:root {
  /* safe areas (notches, rounded corners, home indicator) — every fixed element keeps clear of them */
  --sat: env(safe-area-inset-top, 0px); --sar: env(safe-area-inset-right, 0px); --sab: env(safe-area-inset-bottom, 0px); --sal: env(safe-area-inset-left, 0px);
  --bg: rgba(14, 20, 30, 0.78);
  --bg2: rgba(30, 42, 60, 0.85);
  --fg: #e9eef5;
  --muted: #9fb0c4;
  --accent: #f2b705;
  --accent2: #2a9df4;
  --radius: 12px;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; height: 100dvh; overflow: hidden; background: #0b1220; color: var(--fg); overscroll-behavior: none; -webkit-tap-highlight-color: transparent;
  font-family: "Segoe UI", Tahoma, "Noto Kufi Arabic", "Geeza Pro", Arial, sans-serif; }
#app { position: fixed; inset: 0; }
#app canvas { display: block; touch-action: none; }

/* labels */
#labels { position: fixed; inset: 0; pointer-events: none; overflow: hidden; }
.label { position: absolute; left: 0; top: 0; white-space: nowrap; transform-origin: 50% 100%;
  font-size: 12px; padding: 2px 8px; border-radius: 10px; background: rgba(10, 16, 26, 0.72); color: #fff;
  border: 1px solid rgba(255,255,255,0.15); will-change: transform; }
.label.district { font-size: 15px; font-weight: 700; background: rgba(242,183,5,0.85); color: #1b1b1b; }
.label.minor { font-size: 10px; opacity: 0.9; }
.label.mission { background: #e63946; font-weight: 700; }

/* loading */
#loading { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center;
  background: radial-gradient(circle at 50% 40%, #1b2b45, #070b14); transition: opacity .6s; }
#loading.done { opacity: 0; pointer-events: none; }
.loading-box { width: min(420px, 86vw); text-align: center; }
.loading-box h1 { margin: 0; font-size: 42px; letter-spacing: 1px; }
.loading-box .sub { color: var(--muted); margin: 4px 0 24px; }
.bar { height: 8px; background: rgba(255,255,255,0.1); border-radius: 6px; overflow: hidden; }
.bar i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--accent2), var(--accent)); transition: width .2s; }
#loadingText { color: var(--muted); font-size: 13px; }
.beta-badge { display: inline-block; margin: 6px 0 0; padding: 2px 8px; border-radius: 10px; background: #f2b705; color: #111; font-size: 11px; font-weight: 700; letter-spacing: .5px; vertical-align: middle; }
.beta-note { color: var(--muted); font-size: 12px; margin: 6px 0 0; }
.beta-note a { color: inherit; }

/* top bar */
#topbar { position: fixed; top: calc(12px + var(--sat)); right: calc(12px + var(--sar)); left: calc(12px + var(--sal)); display: flex; gap: 8px; align-items: center; z-index: 10; pointer-events: none; }
#topbar > * { pointer-events: auto; }
#topbar .brand, #topbar .stat { background: var(--bg); padding: 8px 14px; border-radius: var(--radius); backdrop-filter: blur(6px); }
#topbar .stat.small { font-size: 12px; color: var(--muted); }
#topbar #clock { font-variant-numeric: tabular-nums; font-weight: 700; }
.icon-btn { background: var(--bg); color: var(--fg); border: 0; border-radius: var(--radius); padding: 8px 12px; font-size: 16px; cursor: pointer; }
#panelBtn { margin-inline-start: auto; }

/* panel */
#panel { position: fixed; top: calc(64px + var(--sat)); left: calc(12px + var(--sal)); width: 300px; max-height: calc(100vh - 150px); max-height: calc(100dvh - 110px - var(--sat) - var(--sab)); overflow-y: auto;
  background: var(--bg); border-radius: var(--radius); padding: 6px 14px 12px; z-index: 10; backdrop-filter: blur(8px);
  transition: transform .25s, opacity .25s; }
