/* stage: refining the arcade palette */
html,body{margin:0;padding:0;width:100%;height:100%;overflow:hidden}
*{box-sizing:border-box}
:root{
  color-scheme:dark;
  --bg:#080d18;
  --panel:#111e2e;
  --line:#263548;
  --text:#edf4ff;
  --muted:#9aafc7;
  --accent:#86f3d8;
  --gold:#ffdb83;
  --red:#ff7597;
  --gutter:clamp(16px,2.7vw,32px);
  --mono:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;
}
body{
  display:flex;
  flex-direction:column;
  background:var(--bg);
  color:var(--text);
  font:14px/1.5 system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;
  -webkit-font-smoothing:antialiased;
}
header{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:24px;
  flex-shrink:0;
  padding:calc(var(--camlin-create-toolbar-inset,0px) + 15px) var(--gutter) 15px;
  border-bottom:1px solid var(--line);
  background:linear-gradient(115deg,#132637 0%,#101b2a 48%,#0c1522 100%);
  box-shadow:inset 0 1px 0 #ffffff05;
}
.brand{min-width:0}
.eyebrow{
  display:block;
  color:var(--accent);
  font-family:var(--mono);
  font-size:9px;
  font-weight:600;
  line-height:1.5;
  letter-spacing:.14em;
}
h1{
  margin:4px 0 0;
  font-size:27px;
  font-weight:750;
  line-height:1.12;
  letter-spacing:-.045em;
  white-space:nowrap;
}
em{font-style:normal;color:var(--accent);font-weight:500}
.headeractions{display:flex;align-items:center;gap:8px;flex-shrink:0}
button{
  min-height:44px;
  border:1px solid #3a4e65;
  border-radius:9px;
  padding:10px 15px;
  background:linear-gradient(180deg,#1c2d42,#172538);
  color:var(--text);
  font:650 12px/1.4 system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;
  letter-spacing:.01em;
  box-shadow:inset 0 1px 0 #ffffff07,0 2px 4px #0000001a;
  cursor:pointer;
  transition:background .16s ease,border-color .16s ease,color .16s ease,box-shadow .16s ease,transform .16s ease;
  touch-action:manipulation;
  white-space:nowrap;
  -webkit-tap-highlight-color:transparent;
}
button:focus-visible{outline:3px solid var(--accent);outline-offset:3px}
button:disabled{opacity:.42;filter:saturate(.55);cursor:not-allowed;box-shadow:none}
button:not(:disabled):active{transform:translateY(1px);box-shadow:inset 0 2px 5px #00000025}
#pauseCombat{
  min-width:80px;
  border-color:var(--accent);
  background:linear-gradient(180deg,#a0f9e2,#86f3d8);
  color:#092b25;
  font-weight:750;
  box-shadow:inset 0 1px 0 #ffffff40,0 3px 12px #86f3d810;
}
#audioCombat{background:#0d172380;color:#b1c3d8;border-color:#34465b}
#audioCombat[aria-pressed="true"]{color:var(--accent);border-color:#86f3d866;background:#86f3d80d}
#reset{color:#b9c9dc;background:#152233;border-color:#34465b}
main{
  flex:1;
  min-width:0;
  min-height:0;
  display:grid;
  grid-template-rows:auto 40px minmax(0,1fr);
}
canvas{display:block;width:100%;height:100%;touch-action:none}
.viewport{position:relative;min-width:0;min-height:0;overflow:hidden;background:#080e1b}
#world{position:absolute;inset:0;cursor:grab}
#world:active{cursor:grabbing}
#world:focus-visible{outline:2px solid #86f3d880;outline-offset:-3px}
footer{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:24px;
  flex-shrink:0;
  padding:10px var(--gutter);
  border-top:1px solid var(--line);
  background:linear-gradient(180deg,#101a29,#0c1522);
  box-shadow:inset 0 1px 0 #ffffff03;
}
#hint{margin:0;color:#a9bdd5;font-size:11px;line-height:1.7;text-wrap:balance}
[hidden]{display:none!important}
::selection{color:#f2fff9;background:#2c655f}
@media(hover:hover){
  button:not(:disabled):hover{
    background:#263b52;border-color:#7892ae;color:#ffffff;
    box-shadow:inset 0 1px 0 #ffffff0a,0 4px 12px #00000026;
    transform:translateY(-1px);
  }
  #pauseCombat:not(:disabled):hover{
    background:#b4ffe9;border-color:#c4fff0;color:#082821;
    box-shadow:0 0 0 3px #86f3d811,0 4px 18px #86f3d815;
  }
  #audioCombat:not(:disabled):hover,#reset:not(:disabled):hover{
    background:#22354a;color:#f0fff9;border-color:#6d8aa6;
  }
  #audioCombat[aria-pressed="true"]:hover{color:#b9ffe9;border-color:#86f3d8a6;background:#183831}
  button:not(:disabled):active{transform:translateY(1px)}
}
@media(prefers-reduced-motion:reduce){
  button{transition:none}
  button:not(:disabled):hover,button:not(:disabled):active{transform:none}
}

/* stage: balancing edge-to-edge instruments */
/* Scoped rules preserve the existing grid and outrank the legacy themes.
   Canvas dimensions still come from the actual available playfield. */
/* stage: harmonising cockpit surface colours */
body.combat{
  --gutter:clamp(10px,1.5vw,22px);
  --bg:#080e18;
  --panel:#142131;
  --line:#8baac038;
  --text:#f0f6ff;
  --muted:#b2c2d5;
  --accent:#85f3d5;
  --gold:#ffdc8f;
  --red:#ff8fab;
  --violet:#cfb7ff;
  --ui-sans:system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;
  --ui-radius:8px;
  width:100%;
  height:100%;
  min-width:0;
  min-height:0;
  background:var(--bg);
  color:var(--text);
}
body.combat header{
  position:relative;
  z-index:5;
  flex-wrap:nowrap;
  gap:14px;
  padding:calc(var(--camlin-create-toolbar-inset,0px) + 7px) var(--gutter) 7px;
  background:linear-gradient(110deg,#0e1d2b,#101625 75%);
  border-bottom-color:var(--line);
  box-shadow:inset 0 1px 0 #e5faff08,0 1px 0 #0005;
}
body.combat .brand{flex:1;min-width:0}
body.combat .brand .eyebrow{
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
  color:var(--muted);
  font-size:8px;
  font-weight:500;
  letter-spacing:.12em;
  line-height:1.5;
}
body.combat h1{
  margin:3px 0 0;
  font-family:var(--ui-sans);
  font-size:clamp(17px,2.1vw,23px);
  font-weight:750;
  line-height:1.15;
  letter-spacing:-.035em;
  text-transform:none;
  text-shadow:none;
}
body.combat h1 em{color:var(--accent);font-weight:750}
body.combat .headeractions{width:auto;gap:7px;flex-shrink:0}
body.combat button{
  border-radius:var(--ui-radius);
  font-family:var(--mono);
  font-weight:600;
  line-height:1.4;
  letter-spacing:.025em;
  font-variant-numeric:tabular-nums;
  transition:background .16s ease,border-color .16s ease,color .16s ease,box-shadow .16s ease,transform .12s ease;
}
body.combat .headeractions button{
  flex:0 0 auto;
  min-height:40px;
  padding:8px 11px;
  font-size:10px;
  letter-spacing:.02em;
}
body.combat #pauseCombat{
  min-width:72px;
  border-color:#b0fbe5;
  color:#082d25;
  background:linear-gradient(180deg,#a5f9e2,#7ce4c8);
  font-weight:750;
  box-shadow:inset 0 1px 0 #ffffff55,0 2px 9px #0003;
}
body.combat #audioCombat,
body.combat #reset{
  color:#bdcee0;
  border-color:#7793ad40;
  background:linear-gradient(180deg,#19283a,#121f30);
  box-shadow:inset 0 1px 0 #ffffff07;
}
body.combat #audioCombat[aria-pressed="true"]{
  color:#b0ffe7;
  border-color:#85f3d558;
  background:linear-gradient(180deg,#18382f,#122b28);
}
body.combat #audioCombat[data-state="blocked"]{
  color:#ffe3a6;
  border-color:#ffdc8f88;
  background:#30291b;
}
body.combat main{
  flex:1 1 0%;
  width:100%;
  min-width:0;
  min-height:0;
  padding:0;
  gap:0;
  grid-template-columns:minmax(0,1.2fr) minmax(0,.8fr);
  grid-template-rows:46px minmax(0,1fr);
}
body.combat #combatHud{
  grid-column:1;
  grid-row:1;
  min-width:0;
  min-height:0;
  grid-template-columns:1fr .75fr 1.2fr;
  padding:5px var(--gutter);
  border-top:0;
  border-bottom:1px solid #42627680;
  background:linear-gradient(180deg,#101c2a,#0b1522);
}
body.combat .instrument{
  flex-direction:column;
  align-items:flex-start;
  justify-content:center;
  gap:2px;
}
body.combat .instrument+.instrument{padding-left:12px;border-left-color:var(--line)}
body.combat .instrument>span{
  color:var(--muted);
  font-size:8px;
  font-weight:500;
  line-height:1.3;
  letter-spacing:.075em;
  white-space:nowrap;
}
body.combat .instrument strong{
  font-size:20px;
  font-weight:650;
  line-height:1.12;
  letter-spacing:0;
  font-variant-numeric:tabular-nums slashed-zero;
}
body.combat .instrument strong small{color:#a8bbcf;font-size:10px;font-weight:500}
body.combat .hullInstrument{align-items:center;justify-content:center;padding-right:12px}
body.combat #telemetry{
  color:var(--accent);
  font-size:15px;
  line-height:1.4;
  letter-spacing:.035em;
  text-shadow:0 0 10px #85f3d51c;
}
body.combat #telemetry.critical{color:#ff9eb6;text-shadow:0 0 10px #ff8fab20}
body.combat .scoreInstrument{align-items:flex-end;text-align:right}
body.combat .scoreInstrument>span{display:flex;align-items:center;gap:8px}
body.combat #score{letter-spacing:.035em;color:#fff0be}
body.combat #bestScore{margin:0;color:#9eb3ca;font-size:7px;letter-spacing:.015em}
body.combat .scanner{
  grid-column:2;
  grid-row:1;
  min-width:0;
  min-height:0;
  padding:7px var(--gutter) 7px 12px;
  gap:10px;
  border-left:1px solid var(--line);
  border-bottom-color:#42627680;
  background:#09121e;
}
body.combat .radarLabel{color:#a8c0d4;font-size:8px;letter-spacing:.1em;gap:6px}
body.combat .radarLabel::before{
  width:4px;
  height:4px;
  background:var(--accent);
  box-shadow:0 0 7px #85f3d540;
}
body.combat #slices{min-width:0;min-height:0;border-radius:3px}
body.combat .viewport{
  grid-column:1 / -1;
  grid-row:2;
  width:100%;
  height:100%;
  min-width:0;
  min-height:0;
  margin:0;
  padding:0;
  border-radius:0;
}
body.combat #world{width:100%;height:100%}
body.combat .viewport::after{
  box-shadow:inset 0 0 24px #00000018;
  background:repeating-linear-gradient(0deg,transparent 0,transparent 3px,#00000006 3px,#00000006 4px);
}
/* Keep sector tint on the drawing, not the mission interface. */
body.combat[data-sector="2"] .viewport,
body.combat[data-sector="3"] .viewport{filter:none}
body.combat[data-sector="2"] #world{filter:hue-rotate(12deg)}
body.combat[data-sector="3"] #world{filter:hue-rotate(28deg)}
body.combat.is-phased .scanner{background:#17172b;border-bottom-color:#bea2ed88}
body.combat.is-phased .radarLabel::before{background:#d5baff;box-shadow:0 0 8px #c6b3ff60}
body.combat .statusline{top:10px;gap:8px;font-size:9px;font-weight:500;letter-spacing:.025em}
body.combat #mission,
body.combat #streak{
  padding:5px 8px;
  line-height:1.45;
  border-radius:6px;
  background:#081320ed;
  box-shadow:0 3px 12px #00000024,inset 0 1px 0 #ffffff04;
}
body.combat #mission{min-width:0;color:#ffe3a7;border-color:#ffdc8f42}
body.combat #mission.carrying{color:#b0ffe6;border-color:#85f3d565;background:#102a25ed}
body.combat #streak{color:#ddcff9;border-color:#c6acfb45}
body.combat #battleCallout{
  top:48px;
  padding:9px 13px;
  font-size:10px;
  font-weight:500;
  line-height:1.55;
  letter-spacing:.01em;
  border-radius:8px;
  border-color:#85f3d55c;
  background:#102633f5;
  color:#baffea;
  box-shadow:0 6px 22px #0005,inset 0 1px 0 #ffffff08;
}
body.combat #battleCallout[data-tone="danger"]{background:#2d1825f5;color:#ffd0dc;border-color:#ff8fab88}
body.combat #battleCallout[data-tone="gold"]{background:#2a251af5;color:#ffe6b4;border-color:#ffdc8f77}

/* stage: clarifying flight control states */
body.combat footer{
  flex-wrap:nowrap;
  gap:16px;
  padding:7px var(--gutter);
  background:linear-gradient(110deg,#0c1924,#111626);
  border-top-color:var(--line);
  box-shadow:inset 0 1px 0 #ffffff04;
}
body.combat #hint{
  flex:1;
  min-width:0;
  margin:0;
  color:#adbed1;
  font-size:10px;
  line-height:1.55;
  text-wrap:balance;
}
body.combat .flightTools{width:auto;gap:8px;flex-shrink:0}
body.combat #phase,
body.combat #pulse{
  flex:0 0 auto;
  min-width:0;
  min-height:44px;
  padding:7px 11px;
  gap:14px;
  border-radius:var(--ui-radius);
  font-size:10px;
  letter-spacing:.025em;
  box-shadow:inset 0 1px 0 #ffffff09;
}
body.combat #phase{
  border-color:#c1a5f08c;
  background:linear-gradient(115deg,#302743,#1b2b40);
  color:#eee5ff;
}
body.combat #pulse{
  border-color:#8da7cc66;
  background:linear-gradient(180deg,#24344a,#1a273b);
  color:#e2edff;
}
body.combat #phase span,
body.combat #pulse span{gap:3px}
body.combat #phase small,
body.combat #pulse small{
  display:block;
  font-size:7px;
  line-height:1.35;
  letter-spacing:.045em;
  font-weight:500;
}
body.combat #phase small{color:#ccbee4}
body.combat #pulse small{color:#b5c6df}
body.combat #phase b{
  min-width:51px;
  min-height:27px;
  padding:3px 5px;
  border-radius:5px;
  border-color:#d0b9ff40;
  background:#0b112454;
  color:#f1e8ff;
  font-size:10px;
}
body.combat #pulse b{
  width:27px;
  height:27px;
  border-radius:5px;
  border-color:#c3d8f33d;
  background:#a7ceff0d;
  color:#f0f6ff;
  font-size:14px;
}
body.combat #phase::after{height:2px;background:#c3a5ff}
body.combat #phase[data-ready="true"]:not(:disabled){
  border-color:#d5bcff;
  box-shadow:inset 0 1px 0 #ffffff0c,0 0 0 2px #c3a5ff12;
}
body.combat #phase:disabled{
  opacity:1;
  filter:none;
  cursor:default;
  transform:none;
}
body.combat #phase:disabled:not([data-active="true"]){
  color:#bfb5d4;
  border-color:#8a76954f;
  background:linear-gradient(115deg,#241f34,#172333);
  box-shadow:inset 0 1px 0 #ffffff04;
}
body.combat #phase:disabled:not([data-active="true"]) small{color:#a79abf}
body.combat #phase:disabled:not([data-active="true"]) b{color:#d7c9ed;border-color:#baa0e129}
body.combat #phase[data-active="true"],
body.combat #phase[data-active="true"]:disabled{
  opacity:1;
  color:#fff1ff;
  border-color:#e0c5ff;
  background:linear-gradient(115deg,#44305f,#282e4e);
  box-shadow:inset 0 1px 0 #ffffff14,0 0 16px #c49bff20;
}
body.combat #phase[data-active="true"] b{color:#fff0ff;background:#d0a8ff18;border-color:#dfbfff66}
body.combat #phase[data-active="true"]::after{background:#e8ceff}
body.combat :is(#pauseCombat,#pulse,#audioCombat,#reset,#testSound,#effectsCombat):disabled{
  opacity:1;
  filter:none;
  color:#8c9db4;
  border-color:#63788f40;
  background:#131d2a;
  box-shadow:none;
  cursor:not-allowed;
  transform:none;
}
body.combat #pulse:disabled small{color:#8494ab}
body.combat #pulse:disabled b{color:#a3b0c6;border-color:#7890af2e;background:#8a9fb408}

