/* ==========================================================================
   WILDCARDS / 2063 — Saratoga CIC flight operations
   Analog carrier CIC: amber phosphor, olive drab, off-white briefing paper.
   No external dependencies. Default theme = dark (CIC night lighting).
   ========================================================================== */

[hidden] { display: none !important; }

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

:root {
  /* type — local system faces only, chosen for military/DIN character */
  --fontDisplay: "Bahnschrift", "DIN Condensed", "DIN Alternate", "Barlow Condensed", "Roboto Condensed", "Arial Narrow", sans-serif-condensed, sans-serif;
  --fontMono: "Cascadia Mono", "Consolas", "SFMono-Regular", "Menlo", "Liberation Mono", "DejaVu Sans Mono", monospace;
  --fontType: "Courier Prime", "Courier New", "Nimbus Mono PS", "Liberation Mono", monospace;

  /* CIC night (default) */
  --ink0: #0b0d08;
  --ink1: #12160d;
  --ink2: #1a2013;
  --ink3: #242b1a;
  --line: #39422a;
  --lineStrong: #56613b;
  --olive: #8b9a52;
  --oliveDim: #56632f;
  --amber: #ffb12a;
  --amberDeep: #c7820f;
  --amberGlow: rgba(255, 177, 42, .32);
  --paper: #ebe4cc;
  --paperStrong: #f6f0da;
  --muted: #a3a184;
  --faint: #6f7058;
  --signal: #e8553b;
  --shieldTone: #5fb7c9;
  --bronze: #c88a3e;
  --onAmber: #120f05;
  --panelBg: linear-gradient(180deg, rgba(36, 43, 26, .72), rgba(18, 22, 13, .86));
  --shadow: 0 1px 0 rgba(255, 255, 255, .04) inset, 0 18px 40px -24px rgba(0, 0, 0, .9);
  --grainOpacity: .16;
  --gridLine: rgba(139, 154, 82, .07);

  /* fixed scope palette (always dark glass, both themes) */
  --scopeInk: #070906;
  --scopeLine: #3c4529;

  --barH: 44px;
  --radius: 2px;
  --ease: cubic-bezier(.2, .7, .1, 1);

  color-scheme: dark;
}

:root[data-theme="light"] {
  /* Day briefing — manila flimsy, olive ink, amber grease pencil */
  --ink0: #e4dcc2;
  --ink1: #ece5cf;
  --ink2: #f3eedc;
  --ink3: #d8cfb1;
  --line: #b3aa86;
  --lineStrong: #8a8360;
  --olive: #4c5a1e;
  --oliveDim: #6d7a3a;
  --amber: #a35f00;
  --amberDeep: #7d4700;
  --amberGlow: rgba(163, 95, 0, .18);
  --paper: #1e2112;
  --paperStrong: #13160a;
  --muted: #545438;
  --faint: #8a8566;
  --signal: #a92d18;
  --shieldTone: #1f6c7c;
  --onAmber: #fbf5e2;
  --panelBg: linear-gradient(180deg, rgba(247, 242, 226, .94), rgba(232, 224, 200, .94));
  --shadow: 0 1px 0 rgba(255, 255, 255, .6) inset, 0 14px 28px -20px rgba(60, 50, 20, .55);
  --grainOpacity: .22;
  --gridLine: rgba(76, 90, 30, .08);
  color-scheme: light;
}

@media (prefers-color-scheme: light) {
  :root:not([data-theme]) {
    --ink0: #e4dcc2; --ink1: #ece5cf; --ink2: #f3eedc; --ink3: #d8cfb1;
    --line: #b3aa86; --lineStrong: #8a8360; --olive: #4c5a1e; --oliveDim: #6d7a3a;
    --amber: #a35f00; --amberDeep: #7d4700; --amberGlow: rgba(163, 95, 0, .18);
    --paper: #1e2112; --paperStrong: #13160a; --muted: #545438; --faint: #8a8566;
    --signal: #a92d18; --onAmber: #fbf5e2; --shieldTone: #1f6c7c;
    --panelBg: linear-gradient(180deg, rgba(247, 242, 226, .94), rgba(232, 224, 200, .94));
    --shadow: 0 1px 0 rgba(255, 255, 255, .6) inset, 0 14px 28px -20px rgba(60, 50, 20, .55);
    --grainOpacity: .22; --gridLine: rgba(76, 90, 30, .08);
    color-scheme: light;
  }
}

/* --------------------------------------------------------------------------
   Base
   -------------------------------------------------------------------------- */
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  background-color: var(--ink0);
  background-image:
    radial-gradient(120% 80% at 70% 0%, var(--amberGlow) 0%, transparent 45%),
    linear-gradient(var(--gridLine) 1px, transparent 1px),
    linear-gradient(90deg, var(--gridLine) 1px, transparent 1px);
  background-size: 100% 100%, 24px 24px, 24px 24px;
  color: var(--paper);
  font-family: var(--fontMono);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  transition: background-color .4s var(--ease), color .4s var(--ease);
}

/* film grain + faint scanlines */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 100;
  pointer-events: none;
  opacity: var(--grainOpacity);
  mix-blend-mode: overlay;
  background-image:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .5 0 0 0 0 .5 0 0 0 0 .5 0 0 0 .9 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E"),
    repeating-linear-gradient(0deg, rgba(0, 0, 0, .18) 0 1px, transparent 1px 3px);
}

h1, h2, h3, p, dl, dd, ol, ul, figure, fieldset { margin: 0; }
ul, ol { padding: 0; }
button { font: inherit; color: inherit; }
a { color: var(--amber); text-underline-offset: 3px; }
a:hover { color: var(--paperStrong); }

:focus-visible {
  outline: 2px solid var(--amber);
  outline-offset: 3px;
}

::selection { background: var(--amber); color: var(--onAmber); }

.skipLink {
  position: absolute;
  left: 8px;
  top: -60px;
  z-index: 200;
  padding: 8px 14px;
  background: var(--amber);
  color: var(--onAmber);
  font-family: var(--fontDisplay);
  text-transform: uppercase;
  letter-spacing: .12em;
  text-decoration: none;
}
.skipLink:focus { top: 8px; }

/* --------------------------------------------------------------------------
   Classification bar (global)
   -------------------------------------------------------------------------- */
.classBar {
  position: sticky;
  top: 0;
  z-index: 50;
  height: var(--barH);
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 16px;
  padding: 0 clamp(10px, 2vw, 24px);
  padding-top: env(safe-area-inset-top, 0);
  background:
    repeating-linear-gradient(-45deg, transparent 0 14px, rgba(0, 0, 0, .06) 14px 28px),
    var(--ink1);
  border-bottom: 1px solid var(--line);
  box-shadow: 0 1px 0 var(--amberGlow);
  font-family: var(--fontDisplay);
  text-transform: uppercase;
  letter-spacing: .14em;
  font-size: 12px;
}

.classMark { display: flex; align-items: center; gap: 10px; white-space: nowrap; }
.classDiamond {
  width: 10px; height: 10px;
  background: var(--amber);
  transform: rotate(45deg);
  box-shadow: 0 0 10px var(--amber);
  animation: lampBlink 2.6s steps(1) infinite;
}
.classHull { font-weight: 700; color: var(--amber); }
.classShip { color: var(--muted); }

.barControls { grid-column: 3; display: flex; gap: 6px; }

.barSwitch {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 30px;
  padding: 0 12px 0 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: linear-gradient(180deg, var(--ink3), var(--ink1));
  font-family: var(--fontDisplay);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .16em;
  text-transform: uppercase;
  cursor: pointer;
  box-shadow: 0 1px 0 rgba(255, 255, 255, .05) inset, 0 2px 0 rgba(0, 0, 0, .35);
  transition: border-color .2s, transform .1s;
}
.barSwitch:hover { border-color: var(--amber); }
.barSwitch:active { transform: translateY(1px); box-shadow: none; }

.barLamp {
  width: 9px; height: 9px;
  border-radius: 50%;
  background: var(--amber);
  box-shadow: 0 0 0 2px rgba(0, 0, 0, .35), 0 0 10px var(--amber);
  transition: background .2s, box-shadow .2s;
}
.barSwitch[aria-pressed="false"] .barLamp {
  background: var(--faint);
  box-shadow: 0 0 0 2px rgba(0, 0, 0, .35);
}
.barSwitch[aria-pressed="false"] .barText { color: var(--faint); text-decoration: line-through; }

