/* Touch combat view. Pointer state lives in touch-input.mjs. */
#touch-deck,.mobile-hud,#mobile-exit{display:none}
#move-pad,#aim-pad,[data-touch-action]{touch-action:none;user-select:none;-webkit-user-select:none;-webkit-touch-callout:none}
#move-pad{position:relative;width:132px;height:132px;border:1px solid #c5f44866;border-radius:50%;background:radial-gradient(circle,#c5f44810 0 40%,#172217a8 41%);flex-shrink:0}
#move-pad:before,#move-pad:after{content:"";position:absolute;background:#c5f4482a;pointer-events:none}
#move-pad:before{width:1px;height:100%;left:50%}#move-pad:after{height:1px;width:100%;top:50%}
#move-pad .stick{position:absolute;left:50%;top:50%;width:44px;height:44px;margin:-22px 0 0 -22px;background:#c5f448bb;border:2px solid #e8ffab;border-radius:50%;pointer-events:none;box-shadow:0 2px 15px #0009}
.pad-label{position:absolute;bottom:8px;left:0;width:100%;font:10px monospace;color:#e9f6c9;text-align:center;pointer-events:none}
#aim-pad{height:100%;min-width:44px;display:flex;align-items:center;justify-content:center;border:1px dashed #c5f44833;border-radius:18px;color:#e6edc580;font:9px monospace;text-align:center;padding:4px}
.touch-actions{display:grid;grid-template-columns:1fr 1fr;gap:8px;width:132px;align-content:center}
.touch-actions button{padding:0;min-width:48px;min-height:48px;font:10px monospace;border:1px solid #e7bb7277;border-radius:10px;background:#1c2a19e6;color:#f2edd4;touch-action:none}
.touch-actions [data-touch-action=fire]{grid-column:1/-1;height:64px;background:#d15136;color:#fff3d2;border:1px solid #ff9b73;font:bold 20px monospace}
.touch-actions button span{display:block;font:8px monospace;margin-top:3px}
.touch-actions button.pressed{background:#e9f5b8;color:#182511;border-color:#fff}
body.mobile-play{overflow:hidden;overscroll-behavior:none}
.mobile-play #play{position:fixed;inset:0;z-index:100;width:100%;max-width:none;height:100dvh;margin:0;border:0;display:flex;flex-direction:column;background:#0c140d;padding:env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);box-sizing:border-box}
.mobile-play .game-top,.mobile-play .controls,.mobile-play #state,.mobile-play #touch-mode,.mobile-play #fullscreen{display:none}
.mobile-play .rescue-objective{padding:7px 10px;gap:3px 12px;flex:0 0 auto;min-height:40px;font-size:10px;line-height:1.25}
.mobile-play #rescue-task{font:11px/1.3 monospace;order:3;width:100%}
.mobile-play .mobile-hud{display:flex;justify-content:space-between;align-items:center;padding:7px 12px;background:#192417;font:bold 12px monospace;color:#e6efc5;min-height:30px;box-sizing:border-box}
.mobile-play .stage{flex:1 1 auto;width:100%;height:auto;min-height:0;max-height:none;aspect-ratio:auto;margin:0;touch-action:none}
.mobile-play #game{width:100%;height:100%;object-fit:cover;touch-action:none}
.mobile-play .world-surface{width:100%;height:100%}
.mobile-play .game-bottom{flex:0 0 48px;min-height:48px;padding:2px 8px;box-sizing:border-box;display:flex;justify-content:center;background:#101a10;z-index:4}
.mobile-play .game-bottom>div{display:flex;width:100%;gap:8px;justify-content:space-between}
.mobile-play .game-bottom button{min-height:44px;min-width:64px;font:11px monospace;padding:0 12px;touch-action:manipulation}
.mobile-play #mobile-exit{display:block}
.mobile-play #touch-deck{display:flex;align-items:center;justify-content:space-between;gap:8px;padding:10px;flex:0 0 170px;height:170px;box-sizing:border-box;background:linear-gradient(#101a10,#1b2919);order:5;touch-action:none}
.mobile-play #aim-pad{flex:1}
.mobile-play .gate,.mobile-play .result{padding:16px;overflow:auto;overscroll-behavior:contain}
.mobile-play .gate h2,.mobile-play .result h2{font-size:clamp(24px,7vw,52px);line-height:.95}
.mobile-play .gate p,.mobile-play .result p{font-size:12px;line-height:1.4;max-width:32em}
.mobile-play .gate .primary,.mobile-play .result .primary{min-height:48px;font-size:14px;margin-top:10px}
.mobile-play .gate .stamp,.mobile-play .gate .gate-note{display:none}
.reunion{position:absolute;inset:0;z-index:2;pointer-events:none;overflow:hidden;display:flex;align-items:center;justify-content:flex-end;flex-direction:column;padding-bottom:16%;background:radial-gradient(ellipse at center,#fff0 35%,#e7bd7014)}
.reunion[hidden]{display:none}.reunion p{font:bold clamp(14px,2.2vw,24px)/1.2 monospace;text-shadow:0 2px 8px #000;background:#121a0cbb;color:#f5ffd8;margin:0 0 6px;padding:8px 12px;text-align:center}
.reunion>span{font:10px monospace;color:#e6ebb4;letter-spacing:2px;text-shadow:0 1px 4px #000}
@media(orientation:landscape){.mobile-play #touch-deck{position:absolute;bottom:calc(48px + env(safe-area-inset-bottom));left:env(safe-area-inset-left);right:env(safe-area-inset-right);height:140px;padding:4px 14px;pointer-events:none;background:transparent;z-index:3;gap:30px}.mobile-play #touch-deck>*{pointer-events:auto}.mobile-play #aim-pad{background:#13201322;border-color:#c5f44822}.mobile-play #move-pad{width:120px;height:120px}.mobile-play .touch-actions{width:136px;gap:6px}.mobile-play .rescue-objective{min-height:30px;display:flex;flex-wrap:nowrap;padding:5px 12px}.mobile-play #rescue-task{width:auto;order:0;font-size:10px}.mobile-play .mobile-hud{min-height:26px;padding:4px 12px}.mobile-play .gate h2,.mobile-play .result h2{font-size:30px}.mobile-play .gate .eyebrow{display:none}.mobile-play .gate p,.mobile-play .result p{margin:4px}.mobile-play .gate .primary{margin-top:4px}.mobile-play .reunion{padding-bottom:14%}}
@media(max-width:360px){.mobile-play #move-pad{width:112px;height:112px}.mobile-play .touch-actions{width:120px}.mobile-play #touch-deck{gap:4px;padding:6px}}
@media(prefers-reduced-motion:reduce){.reunion{background:none}}

.mobile-pause{display:none;position:absolute;inset:0;z-index:3;background:#0a120be6;align-items:center;justify-content:center;flex-direction:column;color:#c5f448;text-align:center;pointer-events:none}.mobile-play .mobile-pause:not([hidden]){display:flex}.mobile-pause h2{font:bold 36px monospace;margin:0 0 14px}.mobile-pause p{font:13px monospace;margin:0}
@media(max-width:700px){.gate .primary,.result .primary{min-height:48px}.game-bottom button{min-height:44px}.kitchen input,.kitchen select{min-height:44px;font-size:16px}.file-label{min-height:44px}}
/* Combat surfaces must never cover the start/restart menu. Keep portrait space stable. */
.mobile-play #play:has(.gate:not([hidden])) #touch-deck,.mobile-play #play:has(.result:not([hidden])) #touch-deck{visibility:hidden;pointer-events:none}
/* Salvage HUD and paused armory. */
#play{position:relative}.weapon-strip{display:flex;justify-content:space-between;gap:12px;padding:8px 14px;background:#202d19;color:#e8f6c6;font:11px monospace;border-bottom:1px solid #c5f44830}.weapon-strip[hidden]{display:none}#loot-toast{color:#ffc978;text-align:right;min-height:13px}#armory-open{border-color:#c5f44866!important}#scrap-count{display:inline-block;color:#c5f448;margin-left:5px}#armory-open.upgrade-ready{background:#344522}#armory[hidden]{display:none!important}.armory{position:fixed;inset:0;z-index:30;background:#071009f2;display:flex;align-items:flex-start;justify-content:center;overflow:auto;overscroll-behavior:contain;touch-action:pan-y;padding:16px;box-sizing:border-box}.armory-panel{width:100%;max-width:760px;min-width:0;color:#e8f2d4;background:#152014;border:1px solid #c5f44855;padding:22px;box-sizing:border-box;box-shadow:0 12px 70px #0009}.armory-heading{display:flex;justify-content:space-between;gap:16px;align-items:center}.armory-heading h2{font:800 clamp(23px,4vw,38px)/1 sans-serif;margin:0;color:#c5f448}.armory-heading .eyebrow{font-size:9px;margin-bottom:8px}.armory button{min-height:48px;padding:12px;border:1px solid #809b5c;background:#24321d;color:#e6f1c9;cursor:pointer;font:12px/1.4 monospace;text-align:left;touch-action:manipulation}.armory button:disabled{opacity:.42;cursor:default}.armory button:focus-visible,.armory input:focus-visible{outline:3px solid #f7cf78;outline-offset:3px}.armory-heading>button{flex-shrink:0;text-align:center;min-width:100px;font-size:10px}.armory-balance{display:flex;justify-content:space-between;align-items:center;gap:12px;padding:20px 0;color:#c5f448;font:20px monospace}.armory-balance span{font:10px/1.4 monospace;color:#b4bba5;max-width:135px;text-align:right}.armory-weapons,.armory-upgrades{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:10px}.weapon-choice{min-height:94px!important;display:flex;flex-direction:column;gap:7px;justify-content:space-between}.weapon-choice[data-weapon=shredder]{border-color:#59c9df}.weapon-choice[data-weapon=breaker]{border-color:#ee9754}.weapon-choice[aria-pressed=true]{background:#c5f448;color:#172011;border-color:#eaffb0}.armory-upgrades button{min-height:96px;display:flex;flex-direction:column;justify-content:space-between;gap:7px}#armory-detail{font:11px/1.6 monospace;color:#c0d4a7;padding:12px;background:#0d160d;border-left:2px solid #c5f448}.armory-hint{font:11px/1.6 monospace;color:#b9c8a8}.touch-settings{border:1px solid #789b4744;margin:18px 0 0;padding:12px;font:12px monospace;display:grid;gap:10px}.touch-settings legend{padding:0 8px;color:#b9d77c}.touch-settings label{display:flex;justify-content:space-between;align-items:center;gap:10px}.touch-settings input[type=range]{width:100%;min-height:44px;margin:0;padding:0;accent-color:#c5f448;touch-action:pan-y}.touch-settings input[type=checkbox]{width:24px;height:24px;accent-color:#c5f448}.lefty-toggle{justify-content:flex-start!important;min-height:44px}#armory-message{min-height:20px;color:#ffca7b;font:12px/1.4 monospace;margin-bottom:0}.left-handed #move-pad{order:3}.left-handed #aim-pad{order:2}.left-handed .touch-actions{order:1}.mobile-play .weapon-strip{padding:6px 10px;font-size:10px;min-height:25px;box-sizing:border-box}.mobile-play .game-bottom button{min-width:56px;padding:0 8px;font-size:10px}.mobile-play .game-bottom>div{gap:3px}.mobile-play .armory{position:absolute;inset:0;padding:8px;align-items:flex-start}.mobile-play .armory-panel{padding:16px}.mobile-play .armory-heading>button{min-width:88px;padding:10px}.mobile-play .armory-heading .eyebrow{display:none}.mobile-play .armory-heading h2{font-size:24px}.mobile-play .armory-weapons{grid-template-columns:1fr}.mobile-play .weapon-choice{min-height:58px!important;flex-direction:row;align-items:center}.mobile-play .armory-upgrades{grid-template-columns:1fr}.mobile-play .armory-upgrades button{min-height:62px;flex-direction:row;align-items:center}.mobile-play .armory-balance{padding:14px 0}.mobile-play .touch-actions [data-touch-action=fire]{height:70px}.mobile-play #aim-pad{font-size:10px;border-style:none;background:transparent;color:#b9d08b88}.mobile-play .rescue-objective{padding:5px 10px;min-height:34px}.mobile-play #rescue-task{font-size:10px}.mobile-play .game-bottom{flex-basis:48px}
@media(orientation:landscape){.mobile-play .armory-panel{max-width:760px}.mobile-play .armory-weapons,.mobile-play .armory-upgrades{grid-template-columns:repeat(3,minmax(0,1fr))}.mobile-play .weapon-choice{flex-direction:column;align-items:flex-start;min-height:78px!important}.mobile-play .armory-upgrades button{flex-direction:column;align-items:flex-start;min-height:84px}.mobile-play .weapon-strip{padding:4px 12px;min-height:22px}.mobile-play #touch-deck{height:133px}.mobile-play #aim-pad{border:0;background:transparent}.mobile-play .touch-settings{grid-template-columns:1fr 1fr}.mobile-play .touch-settings input[type=range]{grid-column:1}.mobile-play .lefty-toggle{grid-column:2;grid-row:1/3}.mobile-play #move-pad{width:116px;height:116px}}
@media(max-width:360px){.mobile-play .armory-panel{padding:12px}.mobile-play .armory-heading h2{font-size:21px}.mobile-play .game-bottom button{font-size:9px;min-width:50px;padding:0 5px}}
.sector-gate{position:absolute;inset:0;z-index:5;background:#0a130aeb;display:flex;align-items:center;justify-content:center;flex-direction:column;text-align:center;padding:24px;overflow:auto;color:#d6edb2}.sector-gate[hidden]{display:none}.sector-gate h2{font:800 clamp(26px,5vw,50px)/.95 sans-serif;color:#c5f448;max-width:12em;margin:5px 0 16px}.sector-gate p{font:14px/1.6 monospace;max-width:38em}.sector-gate button{min-height:48px;margin:6px;padding:12px 16px;touch-action:manipulation}.sector-gate>div{display:flex;gap:6px;flex-wrap:wrap;justify-content:center}.difficulty-picker{display:flex;gap:10px;justify-content:center;margin:14px 0}.difficulty-picker button{min-height:52px;border:1px solid #6d8543;background:#182516;color:#cbd8af;font:bold 12px monospace;padding:10px 14px;touch-action:manipulation}.difficulty-picker button span{display:block;font:9px monospace;margin-top:5px;color:#c8ceb7}.difficulty-picker button[aria-pressed=true]{border-color:#c5f448;background:#384922;color:#eaffb9}.difficulty-picker button[data-difficulty=hard][aria-pressed=true]{border-color:#ff8d59;background:#542b1d;color:#ffd8aa}.gate .difficulty-picker{position:relative;z-index:1}#sector-label{color:#ffcf77;font-size:10px}.mobile-play .weapon-strip{flex-wrap:wrap;gap:3px 10px}.mobile-play #sector-label{font-size:9px}.mobile-play #loot-toast{flex:1;min-width:70px;font-size:9px}.mobile-play #mobile-lives{color:#dbb0ff}.mobile-play .sector-gate{padding:14px}.mobile-play .sector-gate h2{font-size:30px}.mobile-play .sector-gate p{font-size:12px;line-height:1.45}.mobile-play .sector-gate button{min-height:48px;font-size:11px}.mobile-play .gate .difficulty-picker{margin:8px 0}.mobile-play .gate .difficulty-picker button{padding:8px;min-height:48px}.mobile-play .gate .difficulty-picker button span{display:none}.mobile-play #play:has(.sector-gate:not([hidden])) #touch-deck{visibility:hidden;pointer-events:none}.gate .difficulty-picker button:focus-visible{outline:3px solid #ffcf77}
@media(orientation:landscape){.mobile-play .sector-gate h2{font-size:26px;margin:0 0 8px}.mobile-play .sector-gate p{margin:5px 0;max-width:50em}.mobile-play .sector-gate .eyebrow{display:none}.mobile-play .gate h2{font-size:25px}.mobile-play .gate .difficulty-picker{margin:3px}.mobile-play .gate .difficulty-picker button{min-height:44px;padding:6px 12px}}
/* Brineworks gun bench: the equipped weapon and its actual mod sockets. */
.weapon-bench{--gun-color:#c5f448;background:linear-gradient(135deg,#33432a,#0b160e 65%);border:1px solid #79984a70;margin-bottom:14px;overflow:hidden}.weapon-bench[hidden]{display:none}.weapon-bench[data-weapon=shredder]{--gun-color:#72dbee}.weapon-bench[data-weapon=breaker]{--gun-color:#ffa454}.bench-label{font:10px/1.4 monospace;letter-spacing:1px;padding:12px;margin:0;border-bottom:1px solid #b7db7b30;color:var(--gun-color)}.bench-rack{height:210px;perspective:700px;position:relative;touch-action:pan-y;cursor:grab;background:repeating-linear-gradient(90deg,#b8cf6d0a 0 1px,transparent 1px 40px),radial-gradient(ellipse at 50% 80%,#799b4440,transparent 65%)}.bench-rack:focus-visible{outline:3px solid #ffcf77;outline-offset:-3px}.bench-turntable{position:absolute;width:76%;height:160px;left:12%;bottom:24px;transform-style:preserve-3d;transform:rotateX(6deg) rotateY(var(--yaw));}.bench-turntable:before{content:'';position:absolute;inset:65% -8% -10%;transform:rotateX(68deg);border:2px solid var(--gun-color);background:repeating-linear-gradient(90deg,#475633 0 2px,#172410 2px 26px);box-shadow:0 18px 0 #10190e,0 22px 0 #506139}.bench-gun{position:absolute;inset:-14px 0 0;background:url('assets/brineblaster.png') center/contain no-repeat;transform:translateZ(45px);filter:drop-shadow(0 14px 7px #000a)}[data-weapon=shredder] .bench-gun,[data-weapon=breaker] .bench-gun{inset:-16px 19% 0;background-image:url('assets/salvage-weapons.png');background-size:200% 100%;background-position:left}[data-weapon=breaker] .bench-gun{background-position:right}.bench-sockets{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:1px}.armory .bench-socket{display:flex;flex-direction:column;align-items:center;gap:10px;font:9px monospace;border:0;border-top:1px solid #b7db7b30;background:#101b10;min-width:0;min-height:58px;padding:10px 3px}.socket-lights{display:flex;gap:6px}.socket-lights i{width:12px;height:7px;background:#34412c;box-shadow:inset 0 1px 3px #000}.socket-lights .lit{background:var(--gun-color);box-shadow:0 0 8px color-mix(in srgb,var(--gun-color),transparent 40%)}.bench-controls{display:flex;align-items:center;justify-content:center;gap:6px;padding:8px}.armory .bench-controls button{min-width:52px;min-height:44px;padding:8px;text-align:center;border-color:#c5f44840}.mobile-play .bench-rack{height:170px}.mobile-play .bench-turntable{height:140px;bottom:20px}
@media(orientation:landscape)and(max-height:600px){.mobile-play .bench-rack{height:150px}.mobile-play .bench-turntable{height:130px}}
@media(prefers-reduced-motion:reduce){.bench-turntable,.bench-gun{transition:none;filter:none}.socket-lights .lit{box-shadow:none}}
