:root {
  color-scheme: dark;
  --ink: #080b10;
  --ink-2: #0c1118;
  --ink-3: #121923;
  --panel: rgba(14, 20, 28, 0.92);
  --panel-solid: #101720;
  --paper: #f4f5ed;
  --muted: #89969c;
  --muted-2: #5d6a70;
  --line: rgba(222, 234, 226, 0.11);
  --line-strong: rgba(222, 234, 226, 0.22);
  --acid: #ccff46;
  --acid-dark: #8dab24;
  --coral: #ff6f58;
  --red: #ef4f48;
  --amber: #f5bd55;
  --cyan: #5dd6df;
  --display: "Barlow Condensed", Impact, sans-serif;
  --body: "DM Sans", system-ui, sans-serif;
  --topbar: 58px;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-right: env(safe-area-inset-right, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-left: env(safe-area-inset-left, 0px);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  min-width: 320px;
  height: 100%;
  margin: 0;
  overflow: hidden;
  background: var(--ink);
  color: var(--paper);
  font-family: var(--body);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

button,
input {
  color: inherit;
  font: inherit;
}

button {
  border: 0;
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
}

button:focus-visible,
input:focus-visible {
  outline: 2px solid var(--acid);
  outline-offset: 3px;
}

img {
  display: block;
  max-width: 100%;
}

[hidden] {
  display: none !important;
}

.atmosphere,
.grain {
  position: fixed;
  inset: 0;
  pointer-events: none;
}

.atmosphere {
  z-index: 0;
  overflow: hidden;
  background:
    radial-gradient(circle at 12% 12%, rgba(93, 214, 223, 0.08), transparent 30%),
    radial-gradient(circle at 88% 92%, rgba(204, 255, 70, 0.06), transparent 32%),
    var(--ink);
}

.atmosphere i {
  position: absolute;
  width: 44vw;
  aspect-ratio: 1;
  border: 1px solid rgba(194, 220, 216, 0.04);
  border-radius: 50%;
}

.atmosphere i:nth-child(1) { left: -24vw; top: 10vh; }
.atmosphere i:nth-child(2) { right: -28vw; top: -22vw; width: 60vw; }
.atmosphere i:nth-child(3) { right: 16vw; bottom: -37vw; width: 66vw; }

.grain {
  z-index: 100;
  opacity: 0.035;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 160 160' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.78' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.7'/%3E%3C/svg%3E");
}

.screen-layer {
  position: fixed;
  z-index: 20;
  inset: 0;
}

.eyebrow {
  margin: 0;
  color: var(--acid);
  font: 800 11px/1 var(--display);
  letter-spacing: 0.19em;
}

.brand-sigil {
  display: inline-flex;
  align-items: flex-end;
  gap: 3px;
  width: 24px;
  height: 28px;
  transform: skewX(-9deg);
}

.brand-sigil i {
  display: block;
  width: 5px;
  background: var(--acid);
  box-shadow: 0 0 16px rgba(204, 255, 70, 0.28);
}

.brand-sigil i:nth-child(1) { height: 12px; }
.brand-sigil i:nth-child(2) { height: 20px; }
.brand-sigil i:nth-child(3) { height: 27px; }

.brand-sigil--large {
  width: 52px;
  height: 62px;
  gap: 7px;
}

.brand-sigil--large i { width: 11px; }
.brand-sigil--large i:nth-child(1) { height: 27px; }
.brand-sigil--large i:nth-child(2) { height: 44px; }
.brand-sigil--large i:nth-child(3) { height: 60px; }

.wordmark {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  color: var(--paper);
  font: 800 20px/1 var(--display);
  letter-spacing: 0.025em;
  text-decoration: none;
}

.wordmark b { color: var(--acid); font-weight: 800; }
.wordmark--button { padding: 0; background: transparent; }

.loading-screen {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 15px;
  background: var(--ink);
}

.loading-screen strong {
  margin-top: 6px;
  font: 900 28px/1 var(--display);
  letter-spacing: 0.08em;
}

.loading-screen p {
  margin: 0;
  color: var(--muted);
  font: 700 9px/1 var(--body);
  letter-spacing: 0.22em;
}

.loading-track {
  width: 150px;
  height: 2px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.08);
}

.loading-track i {
  display: block;
  width: 48%;
  height: 100%;
  background: var(--acid);
  animation: loadingSweep 1.2s ease-in-out infinite;
}

@keyframes loadingSweep {
  from { transform: translateX(-110%); }
  to { transform: translateX(220%); }
}

/* Landing */
.landing-screen {
  z-index: 10;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  padding: calc(22px + var(--safe-top)) calc(34px + var(--safe-right)) calc(18px + var(--safe-bottom)) calc(34px + var(--safe-left));
  overflow: hidden;
  background:
    linear-gradient(rgba(8, 11, 16, 0.2), rgba(8, 11, 16, 0.9)),
    repeating-linear-gradient(90deg, transparent 0, transparent calc(8.333% - 1px), rgba(255, 255, 255, 0.018) 8.333%);
}

.landing-nav,
.landing-footer {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.mode-pill {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  min-width: 108px;
  min-height: 44px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.035);
  color: var(--muted);
  font: 700 10px/1 var(--body);
  letter-spacing: 0.1em;
  transition: border-color 160ms, color 160ms, transform 160ms;
}

.mode-pill:hover { border-color: var(--line-strong); color: var(--paper); }
.mode-pill:active { transform: scale(0.97); }
.mode-pill span { color: var(--paper); }
.mode-pill svg { width: 18px; fill: none; stroke: currentColor; stroke-width: 1.6; }

.landing-layout {
  position: relative;
  z-index: 1;
  align-self: center;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(360px, 470px);
  gap: clamp(46px, 8vw, 140px);
  align-items: center;
  width: min(1260px, 100%);
  max-height: 100%;
  margin: 0 auto;
}

.live-kicker {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-bottom: 18px;
  color: var(--muted);
  font: 700 10px/1 var(--body);
  letter-spacing: 0.16em;
}

.live-kicker i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--coral);
  box-shadow: 0 0 0 5px rgba(255, 111, 88, 0.1), 0 0 14px rgba(255, 111, 88, 0.55);
  animation: livePulse 1.8s ease-in-out infinite;
}

@keyframes livePulse { 50% { opacity: 0.42; transform: scale(0.78); } }

.landing-copy h1 {
  max-width: 760px;
  margin: 0;
  font: 900 clamp(66px, 7.2vw, 116px)/0.82 var(--display);
  letter-spacing: -0.045em;
  text-transform: uppercase;
}

.landing-copy h1 em {
  color: transparent;
  font-style: italic;
  -webkit-text-stroke: 1.5px var(--acid);
  text-shadow: 0 0 34px rgba(204, 255, 70, 0.08);
}

.landing-copy > p {
  max-width: 475px;
  margin: 28px 0 24px;
  color: #a4adb0;
  font-size: 16px;
  line-height: 1.6;
}

.landing-proof {
  display: flex;
  align-items: center;
  gap: 12px;
  color: #657178;
  font: 700 9px/1 var(--body);
  letter-spacing: 0.13em;
}

.landing-proof i { width: 3px; height: 3px; border-radius: 50%; background: var(--acid-dark); }