/* theme lamp: half-moon at night, full disc by day */
.barLampTheme { background: radial-gradient(circle at 70% 35%, var(--ink1) 0 45%, var(--amber) 47%); }
:root[data-theme="light"] .barLampTheme { background: var(--amber); }
.themeText { font-size: 0; }
.themeText::after { content: "Night"; font-size: 11px; }
:root[data-theme="light"] .themeText::after { content: "Day"; }

/* --------------------------------------------------------------------------
   Shared labels, stamps, buttons
   -------------------------------------------------------------------------- */
.opOrder {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 12px;
  font-family: var(--fontDisplay);
  font-size: 12px;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--muted);
}
.opOrder q { quotes: "“" "”"; color: var(--paper); }
.opStamp {
  padding: 2px 8px;
  border: 1.5px solid var(--signal);
  color: var(--signal);
  font-weight: 700;
  transform: rotate(-2deg);
}

.btn {
  --btnBg: var(--ink2);
  --btnInk: var(--paper);
  --btnEdge: var(--lineStrong);
  position: relative;
  display: inline-grid;
  grid-template-columns: auto 1fr;
  grid-template-rows: auto auto;
  column-gap: 12px;
  align-items: center;
  min-height: 52px;
  padding: 8px 20px 8px 16px;
  border: 1px solid var(--btnEdge);
  border-radius: 0;
  background: var(--btnBg);
  color: var(--btnInk);
  text-align: left;
  cursor: pointer;
  clip-path: polygon(0 0, calc(100% - 12px) 0, 100% 12px, 100% 100%, 12px 100%, 0 calc(100% - 12px));
  transition: transform .15s var(--ease), background .2s, color .2s, border-color .2s, filter .2s;
}
.btnText {
  grid-column: 2;
  font-family: var(--fontDisplay);
  font-size: 18px;
  font-weight: 700;
  font-stretch: 85%;
  letter-spacing: .12em;
  text-transform: uppercase;
  line-height: 1.1;
}
.btnSub {
  grid-column: 2;
  font-size: 10.5px;
  letter-spacing: .14em;
  text-transform: uppercase;
  opacity: .72;
}
.btn:hover:not(:disabled) { transform: translate(-2px, -2px); filter: brightness(1.08); }
.btn:active:not(:disabled) { transform: translate(1px, 1px); }

.btnHazard {
  grid-row: 1 / span 2;
  grid-column: 1;
  align-self: stretch;
  width: 14px;
  margin: -8px 0 -8px -16px;
  background: repeating-linear-gradient(-45deg, var(--onAmber) 0 5px, transparent 5px 10px);
  opacity: .85;
}

.btnLaunch {
  --btnBg: var(--amber);
  --btnInk: var(--onAmber);
  --btnEdge: var(--amber);
  padding-left: 16px;
  min-width: 220px;
  box-shadow: 0 0 0 1px var(--amber), 0 0 28px -6px var(--amber);
}
.btnLaunch .btnText { font-size: 22px; }

.btnSecondary {
  --btnBg: transparent;
  --btnEdge: var(--olive);
  --btnInk: var(--paper);
  box-shadow: inset 0 0 0 1px var(--olive);
}
.btnSecondary:not(:disabled):hover { --btnBg: var(--olive); --btnInk: var(--ink0); }

.btnGhost {
  --btnBg: transparent;
  --btnEdge: var(--line);
  --btnInk: var(--paper);
}
.btnGhost:hover { --btnEdge: var(--amber); --btnInk: var(--amber); }

.btn:disabled {
  cursor: not-allowed;
  --btnInk: var(--faint);
  --btnEdge: var(--line);
  box-shadow: none;
  background:
    repeating-linear-gradient(-45deg, transparent 0 6px, rgba(128, 128, 100, .08) 6px 12px),
    transparent;
  border-style: dashed;
}

.btnCompact { min-height: 42px; min-width: 0; padding: 6px 16px 6px 14px; }
.btnCompact .btnText { font-size: 16px; }
.btnCompact .btnHazard { margin: -6px 0 -6px -14px; width: 10px; }

kbd {
  display: inline-grid;
  place-items: center;
  min-width: 26px;
  height: 26px;
  padding: 0 6px;
  margin: 0 2px 2px 0;
  border: 1px solid var(--lineStrong);
  border-bottom-width: 3px;
  border-radius: 3px;
  background: var(--ink2);
  color: var(--paperStrong);
  font-family: var(--fontDisplay);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: .04em;
  line-height: 1;
}
.kbdWide { padding: 0 10px; text-transform: uppercase; font-size: 11px; letter-spacing: .12em; }
.kbdRound { border-radius: 50%; width: 28px; height: 28px; padding: 0; border-bottom-width: 1px; border-color: var(--amber); color: var(--amber); }

/* --------------------------------------------------------------------------
   Landing — quiet launch panel + one large illustrated plate
   -------------------------------------------------------------------------- */
