:root{color-scheme:dark;font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,"Liberation Mono",monospace;background:#111;color:#efefeb;font-synthesis:none;-webkit-text-size-adjust:100%;font-size:14px}*{box-sizing:border-box;-webkit-tap-highlight-color:transparent}html,body{margin:0;width:100%;height:100%;overflow:hidden;overscroll-behavior:none;touch-action:none;user-select:none;-webkit-user-select:none;-webkit-touch-callout:none}button,input{font:inherit}button{color:inherit;background:none;border:1px solid #666;cursor:pointer;touch-action:none}button:focus-visible,input:focus-visible{outline:2px solid #fff;outline-offset:4px}button:disabled{cursor:default;opacity:.45}button:active{background:#454545}button svg{width:22px;height:22px;fill:none;stroke:currentColor;stroke-width:1.6;stroke-linecap:round;stroke-linejoin:round}[hidden]{display:none!important}#console{height:100%;height:100dvh;max-width:1024px;margin: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));display:grid;grid-template-rows:76px minmax(0,1fr) 214px;gap:0}#status{display:flex;align-items:center;justify-content:space-between;gap:10px}.mission-id{font-size:13px;font-weight:700;letter-spacing:1px;white-space:nowrap}.mission-id span{display:block;color:#aaa;font-size:9px;font-weight:400;letter-spacing:.4px;margin-top:6px}.mission-state{min-width:0;text-align:right;flex:1}#clock{font-size:20px;font-variant-numeric:tabular-nums;letter-spacing:1px}#objective{display:block;font-size:10px;color:#ccc;line-height:1.3;margin-top:4px;max-width:190px;margin-left:auto}#pause{border:none;width:36px;min-width:36px;height:44px}.icon-button{width:44px;height:44px;display:grid;place-items:center;border-color:#4c4c4c;border-radius:5px}#feed{position:relative;min-height:0;border:1px solid #595959;border-radius:10px;overflow:hidden;background:#252525}#sensor{display:block;width:100%;height:100%;touch-action:none}#hud{position:absolute;inset:0;width:100%;height:100%;pointer-events:none}#polarity{position:absolute;top:0;left:0;width:105px;height:42px;border:0;border-radius:8px;background:transparent}#debug{position:absolute;right:8px;bottom:40px;padding:5px;background:#000b;color:#fff;font-size:9px;pointer-events:none;white-space:pre;text-align:right}#controls{display:grid;grid-template-columns:minmax(0,1fr) 44px 116px;grid-template-rows:1fr 24px;column-gap:12px;align-items:center;padding:14px 2px 7px}#weapons{display:flex;flex-direction:column;gap:6px;min-width:0}.weapon{display:flex;justify-content:space-between;align-items:center;text-align:left;min-height:44px;border-color:#515151;border-radius:4px;padding:7px 9px}.weapon>span{font-size:20px;line-height:1;letter-spacing:-1px}.unit{font-size:9px;letter-spacing:0;margin-left:3px}.weapon small{font-size:9px;white-space:nowrap;letter-spacing:.2px}.weapon.selected{background:#e7e7e0;color:#111;border-color:#e7e7e0}.weapon:not(.selected) small{color:#bcbcbc}#utilities{display:flex;flex-direction:column;gap:12px}#fire{width:116px;height:116px;border-radius:50%;border:2px solid #deded8;box-shadow:inset 0 0 0 6px #111,inset 0 0 0 7px #5d5d5d;background:#272727;display:flex;flex-direction:column;justify-content:center;align-items:center;gap:8px}#fire>span{font-size:22px;font-weight:700;letter-spacing:2px}#fire small{font-size:8px;color:#c1c1c1}#fire.held{background:#e7e7e0;color:#111}#fire.held small{color:#333}.control-caption{grid-column:1/-1;display:flex;justify-content:space-between;gap:10px;font-size:8px;color:#999;letter-spacing:.5px}body.left-handed #weapons{grid-column:3;grid-row:1}body.left-handed #fire{grid-column:1;grid-row:1}body.left-handed #utilities{grid-column:2;grid-row:1}body.left-handed #controls{grid-template-columns:116px 44px minmax(0,1fr)}#overlay{position:fixed;inset:0;display:flex;align-items:center;justify-content:center;padding:max(16px,env(safe-area-inset-top)) 20px max(16px,env(safe-area-inset-bottom));background:#090909e8;z-index:10}.sheet{width:100%;max-width:410px;max-height:100%;overflow:auto;overscroll-behavior:contain;touch-action:pan-y;scrollbar-color:#666 #171717}.sheet h1{font-size:clamp(32px,9vw,44px);letter-spacing:-2px;line-height:1;margin:0 0 13px;font-weight:500}.sheet h2{font-size:27px;line-height:1.15;letter-spacing:-1px;margin:0 0 18px}.sheet p{color:#bdbdbd;font-size:12px;line-height:1.65;margin:10px 0 20px}.sheet .intro{font-size:13px;color:#ddd;max-width:34ch}.controls-card{border-block:1px solid #555;padding:9px 0;margin:24px 0}.controls-card div{display:grid;grid-template-columns:93px 1fr;gap:8px;align-items:baseline;padding:7px 0;font-size:11px;line-height:1.5}.controls-card b{font-weight:500;color:#fff}.controls-card span{color:#bbb}.sheet .safety{font-size:11px;color:#e0e0e0;margin:16px 0}.primary,.secondary{width:100%;min-height:52px;border-radius:4px;padding:12px;font-size:12px;font-weight:700;letter-spacing:1px}.primary{background:#e7e7e0;color:#111;border-color:#e7e7e0}.secondary{margin-top:10px;border-color:#666}.start-actions{display:flex;flex-direction:column}.start-actions .secondary{min-height:44px}.sheet .footnote{font-size:10px;line-height:1.5;text-align:center;margin:14px 0 0;color:#969696}.setting-row{display:flex;gap:16px;justify-content:space-between;align-items:center;border-top:1px solid #444;padding:15px 0;font-size:12px;line-height:1.5}.setting-row small{display:block;color:#aaa;font-size:10px;margin-top:3px}.setting-row input{width:22px;height:22px;accent-color:#ddd;flex:none;cursor:pointer}.settings-actions{margin-top:18px}.result-table{width:100%;border-collapse:collapse;margin:20px 0;font-size:11px;font-variant-numeric:tabular-nums}.result-table th,.result-table td{border-bottom:1px solid #444;padding:9px 0;text-align:right;font-weight:400}.result-table th:first-child,.result-table td:first-child{text-align:left}.result-table thead{color:#aaa}.rank{font-size:17px;letter-spacing:1px;padding-bottom:14px;border-bottom:1px solid #777}.desktop-hint{display:none}@media(pointer:fine){.desktop-hint{display:block}}@media(max-height:720px) and (orientation:portrait){#console{grid-template-rows:64px minmax(0,1fr) 180px}#controls{padding-top:9px;grid-template-rows:1fr 20px;column-gap:9px;grid-template-columns:minmax(0,1fr) 44px 108px}#fire{width:108px;height:108px}#weapons{gap:4px}.weapon{min-height:42px}.sheet h1{font-size:36px}.controls-card{margin:17px 0;padding:5px 0}.controls-card div{padding:5px 0}.sheet p{margin-bottom:14px}.sheet .safety{margin:12px 0}body.left-handed #controls{grid-template-columns:108px 44px minmax(0,1fr)}}@media(orientation:landscape) and (max-height:650px){#console{max-width:none;grid-template-columns:minmax(0,1fr) 170px;grid-template-rows:53px minmax(0,1fr);column-gap:12px;padding-bottom:max(8px,env(safe-area-inset-bottom))}#status{grid-column:1;grid-row:1}#feed{grid-column:1;grid-row:2}#controls{grid-column:2;grid-row:1/3;display:flex;flex-direction:column;gap:8px;padding:8px 0 0;justify-content:center}#weapons{width:100%;gap:4px}.weapon{min-height:36px;padding:5px 8px}.weapon>span{font-size:17px}#utilities{flex-direction:row;gap:10px}#utilities .icon-button{height:36px}#fire{width:96px;height:96px;min-height:96px}.control-caption{display:none}body.left-handed #console{grid-template-columns:170px minmax(0,1fr)}body.left-handed #status,body.left-handed #feed{grid-column:2}body.left-handed #controls{grid-column:1}.sheet{max-width:560px}.sheet h1{font-size:30px}.sheet .intro{max-width:none;margin:6px 0}.controls-card{margin:10px 0;display:grid;grid-template-columns:1fr 1fr;gap:0 15px}.controls-card div{grid-template-columns:72px 1fr;font-size:10px;padding:3px 0}.sheet .safety{margin:8px 0}.sheet .footnote{margin-top:8px}.primary,.secondary{min-height:44px}.start-actions{flex-direction:row;gap:10px}.start-actions .secondary{margin-top:0;width:34%}.setting-row{padding:9px 0}}@media(min-width:800px) and (min-height:651px){#console{grid-template-rows:86px minmax(0,1fr) 185px;max-width:1100px;padding-inline:26px}.mission-id{font-size:17px}.mission-id span{font-size:10px}#objective{font-size:12px;max-width:400px}#controls{grid-template-columns:1fr 120px 130px;column-gap:30px}#weapons{flex-direction:row;gap:12px}.weapon{flex:1;min-height:64px;padding:12px;flex-direction:column;align-items:flex-start;gap:8px}.weapon>span{font-size:27px}#utilities{flex-direction:row;gap:12px}#fire{width:130px;height:130px}.control-caption{font-size:10px}body.left-handed #controls{grid-template-columns:130px 120px 1fr}}
.phase-result{border-top:1px solid #444;font-size:11px}.phase-result summary{padding:13px 0;cursor:pointer;line-height:1.5}.phase-result summary span{float:right;color:#aaa;font-size:10px}.phase-result .result-table{margin:0 0 16px}.phase-result:last-of-type{margin-bottom:20px}.phase-result summary:focus-visible{outline:2px solid #fff;outline-offset:2px}

#view-mode{position:absolute;left:10px;top:68px;min-width:70px;min-height:44px;padding:8px 12px;background:#171b1e;color:#f4f4ef;border:1px solid #858b8b;border-radius:4px;font-size:10px;letter-spacing:.5px}#view-mode:hover{background:#30373b}#view-mode:active{background:#465056}#view-mode[aria-pressed="false"]{background:#e7e7e0;color:#111;border-color:#e7e7e0}

/* Fullscreen keeps the complete console and all overlays inside the browser surface. */
#utilities{gap:8px}
html.game-fullscreen #console{max-width:none}
#fullscreen[aria-pressed="true"]{background:#e7e7e0;color:#111;border-color:#e7e7e0}
#start-fullscreen{margin-top:10px;min-height:44px;font-size:11px}
#rotate-prompt{position:fixed;inset:0;z-index:30;display:grid;place-items:center;padding:max(24px,env(safe-area-inset-top)) max(24px,env(safe-area-inset-right)) max(24px,env(safe-area-inset-bottom)) max(24px,env(safe-area-inset-left));background:#111;text-align:center}
.rotate-content{max-width:320px;width:100%}
.rotate-content>svg{width:96px;height:80px;fill:none;stroke:#e7e7e0;stroke-width:2;stroke-linecap:round;stroke-linejoin:round}
.rotate-content h2{font-size:20px;font-weight:500;line-height:1.3;margin:22px 0 12px}
.rotate-content p{font-size:12px;color:#bdbdbd;line-height:1.7;margin:0 0 22px}
@media(min-width:800px) and (min-height:651px){#controls{grid-template-columns:1fr 160px 130px}body.left-handed #controls{grid-template-columns:130px 160px 1fr}}
@media(orientation:landscape) and (max-height:650px){#utilities{gap:8px}#utilities .icon-button{height:44px}}

/* Immersive sensor: the scene fills the viewport; only controls intercept touches. */
html.game-fullscreen #console{position:fixed;inset:0;width:100%;height:100%;height:100dvh;display:block;padding:0;max-width:none}
html.game-fullscreen #feed{position:absolute;inset:0;border:0;border-radius:0}
html.game-fullscreen #status{position:absolute;z-index:3;top:max(8px,env(safe-area-inset-top));left:50%;transform:translateX(-50%);width:min(52%,420px);height:48px;gap:8px;pointer-events:none;background:#111b;border-radius:5px;padding:2px 8px}
html.game-fullscreen .mission-id{display:none}
html.game-fullscreen .mission-state{text-align:center}
html.game-fullscreen #clock{font-size:16px}
html.game-fullscreen #objective{font-size:9px;max-width:none;margin:2px 0 0}
html.game-fullscreen #pause{pointer-events:auto;width:44px;min-width:44px}
html.game-fullscreen #controls{position:absolute;inset:0;display:block;padding:0;pointer-events:none;z-index:2}
html.game-fullscreen #controls button{pointer-events:auto}
html.game-fullscreen #weapons{position:absolute;left:max(12px,env(safe-area-inset-left));bottom:max(44px,calc(env(safe-area-inset-bottom) + 12px));width:auto;display:flex;flex-direction:row;gap:6px}
html.game-fullscreen .weapon{flex:none;width:78px;min-height:58px;padding:8px;flex-direction:column;align-items:flex-start;gap:7px;background:#171b1ed9;border-color:#999a}
html.game-fullscreen .weapon>span{font-size:21px}
html.game-fullscreen .weapon.selected{background:#e7e7e0;color:#111;border-color:#e7e7e0}
html.game-fullscreen #utilities{position:absolute;left:max(12px,env(safe-area-inset-left));bottom:max(110px,calc(env(safe-area-inset-bottom) + 78px));flex-direction:row;gap:6px}
html.game-fullscreen #utilities button{height:44px;background:#171b1ed9;border-color:#999a}
html.game-fullscreen #utilities #fullscreen{background:#e7e7e0;color:#111}
html.game-fullscreen #fire{position:absolute;right:max(16px,env(safe-area-inset-right));bottom:max(44px,calc(env(safe-area-inset-bottom) + 12px));width:100px;height:100px;min-height:100px;background:#171b1ec9}
html.game-fullscreen #fire.held{background:#e7e7e0;color:#111}
html.game-fullscreen .control-caption{display:none}
html.game-fullscreen #view-mode{left:max(12px,env(safe-area-inset-left));top:max(120px,calc(env(safe-area-inset-top) + 110px));background:#171b1ed9}
html.game-fullscreen body.left-handed #weapons,html.game-fullscreen body.left-handed #utilities{left:auto;right:max(12px,env(safe-area-inset-right))}
html.game-fullscreen body.left-handed #fire{right:auto;left:max(16px,env(safe-area-inset-left))}
#audio-recover{position:absolute;z-index:4;top:120px;left:50%;transform:translateX(-50%);min-height:44px;padding:10px 14px;border-radius:4px;background:#e7e7e0;color:#111;font-size:11px;font-weight:700}

/* Campaign briefing follows the existing sensor-console palette. */
.mission-picker{display:block;font-size:11px;color:#ddd;line-height:1.5}.mission-picker select{display:block;width:100%;min-height:48px;margin-top:7px;padding:10px 9px;font:inherit;font-size:13px;color:#efefeb;background:#202020;border:1px solid #777;border-radius:4px;touch-action:manipulation}.mission-picker select:focus-visible{outline:2px solid #fff;outline-offset:3px}.mission-brief{margin:17px 0 20px;border-block:1px solid #555;padding:13px 0}.mission-meta{display:flex;flex-wrap:wrap;justify-content:space-between;gap:8px;font-size:11px;color:#ddd}.mission-brief p{margin:10px 0 0;font-size:12px}.mission-brief .mission-focus{font-size:11px;color:#bdbdbd}.mission-brief .mission-record{font-size:10px;color:#ddd}.mission-help{margin-top:20px;font-size:11px;color:#ccc}.mission-help summary{min-height:44px;padding:12px 0;cursor:pointer;touch-action:manipulation}.mission-help summary:focus-visible{outline:2px solid #fff;outline-offset:2px}.mission-help .controls-card{margin:0 0 14px}.sheet select option{background:#202020;color:#efefeb}.sheet .secondary:hover,.mission-picker select:hover{border-color:#ddd}.sheet .primary:hover{background:#fff}.mission-id span{white-space:normal;line-height:1.3}@media(orientation:landscape) and (max-height:650px){.mission-brief{margin:12px 0;padding:10px 0}.mission-help{margin-top:8px}}

/* Installed iPhone windows may report a short dynamic/fixed viewport. */
html.game-standalone,html.game-standalone body{height:var(--game-screen-height,100%)}
html.game-standalone #console{height:var(--game-screen-height,100%)}
html.game-standalone.game-fullscreen #console{position:absolute;inset:0 0 auto;height:var(--game-screen-height,100%)}
html.game-standalone #overlay,html.game-standalone #rotate-prompt{position:absolute;inset:0 0 auto;height:var(--game-screen-height,100%)}

.gyro-settings{border-top:1px solid #444;padding:6px 0 12px}
.sheet #gyro-status{font-size:11px;line-height:1.5;margin:10px 0 14px}
.gyro-sensitivity{display:flex;align-items:center;justify-content:space-between;gap:12px;font-size:10px}
#gyro-sensitivity{font:inherit;color:#efefeb;background:#171b1e;border:1px solid #666;border-radius:4px;min-height:44px;padding:8px;touch-action:manipulation}

/* Compact visible controls retain 44px touch targets inside the sensor banner. */
#sensor-modes{position:absolute;top:2px;left:max(10px,env(safe-area-inset-left));display:flex;gap:6px}
#sensor-modes #polarity,#sensor-modes #view-mode{position:static;display:grid;align-items:center;min-width:0;min-height:44px;height:44px;width:58px;margin:0;padding:6px 0;border:0;border-radius:0;background:transparent;color:#f4f4ef;font-size:9px;letter-spacing:.3px}
#sensor-modes button span{display:grid;place-items:center;width:100%;height:30px;border:1px solid #858b8b;border-radius:4px;background:#171b1ee8}
#sensor-modes button:hover span{background:#30373b}
#sensor-modes button:active span{background:#465056}
#sensor-modes #view-mode[aria-pressed="false"] span,#sensor-modes #polarity[aria-pressed="false"] span{background:#e7e7e0;color:#111;border-color:#e7e7e0}
@media(orientation:landscape){html.game-fullscreen #status{width:min(420px,calc(100% - 360px))}}

.leg-route{list-style:none;display:flex;gap:8px;margin:18px 0;padding:0}
.leg-route li{flex:1;min-width:0;border-top:1px solid #555;padding-top:9px;color:#999;font-size:9px;line-height:1.5}
.leg-route li span{display:block;font-size:13px;margin-bottom:3px}
.leg-route .leg-complete{color:#c0c0ba;border-color:#aaa}
.leg-route .leg-next{color:#fff;border-top:2px solid #eee;padding-top:8px}
.handoff-stats{display:flex;gap:32px;border-block:1px solid #555;margin:18px 0;padding:12px 0}
.handoff-stats dt{font-size:9px;color:#aaa}.handoff-stats dd{margin:6px 0 0;font-size:22px;font-variant-numeric:tabular-nums}
.handoff-next{font-size:14px;line-height:1.4;font-weight:500;margin:20px 0 8px}
.sheet .handoff-context{font-size:10px;line-height:1.6;margin:0 0 16px}
@media(orientation:landscape) and (max-height:650px){.handoff-stats{margin:10px 0;padding:8px 0}.handoff-stats dd{font-size:18px;margin-top:3px}.leg-route{margin:12px 0}.handoff-next{margin:12px 0 6px}}

.sheet.handoff .primary:active{background:#c9c9c3;color:#111}
@media(orientation:landscape) and (max-height:650px){
 .sheet.handoff h2{font-size:22px;margin-bottom:8px}
 .sheet.handoff .handoff-context{line-height:1.4;margin-bottom:8px}
 .sheet.handoff .handoff-stats{margin:8px 0;padding:6px 0}
 .sheet.handoff .handoff-stats dd{font-size:16px;margin-top:3px}
 .sheet.handoff .leg-route{margin:8px 0}
 .sheet.handoff .leg-route li{padding-top:6px}
 .sheet.handoff .leg-route .leg-next{padding-top:5px}
 .sheet.handoff .leg-route li span{font-size:11px;margin-bottom:1px}
 .sheet.handoff .handoff-next{margin:8px 0 6px}
 .sheet.handoff p{line-height:1.5;margin:8px 0 10px;font-size:11px}
}

/* Final console polish: long objectives share the available mobile width. */
@media(max-width:600px){html:not(.game-fullscreen) #status{display:grid;grid-template-columns:minmax(0,1fr) auto 36px;grid-template-rows:auto auto;column-gap:9px;row-gap:2px;align-content:center}html:not(.game-fullscreen) .mission-id{grid-column:1;grid-row:1;min-width:0}html:not(.game-fullscreen) .mission-state{display:contents}html:not(.game-fullscreen) #clock{grid-column:2;grid-row:1;font-size:19px}html:not(.game-fullscreen) #objective{grid-column:1/3;grid-row:2;max-width:none;margin:0;text-align:left;line-height:1.25;font-size:10px}html:not(.game-fullscreen) #pause{grid-column:3;grid-row:1/3}html:not(.game-fullscreen) .mission-id span{font-size:8px;letter-spacing:0;margin-top:3px}}
.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap;border:0}
select:focus-visible{outline:2px solid #efefeb;outline-offset:2px}
/* Objective text sets its own height in every console orientation. */
html:not(.game-fullscreen) #console{grid-template-rows:auto minmax(0,1fr) 214px}html:not(.game-fullscreen) #status{min-height:76px;padding-block:6px}
@media(min-width:800px) and (min-height:651px){html:not(.game-fullscreen) #console{grid-template-rows:auto minmax(0,1fr) 185px}html:not(.game-fullscreen) #status{min-height:86px}}
@media(max-height:720px) and (orientation:portrait){html:not(.game-fullscreen) #console{grid-template-rows:auto minmax(0,1fr) 180px}html:not(.game-fullscreen) #status{min-height:64px}}
@media(orientation:landscape) and (max-height:650px){html:not(.game-fullscreen) #console{grid-template-rows:auto minmax(0,1fr)}html:not(.game-fullscreen) #status{min-height:53px}}
html.game-fullscreen #status{height:auto;min-height:48px;padding-block:5px}

#latch-state{display:block;font-size:9px;line-height:1.35;color:#bfc6c3;margin-top:3px;font-variant-numeric:tabular-nums}@media(max-width:600px){html:not(.game-fullscreen) #latch-state{grid-column:1/3;grid-row:3;margin:0;font-size:9px}html:not(.game-fullscreen) #pause{grid-row:1/4}}