.featured-card {
  position: relative;
  display: grid;
  grid-template-rows: minmax(170px, 0.84fr) auto;
  min-height: min(630px, 72vh);
  overflow: hidden;
  border: 1px solid var(--line-strong);
  border-radius: 3px;
  background: linear-gradient(155deg, rgba(22, 31, 41, 0.94), rgba(12, 17, 24, 0.98));
  box-shadow: 0 40px 100px rgba(0, 0, 0, 0.38);
}

.featured-card::before {
  content: "";
  position: absolute;
  z-index: 2;
  inset: 0;
  pointer-events: none;
  border: 1px solid rgba(255, 255, 255, 0.025);
  box-shadow: inset 0 1px rgba(255, 255, 255, 0.04);
}

.featured-map {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 0;
  overflow: hidden;
  border-bottom: 1px solid var(--line);
  background:
    linear-gradient(rgba(93, 214, 223, 0.055) 1px, transparent 1px),
    linear-gradient(90deg, rgba(93, 214, 223, 0.055) 1px, transparent 1px),
    radial-gradient(circle, rgba(93, 214, 223, 0.10), transparent 62%);
  background-size: 34px 34px, 34px 34px, auto;
}

.featured-map img {
  position: relative;
  z-index: 3;
  width: clamp(98px, 10vw, 140px);
  aspect-ratio: 1.42;
  object-fit: cover;
  border: 5px solid #eef0e7;
  box-shadow: 0 24px 50px rgba(0, 0, 0, 0.4), 0 0 0 1px rgba(0, 0, 0, 0.7);
  transform: rotate(-3deg);
}

.featured-glow {
  position: absolute;
  width: 44%;
  aspect-ratio: 1;
  border-radius: 50%;
  background: rgba(204, 255, 70, 0.08);
  filter: blur(28px);
}

.orbit {
  position: absolute;
  border: 1px solid rgba(93, 214, 223, 0.15);
  border-radius: 50%;
  animation: orbitSpin 22s linear infinite;
}

.orbit::before {
  content: "";
  position: absolute;
  top: 18%;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--cyan);
  box-shadow: 0 0 12px var(--cyan);
}

.orbit-one { width: 56%; aspect-ratio: 1; }
.orbit-two { width: 82%; aspect-ratio: 1; animation-direction: reverse; animation-duration: 31s; }
@keyframes orbitSpin { to { transform: rotate(360deg); } }

.featured-content { padding: clamp(24px, 3.2vw, 38px); }
.featured-content h2 { margin: 8px 0 10px; font: 900 clamp(32px, 3vw, 44px)/0.95 var(--display); letter-spacing: -0.02em; }
.featured-content h2 span { color: var(--acid); }
.featured-content > p:not(.eyebrow) { margin: 0 0 22px; color: var(--muted); font-size: 12px; line-height: 1.55; }

.primary-button {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 52px;
  width: 100%;
  padding: 0 20px;
  overflow: hidden;
  border: 1px solid var(--acid);
  border-radius: 2px;
  background: var(--acid);
  color: #0a0d10;
  font: 900 16px/1 var(--display);
  letter-spacing: 0.055em;
  text-transform: uppercase;
  transition: transform 140ms, background 140ms, box-shadow 140ms;
}

.primary-button::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(105deg, transparent 25%, rgba(255, 255, 255, 0.28), transparent 70%);
  transform: translateX(-120%);
  transition: transform 420ms ease;
}

.primary-button:hover { background: #d9ff6b; box-shadow: 0 10px 36px rgba(204, 255, 70, 0.14); }
.primary-button:hover::before { transform: translateX(120%); }
.primary-button:active { transform: translateY(1px) scale(0.99); }
.primary-button:disabled { opacity: 0.42; filter: grayscale(0.6); }

.primary-button--hero {
  justify-content: space-between;
  min-height: 62px;
  padding: 0 22px;
  font-size: 19px;
}

.primary-button--hero svg,
.command-button svg {
  width: 24px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.quiet-button {
  display: grid;
  place-items: center;
  width: 100%;
  min-height: 46px;
  margin-top: 7px;
  background: transparent;
  color: var(--muted);
  font: 700 10px/1 var(--body);
  letter-spacing: 0.12em;
  transition: color 140ms;
}

.quiet-button:hover { color: var(--paper); }

.profile-line {
  display: flex;
  justify-content: space-between;
  margin-top: 10px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
  color: var(--muted-2);
  font: 700 8px/1 var(--body);
  letter-spacing: 0.11em;
}

.profile-line b { color: var(--paper); }
.landing-footer { color: var(--muted-2); font: 700 8px/1 var(--body); letter-spacing: 0.16em; }
.text-link { min-height: 44px; padding: 0; background: transparent; color: var(--muted); font: 700 9px/1 var(--body); letter-spacing: 0.14em; }
.text-link:hover { color: var(--paper); }

/* Game shell */
.game-shell {
  position: relative;
  z-index: 5;
  display: grid;
  grid-template-rows: calc(var(--topbar) + var(--safe-top)) minmax(0, 1fr);
  width: 100%;
  height: 100dvh;
  background: rgba(8, 11, 16, 0.78);
}

.topbar {
  position: relative;
  z-index: 14;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  min-width: 0;
  padding: var(--safe-top) calc(18px + var(--safe-right)) 0 calc(18px + var(--safe-left));
  border-bottom: 1px solid var(--line);
  background: rgba(8, 11, 16, 0.88);
  backdrop-filter: blur(18px);
}

.war-stats {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
}

.war-stats > span { display: flex; align-items: baseline; gap: 5px; }
.war-stats small { color: var(--muted-2); font: 700 8px/1 var(--body); letter-spacing: 0.12em; }
.war-stats b { font: 800 21px/1 var(--display); }
.war-stats i { width: 1px; height: 17px; background: var(--line); }

.top-actions { display: flex; justify-content: flex-end; align-items: center; gap: 3px; }
.icon-button {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-width: 44px;
  height: 44px;
  padding: 0 10px;
  border-radius: 2px;
  background: transparent;
  color: var(--muted);
  transition: color 140ms, background 140ms;
}

.icon-button:hover { color: var(--paper); background: rgba(255, 255, 255, 0.045); }
.icon-button svg { width: 19px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.icon-button .sound-on-icon { fill: currentColor; stroke: none; display: none; }
.icon-button .sound-off-icon { display: block; }
.icon-button.is-on { color: var(--acid); }
.icon-button.is-on .sound-on-icon { display: block; }
.icon-button.is-on .sound-off-icon { display: none; }
.desktop-label { font: 700 8px/1 var(--body); letter-spacing: 0.12em; }

.sound-control { display: contents; }
.sound-panel {
  position: fixed;
  display: none;
  inset: calc(var(--safe-top) + var(--topbar) + 7px) calc(var(--safe-right) + 9px) auto auto;
  width: min(230px, calc(100vw - var(--safe-left) - var(--safe-right) - 18px));
  margin: 0;
  padding: 13px;
  border: 1px solid var(--line-strong);
  border-radius: 5px;
  background: rgba(10, 15, 21, 0.97);
  color: var(--paper);
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.48), inset 0 1px rgba(255, 255, 255, 0.04);
  backdrop-filter: blur(18px);
}
.sound-panel:popover-open { display: block; }
.sound-panel.is-open { display: block; }
.sound-panel::backdrop { background: transparent; }
.sound-panel__heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 24px;
  color: var(--muted);
  font: 800 9px/1 var(--body);
  letter-spacing: 0.13em;
}
.sound-panel__heading output { color: var(--acid); font: 800 17px/1 var(--display); letter-spacing: 0; }
.volume-row {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr) 18px;
  align-items: center;
  gap: 8px;
  min-height: 48px;
}
.volume-row svg { width: 17px; fill: none; stroke: var(--muted); stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.volume-row input { width: 100%; height: 44px; margin: 0; accent-color: var(--acid); cursor: pointer; }
.sound-mute {
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.035);
  color: var(--paper);
  font: 800 9px/1 var(--body);
  letter-spacing: 0.12em;
}
.sound-mute:hover { border-color: rgba(204, 255, 70, 0.42); color: var(--acid); }