/* stage: polishing briefing and settings */
body.combat #briefing{
  padding:20px;
  overscroll-behavior:contain;
  background:radial-gradient(ellipse at 50% 32%,#203b4e85,#060c18ed 85%);
  scrollbar-color:#577089 #0c1624;
}
/* stage: refining briefing visual hierarchy */
body.combat .briefingPanel{
  width:min(100%,560px);
  margin:auto;
  padding:28px 30px 24px;
  border-radius:16px;
  border-color:#9cbdcf52;
  background:linear-gradient(145deg,#1a3041fa,#111c2bfc 74%);
  box-shadow:0 24px 70px #0008,0 4px 16px #0004,inset 0 1px 0 #e1fff514;
}
body.combat .briefingPanel::before{
  left:20%;
  right:20%;
  background:linear-gradient(90deg,transparent,#aaf6ddbb,transparent);
}
body.combat .briefingPanel .eyebrow{
  color:#b4e4d9;
  font-size:8px;
  font-weight:500;
  line-height:1.65;
  letter-spacing:.1em;
  text-wrap:balance;
}
body.combat .briefingPanel h2{
  margin:12px 0 14px;
  font-family:var(--ui-sans);
  font-size:clamp(28px,3.5vw,38px);
  line-height:1.15;
  font-weight:750;
  letter-spacing:-.035em;
  text-transform:none;
  text-wrap:balance;
  color:#f2faff;
}
body.combat #overlaySummary{
  color:#c7d5e5;
  font-family:var(--ui-sans);
  font-size:13px;
  line-height:1.75;
  text-wrap:pretty;
}
body.combat #briefingSteps{margin:18px 0 14px;gap:8px}
body.combat #briefingSteps p{
  align-items:flex-start;
  gap:14px;
  padding:12px 14px;
  border-radius:10px;
  border-color:#92b0c536;
  background:#08152285;
  color:#c7d5e5;
  font-size:12px;
  line-height:1.7;
}
body.combat #briefingSteps .legend{margin-top:3px}
body.combat #briefingSteps .laserLegend{margin-top:9px}
body.combat #briefingSteps strong{font-weight:650}
body.combat .phaseTip{
  padding:11px 13px;
  margin-bottom:17px;
  border-radius:9px;
  border-color:#c3a5ff40;
  background:linear-gradient(110deg,#b69cff10,#92bfff06);
  color:#c4cce4;
  font-size:11px;
  line-height:1.7;
}
body.combat .phaseTip span{
  color:#deceff;
  font-size:8px;
  line-height:1.55;
  letter-spacing:.065em;
  margin-bottom:5px;
}
body.combat #launchCombat{
  min-height:48px;
  padding:11px 14px 11px 17px;
  font-size:12px;
  font-weight:750;
  border-radius:9px;
  border-color:#b4fce7;
  color:#082d25;
  background:linear-gradient(180deg,#abfae4,#80e8cc);
  box-shadow:inset 0 1px 0 #ffffff55,0 5px 18px #0003;
}
body.combat #launchCombat span{
  width:26px;
  height:26px;
  border-radius:5px;
  color:#1d5443;
  background:#0c362510;
  border-color:#0c36252b;
}
body.combat #overlayHelp{
  margin-top:12px;
  color:#a6bad0;
  font-size:10px;
  line-height:1.6;
  text-wrap:balance;
}
body.combat #soundSettings summary{
  width:40px;
  min-height:40px;
  border-radius:var(--ui-radius);
  border-color:#7793ad40;
  background:linear-gradient(180deg,#19283a,#121f30);
  color:#bdcee0;
  font-size:20px;
  box-shadow:inset 0 1px 0 #ffffff07;
  touch-action:manipulation;
  -webkit-tap-highlight-color:transparent;
  transition:background .16s ease,border-color .16s ease,color .16s ease,box-shadow .16s ease;
}
body.combat #soundSettings[open] summary{
  color:#c5ffeb;
  border-color:#85f3d580;
  background:#1c3934;
  box-shadow:inset 0 1px 0 #ffffff0c;
}
body.combat #soundSettings .audioPanel{
  top:calc(100% + 11px);
  width:min(310px,calc(100vw - 24px));
  max-height:calc(100vh - 86px);
  max-height:calc(100dvh - 86px);
  padding:18px;
  gap:16px;
  overflow:auto;
  overscroll-behavior:contain;
  scrollbar-width:thin;
  scrollbar-color:#577089 #101c2c;
  border-radius:12px;
  border-color:#8aadc565;
  background:linear-gradient(150deg,#17293afc,#101a2afa);
  box-shadow:0 16px 44px #0009,0 0 0 1px #0003,inset 0 1px 0 #ffffff0c;
}
body.combat .audioPanel h2{color:#b7f9e4;font:600 10px/1.5 var(--mono);letter-spacing:.12em}
body.combat .audioPanel label{
  gap:14px;
  color:#d4e0ed;
  font:500 12px/1.5 var(--ui-sans);
  cursor:pointer;
}
body.combat .audioPanel .volumeControl{gap:5px}
body.combat #volumeValue{
  color:#b0ffe6;
  font:600 11px/1.5 var(--mono);
  font-variant-numeric:tabular-nums;
}
body.combat .audioPanel input[type="range"]{
  display:block;
  width:100%;
  min-width:0;
  min-height:32px;
  margin:0;
  accent-color:var(--accent);
  cursor:pointer;
  touch-action:pan-x;
}
body.combat .audioPanel input[type="checkbox"]{
  flex-shrink:0;
  width:20px;
  height:20px;
  margin:2px 0;
  accent-color:var(--accent);
  cursor:pointer;
}
body.combat .audioPanel .audioMeter{
  height:6px;
  border-radius:4px;
  background:#071420;
  box-shadow:inset 0 0 0 1px #a4bfd219;
}
body.combat #audioMeter{background:linear-gradient(90deg,#6bddc2,#b6ffe5)}
body.combat .audioPanel p{color:#acbfd5;font:12px/1.6 var(--ui-sans)}
body.combat #audioStatus{
  padding-top:12px;
  border-top:1px solid var(--line);
  color:#cbdbea;
}
body.combat #audioStatus[data-error="true"]{color:#ffe1a0}
body.combat .audioPanel button{
  width:100%;
  min-height:44px;
  padding:10px 12px;
  white-space:normal;
  text-align:center;
  font-size:10px;
  line-height:1.5;
  color:#d8e8f6;
  border-color:#86a6c158;
  background:linear-gradient(180deg,#20384b,#182c3f);
}
body.combat #testSound{
  color:#bfffe9;
  border-color:#85f3d55c;
  background:linear-gradient(180deg,#21483c,#18362f);
}
body.combat #effectsCombat[aria-pressed="true"]{
  color:#e6d7ff;
  border-color:#c3a5ff66;
  background:linear-gradient(115deg,#302743,#1d2b40);
}

/* stage: sharpening accessible interaction feedback */
@media(hover:hover){
  body.combat button:not(:disabled):hover{
    color:#fff;
    border-color:#a1bfd8;
    background:#294057;
    box-shadow:inset 0 1px 0 #ffffff12,0 3px 10px #0003;
    transform:translateY(-1px);
  }
  body.combat #audioCombat:not(:disabled):hover,
  body.combat #reset:not(:disabled):hover{
    color:#f2faff;
    border-color:#93b3cc;
    background:linear-gradient(180deg,#2b4055,#203348);
  }
  body.combat #audioCombat[aria-pressed="true"]:not(:disabled):hover{
    color:#dbfff2;
    border-color:#a2f6da;
    background:#234d41;
  }
  body.combat #audioCombat[data-state="blocked"]:not(:disabled):hover{
    color:#fff0ce;
    border-color:#ffe4a5;
    background:#443822;
  }
  body.combat #pauseCombat:not(:disabled):hover,
  body.combat #launchCombat:not(:disabled):hover{
    color:#07291f;
    border-color:#defff3;
    background:linear-gradient(180deg,#c9ffed,#a2f6da);
    box-shadow:0 0 0 3px #85f3d512,0 4px 16px #85f3d51a;
  }
  body.combat #phase:not(:disabled):hover{
    color:#fff3ff;
    border-color:#eedbff;
    background:linear-gradient(115deg,#473462,#2b4059);
    box-shadow:0 0 0 3px #c3a5ff14,0 4px 14px #0003;
  }
  body.combat #pulse:not(:disabled):hover{
    color:#f5faff;
    border-color:#d0e4ff;
    background:linear-gradient(180deg,#344c67,#283b55);
    box-shadow:0 0 0 3px #a7ceff12,0 4px 14px #0003;
  }
  body.combat #soundSettings summary:hover{
    color:#e5fff5;
    border-color:#9bcebF;
    background:#29453f;
  }
  body.combat #testSound:not(:disabled):hover{
    color:#e1fff4;
    border-color:#b3ffe4;
    background:#2b5848;
  }
  body.combat #effectsCombat:not(:disabled):hover{
    color:#f8edff;
    border-color:#e7d0ff;
    background:#403556;
  }
}
body.combat :is(button,#soundSettings summary,input):focus-visible{
  outline:2px solid #edfff7;
  outline-offset:3px;
  box-shadow:0 0 0 5px #85f3d52e;
}
body.combat :is(#phase,#effectsCombat):focus-visible{
  outline-color:#f4e9ff;
  box-shadow:0 0 0 5px #c3a5ff33;
}
body.combat button:not(:disabled):active{
  transform:translateY(1px);
  box-shadow:inset 0 2px 5px #00000038;
}
body.combat #soundSettings summary:active{background:#1a302e}
body.combat #world:focus-visible{outline:2px solid #c0ffe995;outline-offset:-2px}
body.combat[data-effects="light"] .viewport::after{background:none;box-shadow:none}

