/* stage: refining the neon cabinet */
:root{
  --bg:#050811;
  --panel:#101c2d;
  --accent:#78f5d9;
  --gold:#ffe18a;
  --red:#ff7c9f;
  --line:#29394e;
  --text:#eef5ff;
  --muted:#a2b5cd;
  --gutter:clamp(14px,2.5vw,30px);
  --violet:#c5afff;
}
body{background:var(--bg)}
header,footer{
  background:linear-gradient(110deg,#0e1d2c,#121326);
  box-shadow:inset 0 1px 0 #ffffff05;
}
header{gap:20px}
.brand .eyebrow{
  color:#9aacbf;
  font-size:9px;
  line-height:1.5;
  letter-spacing:.15em;
}
h1{
  margin-top:5px;
  font-family:var(--mono);
  font-size:clamp(22px,2.8vw,29px);
  font-weight:800;
  line-height:1.15;
  letter-spacing:-.055em;
  text-transform:uppercase;
  text-shadow:0 0 22px #78f5d90b;
}
h1 em{color:var(--accent);font-weight:750}
.headeractions{gap:8px}
button{
  border-radius:7px;
  border-color:#3a4e66;
  font-family:var(--mono);
  font-weight:650;
  font-size:11px;
  letter-spacing:.035em;
  text-transform:uppercase;
  background:linear-gradient(180deg,#1c2c40,#152234);
  box-shadow:inset 0 1px 0 #ffffff09,0 2px 6px #00000020;
  transition:background .16s ease,border-color .16s ease,color .16s ease,box-shadow .16s ease,transform .16s ease;
}
.headeractions button{padding-inline:13px}
#pauseCombat{
  color:#082c25;
  border-color:#9cfce5;
  background:linear-gradient(180deg,#a0f8e3,#78e8cc);
  box-shadow:inset 0 1px 0 #ffffff50,0 3px 12px #78f5d90d;
}
#audioCombat,#reset{background:#0c172580;color:#b7c7da}
#audioCombat[aria-pressed="true"]{
  color:#a5fbe4;
  background:#16342e;
  border-color:#467a70;
}
footer{gap:20px;padding-block:11px}
#hint{color:#a7bbd2;font-size:11px;line-height:1.65}

/* stage: aligning the flight instruments */
#combatHud{
  padding-block:13px;
  background:linear-gradient(180deg,#101b2a,#0b1422);
  border-top:1px solid #78f5d925;
}
.instrument{gap:6px}
.instrument+.instrument{border-left-color:#94b4d320}
.instrument>span{
  color:#9fb2ca;
  font-family:var(--mono);
  font-size:9px;
  font-weight:600;
  letter-spacing:.11em;
}
.instrument strong{
  font-size:26px;
  font-weight:650;
  line-height:1.15;
  text-shadow:none;
}
.instrument strong small{color:#9db0c8}
#rescued{color:var(--gold)}
#score{color:#f5efcf;letter-spacing:.04em}
#bestScore{color:#a5b7ce;letter-spacing:.01em}
#telemetry{color:var(--accent);text-shadow:0 0 12px #78f5d915}
#telemetry.critical{color:#ff9cb7;text-shadow:0 0 12px #ff7c9f20}
.scanner{
  gap:14px;
  background:#070f1a;
  border-bottom-color:#385465;
  box-shadow:inset 0 1px 0 #00000035;
}
.radarLabel{color:#9ab2c8;font-size:9px;letter-spacing:.1em}
.radarLabel::before{width:5px;height:5px;box-shadow:0 0 7px #78f5d935}
#slices{border-radius:3px}
.statusline{top:13px;gap:10px;font-size:10px;letter-spacing:.02em}
#mission,#streak{
  padding:6px 9px;
  border-radius:5px;
  background:#08111ee6;
  box-shadow:0 3px 10px #00000020;
  line-height:1.5;
}
#mission{color:#ffe3a1;border-color:#ffe18a38}
#mission.carrying{color:#a0fbe2;border-color:#78f5d94d}
#streak{color:#d3c5f7;border-color:#b79aef45}
#battleCallout{
  top:59px;
  padding:10px 16px;
  border-radius:7px;
  font-family:var(--mono);
  font-size:10px;
  line-height:1.6;
  letter-spacing:.015em;
  background:#102532f5;
  box-shadow:0 8px 28px #00000045,inset 0 1px 0 #ffffff08;
}
.viewport::after{
  content:"";
  position:absolute;
  inset:0;
  z-index:2;
  pointer-events:none;
  background:repeating-linear-gradient(0deg,transparent 0,transparent 3px,#0000000d 3px,#0000000d 4px);
  box-shadow:inset 0 0 45px #00000030;
}
body[data-sector="2"] .viewport{filter:hue-rotate(12deg)}
body[data-sector="3"] .viewport{filter:hue-rotate(28deg)}

/* stage: giving briefings breathing room */
#briefing{
  padding:24px;
  background:radial-gradient(ellipse at 50% 35%,#172d4090,#050a15eb 85%);
  scrollbar-color:#475872 #0b1422;
}
.briefingPanel{
  width:min(100%,560px);
  padding:28px 30px 25px;
  border-radius:12px;
  border-color:#608a945c;
  background:linear-gradient(145deg,#162a3cf5,#111326fa 78%);
  box-shadow:0 24px 65px #00000065,inset 0 1px 0 #d7fffa0c;
}
.briefingPanel::before{
  left:20%;
  right:20%;
  background:linear-gradient(90deg,transparent,#9beedd99,transparent);
}
.briefingPanel .eyebrow{
  color:#aadfd7;
  font-size:9px;
  letter-spacing:.1em;
  line-height:1.7;
}
.briefingPanel h2{
  margin:12px 0;
  color:#f0f9ff;
  font-family:var(--mono);
  font-size:clamp(27px,3.8vw,38px);
  font-weight:800;
  line-height:1.12;
  letter-spacing:-.055em;
  text-transform:uppercase;
}
#overlaySummary{color:#b9cbe0;font-size:13px;line-height:1.75}
#briefingSteps{gap:8px;margin:22px 0 18px}
#briefingSteps p{
  gap:14px;
  padding:12px 14px;
  border-radius:7px;
  border-color:#8baac124;
  background:#07121e65;
  color:#b8cbe0;
  font-size:12px;
  line-height:1.65;
}
#briefingSteps strong{font-weight:650}
.phaseTip{
  padding:12px 14px;
  margin-bottom:20px;
  border-radius:7px;
  border-color:#b69bf53b;
  background:linear-gradient(110deg,#b79aff0c,#8fbaff06);
  color:#c0cce2;
  font-size:11px;
  line-height:1.75;
}
.phaseTip span{
  margin-bottom:5px;
  color:#d3c5fa;
  font-size:8px;
  line-height:1.65;
  letter-spacing:.06em;
}
#launchCombat{
  width:100%;
  min-width:0;
  min-height:49px;
  padding:11px 15px 11px 18px;
  border-radius:7px;
  border-color:#a0fbe4;
  background:linear-gradient(180deg,#a0f8e3,#78e8cc);
  color:#092d26;
  font-size:12px;
  font-weight:750;
  letter-spacing:.035em;
  box-shadow:inset 0 1px 0 #ffffff45,0 6px 20px #00000025;
}
#launchCombat span{border-radius:4px;background:#0c36250d}
#overlayHelp{margin-top:13px;color:#a5b8d0;font-size:10px;line-height:1.7}

/* stage: distinguishing charge and readiness */
.flightTools{gap:10px}
#phase,#pulse{
  min-height:48px;
  padding:9px 11px 9px 14px;
  gap:14px;
  border-radius:7px;
  font-size:10px;
  letter-spacing:.045em;
}
#phase{
  min-width:187px;
  border-color:#9e85d5;
  background:linear-gradient(115deg,#2b2444,#1b2b41);
  color:#eee7ff;
}
#phase span,#pulse span{gap:4px}
#phase small,#pulse small{
  font-size:8px;
  line-height:1.3;
  letter-spacing:.025em;
}
#phase small{color:#cabee6}
#phase b{
  display:grid;
  place-items:center;
  min-width:52px;
  min-height:28px;
  padding:3px 5px;
  border:1px solid #c5afff35;
  border-radius:4px;
  background:#090f214d;
  color:#f0e8ff;
  font-size:10px;
  font-variant-numeric:tabular-nums;
}
#phase::after{height:3px;background:#baa5f5}
#phase[data-ready="true"]:not(:disabled){
  border-color:#dbc4ff;
  box-shadow:inset 0 1px 0 #ffffff0a,0 0 0 2px #b79aff12;
}
#phase[data-active="true"]{
  opacity:1;
  background:linear-gradient(115deg,#3e2c59,#272b4d);
  color:#f7eeff;
  border-color:#d5bbff;
  box-shadow:inset 0 1px 0 #ffffff0b,0 0 18px #ab7aff26;
}
#phase[data-active="true"] b{background:#b99aff16;border-color:#d5bbff66}
#phase[data-active="true"]::after{background:#e1c8ff}
#pulse{
  background:linear-gradient(180deg,#293044,#202738);
  color:#e3e9fb;
  border-color:#65728f;
}
#pulse small{color:#b1bdd5}
#pulse b{
  width:28px;
  height:28px;
  border-color:#b7c6e13b;
  border-radius:4px;
  background:#b7c6e10d;
  color:#eef4ff;
  font-size:15px;
}
button:disabled{
  opacity:.48;
  cursor:not-allowed;
  box-shadow:none;
  transform:none;
}
#phase:disabled{opacity:.78;filter:none;cursor:default}
#phase:disabled:not([data-active="true"]){
  border-color:#655880;
  box-shadow:none;
  background:linear-gradient(115deg,#241f36,#1a2638);
}
#phase[data-active="true"]:disabled{opacity:1}
body.is-phased .scanner{background:#14172a;border-bottom-color:#b4a0dc80}

/* stage: sharpening interaction feedback */
@media(hover:hover){
  button:not(:disabled):hover{
    background:#293c54;
    border-color:#8babc5;
    color:#fff;
    transform:translateY(-1px);
    box-shadow:inset 0 1px 0 #ffffff10,0 4px 12px #00000030;
  }
  #audioCombat:not(:disabled):hover,#reset:not(:disabled):hover{
    background:#23364c;
    border-color:#7894b0;
    color:#f1f7ff;
  }
  #audioCombat[aria-pressed="true"]:hover{
    background:#20473d;
    border-color:#80cbb6;
    color:#c5ffed;
  }
  #pauseCombat:not(:disabled):hover,#launchCombat:not(:disabled):hover{
    background:#b5ffe9;
    border-color:#d0fff1;
    color:#072920;
    box-shadow:0 0 0 3px #78f5d912,0 5px 18px #78f5d91c;
  }
  #phase:not(:disabled):hover{
    background:linear-gradient(115deg,#43305f,#2a3d56);
    border-color:#eedaff;
    color:#fff;
    box-shadow:0 0 0 3px #b79aff15,0 5px 18px #b79aff1c;
  }
  #pulse:not(:disabled):hover{
    background:#36435a;
    border-color:#b8c9e9;
    color:#fff;
    box-shadow:0 0 0 3px #b7c6e112,0 4px 14px #00000030;
  }
}
button:focus-visible,
#pauseCombat:focus-visible,#audioCombat:focus-visible,#reset:focus-visible,
#launchCombat:focus-visible,#pulse:focus-visible,#phase:focus-visible{
  outline:3px solid #e9f7ff;
  outline-offset:3px;
  box-shadow:0 0 0 6px #78f5d929;
}
button:not(:disabled):active{
  transform:translateY(1px);
  box-shadow:inset 0 2px 5px #00000030;
}
#world:focus-visible{outline:2px solid #b5ffe9a6;outline-offset:-3px}