.game-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(390px, 430px);
  min-width: 0;
  min-height: 0;
  padding: 10px;
  gap: 10px;
}

.map-stage {
  position: relative;
  display: grid;
  grid-template-rows: 40px minmax(0, 1fr) 38px;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 3px;
  background: #09111a;
  box-shadow: inset 0 1px rgba(255, 255, 255, 0.025);
}

.map-chrome {
  position: relative;
  z-index: 4;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 14px;
  color: var(--muted-2);
  font: 700 8px/1 var(--body);
  letter-spacing: 0.12em;
}

.map-chrome--top { border-bottom: 1px solid var(--line); }
.map-chrome--bottom { border-top: 1px solid var(--line); }
.map-chrome > div { display: flex; align-items: center; gap: 8px; }
.map-chrome button { min-height: 32px; padding: 0 4px; background: transparent; color: var(--muted); font: inherit; letter-spacing: inherit; }
.map-chrome button:hover { color: var(--paper); }
.map-status-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--acid); box-shadow: 0 0 9px rgba(204, 255, 70, 0.65); }

.map-wrap {
  position: relative;
  min-height: 0;
  overflow: hidden;
  isolation: isolate;
  touch-action: none;
  overscroll-behavior: contain;
  user-select: none;
  background:
    radial-gradient(ellipse at center, rgba(25, 54, 68, 0.38), transparent 64%),
    repeating-linear-gradient(0deg, transparent 0, transparent 29px, rgba(93, 214, 223, 0.035) 30px),
    repeating-linear-gradient(90deg, transparent 0, transparent 39px, rgba(93, 214, 223, 0.035) 40px),
    #08111a;
}

.map-viewport {
  position: absolute;
  z-index: 1;
  top: 0;
  left: 0;
  width: 100%;
  aspect-ratio: 8 / 3;
  transform-origin: 0 0;
  will-change: transform;
}

