/* Thumb reach, not viewport pixel offsets. Last stylesheet owns touch layout. */
html{overscroll-behavior:none}#touch-controls{--touch-scale:1;--touch-opacity:.8;--button:calc(clamp(46px,10vmin,62px)*var(--touch-scale));--gap:calc(var(--button) + 12px);--edge:max(16px,env(safe-area-inset-right));--base:max(72px,calc(env(safe-area-inset-bottom) + 60px))}
#touch-controls .look-pad{left:43%;right:0;top:12%;bottom:0}
#touch-controls .move-pad{position:absolute;left:max(8px,env(safe-area-inset-left));width:40%;top:30%;bottom:max(55px,env(safe-area-inset-bottom));touch-action:none;pointer-events:auto}
#touch-controls .move-stick{pointer-events:none;width:calc(clamp(96px,23vmin,125px)*var(--touch-scale));height:calc(clamp(96px,23vmin,125px)*var(--touch-scale));left:20px;bottom:22px;opacity:var(--touch-opacity)}
#touch-controls .stick-knob{width:42%;height:42%}#touch-controls.sprinting .move-stick{border-color:#cde8a4;box-shadow:0 0 0 4px #cde8a422}
#touch-controls button{width:var(--button);height:var(--button);font-size:clamp(9px,2vmin,12px);letter-spacing:.3px;opacity:var(--touch-opacity);backdrop-filter:none;-webkit-touch-callout:none;touch-action:none;min-width:44px;min-height:44px}
#touch-controls button.held{opacity:1}
#touch-controls .touch-fire{width:calc(var(--button)*1.27)!important;height:calc(var(--button)*1.27)!important;right:var(--edge);bottom:calc(var(--base) + var(--gap));font-size:12px!important}
#touch-controls .touch-aim{right:calc(var(--edge) + var(--gap)*1.4);bottom:calc(var(--base) + var(--gap)*1.35)}
#touch-controls .touch-jump{right:var(--edge);bottom:calc(var(--base) + var(--gap)*2.55)}
#touch-controls .touch-reload{right:calc(var(--edge) + var(--gap));bottom:var(--base)}
#touch-controls .touch-crouch{right:var(--edge);bottom:var(--base)}
#touch-controls .touch-prone{left:auto;right:calc(var(--edge) + var(--gap)*2);bottom:var(--base)}
#touch-controls .touch-swap{right:calc(var(--edge) + var(--gap)*2.6);bottom:calc(var(--base) + var(--gap)*1.1)}
#touch-controls .touch-sprint{left:max(18px,env(safe-area-inset-left));right:auto;bottom:calc(var(--base) + var(--gap)*2.6)}
#touch-controls .touch-fire-left{display:none;left:max(90px,calc(env(safe-area-inset-left) + 80px));right:auto;top:max(85px,calc(env(safe-area-inset-top) + 70px));bottom:auto}
#touch-controls[data-layout=claw] .touch-fire-left{display:block}
.fullscreen-button{min-height:44px;padding:10px 14px;border:1px solid #d5d3b050;background:#192119cc;font-size:11px;letter-spacing:1px;white-space:nowrap}
.hud-actions{display:flex;gap:8px;pointer-events:auto}.hud-actions .fullscreen-button{font-size:10px}#pause-button{min-height:44px;min-width:44px}
#fullscreen-help{max-width:min(520px,90vw);max-height:85dvh;overflow:auto;color:#eae5d7;background:#172119;border:1px solid #a9bb91;padding:26px;font:16px/1.6 system-ui}#fullscreen-help::backdrop{background:#000a}#fullscreen-help-close{min-height:44px;padding:8px 24px;background:#dbb079;color:#172119}.touch-advice{font-size:12px;line-height:1.5;color:#c4ccb9}
@media(orientation:portrait){#touch-controls{--base:max(86px,calc(env(safe-area-inset-bottom) + 65px))}#touch-controls .move-pad{width:43%;top:44%;bottom:calc(var(--base) + var(--gap)*.6)}#touch-controls .touch-swap{right:calc(var(--edge) + var(--gap)*1.4);bottom:calc(var(--base) + var(--gap)*2.6)}#touch-controls .touch-sprint{bottom:calc(var(--base) + var(--gap)*3.6)}.topbar .build{display:none}.hud-actions{gap:4px}}
@media(orientation:landscape) and (max-height:480px){#touch-controls{--button:calc(46px*var(--touch-scale));--base:max(48px,calc(env(safe-area-inset-bottom) + 36px))}#touch-controls .move-pad{top:29%;bottom:40px}#touch-controls .touch-fire-left{top:max(70px,calc(env(safe-area-inset-top) + 45px))}.hud-actions .fullscreen-button{padding:5px 8px}}
@media(max-width:420px){#touch-controls{--gap:calc(var(--button) + 8px);--edge:max(10px,env(safe-area-inset-right))}.topbar{gap:8px}.topbar .brand{font-size:15px;gap:5px}.topbar .edition{font-size:11px}.topbar .fullscreen-button{padding:8px;font-size:10px}}
@media(display-mode:standalone){body{padding:0}.topbar{padding-top:env(safe-area-inset-top)}}