/* stage: balancing compact arcade screens */
@media(max-width:850px){
  footer{gap:12px}
  #hint{font-size:10px}
  .flightTools{gap:8px}
  #phase,#pulse{gap:10px;padding-inline:10px}
  #phase{min-width:176px}
}
@media(max-width:650px){
  :root{--gutter:14px}
  header{gap:10px}
  h1{font-size:20px}
  .brand .eyebrow{font-size:7px;letter-spacing:.07em}
  .headeractions{gap:6px}
  .headeractions button{padding:9px 9px;font-size:10px;min-height:44px}
  #combatHud{padding-block:10px}
  .instrument{gap:5px}
  .instrument>span{font-size:8px;letter-spacing:.05em}
  .instrument strong{font-size:22px}
  #telemetry{font-size:17px}
  .radarLabel{font-size:8px}
  .statusline{top:11px;gap:8px;font-size:9px}
  #mission,#streak{padding:5px 7px}
  #battleCallout{top:52px;font-size:9px;padding:9px 12px}
  footer{padding-block:9px;gap:9px}
  #phase,#pulse{min-width:0;min-height:46px;padding:8px 9px;gap:8px;font-size:9px}
  #phase small,#pulse small{font-size:7px}
  #phase b{min-width:46px;font-size:9px}
  #briefing{padding:16px}
  .briefingPanel{padding:23px 21px 21px;border-radius:10px}
  .briefingPanel .eyebrow{font-size:8px}
  .briefingPanel h2{font-size:31px;margin:10px 0}
  #overlaySummary{font-size:12px;line-height:1.65}
  #briefingSteps{margin:18px 0 15px}
  #briefingSteps p{padding:10px 12px;gap:12px;font-size:11.5px}
  .phaseTip{padding:10px 12px;font-size:10.5px;margin-bottom:17px}
  #launchCombat{min-height:47px;font-size:11px}
}
@media(max-width:520px){
  footer{flex-wrap:wrap;gap:8px}
  #hint{flex-basis:100%;font-size:9px;line-height:1.5}
  .flightTools{width:100%;gap:8px}
  .flightTools button{flex:1;justify-content:space-between}
  .phaseTip span{font-size:7.5px;letter-spacing:.025em}
}
@media(max-width:450px){
  :root{--gutter:12px}
  header{flex-wrap:wrap;gap:10px;padding-block:11px}
  .brand{flex:1}
  h1{font-size:22px}
  .brand .eyebrow{font-size:7px;letter-spacing:.08em}
  .headeractions{width:100%;gap:7px}
  .headeractions button{flex:1;min-height:44px;font-size:10px}
  .instrument strong{font-size:20px}
  #telemetry{font-size:16px}
  #score{letter-spacing:.01em}
  #bestScore{font-size:7px}
  .statusline{font-size:8px;gap:6px}
  #mission,#streak{padding:4px 6px}
  #briefing{padding:12px}
  .briefingPanel{padding:21px 17px 19px}
  .briefingPanel h2{font-size:28px}
  #briefingSteps p{padding:10px;gap:11px}
}
@media(max-width:380px){
  :root{--gutter:10px}
  .instrument>span{font-size:7.5px;letter-spacing:0}
  .instrument strong{font-size:19px}
  #telemetry{font-size:15px}
  #bestScore{display:none}
  #phase,#pulse{font-size:8px;gap:6px}
  #phase small,#pulse small{font-size:6.5px}
  #phase b{min-width:43px}
  .briefingPanel{padding:19px 14px 17px}
  .briefingPanel h2{font-size:26px}
  #briefingSteps p{font-size:11px}
}
@media(max-height:720px) and (min-width:651px){
  h1{font-size:25px}
  #combatHud{padding-block:10px}
  footer{padding-block:8px}
  #briefing{padding:18px}
  .briefingPanel{padding:21px 25px}
  .briefingPanel h2{font-size:33px;margin:8px 0}
  #briefingSteps{margin:16px 0;gap:7px}
  #briefingSteps p{padding:9px 12px;font-size:11.5px}
  .phaseTip{padding:10px 12px;margin-bottom:15px}
}
@media(max-height:560px) and (min-width:600px){
  header{gap:14px}
  h1{font-size:21px;margin-top:2px}
  .brand .eyebrow{font-size:7px}
  .headeractions button{min-height:36px;padding:7px 12px;font-size:10px}
  #combatHud{padding-block:7px}
  .instrument{gap:10px}
  .instrument strong{font-size:19px}
  .instrument>span{font-size:8px}
  #telemetry{font-size:15px}
  .statusline{top:9px;font-size:9px}
  #mission,#streak{padding:4px 6px}
  #battleCallout{top:46px;padding:7px 12px}
  footer{padding-block:5px}
  #phase,#pulse{min-height:36px;padding:4px 9px;font-size:9px}
  #phase small,#pulse small{display:none}
  #phase b{min-height:25px}
  #pulse b{width:25px;height:25px}
  #briefing{padding:10px 18px}
  .briefingPanel{width:min(100%,820px);padding:15px 20px}
  .briefingPanel h2{font-size:27px;margin:5px 0}
  #overlaySummary{font-size:11px}
  #briefingSteps{margin:12px 0}
  #briefingSteps p{padding:10px;font-size:10px;gap:10px}
  .phaseTip{padding:7px 10px;margin-bottom:10px;font-size:10px}
  .phaseTip span{display:inline;margin-right:8px}
  #launchCombat{width:auto;min-width:226px;min-height:38px;padding:7px 12px 7px 16px}
  #overlayHelp{margin-top:8px;font-size:9px}
}
@media(pointer:coarse){
  .headeractions button,#phase,#pulse{min-height:44px}
  #launchCombat{min-height:46px}
}
@media(prefers-reduced-motion:reduce){
  button{transition:none}
  button:not(:disabled):hover,button:not(:disabled):active{transform:none}
  .viewport::after{background:none}
}