.map-viewport canvas,
.map-labels {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

#worldMap { z-index: 1; cursor: grab; image-rendering: pixelated; filter: saturate(0.9) contrast(1.06); }
#worldMap:focus-visible { outline: 2px solid var(--acid); outline-offset: -2px; }
.map-wrap.is-dragging #worldMap { cursor: grabbing; }
#threatMap { z-index: 2; pointer-events: none; }
.map-labels { z-index: 3; overflow: visible; pointer-events: none; }
.map-country-label {
  position: absolute;
  display: flex;
  align-items: center;
  gap: 4px;
  max-width: 150px;
  min-height: 20px;
  padding: 3px 6px 2px;
  opacity: 0;
  border: 1px solid rgba(228, 236, 231, 0.26);
  border-radius: 2px;
  background: rgba(5, 9, 13, 0.86);
  color: rgba(244, 245, 237, 0.92);
  box-shadow: 0 2px 9px rgba(0, 0, 0, 0.58);
  font: 800 10px/1 var(--display);
  letter-spacing: 0.035em;
  white-space: nowrap;
  isolation: isolate;
  transform: translate(-50%, -50%) scale(var(--label-scale, 1));
  transform-origin: center;
  transition: opacity 120ms, border-color 120ms, color 120ms;
}
.map-country-label.is-visible { opacity: 1; }
.map-country-label.is-player { border-color: rgba(204, 255, 70, 0.82); color: var(--acid); }
.map-country-label.is-selected { border-color: rgba(255, 111, 88, 0.9); color: #ff9786; }
.map-country-label.is-focused:not(.is-player):not(.is-selected) { border-color: rgba(93, 214, 223, 0.82); color: #a9f7fb; }
.map-country-label.is-threat { border-color: rgba(239, 79, 72, 0.72); }
.map-country-label small { color: inherit; font: 800 7px/1 var(--body); letter-spacing: 0.12em; }
.map-country-label.is-shifted::before {
  content: "";
  position: absolute;
  z-index: -1;
  top: 50%;
  left: 50%;
  width: var(--leader-length);
  height: 1px;
  opacity: 0.45;
  background: currentColor;
  transform: rotate(var(--leader-angle));
  transform-origin: 0 50%;
}
.map-country-label.is-shifted::after {
  content: "";
  position: absolute;
  z-index: -1;
  top: calc(50% + var(--leader-end-y));
  left: calc(50% + var(--leader-end-x));
  width: 4px;
  height: 4px;
  border: 1px solid currentColor;
  border-radius: 50%;
  background: #071016;
  transform: translate(-50%, -50%);
}

.map-controls {
  position: absolute;
  z-index: 7;
  right: 9px;
  bottom: 9px;
  display: flex;
  align-items: center;
  overflow: visible;
  border: 1px solid var(--line-strong);
  border-radius: 3px;
  background: rgba(7, 12, 17, 0.9);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.38);
  backdrop-filter: blur(10px);
}
.map-controls button {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border-right: 1px solid var(--line);
  background: transparent;
  color: var(--paper);
  font: 800 19px/1 var(--display);
}
.map-controls output {
  position: absolute;
  bottom: calc(100% + 5px);
  left: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 22px;
  border: 1px solid var(--line-strong);
  border-radius: 2px;
  background: rgba(7, 12, 17, 0.92);
  color: var(--acid);
  font: 800 11px/1 var(--display);
  pointer-events: none;
}
.map-controls button:hover { background: rgba(255, 255, 255, 0.06); color: var(--acid); }
.map-controls button:disabled { opacity: 0.32; background: transparent; color: var(--muted); }
.map-controls .map-reset { border-right: 0; }
.map-reset svg { width: 17px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

.map-vignette,
.map-scan {
  position: absolute;
  z-index: 3;
  inset: 0;
  pointer-events: none;
}

.map-vignette { box-shadow: inset 0 0 90px rgba(0, 0, 0, 0.58); }
.map-scan {
  opacity: 0.16;
  background: repeating-linear-gradient(0deg, transparent 0, transparent 3px, rgba(255, 255, 255, 0.03) 4px);
}

.map-tooltip {
  position: absolute;
  z-index: 8;
  max-width: 180px;
  padding: 8px 10px;
  opacity: 0;
  pointer-events: none;
  border: 1px solid var(--line-strong);
  background: rgba(7, 11, 16, 0.94);
  color: var(--paper);
  font: 700 9px/1 var(--body);
  letter-spacing: 0.08em;
  transform: translate(12px, -50%);
  transition: opacity 100ms;
}

.map-tooltip.is-visible { opacity: 1; }

.battle-flash {
  position: absolute;
  z-index: 9;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 8px;
  opacity: 0;
  pointer-events: none;
  background: radial-gradient(circle, rgba(5, 10, 14, 0.55), rgba(5, 10, 14, 0.08) 50%, transparent 74%);
  transform: scale(1.04);
}

.battle-flash small { color: var(--muted); font: 700 9px/1 var(--body); letter-spacing: 0.24em; }
.battle-flash strong { font: 900 clamp(34px, 5.2vw, 78px)/0.9 var(--display); letter-spacing: -0.025em; text-align: center; text-shadow: 0 8px 30px rgba(0, 0, 0, 0.7); }
.battle-flash.win strong,
.battle-flash.start strong,
.battle-flash.guard strong { color: var(--acid); }
.battle-flash.loss strong { color: var(--coral); }
.battle-flash.show { animation: battleFlash 900ms cubic-bezier(0.2, 0.8, 0.2, 1) both; }
@keyframes battleFlash { 0% { opacity: 0; transform: scale(1.1); } 16%, 72% { opacity: 1; transform: scale(1); } 100% { opacity: 0; transform: scale(0.98); } }

.command-panel {
  display: grid;
  grid-template-rows: auto auto auto minmax(0, 1fr);
  gap: 8px;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
}

.player-strip,
.forecast-section,
.targets-section,
.order-card {
  border: 1px solid var(--line);
  border-radius: 3px;
  background: var(--panel);
  box-shadow: inset 0 1px rgba(255, 255, 255, 0.025);
}

.player-strip {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(78px, 0.8fr) minmax(82px, 0.78fr) 40px;
  align-items: center;
  min-height: 72px;
  padding: 9px 10px;
}

.player-identity { display: flex; align-items: center; gap: 9px; min-width: 0; }
.player-identity > span:last-child { min-width: 0; }
.player-identity small,
.player-stat small { display: block; margin-bottom: 4px; color: var(--muted-2); font: 700 7px/1 var(--body); letter-spacing: 0.12em; }
.player-identity strong { display: block; overflow: hidden; font: 800 18px/1 var(--display); text-overflow: ellipsis; white-space: nowrap; }

.flag-frame {
  flex: 0 0 auto;
  display: block;
  width: 44px;
  aspect-ratio: 1;
  padding: 3px;
  overflow: hidden;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  background: #e9ebdf;
}

.flag-frame img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; }
.flag-frame--small { width: 37px; }

.player-stat { min-width: 0; padding-left: 10px; border-left: 1px solid var(--line); }
.player-stat strong { display: block; font: 800 18px/1 var(--display); }
.player-stat > span:not(.army-meter) { display: block; margin-top: 4px; overflow: hidden; color: var(--acid); font: 700 6px/1 var(--body); letter-spacing: 0.06em; text-overflow: ellipsis; white-space: nowrap; }
.army-meter { display: block; width: 90%; height: 2px; margin-top: 6px; overflow: hidden; background: rgba(255, 255, 255, 0.08); }
.army-meter i { display: block; width: 50%; height: 100%; background: var(--acid); box-shadow: 0 0 9px var(--acid); transition: width 300ms ease; }
.rank-chip { display: grid; place-items: center; width: 34px; height: 34px; border: 1px solid rgba(204, 255, 70, 0.28); border-radius: 50%; color: var(--acid); font: 800 13px/1 var(--display); }

.forecast-section,
.targets-section { padding: 9px 10px 10px; overflow: hidden; }
.section-heading { display: flex; align-items: center; justify-content: space-between; min-height: 16px; margin-bottom: 7px; }
.section-heading > div { display: flex; align-items: center; gap: 7px; }
.section-heading span { color: #bcc5c3; font: 700 8px/1 var(--body); letter-spacing: 0.13em; }
.section-heading small { color: var(--muted-2); font: 700 6px/1 var(--body); letter-spacing: 0.1em; }
#threatPulse { width: 5px; height: 5px; border-radius: 50%; background: #526065; }
#threatPulse.is-live { background: var(--red); box-shadow: 0 0 10px var(--red); animation: livePulse 1.5s infinite; }

.threat-list,
.target-rail {
  display: flex;
  gap: 7px;
  min-width: 0;
  overflow-x: auto;
  overscroll-behavior-inline: contain;
  scroll-snap-type: x proximity;
  scrollbar-width: none;
}

.threat-list::-webkit-scrollbar,
.target-rail::-webkit-scrollbar { display: none; }

.no-threat {
  display: flex;
  align-items: center;
  gap: 9px;
  width: 100%;
  min-height: 47px;
  padding: 0 10px;
  border: 1px solid rgba(204, 255, 70, 0.10);
  background: rgba(204, 255, 70, 0.025);
}

.no-threat > span { display: grid; place-items: center; width: 24px; height: 24px; border: 1px solid rgba(204, 255, 70, 0.25); border-radius: 50%; color: var(--acid); font-size: 11px; }
.no-threat strong,
.no-threat small { display: block; }
.no-threat strong { color: #c6d3c5; font: 800 10px/1 var(--display); letter-spacing: 0.06em; }
.no-threat small { margin-top: 3px; color: var(--muted-2); font-size: 7px; }

.threat-card {
  flex: 0 0 176px;
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) auto;
  align-items: center;
  min-height: 49px;
  padding: 6px 8px;
  scroll-snap-align: start;
  border: 1px solid rgba(239, 79, 72, 0.24);
  border-radius: 2px;
  background: linear-gradient(100deg, rgba(239, 79, 72, 0.09), rgba(239, 79, 72, 0.025));
  text-align: left;
  transition: border-color 140ms, background 140ms, transform 140ms;
}

.threat-card:hover,
.threat-card.is-selected { border-color: var(--coral); background: rgba(239, 79, 72, 0.13); }
.threat-card:active { transform: scale(0.98); }
.threat-flag { width: 27px; height: 27px; overflow: hidden; border: 1px solid rgba(255, 255, 255, 0.26); border-radius: 50%; }
.threat-flag img { width: 100%; height: 100%; object-fit: cover; }
.threat-card strong,
.threat-card small { display: block; }
.threat-card > span:nth-child(2) { min-width: 0; }
.threat-card > span:nth-child(2) strong { overflow: hidden; font: 800 11px/1 var(--display); text-overflow: ellipsis; white-space: nowrap; }
.threat-card > span:nth-child(2) small { margin-top: 4px; color: var(--coral); font: 700 6px/1 var(--body); letter-spacing: 0.08em; }
.threat-card > b { color: var(--coral); font: 800 15px/0.85 var(--display); text-align: right; }
.threat-card > b small { margin-top: 4px; color: #9b5c57; font: 700 5px/1 var(--body); letter-spacing: 0.08em; }

.target-card {
  flex: 0 0 138px;
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr) auto;
  align-items: center;
  min-height: 52px;
  padding: 6px 7px;
  scroll-snap-align: start;
  border: 1px solid var(--line);
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.024);
  text-align: left;
  transition: border-color 140ms, background 140ms, transform 140ms;
}

.target-card:hover { border-color: var(--line-strong); background: rgba(255, 255, 255, 0.045); }
.target-card.is-selected { border-color: var(--acid); background: rgba(204, 255, 70, 0.07); box-shadow: inset 0 0 20px rgba(204, 255, 70, 0.025); }
.target-card.is-threat:not(.is-selected) { border-color: rgba(239, 79, 72, 0.25); }
.target-card:active { transform: scale(0.98); }
.target-flag { width: 25px; height: 25px; overflow: hidden; border-radius: 50%; border: 1px solid var(--line-strong); }
.target-flag img { width: 100%; height: 100%; object-fit: cover; }
.target-copy { min-width: 0; }
.target-copy strong,
.target-copy small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.target-copy strong { font: 800 11px/1 var(--display); }
.target-copy small { margin-top: 4px; color: var(--muted-2); font: 700 6px/1 var(--body); letter-spacing: 0.06em; }
.target-card.is-threat .target-copy small { color: var(--coral); }
.target-card > b { color: var(--muted); font: 800 13px/1 var(--display); }
.target-card.is-selected > b { color: var(--acid); }

.order-card {
  position: relative;
  min-height: 0;
  overflow: hidden;
  transition: opacity 180ms;
}

.order-card.is-locked { opacity: 0.76; }
.order-prompt { display: flex; align-items: center; justify-content: center; gap: 16px; height: 100%; min-height: 220px; padding: 24px; }
.order-prompt strong { display: block; font: 800 19px/1 var(--display); letter-spacing: 0.04em; }
.order-prompt p { margin: 6px 0 0; color: var(--muted); font-size: 10px; }
.prompt-reticle { position: relative; display: grid; place-items: center; width: 48px; height: 48px; border: 1px solid rgba(204, 255, 70, 0.35); border-radius: 50%; }
.prompt-reticle::before,
.prompt-reticle::after { content: ""; position: absolute; background: var(--acid); opacity: 0.55; }
.prompt-reticle::before { width: 62px; height: 1px; }
.prompt-reticle::after { width: 1px; height: 62px; }
.prompt-reticle i { width: 5px; height: 5px; border-radius: 50%; background: var(--acid); box-shadow: 0 0 13px var(--acid); }

.order-planner {
  display: flex;
  flex-direction: column;
  min-height: 100%;
  padding: 10px;
}

.order-target {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) auto;
  align-items: center;
  gap: 9px;
  min-height: 43px;
  margin-bottom: 8px;
}

.order-target > span:nth-child(2) { min-width: 0; }
.order-target strong,
.order-target small { display: block; }
.order-target > span:nth-child(2) strong { overflow: hidden; font: 800 18px/1 var(--display); text-overflow: ellipsis; white-space: nowrap; }
.order-target > span:nth-child(2) small { margin-bottom: 4px; color: var(--muted-2); font: 700 6px/1 var(--body); letter-spacing: 0.09em; }
.order-target > span:nth-child(2) small.is-danger { color: var(--coral); }
.target-force { padding-left: 12px; border-left: 1px solid var(--line); text-align: right; }
.target-force small { color: var(--muted-2); font: 700 6px/1 var(--body); letter-spacing: 0.1em; }
.target-force b { display: block; margin-top: 4px; font: 800 16px/1 var(--display); }

.action-tabs {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 5px;
  margin-bottom: 8px;
}

.action-tabs button {
  min-height: 48px;
  padding: 7px 4px;
  border: 1px solid var(--line);
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.02);
  color: var(--muted);
  transition: color 140ms, border-color 140ms, background 140ms, transform 140ms;
}

