
:root{color-scheme:dark;--bg:#14171d;--panel:#1d252f;--line:#374454;--text:#f3f6fb;--muted:#b7c2d1;--accent:#ff6533;--gold:#ffd36b}*{box-sizing:border-box}body{margin:0;background:var(--bg);color:var(--text);font:15px/1.45 system-ui,sans-serif}main{width:100%;max-width:none;margin:auto;padding:12px}header{margin-bottom:15px}header h1{font-size:32px;margin:4px 0}header p{margin:0;color:var(--muted)}small{font-size:11px;letter-spacing:.12em;font-weight:800;color:var(--accent)}.console{display:grid;grid-template-columns:minmax(0,1fr) clamp(280px,20vw,330px);gap:12px;align-items:stretch}.arena,.panel{background:var(--panel);border:1px solid var(--line);border-radius:12px;min-width:0;padding:12px}.arena{display:flex;flex-direction:column;align-self:stretch}.hud{display:grid;grid-template-columns:1fr 1fr 1.55fr .6fr;gap:12px;padding:4px 0 12px}.hud>div{min-width:0}.hud span{display:block;font-size:10px;font-weight:800;color:var(--muted);letter-spacing:.06em}.hud strong{display:block;font-size:22px;line-height:1.4;font-variant-numeric:tabular-nums}.energy b{float:right;color:var(--gold)}.meter{height:9px;border-radius:6px;background:#101820;overflow:hidden;margin-top:9px}.meter div{width:100%;height:100%;background:linear-gradient(90deg,#fb6233,#ffdb69);transition:width .1s}.screen{position:relative;overflow:hidden;border-radius:8px;border:1px solid #465161;background:#111820;touch-action:manipulation;flex:1 0 auto;min-height:clamp(420px,40vw,620px);isolation:isolate}canvas{position:absolute;inset:0;display:block;width:100%;height:100%;touch-action:manipulation;aspect-ratio:auto;object-fit:fill}.overlay{position:absolute;inset:0;display:grid;place-items:center;text-align:center;background:linear-gradient(90deg,#0e141bde,#0d141caa);padding:12px;z-index:1}.overlay[hidden]{display:none}.overlay>div{max-width:min(560px,100%)}.overlay h2{font-size:clamp(32px,4vw,56px);letter-spacing:-.045em;margin:4px 0}.overlay p{color:#d2dae6;margin:4px 0 18px}button{background:#2d3947;border:1px solid #5a6879;border-radius:7px;padding:9px 13px;color:var(--text);font:inherit;font-weight:750;cursor:pointer;touch-action:manipulation}button.primary{color:#14171d;background:var(--accent);border-color:var(--accent);padding:11px 22px}button:disabled{opacity:.45;cursor:default}button:focus-visible{outline:3px solid #fff;outline-offset:2px}.controls{display:flex;flex-wrap:wrap;gap:8px;align-items:center;padding-top:12px}.controls button:first-child{background:#563322;border-color:#d77b4f}.controls span{font-size:12px;color:var(--muted);margin-left:auto}kbd{font:10px system-ui;background:#161e29;padding:3px 5px;border-radius:4px;margin-left:6px}aside{display:grid;grid-template-rows:1fr auto;gap:10px;min-height:100%}.panel{display:flex;flex-direction:column}.panel h2{font-size:19px;line-height:1.2;margin:6px 0 8px}.panel p{color:var(--muted);font-size:13px;margin:0 0 10px}.brief p{max-width:36ch}.modebox{border-top:1px solid var(--line);border-bottom:1px solid var(--line);padding:10px 0;margin:6px 0 8px}.modehead{display:flex;justify-content:space-between;align-items:baseline;gap:8px;margin-bottom:8px}.modehead strong{font-size:13px}.modehead span{font-size:11px;color:var(--muted)}.modes{display:grid;grid-template-columns:repeat(3,1fr);gap:8px}.mode{min-height:40px;background:#22303d;border-color:#4f6272}.mode.active{background:#563322;border-color:#ff986f;color:#fff}.rule{display:flex;gap:10px;border-top:1px solid var(--line);padding:9px 0 0;margin-top:8px}.rule>b{color:var(--accent);font-size:12px}.rule strong{font-size:13px}.rule p{margin:2px 0 0}.records>div{display:flex;justify-content:space-between;align-items:center;margin:8px 0;font-size:13px}.records p{margin:8px 0 0;font-size:11px}footer{font-size:11px;color:var(--muted);padding:10px 0}.wrn-embedded main{max-width:none;padding:0 3px}.wrn-embedded header,.wrn-embedded footer{display:none}@media(min-width:851px){aside>.panel:first-child{justify-content:flex-start}.records{justify-content:space-between}}@media(max-width:850px){.console{grid-template-columns:1fr}.screen{min-height:360px}aside{grid-template-columns:1fr 1fr;grid-template-rows:none;align-items:stretch}}@media(max-width:540px){main{padding:6px}.arena,.panel{padding:8px}.hud{grid-template-columns:1fr 1fr;gap:7px}.hud strong{font-size:17px}.hud span{font-size:9px}.controls button{min-height:44px;font-size:12px;padding:7px 9px}.controls span{margin-left:0;width:100%}.screen{min-height:320px}aside{grid-template-columns:1fr}.overlay h2{font-size:26px}.overlay p{font-size:12px;margin:2px 0 8px}.overlay small{font-size:9px}.overlay button{padding:7px 16px}.modes{grid-template-columns:1fr}.modehead{display:block}.modehead span{display:block;margin-top:2px}}@media(prefers-reduced-motion:reduce){*{transition:none!important}}

/* 0.1.5 — compact viewport-aware console; keep the game visually dominant. */
main{padding:8px}.wrn-embedded main{padding:0 3px}.console{gap:10px;align-items:stretch;grid-template-columns:minmax(0,1fr) clamp(245px,19vw,310px)}.arena,.panel{padding:10px;border-radius:10px}.hud{gap:9px;padding:0 0 8px}.hud strong{font-size:20px}.screen{min-height:0;flex:1 1 auto;height:auto}.controls{padding-top:8px;gap:6px}.controls button{padding:7px 10px;font-size:13px}.controls span{font-size:11px}.panel h2{font-size:16px;margin:4px 0}.panel p{font-size:12px;line-height:1.35;margin:0 0 5px}.modebox{padding:6px 0;margin:4px 0}.modehead{margin-bottom:4px}.modehead span{font-size:10px}.modes{gap:5px}.mode{min-height:32px;font-size:12px;padding:5px}.rule{padding-top:5px;margin-top:5px;gap:7px}.rule strong,.rule>b{font-size:12px}.rule p{margin:0;font-size:12px}.records>div{margin:3px 0;font-size:12px}.records p{font-size:10px;margin:4px 0 0}.records{justify-content:flex-start}.overlay h2{font-size:clamp(28px,4vw,44px)}.overlay p{margin:4px 0 12px}.overlay-actions{display:flex;gap:8px;justify-content:center;flex-wrap:wrap}.settings-panel{display:grid;gap:7px;text-align:left;background:#1b242e;border:1px solid #485666;border-radius:9px;padding:10px;margin-top:8px}.settings-panel[hidden]{display:none}.settings-panel label{display:flex;gap:7px;align-items:center;font-size:13px}.settings-panel input{accent-color:var(--accent)}.settings-panel button{padding:5px 12px}.overlay.settings-open #eyebrow,.overlay.settings-open #headline,.overlay.settings-open #summary,.overlay.settings-open .overlay-actions{display:none}
@media(min-width:851px){.console{min-height:clamp(390px,calc(100vh - 100px),570px)}.wrn-embedded .console{min-height:clamp(390px,var(--game-budget,480px),570px)}.screen{min-height:240px}.brief{justify-content:flex-start}.records{justify-content:flex-start}aside{gap:8px;min-height:0}}
@media(max-width:850px){.console{grid-template-columns:1fr;min-height:0}.screen{flex:none;min-height:240px;height:clamp(240px,42vw,380px)}aside{grid-template-rows:auto;min-height:0}}
@media(max-width:540px){.screen{height:250px;min-height:250px}.hud strong{font-size:17px}.controls button{min-height:42px;padding:6px 8px}.modes{grid-template-columns:repeat(3,1fr)}.mode{min-height:40px}.modehead{display:flex}.overlay h2{font-size:26px}.overlay p{font-size:12px}.overlay .primary{padding:8px 15px}}

.records>div[hidden]{display:none}.brief p{max-width:none}.rule{padding-top:4px;margin-top:4px}.modebox{margin:3px 0;padding:5px 0}.records>div{margin:2px 0}.records p{line-height:1.25}.brief{gap:0}.console{min-height:0}@media(min-width:851px){.console{min-height:clamp(390px,calc(100vh - 100px),530px)}.wrn-embedded .console{min-height:clamp(390px,var(--game-budget,480px),530px)}}

.runbox{border-top:1px solid var(--line);padding:5px 0;margin-top:3px}.runtypes{display:grid;grid-template-columns:1fr 1fr;gap:5px}.overlay{background:linear-gradient(90deg,#0e141b88,#0d141c66)}.overlay>div{background:#111922d9;border:1px solid #465361;border-radius:12px;padding:14px 20px;max-width:min(420px,100%)}.overlay-actions button{font-size:13px;padding:7px 12px}.hud>div:first-child strong{white-space:nowrap;font-size:clamp(12px,1.5vw,20px)}@media(min-width:851px){.console{min-height:clamp(390px,calc(100vh - 100px),510px)}.wrn-embedded .console{min-height:clamp(390px,var(--game-budget,480px),510px)}.rule{padding-top:3px;margin-top:3px}.panel p{font-size:11px}.modebox{padding:4px 0}.brief h2{font-size:15px}}@media(max-width:540px){.overlay>div{padding:9px}.overlay-actions{gap:5px}.overlay-actions button{padding:5px 8px}.hud>div:first-child strong{font-size:16px}}
.mission-track{height:4px;background:#111820;border-radius:3px;overflow:hidden;margin:3px 0 4px}.mission-track>div{width:0;height:100%;background:var(--accent)}.panel .route{font-size:10px;letter-spacing:0;color:#b7c2d1;margin-bottom:3px}.brief .rule p{line-height:1.28}@media(min-width:851px){.console{min-height:clamp(390px,calc(100vh - 100px),510px)}.wrn-embedded .console{min-height:clamp(390px,var(--game-budget,480px),510px)}}

[hidden]{display:none!important}dialog{width:min(650px,94vw);max-height:min(85vh,660px);overflow:auto;border:1px solid #526378;border-radius:12px;background:#19232e;color:var(--text);padding:18px}dialog::backdrop{background:#080e15bc}.dialog-head{display:flex;justify-content:space-between;align-items:center;gap:12px}.dialog-head h2{margin:4px 0 12px}.campaign-tabs{display:flex;gap:6px;flex-wrap:wrap;margin:8px 0 12px}.campaign-tabs .active{border-color:var(--accent);background:#563322}.campaign-status{font-size:13px;margin:8px 0;color:var(--gold)}dialog select,dialog textarea{display:block;width:100%;padding:8px;margin:5px 0 10px;background:#101820;color:#fff;border:1px solid #526378;border-radius:6px;font:inherit}dialog textarea{resize:vertical;font-family:monospace;overflow-wrap:anywhere}.level-grid{display:grid;grid-template-columns:repeat(5,1fr);gap:7px}.level-grid button{padding:9px 4px;min-height:53px;font-size:12px}.level-grid button span{display:block;color:var(--gold);font-size:10px}.skin-grid{display:grid;grid-template-columns:repeat(2,1fr);gap:8px}.skin-card{border:1px solid var(--line);border-radius:8px;padding:10px}.skin-swatch{display:inline-block;width:18px;height:18px;border-radius:4px;vertical-align:middle;margin-right:5px}.skin-card p{font-size:12px}.skin-card button{width:100%;font-size:12px}.overlay>div{max-height:100%;overflow:auto}.screen .overlay h2{font-size:clamp(24px,3vw,40px)}.controls button{font-size:12px;padding:6px 8px}@media(max-width:540px){.level-grid{grid-template-columns:repeat(3,1fr)}dialog{padding:12px}.skin-grid{grid-template-columns:1fr}}

/* Compact progress-code controls */
#saveCode{display:block;width:100%;padding:11px 9px;background:#101820;border:1px solid var(--line);border-radius:6px;color:var(--text);font:700 clamp(15px,3vw,22px)/1.4 ui-monospace,monospace;letter-spacing:.05em;box-sizing:border-box;text-align:center;margin:4px 0 8px}.code-actions{display:flex;flex-wrap:wrap;gap:8px}.full-backup{margin:14px 0;padding:10px 0;border-block:1px solid var(--line)}.full-backup summary{cursor:pointer;font-weight:700;color:var(--muted)}.full-backup p{margin:8px 0}.full-backup textarea{width:100%}

/* v0.2.3 mission rooms and live cell balance */
.hud{grid-template-columns:minmax(0,1.2fr) minmax(0,.8fr) minmax(0,1.4fr) minmax(0,.8fr) minmax(0,.4fr);align-items:start}.hud-cells strong{color:#59d5e1;overflow-wrap:anywhere}.hud .run-cell-count{font-size:10px;letter-spacing:0;font-weight:500;color:#b7c2d1}.mission-track{position:relative}.mission-track i{position:absolute;left:50%;top:0;width:2px;height:100%;background:#d4dfe8}.mission-track i.reached{background:#8cf5a4}.checkpoint-banner{position:absolute;z-index:2;top:42px;left:50%;transform:translateX(-50%);max-width:92%;padding:8px 14px;border:1px solid #8cf5a4;border-radius:6px;background:#122a24ed;color:#a2e6c6;font-size:clamp(10px,1.6vw,14px);font-weight:800;text-align:center;pointer-events:none;box-shadow:0 4px 20px #0005}@media(max-width:540px){.hud{grid-template-columns:1fr 1fr 1fr;gap:6px}.hud .energy{grid-column:1/3;grid-row:2}.hud-cells{grid-column:3;grid-row:2}.hud>div:last-child{grid-column:3;grid-row:1}.hud>div:first-child strong{font-size:13px;white-space:normal}.hud strong{font-size:15px}.hud .run-cell-count{font-size:9px}}

.pursuit-banner{position:absolute;z-index:2;bottom:12px;left:50%;transform:translateX(-50%);max-width:94%;padding:6px 12px;border:1px solid #ff9379;border-radius:6px;background:#352020ed;color:#ffd0bb;font-size:clamp(10px,1.4vw,13px);font-weight:800;white-space:nowrap;pointer-events:none}.pursuit-banner[hidden]{display:none}

/* v0.3.0 compact, accessible power-up key; identical colors and letters to pickups. */
.power-legend{display:grid;grid-template-columns:1fr 1fr;gap:4px 6px;margin-top:3px}.power-legend>span{display:flex;gap:4px;align-items:center;line-height:1.15;font-size:10px;color:#dce6ef}.power-gem{display:inline-grid;place-items:center;flex:0 0 19px;height:21px;clip-path:polygon(50% 0,100% 25%,100% 75%,50% 100%,0 75%,0 25%);color:#142432;font:800 12px/1 system-ui;font-style:normal}.power-gem.cell{background:#59d5e1}.power-gem.shield{background:#75a6ff}.power-gem.coolant{background:#8cf5a4}.power-gem.magnet{background:#d7a0ff}@media(max-width:540px){.power-legend>span{font-size:11px}}

/* v0.3.2 — actual pickups counted separately from bonus currency and active power-ups. */
.hud .hud-pickups{min-width:0;grid-column:1/-1;grid-row:2;display:flex;align-items:center;gap:12px;padding:5px 0 0;border-top:1px solid var(--line)}
.hud .pickup-label{white-space:nowrap;font-size:10px;line-height:1.15}
.pickup-totals{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:8px;min-width:0;flex:1}
.pickup-total{display:flex;align-items:center;gap:5px;min-width:0;justify-content:center}
.hud .pickup-total strong{font-size:15px;line-height:1.2;font-variant-numeric:tabular-nums;overflow-wrap:anywhere;min-width:0}
.pickup-total .power-gem{flex:0 0 18px;height:20px;font-size:11px}
@media(min-width:1250px){.hud{grid-template-columns:minmax(0,1.05fr) minmax(0,.65fr) minmax(0,1.15fr) minmax(160px,1.55fr) minmax(0,.65fr) minmax(0,.35fr)}.hud .hud-pickups{grid-column:auto;grid-row:auto;display:block;padding:0;border:0}.hud .pickup-label{margin-bottom:5px}.pickup-totals{gap:4px}.pickup-total{gap:3px;justify-content:flex-start}.hud .pickup-total strong{font-size:13px}}
@media(max-width:540px){.hud .hud-pickups{grid-row:3;display:block;padding:5px 0 0}.hud .pickup-label{margin-bottom:5px}.pickup-totals{gap:6px}.hud .pickup-total strong{font-size:14px}}

/* v0.3.3 — fit the desktop console to the available viewport; side panels never stretch the playfield. */
#fullscreen{margin-left:auto;white-space:nowrap}.controls #notice{margin-left:0;flex:1 1 140px;text-align:right}.controls button{flex-shrink:0}.screen{flex:1 1 0;min-height:0}
@media(min-width:851px){
 .console{height:clamp(400px,calc(100vh - 125px),540px);min-height:0;grid-template-rows:minmax(0,1fr)}
 .wrn-embedded .console{height:clamp(400px,var(--game-budget,520px),540px);min-height:0}
 .arena{min-height:0;padding:9px}.screen{height:0;min-height:180px}.hud{flex:none;padding-bottom:7px;gap:7px}.controls{flex:none;padding-top:7px}
 aside{min-height:0;max-height:100%;overflow-y:auto;grid-template-rows:auto auto;align-content:start;scrollbar-width:thin;scrollbar-color:#526378 #1d252f;gap:6px;overscroll-behavior:contain}
 .panel{padding:8px}.brief h2{margin:3px 0}.rule{margin-top:3px;padding-top:3px}.rule p{line-height:1.23}.modebox,.runbox{padding:3px 0;margin:2px 0}.mode{min-height:29px;padding:4px}.records>div{margin:1px 0}
}
@media(max-width:850px){.screen{flex:none;height:clamp(210px,40vw,340px);min-height:0}.controls #notice{flex-basis:100%;text-align:left}.console{height:auto;min-height:0}aside{min-height:0}}
:root:fullscreen{background:var(--bg);overflow:auto}:root:fullscreen body{min-height:100%;margin:0}:root:fullscreen main{max-width:none;width:100%;padding:8px}:root:fullscreen header,:root:fullscreen footer{display:none}
:root:fullscreen .console{height:calc(100dvh - 16px);min-height:0;grid-template-columns:minmax(0,1fr);grid-template-rows:minmax(0,1fr);gap:0}:root:fullscreen .arena{min-height:0}:root:fullscreen .screen{flex:1 1 0;height:0;min-height:100px}:root:fullscreen .console>aside{display:none}
@media(max-width:850px),(max-height:480px){:root:fullscreen .console{grid-template-columns:minmax(0,1fr)}:root:fullscreen aside{display:none}:root:fullscreen .controls #notice{flex-basis:100%;text-align:left}:root:fullscreen .controls button{min-height:30px}:root:fullscreen .arena{padding:6px}}

/* 0.3.4 — compact grouped HUD. Breakpoints follow arena width, not monitor width. */
.arena{container-type:inline-size;container-name:arena}
.hud.hud-refined{display:grid;grid-template-columns:minmax(0,1.1fr) minmax(0,.85fr) minmax(0,1.55fr);align-items:center;gap:0;padding:0 0 8px;min-width:0}
.hud-refined>div{grid-column:auto;grid-row:auto;min-width:0;padding:2px 12px}
.hud-refined>div:first-child{padding-left:0}.hud-refined>div:last-child{padding-right:0}
.hud-refined>div+div{border-left:1px solid var(--line)}
.hud-refined .hud-mission{display:flex;align-items:center;gap:12px}
.hud-refined .hud-level{background:#151d26;border:1px solid #394857;border-radius:6px;padding:5px 9px;text-align:center;flex:none}
.hud-refined span{font-size:10px;letter-spacing:.045em;line-height:1.25;font-weight:750;color:var(--muted)}
.hud-refined .hud-level strong{color:var(--text);font-size:19px;line-height:1.2;white-space:normal;overflow-wrap:anywhere}
.hud-refined .hud-distance{min-width:0}
.hud-refined .hud-distance #score{font-size:clamp(14px,1.45cqi,20px);line-height:1.2;white-space:normal;overflow-wrap:anywhere;font-weight:800}
.hud-refined .hud-record{display:flex;align-items:baseline;flex-wrap:wrap;gap:4px;margin-top:2px;color:var(--muted)}
.hud-refined .hud-record span,.hud-refined .hud-record #best{display:inline;font-size:11px;line-height:1.2;letter-spacing:0;color:var(--muted);font-weight:600;white-space:normal;overflow-wrap:anywhere}
.hud-refined .hud-boost .meter{height:7px;margin-top:6px}
.hud-refined .hud-resources{display:grid;grid-template-columns:minmax(0,1fr) minmax(64px,auto);gap:10px;align-items:center}
.hud-refined .hud-pickups{display:block;grid-column:auto;grid-row:auto;padding:0;border:0;min-width:0}
.hud-refined .pickup-label{margin-bottom:5px;font-size:10px;white-space:normal}
.hud-refined .pickup-totals{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:5px}
.hud-refined .pickup-total{display:flex;align-items:center;justify-content:center;gap:3px;background:#151d26;border:1px solid #354352;border-radius:5px;padding:3px 2px;min-width:0;flex-wrap:wrap}
.hud-refined .pickup-total strong{font-size:13px;line-height:1;overflow-wrap:anywhere;min-width:0}
.hud-refined .pickup-total .power-gem{flex:0 0 16px;height:18px;font-size:10px}
.hud-refined .hud-cells{border-left:1px solid var(--line);padding-left:10px;min-width:0;max-width:112px}
.hud-refined .hud-cells strong{font-size:19px;line-height:1.2}
.hud-refined .run-cell-count{font-size:10px;line-height:1.2;letter-spacing:0;font-weight:500;overflow-wrap:anywhere}
@container arena (max-width:820px){
 .hud.hud-refined{grid-template-columns:minmax(0,1fr) minmax(0,1fr);row-gap:7px}
 .hud-refined .hud-resources{grid-column:1/-1;grid-row:2;border-left:0;border-top:1px solid var(--line);padding:6px 0 0;grid-template-columns:minmax(0,1fr) minmax(64px,auto)}
 .hud-refined .hud-boost{padding-right:0}.hud-refined .hud-pickups{display:flex;align-items:center;gap:9px}.hud-refined .pickup-label{margin:0;max-width:85px}.hud-refined .pickup-totals{flex:1;max-width:330px}
}
@container arena (max-width:400px){
 .hud-refined>div{padding:0 7px}.hud-refined .hud-mission{gap:6px}.hud-refined .hud-level{padding:3px 5px}.hud-refined .hud-level strong{font-size:16px}.hud-refined .hud-distance #score{font-size:13px}.hud-refined .hud-boost span{font-size:9px}.hud-refined .hud-pickups{display:block}.hud-refined .pickup-label{max-width:none;margin-bottom:3px}.hud-refined .pickup-totals{gap:3px}.hud-refined .pickup-total{gap:2px;padding:2px 1px}.hud-refined .hud-cells{padding-left:6px;max-width:85px}.hud-refined .hud-cells strong{font-size:16px}.hud-refined .hud-resources{gap:6px}.hud-refined .pickup-total strong{font-size:12px}
}
/* Explicit positions supersede older HUD breakpoints. */
.hud.hud-refined>.hud-mission{grid-column:1;grid-row:1}
.hud.hud-refined>.hud-boost{grid-column:2;grid-row:1}
.hud.hud-refined>.hud-resources{grid-column:3;grid-row:1}
.hud-refined .hud-boost>span{display:flex;justify-content:space-between;gap:4px;flex-wrap:wrap}
.hud-refined .hud-boost b{float:none}
@container arena (max-width:820px){.hud.hud-refined>.hud-resources{grid-column:1/-1;grid-row:2}}
.hud.hud-refined .hud-pickups{grid-column:1;grid-row:1}
.hud.hud-refined .hud-cells{grid-column:2;grid-row:1}

/* v0.3.7: dedicated tab uses the browser viewport, not native fullscreen. */
.window-settings{display:none}.wrn-window .window-settings,:root:fullscreen .window-settings{display:grid;gap:5px}.window-settings .runtypes button.active{background:#563322;border-color:#ff986f}.window-settings small{font-size:10px;color:var(--muted);letter-spacing:0}.wrn-window .settings-panel,:root:fullscreen .settings-panel{max-height:min(65dvh,430px);overflow:auto}.wrn-window{background:var(--bg);overflow:auto}.wrn-window body{margin:0;min-height:100%}.wrn-window main,.wrn-window.wrn-embedded main{max-width:none;width:100%;padding:8px}.wrn-window header,.wrn-window footer,.wrn-window .console>aside{display:none}.wrn-window .console,.wrn-window.wrn-embedded .console{height:calc(100dvh - 16px);min-height:0;grid-template-columns:minmax(0,1fr);grid-template-rows:minmax(0,1fr);gap:0}.wrn-window .arena{min-height:0}.wrn-window .screen{flex:1 1 0;height:0;min-height:100px}.wrn-window .controls #notice{min-width:0}.wrn-window .overlay{overflow:auto}.wrn-window .overlay>div{max-width:100%}
@media(max-width:850px),(max-height:480px){.wrn-window .controls #notice{flex-basis:100%;text-align:left}.wrn-window .controls button{min-height:30px}.wrn-window .arena{padding:6px}.wrn-window .console,.wrn-window.wrn-embedded .console{height:max(350px,calc(100dvh - 16px))}}

/* Collapsible mission sidebar: a compact right-hand rail restores the panel on demand. */
.mission-sidebar{position:relative;min-width:0;min-height:0;display:flex;flex-direction:column}
.mission-sidebar>aside{min-height:0;flex:1 1 auto}
.mission-sidebar>aside[hidden]{display:none!important}
.panel-toggle{position:absolute;z-index:2;top:5px;right:19px;display:flex;align-items:center;justify-content:center;gap:4px;padding:3px 7px;min-height:24px;font-size:10px;line-height:1.1;background:#253341;border:1px solid #526378;border-radius:5px;color:#dce6ef}
.panel-toggle-arrow{font-size:17px;line-height:1;font-weight:800}
.mission-sidebar .brief>small:first-child{padding-right:62px}
.console.panel-collapsed{grid-template-columns:minmax(0,1fr) 34px;gap:6px}
.panel-collapsed .mission-sidebar{background:var(--panel);border:1px solid var(--line);border-radius:8px}
.panel-collapsed .panel-toggle{position:static;flex:1 1 auto;width:100%;padding:5px 0;flex-direction:column;border:0;background:transparent;min-height:32px}
.panel-collapsed .panel-toggle-label{writing-mode:vertical-rl;text-orientation:mixed;letter-spacing:.04em}
.panel-toggle:hover{background:#34475a;color:#fff}
.panel-collapsed .window-settings{display:grid;gap:5px}
.panel-collapsed .settings-panel{max-height:min(65dvh,430px);overflow:auto}
.wrn-window .console:not(.panel-collapsed){grid-template-columns:minmax(0,1fr) clamp(240px,20vw,300px);gap:8px}
.wrn-window .console.panel-collapsed{grid-template-columns:minmax(0,1fr) 34px;gap:6px}
@media(max-width:850px){
 .console.panel-collapsed,.wrn-window .console.panel-collapsed,.wrn-window .console:not(.panel-collapsed){grid-template-columns:minmax(0,1fr);grid-template-rows:auto auto;gap:6px}
 .panel-collapsed .panel-toggle{min-height:34px;flex-direction:row;gap:7px}.panel-collapsed .panel-toggle-label{writing-mode:horizontal-tb}.panel-collapsed .panel-toggle-arrow{transform:rotate(-90deg)}
 .wrn-window .console.panel-collapsed{grid-template-rows:minmax(0,1fr) 36px}
 .wrn-window .console:not(.panel-collapsed){height:auto;min-height:0}.wrn-window .console:not(.panel-collapsed) .screen{flex:none;height:clamp(210px,46vw,380px)}
 .panel-toggle{min-height:30px;right:8px}
}
:root:fullscreen .mission-sidebar{display:none!important}
:root:fullscreen .console,:root:fullscreen .console.panel-collapsed,:root.wrn-window:fullscreen .console{grid-template-columns:minmax(0,1fr);grid-template-rows:minmax(0,1fr);height:calc(100dvh - 16px);gap:0}
:root.wrn-window:fullscreen .console:not(.panel-collapsed) .screen{flex:1 1 0;height:0;min-height:100px}

/* 0.4.0 — viewport-fit height and compact combat HUD */
@media(min-width:851px){.wrn-embedded:not(.wrn-window):not(:fullscreen) .console{height:max(360px,var(--game-budget,540px));min-height:0}.screen{min-height:150px}.controls{gap:5px}.controls button{padding:6px 8px}}
.weapon-row{margin-top:7px}.hud-refined .weapon-row>span{display:flex;justify-content:space-between;gap:4px}.weapon-row b{color:#59d5e1}.weapon-meter #weaponEnergy{width:100%;height:100%;background:linear-gradient(90deg,#2d8db7,#90f2f2)}.weapon-row .meter{height:5px!important;margin-top:3px!important}#attack{background:#244453;border-color:#4b9eb4}.settings-panel{max-height:min(75dvh,420px);overflow:auto}.settings-panel input[type=range]{width:100%;accent-color:#ff8557;min-height:24px}.volume-label{display:flex!important;justify-content:space-between;gap:8px}.overlay{overflow:auto}.settings-open{align-items:start}.settings-open>div{margin:auto}.settings-panel output{color:#ffd36b}

.boss-hud{position:absolute;top:37px;left:50%;transform:translateX(-50%);width:min(460px,92%);padding:8px 12px;background:#101923e8;border:1px solid #93634c;border-radius:8px;z-index:2;pointer-events:none;line-height:1.15}.boss-hud[hidden]{display:none}.boss-heading{display:flex;justify-content:space-between;align-items:center;gap:6px;color:#ffdab8;font-size:11px}.boss-heading strong{font-size:13px}.boss-track{height:8px;margin:5px 0;background:#3a2830;border-radius:4px;overflow:hidden}.boss-track div{height:100%;background:linear-gradient(90deg,#e04b4b,#ffad65);transition:width .12s}.boss-message{font-size:11px;color:#edf6ff;text-align:center;margin-top:4px}.screen:has(.boss-hud:not([hidden])) .checkpoint-banner,.screen:has(.boss-hud:not([hidden])) .pursuit-banner{display:none}@media(max-width:540px){.boss-hud{top:24px;padding:5px 7px}.boss-heading strong{font-size:11px}.boss-message{font-size:10px}}

.objective-text{color:#ffd36b!important;font-weight:700}.skin-card p{line-height:1.45}#campaignWorkshop h3{margin:14px 0 8px;font-size:15px}#campaignWorkshop .skin-card{display:flex;flex-direction:column;gap:5px}#campaignWorkshop .skin-card button{margin-top:auto}.campaign-tabs{flex-wrap:wrap}

.campaign-tabs{flex-wrap:wrap;grid-template-columns:repeat(auto-fit,minmax(100px,1fr))}.campaign-tabs button{min-width:0;white-space:normal} #campaignAccount .code-actions{flex-wrap:wrap}

/* 0.9.0 — accessible touch and performance controls */
.settings-panel select{background:#15212b;color:var(--text);border:1px solid #526378;border-radius:5px;padding:6px;min-width:0;max-width:55%;font:inherit}.settings-panel label:has(select){justify-content:space-between}.settings-panel .control-help,#controllerStatus{font-size:11px;color:var(--muted);margin:2px 0}.controls #jump,.controls #attack{touch-action:none;user-select:none;-webkit-user-select:none}.controls #attack:active,.controls #jump:active{filter:brightness(1.3)}@media(pointer:coarse){.controls #jump,.controls #attack{min-height:48px;flex:1 1 42%;font-size:14px}.controls button{min-height:40px}.controls #notice{flex-basis:100%;text-align:left}.panel-toggle{min-height:40px}.settings-panel label{min-height:32px}.settings-panel select{min-height:36px}.settings-panel input[type=checkbox]{width:20px;height:20px}}@media(pointer:coarse) and (orientation:landscape) and (max-height:540px){.wrn-window .console.panel-collapsed,:root:fullscreen .console{height:calc(100dvh - 12px);min-height:0}.wrn-window .screen,:root:fullscreen .screen{min-height:85px}.controls #jump,.controls #attack{flex:0 1 auto;min-height:40px}.controls #notice{display:none}.hud.hud-refined{padding-bottom:5px}.wrn-window main{padding:6px}.overlay h2{font-size:clamp(18px,4vw,30px)}.overlay p{font-size:12px}.overlay-actions button{padding:5px 9px}}

#testOpen{border-color:#ffac64;color:#ffbc85}.test-options label{display:block;margin:10px 0}.test-options input[type=checkbox]{margin-right:8px}.test-options p{font-size:13px;line-height:1.45}.test-actions{display:flex;flex-wrap:wrap;gap:8px}.test-options h3{margin-top:18px}

/* Campaign operation briefing (1.0 RC1) */
.mission-story{border-left:2px solid var(--gold,#f9b65c);padding:8px 10px;margin:10px 0;background:#1b2532;border-radius:0 5px 5px 0}.mission-story small{font-size:10px;letter-spacing:.07em;color:var(--gold,#f9b65c)}.mission-story p{font-size:12px;line-height:1.4;margin:5px 0}.mission-story #storyTip{color:#b2c4d4}.zone-brief{margin:10px 0;padding:10px 12px;border:1px solid #47576a;background:#192432;border-radius:6px;font-size:13px;line-height:1.45}.level-grid button .level-operation{display:block;font-size:10px;line-height:1.3;margin:4px 0;color:inherit;font-weight:400}.level-grid button{min-height:75px;overflow-wrap:anywhere}.mission-help{font-size:12px;color:#b2c4d4}.mission-story[hidden]{display:none}

/* RC4: base campaign, expansion preview and mobile layout */
.base-campaign-intro,.expansion-preview{padding:14px;margin:12px 0;border:1px solid #4b5d70;border-radius:9px;background:linear-gradient(135deg,#253442,#19232e)}.campaign-kicker{font-size:11px;letter-spacing:.08em;color:#ffba76;font-weight:800}.base-campaign-intro h3,.expansion-preview h3{font-size:21px;margin:6px 0}.base-campaign-intro p,.expansion-preview p{font-size:13px;margin:5px 0;line-height:1.5}.level-duration{display:block;font-size:10px;line-height:1.3;margin:5px 0;color:inherit}.level-grid button{min-height:96px}.campaign-tabs button{min-height:42px}.wrn-window main{padding:max(8px,env(safe-area-inset-top)) max(8px,env(safe-area-inset-right)) max(8px,env(safe-area-inset-bottom)) max(8px,env(safe-area-inset-left))}.wrn-window .console,.wrn-window.wrn-embedded .console{height:calc(100dvh - max(8px,env(safe-area-inset-top)) - max(8px,env(safe-area-inset-bottom)))}
@media(pointer:coarse){dialog{max-height:calc(100dvh - max(20px,env(safe-area-inset-top)) - max(20px,env(safe-area-inset-bottom)));padding:12px;overscroll-behavior:contain}.campaign-tabs button,.dialog-head button,.overlay-actions button{min-height:44px}.level-grid button{min-height:100px}.controls #jump,.controls #attack{min-height:48px;touch-action:none}.controls #pause,.controls #restart{min-height:44px}.controls kbd{display:none}.settings-panel input[type=range]{min-height:40px}.wrn-window .console:not(.panel-collapsed){height:auto}.wrn-window .console.panel-collapsed{min-height:0}}
@media(pointer:coarse) and (orientation:landscape) and (max-height:540px){.wrn-window .controls{gap:4px}.wrn-window .controls button{min-height:44px;padding:5px 8px}.wrn-window .console.panel-collapsed{grid-template-rows:minmax(0,1fr) 32px}.wrn-window .panel-collapsed .panel-toggle{min-height:32px}.wrn-window .screen{min-height:80px}.overlay-actions{gap:4px}.overlay-actions button{min-height:44px}.wrn-window .arena{padding:4px}}

.skin-art-preview{height:144px;width:128px;max-width:100%;margin:4px auto 8px;display:grid;place-items:center}.skin-art-preview img{display:block;width:100%;height:100%;object-fit:contain;filter:drop-shadow(0 4px 8px #07080d88)}.skin-art-error{font-size:12px;color:#f4b78a;text-align:center;line-height:1.4}.game-build-label{font-size:11px;color:#a8bacb;letter-spacing:.04em;margin-top:3px}

/* RC12 — in-arena player status. Display only; existing external HUD retained. */
.arena-status{position:absolute;top:8px;left:8px;right:8px;z-index:2;display:flex;align-items:flex-start;justify-content:space-between;gap:8px;pointer-events:none;line-height:1.15}
.arena-status[hidden],.player-hud [hidden]{display:none!important}
.player-hud{width:clamp(112px,28%,200px);flex:0 0 auto;padding:7px 9px;border:1px solid #607686;border-radius:7px;background:#101923ed;color:#f3f6fb;box-shadow:0 2px 8px #0005;min-width:0}
.player-hud-title,.player-meter-label{display:flex;align-items:baseline;justify-content:space-between;gap:4px;font-size:10px;font-weight:750}
.player-hud-title{margin-bottom:5px}.player-hud-title strong{color:#fff;letter-spacing:.08em}.player-hud-title span{color:#bcc9d5;font-size:9px}.player-hud-title .charged{color:#85e6c4}
.player-meter-label{color:#d3dee7;margin-top:4px}.player-meter-label b{color:#fff;white-space:nowrap;font-variant-numeric:tabular-nums}
.player-track{height:6px;margin-top:3px;background:#26343e;border-radius:3px;overflow:hidden}.player-track>div{height:100%;width:100%;background:linear-gradient(90deg,#168754,#a6f272)}
.player-track.weapon>div{background:linear-gradient(90deg,#248fb8,#84e9ff)}.player-track.armor>div{background:linear-gradient(90deg,#a96b19,#ffd278)}.player-track.low>div{background:#ff6558}
.arena-status .boss-hud{position:static;transform:none;flex:0 1 460px;width:auto;min-width:0;margin-left:auto}.arena-status .boss-heading{flex-wrap:wrap}.arena-status .boss-message{overflow-wrap:anywhere}
.screen:has(.arena-status:not([hidden])) .checkpoint-banner{top:8px;left:auto;right:8px;transform:none;max-width:calc(100% - clamp(112px,28%,200px) - 28px)}
@media(max-width:540px),(max-height:520px){.arena-status{top:4px;left:4px;right:4px;gap:5px}.player-hud{padding:4px 5px;width:clamp(108px,34%,168px)}.player-hud-title{margin-bottom:1px}.player-hud-title,.player-meter-label{font-size:9px}.player-hud-title span{font-size:8px}.player-meter-label{margin-top:2px}.player-track{height:5px;margin-top:2px}.arena-status .boss-hud{padding:4px 5px}.arena-status .boss-heading,.arena-status .boss-message{font-size:9px}.arena-status .boss-heading strong{font-size:10px}.screen:has(.arena-status:not([hidden])) .checkpoint-banner{top:4px;right:4px;max-width:calc(100% - clamp(108px,34%,168px) - 18px);padding:4px 6px}}

/* RC15: preserve player visibility without changing jump height or hitbox size. */
.arena-status:not(.hud-outside) .player-hud{max-width:var(--player-hud-limit,200px)}
.arena-status.hud-outside{position:relative;inset:auto;flex:none;margin:0 0 6px;min-width:0;pointer-events:none}
.arena-status.hud-outside[hidden]{display:none!important}

/* RC24: standard opening menu; only show a recovery action on an actual asset failure. */
.graphics-error[hidden]{display:none}.graphics-error{margin-top:12px;padding:10px;border:1px solid #a56c48;border-radius:8px;background:#222831;color:#edf3f8}.graphics-error p{margin:0 0 8px;font-size:13px}.graphics-error button{margin:0}

/* RC34 — independent multi-touch, visible focus and thumb-sized controls. */
.controls #attack.held:not(:disabled){filter:brightness(1.25);border-color:#ffb47f}.ff-playing canvas{touch-action:none;user-select:none;-webkit-user-select:none}.overlay{overflow:auto;overscroll-behavior:contain}.overlay>div{min-width:0;max-width:min(560px,100%)}
@media(pointer:coarse){.controls #jump,.controls #attack{flex:1 1 calc(50% - 6px);min-width:0;min-height:56px;white-space:normal}.controls #attack{background:#354b61;border-color:#8caabd}.controls button{min-height:44px}.controls #fullscreen{margin-left:0}.settings-panel select{min-height:44px}.settings-panel label{min-height:44px}.overlay-actions button{min-height:44px}.ff-playing .controls{padding-bottom:max(6px,env(safe-area-inset-bottom))}}
@media(pointer:coarse) and (orientation:landscape) and (max-height:540px){.wrn-window .controls #jump,.wrn-window .controls #attack,:root:fullscreen .controls #jump,:root:fullscreen .controls #attack{flex:1 1 90px;min-height:48px}.wrn-window .controls #notice,:root:fullscreen .controls #notice{flex-basis:100%;margin:0}.wrn-window .overlay>div,:root:fullscreen .overlay>div{max-width:100%}}

/* Illustrated Workshop, no added gameplay asset preload. */
#campaignWorkshop .equipment-preview{height:132px;display:flex;align-items:center;justify-content:center;background:#161c23;border:1px solid #364655;border-radius:7px;overflow:hidden}#campaignWorkshop .equipment-preview img,#campaignWorkshop .equipment-preview canvas{max-width:100%;width:auto;height:100%;object-fit:contain}#campaignWorkshop .weapon-stats{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:4px 8px;font-size:11px;margin:5px 0;color:#d6e1ed}#campaignWorkshop .weapon-stats dt{color:#b9c6d3;overflow-wrap:anywhere}#campaignWorkshop .weapon-stats dd{margin:0;text-align:right;font-weight:600}#campaignWorkshop .skin-card button{margin-top:auto}#testWeapon{width:100%;margin-bottom:10px}
#campaignWorkshop .equipment-preview canvas{position:static;inset:auto;display:block;aspect-ratio:5/2;touch-action:auto;pointer-events:none}
