:root {
  color-scheme: dark;
  --ink: #05070d;
  --panel: #0a0d15;
  --panel-edge: #242b3c;
  --cream: #f4e9ce;
  --muted: #8791a6;
  --cyan: #6ff7ff;
  --cyan-dim: #1a9aa8;
  --amber: #ffb429;
  --red: #ff4d57;
  --green: #55f29a;
  --line: rgba(159, 176, 206, 0.18);
  font-family: "SFMono-Regular", "Roboto Mono", "Cascadia Mono", Menlo, Consolas, monospace;
}

* {
  box-sizing: border-box;
}

.difficulty-picker {
  display: grid;
  grid-template-columns: auto auto;
  justify-content: center;
  align-items: center;
  gap: 12px;
  max-width: 25rem;
  margin: 20px auto 8px;
  color: var(--amber);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-align: center;
  text-transform: uppercase;
}
.difficulty-options {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  width: max-content;
  max-width: 100%;
  justify-self: center;
}
.difficulty-option {
  min-width: 0;
  min-height: 34px;
  padding: 8px 14px;
  border: 1px solid var(--panel-edge);
  border-radius: 0;
  background: var(--panel);
  color: var(--cream);
  font: inherit;
  text-align: center;
  text-transform: uppercase;
  cursor: pointer;
  transition: background 120ms ease, border-color 120ms ease, color 120ms ease;
}
.difficulty-option[aria-checked="true"] {
  border-color: var(--cyan);
  background: rgba(111, 247, 255, 0.16);
  color: var(--cyan);
}
.difficulty-option:focus {
  outline: 2px solid var(--cream);
  outline-offset: 3px;
}
#start-button:focus,
#restart-button:focus,
#ld-controls-continue:focus {
  outline: 2px solid var(--cyan);
  outline-offset: 4px;
}
.difficulty-description {
  max-width: 25rem;
  margin: 8px auto;
  color: var(--muted);
  font: 12px/1.5 system-ui, sans-serif;
  text-align: center;
}
#start-difficulty-description {
  margin-bottom: 24px;
}

html,
body {
  margin: 0;
  min-height: 100%;
  background: var(--ink);
}

body {
  min-height: 100dvh;
  color: var(--cream);
  overflow-x: hidden;
  background-image:
    radial-gradient(circle at 50% 18%, rgba(39, 62, 91, 0.22), transparent 34rem),
    linear-gradient(rgba(255, 255, 255, 0.018) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.018) 1px, transparent 1px);
  background-size: auto, 32px 32px, 32px 32px;
}

button,
kbd {
  font: inherit;
}

button {
  color: inherit;
}

.arcade-shell {
  width: min(100%, 1440px);
  min-height: 100dvh;
  margin: 0 auto;
  padding: 24px;
  display: grid;
  grid-template-columns: minmax(190px, 1fr) minmax(360px, 720px) minmax(190px, 1fr);
  gap: 28px;
  align-items: center;
}

/* Major-context curtain. It covers the whole cabinet so the playfield and
   contextual side panels change as one scene. */
html.scene-transitions .arcade-shell::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 1000;
  pointer-events: none;
  background: var(--ink);
  opacity: 0;
  transition: opacity 750ms cubic-bezier(0.4, 0, 0.2, 1);
}

html.scene-transitions.scene-transition--dark .arcade-shell::after {
  opacity: 1;
}

.side-panel {
  align-self: stretch;
  max-height: 900px;
  padding: 40px 8px 24px;
  display: flex;
  flex-direction: column;
  gap: 40px;
}

.side-panel--right {
  padding-top: 72px;
}

.right-panel-starfield {
  display: none;
}

.brand-lockup h1 {
  margin: 8px 0 0;
  line-height: 0;
}

.brand-lockup h1 img {
  display: block;
  width: min(100%, 240px);
  height: auto;
}

.eyebrow,
.section-label,
.kicker,
.subtitle,
.start-hint {
  margin: 0;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.eyebrow,
.section-label,
.subtitle,
.start-hint {
  color: var(--muted);
}

.subtitle {
  margin-top: 9px;
  color: var(--cyan-dim);
}

.section-label {
  margin-bottom: 14px;
  color: var(--amber);
}

.briefing,
.field-note {
  border-left: 1px solid var(--panel-edge);
  padding-left: 16px;
}

.briefing > p:not(.section-label),
.field-note p:last-child {
  margin: 0;
  max-width: 26ch;
  color: #aeb6c7;
  font-family: Inter, ui-sans-serif, system-ui, sans-serif;
  font-size: 15px;
  line-height: 1.55;
}

.briefing > p:not(.section-label) + p:not(.section-label) {
  margin-top: 1em;
}

.stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px 10px;
  margin: 0;
  padding: 18px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.stats div {
  min-width: 0;
}

.stats dt {
  margin-bottom: 5px;
  color: var(--muted);
  font-size: 12px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
}

#high-score-label {
  letter-spacing: 0.05em;
}