.action-tabs button:hover:not(:disabled) { color: var(--paper); border-color: var(--line-strong); }
.action-tabs button:active:not(:disabled) { transform: scale(0.98); }
.action-tabs button.is-selected { color: var(--paper); border-color: rgba(204, 255, 70, 0.5); background: rgba(204, 255, 70, 0.07); }
.action-tabs button:disabled { opacity: 0.28; }
.action-tabs span,
.action-tabs small { display: block; }
.action-tabs span { font: 800 13px/1 var(--display); letter-spacing: 0.05em; }
.action-tabs small { margin-top: 4px; color: var(--muted-2); font: 700 6px/1 var(--body); letter-spacing: 0.1em; }
.action-tabs button.is-selected small { color: var(--acid-dark); }

.commitment-control { margin-bottom: 8px; }
.commitment-heading { display: flex; align-items: center; justify-content: space-between; min-height: 16px; margin-bottom: 5px; }
.commitment-heading span { color: var(--muted); font: 700 7px/1 var(--body); letter-spacing: 0.12em; }
.commitment-heading small { max-width: 65%; overflow: hidden; color: var(--muted-2); font: 700 6px/1 var(--body); letter-spacing: 0.06em; text-overflow: ellipsis; white-space: nowrap; }
.commitment-options { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; padding: 3px; border: 1px solid var(--line); background: rgba(0, 0, 0, 0.14); }
.commitment-options button { min-height: 35px; background: transparent; color: var(--muted); font: 800 12px/1 var(--display); transition: color 140ms, background 140ms; }
.commitment-options button:hover { color: var(--paper); }
.commitment-options button.is-selected { background: var(--paper); color: var(--ink); }

.order-readout {
  display: grid;
  grid-template-columns: 76px minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  min-height: 72px;
  margin-top: auto;
  margin-bottom: 8px;
  padding: 7px 10px 7px 7px;
  border: 1px solid var(--line);
  background: rgba(0, 0, 0, 0.12);
}

.odds-gauge {
  --gauge-color: var(--cyan);
  position: relative;
  display: grid;
  place-items: center;
  width: 62px;
  height: 62px;
  border-radius: 50%;
  background: conic-gradient(var(--gauge-color) calc(var(--odds) * 1%), rgba(255, 255, 255, 0.075) 0);
}

.odds-gauge::before { content: ""; position: absolute; inset: 4px; border-radius: 50%; background: var(--panel-solid); }
.odds-gauge > span { position: relative; z-index: 1; text-align: center; }
.odds-gauge b,
.odds-gauge small { display: block; }
.odds-gauge b { font: 900 19px/1 var(--display); }
.odds-gauge small { margin-top: 3px; color: var(--muted-2); font: 700 5px/1 var(--body); letter-spacing: 0.07em; }
.odds-gauge.is-risky { --gauge-color: var(--coral); }
.odds-gauge.is-strong { --gauge-color: var(--acid); }

