/* HUD FRAME (p72): a top bar + a bottom bar, nothing on the sides. js/ui/hud_frame.js packs every widget into fixed px boxes
   (inline left/top/width/height) and folds what does not fit into the ⋯ popover, so this file only styles. Cheap on phones:
   no backdrop-filter, no CSS filter, no infinite animations on the walking HUD, no layout-dependent rules. */
:root{--hud-accent:#4fd8ff;--hud-opacity:.92;--hud-top-h:72px;--hud-bottom-h:120px;--hud-s:1;--hud-btn:44px;--hud-slot:48px}
body.hud-frame-on #hud-top,body.hud-frame-on #hud-bottom{position:fixed;left:0;right:0;z-index:9;pointer-events:none;contain:strict}
body.hud-frame-on #hud-top{top:0;height:var(--hud-top-h);background:linear-gradient(180deg,rgba(9,7,28,.58),rgba(9,7,28,.18) 78%,rgba(9,7,28,0))}
body.hud-frame-on #hud-bottom{bottom:0;height:var(--hud-bottom-h);background:linear-gradient(0deg,rgba(9,7,28,.58),rgba(9,7,28,.16) 78%,rgba(9,7,28,0))}
body.hud-frame-on.hud-drive:not(.hud-touch) #hud-bottom{display:none}
body.hud-frame-on #hud-layer{position:fixed;inset:0;z-index:26;pointer-events:none}
body.hud-frame-on #hud-layer>*{pointer-events:auto}
body.hud-frame-on #hud-layer>#netbadge,body.hud-frame-on #hud-layer>#hud-combo{pointer-events:none}

/* every packed widget: fixed box from the packer, no transforms / margins / max-sizes left over from the old corner layouts */
body.hud-frame-on .hud-placed{position:fixed!important;right:auto!important;bottom:auto!important;margin:0!important;transform:none!important;
  box-sizing:border-box!important;max-width:none!important;max-height:none!important;min-width:0!important;min-height:0!important;z-index:26;
  -webkit-backdrop-filter:none!important;backdrop-filter:none!important;filter:none!important;opacity:var(--hud-opacity)}
body.hud-frame-on .hud-unplaced{display:none!important}
/* the old corner speedometer box, digital steer pads, eat button and clock caption are gone in the frame */
body.hud-frame-on #speedBox,body.hud-frame-on #bL,body.hud-frame-on #bR,body.hud-frame-on #eatBtn,body.hud-frame-on #tod,body.hud-frame-on #devTag,body.hud-frame-on #carArrow{display:none!important}
body.hud-frame-on #topbtns{display:contents!important}
body.hud-frame-on #rotate{display:none!important}

/* top bar buttons */
body.hud-frame-on .tb.hud-placed,body.hud-frame-on #hud-more.hud-placed{display:flex!important;align-items:center;justify-content:center;padding:0 6px!important;overflow:hidden;
  font:800 calc(10px * var(--hud-s)) system-ui,sans-serif!important;letter-spacing:.1em!important;white-space:nowrap;border-color:var(--hud-accent)!important}