#panel.hidden { transform: translateX(-120%); opacity: 0; pointer-events: none; }
#panel section { border-bottom: 1px solid rgba(255,255,255,0.08); padding: 8px 0; }
#panel section:last-child { border-bottom: 0; }
#panel h3 { margin: 4px 0 8px; font-size: 14px; }
#panel label { display: block; font-size: 12px; color: var(--muted); margin: 6px 0 2px; }
#panel label.check { color: var(--fg); display: flex; gap: 6px; align-items: center; cursor: pointer; }
#panel input[type=range] { width: 100%; accent-color: var(--accent); }
#panel select { width: 100%; background: var(--bg2); color: var(--fg); border: 1px solid rgba(255,255,255,0.12); border-radius: 8px; padding: 5px; }
.grid-btns { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.grid-btns button, .wide { background: var(--bg2); color: var(--fg); border: 1px solid rgba(255,255,255,0.1); border-radius: 8px; padding: 7px; cursor: pointer; font: inherit; font-size: 12px; }
.grid-btns button.active { background: var(--accent); color: #1b1b1b; font-weight: 700; }
.wide { width: 100%; }
.wide.on { background: var(--accent2); }
.note { font-size: 11px; color: var(--muted); margin: 8px 0 0; }

/* places */
#places { position: fixed; bottom: 12px; left: 50%; transform: translateX(-50%); display: flex; gap: 6px; flex-wrap: wrap; justify-content: center;
  max-width: calc(100vw - 260px); z-index: 10; }
#places button { background: var(--bg); color: var(--fg); border: 1px solid rgba(255,255,255,0.1); border-radius: 20px; padding: 6px 12px; cursor: pointer; font: inherit; font-size: 12px; backdrop-filter: blur(6px); }
#places button:hover { background: var(--accent); color: #111; }

#driveBtn { position: fixed; bottom: 12px; right: 12px; z-index: 10; background: var(--accent); color: #111; border: 0; border-radius: var(--radius); padding: 10px 16px; font: inherit; font-weight: 700; cursor: pointer; }
#driveBtn.on { background: #e63946; color: #fff; }

/* truck hud */
#truckHud { position: fixed; bottom: calc(64px + var(--sab)); right: calc(196px + var(--sar)); width: 300px; background: var(--bg); border-radius: var(--radius); padding: 10px 14px; z-index: 10; backdrop-filter: blur(6px); }
#truckHud .row { display: flex; gap: 8px; align-items: baseline; margin: 3px 0; }
#truckHud .row span { color: var(--muted); width: 70px; font-size: 12px; }
#truckHud .row b { font-size: 18px; font-variant-numeric: tabular-nums; }
#truckHud .mission { margin-top: 8px; padding: 8px; border-radius: 8px; background: rgba(242,183,5,0.15); border: 1px solid rgba(242,183,5,0.4); font-size: 13px; }
#truckHud .hint { margin-top: 6px; color: var(--accent); font-size: 13px; min-height: 18px; }

/* help */
#help { position: fixed; inset: 0; z-index: 40; display: grid; place-items: center; background: rgba(0,0,0,0.45); }
#help[hidden], #truckHud[hidden] { display: none; }
.help-box { background: var(--bg2); padding: 18px 22px; border-radius: var(--radius); width: min(520px, 92vw); }
.help-box h2 { margin-top: 0; }
.help-box li { margin: 6px 0; font-size: 14px; }

#toast { position: fixed; bottom: calc(150px + var(--sab)); left: 50%; max-width: calc(100vw - 32px); text-align: center; transform: translateX(-50%); background: var(--bg2); padding: 10px 18px; border-radius: 20px;
  opacity: 0; transition: opacity .3s; pointer-events: none; z-index: 30; font-size: 14px; }
#toast.show { opacity: 1; }

@media (max-width: 700px) {
  #panel { width: calc(100vw - 24px); }
  #places { max-width: calc(100vw - 24px); bottom: 64px; }
  #topbar .stat.small { display: none; }
}

/* intersection control */
#isecPanel { position: fixed; top: 64px; right: 12px; width: 280px; background: var(--bg); border-radius: var(--radius); padding: 10px 14px; z-index: 12; backdrop-filter: blur(8px); }
#isecPanel[hidden] { display: none; }
#isecPanel h4 { margin: 2px 0 4px; }
#isecPanel .grid-btns button.active { background: var(--accent); color: #1b1b1b; font-weight: 700; }
/* speed-limit sign */
#truckHud .limit { width: 30px !important; height: 30px; border-radius: 50%; border: 3px solid #d62828; background: #fff; color: #111 !important; font-weight: 800; font-size: 12px !important;
  display: inline-grid !important; place-items: center; margin-inline-start: auto; }