.risk-readout { min-width: 0; }
.risk-readout > span { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.risk-readout small { color: var(--muted-2); font: 700 7px/1 var(--body); letter-spacing: 0.1em; }
.risk-readout b { overflow: hidden; color: var(--paper); font: 800 18px/1 var(--display); text-overflow: ellipsis; white-space: nowrap; }
.risk-readout p { margin: 7px 0 0; color: var(--muted); font-size: 8px; line-height: 1.45; }

.command-button {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 24px;
  grid-template-rows: auto auto;
  justify-items: start;
  min-height: 58px;
  padding: 10px 14px;
  text-align: left;
}

.command-button > span { font: 900 16px/1 var(--display); }
.command-button > small { grid-column: 1; margin-top: 5px; font: 700 7px/1 var(--body); letter-spacing: 0.04em; opacity: 0.66; }
.command-button > svg { grid-column: 2; grid-row: 1 / 3; align-self: center; }

/* Result */
.end-screen {
  z-index: 30;
  display: grid;
  place-items: center;
  padding: calc(20px + var(--safe-top)) calc(16px + var(--safe-right)) calc(20px + var(--safe-bottom)) calc(16px + var(--safe-left));
  overflow-y: auto;
  background: rgba(5, 8, 12, 0.88);
  backdrop-filter: blur(18px);
}

.end-card {
  position: relative;
  width: min(410px, 100%);
  padding: 34px;
  overflow: hidden;
  border: 1px solid var(--line-strong);
  background: linear-gradient(160deg, #151d27, #0c1118 70%);
  box-shadow: 0 34px 100px rgba(0, 0, 0, 0.5);
  text-align: center;
  animation: endRise 440ms cubic-bezier(0.18, 0.82, 0.2, 1) both;
}

@keyframes endRise { from { opacity: 0; transform: translateY(18px) scale(0.98); } }
.end-orbit { position: absolute; inset: -80px; pointer-events: none; opacity: 0.35; }
.end-orbit i { position: absolute; inset: 10%; border: 1px solid rgba(93, 214, 223, 0.12); border-radius: 50%; animation: orbitSpin 28s linear infinite; }
.end-orbit i + i { inset: 24%; animation-direction: reverse; animation-duration: 19s; }
.end-flag { position: relative; z-index: 1; display: block; width: 88px; aspect-ratio: 1; margin: 20px auto 14px; padding: 5px; overflow: hidden; border: 1px solid var(--line-strong); border-radius: 50%; background: #eef0e7; box-shadow: 0 18px 45px rgba(0, 0, 0, 0.36); }
.end-flag img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; }
.end-card h2 { position: relative; z-index: 1; margin: 0; color: var(--coral); font: 900 48px/0.92 var(--display); letter-spacing: -0.025em; }
.end-card.is-winner h2 { color: var(--acid); }
.end-card > p:not(.eyebrow) { position: relative; z-index: 1; min-height: 38px; margin: 12px auto 20px; color: var(--muted); font-size: 11px; line-height: 1.55; }
.end-stats { position: relative; z-index: 1; display: grid; grid-template-columns: repeat(3, 1fr); margin-bottom: 18px; border: 1px solid var(--line); }
.end-stats > div { padding: 13px 5px; }
.end-stats > div + div { border-left: 1px solid var(--line); }
.end-stats b,
.end-stats span { display: block; }
.end-stats b { font: 800 26px/1 var(--display); }
.end-stats span { margin-top: 4px; color: var(--muted-2); font: 700 6px/1 var(--body); letter-spacing: 0.1em; }
.passport-progress { position: relative; z-index: 1; margin-bottom: 18px; color: var(--muted); font: 700 7px/1 var(--body); letter-spacing: 0.1em; text-align: left; }
.passport-progress > span { display: block; margin-bottom: 7px; }
.passport-progress b { color: var(--paper); }
.passport-progress > i { display: block; width: 100%; height: 3px; overflow: hidden; background: rgba(255, 255, 255, 0.07); }
.passport-progress > i b { display: block; width: 0; height: 100%; background: var(--acid); transition: width 600ms ease; }
.end-card .primary-button { position: relative; z-index: 1; margin-top: 7px; }
.primary-button--share { border-color: var(--line-strong); background: transparent; color: var(--paper); }
.primary-button--share:hover { background: rgba(255, 255, 255, 0.055); box-shadow: none; }
.primary-button--share svg { width: 18px; margin-right: 9px; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.7; }
.end-card .quiet-button { position: relative; z-index: 1; }

/* Dialogs */
.sheet-dialog {
  width: min(720px, calc(100% - 28px));
  max-width: none;
  max-height: min(88dvh, 820px);
  margin: auto;
  padding: 0;
  overflow: visible;
  border: 0;
  border-radius: 3px;
  background: transparent;
  color: var(--paper);
}

.sheet-dialog::backdrop { background: rgba(4, 7, 10, 0.76); backdrop-filter: blur(12px); }
.dialog-shell { max-height: min(88dvh, 820px); padding: 26px; overflow-y: auto; border: 1px solid var(--line-strong); border-radius: 3px; background: linear-gradient(160deg, #141c26, #0d131b 70%); box-shadow: 0 35px 100px rgba(0, 0, 0, 0.52); scrollbar-color: var(--line-strong) transparent; }
.dialog-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; margin-bottom: 20px; }
.dialog-header h2,
.doctrine-shell h2 { margin: 6px 0 0; font: 900 34px/0.95 var(--display); letter-spacing: -0.015em; }
.dialog-close { display: grid; place-items: center; flex: 0 0 auto; width: 44px; height: 44px; border: 1px solid var(--line); border-radius: 50%; background: transparent; color: var(--muted); font: 300 26px/1 var(--body); transition: color 140ms, border-color 140ms, transform 140ms; }
.dialog-close:hover { color: var(--paper); border-color: var(--line-strong); }
.dialog-close:active { transform: scale(0.95); }

.country-dialog { width: min(900px, calc(100% - 28px)); }
.country-search { display: flex; align-items: center; min-height: 48px; margin-bottom: 13px; padding: 0 15px; border: 1px solid var(--line); background: rgba(0, 0, 0, 0.16); }
.country-search svg { flex: 0 0 auto; width: 18px; margin-right: 10px; fill: none; stroke: var(--muted); stroke-linecap: round; stroke-width: 1.6; }
.country-search input { width: 100%; height: 46px; border: 0; outline: 0; background: transparent; font-size: 14px; }
.country-search input::placeholder { color: var(--muted-2); }
.country-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; max-height: min(58dvh, 520px); overflow-y: auto; padding-right: 3px; }
.country-option { position: relative; display: grid; grid-template-columns: 38px minmax(0, 1fr); align-items: center; gap: 10px; min-height: 62px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 2px; background: rgba(255, 255, 255, 0.02); text-align: left; transition: border-color 140ms, background 140ms, transform 140ms; }
.country-option:hover { border-color: var(--acid); background: rgba(204, 255, 70, 0.055); }
.country-option:active { transform: scale(0.98); }
.country-flag { width: 36px; height: 36px; padding: 2px; overflow: hidden; border: 1px solid var(--line-strong); border-radius: 50%; background: #e9ebe0; }
.country-flag img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; }
.country-option > span:nth-child(2) { min-width: 0; }
.country-option strong,
.country-option small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.country-option strong { font: 800 14px/1 var(--display); }
.country-option small { margin-top: 5px; color: var(--muted-2); font: 700 6px/1 var(--body); letter-spacing: 0.06em; }
.crowned-badge { position: absolute; top: 4px; right: 5px; color: var(--acid); font-size: 10px; }

.doctrine-dialog { width: min(700px, calc(100% - 28px)); }
.doctrine-shell { padding: 34px; text-align: center; }
.doctrine-shell > p:not(.eyebrow) { margin: 10px 0 24px; color: var(--muted); font-size: 11px; }
.doctrine-options { display: grid; grid-template-columns: repeat(3, 1fr); gap: 9px; }
.doctrine-options button { min-height: 190px; padding: 22px 14px; border: 1px solid var(--line); background: rgba(255, 255, 255, 0.025); transition: border-color 160ms, background 160ms, transform 160ms; }
.doctrine-options button:hover { border-color: var(--acid); background: rgba(204, 255, 70, 0.06); transform: translateY(-3px); }
.doctrine-options button > span { display: grid; place-items: center; width: 54px; height: 54px; margin: 0 auto 18px; border: 1px solid rgba(204, 255, 70, 0.25); border-radius: 50%; color: var(--acid); }
.doctrine-options svg { width: 26px; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.5; }
.doctrine-options strong,
.doctrine-options small { display: block; }
.doctrine-options strong { font: 800 18px/1 var(--display); }
.doctrine-options small { margin-top: 8px; color: var(--muted); font-size: 9px; line-height: 1.4; }

.intel-dialog { width: min(760px, calc(100% - 28px)); }
.intel-grid { display: grid; grid-template-columns: 0.9fr 1.1fr; gap: 14px; }
.intel-grid > section { min-width: 0; padding: 12px; border: 1px solid var(--line); background: rgba(0, 0, 0, 0.1); }
.power-list { display: grid; gap: 2px; }
.power-row { display: grid; grid-template-columns: 18px 28px minmax(0, 1fr) auto; align-items: center; gap: 7px; min-height: 38px; padding: 4px 5px; border-bottom: 1px solid rgba(255, 255, 255, 0.04); }
.power-row.is-player { background: rgba(204, 255, 70, 0.06); }
.power-row > b { color: var(--muted-2); font: 800 11px/1 var(--display); }
.power-row img { width: 24px; height: 24px; border-radius: 50%; object-fit: cover; }
.power-row span { min-width: 0; }
.power-row strong,
.power-row small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.power-row strong { font: 800 11px/1 var(--display); }
.power-row small { margin-top: 3px; color: var(--muted-2); font: 700 6px/1 var(--body); letter-spacing: 0.06em; }
.power-row em { color: var(--muted); font: normal 800 11px/1 var(--display); }
.feed-list { max-height: 410px; margin: 0; padding: 0; overflow-y: auto; list-style: none; }
.feed-list li { position: relative; padding: 9px 5px 9px 14px; border-bottom: 1px solid rgba(255, 255, 255, 0.04); color: #a0aaad; font-size: 9px; line-height: 1.45; }
.feed-list li::before { content: ""; position: absolute; top: 13px; left: 2px; width: 4px; height: 4px; border-radius: 50%; background: var(--muted-2); }
.feed-list li.player::before { background: var(--acid); box-shadow: 0 0 8px rgba(204, 255, 70, 0.4); }
.feed-list li.major { color: var(--paper); }
.feed-list li.major::before { background: var(--coral); }
.feed-list li > span { display: block; margin-bottom: 3px; color: var(--muted-2); font: 700 6px/1 var(--body); letter-spacing: 0.1em; }

.settings-dialog { width: min(500px, calc(100% - 28px)); }
.difficulty-options { display: grid; grid-template-columns: repeat(2, 1fr); gap: 6px; }
.difficulty-options button { min-height: 64px; padding: 10px; border: 1px solid var(--line); background: rgba(255, 255, 255, 0.02); text-align: left; transition: border-color 140ms, background 140ms; }
.difficulty-options button:hover { border-color: var(--line-strong); }
.difficulty-options button.is-selected { border-color: var(--acid); background: rgba(204, 255, 70, 0.06); }
.difficulty-options span,
.difficulty-options small { display: block; }
.difficulty-options span { font: 800 16px/1 var(--display); }
.difficulty-options small { margin-top: 6px; color: var(--muted-2); font: 700 6px/1 var(--body); letter-spacing: 0.09em; }
.difficulty-options button.is-selected small { color: var(--acid-dark); }
.difficulty-copy { min-height: 36px; margin: 10px 0 16px; padding: 11px; border: 1px solid var(--line); color: var(--muted); font-size: 9px; text-align: center; }
.menu-row { display: flex; align-items: center; justify-content: space-between; width: 100%; min-height: 50px; padding: 0 12px; border-top: 1px solid var(--line); background: transparent; color: var(--muted); font: 700 9px/1 var(--body); letter-spacing: 0.1em; transition: color 140ms, background 140ms; }
.menu-row:hover { color: var(--paper); background: rgba(255, 255, 255, 0.025); }
.menu-row--danger:hover { color: var(--coral); }
.settings-note { display: block; margin-top: 14px; color: var(--muted-2); font-size: 8px; line-height: 1.5; text-align: center; }

.rules-dialog { width: min(650px, calc(100% - 28px)); }
.rules-list { display: grid; gap: 5px; }
.rules-list article { display: grid; grid-template-columns: 42px minmax(0, 1fr); gap: 11px; padding: 12px; border: 1px solid var(--line); background: rgba(255, 255, 255, 0.018); }
.rules-list article > b { color: var(--acid); font: 800 20px/1 var(--display); }
.rules-list strong { display: block; font: 800 13px/1 var(--display); letter-spacing: 0.04em; }
.rules-list p { margin: 5px 0 0; color: var(--muted); font-size: 9px; line-height: 1.45; }
.dialog-done { margin-top: 12px; }

.toast {
  position: fixed;
  z-index: 80;
  left: 50%;
  bottom: calc(20px + var(--safe-bottom));
  max-width: calc(100% - 32px);
  padding: 11px 15px;
  opacity: 0;
  pointer-events: none;
  border: 1px solid var(--line-strong);
  background: rgba(17, 24, 32, 0.96);
  color: var(--paper);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.4);
  font-size: 10px;
  text-align: center;
  transform: translate(-50%, 10px);
  transition: opacity 160ms, transform 160ms;
}

.toast.show { opacity: 1; transform: translate(-50%, 0); }

@media (max-width: 1050px) {
  .game-layout { grid-template-columns: minmax(0, 1fr) 390px; }
  .landing-layout { gap: 44px; }
  .landing-copy h1 { font-size: clamp(60px, 7vw, 82px); }
}

@media (max-width: 800px) {
  :root { --topbar: 52px; }
  .desktop-label { display: none; }
  .wordmark { font-size: 17px; }
  .wordmark .brand-sigil { transform: scale(0.84) skewX(-9deg); transform-origin: left center; margin-right: -4px; }
  .topbar { padding-right: calc(7px + var(--safe-right)); padding-left: calc(10px + var(--safe-left)); }
  .top-actions { gap: 0; }
  .game-layout { grid-template-columns: 1fr; grid-template-rows: clamp(205px, 28dvh, 255px) minmax(0, 1fr); padding: 0; gap: 0; }
  .map-stage { grid-template-rows: 32px minmax(0, 1fr) 28px; border-width: 0 0 1px; border-radius: 0; }
  .map-chrome { padding: 0 10px; font-size: 6px; }
  .map-chrome button { min-height: 28px; font-size: 6px; }
  .map-vignette { box-shadow: inset 0 0 42px rgba(0, 0, 0, 0.48); }
  .map-controls { right: 6px; bottom: 6px; }
  .map-country-label { max-width: 110px; min-height: 18px; padding: 3px 5px 2px; font-size: 9px; }
  .battle-flash strong { font-size: clamp(31px, 11vw, 52px); }
  .command-panel { display: flex; flex-direction: column; gap: 6px; padding: 6px 7px calc(7px + var(--safe-bottom)); overflow-y: auto; overscroll-behavior: contain; scrollbar-width: none; }
  .command-panel::-webkit-scrollbar { display: none; }
  .player-strip { flex: 0 0 auto; min-height: 58px; padding: 6px 8px; grid-template-columns: minmax(0, 1.25fr) minmax(70px, 0.7fr) minmax(70px, 0.7fr) 34px; }
  .flag-frame { width: 38px; }
  .player-identity strong { font-size: 16px; }
  .player-stat { padding-left: 7px; }
  .player-stat strong { font-size: 16px; }
  .rank-chip { width: 30px; height: 30px; }
  .forecast-section,
  .targets-section { flex: 0 0 auto; padding: 6px 7px 7px; }
  .section-heading { min-height: 13px; margin-bottom: 5px; }
  .no-threat { min-height: 43px; }
  .threat-card { min-height: 45px; }
  .target-card { min-height: 47px; }
  .order-card { flex: 0 0 auto; min-height: 230px; overflow: visible; }
  .order-planner { min-height: 228px; padding: 7px; }
  .order-target { min-height: 38px; margin-bottom: 5px; }
  .action-tabs { margin-bottom: 5px; }
  .action-tabs button { min-height: 44px; }
  .commitment-control { margin-bottom: 5px; }
  .order-readout { min-height: 65px; margin-bottom: 5px; }
  .command-button { min-height: 54px; }
  .sheet-dialog { width: 100%; max-height: 92dvh; margin: auto 0 0; border-radius: 14px 14px 0 0; }
  .dialog-shell { max-height: 92dvh; padding: 20px 16px calc(18px + var(--safe-bottom)); border-width: 1px 0 0; border-radius: 14px 14px 0 0; animation: sheetUp 260ms cubic-bezier(0.2, 0.8, 0.2, 1) both; }
  @keyframes sheetUp { from { transform: translateY(28px); opacity: 0; } }
  .country-dialog,
  .doctrine-dialog,
  .intel-dialog,
  .settings-dialog,
  .rules-dialog { width: 100%; }
  .country-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); max-height: 66dvh; }
  .intel-grid { grid-template-columns: 1fr; }
  .intel-grid > section { padding: 9px; }
  .feed-list { max-height: 260px; }
  .doctrine-options { grid-template-columns: 1fr; }
  .doctrine-options button { display: grid; grid-template-columns: 50px minmax(0, 1fr); grid-template-rows: auto auto; align-items: center; min-height: 82px; padding: 10px 13px; text-align: left; }
  .doctrine-options button > span { grid-row: 1 / 3; width: 42px; height: 42px; margin: 0; }
  .doctrine-options strong { align-self: end; }
  .doctrine-options small { align-self: start; margin-top: 4px; }
  .end-card { padding: 28px 22px; }
}