body.hud-frame-on #modeBtn.hud-placed{flex-direction:column!important;gap:1px}
body.hud-frame-on #modeBtn i{font:800 calc(7px * var(--hud-s))/1.1 system-ui,sans-serif!important;letter-spacing:.05em!important}
body.hud-frame-on #hud-more{color:#ffcf5a;font-size:calc(20px * var(--hud-s))!important;letter-spacing:0!important;background:rgba(9,7,28,.72);border:2px solid var(--hud-accent);border-radius:10px;cursor:pointer}
body.hud-frame-on #hud #minimap.hud-placed{border-radius:50%;border:3px solid #120f1e!important;box-shadow:0 0 0 2px var(--hud-accent)!important;opacity:1}
/* ⋯ popover: folded buttons as a small vertical card under the ⋯ button */
.hud-more-pop{position:fixed;z-index:40;display:flex;flex-direction:column;gap:6px;padding:8px;min-width:150px;background:rgba(9,7,28,.94);border:2px solid var(--hud-accent,#4fd8ff);border-radius:12px;pointer-events:auto}
.hud-more-pop[hidden]{display:none!important}
.hud-more-pop>.hud-folded{position:static!important;display:flex!important;align-items:center;justify-content:center;gap:6px;width:auto!important;height:44px!important;min-height:44px;margin:0!important;transform:none!important;font:800 11px system-ui,sans-serif;letter-spacing:.1em}
.hud-more-pop>#lpEmote.hud-folded{display:flex!important}

/* slim speed / gear / NOS readout (driving), sits right after ☰ */
.hud-speed{display:none}
body.hud-frame-on #hud-speed.hud-placed{display:grid;grid-template-columns:auto auto 1fr;grid-template-rows:1fr auto auto;align-items:end;column-gap:5px;row-gap:2px;padding:3px 8px 4px;cursor:pointer;
  background:rgba(9,7,28,.78);border:2px solid var(--hud-accent);border-radius:10px;color:#fff;font:800 11px system-ui,sans-serif}
#hud-speed .hs-v{grid-row:1;grid-column:1;font:italic 900 calc(20px * var(--hud-s))/1 "AI Orbitron",system-ui,sans-serif;letter-spacing:.02em;font-variant-numeric:tabular-nums;color:#fff}
#hud-speed small{grid-row:1;grid-column:2;font:800 calc(8px * var(--hud-s))/1 system-ui;color:var(--hud-accent);letter-spacing:.12em;align-self:end;padding-bottom:2px}
#hud-speed .hs-g{grid-row:1;grid-column:3;justify-self:end;font:italic 900 calc(18px * var(--hud-s))/1 "AI Orbitron",system-ui;color:#ffcf5a}
#hud-speed.rev .hs-g{color:#ff2f5e}
#hud-speed.manual .hs-g::after{content:'M';font-size:.5em;vertical-align:top;margin-left:1px;color:var(--hud-accent)}
#hud-speed .hs-r,#hud-speed .hs-n{grid-column:1 / 4;display:block;height:3px;background:rgba(79,216,255,.16);overflow:hidden;border-radius:2px}
#hud-speed .hs-n{height:4px;background:rgba(255,79,184,.18)}
#hud-speed .hs-r em,#hud-speed .hs-n em{display:block;height:100%;width:100%;transform-origin:0 50%;transform:scaleX(0)}
#hud-speed .hs-r em{background:var(--hud-accent)}#hud-speed.red .hs-r em{background:#ff4fb8}
#hud-speed .hs-n em{background:linear-gradient(90deg,#ff4fb8,#ffcf5a)}
#hud-speed.burn{border-color:#ff4fb8}#hud-speed.flash{border-color:#ffcf5a}

/* walking stats: compact card in the top-right (mode 0 full, 1 slim, 2 avatar only) */
body.hud-frame-on #ofIdentity.hud-placed{display:flex!important;gap:6px!important;padding:3px 8px 3px 3px!important;align-items:center;cursor:pointer;font-size:10px}
body.hud-frame-on #ofIdentity.hud-placed::before{background:var(--hud-accent)}
body.hud-frame-on #ofIdentity .of-avatar-frame{width:calc(var(--hud-btn) - 6px)!important;height:calc(var(--hud-btn) - 6px)!important;padding:3px!important;flex:none}
body.hud-frame-on #ofIdentity .of-avatar{font-size:15px!important}
body.hud-frame-on #ofIdentity .of-info{display:flex;flex-direction:column;justify-content:center;gap:1px;min-width:0;flex:1}
body.hud-frame-on #ofIdentity .of-name{font-size:11px!important;line-height:13px!important}
body.hud-frame-on #ofIdentity .of-info label{margin:0!important;font-size:8px!important;line-height:10px!important;height:10px!important}
body.hud-frame-on #ofIdentity progress{height:5px!important}
body.hud-frame-on #ofIdentity .of-level,body.hud-frame-on #ofIdentity .of-balance,body.hud-frame-on #ofIdentity .of-xp,body.hud-frame-on #ofIdentity .of-xp-label,
body.hud-frame-on #ofIdentity .of-super,body.hud-frame-on #ofIdentity .of-super-label{display:none!important}
body.hud-frame-on #ofIdentity[data-hud-mode="1"] .of-name,body.hud-frame-on #ofIdentity[data-hud-mode="1"] .of-info label{display:none!important}
body.hud-frame-on #ofIdentity[data-hud-mode="2"] .of-info{display:none!important}
body.hud-frame-on #ofIdentity[data-hud-mode="2"]{padding:3px!important}

/* network / dev caption (only when the packer found a real gap) */
body.hud-frame-on #netbadge.hud-placed{display:flex!important;transform:none!important;min-width:0!important;flex-direction:column;align-items:center;justify-content:center;padding:2px 6px!important;border-radius:8px!important;
  font:800 calc(9px * var(--hud-s))/1.2 system-ui,sans-serif!important;letter-spacing:.1em!important;text-align:center;overflow:hidden;white-space:nowrap}
body.hud-frame-on.hud-dev #netbadge.hud-placed::after{content:'DEV BUILD';color:#ffcf5a;font-size:.9em}

/* bottom bar: joystick, fight / jump / dodge, pedals */
body.hud-frame-on #lpStick.hud-placed{display:block!important;border-color:var(--hud-accent)!important;box-shadow:none!important;opacity:1}
body.hud-frame-on #lpStick i{width:42%!important;height:42%!important;margin:-21% 0 0 -21%!important;box-shadow:none!important}
body.hud-frame-on #lpJump.hud-placed,body.hud-frame-on #ofAttack.hud-placed,body.hud-frame-on #lpEmote.hud-placed,body.hud-frame-on #ctxDodge.hud-placed,
body.hud-frame-on #wpnAim.hud-placed,body.hud-frame-on #wpnReload.hud-placed{display:flex!important;flex-direction:column;align-items:center;justify-content:center;opacity:1}
body.hud-frame-on #lpJump.hud-placed{font-size:calc(14px * var(--hud-s))!important;box-shadow:0 0 0 2px #fff!important}
body.hud-frame-on #ofAttack b{font-size:calc(14px * var(--hud-s))!important}
body.hud-frame-on #ctxDodge.hud-placed{border-radius:50%;border:2px solid rgba(255,207,90,.8);background:rgba(8,14,32,.86);color:#ffe9a8;font:800 calc(11px * var(--hud-s))/1 system-ui,sans-serif;letter-spacing:.08em}
body.hud-frame-on #ctxDodge[hidden]{display:none!important}
body.hud-frame-on #bGas.hud-placed,body.hud-frame-on #bBrake.hud-placed,body.hud-frame-on #bNitro.hud-placed,body.hud-frame-on #bUp.hud-placed,body.hud-frame-on #bDn.hud-placed{display:flex!important;align-items:center;justify-content:center;opacity:1}
body.hud-frame-on #bGas.on,body.hud-frame-on #bBrake.on,body.hud-frame-on #bNitro.on,body.hud-frame-on #lpJump.on,body.hud-frame-on #ofAttack.on{outline:3px solid var(--hud-accent);outline-offset:-3px}

/* hot bar (walking): first bag slots, numbered with their key (or pad button) */
body.hud-frame-on #hud-hotbar.hud-placed{display:flex!important;gap:calc(4px * var(--hud-s));align-items:stretch;justify-content:center;opacity:1}
#hud-hotbar .hud-slot{position:relative;flex:1 1 0;min-width:0;padding:0;border:2px solid rgba(79,216,255,.55);border-color:color-mix(in srgb,var(--hud-accent) 60%,transparent);border-radius:8px;
  background:rgba(9,7,28,.72);color:#eafcff;cursor:pointer;touch-action:manipulation;-webkit-tap-highlight-color:transparent;display:flex;align-items:center;justify-content:center}
#hud-hotbar .hud-slot svg{width:58%;height:58%}
#hud-hotbar .hud-slot.eq{border-color:#ffcf5a}
#hud-hotbar .hud-slot.hit,#hud-hotbar .hud-slot:active{background:rgba(79,216,255,.35)}
#hud-hotbar .hud-slot>i{position:absolute;right:3px;bottom:1px;font:800 10px/1 system-ui;font-style:normal;color:#fff}
#hud-hotbar .hud-slot>kbd{position:absolute;left:3px;top:2px;font:800 9px/1 system-ui;color:#ffcf5a;opacity:.9}
body.hud-touch:not(.hud-pad) #hud-hotbar .hud-slot>kbd{display:none}

/* combo 1-2-3 + stamina strip (above the attack button on touch, bottom-right on PC) */
#hud-combo{display:none}
body.hud-frame-on #hud-combo.hud-placed{display:flex!important;flex-direction:column;justify-content:flex-end;gap:2px;opacity:.35}
body.hud-frame-on #hud-combo.hud-placed.live{opacity:1}
#hud-combo .hc-pips{display:flex;gap:3px;flex:1 1 0;min-height:0}
#hud-combo .hc-pips i{flex:1;display:flex;align-items:center;justify-content:center;font:italic 900 11px/1 system-ui;color:rgba(255,255,255,.55);background:rgba(9,7,28,.7);border:1px solid rgba(79,216,255,.4);border-radius:3px}
#hud-combo .hc-pips i.on{background:var(--hud-accent);color:#120f1e;border-color:#fff}
#hud-combo.fin .hc-pips i.on{background:#ff4fb8}
#hud-combo .hc-st{display:block;height:5px;flex:none;background:rgba(125,255,154,.18);border-radius:2px;overflow:hidden}
#hud-combo .hc-st em{display:block;width:100%;height:100%;background:#7dff9a;transform-origin:0 50%;transform:scaleX(1)}
#hud-combo.low .hc-st em{background:#ff4fb8}
body.hud-touch #hud-combo .hc-pips{display:none}
body.hud-touch #hud-combo.live .hc-pips{display:flex}

/* things that are not buttons live just under the top bar / above the bottom bar instead of in a corner */
body.hud-frame-on #zonePop{top:calc(var(--hud-top-h) + 6px)!important}
body.hud-frame-on #race{top:calc(var(--hud-top-h) + 6px)!important}

/* PC: the hologram menu scales with the browser window instead of cramming (js/ui/hud_frame.js menuScale) */
body.holo-scaled .holo-frame{width:1180px!important;height:720px!important;max-width:none!important;max-height:none!important;scale:var(--holo-z,1)}
/* contextual DRIVE / EXIT holograms: centred just above the bottom bar, so they can never sit on the hot bar, pedals or fight buttons
   (selector is deliberately heavy to beat the older per-device rules in hud_v3.css / ui.css / onfoot_hud.css) */
html body.hud-frame-on.hud-frame-on.hud-frame-on #lpDrive.lpHolo,html body.hud-frame-on.hud-frame-on.hud-frame-on #lpExit.lpHolo{left:50%!important;right:auto!important;top:auto!important;
  bottom:calc(var(--hud-bottom-h) + 10px)!important;transform:translate(-50%,0) scale(.94)!important;transform-origin:50% 100%;max-width:calc(100vw - 24px);box-sizing:border-box}
