:root {
  color-scheme: dark;
  --ink: #f5f1ff;
  --muted: #c3bdd9;
  --cyan: #9af4ff;
  --mint: #c8fa9d;
  --violet: #bdabff;
  --line: #423b64;
  --panel: #1a1732;
  --hazard: #ff8f9c;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body {
  min-width: 280px;
  margin: 0;
  color: var(--ink);
  background: radial-gradient(ellipse at 73% 0, #2c1e54, transparent 48%), #100f26;
  font: 400 15px/1.55 Inter, system-ui, sans-serif;
}
a { color: inherit; text-underline-offset: 4px; }
button { font: inherit; color: inherit; cursor: pointer; }
button:disabled { opacity: .43; cursor: default; }
:focus-visible { outline: 3px solid var(--cyan); outline-offset: 4px; }
h1, h2, p { margin: 0; }
.wrap { width: min(1160px, calc(100% - 52px)); margin-inline: auto; }
.skip { position: absolute; z-index: 10; inset: 8px auto auto 8px; padding: 10px; background: #100f26; transform: translateY(-200%); }
.skip:focus { transform: none; }
.arcade-bar { border-bottom: 1px solid var(--line); background: #15122b; }
.arcade-bar .wrap { display: flex; justify-content: space-between; align-items: center; gap: 14px; min-height: 63px; }
.arcade-brand { display: inline-flex; gap: 7px; align-items: center; font: 750 24px/1 Syne, Inter, sans-serif; letter-spacing: -.06em; text-decoration: none; }
.arcade-brand span { margin-left: -6px; color: var(--violet); }
.arcade-brand img { border-radius: 6px; }
.back { color: var(--muted); font-size: 12px; font-weight: 650; text-decoration: none; }
.back span { margin-right: 4px; color: var(--cyan); }
.back:hover, .credits a:hover { color: var(--cyan); }
.game-heading { display: flex; justify-content: space-between; align-items: end; gap: 14px; padding-block: 35px 24px; }
.eyebrow {
  display: flex;
  align-items: center;
  gap: 7px;
  color: var(--cyan);
  font: 750 10px/1.25 Inter, system-ui, sans-serif;
  letter-spacing: .16em;
}
.eyebrow > span { width: 6px; height: 6px; border-radius: 50%; background: var(--cyan); box-shadow: 0 0 10px #7af0ff; }
h1 {
  margin-top: 8px;
  font: 800 clamp(34px, 5.3vw, 72px)/1.02 Syne, Inter, sans-serif;
  letter-spacing: -.067em;
  text-wrap: balance;
}
h1 em { color: var(--violet); font-style: normal; text-shadow: 0 2px #513c92; }
.intro { margin-top: 8px; color: var(--muted); }
.best {
  display: grid;
  flex: none;
  justify-items: end;
  min-width: 112px;
  padding: 10px 14px;
  border: 1px solid #6d5b9e;
  border-radius: 8px;
  background: linear-gradient(145deg, #2d2350, #1c1836);
}
.best > span, .hud > div > span { color: var(--muted); font-size: 9px; font-weight: 750; letter-spacing: .11em; }
.best strong { color: var(--mint); font: 750 25px/1.25 Inter, system-ui, sans-serif; font-variant-numeric: tabular-nums; }
.best small { color: var(--muted); font-size: 9px; }
.game-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(205px, 235px); gap: 20px; align-items: start; }
.console, .dispatch { min-width: 0; border: 1px solid var(--line); border-radius: 15px; background: var(--panel); }
.console { box-shadow: 0 18px 54px #070713a6; }
.hud { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); padding: 10px 12px; }
.hud > div { display: grid; gap: 1px; min-width: 0; padding: 0 6px; text-align: center; }
.hud > div + div { border-left: 1px solid var(--line); }
.hud strong { color: var(--ink); font: 750 clamp(13px, 1.7vw, 20px)/1.3 Inter, system-ui, sans-serif; font-variant-numeric: tabular-nums; white-space: nowrap; }
.hud .hull { color: var(--cyan); font-size: clamp(11px, 1.65vw, 17px); letter-spacing: .03em; }
.hud .warning { color: #ffb0ae; }
.arena { position: relative; isolation: isolate; border-block: 1px solid var(--line); background: #0b0d25; }
#arena { display: block; width: 100%; height: auto; aspect-ratio: 640 / 440; max-height: 58vh; min-height: 220px; touch-action: none; }
#arena:focus-visible { outline-offset: -4px; }
.mission {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 12px;
  background: radial-gradient(ellipse, #0b0c21e6 14%, #0b0c2166 62%, #0b0c212d);
}
.mission-card {
  width: min(100%, 380px);
  padding: clamp(15px, 2.5vw, 25px);
  border: 1px solid #7b6bb6;
  border-radius: 13px;
  background: linear-gradient(145deg, #251f45f5, #15132bf7);
  box-shadow: 0 15px 40px #070618a8;
  text-align: center;
}
.mission-card .eyebrow { justify-content: center; font-size: 9px; }
.mission-card h2 { margin-top: 6px; font: 750 clamp(21px, 3vw, 33px)/1.15 Syne, Inter, sans-serif; letter-spacing: -.055em; }
#mission-copy { margin-top: 7px; color: var(--muted); font-size: clamp(12px, 1.3vw, 14px); line-height: 1.5; }
.primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  min-height: 44px;
  max-width: 100%;
  margin-top: 14px;
  padding: 9px 15px;
  border: 1px solid #dcffbd;
  border-radius: 7px;
  background: linear-gradient(135deg, #d8ffaf, #a9e5a0);
  color: #18271f;
  box-shadow: 0 3px #548266;
  font-size: 13px;
  font-weight: 800;
}
.primary:hover:enabled { filter: brightness(1.08); }
.console-controls { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 10px; padding: 12px; }
.pad, .utilities { display: flex; flex-wrap: wrap; gap: 6px; }
.pad button, .utilities button {
  min-height: 44px;
  padding: 5px 11px;
  border: 1px solid #554a7c;
  border-radius: 7px;
  background: #252040;
  color: var(--ink);
  font-size: 11px;
  font-weight: 700;
}
.pad button { min-width: 44px; color: var(--cyan); font-size: 18px; touch-action: none; }
.pad button[aria-pressed="true"], .pad button:hover:enabled, .utilities button:hover:enabled { border-color: var(--cyan); background: #33305b; }
.utilities button span { margin-right: 3px; color: var(--cyan); }
.dispatch { padding: 19px 17px; }
.dispatch h2 { margin-top: 9px; font: 750 23px/1.15 Syne, Inter, sans-serif; letter-spacing: -.05em; }
.sectors { display: grid; gap: 8px; margin: 16px 0; padding: 0; list-style: none; }
.sectors li { display: flex; align-items: flex-start; gap: 8px; padding: 8px; border: 1px solid transparent; border-radius: 6px; }
.sectors li[aria-current] { border-color: #645496; background: #2c234c; }
.sectors b { color: var(--violet); font-size: 10px; }
.sectors strong, .sectors small { display: block; }
.sectors strong { font-size: 12px; }
.sectors small, .steering { color: var(--muted); font-size: 11px; }
.steering { padding-top: 12px; border-top: 1px solid var(--line); }
.steering strong { color: var(--ink); }
.legend { display: flex; flex-wrap: wrap; gap: 9px 14px; margin-top: 12px; color: var(--muted); font-size: 10px; }
.legend span { display: flex; align-items: center; gap: 5px; }
.legend i { width: 9px; height: 9px; border: 1px solid var(--mint); border-radius: 50%; }
.legend span + span i { border-color: var(--hazard); border-radius: 2px; transform: rotate(45deg); }
.credits { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 10px; padding-block: 24px; color: var(--muted); font-size: 11px; }
.sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

@media (max-width: 800px) {
  .game-layout { grid-template-columns: minmax(0, 1fr); }
  .dispatch { padding: 17px; }
  .sectors { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 520px) {
  .wrap { width: calc(100% - 28px); }
  .arcade-bar .wrap { min-height: 54px; }
  .game-heading { align-items: start; padding-block: 22px 16px; }
  h1 { font-size: clamp(29px, 7.9vw, 41px); text-wrap: initial; }
  .intro { font-size: 12px; line-height: 1.45; }
  .best { min-width: 74px; padding: 7px; }
  .best > span { font-size: 8px; }
  .best strong { font-size: 20px; }
  .best small { font-size: 8px; }
  .hud { padding: 7px 3px; }
  .hud > div { padding: 0 2px; }
  .hud > div > span { font-size: 8px; }
  #arena { min-height: 235px; max-height: none; aspect-ratio: 1.3; }
  .console-controls { padding: 8px; }
  .pad, .utilities { gap: 5px; }
  .dispatch .sectors { grid-template-columns: 1fr; gap: 3px; }
}
