
:root{color-scheme:dark;--bg:#07121f;--ink:#e8f2f3;--muted:#8eacbf;--line:#33515f;--mint:#8aeacc;--violet:#c5b6ff;--amber:#ffc487;--danger:#ffa18d;font-family:"Segoe UI",system-ui,sans-serif;font-synthesis:none}*{box-sizing:border-box}body{margin:0;min-width:280px;min-height:100dvh;color:var(--ink);background-color:var(--bg);background-image:radial-gradient(ellipse at 12% 45%,#19475380,transparent 48%),radial-gradient(ellipse at 75% 10%,#23335b55,transparent 65%),radial-gradient(circle at 17px 31px,#d5efff75 1px,transparent 1.4px),radial-gradient(circle at 74px 23px,#a9cfdf45 .7px,transparent 1px);background-size:auto,auto,173px 139px,223px 193px}button,a{-webkit-tap-highlight-color:transparent}button{font:inherit;color:inherit;cursor:pointer;min-width:44px;min-height:44px;border:1px solid var(--line);border-radius:7px;background:#122634}button:hover{border-color:var(--mint);background:#1b3643}button:disabled{cursor:default;opacity:.4}button:focus-visible,a:focus-visible{outline:3px solid var(--mint);outline-offset:2px}a{color:var(--muted);text-decoration:none}a:hover{text-decoration:underline}[hidden]{display:none!important}.game{height:100dvh;min-height:340px;display:grid;grid-template-rows:auto minmax(180px,1fr) auto;padding:env(safe-area-inset-top) max(10px,env(safe-area-inset-right)) env(safe-area-inset-bottom) max(10px,env(safe-area-inset-left));position:relative}.topbar{display:flex;flex-wrap:wrap;align-items:center;justify-content:space-between;gap:12px;z-index:2}.brand{display:flex;align-items:center;gap:7px}.brand-mark{width:24px;height:24px;fill:none;stroke:var(--mint);stroke-width:1.5}h1{margin:0;font-size:15px;font-weight:650;letter-spacing:-.4px;white-space:nowrap}h1 span{color:var(--mint)}.readouts{display:flex;align-items:center;gap:20px;font-size:12px;font-variant-numeric:tabular-nums;white-space:nowrap;color:#b5cbd5}.readouts strong{font-weight:600;color:var(--ink)}#shield{color:var(--amber)}#score{color:var(--mint)}.tools{display:flex;align-items:center;gap:2px}.tools button,.tools a{background:transparent;border:0;padding:0 9px;font-size:11px;min-height:44px;display:flex;align-items:center;justify-content:center;white-space:nowrap}.tools #help-toggle{font-size:17px}.field-wrap{position:relative;min-width:0;min-height:0;display:flex;justify-content:center;align-items:center}#field{display:block;width:100%;height:100%;max-height:780px;touch-action:pan-y pinch-zoom;overflow:hidden}.sector-label{position:absolute;left:8px;top:5px;display:flex;flex-direction:column;gap:4px;pointer-events:none;color:#7b9ba9;font-size:10px;letter-spacing:.8px}.sector-label>span:first-child{color:#a4d3cf;font-size:12px;letter-spacing:2.8px}.console{width:100%;max-width:1120px;justify-self:center;min-width:0;align-self:end;padding-bottom:4px;background:linear-gradient(180deg,#07121f00,#07121fb8 75%)}.command-row{display:flex;justify-content:space-between;align-items:center;gap:12px;min-height:52px;flex-wrap:wrap}.solution{display:flex;align-items:center;gap:18px;min-width:0;flex-wrap:wrap}.equation{display:flex;align-items:center;gap:8px;font-size:27px;white-space:nowrap;font-family:Georgia,serif}.variable{display:flex;align-items:center;gap:8px;background:transparent;padding:0 9px;min-width:64px;min-height:44px;font-family:inherit;border-color:#57726a}.variable i{font-size:28px}.variable small{font-family:"Segoe UI",sans-serif;font-size:15px;font-variant-numeric:tabular-nums}.m-color{color:var(--mint);border-color:#4f8b80}.b-color{color:var(--violet);border-color:#776798}.variable[aria-expanded=true]{background:#173634;box-shadow:inset 0 -2px var(--mint)}.b-color[aria-expanded=true]{background:#29243b;box-shadow:inset 0 -2px var(--violet)}.aim-meta{display:flex;flex-direction:column;gap:4px;font-size:11px;white-space:nowrap;color:var(--muted)}#armed-equation{color:#d4e5e6;font-variant-numeric:tabular-nums}.actions{display:flex;align-items:center;gap:8px;flex-shrink:0}.actions button{padding:0 20px;font-size:14px;font-weight:650;min-height:44px}.actions button span{margin-left:12px}.fire,.next-wave{border-color:#a5f2d7;background:var(--mint);color:#092b26;box-shadow:0 0 22px #64dfb815}.fire:hover,.next-wave:hover{background:#b4f6de}.choice-row{min-height:48px;display:flex;align-items:center;min-width:0}.choices{display:flex;align-items:center;gap:5px;overflow-x:auto;max-width:100%;padding:2px 1px;scroll-padding-inline:5px;touch-action:pan-x pinch-zoom}.choices:before{font-size:11px;line-height:1.35;flex:0 0 90px;padding-right:6px;color:var(--mint);white-space:pre-line}.slope-choices:before{content:'m · barrel slope'}.intercept-choices:before{content:'b · altitude\A y-intercept';color:var(--violet)}.choices button{flex:0 0 44px;min-height:44px;padding:0;font-size:15px;font-variant-numeric:tabular-nums}.slope-choices button[aria-pressed=true]{background:var(--mint);color:#102722;border-color:var(--mint)}.intercept-choices button[aria-pressed=true]{background:var(--violet);color:#221b32;border-color:var(--violet)}#control-hint{display:flex;align-items:center;gap:8px;font-size:12px;color:var(--muted);min-width:0;width:100%;line-height:1.3}#aim-status{color:#a9cdc6}#result{margin-left:auto;text-align:right;font-size:11px}.status-light{width:5px;height:5px;border-radius:50%;background:var(--mint);box-shadow:0 0 8px #8aeacc77;flex-shrink:0}.rotate-hint{display:none}.help-panel{position:absolute;right:max(12px,env(safe-area-inset-right));top:48px;z-index:10;width:min(430px,calc(100% - 24px));max-height:calc(100dvh - 64px);overflow:auto;padding:16px 20px;border:1px solid #587a88;border-radius:12px;background:#0b1d2bf5;box-shadow:0 15px 60px #0009;color:#bbcfda;font-size:14px;line-height:1.6}.help-heading{display:flex;align-items:center;justify-content:space-between;gap:10px}.help-heading h2{font-size:20px;font-weight:500;color:var(--mint);margin:0}.help-heading button{font-size:25px}.help-panel strong{color:#e1efec}.help-panel a{display:inline-flex;align-items:center;min-height:44px}.prototype-tag{font-size:10px;letter-spacing:1px;color:#74909c}
.stars{fill:#cceaff}.gridline{stroke:#567787;stroke-width:.7;opacity:.26}.axis{fill:none;stroke:#769eac;stroke-width:1.4}.tick{fill:#95b0be;font-size:14px;font-variant-numeric:tabular-nums}.axis-label{fill:#cde1e8;font-size:21px;font-style:italic}.coordinate{fill:#f9e6ce;font-size:16px;paint-order:stroke;stroke:#081624;stroke-width:4;stroke-linejoin:round;font-variant-numeric:tabular-nums}.field-summary{fill:#7396aa;font-size:9px;letter-spacing:1.3px}.planet-name{fill:#ccf6ef;font-size:16px;letter-spacing:4px}.planet-subtitle{fill:#80b6bd;font-size:8px;letter-spacing:1.8px}.field-footer{fill:#7292a3;font-size:9px;letter-spacing:1.2px}.planet-aura{fill:none;stroke:#6be5e4;stroke-width:15;opacity:.12;filter:blur(7px)}.landmass{fill:#325561;opacity:.47}.landmass.distant{fill:#2a6373;opacity:.4}.planet-cloud{fill:none;stroke:#98dbe2;stroke-width:14;opacity:.1;filter:blur(5px)}.surface-circuit{fill:none;stroke:#58a8bc;stroke-width:.8;opacity:.3}.surface-light{fill:#c4fbeb}.planet-limb{fill:none;stroke:#8ee5e1;stroke-width:2;opacity:.75}.atmosphere-edge{fill:none;stroke:#84e9f0;stroke-width:1;opacity:.34}.city-foundation{fill:#294959;stroke:#83b9bf;stroke-width:1}.city-outrigger{fill:#182d42;stroke:#72a1ae;stroke-width:1}.city-tower{fill:#2b495d;stroke:#bddbd6;stroke-width:1}.city-roof{fill:none;stroke:#99efd3;stroke-width:2}.city-antenna{stroke:#8dddc9;stroke-width:1}.window{fill:none;stroke:#b5f5d7;stroke-width:2;opacity:.85}.city-building.damaged .city-tower,.city-building.damaged .city-outrigger{fill:#322831;stroke:#95685d}.building-crack{stroke:#ffac79;stroke-width:1.5;fill:none}.smoke{fill:#959298;opacity:.3}.smoke ellipse:nth-child(2){opacity:.65}.smoke ellipse:nth-child(3){opacity:.35}.crater{fill:#19161e;stroke:#c77c58;stroke-width:1.5}.embers{fill:none;stroke:#ffc086;stroke-width:2;opacity:.8}.city-caption{fill:#a6c7ca;font-size:9px;letter-spacing:1.5px}.integrity-segment.intact{fill:#8aeacc}.integrity-segment.lost{fill:#754f47}.comet-halo{fill:#ffab5a;opacity:.26;filter:url(#warm-glow)}.comet-tail{fill:#f6a55d;opacity:.55}.comet-filament{stroke:#ffe6b5;stroke-width:1.2;fill:none;opacity:.55}.comet-glow{fill:#ffaf65;opacity:.47;filter:url(#warm-glow)}.comet-core{fill:#ffd396;stroke:#fff0cf;stroke-width:1}.comet-hot{fill:#fff9ed}.orbital-rail{stroke:#87d5d4;stroke-width:3;opacity:.13;stroke-dasharray:2 6}.station-halo{fill:#7eeddd;opacity:.055;stroke:#b1f6e5;stroke-width:1}.station-truss{fill:none;stroke:#779daa;stroke-width:3}.solar-panel{fill:#133143;stroke:#88b5c3;stroke-width:1.3}.solar-cells{stroke:#427d95;stroke-width:1;fill:none}.station-body{fill:#203d50;stroke:#b7dedb;stroke-width:1.5}.station-detail{fill:none;stroke:#668e9f;stroke-width:1.5}.barrel-shadow{fill:#234958;stroke:#9cc9c7;stroke-width:1}.barrel{fill:#d9f5ee}.muzzle{fill:#8aeacc}.turret{fill:#143343;stroke:#c0e8df;stroke-width:1.5}.reactor{fill:#99ffde;filter:drop-shadow(0 0 5px #99ffde)}.shot-line{stroke:#bcffe6;stroke-width:3;filter:drop-shadow(0 0 7px #75efc1)}.flash-ring{fill:none;stroke:var(--mint);stroke-width:2.5}.hit-core{fill:#d4fff0;opacity:.85;filter:drop-shadow(0 0 11px #aaffd9)}.explosion-halo{fill:#ffaf68;opacity:.55;filter:blur(12px)}.explosion-ring{fill:#ff9c5222;stroke:#ffcb8a;stroke-width:3}.explosion-core{fill:#fff2c9;filter:drop-shadow(0 0 8px #ffb25f)}.explosion-sparks{fill:none;stroke:#ffd19b;stroke-width:2}.impact-burst{animation:impact-flash 500ms ease-out both}.outcome rect{fill:#0b1c2b;fill-opacity:.97;stroke:#476979}.completed-label{fill:var(--mint);font-size:29px;font-weight:600}.completed-subtitle{fill:#b6c8d6;font-size:16px}
.gridline{opacity:.24}.gridline.major{opacity:.45}.tick{font-size:23px;fill:#afc5cc}.coordinate{font-size:25px;stroke-width:5}.axis-label{font-size:27px}.completed-label{font-size:32px}.completed-subtitle{font-size:20px}.planet-limb{stroke-width:2.5}.impact-burst{animation:none}.comet-tail{opacity:.7}
@media(min-height:650px) and (min-width:900px){.game{grid-template-rows:minmax(58px,auto) minmax(260px,1fr) auto;padding-inline:max(24px,env(safe-area-inset-left))}.topbar h1{font-size:19px}.readouts{font-size:14px;gap:30px}.tools button,.tools a{font-size:13px}.console{padding-bottom:12px}.command-row{min-height:58px}.choice-row{min-height:50px}.equation{font-size:32px}.variable{min-width:72px}.aim-meta{font-size:12px}.sector-label{left:15px;top:15px}}
@media(max-width:740px){.topbar{gap:5px}.brand{gap:4px}.brand-mark{width:18px;height:18px}h1{font-size:13px}.readouts{font-size:11px;gap:12px}.tools button,.tools a{padding:0 5px;font-size:10px}.tools #help-toggle{min-width:44px}.solution{gap:11px}.aim-meta{font-size:10px}.equation{gap:6px;font-size:24px}.variable{min-width:57px;padding:0 7px;gap:6px}.variable i{font-size:26px}.actions{gap:6px}.actions button{padding:0 14px;font-size:13px}.actions button span{margin-left:6px}.sector-label{font-size:8px}.sector-label>span:first-child{font-size:10px;letter-spacing:1.8px}}
@media(orientation:portrait){.game{height:auto;min-height:100dvh;grid-template-rows:minmax(88px,auto) minmax(36px,auto) minmax(280px,50dvh) auto;align-content:start;padding-bottom:max(12px,env(safe-area-inset-bottom))}.topbar{flex-wrap:wrap;align-content:start;gap:0}.brand{flex:1;height:44px}h1{font-size:16px}.brand-mark{width:22px;height:22px}.tools{order:1}.readouts{order:2;width:100%;height:44px;justify-content:space-between;font-size:12px;gap:8px}.rotate-hint{display:flex;align-items:center;justify-content:center;text-align:center;color:#a2b9c7;font-size:11px;border-block:1px solid #31445477}.field-wrap{align-items:center}.sector-label{top:12px;left:4px}#field{min-height:280px}.console{align-self:start}.command-row{flex-wrap:wrap;height:auto;gap:8px;padding-top:10px}.solution{width:100%;justify-content:space-between}.aim-meta{font-size:11px}.actions{width:100%}.actions button{flex:1}.choice-row{height:auto;min-height:56px;margin-top:4px}.choices{flex-wrap:wrap;overflow-x:visible;gap:6px}.choices:before{flex-basis:100%;white-space:normal;padding-bottom:1px}.choices button{flex-basis:44px}.intercept-choices:before{content:'b · altitude / y-intercept'}#control-hint{flex-wrap:wrap;font-size:11px}#result{font-size:11px}.help-panel{top:54px}.coordinate{font-size:29px}.tick{font-size:27px}}
@media(max-width:350px){.tools>a{display:none}.aim-meta{font-size:10px}.variable{min-width:51px}.equation{font-size:22px;gap:5px}.readouts{font-size:11px;gap:5px}}
@media(prefers-reduced-motion:reduce){*{scroll-behavior:auto!important}.impact-burst{animation:none}}

#mute[aria-pressed=true],#music-mute[aria-pressed=true]{color:var(--amber)}
@media(orientation:landscape) and (max-height:450px){.readouts{gap:12px}.tools button,.tools a{padding-inline:5px}.brand-mark{width:18px;height:18px}h1{font-size:13px}.tools #mute{font-size:10px}}

/* One shared wave battery; the last-change warning stays visible with either chooser open. */
#battery-readout{color:var(--mint);font-variant-numeric:tabular-nums}#battery-readout[data-low=true]{color:var(--amber)}#battery-costs{color:#b5cbd5}#battery-warning{padding:3px 0 2px;color:var(--amber);font-size:12px;line-height:1.35}#fire .fire-cost{display:inline-flex;align-items:center;justify-content:center;min-width:21px;border-left:1px solid #092b2640;padding-left:10px;margin-left:10px;font-variant-numeric:tabular-nums}#fire .fire-cost span{margin-left:0}.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap;border:0}

/* Wait is secondary to Fire, with the same reachable touch target. */
.wait{color:#c4d9df;border-color:#5e7f8a;background:#142b38}
.wait:hover{background:#203e4b}
.wait .action-cost{display:inline-flex;align-items:center;border-left:1px solid #819ea655;padding-left:10px;margin-left:10px;font-variant-numeric:tabular-nums;color:var(--mint)}
@media(orientation:landscape) and (max-width:740px){.topbar{column-gap:10px;row-gap:0}.tools{margin-left:auto}.readouts{order:2;width:100%;min-height:20px;justify-content:space-between}.solution{gap:10px}.aim-meta{white-space:normal}.actions button{padding-inline:12px}.actions{gap:6px}}
@media(orientation:portrait){.tools{flex-wrap:wrap;justify-content:flex-end}.topbar .brand{min-width:130px}.topbar .readouts{flex-wrap:wrap;height:auto;min-height:44px}.topbar{padding-bottom:4px}.wait{flex:0 1 35%}.solution{row-gap:8px}.aim-meta{white-space:normal}}

/* Settings remains natively scrollable; scores never change the game surface. */
.settings-panel{width:min(430px,calc(100% - 24px));max-height:calc(100dvh - 76px - env(safe-area-inset-bottom));overflow-y:auto;overflow-wrap:anywhere;overscroll-behavior:contain}
.settings-section{padding:12px 0;border-bottom:1px solid var(--line)}.settings-section h3{margin:0 0 8px;font-size:16px;color:var(--ink);font-weight:600}.settings-section p{margin:8px 0}.settings-section button{padding:8px 12px;max-width:100%;white-space:normal}.settings-scope,.settings-note{font-size:12px;line-height:1.5;color:#aac1cd}#personal-best{color:var(--mint);font-weight:600}#high-scores-table{width:100%;table-layout:fixed;border-collapse:collapse;font-size:13px;font-variant-numeric:tabular-nums}#high-scores-table th,#high-scores-table td{padding:7px 3px;border-bottom:1px solid #33515f80;text-align:right;overflow-wrap:anywhere}#high-scores-table th:first-child,#high-scores-table td:first-child{text-align:left;width:18%}#high-scores-table th{color:#aac1cd;font-size:12px;font-weight:500}#score-storage-status:empty,#update-status:empty{display:none}#apply-update{color:#092b26;background:var(--mint);border-color:var(--mint)}#update-warning{color:var(--amber)}
@media(max-width:740px){.tools{flex-wrap:wrap;justify-content:flex-end;max-width:100%}.tools button{min-width:44px}.settings-panel{top:54px}}