.stats dd {
  margin: 0;
  color: var(--cream);
  font-family: "Arial Narrow", Impact, sans-serif;
  font-size: clamp(18px, 2vw, 25px);
  font-weight: 700;
  letter-spacing: 0.04em;
}

.signal {
  margin-top: auto;
  display: flex;
  align-items: end;
  gap: 5px;
  height: 20px;
}

.signal span {
  display: block;
  width: 4px;
  background: var(--cyan-dim);
  opacity: 0.7;
}

.signal span:nth-child(1), .signal span:nth-child(6) { height: 4px; }
.signal span:nth-child(2), .signal span:nth-child(5) { height: 9px; }
.signal span:nth-child(3), .signal span:nth-child(4) { height: 16px; }

/* Squad comms feed. Normal traffic persists as individual cards in
   chronological order; new cards enter at the bottom and move history up.
   Three modes on [data-mode] remain: cold, live, and standby. */
.comms {
  min-height: 0;
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
}

.location-title {
  margin: 0 0 14px;
  color: var(--muted);
  opacity: 0.55;
  font-family: Impact, Haettenschweiler, "Arial Narrow Bold", sans-serif;
  font-size: clamp(32px, 3vw, 52px);
  font-weight: 700;
  line-height: 1;
  letter-spacing: 0.01em;
  text-transform: uppercase;
}

html:not(.scene-polaris) .location-title--polaris,
html.scene-polaris .location-title--kestrel {
  display: none;
}