@media (max-width: 640px) {
  .landing-screen { padding: calc(10px + var(--safe-top)) calc(16px + var(--safe-right)) calc(10px + var(--safe-bottom)) calc(16px + var(--safe-left)); overflow-y: auto; }
  .landing-nav { min-height: 48px; }
  .landing-layout { display: flex; align-self: stretch; flex-direction: column; gap: 15px; width: 100%; max-height: none; padding: 14px 0 10px; }
  .live-kicker { margin-bottom: 10px; }
  .landing-copy h1 { font-size: clamp(47px, 14.4vw, 63px); line-height: 0.84; }
  .landing-copy > p { margin: 15px 0 12px; font-size: 12px; line-height: 1.45; }
  .landing-proof { gap: 8px; font-size: 7px; }
  .featured-card { grid-template-columns: 0.72fr 1.28fr; grid-template-rows: auto; width: 100%; min-height: 248px; }
  .featured-map { min-height: 100%; border-right: 1px solid var(--line); border-bottom: 0; }
  .featured-map img { width: clamp(72px, 22vw, 96px); border-width: 4px; }
  .featured-content { display: flex; flex-direction: column; justify-content: center; padding: 17px 14px; }
  .featured-content h2 { margin-top: 6px; font-size: clamp(25px, 8vw, 34px); }
  .featured-content > p:not(.eyebrow) { margin-bottom: 12px; font-size: 9px; }
  .primary-button--hero { min-height: 54px; padding: 0 14px; font-size: 15px; }
  .quiet-button { min-height: 40px; margin-top: 2px; font-size: 8px; }
  .profile-line { margin-top: 4px; padding-top: 10px; font-size: 6px; }
  .landing-footer { min-height: 32px; }
  .war-stats { gap: 8px; }
  .war-stats small { font-size: 6px; }
  .war-stats b { font-size: 18px; }
}