#truckHud .limit.over { animation: blink .5s steps(2) infinite; }
@keyframes blink { 50% { background: #ffd166; } }
#trafficStats { color: var(--fg); }
html[dir=rtl] #isecPanel { right: auto; left: 324px; }

/* character HUD */
#playHud { position: fixed; bottom: calc(12px + var(--sab)); left: calc(12px + var(--sal)); max-width: min(430px, calc(100vw - 24px)); background: var(--bg); border-radius: var(--radius); padding: 10px 14px; z-index: 11; backdrop-filter: blur(6px); }
#playHud[hidden] { display: none; }
#pMode { font-weight: 700; font-size: 15px; }
#pInfo { color: var(--muted); font-size: 13px; margin-top: 2px; font-variant-numeric: tabular-nums; }
#pHint { color: var(--accent); font-size: 14px; margin-top: 6px; min-height: 18px; font-weight: 600; }

/* ---------- keyboard, TV remote and controller focus ---------- */
button:focus-visible, select:focus-visible, input:focus-visible, textarea:focus-visible, a:focus-visible, [tabindex]:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }

/* ---------- server notifications & announcements (distinct from player chat) ---------- */
.notify-stack { position: fixed; top: calc(64px + var(--sat)); left: 50%; transform: translateX(-50%); width: min(560px, calc(100vw - 400px)); min-width: min(320px, calc(100vw - 24px));
  display: flex; flex-direction: column; gap: 6px; z-index: 35; pointer-events: none; }
.announce-bar { display: flex; flex-direction: column; gap: 6px; }
.announce { pointer-events: auto; display: flex; gap: 8px; align-items: center; padding: 8px 10px 8px 12px; border-radius: 12px; background: rgba(28, 64, 120, .92); border: 1px solid rgba(120,180,255,.5);
  box-shadow: 0 6px 24px rgba(0,0,0,.35); font-size: 14px; backdrop-filter: blur(6px); }
.announce.urgent { background: rgba(140, 24, 32, .94); border-color: #ff8a8a; }
.announce.new { animation: annIn .45s ease-out; } .announce.urgent.new { animation: annIn .45s ease-out, urgentPulse 1s ease-in-out 3; }
.announce .a-label { font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; opacity: .85; white-space: nowrap; }
.announce .a-text { flex: 1; overflow-wrap: anywhere; font-weight: 600; }
.announce .a-close { background: none; border: 0; color: #fff; opacity: .7; cursor: pointer; font-size: 14px; padding: 2px 6px; }
@keyframes annIn { from { opacity: 0; transform: translateY(-8px); } }
@keyframes urgentPulse { 50% { box-shadow: 0 0 0 4px rgba(255,90,90,.45), 0 6px 24px rgba(0,0,0,.35); } }
.sys-feed { display: flex; flex-direction: column; gap: 4px; align-items: center; }
.sys-item { display: flex; gap: 8px; align-items: center; padding: 6px 14px; border-radius: 999px; background: rgba(10, 16, 26, .82); border: 1px solid rgba(255,255,255,.14);
  font-size: 13px; opacity: 0; transform: translateY(-6px); transition: opacity .3s, transform .3s; max-width: 100%; }
.sys-item.show { opacity: 1; transform: none; }
.sys-item.join { border-color: rgba(110, 220, 140, .55); } .sys-item.leave { border-color: rgba(200, 200, 200, .35); color: #d6dde6; }
.sys-item.world { border-color: rgba(242, 183, 5, .55); } .sys-item.warn { border-color: #ff8f8f; } .sys-item.mod { border-color: #ffd479; }
.sys-item .sys-icon { font-size: 15px; }

/* ---------- nameplates above other players (unlike landmark labels: rounded card, colour bar, distance) ---------- */
#nameTags .nameplate { position: absolute; left: 0; top: 0; transform-origin: 0 0; pointer-events: auto; cursor: pointer; display: flex; flex-direction: column; align-items: center;
  border: 0; border-top: 3px solid var(--pc, #9fd0ff); border-radius: 8px; padding: 3px 9px 4px; background: rgba(8, 12, 20, .78); color: #fff; font: 600 13px/1.25 system-ui, -apple-system, "Segoe UI", sans-serif;
  white-space: nowrap; box-shadow: 0 2px 8px rgba(0,0,0,.35); will-change: transform; }
#nameTags .nameplate::after { content: ""; position: absolute; left: 50%; bottom: -5px; margin-left: -5px; border: 5px solid transparent; border-bottom: 0; border-top-color: rgba(8, 12, 20, .78); }
#nameTags .nameplate .np-top { display: flex; gap: 5px; align-items: baseline; }
#nameTags .nameplate .np-id { font-size: 11px; font-weight: 500; color: #b9c6d6; }
#nameTags .nameplate .np-dist { font-size: 11px; font-weight: 500; color: var(--pc, #9fd0ff); filter: brightness(1.25); }
#nameTags .nameplate.staff .np-name { color: #ffd479; }
#nameTags .nameplate.far { padding: 2px 7px 3px; font-size: 11px; opacity: .85; } #nameTags .nameplate.far .np-id { display: none; }
#nameTags .nameplate.far .np-dist { font-size: 10px; }

/* ---------- map ---------- */
#minimap { position: fixed; top: calc(64px + var(--sat)); right: calc(12px + var(--sar)); width: 168px; height: 168px; border-radius: 50%; z-index: 12; cursor: pointer;
  box-shadow: 0 4px 18px rgba(0,0,0,.45); background: #1b2a1b; }
#minimap[hidden], #mapView[hidden] { display: none; }
#minimap canvas { width: 100%; height: 100%; display: block; border-radius: 50%; }
#mapView { position: fixed; inset: 0; z-index: 45; display: grid; place-items: center; background: rgba(0,0,0,.55); padding: calc(12px + var(--sat)) calc(12px + var(--sar)) calc(12px + var(--sab)) calc(12px + var(--sal)); }
#mapView .map-box { position: relative; width: min(1200px, 100%); height: min(820px, 100%); display: flex; gap: 10px; background: rgba(14, 20, 30, .95); border-radius: 14px; padding: 10px; }
#mapView .map-canvas { flex: 1; min-width: 0; position: relative; } #mapView .map-canvas canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
#mapView .map-side { width: 280px; overflow-y: auto; padding: 4px 34px 4px 4px; font-size: 13px; }
#mapView .map-side h3 { margin: 4px 0 8px; font-size: 15px; }
#mapView .map-close { position: absolute; top: 8px; right: 8px; background: var(--bg2); color: var(--fg); border: 0; border-radius: 8px; padding: 6px 10px; cursor: pointer; font-size: 15px; }
.map-players { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.map-player { width: 100%; display: grid; grid-template-columns: 14px auto 1fr; gap: 2px 6px; align-items: center; text-align: start; background: var(--bg2); color: var(--fg); border: 1px solid transparent; border-radius: 8px; padding: 6px 8px; cursor: pointer; font: inherit; }
.map-player.active { border-color: #fff; }
.map-player i { width: 12px; height: 12px; border-radius: 50%; border: 2px solid #fff; } .map-player small { color: var(--muted); }
.map-player .map-eta { grid-column: 2 / 4; color: var(--muted); font-size: 12px; }
.map-legend { color: var(--muted); font-size: 12px; margin-top: 12px; }
.muted { color: var(--muted); }

/* ---------- touch controls ---------- */
#touch { position: fixed; inset: 0; z-index: 20; pointer-events: none; --u: 1; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; }
#touch[hidden], #touch [hidden] { display: none !important; }
#touch { transition: opacity .2s, visibility 0s; }
#touch.doze { opacity: 0; visibility: hidden; transition: opacity .6s, visibility 0s .6s; } /* idle: faded out until the screen is touched again */
#touch .t-zone, #touch .t-steer, #touch .t-btn { pointer-events: auto; touch-action: none; }
#touch .t-left { position: absolute; left: 0; bottom: 0; width: 45%; height: 62%; }
#touch .t-look { position: absolute; right: 0; top: 18%; width: 55%; height: 82%; }
#touch .t-stick { position: absolute; left: calc(96px * var(--u) + var(--sal)); top: calc(100% - 100px * var(--u) - var(--sab)); width: calc(124px * var(--u)); height: calc(124px * var(--u));
  margin: calc(-62px * var(--u)) 0 0 calc(-62px * var(--u)); border-radius: 50%; background: rgba(255,255,255,.07); border: 2px solid rgba(255,255,255,.28); opacity: .7; transition: opacity .2s; }
#touch .t-stick.on { opacity: 1; }
#touch .t-stick i { position: absolute; left: 50%; top: 50%; width: calc(54px * var(--u)); height: calc(54px * var(--u)); margin: calc(-27px * var(--u)); border-radius: 50%; background: rgba(255,255,255,.55); box-shadow: 0 2px 10px rgba(0,0,0,.35); }
#touch .t-steer { position: absolute; left: calc(16px + var(--sal)); bottom: calc(18px + var(--sab)); width: min(44vw, calc(320px * var(--u))); height: calc(92px * var(--u)); border-radius: 46px;
  background: rgba(10,16,26,.45); border: 2px solid rgba(255,255,255,.28); display: flex; align-items: center; justify-content: space-between; padding: 0 22px; color: rgba(255,255,255,.75); font-size: 22px; }
#touch .t-steer i { position: absolute; left: 50%; top: 10%; width: calc(64px * var(--u)); height: 80%; margin-left: calc(-32px * var(--u)); border-radius: 40px; background: rgba(255,255,255,.5); }
#touch .t-steer.on { border-color: var(--accent); }
#touch .t-btn { position: absolute; display: grid; place-items: center; width: calc(64px * var(--u)); height: calc(64px * var(--u)); border-radius: 50%; padding: 0 8px;
  background: rgba(10,16,26,.55); color: #fff; border: 2px solid rgba(255,255,255,.35); font: 700 calc(13px * var(--u))/1.1 system-ui, sans-serif; text-align: center; backdrop-filter: blur(4px); }
#touch .t-btn.on { background: rgba(242,183,5,.85); color: #111; border-color: #fff; }
#touch .t-btn.big { width: calc(86px * var(--u)); height: calc(86px * var(--u)); font-size: calc(22px * var(--u)); }
#touch .t-btn.wide { width: auto; min-width: calc(86px * var(--u)); height: calc(48px * var(--u)); border-radius: 24px; padding: 0 14px; background: rgba(42,157,244,.75); }
/* positions from the bottom-right corner */
#touch [data-act] { right: calc(var(--r) * var(--u) + var(--sar)); bottom: calc(var(--b) * var(--u) + var(--sab)); }
#touch [data-act=jump] { --r: 18px; --b: 22px; }
#touch [data-act=run] { --r: 118px; --b: 30px; }
#touch [data-act=dive] { --r: 118px; --b: 30px; }
#touch [data-act=use] { --r: 18px; --b: 122px; }
#touch [data-act=cam] { --r: 18px; --b: 184px; width: calc(48px * var(--u)); height: calc(48px * var(--u)); font-size: calc(18px * var(--u)); }
#touch [data-act=horn] { --r: 76px; --b: 184px; width: calc(48px * var(--u)); height: calc(48px * var(--u)); font-size: calc(18px * var(--u)); }
#touch [data-act=gas] { --r: 18px; --b: 22px; height: calc(112px * var(--u)); border-radius: 20px; background: rgba(40,140,70,.6); }
#touch [data-act=brake] { --r: 116px; --b: 22px; border-radius: 20px; background: rgba(160,40,40,.6); }
#touch [data-act=hb] { --r: 212px; --b: 22px; border-radius: 16px; width: calc(76px * var(--u)); height: calc(48px * var(--u)); font-size: calc(11px * var(--u)); }
#touch[data-mode=car] [data-act=use], #touch[data-mode=truck] [data-act=use] { --b: 146px; }
#touch[data-mode=car] [data-act=cam], #touch[data-mode=truck] [data-act=cam], #touch[data-mode=car] [data-act=horn], #touch[data-mode=truck] [data-act=horn] { --b: 206px; }
#touch [data-act=load] { --r: 18px; --b: 262px; } #touch [data-act=trailer] { --r: 90px; --b: 262px; } #touch [data-act=repair] { --r: 162px; --b: 262px; }
#touch [data-act=load], #touch [data-act=trailer], #touch [data-act=repair] { width: calc(64px * var(--u)); height: calc(44px * var(--u)); border-radius: 14px; font-size: calc(12px * var(--u)); }
#touch .t-rotate { position: absolute; top: 40%; left: 50%; transform: translateX(-50%); background: rgba(10,16,26,.88); padding: 12px 18px; border-radius: 14px; font-weight: 700; text-align: center; max-width: 80vw; }
/* portrait: the steering strip takes the bottom-left, so the handbrake moves up next to the brake */
@media (orientation: portrait) { #touch [data-act=hb] { --r: 116px; --b: 122px; } #touch [data-act=run], #touch [data-act=dive] { --r: 112px; } }
@media (max-height: 430px) { #touch { --u: .8; } }
@media (min-width: 900px) and (min-height: 600px) { #touch { --u: 1.12; } }

/* ---------- small screens & touch play ---------- */
/* phones/tablets: row 1 = top bar; row 2 = what you're doing (left) and the minimap (right); notifications in between */
body.touch #pHint { display: none; }
body.touch #playHud { bottom: auto; top: calc(58px + var(--sat)); padding: 6px 10px; max-width: 44vw; font-size: 12px; }
body.touch #pMode { font-size: 13px; } body.touch #pInfo { font-size: 12px; }
body.touch #truckHud { bottom: auto; right: auto; top: calc(58px + var(--sat)); left: calc(12px + var(--sal)); width: 230px; transform: scale(.8); transform-origin: top left; }
body.touch:has(#truckHud:not([hidden])) #playHud { display: none; }
body.touch #toast { bottom: auto; top: 38%; }
body.touch .announce .a-label { display: none; }
body.touch .announce, body.touch .sys-item { font-size: 13px; }
@media (max-width: 700px), (max-height: 500px) {
  #topbar .brand { display: none; }
  #minimap { width: 112px; height: 112px; top: calc(58px + var(--sat)); }
  #truckHud { right: calc(12px + var(--sar)); }
  .announce .a-label { display: none; }
  .notify-stack { width: auto; min-width: 0; transform: none; left: calc(12px + var(--sal)); right: calc(136px + var(--sar)); top: calc(58px + var(--sat)); }
  body.touch .notify-stack { top: calc(112px + var(--sat)); }
}
/* phone held sideways: notifications between the mode panel and the HUD buttons + minimap */
@media (max-height: 500px) and (orientation: landscape) {
  .notify-stack, body.touch .notify-stack { top: calc(58px + var(--sat)); left: calc(190px + var(--sal)); right: calc(300px + var(--sar)); }
  #mapView .map-side { width: 220px; }
  .help-box { max-height: calc(100dvh - 24px); overflow-y: auto; }
}
@media (max-width: 700px) and (orientation: portrait) {
  #mapView .map-box { flex-direction: column; } #mapView .map-side { width: auto; max-height: 38%; padding-right: 4px; } #mapView .map-canvas { min-height: 55%; }
}
/* big screens far away (TVs): larger interface */
@media (min-width: 1800px) and (min-height: 950px) {
  #topbar, #playHud, #truckHud, #panel, #socialHud, .notify-stack, #nameTags .nameplate, .help-box, #minimap { zoom: 1.3; }
}
.help-box { max-height: calc(100dvh - 40px); overflow-y: auto; }

/* ---------- public health measures (systems/Health.js) ---------- */
.health-hud { position: fixed; top: calc(352px + var(--sat)); right: calc(12px + var(--sar)); width: min(250px, 44vw); background: var(--bg); border-radius: var(--radius); padding: 8px 10px; z-index: 11;
  backdrop-filter: blur(6px); font-size: 12px; border-inline-start: 3px solid #4fb3d9; }
.health-hud[hidden] { display: none; }
.health-hud.alert { border-inline-start-color: #f2b705; }
.health-hud .h-title { font-weight: 700; font-size: 13px; margin-bottom: 4px; font-variant-numeric: tabular-nums; }
.health-hud .h-rules { display: flex; flex-wrap: wrap; gap: 4px; }
.health-hud .h-rule { background: rgba(79, 179, 217, 0.18); border-radius: 8px; padding: 1px 7px; }
.health-hud .h-msg { margin-top: 6px; color: var(--fg); }
.health-hud .h-msg[hidden], .health-hud .h-warn[hidden], .health-hud .h-mask[hidden] { display: none; }
.health-hud .h-warn { margin-top: 6px; color: #ffd479; font-weight: 600; }
.health-hud .h-mask { margin-top: 6px; width: 100%; font: inherit; cursor: pointer; border: 0; border-radius: 8px; padding: 4px 8px; background: rgba(255, 255, 255, 0.12); color: var(--fg); }
/* phones: under the minimap and the People / Map buttons on the right, compact */
@media (max-width: 700px) { .health-hud { right: calc(12px + var(--sar)); top: calc(310px + var(--sat)); width: 46vw; font-size: 11px; padding: 6px 8px; } }
body.touch .health-hud { right: calc(12px + var(--sar)); top: calc(310px + var(--sat)); width: min(240px, 44vw); font-size: 11px; padding: 6px 8px; }
body.touch .health-hud .h-msg { display: none; }
@media (max-height: 500px) and (orientation: landscape) { body.touch .health-hud { top: calc(180px + var(--sat)); } }