html body.hud-frame-on.hud-frame-on.hud-frame-on #lpDrive.lpHolo.show,html body.hud-frame-on.hud-frame-on.hud-frame-on #lpExit.lpHolo.show{transform:translate(-50%,0) scale(1)!important}
/* Settings > HUD: one toggle per row (they wrapped into a paragraph on phones) */
#holo .hudset .chk{display:flex!important;width:100%;margin:2px 0}
#holo .hudset .chk input{margin:0}
/* the two holograms share one slot: DRIVE only on foot, EXIT only in the car (never both, even mid-transition) */
html body.hud-frame-on.hud-drive #lpDrive.lpHolo,html body.hud-frame-on.hud-walk #lpExit.lpHolo{display:none!important}

/* pad glyphs on existing HUD buttons (inside the widget, never a new box) */
body.pad-on [data-pad]::after,body.hud-pad [data-pad]::after{content:attr(data-pad);position:absolute;top:2px;right:3px;z-index:2;padding:0 3px;border-radius:4px;border:1px solid var(--hud-accent,#4fd8ff);background:rgba(9,7,28,.85);color:#ffcf5a;font:800 9px/1.2 system-ui,sans-serif;pointer-events:none;letter-spacing:0}
.hud-more-pop>#hud-controls{position:static!important;display:flex!important;width:auto!important;height:44px!important;min-height:44px;margin:0!important;letter-spacing:.12em;color:#ffcf5a}
/* p99: the gun's ammo is a tiny readout on its hot-bar slot (and inside the touch RELOAD button), never a box over the play area */
#hud-hotbar .hud-slot>i.am{left:2px;right:2px;bottom:2px;text-align:center;font:800 9px/1 system-ui;font-variant-numeric:tabular-nums;color:#adefff;white-space:nowrap;overflow:hidden}
#hud-hotbar .hud-slot.am-low>i.am{color:#ff4fb8}
#wpnHud .wammo{display:none!important}