@media (max-width: 380px) {
  .wordmark > span:last-child { font-size: 15px; }
  .topbar .wordmark .brand-sigil { display: none; }
  .player-strip { grid-template-columns: minmax(0, 1.15fr) 68px 67px 30px; }
  .player-identity { gap: 6px; }
  .flag-frame { width: 34px; }
  .player-identity small,
  .player-stat small { font-size: 5px; }
  .player-identity strong,
  .player-stat strong { font-size: 14px; }
  .player-stat > span:not(.army-meter) { font-size: 5px; }
  .target-card { flex-basis: 125px; }
  .order-planner { padding: 6px; }
  .order-target > span:nth-child(2) strong { font-size: 16px; }
  .action-tabs span { font-size: 12px; }
  .order-readout { grid-template-columns: 66px minmax(0, 1fr); gap: 8px; }
  .odds-gauge { width: 56px; height: 56px; }
  .risk-readout p { font-size: 7px; }
  .country-option { min-height: 56px; padding: 6px; gap: 7px; }
  .country-flag { width: 31px; height: 31px; }
  .country-option strong { font-size: 12px; }
}

@media (max-height: 680px) and (max-width: 800px) {
  .game-layout { grid-template-rows: 190px minmax(0, 1fr); }
  .map-stage { grid-template-rows: 28px minmax(0, 1fr) 24px; }
  .player-strip { min-height: 50px; }
  .forecast-section,
  .targets-section { padding-top: 4px; padding-bottom: 5px; }
  .threat-card,
  .no-threat { min-height: 41px; }
  .target-card { min-height: 43px; }
  .order-card { min-height: 218px; }
  .order-planner { min-height: 216px; }
  .order-target { min-height: 34px; }
  .action-tabs button { min-height: 40px; }
  .commitment-options button { min-height: 31px; }
  .order-readout { min-height: 59px; }
  .command-button { min-height: 50px; }
  .landing-copy > p { display: none; }
  .featured-card { min-height: 220px; }
}

@media (max-height: 620px) and (max-width: 800px) {
  .command-panel { padding-bottom: calc(62px + var(--safe-bottom)); }
  .command-button {
    position: fixed;
    z-index: 12;
    right: calc(7px + var(--safe-right));
    bottom: calc(6px + var(--safe-bottom));
    left: calc(7px + var(--safe-left));
    width: auto;
    box-shadow: 0 -10px 30px rgba(8, 11, 16, 0.82), 0 8px 24px rgba(0, 0, 0, 0.28);
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}
