body::after{content:"";position:fixed;inset:3px;z-index:25;pointer-events:none;border:2px solid #285868;border-radius:9px;box-shadow:inset 0 0 0 1px #78ded6,0 0 0 3px #101627;background:linear-gradient(90deg,#ff5581,#ffc4a0) left top/18% 3px no-repeat,linear-gradient(90deg,#76edcd,#3c8291) right bottom/22% 3px no-repeat}
button,#actions button{color:#ecfbf6;background:linear-gradient(155deg,#293349,#15202d 70%);border:1px solid #487c85;border-radius:9px;box-shadow:inset 0 1px #92dbd844,0 2px 0 #07131c;letter-spacing:.012em;-webkit-tap-highlight-color:transparent;touch-action:manipulation}
section button{padding:9px 16px;text-align:left;border-left:3px solid #6dc7bf}
section button:first-of-type{color:#0d2630;border-color:#a0f8de;background:linear-gradient(100deg,#7bdcca,#acedd6);text-shadow:none}
button:focus-visible{outline:2px solid #ffd3a0;outline-offset:2px}
button:active,button.held,#actions button:active{background:#6a354f;border-color:#ffa9bc;box-shadow:inset 0 2px 5px #1a111e;transform:translateY(1px)}
#steer,#pedals{display:none}#hud.driving #pad,#hud.driving #aim{display:none}
@media(pointer:coarse),(any-pointer:coarse){
#hud.driving #steer,#hud.driving #pedals{display:flex;position:absolute;bottom:max(21px,env(safe-area-inset-bottom));gap:8px}
#steer{left:max(20px,env(safe-area-inset-left))}#pedals{right:max(20px,env(safe-area-inset-right))}
#hud.driving #actions{bottom:max(91px,calc(env(safe-area-inset-bottom) + 74px));grid-template-columns:auto auto}
#hud.driving #actions [data-act=run],#hud.driving #actions [data-act=swap],#hud.driving #actions [data-act=interact]{display:none}
[data-drive]{width:clamp(46px,8vw,67px);height:clamp(48px,10vh,64px);text-align:center;font:700 26px/1 system-ui;touch-action:none;user-select:none;padding:0}
[data-drive=up]{border-color:#70d4b5}[data-drive=down]{border-color:#ea8b9e}}
@media(max-height:500px){section button{padding:5px 14px}}

#radar{left:max(12px,env(safe-area-inset-left));right:auto;bottom:max(12px,env(safe-area-inset-bottom));top:auto}
#vitals{position:absolute;left:max(12px,env(safe-area-inset-left));bottom:calc(max(12px,env(safe-area-inset-bottom)) + 100px);width:114px;display:grid;gap:2px}
#wanted{color:#ffe176;text-shadow:1px 1px 2px #000;font:bold 18px monospace}#life{width:100%;height:11px;border:2px solid white;background:#48151d;appearance:none}#life::-webkit-progress-bar{background:#48151d}#life::-webkit-progress-value{background:#f33024}#life::-moz-progress-bar{background:#f33024}
@media(pointer:coarse),(any-pointer:coarse){#radar{width:72px;height:62px;bottom:110px}#vitals{width:76px;bottom:176px}#wanted{font-size:14px}}
#cinema:not([hidden]){position:absolute;z-index:20;bottom:0;left:0;right:0;background:#090d17ee;color:white;text-align:center;padding:12px 5vw max(14px,env(safe-area-inset-bottom));border-top:2px solid #bb8866}#cinema p{margin:.5em auto;max-width:48em}#cinema button{margin:3px;padding:6px 12px}
#deck{display:contents}
@media(pointer:coarse),(any-pointer:coarse){
 body:has(#hud:not([hidden])){--deck:calc(152px + env(safe-area-inset-bottom,0px))}
 body:has(#hud:not([hidden])) #world{height:calc(100dvh - var(--deck));bottom:auto}
 #deck{display:grid;position:absolute;bottom:0;left:0;right:0;height:var(--deck);grid-template-columns:minmax(52px,1fr) minmax(122px,1.6fr) minmax(52px,1fr);align-items:center;justify-items:center;gap:4px;padding:6px max(10px,env(safe-area-inset-right)) max(7px,env(safe-area-inset-bottom)) max(10px,env(safe-area-inset-left));background:#111c29;border-top:2px solid #558c91}
 #deck>#pad,#deck>#aim,#deck>#actions,#hud.driving #deck>#steer,#hud.driving #deck>#pedals{position:static;grid-row:1}
 #deck>#pad,#deck>#aim{display:flex;width:min(18vw,78px);height:min(18vw,78px);touch-action:none}
 #deck>#pad,#deck>#steer{grid-column:1}#deck>#aim,#deck>#pedals{grid-column:3}
 #deck>#actions{display:grid;grid-column:2;grid-template-columns:repeat(2,1fr);gap:4px;width:100%;max-width:296px}
 #deck>#actions button{padding:3px;min-height:41px;font-size:13px}
 #hud.driving #deck>#aim,#hud.driving #deck>#pad{display:none}
 #hud.driving #deck>#steer,#hud.driving #deck>#pedals{display:flex;gap:2px}
 #deck [data-drive]{width:clamp(32px,8vw,56px);height:48px;padding:0}
 #radar{bottom:calc(var(--deck) + 8px)}#vitals{bottom:calc(var(--deck) + 73px)}
 body:has(#hud:not([hidden])) #hint{display:none}
}
@media(orientation:landscape) and (pointer:coarse),(orientation:landscape) and (any-pointer:coarse){
 body:has(#hud:not([hidden])){--deck:calc(84px + env(safe-area-inset-bottom,0px))}
 #deck>#actions{grid-template-columns:repeat(5,1fr);max-width:none}#deck>#actions button{font-size:12px}
 #deck>#pad,#deck>#aim{width:62px;height:62px}
}

#world,#hud,#hud *,#cinema,#menu button{-webkit-touch-callout:none;-webkit-user-select:none;user-select:none}#deck,#deck button{touch-action:none}
#hud:not(.driving) [data-act=radio],#hud.driving [data-act=kit]{display:none}
@media(orientation:landscape) and (any-pointer:coarse){#deck>#actions{grid-template-columns:repeat(3,1fr)}#deck>#actions button{min-height:30px}}

#hud,#deck,#deck button,#hud canvas{touch-action:none} #deck button{overscroll-behavior:contain}

#wheel:not([hidden]){display:block;position:absolute;pointer-events:auto;z-index:12;left:50%;top:46%;transform:translate(-50%,-50%);width:min(90vw,76dvh,390px);aspect-ratio:1;border-radius:50%;background:#0b1828f4;border:2px solid #78dace}
#wheel button{position:absolute;transform:translate(-50%,-50%);max-width:29%;font-size:clamp(10px,2vw,14px);line-height:1.1;padding:5px;white-space:normal}
#hud.passenger #deck>#pedals,#hud.passenger #deck>#steer{display:none}#hud.passenger #deck>#aim{display:flex}#hud.passenger [data-act=kit]{display:block}

html,body,#menu,#cinema,button{touch-action:manipulation}#hud,#deck,#world,#deck button{touch-action:none}
#deck button,#hud>div>button{border:1px solid #579b9e;border-radius:12px;background:linear-gradient(165deg,#264550,#152532 70%);box-shadow:inset 0 1px #8fd9d933,0 2px 3px #06132388;color:#edfffa;font-weight:650}
#deck button.held,#deck button:active{background:#65cebb;color:#10282b}#deck [data-act=gun]{border-color:#f58b98;background:linear-gradient(160deg,#773747,#402934)}#deck [data-drive]{font-size:23px}
@media(any-pointer:coarse){#hud [data-act=car],#hud [data-act=kit]{display:none}#deck>#actions{grid-template-columns:repeat(2,1fr)}#deck>#actions button{min-height:38px}#deck [data-act=interact]{border-color:#77d8c2}}

#menu .logo{width:min(76vw,430px);height:auto;max-height:33dvh;object-fit:contain;object-position:left center}
#deck button{border-radius:14px;font-weight:700;letter-spacing:.015em;background:linear-gradient(170deg,#34485e,#192c3e);box-shadow:inset 0 1px #c5f7ff40,0 3px #0b1725}
#deck [data-act=gun]{background:linear-gradient(155deg,#a93c64,#512444);color:white;border-color:#ff9db5}
#deck [data-act=interact]{background:linear-gradient(155deg,#276958,#133b3e);border-color:#76e4c1}
@media(any-pointer:coarse){
 #deck{grid-template-columns:minmax(66px,.85fr) minmax(130px,1.9fr) minmax(66px,.85fr);column-gap:6px}
 #deck>#actions{grid-template-areas:"run fire" "swap use";gap:5px}
 #deck [data-act=run]{grid-area:run}#deck [data-act=gun]{grid-area:fire}#deck [data-act=swap]{grid-area:swap}#deck [data-act=interact]{grid-area:use}
 #hud.driving #deck>#actions{grid-template-areas:"radio fire" "swap use"}#hud.driving [data-act=run]{display:none}#deck [data-act=radio]{grid-area:radio}
 #deck [data-drive]{border-radius:50%;min-height:43px}
}
@media(any-pointer:coarse) and (orientation:landscape){#deck>#actions{width:min(100%,390px)}#deck>#actions button{min-height:32px}}

#hud #leaveCraft:not([hidden]),#hud #findDock:not([hidden]){display:inline-flex;align-items:center;min-height:36px;padding:5px 9px;font-size:13px;color:#f6fffc;border:1px solid #72decc;background:#16413f}
#cinema:not([hidden]){position:fixed;inset:auto max(10px,env(safe-area-inset-right)) max(12px,env(safe-area-inset-bottom)) max(10px,env(safe-area-inset-left));margin-inline:auto;box-sizing:border-box;width:auto;max-width:640px;max-height:70dvh;display:grid;grid-template-columns:1fr auto;grid-template-rows:auto minmax(0,1fr) auto;gap:6px 10px;padding:12px 14px;border:2px solid #6be1cd;border-top-color:#ff95af;border-radius:12px;background:linear-gradient(135deg,#162536,#0b1220);box-shadow:0 3px 14px #080b15cc;text-align:left;overflow:auto}
#cinema strong,#cinema p{grid-column:1/-1;margin:0;width:100%;max-width:none}
#sceneTitle{color:#95efe0;font-size:14px}
#cinema #subtitle{overflow:auto;touch-action:pan-y;line-height:1.42;font-size:clamp(16px,2.4vw,20px);color:white;white-space:pre-wrap;overflow-wrap:anywhere}
#cinema button{width:auto;min-height:36px;margin:0;font-size:14px;text-align:center}
body:has(#cinema:not([hidden])) #hint{display:none}

@media(any-pointer:coarse),(pointer:coarse){#hud.driving #actions [data-act=interact]{display:block;grid-area:use;min-height:38px}}