.comms-feed {
  min-height: 0;
  flex: 1 1 430px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: 8px;
  padding: 2px;
  -webkit-mask-image: linear-gradient(to bottom, transparent 0, #000 30px);
  mask-image: linear-gradient(to bottom, transparent 0, #000 30px);
}

.comms-feed.is-empty {
  justify-content: flex-start;
  -webkit-mask-image: none;
  mask-image: none;
}

.comms-card {
  flex: 0 0 auto;
  border: 1px solid var(--panel-edge);
  background: rgba(4, 7, 14, 0.72);
  padding: 0 11px 9px;
  transition: border-color 260ms ease, opacity 260ms ease;
}

html.scene-polaris .comms-card {
  background: rgba(4, 7, 14, 0.86);
}

.comms-card-head {
  display: flex;
  gap: 10px;
  align-items: center;
  min-height: 48px;
  margin: 0 -11px 7px;
  padding: 7px 10px;
  border-bottom: 1px solid var(--panel-edge);
}

.comms-card-glyph {
  width: 30px;
  height: 30px;
  flex: 0 0 auto;
  object-fit: contain;
  filter: grayscale(1);
  opacity: 0.32;
  transition: filter 220ms ease, opacity 220ms ease;
}

.comms-card-id {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.comms-card .who {
  margin: 0;
  color: var(--cyan-dim);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.16em;
}

.comms-card.msg--them .who {
  color: var(--muted);
}

.comms-card .channel {
  color: #57607a;
  font-size: 9px;
  letter-spacing: 0.14em;
}

.comms-card .said {
  margin: 0;
  color: var(--cream);
  font-size: 14px;
  line-height: 1.5;
  transition: color 260ms ease;
}

.comms-card .comms-pending {
  visibility: hidden;
}

.comms-card.msg--them .said {
  color: #a9b6cc;
}

.comms-card.receiving .said {
  color: var(--amber);
}

.comms-card.live {
  border-color: rgba(111, 247, 255, 0.38);
}

.comms-card.live .who {
  color: var(--cyan);
}

.comms-card.live .said {
  color: var(--amber);
}

.comms-viz {
  width: min(118px, 40%);
  height: 24px;
  margin-left: auto;
  flex: 0 1 118px;
  display: block;
  opacity: 0.58;
  transition: opacity 220ms ease;
}

.comms-card.live .comms-card-glyph {
  filter: drop-shadow(0 0 5px rgba(111, 247, 255, 0.45));
  opacity: 1;
}

.comms-card.live .comms-viz {
  opacity: 1;
}

.comms-empty {
  display: none;
}

.comms-strip {
  margin-top: 8px;
  padding: 6px 10px;
  display: flex;
  justify-content: space-between;
  border: 1px solid var(--panel-edge);
  background: rgba(4, 7, 14, 0.55);
  font-size: 10px;
  letter-spacing: 0.14em;
}

html.scene-polaris .comms-strip {
  background: rgba(4, 7, 14, 0.72);
}

.comms-status,
.comms-channel {
  color: var(--muted);
}

.comms[data-mode="live"] .comms-status {
  color: var(--green);
}

.cabinet {
  width: 100%;
  max-width: 720px;
  justify-self: center;
}

.screen-frame {
  position: relative;
  width: 100%;
  aspect-ratio: 4 / 5;
  overflow: hidden;
  border: 1px solid #30394e;
  background: #02040a;
  box-shadow: 0 0 0 8px #080b12, 0 0 0 9px #202738, 0 28px 80px rgba(0, 0, 0, 0.48);
}

canvas {
  display: block;
  width: 100%;
  height: 100%;
  touch-action: none;
}

.scanlines {
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0.25;
  background: repeating-linear-gradient(to bottom, transparent 0 3px, rgba(2, 4, 10, 0.22) 3px 4px);
  mix-blend-mode: multiply;
}

.overlay {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: grid;
  place-items: center;
  padding: 32px;
  text-align: center;
  background: radial-gradient(circle at 50% 42%, rgba(4, 23, 39, 0.28), rgba(2, 4, 10, 0.76) 67%);
  transition: opacity 180ms ease, visibility 180ms ease;
}

.overlay--hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.overlay-content {
  position: relative;
  width: min(100%, 420px);
}

.transmission-overlay {
  z-index: 3;
  padding: 24px;
  background:
    linear-gradient(rgba(1, 8, 14, 0.68), rgba(1, 5, 12, 0.9)),
    radial-gradient(circle at 50% 40%, rgba(26, 154, 168, 0.2), transparent 66%);
}

.transmission-card {
  width: min(100%, 500px);
  padding: 22px;
  border: 1px solid rgba(111, 247, 255, 0.42);
  background: rgba(3, 10, 19, 0.94);
  box-shadow: inset 0 0 42px rgba(111, 247, 255, 0.04), 0 0 32px rgba(0, 0, 0, 0.46);
  text-align: left;
}

.transmission-meta {
  display: flex;
  justify-content: space-between;
  margin-bottom: 26px;
  color: #68758a;
  font-size: 11px;
  letter-spacing: 0.12em;
}

.transmission-lock {
  color: var(--green);
}

.transmission-card .kicker {
  color: var(--amber);
}

.transmission-card h2 {
  margin: 8px 0 2px;
  color: var(--cream);
  font-family: Impact, Haettenschweiler, "Arial Narrow Bold", sans-serif;
  font-size: clamp(34px, 7vw, 52px);
  font-weight: 400;
  line-height: 0.95;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.transmission-designation {
  margin: 0 0 18px;
  color: var(--muted);
  font-size: 13px;
  letter-spacing: 0.14em;
}

.transmission-video {
  position: relative;
  aspect-ratio: 16 / 9;
  margin-bottom: 18px;
  overflow: hidden;
  display: grid;
  place-content: center;
  gap: 8px;
  border: 1px solid rgba(111, 247, 255, 0.3);
  color: rgba(174, 247, 248, 0.84);
  text-align: center;
  background:
    repeating-linear-gradient(to bottom, transparent 0 3px, rgba(111, 247, 255, 0.045) 3px 4px),
    linear-gradient(135deg, rgba(9, 51, 61, 0.54), rgba(3, 13, 24, 0.96));
}

.transmission-video--media {
  display: block;
  background: #000;
}

.transmission-media {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #000;
}

.transmission-video::after {
  content: "";
  position: absolute;
  inset: -30% 0 auto;
  height: 32%;
  background: linear-gradient(transparent, rgba(111, 247, 255, 0.11), transparent);
  animation: transmission-scan 2.2s linear infinite;
}

.transmission-video strong {
  font-size: 14px;
  letter-spacing: 0.15em;
}

.transmission-video small {
  color: #6d7d8e;
  font-size: 11px;
  letter-spacing: 0.1em;
}

.transmission-signal {
  height: 30px;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 5px;
}

.transmission-signal span {
  width: 4px;
  height: 30%;
  background: var(--cyan);
  box-shadow: 0 0 6px rgba(111, 247, 255, 0.65);
  animation: transmission-bars 900ms ease-in-out infinite alternate;
}

.transmission-signal span:nth-child(2) { animation-delay: -180ms; }
.transmission-signal span:nth-child(3) { animation-delay: -360ms; }
.transmission-signal span:nth-child(4) { animation-delay: -540ms; }
.transmission-signal span:nth-child(5) { animation-delay: -720ms; }

.transmission-brief {
  margin: 0 0 20px;
  color: #b8c2d4;
  font-size: 14px;
  line-height: 1.7;
}

.transmission-card .primary-button,
.transmission-card .start-hint {
  display: block;
  margin-inline: auto;
  text-align: center;
}

.transmission-card .transmission-control--hidden {
  visibility: hidden;
  pointer-events: none;
}

.tutorial-popover {
  position: absolute;
  inset: 0;
  z-index: 3;
  display: grid;
  place-items: center;
  padding: 24px;
  background: linear-gradient(
    to bottom,
    rgba(2, 5, 12, 0.18),
    rgba(2, 5, 12, 0.58) 34%,
    rgba(2, 5, 12, 0.58) 66%,
    rgba(2, 5, 12, 0.18)
  );
  transition: opacity 150ms ease, visibility 0s linear;
}

.tutorial-popover--hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition-delay: 0s, 150ms;
}

.tutorial-popover--dock-intro {
  transition-duration: 360ms, 0s;
}

.tutorial-popover--instant-hide {
  transition: none;
}

.tutorial-card {
  width: min(100%, 560px);
  padding: 24px;
  border-top: 1px solid rgba(255, 180, 41, 0.72);
  border-bottom: 1px solid rgba(255, 180, 41, 0.72);
  background: rgba(3, 9, 18, 0.94);
  box-shadow: 0 0 42px rgba(0, 0, 0, 0.72);
  text-align: center;
}

.tutorial-card .kicker {
  color: var(--amber);
}

.tutorial-copy {
  margin: 16px auto 20px;
  max-width: 46ch;
  color: var(--cream);
  font-family: Inter, ui-sans-serif, system-ui, sans-serif;
  font-size: clamp(15px, 2.2vw, 18px);
  line-height: 1.55;
}

@keyframes transmission-scan {
  to { transform: translateY(520%); }
}

@keyframes transmission-bars {
  to { height: 100%; }
}

.title-card .kicker,
.compact-card .kicker {
  margin-bottom: 24px;
  color: var(--red);
}

.title-logo {
  display: block;
  width: min(100%, 460px);
  height: auto;
  margin: -8px auto 34px;
  transform: translateX(8.3%);
}

.primary-button {
  min-width: 190px;
  padding: 14px 22px;
  border: 1px solid var(--cyan);
  border-radius: 0;
  background: rgba(11, 35, 45, 0.86);
  color: var(--cyan);
  font-size: 14px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  cursor: pointer;
  box-shadow: inset 0 0 20px rgba(111, 247, 255, 0.08), 0 0 20px rgba(111, 247, 255, 0.08);
  transition: background 120ms ease, color 120ms ease, transform 120ms ease;
}

.primary-button:hover,
.primary-button:focus-visible {
  outline: none;
  background: var(--cyan);
  color: var(--ink);
  transform: translateY(-2px);
}

.start-hint {
  margin-top: 16px;
  animation: hint-pulse 1.6s ease-in-out infinite;
}

@keyframes hint-pulse {
  50% {
    opacity: 0.35;
  }
}

/* ---------- gamepad glyph vocabulary ----------
   Approved in pad-glyph-conventions-mockup.html, 2026-08-25. Face buttons are
   round and colored (Xbox: A green, B red), the trigger is a rounded-top slab,
   the stick a top-down cap in a ring, the D-pad a cross, Menu the round ≡.
   Base size sits inline with 12-13px hint text; --lg matches the interstitial
   legend's kbd chips. Hints gate their pad half on body.has-pad, kept live by
   pollGamepad (game) and the landing's poll loop: .hint-pad segments appear,
   .hint-kb-only segments hide, while a pad is live. */
.pad-chip {
  display: inline-flex; align-items: center; justify-content: center;
  width: 19px; height: 19px; border-radius: 50%;
  font-size: 10px; font-weight: 700; letter-spacing: 0;
  vertical-align: 1px;
}
.pad-chip--a { background: var(--green); color: var(--ink); }
.pad-chip--b { background: var(--red); color: var(--ink); }
.pad-chip--menu {
  background: linear-gradient(180deg, #1a2130, #10141f);
  border: 1px solid var(--panel-edge);
  color: var(--cream);
}
.pad-trigger {
  display: inline-flex; align-items: center; justify-content: center;
  width: 27px; height: 19px; border-radius: 9px 9px 4px 4px;
  background: linear-gradient(180deg, #1a2130, #10141f);
  border: 1px solid var(--panel-edge); border-bottom-width: 2px;
  font-size: 9px; font-weight: 700; letter-spacing: 0.05em; color: var(--cream);
  vertical-align: 1px;
}
.pad-stick {
  display: inline-block; width: 19px; height: 19px; border-radius: 50%;
  border: 1.5px solid #4a5570;
  background: radial-gradient(circle at 50% 50%, #8fa0bd 0 4.5px, rgba(0, 0, 0, 0) 5.5px),
    linear-gradient(180deg, #1a2130, #10141f);
  vertical-align: -4px;
}
.pad-dpad {
  display: inline-block; width: 19px; height: 19px;
  background: linear-gradient(180deg, #2a3348, #1a2130);
  clip-path: polygon(34% 0, 66% 0, 66% 34%, 100% 34%, 100% 66%, 66% 66%, 66% 100%, 34% 100%, 34% 66%, 0 66%, 0 34%, 34% 34%);
  vertical-align: -4px;
}
.pad-glyph--lg.pad-chip, .pad-glyph--lg.pad-stick { width: 23px; height: 23px; font-size: 11px; }
.pad-glyph--lg.pad-chip--menu { font-size: 12px; }
.pad-glyph--lg.pad-trigger { width: 32px; height: 23px; font-size: 10px; }
.pad-glyph--lg.pad-dpad { width: 23px; height: 23px; }
.pad-glyph--lg.pad-stick, .pad-glyph--lg.pad-dpad { vertical-align: -6px; }
.pad-word {
  font-size: 11px; font-weight: 700; letter-spacing: 0.08em;
  color: var(--muted); margin-left: 2px;
}
.hint-pad { display: none; }
body.has-pad .hint-pad { display: inline; }
body.has-pad .hint-kb-only { display: none; }

.compact-card {
  padding: 40px 24px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: rgba(3, 7, 15, 0.88);
}

.compact-card h2 {
  margin: 0 0 30px;
  font-family: Impact, Haettenschweiler, "Arial Narrow Bold", sans-serif;
  font-size: 52px;
  line-height: 1;
  letter-spacing: 0.01em;
  text-transform: uppercase;
}

.final-score {
  margin: -15px 0 8px;
  color: var(--cyan);
  font-size: 36px;
  font-weight: 800;
}

.end-detail {
  margin: 0 0 28px;
  color: var(--muted);
  font-size: 13px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.control-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.control-list li {
  min-height: 32px;
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: 9px;
}

.control-list li > span {
  width: 48px;
  color: #b6bed0;
  text-transform: uppercase;
}

.control-list small {
  color: #596276;
}

kbd {
  min-width: 26px;
  padding: 6px 7px;
  border: 1px solid #343c50;
  border-bottom-color: #576178;
  background: #10141f;
  color: var(--cream);
  font-size: 8px;
  text-align: center;
  box-shadow: 0 2px 0 #252c3d;
}

.targets {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.target-row {
  min-height: 42px;
  display: flex;
  align-items: center;
  gap: 14px;
}

.target-row div {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.target-row strong {
  color: #c6cddd;
  font-size: 10px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.target-row small {
  color: #5e687d;
  font-size: 8px;
}

.enemy-icon {
  position: relative;
  width: 28px;
  height: 24px;
  display: inline-block;
  clip-path: polygon(50% 0, 67% 26%, 100% 40%, 78% 62%, 90% 100%, 53% 75%, 50% 100%, 47% 75%, 10% 100%, 22% 62%, 0 40%, 33% 26%);
}

.enemy-icon--razor { background: var(--red); }
.enemy-icon--mantis { background: var(--green); transform: rotate(180deg); }
.enemy-icon--crown { background: var(--amber); }

.enemy-icon-img {
  width: 28px;
  height: 28px;
  object-fit: contain;
  image-rendering: pixelated;
}

.enemy-icon-img--smooth {
  image-rendering: auto;
  mix-blend-mode: screen;
}

.sound-button {
  margin-top: auto;
  align-self: flex-start;
  padding: 9px 12px;
  border: 1px solid var(--panel-edge);
  background: transparent;
  color: var(--muted);
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
}

.sound-button:hover,
.sound-button:focus-visible {
  outline: 1px solid var(--cyan-dim);
  color: var(--cream);
}

.sound-dot {
  display: inline-block;
  width: 6px;
  height: 6px;
  margin-right: 7px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 6px var(--green);
}

.sound-button[aria-pressed="true"] .sound-dot {
  background: #5c6371;
  box-shadow: none;
}

.touch-controls {
  display: none;
  padding-top: 14px;
  justify-content: space-between;
  align-items: center;
}

.touch-controls button {
  border: 1px solid #344057;
  background: #0b101b;
  color: var(--cream);
  cursor: pointer;
  user-select: none;
  touch-action: none;
}

.move-controls {
  display: flex;
  gap: 10px;
}

.move-controls button {
  width: 64px;
  height: 52px;
  font-size: 22px;
}

.touch-controls .fire-button {
  width: 84px;
  height: 52px;
  border-color: #7e313a;
  color: #ff7880;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.12em;
}

.touch-controls .shield-button {
  width: 84px;
  height: 52px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.12em;
  background: rgba(111, 247, 255, 0.12);
  border: 1px solid rgba(111, 247, 255, 0.5);
  color: #6ff7ff;
}

.touch-controls button:active,
.touch-controls button.is-active {
  background: #1b2639;
  transform: translateY(1px);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

@media (min-width: 1041px) and (min-height: 761px) {
  html.layout-wide body {
    height: 100dvh;
    display: grid;
    place-items: center;
    overflow: hidden;
  }

  html.layout-wide .arcade-shell {
    width: min(calc(100vw - 2rem), calc((100dvh - 2rem) * 16 / 9));
    min-height: 0;
    max-width: none;
    aspect-ratio: 16 / 9;
    padding: 1rem;
    grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
    gap: 1.25rem;
  }

  html.layout-wide .cabinet {
    width: auto;
    height: 100%;
    min-width: 0;
    min-height: 0;
    max-width: none;
    max-height: 100%;
    aspect-ratio: 4 / 5;
  }

  html.layout-wide .screen-frame,
  html.layout-wide canvas {
    min-width: 0;
    min-height: 0;
  }

  html.layout-wide .side-panel {
    width: min(100%, 15rem);
    height: 100%;
    min-height: 0;
    max-height: 100%;
    padding: clamp(1.25rem, 3dvh, 2rem) 0 1.25rem;
    gap: clamp(1.25rem, 3dvh, 2rem);
  }

  html.layout-wide .side-panel--left {
    justify-self: end;
  }

  html.layout-wide .side-panel--right {
    justify-self: start;
    padding-top: clamp(2rem, 4.5dvh, 3.25rem);
  }

  html.layout-wide .brand-lockup h1 img {
    width: min(100%, 220px);
  }

  html.layout-wide body {
    background-image: radial-gradient(circle at 50% 18%, rgba(39, 62, 91, 0.22), transparent 34rem);
  }

  html.layout-wide .side-panel {
    position: relative;
    isolation: isolate;
    width: 100%;
    overflow: hidden;
    padding: clamp(1.25rem, 3dvh, 2rem);
    border: 1px solid rgba(77, 101, 128, 0.42);
    background: #050914;
  }

  html.layout-wide .side-panel::before,
  html.layout-wide .side-panel::after {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
  }

  html.layout-wide .side-panel::before {
    z-index: 0;
    background-repeat: no-repeat;
    background-size: cover;
  }

  html.layout-wide .side-panel::after {
    z-index: 1;
  }

  html.layout-wide .side-panel > * {
    position: relative;
    z-index: 2;
  }

  html.layout-wide .right-panel-starfield {
    position: absolute;
    inset: 0;
    z-index: 0;
    display: block;
    width: 100%;
    height: 100%;
    pointer-events: none;
  }

  html.layout-wide .side-panel--left::before {
    background-image: url("assets/f333881331b16ca5d5d3/images/side-panels/outer-reach-facility.png");
    background-position: center;
  }

  html.layout-wide .side-panel--left::after {
    background:
      linear-gradient(90deg, rgba(2, 7, 14, 0.08), rgba(2, 7, 14, 0.28)),
      linear-gradient(180deg, rgba(3, 9, 17, 0.28), rgba(3, 9, 17, 0.04) 46%, rgba(3, 9, 17, 0.2));
  }

  html.layout-wide .side-panel--right::before {
    z-index: 1;
    background-image: url("assets/f333881331b16ca5d5d3/images/side-panels/outer-reach-orbit-matted.png");
    background-position: right center;
  }

  html.layout-wide.scene-polaris .side-panel--left::before {
    background-image: url("assets/f333881331b16ca5d5d3/images/side-panels/polaris-dock-4-interior-panel.png");
    background-position: center;
  }

  html.layout-wide.scene-polaris .side-panel--right::before {
    background-image: url("assets/f333881331b16ca5d5d3/images/side-panels/polaris-exterior-matted.png");
    background-position: center;
  }

  html.layout-wide .side-panel--right::after {
    z-index: 2;
    background:
      linear-gradient(90deg, rgba(2, 6, 13, 0.28), rgba(2, 6, 13, 0.16) 38%, rgba(2, 6, 13, 0.02) 78%),
      linear-gradient(180deg, rgba(2, 6, 13, 0.08), transparent 58%, rgba(2, 6, 13, 0.06));
  }

  html.layout-wide .side-panel--right > :not(.right-panel-starfield) {
    z-index: 3;
  }

  html.layout-wide .side-panel--left {
    gap: clamp(0.85rem, 2dvh, 1.4rem);
  }

  html.layout-wide .briefing,
  html.layout-wide .stats {
    width: 100%;
    border: 1px solid rgba(125, 151, 177, 0.5);
    border-radius: 7px;
    background: rgba(4, 13, 24, 0.73);
    box-shadow: inset 0 1px rgba(255, 255, 255, 0.025);
  }

  html.layout-wide .briefing {
    padding: clamp(0.9rem, 2dvh, 1.25rem);
  }

  html.layout-wide .briefing > p:not(.section-label) {
    max-width: none;
    color: #d6deec;
  }

  html.layout-wide .stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: clamp(0.8rem, 2dvh, 1.2rem);
    padding: clamp(0.9rem, 2dvh, 1.25rem);
  }

  html.layout-wide .stats dd {
    font-size: clamp(17px, 1.4vw, 24px);
  }

  /* The 15rem cap and the flex-start shrink that used to size these children
     were both for the control lists and target rows the panel no longer
     carries. Removed with them — panel content now stretches to the panel. */
}

@media (min-width: 1440px) and (min-height: 761px) {
  html.layout-wide .stats {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

@media (min-width: 1041px) and (min-height: 761px) and (min-aspect-ratio: 16 / 9) {
  html.layout-wide .arcade-shell {
    place-self: center;
    margin-inline: auto;
  }
}

@media (min-width: 1041px) and (min-height: 761px) and (max-height: 850px) {
  html.layout-wide .side-panel {
    padding: 1rem 0 0.75rem;
    gap: 1rem;
  }

  html.layout-wide .side-panel--right {
    padding-top: 1.5rem;
  }
}

@media (max-width: 1040px) {
  .arcade-shell {
    grid-template-columns: minmax(0, 720px) 200px;
    justify-content: center;
  }

  .side-panel--left {
    display: none;
  }
}

@media (hover: none), (pointer: coarse) {
  .touch-controls {
    display: flex;
  }
}

@media (max-width: 760px) {
  body {
    background-image: radial-gradient(circle at 50% 15%, rgba(39, 62, 91, 0.2), transparent 24rem);
  }

  .arcade-shell {
    min-height: auto;
    padding: 0 0 max(12px, env(safe-area-inset-bottom));
    display: block;
  }

  .side-panel {
    display: none;
  }

  .screen-frame {
    border-inline: 0;
    box-shadow: none;
  }

  .touch-controls {
    display: flex;
    padding-inline: 16px;
  }
}

@media (max-height: 760px) and (orientation: landscape) {
  .arcade-shell {
    min-height: auto;
    padding-block: 8px;
  }

  .cabinet {
    width: min(74vh, 720px);
  }

  .side-panel {
    padding-block: 28px 12px;
    gap: 24px;
  }
}

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

/* ── Kinetic Salvage (chapter 1 bonus stage) ──────────────────────────────
   Left-panel readouts, dock-control tutorial variant, and the payout modal,
   per the approved campaign shell board (kinetic-campaign-shell-mockup.html). */

#ks-panel {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* An author display beats the UA's [hidden] rule, so restate it: outside the
   salvage stage this panel must not exist visually. (Shipped visible on the
   title screen before this rule — caught in play review 2026-08-19.) */
#ks-panel[hidden] {
  display: none;
}

.ks-block {
  padding: 13px 12px;
  border: 1px solid #34415a;
  border-left: 3px solid var(--cyan);
  background: rgba(4, 13, 24, 0.73);
}

.ks-block--style {
  border-left-color: var(--amber);
}

.ks-label {
  margin: 0 0 7px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.14em;
}

.ks-big {
  color: var(--cyan);
  font: 900 34px/0.9 Impact, "Arial Narrow", sans-serif;
  font-variant-numeric: tabular-nums;
}

.ks-block--style .ks-big {
  color: var(--amber);
}

.ks-big small {
  color: var(--muted);
  font: 800 13px/1 "SFMono-Regular", Menlo, monospace;
}

.ks-big .v-amber { color: var(--amber); }
.ks-big .v-red { color: var(--red); }

.ks-sub {
  margin-top: 6px;
  color: var(--cream);
  font: 800 12px/1 "SFMono-Regular", Menlo, monospace;
  font-variant-numeric: tabular-nums;
}

.ks-sub small {
  color: var(--muted);
  font-size: 12px;
}

.ks-track {
  height: 7px;
  margin-top: 9px;
  border: 1px solid #34415a;
  background: #03060c;
}

.ks-track span {
  display: block;
  width: 100%;
  height: 100%;
  background: var(--cyan);
  transition: background-color 0.25s ease;
}

/* Same gain/loss grammar as the proof's side panel. */
.ks-block.gain { animation: ks-gain-pulse 0.55s ease-out; }
.ks-block.loss { animation: ks-loss-pulse 0.55s ease-out; }

@keyframes ks-gain-pulse {
  45% { border-color: var(--amber); box-shadow: 0 0 22px rgba(255, 180, 41, 0.32); }
}

@keyframes ks-loss-pulse {
  45% { border-color: var(--red); box-shadow: 0 0 24px rgba(255, 77, 87, 0.38); }
}

/* Dock Control tutorial cards anchor top-of-field over the scripted demos
   (accepted proof presentation); the Commander's briefs stay centered. */
.tutorial-popover--dock {
  place-items: start center;
  padding-top: 4.5%;
  background: linear-gradient(
    to bottom,
    rgba(2, 5, 12, 0.14),
    rgba(2, 5, 12, 0.5) 8%,
    rgba(2, 5, 12, 0.5) 30%,
    rgba(2, 5, 12, 0.1) 44%,
    rgba(2, 5, 12, 0)
  );
}

.ghost-button {
  margin-left: 10px;
  padding: 10px 18px;
  border: 1px solid #3a4861;
  border-radius: 3px;
  background: #121925;
  color: var(--muted);
  font: 700 13px/1 "SFMono-Regular", Menlo, monospace;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
}

.ghost-button:hover,
.ghost-button:focus-visible {
  border-color: var(--cyan);
  color: var(--cream);
  outline: none;
}

/* Tutorial cards are driven by gamepad and keyboard focus movement, where the
   browser's focus-visible heuristics don't always apply — always show which
   control is armed. */
.tutorial-card .primary-button:focus,
.tutorial-card .ghost-button:focus {
  outline: 2px solid var(--cyan);
  outline-offset: 3px;
}

/* Payout modal: itemized multipliers land beat by beat over the dock scene. */
.payout-card {
  width: min(100%, 460px);
  padding: 26px 24px 22px;
  border-top: 1px solid rgba(255, 180, 41, 0.72);
  border-bottom: 1px solid rgba(255, 180, 41, 0.72);
  background: rgba(3, 9, 18, 0.95);
  box-shadow: 0 0 52px rgba(0, 0, 0, 0.78);
  text-align: center;
}

.payout-kicker {
  margin: 0;
  color: var(--amber);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.14em;
}

.payout-title {
  margin: 12px 0 20px;
  color: var(--cream);
  font: 900 36px/1 Impact, "Arial Narrow", sans-serif;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.payout-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin: 0 auto 10px;
  max-width: 380px;
  color: var(--cream);
  font: 800 13px/1.35 "SFMono-Regular", Menlo, monospace;
  font-variant-numeric: tabular-nums;
  opacity: 0;
  transform: translateY(5px);
  transition: opacity 0.35s ease, transform 0.35s ease;
}

.payout-row.sp-on {
  opacity: 1;
  transform: none;
}

.payout-row .sp-mult {
  color: var(--cyan);
}

#accuracy-payout.accuracy-countup:not(.overlay--hidden) {
  transition-duration: 650ms;
}

.accuracy-countup .ap-range {
  display: inline-flex;
  gap: 10px;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.accuracy-countup .ap-threshold {
  color: var(--muted);
}

.accuracy-countup .ap-count {
  color: var(--amber);
}

.payout-rule {
  height: 1px;
  max-width: 380px;
  margin: 14px auto;
  background: rgba(255, 180, 41, 0.35);
}

.payout-total {
  color: var(--amber);
  font: 900 32px/1 Impact, "Arial Narrow", sans-serif;
  letter-spacing: 0.02em;
  font-variant-numeric: tabular-nums;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.payout-total.sp-on {
  opacity: 1;
}

#sp-hint {
  margin-top: 18px;
  transition: opacity 0.3s ease;
}

.sp-hidden {
  opacity: 0;
}