/* stage: finishing tactile control feedback */
body.combat .headeractions>button,
body.combat .audioPanel button,
body.combat #launchCombat{
  text-transform:none;
  letter-spacing:.01em;
}
body.combat #launchCombat{
  font-family:var(--ui-sans);
  font-size:14px;
  letter-spacing:.005em;
}
body.combat .audioPanel button{
  font-family:var(--ui-sans);
  font-size:12px;
}
body.combat #soundSettings summary{
  user-select:none;
}
body.combat .audioPanel label[for="musicCombat"]{
  padding-block:4px;
  line-height:1.6;
}
body.combat #effectsCombat[aria-pressed="false"]{
  color:#b9cadd;
  background:#142335;
  border-color:#829cb34d;
}
body.combat #overlayHelp{
  padding-top:12px;
  border-top:1px solid #92b0c526;
}
body.combat #briefing,
body.combat #soundSettings .audioPanel{
  scrollbar-gutter:stable;
}
@media(hover:hover){
  body.combat button:not(:disabled):hover{transform:none}
  body.combat .audioPanel input[type="range"]:hover{accent-color:#b7ffe9}
  body.combat .audioPanel label[for="musicCombat"]:hover{color:#f0fff9}
}
body.combat button:not(:disabled):active{transform:translateY(1px)}
body.combat :is(button,#soundSettings summary,input):focus-visible{
  outline:2px solid #edfff7;
  outline-offset:3px;
  box-shadow:0 0 0 5px #85f3d52e;
}
body.combat :is(#phase,#effectsCombat):focus-visible{
  outline-color:#f4e9ff;
  box-shadow:0 0 0 5px #c3a5ff33;
}

/* stage: preserving compact flight space */
@media(min-width:1100px){
  body.combat main{grid-template-columns:minmax(0,1fr) minmax(0,1fr)}
  body.combat .instrument{flex-direction:row;align-items:center;gap:12px}
  body.combat .hullInstrument{justify-content:center}
  body.combat .scoreInstrument{justify-content:flex-end}
  body.combat .instrument strong{font-size:22px}
  body.combat .instrument>span{font-size:8px}
  body.combat #bestScore{font-size:8px}
}
@media(max-width:760px){
  body.combat .instrument+.instrument{padding-left:8px}
  body.combat .hullInstrument{padding-right:8px}
  body.combat #bestScore{display:none}
  body.combat .scanner{padding-left:9px;gap:7px}
  body.combat footer{gap:10px}
  body.combat #hint{font-size:9px}
  body.combat #phase,body.combat #pulse{gap:8px;padding-inline:9px;font-size:9px}
}
@media(max-width:560px){
  body.combat header{
    gap:9px;
    padding-top:calc(var(--camlin-create-toolbar-inset,0px) + 5px);
    padding-bottom:5px;
  }
  body.combat h1{font-size:16px;line-height:1.12;white-space:normal;margin:0}
  body.combat h1 em{display:block}
  body.combat .brand .eyebrow{display:none}
  body.combat .headeractions{gap:5px}
  body.combat .headeractions button{min-height:44px;padding:7px 8px;font-size:9px}
  body.combat #pauseCombat{min-width:59px}
  body.combat #soundSettings summary{width:40px;min-height:44px}
  body.combat #soundSettings .audioPanel{
    position:fixed;
    top:calc(var(--camlin-create-toolbar-inset,0px) + 64px);
    right:var(--gutter);
    left:var(--gutter);
    width:auto;
    max-height:calc(100vh - var(--camlin-create-toolbar-inset,0px) - 80px);
    max-height:calc(100dvh - var(--camlin-create-toolbar-inset,0px) - 80px);
    padding:16px;
  }
  body.combat main{
    grid-template-columns:minmax(0,1fr);
    grid-template-rows:41px 24px minmax(0,1fr);
  }
  body.combat #combatHud{grid-column:1;grid-row:1;padding-block:4px;border-bottom-color:#263d4d}
  body.combat .instrument{gap:1px}
  body.combat .instrument>span{font-size:8px;letter-spacing:.045em}
  body.combat .instrument strong{font-size:18px}
  body.combat #telemetry{font-size:14px}
  body.combat #bestScore{display:inline-block;font-size:7px}
  body.combat .scanner{
    grid-column:1;
    grid-row:2;
    padding:3px var(--gutter);
    border-left:0;
    gap:8px;
  }
  body.combat .radarLabel{font-size:7px}
  body.combat .radarLabel::before{width:3px;height:3px}
  body.combat .viewport{grid-row:3}
  body.combat .statusline{font-size:8px;gap:6px;top:8px}
  body.combat #mission,body.combat #streak{padding:4px 6px}
  body.combat #battleCallout{top:46px;font-size:9px;padding:8px 10px}
  body.combat footer{padding-block:6px}
  body.combat #hint{display:none}
  body.combat .flightTools{width:100%;gap:8px}
  body.combat #phase,body.combat #pulse{
    flex:1 1 0;
    justify-content:space-between;
    min-height:44px;
    padding:7px 10px;
    font-size:9px;
  }
  body.combat #briefing{padding:12px}
  body.combat .briefingPanel{padding:21px 18px 18px;border-radius:12px}
  body.combat .briefingPanel h2{font-size:27px;margin:10px 0}
  body.combat #overlaySummary{font-size:12px}
  body.combat #briefingSteps{margin:15px 0 12px;gap:7px}
  body.combat #briefingSteps p{padding:10px 11px;font-size:11.5px;gap:11px}
  body.combat .phaseTip{padding:10px 11px;font-size:10.5px;margin-bottom:15px}
  body.combat .phaseTip span{font-size:8px;letter-spacing:.025em}
  body.combat #launchCombat{font-size:11px}
  body.combat #overlayHelp{font-size:9px;line-height:1.65}
}
@media(max-width:380px){
  body.combat header{gap:8px}
  body.combat h1{font-size:13px}
  body.combat .headeractions{gap:4px}
  body.combat .headeractions button{padding-inline:6px;font-size:8.5px;letter-spacing:0}
  body.combat #pauseCombat{min-width:53px}
  body.combat #soundSettings summary{width:38px}
  body.combat .instrument>span{font-size:7px}
  body.combat #bestScore{display:none}
  body.combat #phase,body.combat #pulse{padding-inline:8px;gap:6px;font-size:8px}
  body.combat #phase small,body.combat #pulse small{font-size:6.5px}
  body.combat #phase b{min-width:45px;font-size:9px}
  body.combat .briefingPanel{padding:19px 15px 17px}
  body.combat .briefingPanel h2{font-size:25px}
  body.combat #streak{font-size:7.5px}
}
@media(max-width:340px){
  body.combat h1{font-size:12px}
  body.combat .headeractions button{font-size:8px}
  body.combat #pauseCombat{min-width:51px}
  body.combat #phase small,body.combat #pulse small{font-size:6px}
  body.combat #phase b{min-width:43px}
}
@media(max-height:500px) and (min-width:561px){
  body.combat header{
    padding-top:calc(var(--camlin-create-toolbar-inset,0px) + 3px);
    padding-bottom:3px;
    gap:10px;
  }
  body.combat .brand .eyebrow{display:none}
  body.combat h1{font-size:17px;margin:0}
  body.combat .headeractions button{min-height:36px;padding:6px 9px;font-size:9px}
  body.combat #soundSettings summary{min-height:36px;width:36px}
  body.combat main{grid-template-rows:33px minmax(0,1fr)}
  body.combat #combatHud{padding-block:3px}
  body.combat .instrument{flex-direction:row;align-items:center;gap:6px}
  body.combat .instrument>span{font-size:7px;letter-spacing:0}
  body.combat .instrument strong{font-size:16px}
  body.combat .hullInstrument{justify-content:center}
  body.combat .scoreInstrument{justify-content:flex-end}
  body.combat #telemetry{font-size:13px}
  body.combat #bestScore{display:none}
  body.combat .scanner{padding-block:5px}
  body.combat footer{padding-block:3px}
  body.combat #hint{font-size:8px;line-height:1.4}
  body.combat #phase,body.combat #pulse{min-height:38px;padding-block:4px;font-size:9px}
  body.combat #phase small,body.combat #pulse small{display:none}
  body.combat #phase b{min-height:24px}
  body.combat #briefing{padding:9px 14px}
  body.combat .briefingPanel{width:min(100%,850px);padding:14px 18px}
  body.combat .briefingPanel .eyebrow{font-size:7px}
  body.combat .briefingPanel h2{font-size:25px;margin:6px 0}
  body.combat #overlaySummary{font-size:11px;line-height:1.5}
  body.combat #briefingSteps{grid-template-columns:repeat(3,minmax(0,1fr));margin:11px 0;gap:7px}
  body.combat #briefingSteps p{padding:8px 10px;gap:8px;font-size:10px}
  body.combat .phaseTip{padding:7px 10px;margin-bottom:10px;font-size:10px;line-height:1.5}
  body.combat .phaseTip span{display:inline;margin-right:6px}
  body.combat #launchCombat{width:auto;min-width:220px;min-height:38px;padding:7px 12px;font-size:11px}
  body.combat #overlayHelp{margin-top:8px;font-size:9px}
}
@media(pointer:coarse){
  body.combat .headeractions button,
  body.combat #phase,
  body.combat #pulse,
  body.combat #soundSettings summary{min-height:44px}
  body.combat #launchCombat{min-height:46px}
  body.combat .audioPanel input[type="range"]{min-height:44px}
  body.combat .audioPanel label[for="musicCombat"]{min-height:44px}
}
@media(prefers-reduced-motion:reduce){
  body.combat button,
  body.combat #soundSettings summary,
  body.combat #audioMeter{transition:none}
  body.combat button:not(:disabled):hover,
  body.combat button:not(:disabled):active{transform:none}
  body.combat .viewport::after{background:none}
}