/* OMC HUD. Laid out like the reference screenshots (on foot + driving).
   ALL sizes use --vh / --vw, the LOGICAL viewport units set by fit() in core.js.
   Plain vh/vw would be wrong while the page is turned 90 degrees (body.rot) on a
   phone held in portrait, so one landscape layout is used in every case:
   there are no media queries and no separate body.rot overrides. */
:root{--vh:1vh;--vw:1vw}
html,body{margin:0;height:100%;overflow:hidden;background:#0b0e13;font-family:system-ui,sans-serif;touch-action:none;user-select:none;-webkit-user-select:none}
canvas{display:block;touch-action:none}
body.rot{position:fixed;top:0;transform:rotate(90deg);transform-origin:0 0;margin:0}
.chip{background:rgba(15,20,30,.5);border:1px solid rgba(255,255,255,.18);border-radius:999px;padding:calc(var(--vh)*1.2) calc(var(--vh)*3);color:#fff;font-size:calc(var(--vh)*3.2)}

/* The lobby is a full screen of its own: no game HUD behind it. */
body.lobby-on #hud,body.lobby-on #ui,body.lobby-on #mm,body.lobby-on #spdbox,body.lobby-on #help,body.lobby-on #hint,body.lobby-on #acc,body.lobby-on #chatlog,body.lobby-on #chatin,body.lobby-on #mppanel{display:none !important}

/* ---------------- top HUD ---------------- */
#hud{position:fixed;left:0;top:0;right:0;bottom:0;z-index:15;pointer-events:none}
#hud button{font:inherit;color:#fff;cursor:pointer;pointer-events:auto;touch-action:none;-webkit-tap-highlight-color:transparent}
.sq,.abtn{position:absolute;display:flex;align-items:center;justify-content:center;padding:0;border:0;background:rgba(28,30,28,.55)}
.sq{left:calc(var(--vh)*1.5);top:calc(var(--vh)*1.5);width:calc(var(--vh)*8);height:calc(var(--vh)*8);border-radius:calc(var(--vh)*2)}
.sq svg{width:calc(var(--vh)*5);height:calc(var(--vh)*5);fill:#fff}
#roomChip{left:calc(var(--vh)*11.5);top:calc(var(--vh)*1);width:calc(var(--vh)*13);height:calc(var(--vh)*13);border-radius:50%}
#roomChip svg{width:calc(var(--vh)*7);height:calc(var(--vh)*7);fill:#fff}
#stat{position:absolute;left:calc(var(--vh)*27);top:calc(var(--vh)*3.5);display:flex;gap:calc(var(--vh)*1);white-space:nowrap;max-width:calc(var(--vw)*26);overflow:hidden;font-size:calc(var(--vh)*3)}
#mode{opacity:.8}#roomTxt{opacity:.9;overflow:hidden;text-overflow:ellipsis}
/* CHAT / mic / like / camera: centre top */
#actions{position:absolute;left:50%;top:calc(var(--vh)*1);transform:translateX(-50%);display:flex;gap:calc(var(--vh)*1.6);pointer-events:none}
#actions .abtn{position:relative;width:calc(var(--vh)*13);height:calc(var(--vh)*13);border-radius:50%;pointer-events:auto}
#topChat{font-size:calc(var(--vh)*3.1);font-weight:800;letter-spacing:.5px}
.abtn svg{width:calc(var(--vh)*6.6);height:calc(var(--vh)*6.6);fill:#fff;display:block}
.abtn.on{background:rgba(255,255,255,.35)}
.abtn.off::after{content:"";position:absolute;left:50%;top:50%;width:calc(var(--vh)*8);height:2px;background:#fff;transform:translate(-50%,-50%) rotate(-45deg);border-radius:2px}
.abtn.off{opacity:.6}
/* PUNCH: dark slanted banner at the top right with the white fist and a white stripe under it */
#topAtk{position:absolute;right:0;top:0;width:calc(var(--vh)*47);height:calc(var(--vh)*21);border:0;background:none;padding:0;overflow:visible}
#topAtk::before{content:"";position:absolute;left:0;top:0;right:0;bottom:0;background:rgba(14,14,14,.92);clip-path:polygon(0 0,100% 0,100% 100%,15% 100%)}
#topAtk svg{position:absolute;right:calc(var(--vh)*5);top:calc(var(--vh)*2.2);width:calc(var(--vh)*16);height:calc(var(--vh)*16);fill:#fff}
#topAtk.pr svg{transform:scale(.9)}
/* HEALTH = the white stripe under the fist banner (shrinks as you get hurt) */
#hpb{position:absolute;right:0;top:calc(var(--vh)*21);width:calc(var(--vh)*44);height:calc(var(--vh)*1.8);background:rgba(255,255,255,.22);clip-path:polygon(0 0,100% 0,100% 100%,9% 100%);display:flex;justify-content:flex-end}
#hpb i{display:block;height:100%;width:100%;background:#f2f2f2;transition:width .15s}
#mm{position:fixed;left:calc(var(--vh)*2);top:calc(var(--vh)*16);width:calc(var(--vh)*20);height:calc(var(--vh)*20);border-radius:50%;border:2px solid rgba(255,255,255,.55);box-shadow:0 2px 10px rgba(0,0,0,.4);z-index:14;pointer-events:none}
#spd{font-size:calc(var(--vh)*6);font-weight:700}
#spdbox{position:fixed;right:calc(var(--vh)*5);top:calc(var(--vh)*25);display:none;flex-direction:column;align-items:center;padding:calc(var(--vh)*1) calc(var(--vh)*3);border-radius:calc(var(--vh)*3);pointer-events:none;z-index:14}
#spdbox small{font-size:calc(var(--vh)*2.6);opacity:.7}
body.car #spdbox{display:flex}
#help{position:fixed;left:50%;transform:translateX(-50%);bottom:calc(var(--vh)*2);z-index:14;white-space:nowrap;font-size:calc(var(--vh)*2.8)}
body.touch #help{display:none}
#hint{position:fixed;bottom:44%;width:100%;text-align:center;color:#fff;text-shadow:0 1px 4px #000;font-size:calc(var(--vh)*4);font-weight:600;pointer-events:none;z-index:14}
#acc{position:fixed;top:28%;width:100%;text-align:center;color:#ff4a3d;font:800 calc(var(--vh)*8) system-ui,sans-serif;text-shadow:0 2px 8px #000;pointer-events:none;opacity:0;transition:opacity .4s;z-index:14}

/* ---------------- bottom controls ---------------- */
#ui{position:fixed;left:0;top:0;right:0;bottom:0;pointer-events:none;z-index:15}
#joy{position:absolute;left:calc(var(--vh)*7);bottom:calc(var(--vh)*10);width:calc(var(--vh)*32);height:calc(var(--vh)*32);border-radius:50%;background:rgba(255,255,255,.14);border:2px solid rgba(255,255,255,.32);display:none;touch-action:none;pointer-events:auto}
/* the stick rests slightly down-right of centre, like the reference HUD */
#knob{position:absolute;left:50%;top:50%;width:calc(var(--vh)*17);height:calc(var(--vh)*17);margin:calc(var(--vh)*-8.5) 0 0 calc(var(--vh)*-8.5);border-radius:50%;background:rgba(255,255,255,.4);transform:translate(var(--kx,calc(var(--vh)*7.8)),var(--ky,calc(var(--vh)*12)))}
body.touch.foot #joy{display:block}
#ui .btn{position:absolute;display:none;align-items:center;justify-content:center;border-radius:50%;background:rgba(28,30,28,.55);border:0;pointer-events:auto;touch-action:none;-webkit-tap-highlight-color:transparent}
#ui .btn svg{width:56%;height:56%;display:block}
#ui .btn.on{background:rgba(255,255,255,.32)}
body.touch.foot #ui .f,body.touch.car #ui .c{display:flex}
/* ON FOOT: SIT + big RUN on the right (double-tap RUN = jump) */
#bRun{right:calc(var(--vh)*13.5);bottom:calc(var(--vh)*4.5);width:calc(var(--vh)*27);height:calc(var(--vh)*27)}
#bRun svg{width:55%;height:55%}
#bSit{right:calc(var(--vh)*47);bottom:calc(var(--vh)*7);width:calc(var(--vh)*20);height:calc(var(--vh)*20)}
#bE{right:calc(var(--vh)*16);bottom:calc(var(--vh)*34);width:calc(var(--vh)*17);height:calc(var(--vh)*17);background:rgba(40,180,90,.8) !important}
body.touch.foot #ui #bE{display:none}
body.touch.foot #ui #bE.show{display:flex;animation:pl 1s infinite}
@keyframes pl{50%{transform:scale(1.08)}}
/* DRIVING: arrows left; horn / car, lights / brake disc, reverse pedal / gas pedal on the right */
#bSl{left:calc(var(--vh)*12);bottom:calc(var(--vh)*5);width:calc(var(--vh)*21);height:calc(var(--vh)*21)}
#bSr{left:calc(var(--vh)*36);bottom:calc(var(--vh)*5);width:calc(var(--vh)*21);height:calc(var(--vh)*21)}
#bGas{right:calc(var(--vh)*11.5);bottom:calc(var(--vh)*4.5);width:calc(var(--vh)*21);height:calc(var(--vh)*21)}
#bRev{right:calc(var(--vh)*37);bottom:calc(var(--vh)*5.5);width:calc(var(--vh)*19);height:calc(var(--vh)*19)}
#bBrk{right:calc(var(--vh)*5.8);bottom:calc(var(--vh)*27.5);width:calc(var(--vh)*15);height:calc(var(--vh)*15)}
#bLight{right:calc(var(--vh)*22.5);bottom:calc(var(--vh)*27.5);width:calc(var(--vh)*15);height:calc(var(--vh)*15)}
#bHorn{right:calc(var(--vh)*22.5);bottom:calc(var(--vh)*44.5);width:calc(var(--vh)*15);height:calc(var(--vh)*15)}
#bX{right:calc(var(--vh)*5.8);bottom:calc(var(--vh)*44.5);width:calc(var(--vh)*15);height:calc(var(--vh)*15)}
#bX.dim{opacity:.4}
/* phone icon half off the right edge: fullscreen / rotate screen */
#bRot{position:absolute;right:calc(var(--vh)*-3.5);bottom:calc(var(--vh)*0.8);width:calc(var(--vh)*10);height:calc(var(--vh)*10);border-radius:50%;background:rgba(28,30,28,.55);display:none;align-items:center;justify-content:flex-start;padding-left:calc(var(--vh)*1.6);box-sizing:border-box;pointer-events:auto;touch-action:none}
#bRot svg{width:calc(var(--vh)*4.6);height:calc(var(--vh)*4.6)}
body.touch #bRot{display:flex}
/* The old separate room chip is never shown: the room lives in #stat. */
#mpchip{display:none !important}