.srOnly {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.landing {
  --landingPad: clamp(14px, 2.6vw, 36px);
  max-width: 1560px;
  min-height: calc(100vh - var(--barH));
  min-height: calc(100dvh - var(--barH));
  margin: 0 auto;
  padding: var(--landingPad);
  display: grid;
  grid-template-columns: minmax(280px, 380px) minmax(0, 1fr);
  gap: clamp(20px, 3.4vw, 52px);
  align-items: stretch;
}

.launchPanel {
  align-self: center;
  display: flex;
  flex-direction: column;
  gap: clamp(22px, 3.4vh, 36px);
  min-width: 0;
  padding-block: 12px;
}

.gameTitle {
  font-family: var(--fontDisplay);
  font-weight: 700;
  font-stretch: 75%;
  text-transform: uppercase;
  line-height: .8;
  letter-spacing: -.005em;
  animation: rise .9s var(--ease) both;
}
.titleMain {
  display: block;
  font-size: clamp(48px, 5.5vw, 84px);
  background: linear-gradient(180deg, var(--paperStrong) 0 46%, transparent 46% 53%, var(--paperStrong) 53% 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: drop-shadow(0 0 1px var(--amberGlow));
}
.titleRow {
  display: flex;
  align-items: flex-end;
  gap: clamp(8px, 1vw, 14px);
  margin-top: .08em;
}
.titleSlash {
  font-size: clamp(40px, 4.3vw, 66px);
  color: var(--signal);
  font-weight: 400;
  line-height: .8;
}
.titleYear {
  font-size: clamp(48px, 5.5vw, 84px);
  color: transparent;
  -webkit-text-stroke: clamp(1.5px, .16vw, 2.2px) var(--amber);
  text-shadow: 0 0 24px var(--amberGlow);
  line-height: .8;
}

.fieldLabel {
  margin-bottom: 8px;
  padding: 0;
  font-family: var(--fontDisplay);
  font-size: 11px;
  letter-spacing: .24em;
  text-transform: uppercase;
  color: var(--muted);
}

/* difficulty — three-way segmented selector */
.profiles {
  border: 0;
  padding: 0;
  min-width: 0;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
  animation: rise .9s .1s var(--ease) both;
}
.profiles legend { float: left; width: 100%; grid-column: 1 / -1; }

.profile { position: relative; display: block; cursor: pointer; min-width: 0; }
.profile input {
  position: absolute;
  opacity: 0;
  width: 1px; height: 1px;
  pointer-events: none;
}
.profileBody {
  position: relative;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 6px;
  min-height: 52px;
  padding: 12px 12px 10px 14px;
  border: 1px solid var(--line);
  background: var(--panelBg);
  box-shadow: var(--shadow);
  transition: border-color .2s, transform .2s var(--ease), background .2s;
}
.profileBody::before {
  content: "";
  position: absolute;
  left: -1px; right: -1px; bottom: -1px;
  height: 3px;
  background: transparent;
  transition: background .2s;
}
.profile:hover .profileBody { border-color: var(--lineStrong); }

.profileGrade {
  font-family: var(--fontDisplay);
  font-size: clamp(15px, 1.25vw, 18px);
  font-weight: 700;
  font-stretch: 85%;
  letter-spacing: .1em;
  text-transform: uppercase;
  line-height: 1;
  color: var(--muted);
  transition: color .2s;
}
.profileSorties b {
  font-family: var(--fontDisplay);
  font-size: clamp(22px, 1.9vw, 28px);
  font-weight: 700;
  font-stretch: 80%;
  line-height: 1;
  color: var(--faint);
  font-variant-numeric: tabular-nums;
  transition: color .2s;
}

.profile input:checked + .profileBody {
  border-color: var(--amber);
  background: linear-gradient(0deg, var(--amberGlow), transparent 80%), var(--panelBg);
}
.profile input:checked + .profileBody::before { background: var(--amber); }
.profile input:checked + .profileBody .profileGrade { color: var(--paperStrong); }
.profile input:checked + .profileBody .profileSorties b { color: var(--amber); }
.profileHard input:checked + .profileBody { border-color: var(--signal); background: linear-gradient(0deg, rgba(232, 85, 59, .16), transparent 80%), var(--panelBg); }
.profileHard input:checked + .profileBody::before { background: var(--signal); }
.profileHard input:checked + .profileBody .profileSorties b { color: var(--signal); }
.profile input:focus-visible + .profileBody { outline: 2px solid var(--amber); outline-offset: 3px; }

/* loadout — airframe + difficulty read as one configuration block */
.loadout { display: grid; gap: clamp(12px, 1.8vh, 18px); min-width: 0; }

/* airframe — two-way selector; ISSAPC lights in shield cyan */
.airframes { grid-template-columns: repeat(2, minmax(0, 1fr)); animation-delay: .05s; }
.airframeBody {
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  gap: 6px;
  padding-right: 10px;
}
.airframeTrait {
  font-size: 10.5px;
  letter-spacing: .08em;
  line-height: 1.2;
  text-transform: uppercase;
  color: var(--faint);
  transition: color .2s;
}
.airframe input:checked + .profileBody .airframeTrait { color: var(--muted); }
.airframeIssapc input:checked + .profileBody {
  border-color: var(--shieldTone);
  background: linear-gradient(0deg, color-mix(in srgb, var(--shieldTone) 18%, transparent), transparent 80%), var(--panelBg);
}
.airframeIssapc input:checked + .profileBody::before { background: var(--shieldTone); }
.airframeIssapc input:checked + .profileBody .airframeTrait { color: var(--shieldTone); }
.airframeIssapc input:focus-visible + .profileBody { outline-color: var(--shieldTone); }

/* launch buttons */
.launchButtons {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  animation: rise .9s .2s var(--ease) both;
}
.launchButtons .btnLaunch,
.launchButtons .btnSecondary { grid-column: 1 / -1; }
.launchButtons .btn { min-width: 0; }
.launchButtons .btnLaunch { min-height: 64px; }
.launchButtons .btnLaunch .btnText { font-size: 26px; letter-spacing: .18em; }
.launchButtons .btnGhost { min-height: 46px; padding-inline: 14px; }
.launchButtons .btn:not(.btnLaunch) { grid-template-columns: 1fr; }
.launchButtons .btn:not(.btnLaunch) .btnText { grid-column: 1; }
.launchButtons .btnGhost .btnText { font-size: 14px; letter-spacing: .16em; }

.tape {
  display: flex;
  align-items: center;
  gap: 10px;
  max-width: 100%;
  margin-top: -10px;
  font-size: 12px;
  letter-spacing: .04em;
  color: var(--muted);
  animation: rise .9s .3s var(--ease) both;
}
.tapeLamp {
  flex: none;
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--olive);
  box-shadow: 0 0 8px var(--olive);
  animation: lampBlink 3.2s steps(1) infinite;
}

/* hero plate */
.hero {
  position: relative;
  min-width: 0;
  min-height: 0;
  display: flex;
  animation: develop 1.4s .1s var(--ease) both;
}
.heroScope {
  position: relative;
  flex: 1;
  min-height: 320px;
  overflow: hidden;
  background: #0b0e08;
  border: 1px solid var(--scopeLine);
  box-shadow:
    0 0 0 6px var(--ink1),
    0 0 0 7px var(--line),
    0 30px 60px -30px rgba(0, 0, 0, .9);
}
.heroScope::after {
  /* vignette — sits above the art, never intercepts input */
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(ellipse 75% 70% at 50% 48%, transparent 55%, rgba(0, 0, 0, .7) 100%);
}
.heroArt { position: absolute; inset: 0; display: block; width: 100%; height: 100%; }

.heroSweep { transform-box: view-box; transform-origin: 300px 320px; animation: sweep 9s linear infinite; }
.heroScan { animation: scan 6s linear infinite; }
.heroDrift { transform-box: view-box; animation: drift 7s ease-in-out infinite alternate; }
.heroEngines { animation: burn .12s steps(2) infinite; }
.heroPlume { transform-box: view-box; transform-origin: 0 160px; animation: plume .18s steps(2) infinite; }
.heroPlumeHeavy { transform-origin: 0 183px; animation-duration: .22s; }
/* airframe swap: the newly shown craft "develops" on the plate (opacity only; the group keeps its transform attribute) */
.heroShip:not([hidden]) { animation: shipDevelop .55s var(--ease) both; }

/* keep grain lighter over the live combat scope */
body:has([data-screen="play"]:not([hidden]))::before { opacity: calc(var(--grainOpacity) * .45); }

.scopeCorner {
  position: absolute;
  z-index: 1;
  width: 22px; height: 22px;
  border: 2px solid #ffb12a;
  opacity: .7;
}
.scopeCornerTL { top: 12px; left: 12px; border-right: 0; border-bottom: 0; }
.scopeCornerTR { top: 12px; right: 12px; border-left: 0; border-bottom: 0; }
.scopeCornerBL { bottom: 12px; left: 12px; border-right: 0; border-top: 0; }
.scopeCornerBR { bottom: 12px; right: 12px; border-left: 0; border-top: 0; }

.credits {
  margin-top: 28px;
  padding-top: 14px;
  border-top: 1px dashed var(--line);
  font-size: 11.5px;
  color: var(--faint);
  letter-spacing: .02em;
}

/* --------------------------------------------------------------------------
   Guide
   -------------------------------------------------------------------------- */
.guide {
  max-width: 1320px;
  margin: 0 auto;
  padding: clamp(18px, 3vw, 40px) clamp(14px, 3vw, 40px) 48px;
}
.guideHead {
  display: flex;
  align-items: center;
  gap: 14px 24px;
  flex-wrap: wrap;
  padding-bottom: 18px;
  margin-bottom: 24px;
  border-bottom: 2px solid var(--paper);
  position: relative;
}
.guideHead::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: -6px;
  height: 1px;
  background: var(--line);
}
.btnBack { grid-template-columns: 1fr; min-height: 44px; }
.btnBack .btnText { grid-column: 1; font-size: 15px; }
.btnBack .btnText::before { content: "◂ "; color: var(--amber); }
.guideTitle {
  font-family: var(--fontDisplay);
  font-size: clamp(36px, 4.6vw, 64px);
  font-weight: 700;
  font-stretch: 75%;
  text-transform: uppercase;
  line-height: .85;
  color: var(--paperStrong);
}

.briefGrid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 290px), 1fr));
  grid-auto-flow: row dense;
  gap: 14px;
}
.brief {
  position: relative;
  padding: 18px 18px 20px;
  background: var(--panelBg);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  animation: rise .7s var(--ease) both;
}
.brief:nth-child(2) { animation-delay: .05s; }
.brief:nth-child(3) { animation-delay: .1s; }
.brief:nth-child(4) { animation-delay: .15s; }
.brief:nth-child(5) { animation-delay: .2s; }
.brief:nth-child(6) { animation-delay: .25s; }
.brief:nth-child(7) { animation-delay: .3s; }
.brief::after {
  /* punched binder holes */
  content: "";
  position: absolute;
  top: 10px; right: 12px;
  width: 26px; height: 8px;
  background: radial-gradient(circle, var(--ink0) 0 3px, transparent 3.5px) 0 0 / 13px 8px repeat-x;
  opacity: .8;
}
.briefHead {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
  font-family: var(--fontDisplay);
  font-size: 20px;
  font-weight: 700;
  font-stretch: 80%;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--paperStrong);
}
.briefHead span {
  display: inline-grid;
  place-items: center;
  width: 34px; height: 26px;
  font-size: 14px;
  background: var(--amber);
  color: var(--onAmber);
  clip-path: polygon(0 0, 100% 0, 100% 70%, 80% 100%, 0 100%);
}

.keyTable { display: grid; gap: 0; }
.keyTable > div {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  padding: 8px 0;
  border-bottom: 1px dashed var(--line);
}
.keyTable > div:last-child { border-bottom: 0; }
.keyTable dt { display: flex; flex-wrap: wrap; align-items: center; gap: 2px; }
.keyTable dt i { font-style: normal; font-size: 11px; color: var(--faint); margin: 0 6px; text-transform: uppercase; letter-spacing: .14em; }
.keyTable dd { font-size: 13.5px; color: var(--paper); }

.briefNote {
  margin-top: 12px;
  padding: 8px 10px;
  font-family: var(--fontType);
  font-size: 13px;
  color: var(--muted);
  border-left: 2px solid var(--amber);
  background: var(--amberGlow);
}
.briefNote b { color: var(--paperStrong); }

.pickupList, .tickList, .stepList { list-style: none; display: grid; gap: 10px; }
.pickupList li { display: grid; grid-template-columns: 34px 1fr; gap: 12px; align-items: center; font-size: 13.5px; }
.pickupList b, .stepList b, .tickList b { color: var(--paperStrong); }
.pickupList b { display: block; font-family: var(--fontDisplay); letter-spacing: .14em; text-transform: uppercase; font-size: 12px; color: var(--amber); }
.pickupBadge {
  display: grid;
  place-items: center;
  width: 34px; height: 34px;
  font-family: var(--fontDisplay);
  font-size: 18px;
  font-weight: 700;
  border: 2px solid currentColor;
  border-radius: 8px;
  box-shadow: inset 0 0 0 2px var(--ink0), inset 0 0 10px -2px currentColor;
  background: var(--ink2);
}
.pickupPower { color: var(--amber); }
.pickupShield { color: #5fb7c9; }
.pickupLife { color: var(--olive); }
.pickupWeapon { color: var(--pickupTint, var(--signal)); }
:root[data-theme="light"] .pickupShield { color: #1f6c7c; }

.stepList { counter-reset: step; }
.stepList li {
  counter-increment: step;
  position: relative;
  min-height: 22px;
  padding-left: 34px;
  font-size: 13.5px;
}
.stepList li::before {
  content: counter(step, upper-alpha);
  position: absolute;
  left: 0;
  top: 0;
  display: grid;
  place-items: center;
  width: 22px; height: 22px;
  border: 1px solid var(--olive);
  color: var(--olive);
  font-family: var(--fontDisplay);
  font-weight: 700;
  font-size: 12px;
}
.tickList li { position: relative; padding-left: 26px; font-size: 13.5px; }
.tickList li::before {
  content: "";
  position: absolute;
  left: 2px; top: 4px;
  width: 12px; height: 7px;
  border-left: 2px solid var(--olive);
  border-bottom: 2px solid var(--olive);
  transform: rotate(-45deg);
}

.profileTable { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.profileTable > div {
  display: grid;
  gap: 2px;
  min-width: 0;
  padding: 10px 10px;
  border: 1px solid var(--line);
  border-top: 3px solid var(--amber);
}
.profileTable > div:last-child { border-top-color: var(--signal); }
.profileTable b { font-family: var(--fontDisplay); font-size: 17px; font-stretch: 80%; letter-spacing: .06em; text-transform: uppercase; color: var(--paperStrong); }
.profileTable em { font-style: normal; color: var(--amber); font-size: 12.5px; }

.brief:nth-child(8) { animation-delay: .35s; }
.brief:nth-child(9) { animation-delay: .4s; }

.pickupAmmo { color: #e8d7a0; }
:root[data-theme="light"] .pickupAmmo { color: #6b5a1c; }
.pickupPod { background: #12160d; text-shadow: 0 0 8px var(--pickupTint); border-style: dashed; }

/* weapons table — badge · name · role · default slot tag */
.weaponTable {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0 24px;
}
.weaponTable li {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) auto;
  grid-template-rows: auto auto;
  column-gap: 12px;
  align-items: center;
  padding: 9px 0;
  border-bottom: 1px dashed var(--line);
  min-width: 0;
}
.weaponTable .pickupBadge {
  grid-row: 1 / span 2;
  background: #12160d;
  text-shadow: 0 0 8px var(--pickupTint);
}
.weaponTable b {
  font-family: var(--fontDisplay);
  font-size: 17px;
  font-weight: 700;
  font-stretch: 85%;
  letter-spacing: .1em;
  text-transform: uppercase;
  line-height: 1.1;
  color: var(--paperStrong);
}
.weaponTable li > span:not(.pickupBadge) { grid-column: 2 / -1; font-size: 13px; color: var(--muted); line-height: 1.3; }
.slotTag {
  grid-column: 3;
  grid-row: 1;
  padding: 1px 7px;
  font-family: var(--fontDisplay);
  font-style: normal;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: .14em;
  text-transform: uppercase;
  white-space: nowrap;
  background: var(--amber);
  color: var(--onAmber);
}
.slotTagTwo { background: var(--olive); color: var(--ink0); }

/* airframes — side-by-side spec plates with segmented pips */
.brief:nth-child(10) { animation-delay: .45s; }
.airframeSpecs {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}
.airframeSpec {
  --specTone: var(--amber);
  min-width: 0;
  padding: 10px 12px 8px;
  border: 1px solid var(--line);
  border-top: 3px solid var(--specTone);
  background: var(--ink0);
}
.airframeSpecHeavy { --specTone: var(--shieldTone); }
.specName {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 2px 10px;
  margin: 0 0 6px;
  font-family: var(--fontDisplay);
  font-size: 18px;
  font-weight: 700;
  font-stretch: 80%;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--paperStrong);
}
.specName em {
  font-style: normal;
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: .16em;
  color: var(--specTone);
}
.specList > div {
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr);
  gap: 8px;
  align-items: center;
  padding: 5px 0;
  border-bottom: 1px dashed var(--line);
}
.specList > div:last-child { border-bottom: 0; }
.specList dt {
  font-family: var(--fontDisplay);
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--olive);
}
.specList dd { display: flex; align-items: center; gap: 10px; min-width: 0; font-size: 13px; color: var(--paper); }
.pips {
  flex: none;
  width: 40px;
  height: 8px;
  color: var(--specTone);
  background:
    repeating-linear-gradient(90deg, currentColor 0 10px, transparent 10px 15px) 0 0 / calc(var(--pips, 0) * 15px) 100% no-repeat,
    repeating-linear-gradient(90deg, var(--line) 0 10px, transparent 10px 15px);
}
.specGlyph {
  flex: none;
  display: grid;
  place-items: center;
  width: 40px;
  font-family: var(--fontDisplay);
  font-size: 15px;
  font-weight: 700;
  line-height: 1;
  color: var(--specTone);
}
.aimSteps li::before { border-color: var(--shieldTone); color: var(--shieldTone); }

/* hazards — warning chevrons */
.warnList { list-style: none; display: grid; gap: 10px; }
.warnList li { position: relative; padding-left: 28px; font-size: 13.5px; }
.warnList b { color: var(--paperStrong); }
.warnList li::before {
  content: "!";
  position: absolute;
  left: 0; top: 0;
  display: grid;
  place-items: center;
  width: 18px; height: 17px;
  padding-top: 3px;
  font-family: var(--fontDisplay);
  font-size: 11px;
  font-weight: 700;
  background: var(--signal);
  color: #fbf5e2;
  clip-path: polygon(50% 0, 100% 100%, 0 100%);
}

/* --------------------------------------------------------------------------
   Enemy intel — roster
   Contract: #enemyRoster > section > h3 (+ optional .rosterCount span)
             + dl > div[data-threat][data-kind] > dt, dd, dd
             (ul/ol > li > span, span, span also works)
   -------------------------------------------------------------------------- */
.intel {
  --rosterCols: minmax(0, 1.2fr) minmax(0, 1.2fr) minmax(84px, .5fr);
  max-width: 1040px;
}
.intelHead { margin-bottom: 0; border-bottom-width: 0; padding-bottom: 18px; }
.intelHead::after { display: none; }
.intelFilter { margin-left: auto; flex: 0 1 280px; min-width: 0; }
.intelFilter input {
  width: 100%;
  height: 44px;
  padding: 0 14px 0 38px;
  border: 1px solid var(--lineStrong);
  border-radius: 0;
  background:
    radial-gradient(circle at 17px 20px, transparent 5px, var(--amber) 5.5px 7px, transparent 7.5px) no-repeat,
    linear-gradient(45deg, transparent 47%, var(--amber) 47% 57%, transparent 57%) 21px 24px / 7px 7px no-repeat,
    var(--ink0);
  color: var(--paperStrong);
  font: inherit;
  font-size: 14px;
  letter-spacing: .04em;
  box-shadow: inset 0 0 14px rgba(0, 0, 0, .3);
  transition: border-color .2s;
}
.intelFilter input::placeholder { color: var(--faint); text-transform: uppercase; letter-spacing: .16em; font-size: 12px; }
.intelFilter input:focus { border-color: var(--amber); outline: none; box-shadow: 0 0 0 1px var(--amber), inset 0 0 14px rgba(0, 0, 0, .3); }

.rosterColumns {
  position: sticky;
  top: var(--barH);
  z-index: 5;
  display: grid;
  grid-template-columns: var(--rosterCols);
  gap: 14px;
  padding: 10px 16px 8px;
  background: var(--ink1);
  border-top: 2px solid var(--paper);
  border-bottom: 1px solid var(--amber);
  font-family: var(--fontDisplay);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .24em;
  text-transform: uppercase;
  color: var(--muted);
}
.rosterColumns span:last-child { text-align: right; }

.roster { display: grid; gap: 16px; margin-top: 16px; }
.roster:empty::before {
  content: "Loading roster…";
  padding: 18px 16px;
  font-size: 13px;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--faint);
}
.roster > section {
  background: var(--panelBg);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  animation: rise .6s var(--ease) both;
}
.roster > section > h3 {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 16px 9px;
  background: var(--ink2);
  border-bottom: 1px solid var(--line);
  border-left: 4px solid var(--olive);
  font-family: var(--fontDisplay);
  font-size: 17px;
  font-weight: 700;
  font-stretch: 85%;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--paperStrong);
}
.roster > section:first-child > h3 { border-left-color: var(--amber); }
.rosterCount {
  font-family: var(--fontMono);
  font-size: 12px;
  font-weight: 400;
  letter-spacing: .08em;
  color: var(--faint);
  font-variant-numeric: tabular-nums;
}

.roster :is(dl, ul, ol) { list-style: none; margin: 0; padding: 0; }
.roster :is(dl, ul, ol) > :is(div, li) {
  display: grid;
  grid-template-columns: var(--rosterCols);
  gap: 14px;
  align-items: center;
  padding: 8px 16px;
  border-bottom: 1px dashed var(--line);
  transition: background .15s;
}
.roster :is(dl, ul, ol) > :is(div, li):last-child { border-bottom: 0; }
.roster :is(dl, ul, ol) > :is(div, li):hover { background: var(--amberGlow); }
.roster :is(dt, dd) { margin: 0; min-width: 0; }
.roster :is(dl, ul, ol) > :is(div, li) > :nth-child(1) {
  font-family: var(--fontDisplay);
  font-size: 15px;
  font-weight: 600;
  font-stretch: 90%;
  letter-spacing: .06em;
  color: var(--paperStrong);
}
.roster dt {
  display: flex;
  align-items: center;
  gap: 10px;
}
.rosterPreview {
  flex: 0 0 auto;
  display: block;
  width: var(--rosterPreviewWidth, 64px);
  height: auto;
  border: 1px solid var(--lineStrong);
  background: #171b14;
}
.rosterName { min-width: 0; overflow-wrap: anywhere; }
.roster :is(dl, ul, ol) > :is(div, li) > :nth-child(2) { font-size: 13px; color: var(--muted); }
.roster :is(dl, ul, ol) > :is(div, li) > :nth-child(3) {
  justify-self: end;
  font-family: var(--fontDisplay);
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: .16em;
  text-transform: uppercase;
  white-space: nowrap;
  color: var(--paper);
}
/* threat tint — set data-threat on the row (low | medium | high | extreme) */
.roster [data-threat="low"] > :nth-child(3) { color: var(--olive); }
.roster [data-threat="medium"] > :nth-child(3) { color: var(--amber); }
.roster [data-threat="high"] > :nth-child(3) { color: var(--signal); }
.roster [data-threat="extreme"] > :nth-child(3) { padding: 1px 7px; background: var(--signal); color: #fbf5e2; }
/* ground units — set data-kind="ground" on the row */
.roster [data-kind="ground"] .rosterName::after {
  content: "Ground";
  display: inline-block;
  margin-left: 8px;
  padding: 0 5px;
  border: 1px solid var(--olive);
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: .16em;
  text-transform: uppercase;
  vertical-align: 2px;
  color: var(--olive);
}

.rosterEmpty {
  margin-top: 16px;
  padding: 18px 16px;
  border: 1px dashed var(--line);
  font-family: var(--fontType);
  font-size: 14px;
  color: var(--muted);
  text-align: center;
}

@media (min-width: 960px) {
  .briefWide { grid-column: span 2; }
}

/* --------------------------------------------------------------------------
   Play — flight deck
   -------------------------------------------------------------------------- */
body:has([data-screen="play"]:not([hidden])) {
  overflow: hidden;
  overscroll-behavior: none;
}

.flightDeck {
  --pad: 12px;
  --gap: 12px;
  --bezel: 10px;
  --sideW: clamp(190px, 19vw, 290px);
  --scopeW: min(
    calc((100dvh - var(--barH) - 2 * var(--pad) - 2 * var(--bezel)) * 480 / 680),
    calc(100vw - 2 * var(--pad) - 2 * var(--gap) - 2 * var(--sideW) - 2 * var(--bezel))
  );
  height: calc(100vh - var(--barH));
  height: calc(100dvh - var(--barH));
  display: grid;
  grid-template-columns: var(--sideW) calc(var(--scopeW) + 2 * var(--bezel)) var(--sideW);
  grid-template-rows: minmax(0, 1fr) auto;
  grid-template-areas:
    "mission scope status"
    "move    scope fire";
  justify-content: center;
  gap: var(--gap);
  padding: var(--pad);
  padding-bottom: max(var(--pad), env(safe-area-inset-bottom, 0px));
  user-select: none;
  -webkit-user-select: none;
}

.deckPanel {
  min-height: 0;
  overflow: auto;
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 14px;
  background: var(--panelBg);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  position: relative;
  scrollbar-width: thin;
}
.deckPanel::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: repeating-linear-gradient(90deg, var(--olive) 0 18px, transparent 18px 22px);
  opacity: .7;
}
.panelMission { grid-area: mission; }
.panelStatus { grid-area: status; }

.panelRow { display: flex; align-items: center; justify-content: space-between; gap: 8px; }

.hudLabel {
  font-family: var(--fontDisplay);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .24em;
  text-transform: uppercase;
  color: var(--olive);
}

.missionNo {
  font-family: var(--fontDisplay);
  font-size: clamp(30px, 3.2vw, 51px);
  font-weight: 700;
  font-stretch: 75%;
  line-height: .8;
  color: var(--amber);
  text-shadow: 0 0 18px var(--amberGlow);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.missionName {
  font-family: var(--fontDisplay);
  font-size: clamp(18px, 1.6vw, 24px);
  font-weight: 700;
  font-stretch: 85%;
  letter-spacing: .06em;
  line-height: 1.1;
  text-transform: uppercase;
  color: var(--paperStrong);
  padding-bottom: 12px;
  border-bottom: 1px dashed var(--line);
}

.meter { display: grid; gap: 6px; }

/* selected airframe (#shipName) — quiet readout under the route gauge */
.airframeTag {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  padding-bottom: 8px;
  border-bottom: 1px dashed var(--line);
  min-width: 0;
}
.airframeName {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-family: var(--fontDisplay);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--paperStrong);
}

/* segmented analog gauges */
.gauge {
  -webkit-appearance: none;
  appearance: none;
  display: block;
  width: 100%;
  height: 12px;
  border: 1px solid var(--lineStrong);
  background: var(--ink0);
  color: var(--amber);
  padding: 1px;
}
.gauge::-webkit-progress-bar { background: var(--ink0); }
.gauge::-webkit-progress-value {
  background: repeating-linear-gradient(90deg, currentColor 0 6px, transparent 6px 8px);
  transition: width .25s linear;
}
.gauge::-moz-progress-bar {
  background: repeating-linear-gradient(90deg, currentColor 0 6px, transparent 6px 8px);
}
.gaugeShield { color: #5fb7c9; }
:root[data-theme="light"] .gaugeShield { color: #1f6c7c; }
.gaugeBoss { color: #e8553b; height: 8px; border-color: rgba(232, 85, 59, .6); background: rgba(0, 0, 0, .5); }
.gaugeBoss::-webkit-progress-bar { background: rgba(0, 0, 0, .5); }

.comms {
  margin-top: auto;
  display: grid;
  gap: 8px;
  padding: 10px 12px;
  background: var(--ink0);
  border: 1px solid var(--line);
  box-shadow: inset 0 0 20px rgba(0, 0, 0, .35);
}
.commsLabel { display: flex; align-items: center; gap: 8px; }
.commsLamp { width: 7px; height: 7px; border-radius: 50%; background: var(--signal); box-shadow: 0 0 8px var(--signal); animation: lampBlink 1.2s steps(1) infinite; }
.radioMessage {
  font-family: var(--fontType);
  font-size: 13.5px;
  line-height: 1.45;
  color: var(--amber);
  min-height: 3.2em;
}
.radioMessage::after { content: "▌"; margin-left: 2px; animation: lampBlink 1s steps(1) infinite; }

.hudButton {
  height: 30px;
  padding: 0 12px;
  border: 1px solid var(--lineStrong);
  background: var(--ink2);
  font-family: var(--fontDisplay);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .18em;
  text-transform: uppercase;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.hudButton::before {
  content: "";
  width: 8px; height: 10px;
  border-inline: 3px solid var(--amber);
}
.hudButton:hover { border-color: var(--amber); color: var(--amber); }

.scoreReadout {
  margin-top: -8px;
  font-family: var(--fontMono);
  font-size: clamp(24px, 2.4vw, 34px);
  font-weight: 700;
  letter-spacing: .06em;
  color: var(--paperStrong);
  font-variant-numeric: tabular-nums;
  padding: 6px 10px;
  background: var(--ink0);
  border: 1px solid var(--line);
  box-shadow: inset 0 0 14px rgba(0, 0, 0, .4);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.statPair { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.stat { padding: 8px 10px; border: 1px solid var(--line); }
.statValue {
  font-family: var(--fontDisplay);
  font-size: 26px;
  font-weight: 700;
  font-stretch: 80%;
  line-height: 1.05;
  color: var(--paperStrong);
  font-variant-numeric: tabular-nums;
}
#shieldMeter { margin-top: -6px; }

.weaponBay { display: grid; gap: 8px; }
.weaponSlot {
  position: relative;
  padding: 8px 10px 9px 14px;
  border: 1px solid var(--line);
  background: var(--ink0);
  transition: border-color .15s, box-shadow .15s;
}
.weaponSlot::before {
  content: "";
  position: absolute;
  left: -1px; top: -1px; bottom: -1px;
  width: 4px;
  background: var(--line);
  transition: background .15s, box-shadow .15s;
}
.weaponSlot[data-active="true"] { border-color: var(--amber); }
.weaponSlot[data-active="true"]::before { background: var(--amber); box-shadow: 0 0 10px var(--amber); }
.slotKey {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 10.5px;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--faint);
}
.slotKey b {
  display: inline-grid;
  place-items: center;
  width: 18px; height: 18px;
  border-radius: 50%;
  background: var(--olive);
  color: var(--ink0);
  font-family: var(--fontDisplay);
  font-size: 11px;
}
.weaponSlot[data-slot="one"] .slotKey b { background: var(--amber); color: var(--onAmber); }
.slotName {
  margin-top: 4px;
  font-family: var(--fontDisplay);
  font-size: 17px;
  font-weight: 700;
  font-stretch: 85%;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--paperStrong);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* secondary ammo (#ammoValue) and unlimited marker for slot 1 */
.weaponSlot .slotName { padding-right: 40px; }
.slotAmmo {
  position: absolute;
  right: 10px;
  bottom: 8px;
  font-family: var(--fontDisplay);
  font-size: 22px;
  font-weight: 700;
  font-stretch: 80%;
  line-height: 1;
  color: var(--amber);
  font-variant-numeric: tabular-nums;
  transition: color .15s;
}
.slotAmmoInfinite { font-size: 24px; color: var(--faint); }
.weaponSlot[data-ammo="low"] .slotAmmo { color: var(--signal); animation: lampBlink 1s steps(1) infinite; }
.weaponSlot[data-ammo="empty"] .slotAmmo { color: var(--faint); text-decoration: line-through; }
.weaponSlot[data-ammo="empty"] .slotName { color: var(--faint); }

/* scope (canvas frame) — always dark glass */
.scopeColumn {
  grid-area: scope;
  align-self: center;
  justify-self: center;
  min-width: 0;
}
.flightScope {
  position: relative;
  width: calc(var(--scopeW) + 2 * var(--bezel));
  padding: var(--bezel);
  background:
    linear-gradient(90deg, rgba(255, 177, 42, .55) 1px, transparent 1px) 0 0 / 24px 4px repeat-x,
    linear-gradient(90deg, rgba(255, 177, 42, .55) 1px, transparent 1px) 0 100% / 24px 4px repeat-x,
    linear-gradient(rgba(255, 177, 42, .55) 1px, transparent 1px) 0 0 / 4px 24px repeat-y,
    linear-gradient(rgba(255, 177, 42, .55) 1px, transparent 1px) 100% 0 / 4px 24px repeat-y,
    #151a0f;
  border: 1px solid #3c4529;
  box-shadow:
    0 0 0 1px #000,
    0 0 0 5px var(--ink1),
    0 0 0 6px var(--line),
    0 24px 50px -20px rgba(0, 0, 0, .9);
}
.flightScope::after {
  /* glass reflection + scanlines, never intercepts input */
  content: "";
  position: absolute;
  inset: var(--bezel);
  pointer-events: none;
  background:
    linear-gradient(155deg, rgba(255, 255, 255, .05) 0 18%, transparent 30%),
    repeating-linear-gradient(0deg, rgba(0, 0, 0, .14) 0 1px, transparent 1px 3px);
  box-shadow: inset 0 0 60px rgba(0, 0, 0, .55);
}
#flightCanvas {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 480 / 680;
  background: var(--scopeInk);
  touch-action: none;
  -webkit-tap-highlight-color: transparent;
}

/* boss bar sits over the canvas top edge, kept thin to protect the combat view */
.bossHud {
  position: absolute;
  z-index: 2;
  top: calc(var(--bezel) + 8px);
  left: calc(var(--bezel) + 10px);
  right: calc(var(--bezel) + 10px);
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: baseline;
  gap: 2px 10px;
  padding: 6px 10px 8px;
  background: rgba(10, 6, 4, .62);
  border: 1px solid rgba(232, 85, 59, .55);
  color: #ebe4cc;
  pointer-events: none;
  animation: bossIn .5s var(--ease) both;
}
.bossTag {
  font-family: var(--fontDisplay);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .22em;
  text-transform: uppercase;
  color: #e8553b;
}
.bossName {
  font-family: var(--fontDisplay);
  font-size: 15px;
  font-weight: 700;
  font-stretch: 85%;
  letter-spacing: .1em;
  text-transform: uppercase;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.bossHud .gauge { grid-column: 1 / -1; }

/* in-flight overlay — printed flimsy over a dimmed scope */
.flightOverlay {
  position: absolute;
  z-index: 3;
  inset: var(--bezel);
  display: grid;
  place-items: center;
  padding: 16px;
  background:
    repeating-linear-gradient(0deg, rgba(0, 0, 0, .25) 0 1px, transparent 1px 3px),
    rgba(6, 8, 4, .7);
  backdrop-filter: blur(2px) saturate(.6);
  -webkit-backdrop-filter: blur(2px) saturate(.6);
  animation: fadeIn .25s ease both;
}
.overlayCard {
  /* fixed paper palette in both themes */
  --ink0: #e9e1c6; --ink1: #efe8d2; --ink2: #f4efde; --ink3: #d9cfae;
  --line: #a59c78; --lineStrong: #7c7552;
  --olive: #4c5a1e; --amber: #a35f00; --amberGlow: rgba(163, 95, 0, .18);
  --paper: #1e2112; --paperStrong: #13160a; --muted: #545438; --faint: #8a8566;
  --signal: #a92d18; --onAmber: #fbf5e2;
  position: relative;
  width: min(100%, 340px);
  padding: 22px 20px 20px;
  background:
    repeating-linear-gradient(0deg, transparent 0 23px, rgba(76, 90, 30, .1) 23px 24px),
    #ece5cf;
  color: var(--paper);
  box-shadow: 0 20px 40px -10px rgba(0, 0, 0, .8);
  transform: rotate(-.6deg);
  animation: slip .45s var(--ease) both;
}
.overlayCard::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 6px;
  background: repeating-linear-gradient(-45deg, #13160a 0 6px, #a35f00 6px 12px);
}
.overlayKicker {
  display: inline-block;
  padding: 1px 8px;
  margin-bottom: 10px;
  border: 1.5px solid var(--signal);
  color: var(--signal);
  font-family: var(--fontDisplay);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .2em;
  text-transform: uppercase;
  transform: rotate(-2deg);
}
.overlayTitle {
  font-family: var(--fontDisplay);
  font-size: clamp(30px, 4vw, 42px);
  font-weight: 700;
  font-stretch: 75%;
  line-height: .9;
  text-transform: uppercase;
  color: var(--paperStrong);
}
.overlayText {
  margin-top: 10px;
  font-family: var(--fontType);
  font-size: 14px;
  line-height: 1.5;
  color: var(--paper);
}
.overlayActions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 18px; }
.overlayActions .btn { flex: 1 1 auto; }

/* touch controls — shown on coarse pointers, or forced by data-touch on <html> */
.touchPad { display: none; touch-action: none; -webkit-tap-highlight-color: transparent; }
.touchMove { grid-area: move; }
.touchFire { grid-area: fire; }

@media (hover: none) and (pointer: coarse) {
  .touchPad { display: grid; }
}
:root[data-touch="on"] .touchPad { display: grid; }
:root[data-touch="off"] .touchPad { display: none; }

.touchMove {
  --key: 50px;
  grid-template-columns: repeat(3, var(--key));
  grid-template-rows: repeat(3, var(--key));
  grid-template-areas: ". up ." "left hub right" ". down .";
  justify-content: center;
  align-content: center;
  align-self: end;
}
.touchUp { grid-area: up; }
.touchDown { grid-area: down; }
.touchLeft { grid-area: left; }
.touchRight { grid-area: right; }
.touchHub {
  grid-area: hub;
  margin: 8px;
  border-radius: 50%;
  background: radial-gradient(circle, var(--ink3), var(--ink0));
  border: 1px solid var(--line);
}

.touchKey {
  position: relative;
  border: 1px solid var(--lineStrong);
  background: linear-gradient(180deg, var(--ink3), var(--ink1));
  box-shadow: 0 3px 0 rgba(0, 0, 0, .45), inset 0 1px 0 rgba(255, 255, 255, .06);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  touch-action: none;
}
.touchUp { border-radius: 8px 8px 0 0; }
.touchDown { border-radius: 0 0 8px 8px; }
.touchLeft { border-radius: 8px 0 0 8px; }
.touchRight { border-radius: 0 8px 8px 0; }
.touchKey::before {
  content: "";
  position: absolute;
  inset: 0;
  margin: auto;
  width: 14px; height: 14px;
  background: var(--amber);
  clip-path: polygon(50% 8%, 95% 85%, 5% 85%);
}
.touchDown::before { transform: rotate(180deg); }
.touchLeft::before { transform: rotate(-90deg); }
.touchRight::before { transform: rotate(90deg); }

.touchKey:active,
.touchKey.is-held {
  transform: translateY(2px);
  box-shadow: 0 1px 0 rgba(0, 0, 0, .45);
  background: linear-gradient(180deg, var(--amberGlow), var(--ink1));
  border-color: var(--amber);
}

.touchFire {
  grid-template-columns: auto auto;
  grid-template-rows: auto auto;
  gap: 4px 14px;
  justify-content: center;
  align-content: center;
  align-self: end;
}
.fireKey {
  display: grid;
  place-items: center;
  border-radius: 50%;
  cursor: pointer;
  font-family: var(--fontDisplay);
  font-weight: 700;
  font-size: 22px;
  touch-action: none;
  -webkit-tap-highlight-color: transparent;
  transition: transform .06s;
}
.fireOne {
  grid-column: 2; grid-row: 2;
  width: 78px; height: 78px;
  background: radial-gradient(circle at 40% 35%, #ffd27a, #ffb12a 45%, #b57408);
  color: #120f05;
  border: 3px solid #120f05;
  box-shadow: 0 0 0 2px #ffb12a, 0 5px 0 #5a3a04, 0 0 24px -4px #ffb12a;
}
.fireTwo {
  grid-column: 1; grid-row: 1;
  width: 64px; height: 64px;
  margin-top: 2px;
  background: radial-gradient(circle at 40% 35%, #b4c27a, #7d8a4a 50%, #44501f);
  color: #0b0d08;
  border: 3px solid #0b0d08;
  box-shadow: 0 0 0 2px #8b9a52, 0 5px 0 #2a3112;
}
.fireKey:active,
.fireKey.is-held { transform: translateY(4px) scale(.97); box-shadow: 0 0 0 2px currentColor, 0 1px 0 #000; filter: brightness(1.15); }

/* ---- Play: portrait / narrow — HUD strip above, scope, controls below ---- */
@media (max-aspect-ratio: 5/6), (max-width: 680px) {
  .flightDeck {
    --pad: 8px;
    --gap: 8px;
    --bezel: 6px;
    --hudH: 118px;
    --touchH: 0px;
    --scopeW: min(
      calc(100vw - 2 * var(--pad) - 2 * var(--bezel)),
      calc((100dvh - var(--barH) - 2 * var(--pad) - 2 * var(--gap) - var(--hudH) - var(--touchH) - 2 * var(--bezel)) * 480 / 680)
    );
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    grid-template-rows: var(--hudH) auto auto;
    grid-template-areas:
      "mission status"
      "scope   scope"
      "move    fire";
    align-content: start;
    justify-content: stretch;
  }

  .deckPanel { padding: 9px 10px; gap: 6px; overflow: hidden; }
  .deckPanel::before { height: 2px; }
  .missionName { font-size: 14px; padding-bottom: 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .meter { gap: 3px; }
  .meter .hudLabel { display: none; }
  .airframeTag { display: none; }
  .gauge { height: 8px; }
  .comms { margin-top: 0; padding: 0; background: none; border: 0; box-shadow: none; }
  .commsLabel { display: none; }
  .radioMessage {
    font-size: 11.5px;
    line-height: 1.3;
    min-height: 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }
  .radioMessage::after { content: none; }

  .missionNo { font-size: 26px; }
  .flightDeck { --hudH: 132px; }
  .deckPanel { gap: 5px; }

  .touchMove { --key: 46px; justify-self: start; align-self: center; height: var(--touchH); }
  .touchFire { justify-self: end; align-self: center; height: var(--touchH); padding-right: 4px; }
  .fireOne { width: 72px; height: 72px; }
  .fireTwo { width: 58px; height: 58px; }
}
@media (max-aspect-ratio: 5/6) and (hover: none) and (pointer: coarse),
       (max-width: 680px) and (hover: none) and (pointer: coarse) {
  .flightDeck { --touchH: 150px; }
}
@media (max-aspect-ratio: 5/6), (max-width: 680px) {
  :root[data-touch="on"] .flightDeck { --touchH: 150px; }
  :root[data-touch="off"] .flightDeck { --touchH: 0px; }
}

/* ---- Play: short landscape (phones on their side) ---- */
@media (orientation: landscape) and (max-height: 560px) {
  :root:has([data-screen="play"]:not([hidden])) { --barH: 32px; }
  .classBar { font-size: 10.5px; gap: 10px; }
  .barSwitch { height: 24px; }
  .flightDeck {
    --pad: 6px;
    --gap: 8px;
    --bezel: 5px;
    --sideW: clamp(150px, 25vw, 240px);
  }
  .deckPanel { padding: 8px; gap: 5px; }
  .missionNo { font-size: 30px; }
  .missionName { font-size: 14px; padding-bottom: 6px; }
  .radioMessage { font-size: 11.5px; min-height: 0; }
  .comms { padding: 6px 8px; }
  .commsLabel { display: none; }
  .touchMove { --key: 42px; }
  .fireOne { width: 66px; height: 66px; }
  .fireTwo { width: 54px; height: 54px; }
}

/* ---- Play: compact status panel (portrait strip and short landscape) ---- */
@media (max-aspect-ratio: 5/6), (max-width: 680px), (orientation: landscape) and (max-height: 560px) {
  .panelStatus {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-content: start;
  }
  .panelStatus .panelRow { display: contents; }
  .panelStatus .panelRow .hudLabel { display: none; }
  .panelStatus > :not(.panelRow) { grid-column: 1 / -1; }
  .hudButton { grid-column: 2; grid-row: 1; height: 26px; padding: 0 8px; font-size: 10px; letter-spacing: .12em; }
  .panelStatus > .scoreReadout { grid-column: 1; grid-row: 1; margin: 0; font-size: 17px; line-height: 1.2; padding: 2px 8px; }
  .statPair { gap: 6px; }
  .stat { padding: 0 4px 1px; display: flex; align-items: baseline; justify-content: space-between; gap: 4px; border: 0; border-bottom: 1px dashed var(--line); }
  .stat .hudLabel { font-size: 9.5px; letter-spacing: .14em; }
  .statValue { font-size: 16px; }
  #shieldMeter { margin-top: 0; height: 6px; }
  .weaponBay { gap: 4px; }
  .weaponSlot { padding: 2px 6px 2px 30px; }
  .weaponSlot .slotName { padding-right: 28px; }
  .slotAmmo { right: 6px; bottom: auto; top: 50%; transform: translateY(-50%); font-size: 14px; }
  .slotAmmoInfinite { font-size: 15px; }
  .slotHint { display: none; }
  .slotKey { position: absolute; top: 50%; left: 9px; transform: translateY(-50%); }
  .slotKey b { width: 15px; height: 15px; font-size: 9px; }
  .slotName { margin: 0; font-size: 12.5px; line-height: 1.35; }
}

/* --------------------------------------------------------------------------
   Responsive — landing / guide
   -------------------------------------------------------------------------- */
@media (max-width: 920px) {
  .landing {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: auto auto;
    align-content: start;
    min-height: 0;
  }
  .hero { order: -1; }
  .heroScope { flex: none; width: 100%; height: clamp(220px, 44dvh, 460px); min-height: 0; }
  .launchPanel { width: min(100%, 520px); margin-inline: auto; padding-block: 0; gap: 20px; }
  .titleMain, .titleYear { font-size: clamp(48px, 13vw, 84px); }
  .titleSlash { font-size: clamp(40px, 10vw, 66px); }
  .classShip { display: none; }
}

@media (max-width: 640px) {
  body { font-size: 14px; }
  .classBar { grid-template-columns: auto 1fr auto; }
  .barText { display: none; }
  .themeText::after { font-size: 0; }
  .barSwitch { padding: 0 9px; }
  .profileBody { padding: 11px 9px 9px 10px; }
  .btn { padding-right: 12px; }
  .btnText { font-size: 16px; }
  .launchButtons .btnLaunch .btnText { font-size: 22px; }
  .profileTable { grid-template-columns: 1fr; }
  .airframeTrait { font-size: 10px; letter-spacing: .05em; }
  .keyTable > div { grid-template-columns: 1fr; gap: 4px; }
  .weaponTable { grid-template-columns: minmax(0, 1fr); }
  .intelFilter { flex: 1 1 100%; margin-left: 0; }
  .intel { --rosterCols: minmax(0, 1fr) auto; --rosterPreviewWidth: 52px; }
  .rosterColumns span:nth-child(2) { display: none; }
  .roster :is(dl, ul, ol) > :is(div, li) {
    position: relative;
    min-height: 58px;
    row-gap: 2px;
    padding: 8px 12px 8px calc(22px + var(--rosterPreviewWidth));
    align-content: center;
  }
  .rosterPreview { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); }
  .roster :is(dl, ul, ol) > :is(div, li) > :nth-child(2) { grid-column: 1 / -1; grid-row: 2; }
  .roster :is(dl, ul, ol) > :is(div, li) > :nth-child(3) { grid-column: 2; grid-row: 1; }
  .roster > section > h3 { padding-inline: 12px; }
  .rosterColumns { padding-inline: 12px; }
}

/* --------------------------------------------------------------------------
   New campaign confirmation dialog (native <dialog>, follows theme)
   -------------------------------------------------------------------------- */
.btnDanger {
  --btnBg: var(--signal);
  --btnInk: #fbf5e2;
  --btnEdge: var(--signal);
  box-shadow: 0 0 0 1px var(--signal), 0 0 24px -8px var(--signal);
}
.btnDanger .btnHazard { background: repeating-linear-gradient(-45deg, rgba(0, 0, 0, .55) 0 5px, transparent 5px 10px); }

.confirmDialog {
  width: min(calc(100vw - 32px), 480px);
  max-height: calc(100dvh - 32px);
  padding: 0;
  overflow: auto;
  border: 1px solid var(--lineStrong);
  border-radius: 0;
  background:
    repeating-linear-gradient(0deg, transparent 0 23px, var(--gridLine) 23px 24px),
    var(--ink1);
  color: var(--paper);
  font-family: var(--fontMono);
  box-shadow:
    0 0 0 5px var(--ink0),
    0 0 0 6px var(--line),
    0 30px 70px -20px rgba(0, 0, 0, .85);
  clip-path: polygon(0 0, calc(100% - 18px) 0, 100% 18px, 100% 100%, 18px 100%, 0 calc(100% - 18px));
}
.confirmDialog[open] { animation: dialogIn .35s var(--ease) both; }
.confirmDialog::backdrop {
  background:
    repeating-linear-gradient(0deg, rgba(0, 0, 0, .25) 0 1px, transparent 1px 3px),
    rgba(6, 8, 4, .72);
  backdrop-filter: blur(3px) saturate(.6);
  -webkit-backdrop-filter: blur(3px) saturate(.6);
}
:root[data-theme="light"] .confirmDialog::backdrop {
  background:
    repeating-linear-gradient(0deg, rgba(40, 34, 12, .08) 0 1px, transparent 1px 3px),
    rgba(52, 46, 24, .5);
}
.dialogStripe {
  height: 8px;
  background: repeating-linear-gradient(-45deg, var(--signal) 0 8px, var(--ink0) 8px 16px);
}
.dialogBody { display: grid; gap: 14px; padding: 22px 24px 24px; }
.dialogTitle {
  font-family: var(--fontDisplay);
  font-size: clamp(28px, 5vw, 38px);
  font-weight: 700;
  font-stretch: 75%;
  line-height: .95;
  text-transform: uppercase;
  color: var(--paperStrong);
}
.dialogText {
  padding: 10px 12px;
  font-family: var(--fontType);
  font-size: 14px;
  line-height: 1.55;
  border-left: 3px solid var(--signal);
  background: var(--ink2);
}
.dialogText b { color: var(--signal); font-weight: 700; }
.dialogActions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 10px; margin-top: 4px; }
.dialogActions .btn { flex: 1 1 160px; }

@keyframes dialogIn {
  from { opacity: 0; transform: translateY(16px) scale(.98); }
  to { opacity: 1; transform: none; }
}

/* state readouts inside #soundButton / #touchButton */
.switchState {
  min-width: 2.4em;
  padding: 1px 5px;
  border: 1px solid var(--line);
  color: var(--amber);
  font-size: 10px;
  letter-spacing: .12em;
  text-align: center;
}
.barSwitch[aria-pressed="false"] .switchState { color: var(--faint); }

/* #touchButton — only shown while the play screen is active */
.touchSwitch { display: none; }
body:has([data-screen="play"]:not([hidden])) .touchSwitch { display: inline-flex; }
.barLampTouch { background: linear-gradient(90deg, var(--amber) 0 50%, var(--faint) 50%); }
:root[data-touch="on"] .barLampTouch { background: var(--amber); }
:root[data-touch="off"] .barLampTouch { background: var(--faint); box-shadow: 0 0 0 2px rgba(0, 0, 0, .35); }

@media (max-width: 640px) {
  .dialogBody { padding: 18px 16px 18px; }
}
@media (max-width: 520px) {
  .airframeSpecs { grid-template-columns: minmax(0, 1fr); }
}

/* --------------------------------------------------------------------------
   Motion
   -------------------------------------------------------------------------- */
@keyframes rise {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: none; }
}
@keyframes develop {
  0% { opacity: 0; filter: brightness(2.2) contrast(.4) blur(2px); }
  40% { opacity: 1; }
  100% { opacity: 1; filter: none; }
}
@keyframes lampBlink { 0%, 62% { opacity: 1; } 63%, 100% { opacity: .25; } }
@keyframes sweep { to { transform: rotate(360deg); } }
@keyframes scan { from { transform: translateY(-10px); } to { transform: translateY(670px); } }
@keyframes drift {
  from { transform: translate(-6px, 4px); }
  to { transform: translate(8px, -10px); }
}
@keyframes burn { 0% { opacity: 1; } 100% { opacity: .78; } }
@keyframes plume { 0% { transform: scaleY(1); } 100% { transform: scaleY(.93); } }
@keyframes shipDevelop {
  0% { opacity: 0; }
  35% { opacity: .55; }
  48% { opacity: .3; }
  100% { opacity: 1; }
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes slip {
  from { opacity: 0; transform: translateY(-18px) rotate(-3deg); }
  to { opacity: 1; transform: rotate(-.6deg); }
}
@keyframes bossIn {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
  }
  .heroSweep, .heroScan, .heroDrift, .heroEngines, .heroPlume { animation: none !important; }
}
