/* MultiCraft — in-game HUD (round 4 pixel layer, round 5 phone layout). Two layers:
   · pixel layer: hotbar, hearts / hunger / armor / air, XP bar + level, boss bars — pixel art on ONE integer grid.
     --px (CSS px per GUI px) and --slot are published by hud.js from an integer device-pixel scale, so nothing is
     ever resampled (crisp on 1x / 2x / 3x screens). Never size these with fractional factors of --gui-scale.
   · info layer: chat, notifications, minimap, effect tiles, compass, player list — calm neutral dark glass, white text,
     one ember accent; no backdrop-filter (it re-blurs the 3D canvas every frame on phones).
   Everything is pointer-transparent except the few interactive widgets.
   Touch (round 5): hud.js measures the touch controls' top buttons per screen third and publishes on .hud
   --hud-tl-y / --hud-tc-y / --hud-tr-y (first free y under them, 0 = free), --hud-tc-b (bottom of the top-centre stack)
   and --hud-chat-y (chat column top, under the icons / info line / kill feed). touch.js publishes --touch-safe-left /
   --touch-safe-right / --touch-safe-bottom / --touch-top-h on <html>.
   State classes on .hud: hud-combat (gun / throwable held or gun minigame), hud-ads (aiming down sights), hud-gun (gun
   minigame: slim vitals bar instead of hearts, compact hotbar on touch), minigame, mg-plane / mg-chute / mg-spec
   (battle royale airplane, parachute drop, spectating — set by the minigame HUD), dead, sleeping, screen-open.
   Round 6 ("Altın Saat", SPEC 10.13): typography and tokens only — Rubik (--font-ui) everywhere, Barlow Condensed 700 +
   tabular figures for changing numbers, the shared toast look, a --hud-text-backing pill under the action bar, warm chat
   backing; every position and size above is the round-5 layout. Debug / coordinates keep --font-mono. */

.hud {
  --px: 2px;
  --slot: calc(var(--px) * 20);
  --g: var(--gui-scale, 1);
  --hud-pad-t: calc(var(--safe-t, 0px) + 6px);
  --hud-pad-r: calc(var(--safe-r, 0px) + 8px);
  --hud-pad-b: calc(var(--safe-b, 0px) + 4px);
  --hud-pad-l: calc(var(--safe-l, 0px) + 8px);
  --hud-tl-y: 0px; --hud-tc-y: 0px; --hud-tr-y: 0px; --hud-tc-b: 0px;
  --hud-top-l: max(var(--hud-pad-t), var(--hud-tl-y));
  --hud-top-c: max(var(--hud-pad-t), var(--hud-tc-y));
  --hud-top-r: max(var(--hud-pad-t), var(--hud-tr-y));
  --glass: rgba(12, 11, 10, 0.55);
  --glass-strong: rgba(16, 14, 13, 0.9);
  --hair: rgba(255, 255, 255, 0.1);
  --accent: var(--ember-2, #ffc14a);
  --chat-alpha: 0.8;
  --mm-w: calc(116px * var(--g));
  position: absolute; inset: 0; z-index: 5; pointer-events: none; color: #fff;
  font-family: var(--font-ui);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.7);
}
/* phones: a small map (~78 px), tablets up to 96 px */
.is-touch .hud { --mm-w: calc(clamp(72px, 20vmin, 96px) * var(--g)); }
.hud * { pointer-events: none; }
.hud .hud-slot, .hud .hud-hotbar-more, .hud .hud-minimap, .hud .hud-minimap *, .hud button, .hud .hud-chat.open, .hud .hud-chat.open *,
.hud .hud-playerlist, .hud .hud-playerlist *, .hud .hud-mg :where(button, [role="button"], .mg-interactive), .hud .mg-hud :where(button, [role="button"]) { pointer-events: auto; }
.hud .hud-minimap-canvas, .hud .hud-minimap-ring, .hud .hud-minimap-n, .hud .hud-minimap-coords { pointer-events: none; }
.hud-px { display: block; image-rendering: pixelated; }
.hud.hidden > :not(.hud-overlays), .hud.hidden .hud-dmgarcs { display: none !important; }
.hud.screen-open .hud-crosshair, .hud.screen-open .hud-cooldown, .hud.screen-open .hud-worldmarkers, .hud.screen-open .hud-playerlist,
.hud.screen-open .hud-title, .hud.screen-open .hud-held-name, .hud.screen-open .hud-actionbar, .hud.screen-open .hud-dmgarcs { display: none; }
/* inventory-like screens draw their own hotbar */
.hud.inv-open .hud-bottom { visibility: hidden; }
.hud.cam-front .hud-crosshair, .hud.cam-front .hud-cooldown, .hud.cam-front .gun-layer .gun-c { visibility: hidden; }
.hud.no-markers .hud-worldmarkers { display: none; }
.hud.dead .hud-crosshair, .hud.dead .hud-cooldown, .hud.sleeping .hud-crosshair { display: none; }
/* death screen: vanilla hides the HUD (chat and notifications stay) */
.hud.dead .hud-bottom, .hud.dead .hud-top, .hud.dead .hud-topleft, .hud.dead .hud-minimap, .hud.dead .hud-effects,
.hud.dead .hud-title, .hud.dead .hud-worldmarkers, .hud.dead .hud-dmgarcs { visibility: hidden; }
/* battle royale: aboard the airplane only the map, compass, storm timer and the ATLA button matter (no hotbar, no health
   bar: nothing can hurt you there, no crosshair); during the drop the health bar stays (the storm still hurts) */
.hud.mg-plane .hud-bottom, .hud.mg-chute .hud-hotbar { visibility: hidden; }
.hud.mg-plane .hud-crosshair, .hud.mg-plane .hud-cooldown, .hud.mg-spec .hud-crosshair, .hud.mg-spec .hud-cooldown { display: none; }

/* ---------------- overlays ---------------- */
.hud-overlays { position: absolute; inset: 0; overflow: hidden; }
.hud-ov { position: absolute; inset: 0; display: none; opacity: 0; will-change: opacity; }
.hud-ov-water { background: radial-gradient(ellipse at 50% 45%, rgba(40, 90, 200, 0.18), rgba(10, 30, 90, 0.55)); }
.hud-ov-water[data-kind="lava"] { background: radial-gradient(ellipse at 50% 50%, rgba(255, 120, 20, 0.55), rgba(160, 30, 0, 0.92)); }
.hud-ov-water[data-kind="powder"] { background: radial-gradient(ellipse at 50% 50%, rgba(235, 245, 255, 0.55), rgba(200, 225, 245, 0.95)); }
.hud-ov-pumpkin { background: radial-gradient(ellipse 60% 48% at 50% 50%, rgba(0, 0, 0, 0) 52%, rgba(140, 70, 0, 0.85) 70%, rgba(45, 20, 0, 0.97) 100%); }
.hud-ov-portal {
  background:
    radial-gradient(circle at 50% 50%, rgba(120, 30, 200, 0.12) 0%, rgba(110, 20, 190, 0.55) 75%),
    conic-gradient(from var(--spin, 0deg), rgba(190, 90, 255, 0.35), rgba(70, 0, 150, 0.5), rgba(190, 90, 255, 0.35), rgba(70, 0, 150, 0.5), rgba(190, 90, 255, 0.35));
  mix-blend-mode: screen;
}
.hud-ov-frost { background: radial-gradient(ellipse at 50% 50%, rgba(220, 240, 255, 0) 45%, rgba(190, 228, 255, 0.45) 78%, rgba(235, 248, 255, 0.85) 100%); }
.hud-ov-heat { background: radial-gradient(ellipse at 50% 50%, rgba(255, 140, 40, 0) 50%, rgba(255, 110, 20, 0.32) 82%, rgba(220, 60, 0, 0.6) 100%); mix-blend-mode: screen; }
.hud-ov-lowhp { background: radial-gradient(ellipse at 50% 50%, rgba(160, 0, 0, 0) 55%, rgba(170, 0, 0, 0.45) 86%, rgba(110, 0, 0, 0.75) 100%); }
/* gun play: an edge-only vignette (the centre of the view stays clean while the health bar already turns red) */
.hud.hud-gun .hud-ov-lowhp { background: radial-gradient(ellipse at 50% 50%, rgba(160, 0, 0, 0) 66%, rgba(170, 0, 0, 0.34) 90%, rgba(120, 0, 0, 0.62) 100%); }
.hud-ov-flash { background: radial-gradient(ellipse at 50% 50%, rgba(255, 40, 30, 0.12), rgba(200, 0, 0, 0.6)); }
.hud.hud-gun .hud-ov-flash { background: radial-gradient(ellipse at 50% 50%, rgba(255, 40, 30, 0) 50%, rgba(220, 20, 10, 0.5) 100%); }
/* spyglass: black mask with a round lens and a thin brass ring */
.hud-ov-scope {
  background: radial-gradient(circle at 50% 50%, transparent 0, transparent min(38vmin, 340px), rgba(176, 132, 60, 0.95) calc(min(38vmin, 340px) + 1px),
    rgba(60, 40, 18, 1) calc(min(38vmin, 340px) + 5px), #000 calc(min(38vmin, 340px) + 8px));
}

/* damage direction arcs around the crosshair (overlays.js rotates each arc toward its source) */
.hud-dmgarcs { position: absolute; left: 50%; top: 50%; width: 0; height: 0; --arc-r: clamp(76px, 25vmin, 150px); }
.hud-dmgarc {
  position: absolute; left: calc(var(--arc-r) * -1); top: calc(var(--arc-r) * -1); width: calc(var(--arc-r) * 2); height: calc(var(--arc-r) * 2);
  opacity: 0; will-change: transform, opacity;
}
.hud-dmgarc svg { display: block; width: 100%; height: 100%; overflow: visible; }
.hud-dmgarc .g { fill: none; stroke: rgba(255, 36, 24, 0.3); stroke-width: 13; stroke-linecap: round; }
.hud-dmgarc .c { fill: none; stroke: #ff4a36; stroke-width: 4.5; stroke-linecap: round; }

.hud-sleep {
  position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px;
  background: rgba(2, 3, 12, var(--dark, 0)); opacity: 0; z-index: 20;
}
.hud-sleep-text { font-family: var(--font-display); font-size: calc(24px * var(--g)); font-weight: 800; letter-spacing: 0.02em; text-transform: uppercase; }
.hud-sleep-count { font-size: calc(14px * var(--g)); color: rgba(225, 222, 255, 0.85); }
.hud-sleep-wake { margin-top: 8px; pointer-events: auto !important; }

/* ---------------- crosshair + attack cooldown ---------------- */
.hud-crosshair { position: absolute; left: 50%; top: 50%; width: calc(18px * var(--g)); height: calc(18px * var(--g)); transform: translate(-50%, -50%); mix-blend-mode: difference; }
.hud-crosshair i, .hud-crosshair b { position: absolute; background: #fff; display: block; }
.hud-crosshair i { left: 0; right: 0; top: 50%; height: calc(2px * var(--g)); transform: translateY(-50%); }
.hud-crosshair b { top: 0; bottom: 0; left: 50%; width: calc(2px * var(--g)); transform: translateX(-50%); }
.is-touch .hud:not(.touch-crosshair) .hud-crosshair { opacity: 0.4; width: calc(12px * var(--g)); height: calc(12px * var(--g)); }
.is-touch .hud.touch-hold .hud-crosshair { opacity: 1; }
.hud-cooldown {
  position: absolute; left: 50%; top: calc(50% + 15px * var(--g)); width: calc(16px * var(--g)); height: calc(3px * var(--g));
  transform: translateX(-50%); background: rgba(0, 0, 0, 0.55); box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.5); opacity: 0; transition: opacity 0.12s;
}
.hud-cooldown i { display: block; height: 100%; width: calc(var(--cd, 0) * 100%); background: #fff; }
.hud-cooldown.on { opacity: 0.9; }
.hud-cooldown.draw { width: calc(22px * var(--g)); }
.hud-cooldown.draw i { transition: background-color 0.1s; }
.hud-cooldown.draw.full i { background: #ffd36b; box-shadow: 0 0 calc(4px * var(--g)) rgba(255, 211, 107, 0.8); }
.is-touch .hud.aiming .hud-crosshair { opacity: 1; }

/* ---------------- top centre: compass (contextual / battle royale) + boss bars ---------------- */
.hud-top { position: absolute; top: var(--hud-pad-t); left: 50%; transform: translateX(-50%); width: min(46vw, calc(330px * var(--g))); display: flex; flex-direction: column; align-items: center; gap: 4px; }
.is-touch .hud-top { top: var(--hud-top-c); width: min(40vw, calc(300px * var(--g))); }
.hud-compass { width: 100%; }
.hud-compass-canvas { display: block; width: 100%; height: calc(28px * var(--g)); }
.is-touch .hud-compass-canvas { height: calc(25px * var(--g)); }
.hud-bossbars { display: flex; flex-direction: column; gap: calc(var(--px) * 3); align-items: center; }
.hud-bossbar { display: flex; flex-direction: column; align-items: center; gap: calc(var(--px) * 1.5); }
.hud-bossbar-name { font-size: calc(13px * var(--g)); font-weight: 600; white-space: nowrap; text-shadow: 0 1px 0 rgba(0, 0, 0, 0.85); }
.is-touch .hud-bossbar-name { font-size: calc(11.5px * var(--g)); }
.hud-bossbar-track {
  position: relative; width: calc(var(--px) * 182); height: calc(var(--px) * 5); background: #1c0c1c;
  box-shadow: 0 0 0 var(--px) rgba(0, 0, 0, 0.88); overflow: hidden;
}
.is-touch .hud-bossbar-track { width: min(calc(var(--px) * 182), 38vw); height: calc(var(--px) * 3); }
.hud-bossbar-fill {
  --boss: #ec5bd2; height: 100%; width: 100%; transition: width 0.25s;
  background: linear-gradient(180deg, color-mix(in srgb, var(--boss) 55%, #fff) 0 var(--px), var(--boss) var(--px) calc(var(--px) * 3), color-mix(in srgb, var(--boss) 62%, #000) calc(var(--px) * 3));
  background-color: var(--boss);
}

/* ---------------- top-left: coordinates / FPS + F3 debug ---------------- */
.hud-topleft { position: absolute; top: var(--hud-pad-t); left: var(--hud-pad-l); max-width: 46vw; display: flex; flex-direction: column; gap: 4px; align-items: flex-start; }
.is-touch .hud-topleft { top: var(--hud-top-l); max-width: calc(50vw - 150px); }
.hud-infoline {
  font-family: var(--font-mono); font-size: calc(12px * var(--g)); font-variant-numeric: tabular-nums;
  padding: 2px 7px; background: var(--glass); border-radius: 5px; white-space: pre; text-shadow: none; color: rgba(255, 255, 255, 0.92);
}
.is-touch .hud-infoline { font-size: calc(10.5px * var(--g)); padding: 1px 6px; }
.hud-infoline:empty { display: none; }
/* connection quality (hud/health.js): hidden while the link is good; level 1 = amber (2 bars), 2 = red (1 bar) */
.hud-net { display: inline-flex; align-items: center; gap: 5px; padding: 3px 6px; background: var(--glass); border-radius: 5px; text-shadow: none;
  --net-c: var(--warning); }
.hud-net[data-level="2"] { --net-c: var(--danger); }
.hud-net-bars { display: inline-flex; align-items: flex-end; gap: 2px; height: calc(11px * var(--g)); }
.hud-net-bars i { display: block; width: calc(3px * var(--g)); border-radius: 1px; background: rgba(255, 255, 255, 0.22); }
.hud-net-bars i:nth-child(1) { height: 40%; background: var(--net-c); }
.hud-net-bars i:nth-child(2) { height: 70%; }
.hud-net-bars i:nth-child(3) { height: 100%; }
.hud-net[data-level="1"] .hud-net-bars i:nth-child(2) { background: var(--net-c); }
.hud-net-ms { font-family: var(--font-mono); font-size: calc(10.5px * var(--g)); font-variant-numeric: tabular-nums; color: var(--net-c); }
.hud-net-ms:empty { display: none; }
.hud-debug { display: flex; flex-direction: column; gap: 4px; }
.hud-debug pre {
  margin: 0; padding: 4px 7px; background: rgba(0, 0, 0, 0.55); border-radius: 4px; color: #f2f2f2; text-shadow: none;
  font: calc(11px * var(--g))/1.3 var(--font-mono); white-space: pre; overflow: hidden; max-width: 46vw; text-overflow: ellipsis;
}
.hud.debug-on .hud-chat { opacity: 0.55; }

/* ---------------- top-right: minimap, effects, notifications ---------------- */
.hud-topright { position: absolute; top: var(--hud-pad-t); right: var(--hud-pad-r); display: flex; flex-direction: column; align-items: flex-end; gap: 6px; }
.is-touch .hud-topright { top: var(--hud-top-r); gap: 4px; }
.hud-minimap { position: relative; width: var(--mm-w); height: var(--mm-w); border-radius: 50%; touch-action: none; cursor: pointer; }
.hud-minimap-canvas { position: absolute; inset: 0; width: 100%; height: 100%; border-radius: 50%; }
.hud-minimap-ring {
  position: absolute; inset: -1.5px; border-radius: 50%; border: 1.5px solid rgba(10, 9, 8, 0.82);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.16), 0 2px 8px rgba(0, 0, 0, 0.32);
}
/* north marker inside the rim (it used to stick out and got clipped at the screen edge) */
.hud-minimap-n {
  position: absolute; top: calc(2px * var(--g)); left: 50%; transform: translateX(-50%);
  min-width: calc(13px * var(--g)); height: calc(13px * var(--g)); padding: 0 2px; border-radius: 7px; display: grid; place-items: center;
  font-family: var(--font-display); font-weight: 800; font-size: calc(9px * var(--g)); line-height: 1; color: var(--red-300); background: rgba(10, 9, 8, 0.72); text-shadow: none;
}
.hud-minimap-coords {
  position: absolute; bottom: calc(14px * var(--g)); left: 50%; transform: translateX(-50%); display: none; white-space: nowrap;
  font-family: var(--font-mono); font-size: calc(12px * var(--g)); font-variant-numeric: tabular-nums;
  background: rgba(0, 0, 0, 0.62); padding: 2px 8px; border-radius: 6px; text-shadow: none;
}
.hud-minimap-ctrl { position: absolute; right: calc(-10px * var(--g)); top: 50%; transform: translate(100%, -50%); display: none; flex-direction: column; gap: 8px; }
.hud-mm-btn {
  width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; padding: 0; cursor: pointer; touch-action: manipulation;
  color: #fff; background: var(--glass-strong); border: 1px solid var(--hair); box-shadow: 0 4px 12px rgba(0, 0, 0, 0.35);
}
.hud-mm-btn:active { transform: scale(0.94); background: rgba(255, 255, 255, 0.2); }
.hud-minimap.expanded {
  position: fixed; top: 50%; right: auto; left: 50%; transform: translate(-50%, -50%);
  width: min(74vmin, calc(460px * var(--g))); height: min(74vmin, calc(460px * var(--g))); z-index: 30;
  box-shadow: 0 0 0 100vmax rgba(6, 6, 8, 0.6);
}
.hud-minimap.expanded .hud-minimap-n { top: calc(6px * var(--g)); min-width: calc(16px * var(--g)); height: calc(16px * var(--g)); font-size: calc(10px * var(--g)); }
.hud-minimap.expanded .hud-minimap-coords { display: block; }
.hud-minimap.expanded .hud-minimap-ctrl { display: flex; }
@media (orientation: portrait) {
  .hud-minimap.expanded .hud-minimap-ctrl { right: 50%; top: auto; bottom: calc(-14px * var(--g)); transform: translate(50%, 100%); flex-direction: row; }
}
/* the enlarged map is modal: touch controls step aside */
#ui.mm-open .touch-root { display: none !important; }

/* status effects (vanilla: beneficial row, then harmful row) */
.hud-effects { display: flex; flex-direction: column; gap: 4px; align-items: flex-end; }
.hud-effects.empty { display: none; }
.hud-eff-row { display: flex; gap: 4px; flex-wrap: wrap; justify-content: flex-end; max-width: calc(5 * 30px * var(--g)); }
.hud-eff-row:empty { display: none; }
.hud-eff { position: relative; display: flex; flex-direction: column; align-items: center; gap: 1px; width: calc(26px * var(--g)); }
.hud-eff-icon { display: block; width: calc(24px * var(--g)); height: calc(24px * var(--g)); filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.45)); }
.hud-eff-icon svg { display: block; width: 100%; height: 100%; }
.hud-eff-lvl {
  position: absolute; top: -3px; right: -3px; min-width: 12px; padding: 0 2px; border-radius: 4px; background: rgba(0, 0, 0, 0.8); text-shadow: none;
  font-family: var(--font-display); font-size: calc(9px * var(--g)); font-weight: 700; line-height: 1.3; text-align: center; font-variant-numeric: tabular-nums;
}
.hud-eff-lvl:empty { display: none; }
.hud-eff-time { font-family: var(--font-display); font-weight: 700; font-size: calc(10px * var(--g)); line-height: 1.1; letter-spacing: .02em; font-variant-numeric: tabular-nums; color: var(--paper-1); }
.hud-eff.ending .hud-eff-icon { animation: effBlink 0.5s steps(2, jump-none) infinite; }
@keyframes effBlink { 50% { opacity: 0.3; } }
/* phones: tiny icon tiles without the timer (it is in the inventory's effect list); they still blink in the last 10 s */
.is-touch .hud-eff { width: calc(19px * var(--g)); }
.is-touch .hud-eff-icon { width: calc(18px * var(--g)); height: calc(18px * var(--g)); }
.is-touch .hud-eff-time { display: none; }
.is-touch .hud-eff-lvl { font-size: calc(7.5px * var(--g)); min-width: 10px; top: -4px; right: -4px; }
/* phones in landscape: the effect tiles stand left of the minimap (under it they hid behind the jump button) */
@media (orientation: landscape) {
  .is-touch .hud-effects { position: absolute; top: 0; right: calc(100% + 6px); flex-direction: row-reverse; align-items: flex-start; gap: 3px; }
  .is-touch .hud-eff-row { flex-direction: column; flex-wrap: wrap; max-width: none; max-height: calc(var(--mm-w) + 10px); gap: 3px; }
}

/* ---------------- minigame overlay slots (plugins) ---------------- */
.hud-mg { position: absolute; display: flex; flex-direction: column; gap: 6px; }
.hud-mg:empty { display: none; }
.hud-mg-top { top: calc(var(--hud-pad-t) + 40px * var(--g)); left: 50%; transform: translateX(-50%); align-items: center; max-width: 70vw; }
.is-touch .hud-mg-top { top: calc(max(var(--hud-top-c), var(--hud-tc-b)) + 4px); max-width: 56vw; }
.hud-mg-left { top: calc(var(--hud-pad-t) + 34px * var(--g)); left: var(--hud-pad-l); align-items: flex-start; max-width: 40vw; }
.is-touch .hud-mg-left { top: calc(var(--hud-top-l) + 2px); left: calc(var(--hud-pad-l) + 4px); }
.hud-mg-center { left: 50%; top: 36%; transform: translate(-50%, -50%); align-items: center; text-align: center; max-width: 90vw; }
.hud.minigame .hud-infoline { display: none; }

/* ---------------- chat ---------------- */
.hud-chat {
  position: absolute; left: var(--hud-pad-l); bottom: calc(var(--hud-pad-b) + var(--px) * 54);
  /* never reaches the centred hotbar block (incl. the offhand box left of it) */
  width: min(calc(460px * var(--g)), max(200px, calc(50vw - var(--px) * 130 - 16px)));
}
.hud-chat-list { display: flex; flex-direction: column; justify-content: flex-end; max-height: 42vh; overflow: hidden; }
.hud-chat-line {
  font-size: calc(14px * var(--g)); line-height: 1.38; padding: 1px 8px; overflow-wrap: anywhere; color: var(--text-1);
  background: rgba(8, 6, 5, calc(0.55 * var(--chat-alpha))); text-shadow: 0 1px 1px rgba(0, 0, 0, 0.9);
  user-select: text; -webkit-user-select: text;
}
.hud-chat-line.system { color: var(--text-2); }
.hud-chat-line.system.ok { color: var(--text-2); }
.hud-chat-line.system.err { color: var(--danger-text); }
.hud-chat-line.system.ach { color: var(--amber-200); }
.hud-chat-line.system.note, .hud-chat-line.whisper .hud-chat-from { color: var(--info-text); }
.hud-chat-line.emote { color: var(--text-2); font-style: italic; }
.hud-chat-ico { display: inline-block; width: 1em; height: 1em; margin-right: .35em; vertical-align: -0.14em; color: var(--text-3); }
.hud-chat-ico > svg { display: block; width: 100%; height: 100%; }
.hud-chat-line.ok .hud-chat-ico { color: var(--success); }
.hud-chat-line.err .hud-chat-ico { color: var(--danger); }
.hud-chat-line.ach .hud-chat-ico { color: var(--amber-300); }
.hud-chat-line.note .hud-chat-ico { color: var(--info); }
/* .top = the first VISIBLE line (hud/chat.js; faded older lines keep :first-child while display: none) */
.hud-chat-line:first-child, .hud-chat-line.top { border-top-left-radius: 5px; border-top-right-radius: 5px; padding-top: 3px; }
.hud-chat-line:last-child { border-bottom-left-radius: 5px; border-bottom-right-radius: 5px; padding-bottom: 3px; }
.hud-chat-from { font-weight: 600; color: var(--text-0); }
.hud-chat.open .hud-chat-list { display: block; max-height: 50vh; overflow-y: auto; touch-action: pan-y; -webkit-overflow-scrolling: touch; overscroll-behavior: contain; }
/* the open log is scrolled to the newest line: the oldest visible line fades in at the top instead of being cut by the
   box edge (the padding keeps the first line clear of the fade when everything fits) */
.hud-chat.open .hud-chat-list {
  padding-top: 12px; -webkit-mask-image: linear-gradient(to bottom, transparent 0, #000 14px); mask-image: linear-gradient(to bottom, transparent 0, #000 14px);
}
.hud-chat.open .hud-chat-line { background: rgba(8, 6, 5, calc(0.62 * var(--chat-alpha) + 0.12)); }
/* touch: a narrow top-left column (hud.js measures --hud-chat-y and how many lines fit above the left controls) */
.is-touch .hud-chat { top: var(--hud-chat-y, calc(var(--hud-pad-t) + 52px)); bottom: auto; left: var(--hud-pad-l); width: min(38vw, calc(300px * var(--g))); }
.is-touch .hud-chat-list { max-height: 30vh; }
.is-touch .hud-chat-line { font-size: calc(13px * var(--g)); line-height: 1.3; padding: 1px 7px; background: rgba(8, 6, 5, calc(0.5 * var(--chat-alpha))); }
.is-touch .hud-chat-line:first-child, .is-touch .hud-chat-line.top { padding-top: 2px; }
.is-touch .hud-chat-line:last-child { padding-bottom: 2px; }
.is-touch .hud-chat.open { width: min(50vw, calc(360px * var(--g))); }
.is-touch .hud-chat.open .hud-chat-list { max-height: 36vh; }
/* aiming down sights: the passive log steps back */
.hud.hud-ads .hud-chat:not(.open) { opacity: 0.35; }

/* ---------------- titles / action bar / held item name ---------------- */
.hud-title { position: absolute; inset: 0; display: none; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 0 6vw 22vh; }
.hud-title-main {
  font-family: var(--font-display); font-weight: 800; font-size: clamp(28px, 8vmin, 72px); letter-spacing: 0.01em; line-height: 1; text-transform: uppercase;
  text-shadow: 0 2px 24px rgba(0, 0, 0, 0.45), 0 1px 2px rgba(0, 0, 0, 0.35);
}
.hud-title-sub { margin-top: 0.45em; font-size: clamp(14px, 3.2vmin, 26px); font-weight: 500; color: var(--paper-1); text-shadow: 0 1px 2px rgba(0, 0, 0, 0.85), 0 0 18px rgba(0, 0, 0, 0.35); }
.is-touch .hud-title-main { font-size: clamp(24px, 7vmin, 56px); }
.is-touch .hud-title-sub { font-size: clamp(12.5px, 3vmin, 20px); }
.hud-actionbar, .hud-held-name {
  min-height: 1.3em; text-align: center; font-size: calc(14px * var(--g)); font-weight: 600; white-space: nowrap; opacity: 0; transition: opacity 0.15s;
  max-width: 92vw; overflow: hidden; text-overflow: ellipsis; text-shadow: 0 1px 1px rgba(0, 0, 0, 0.6);
  padding: calc(2px * var(--g)) calc(10px * var(--g)); border-radius: 6px; background: var(--hud-text-backing); color: var(--paper-0);
}
.hud-actionbar:empty, .hud-held-name:empty { background: none; }
.is-touch .hud-actionbar, .is-touch .hud-held-name { font-size: calc(13px * var(--g)); max-width: 60vw; }

/* ---------------- notification stack ---------------- */
/* desktop: last item of the top-right column (under the minimap + effect tiles) */
.hud-toasts { position: relative; display: flex; flex-direction: column; gap: 6px; align-items: flex-end; z-index: 6; }
.hud-toasts:empty { display: none; }
html:not(.is-touch) .hud.minigame .hud-toasts {
  position: fixed; left: 50%; right: auto; top: auto; transform: translateX(-50%); align-items: center;
  bottom: calc(var(--hud-pad-b) + var(--px) * 64);
}
/* touch: compact cards at the top centre, under the compass / minigame stack */
.is-touch .hud-toasts {
  position: fixed; right: auto; left: 50%; transform: translateX(-50%); align-items: center; gap: 4px;
  top: calc(max(var(--hud-top-c), var(--hud-tc-b)) + 4px);
}
.hud-toast {
  --toast-c: var(--info);
  position: relative; display: flex; align-items: center; gap: calc(10px * var(--g)); width: min(72vw, calc(300px * var(--g)));
  padding: calc(9px * var(--g)) calc(12px * var(--g)) calc(9px * var(--g)) calc(13px * var(--g));
  background: var(--surface-toast); border: 1px solid var(--line-2); border-radius: 6px; box-shadow: var(--elev-2); text-shadow: none;
  transform: translateX(12px); opacity: 0; transition: transform var(--dur-3) var(--ease-out), opacity var(--dur-3) var(--ease-out);
}
.hud-toast::before { content: ""; position: absolute; left: -1px; top: -1px; bottom: -1px; width: 3px; border-radius: 6px 0 0 6px; background: var(--toast-c); }
.is-touch .hud-toast { width: auto; min-width: min(46vw, calc(170px * var(--g))); max-width: min(62vw, calc(270px * var(--g))); gap: 8px; padding: 6px 10px 6px 11px; }
.is-touch .hud-toast, html:not(.is-touch) .hud.minigame .hud-toast { transform: translateY(-12px); }
.hud-toast.in { transform: none; opacity: 1; }
.hud-toast.out { opacity: 0; transition-duration: var(--dur-2); transition-timing-function: var(--ease-in); }
.hud-toast.ok { --toast-c: var(--success); }
.hud-toast.bad { --toast-c: var(--danger); }
.hud-toast.warn { --toast-c: var(--warning); }
.hud-toast.info { --toast-c: var(--info); }
.hud-toast.ach { --toast-c: var(--accent); }
.hud-toast-icon { width: calc(24px * var(--g)); height: calc(24px * var(--g)); flex: none; }
.is-touch .hud-toast-icon { width: calc(20px * var(--g)); height: calc(20px * var(--g)); }
.hud-toast-icon.item { image-rendering: pixelated; }
.hud-toast-icon.glyph { display: grid; place-items: center; color: var(--toast-c); }
.hud-toast.ach .hud-toast-icon.glyph { color: var(--amber-300); }
.hud-toast-icon.glyph svg { width: calc(20px * var(--g)); height: calc(20px * var(--g)); }
.hud-toast-body { min-width: 0; display: grid; gap: 1px; }
.hud-toast-title { color: var(--text-0); font-weight: 600; font-size: calc(14px * var(--g)); line-height: 1.3; }
.hud-toast-text { color: var(--text-2); font-size: calc(13px * var(--g)); line-height: 1.35; overflow-wrap: anywhere; }
.is-touch .hud-toast-title { font-size: calc(13px * var(--g)); }
.is-touch .hud-toast-text { font-size: calc(12px * var(--g)); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
/* shell notices raised while playing (dialogs.js toast(), the 'game' lane) ride this stack too (hud/messages.js adopts them) */
.hud-toasts > .toast { width: min(72vw, calc(300px * var(--g))); font-size: calc(13px * var(--g)); text-shadow: none; }
.is-touch .hud-toasts > .toast { width: auto; max-width: min(62vw, calc(270px * var(--g))); padding: 6px 10px 6px 11px; }
.hud .hud-toasts > .toast, .hud .hud-toasts > .toast * { pointer-events: auto; }
/* "Oyun yavaş çalışıyor" (hud/health.js): the toast look with a row of buttons; only the buttons take touches */
.hud-toast.hud-perf, .is-touch .hud-toast.hud-perf { align-items: flex-start; width: auto; max-width: min(88vw, calc(360px * var(--g))); }
.hud-perf-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 6px; }
.hud-perf-actions .btn { text-shadow: none; }

/* ---------------- blocking card: the WebGL context did not come back (hud/health.js; child of #ui, above every screen) ---------------- */
.hud-block { position: absolute; inset: 0; z-index: 90; display: grid; place-items: center; pointer-events: auto;
  padding: calc(16px + var(--safe-t, 0px)) calc(16px + var(--safe-r, 0px)) calc(16px + var(--safe-b, 0px)) calc(16px + var(--safe-l, 0px));
  background: var(--scrim-game-strong); animation: fadeIn var(--dur-2) var(--ease-out); }
.hud-block-card { display: grid; justify-items: center; gap: .625rem; width: min(24rem, 100%); box-sizing: border-box; padding: 1.25rem 1.5rem; text-align: center;
  border-radius: var(--r-md); background: var(--surface-1); border: 1px solid var(--line-2); box-shadow: var(--elev-2);
  color: var(--text-0); font-family: var(--font-ui); }
.hud-block-ico { display: grid; place-items: center; width: 2.75rem; height: 2.75rem; border-radius: var(--r-sm); background: var(--warning-soft); color: var(--warning); }
.hud-block-title { font-size: var(--fs-lg); font-weight: 600; line-height: 1.25; }
.hud-block-text { color: var(--text-2); font-size: var(--fs-sm); line-height: 1.4; }
.hud-block-card .btn { margin-top: .375rem; }

/* ---------------- world markers ---------------- */
.hud-worldmarkers { position: absolute; inset: 0; overflow: hidden; }
.hud-wm { position: absolute; left: 0; top: 0; display: flex; flex-direction: column; align-items: center; gap: 3px; will-change: transform; }
.hud-wm-icon {
  width: calc(12px * var(--g)); height: calc(12px * var(--g)); background: var(--mc, #ffd34d); border: 2px solid rgba(0, 0, 0, 0.85); transform: rotate(45deg);
  box-shadow: 0 0 8px color-mix(in srgb, var(--mc, #ffd34d) 70%, transparent); animation: wmPulse 1.4s ease-in-out infinite; order: 2;
}
.hud-wm-death .hud-wm-icon { border-radius: 50%; transform: none; background: #ff4d4d; box-shadow: 0 0 8px rgba(255, 77, 77, 0.7); animation: none; }
.hud-wm-label { font-size: calc(12px * var(--g)); font-weight: 600; background: var(--hud-text-backing); padding: 1px 6px; border-radius: 4px; white-space: nowrap; order: 1; text-shadow: none; }
.is-touch .hud-wm-label { font-size: calc(10.5px * var(--g)); }
@keyframes wmPulse { 50% { transform: rotate(45deg) scale(1.18); } }

/* ---------------- bottom: pixel status bars + hotbar (sizes from --px; left set by hud.js on a whole device pixel) ---- */
.hud-bottom {
  position: absolute; left: calc(50% - var(--px) * 92); bottom: var(--hud-pad-b); width: calc(var(--px) * 184);
  display: flex; flex-direction: column; align-items: center;
}
.hud-status-wrap { position: relative; display: flex; justify-content: center; width: 100%; }
.hud-status { margin-bottom: var(--px); }
.hud.hud-gun .hud-status { display: none !important; }
.hud-hotbar { position: relative; width: calc(var(--px) * 184); height: calc(var(--px) * 24); }
/* gun minigames on touch: only the occupied slots, centred (.hud-bottom keeps its width: the touch layout never moves) */
.hud-hotbar.compact { width: calc(var(--px) * (20 * var(--hb-n, 9) + 4)); }
.hud-hotbar-row { position: relative; width: 100%; height: 100%; }
.hud-hotbar-canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.hud-slot { position: absolute; top: 0; left: calc(var(--px) * (1 + 20 * var(--i, 0))); width: calc(var(--px) * 20); height: 100%; touch-action: none; cursor: pointer; }
.hud-slot.dropping::after {
  content: ""; position: absolute; left: calc(var(--px) * 2); top: calc(var(--px) * 3); width: calc(var(--px) * 18); height: calc(var(--px) * 18);
  background: rgba(255, 60, 40, 0.42);
}
.hud-offhand { position: absolute; right: calc(100% + var(--px) * 5); bottom: 0; width: calc(var(--px) * 24); height: calc(var(--px) * 24); pointer-events: none !important; }
.hud-offhand canvas { width: 100%; height: 100%; }
.hud.no-offhand .hud-offhand { display: none; }
.hud-hotbar-more {
  display: none; position: absolute; left: calc(100% + var(--px) * 5); bottom: 0; width: calc(var(--px) * 24); height: calc(var(--px) * 24);
  padding: 0; margin: 0; border: 0; background: none; cursor: pointer; touch-action: manipulation; -webkit-tap-highlight-color: transparent;
}
.hud-hotbar-more canvas { width: 100%; height: 100%; }
.hud-hotbar-more:active { filter: brightness(1.6); }
/* touch.js turns this on (Bedrock-style inventory button in thumb reach) */
.hud.hud-more-on .hud-hotbar-more { display: block; }
.hud button:focus-visible, .hud .hud-slot:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.hud-unhide:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* gun minigames: slim shooter vitals (vitals.js) — armor line over one health bar, hunger / air chips on its left,
   the controls' ammo readout may mount on its right (.hud-ammo-slot) */
.hud-vitals { display: none; }
.hud.hud-gun .hud-vitals { display: block; margin-bottom: calc(var(--px) * 2.5); }
.hud[data-mode="spectator"] .hud-vitals { display: none !important; }
.hv-bars { position: relative; width: min(calc(var(--px) * 124), 44vw); }
.hv-armor { height: max(2px, calc(var(--px) * 1.25)); margin: 0 1px calc(var(--px) * 1); border-radius: 2px; background: rgba(0, 0, 0, 0.42); overflow: hidden; }
.hv-armor.none { visibility: hidden; }
.hv-armor i { display: block; height: 100%; background: linear-gradient(90deg, #6fb6ff, #a9d6ff); transform-origin: 0 50%; transform: scaleX(0); }
.hv-hp {
  position: relative; height: max(6px, calc(var(--px) * 3.5)); border-radius: 3px; overflow: hidden;
  background: rgba(10, 10, 12, 0.55); box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.62), 0 1px 3px rgba(0, 0, 0, 0.35);
}
.hv-hp i { position: absolute; left: 0; top: 0; bottom: 0; width: 100%; transform-origin: 0 50%; transform: scaleX(1); }
.hv-lag { background: #e8503f; }
.hv-fill { background: linear-gradient(180deg, #ffffff, #dcdcdc); }
.hv-hp .hv-abs { top: auto; height: 2px; background: #ffd451; transform: scaleX(0); }
.hv-hp.low .hv-fill { background: linear-gradient(180deg, #ff7a68, #e83a2a); }
.hv-hp.crit { animation: hvCrit 0.8s ease-in-out infinite; }
.hv-hp.poison .hv-fill { background: linear-gradient(180deg, #c4f59a, #86cf55); }
.hv-hp.heal { box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.62), 0 0 8px rgba(120, 255, 150, 0.85); }
.hv-hp.heal .hv-fill { background: linear-gradient(180deg, #f4fff5, #b9f5c2); }
@keyframes hvCrit { 50% { box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.62), 0 0 10px rgba(255, 50, 30, 0.9); } }
.hv-side { position: absolute; right: calc(100% + 7px); bottom: -3px; display: flex; gap: 5px; align-items: center; }
.hv-chip { display: flex; align-items: center; gap: 3px; color: #ffcf7a; filter: drop-shadow(0 1px 1px rgba(0, 0, 0, 0.8)); }
.hv-chip[hidden] { display: none; }
.hv-chip svg { width: calc(12px * var(--g)); height: calc(12px * var(--g)); }
.hv-chip b { display: block; width: calc(20px * var(--g)); height: 4px; border-radius: 2px; background: rgba(0, 0, 0, 0.55); overflow: hidden; box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.5); }
.hv-chip b i { display: block; height: 100%; background: currentColor; transform-origin: 0 50%; }
.hv-chip.low { color: #ff6a50; animation: effBlink 0.9s steps(2, jump-none) infinite; }
.hv-air { color: #8fd3ff; }
.hud-ammo-slot { position: absolute; left: calc(100% + 8px); bottom: -6px; display: flex; align-items: center; }
.hud-ammo-slot:empty { display: none; }

/* thermometer (realism) */
.hud-thermo { position: absolute; right: calc(100% + 10px * var(--g)); bottom: calc(6px * var(--g)); display: flex; flex-direction: column; align-items: center; width: calc(30px * var(--g)); }
.is-touch .hud-thermo { right: auto; left: 0; bottom: calc(100% + 2px); }
.hud-thermo-trend { height: calc(12px * var(--g)); font-size: calc(10px * var(--g)); line-height: 1; }
.hud-thermo-tube { position: relative; width: calc(10px * var(--g)); height: calc(46px * var(--g)); background: rgba(0, 0, 0, 0.55); border: calc(2px * var(--g)) solid #000; border-bottom: 0; border-radius: calc(5px * var(--g)) calc(5px * var(--g)) 0 0; overflow: hidden; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.2); }
.is-touch .hud-thermo-tube { height: calc(28px * var(--g)); }
.hud-thermo-fill { position: absolute; left: 0; right: 0; bottom: 0; height: 50%; background: #5d5; transition: height 0.4s, background 0.4s; }
.hud-thermo-tube::after { content: ""; position: absolute; left: 0; right: 0; top: 50%; height: 1px; background: rgba(255, 255, 255, 0.5); }
.hud-thermo-bulb { width: calc(18px * var(--g)); height: calc(18px * var(--g)); margin-top: calc(-3px * var(--g)); border-radius: 50%; border: calc(2px * var(--g)) solid #000; background: #5d5; box-shadow: inset 0 calc(-3px * var(--g)) 0 rgba(0, 0, 0, 0.25), inset calc(2px * var(--g)) calc(2px * var(--g)) 0 rgba(255, 255, 255, 0.35); }
.hud-thermo-label { margin-top: 2px; font-family: var(--font-display); font-weight: 700; font-size: calc(11px * var(--g)); white-space: nowrap; font-variant-numeric: tabular-nums; }
.hud-thermo.danger .hud-thermo-bulb { animation: thermoPulse 0.8s ease-in-out infinite; }
@keyframes thermoPulse { 50% { transform: scale(1.18); filter: brightness(1.3); } }

/* ---------------- player list ---------------- */
.hud-playerlist {
  position: absolute; top: calc(var(--hud-pad-t) + 36px * var(--g)); left: 50%; transform: translateX(-50%); z-index: 25;
  min-width: min(92vw, calc(360px * var(--g))); max-width: 92vw; max-height: 70vh; overflow-y: auto; overscroll-behavior: contain;
  background: var(--glass-strong); border: 1px solid var(--hair); border-radius: 12px; box-shadow: 0 12px 30px rgba(0, 0, 0, 0.5); padding: 10px 12px; text-shadow: none;
}
.is-touch .hud-playerlist { top: calc(max(var(--hud-top-c), var(--hud-tc-b)) + 8px); max-height: 62vh; }
.hud-playerlist .pl-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; padding-bottom: 6px; border-bottom: 1px solid var(--hair); margin-bottom: 4px; }
.hud-playerlist .pl-world { font-weight: 600; color: var(--text-0); }
.hud-playerlist .pl-count { font: 700 0.8em/1 var(--font-display); letter-spacing: .06em; text-transform: uppercase; color: var(--text-3); }
.hud-playerlist .pl-rows { display: flex; flex-direction: column; gap: 2px; }
.hud-playerlist .pl-row { display: grid; grid-template-columns: auto 1fr auto auto auto; gap: 10px; align-items: center; padding: 6px 8px; border-radius: 8px; }
.hud-playerlist .pl-row.self { background: rgba(255, 255, 255, 0.07); }
.hud-playerlist .pl-dot { width: 9px; height: 9px; border-radius: 50%; box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.6); }
.hud-playerlist .pl-name { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hud-playerlist .pl-mode { font-size: 0.8em; color: var(--text-3); }
.hud-playerlist .pl-you { color: var(--text-3); font-weight: 400; }
.hud-playerlist .pl-ms { min-width: 3.4em; text-align: right; font: 700 0.8em/1 var(--font-display); letter-spacing: .04em; color: var(--text-2); font-variant-numeric: tabular-nums; }
.hud-playerlist .pl-ping { display: inline-flex; align-items: flex-end; gap: 2px; height: 12px; }
.hud-playerlist .pl-ping i { width: 3px; background: rgba(255, 255, 255, 0.18); display: block; }
.hud-playerlist .pl-ping i:nth-child(1) { height: 25%; } .hud-playerlist .pl-ping i:nth-child(2) { height: 50%; } .hud-playerlist .pl-ping i:nth-child(3) { height: 75%; } .hud-playerlist .pl-ping i:nth-child(4) { height: 100%; }
.hud-playerlist .pl-ping i.on { background: var(--success); }
.hud-playerlist .pl-ping[data-level="2"] i.on, .hud-playerlist .pl-ping[data-level="1"] i.on { background: var(--warning); }

/* hidden mode restore (touch) — not during photo mode, which has its own bar */
.hud-unhide { position: absolute; top: calc(var(--safe-t, 0px) + 8px); right: calc(var(--safe-r, 0px) + 8px); width: 44px; height: 44px; border-radius: 50%; border: 1px solid rgba(255, 255, 255, 0.18); background: rgba(0, 0, 0, 0.32); color: rgba(255, 255, 255, 0.85); display: none; place-items: center; padding: 0; z-index: 40; }
.is-touch #ui.ui-hidden .hud-unhide { display: grid; touch-action: manipulation; }
.hud-unhide:active { transform: scale(0.94); background: rgba(255, 255, 255, 0.2); }
#ui:has(.scr-photo-root) .hud-unhide, #ui:has(.scr-type-photo) .hud-unhide { display: none !important; }

/* ---------------- onboarding: fallback card deck (the .scr-tut card of the 'tutorial' screen) + coach marks ---------------- */
.tut-deck { position: absolute; inset: 0; z-index: 70; display: flex; align-items: flex-end; justify-content: center; padding: 16px 16px calc(2.5rem + var(--safe-b, 0px));
  background: var(--scrim-game-strong); pointer-events: auto; animation: fadeIn var(--dur-2) var(--ease-out); }
.tut-deck.out { opacity: 0; transition: opacity var(--dur-2); }
.coach-layer { position: absolute; inset: 0; z-index: 65; pointer-events: none; }
.coach-dim { position: absolute; inset: 0; width: 100%; height: 100%; }
.coach-ring { position: absolute; border-radius: 14px; border: 2px solid var(--accent); animation: coachPulse 1.6s var(--ease-inout) infinite; }
.coach-bubble {
  position: absolute; max-width: min(17rem, 72vw); padding: 10px 14px; border-radius: var(--r-md); pointer-events: auto; cursor: pointer; text-align: left;
  display: flex; flex-direction: column; gap: 4px; color: var(--text-0); font: 500 14px/1.4 var(--font-ui); text-shadow: none;
  background: var(--surface-1); border: 1px solid var(--line-2); box-shadow: var(--elev-2), inset 3px 0 0 var(--accent); animation: popIn var(--dur-3) var(--ease-out);
}
.coach-bubble small { font-weight: 500; font-size: 12px; color: var(--text-3); }
@keyframes coachPulse { 0%, 100% { transform: scale(1); opacity: 1; } 50% { transform: scale(1.06); opacity: .65; } }

/* ---------------- small screens ---------------- */
@media (max-height: 430px) {
  .hud-top { width: min(42vw, calc(300px * var(--g))); }
  .hud-compass-canvas { height: calc(26px * var(--g)); }
  .is-touch .hud-compass-canvas { height: calc(24px * var(--g)); }
}
@media (orientation: portrait) {
  .hud-top { width: min(60vw, 340px); }
  /* the touch icons sit top-left in portrait: compass / boss bars between them and the minimap column, below the icons */
  .is-touch .hud-top {
    left: var(--hud-pad-l); right: calc(var(--hud-pad-r) + var(--mm-w) + 12px); width: auto; transform: none;
    top: max(var(--hud-top-c), var(--hud-top-l)); align-items: center;
  }
  .is-touch .hud-top > * { width: min(100%, 340px); }
  .is-touch .hud-topleft { max-width: calc(100vw - var(--mm-w) - 40px); }
  .is-touch .hud-top:has(.hud-compass:not([hidden])) ~ .hud-topleft { top: calc(max(var(--hud-top-c), var(--hud-top-l)) + 30px * var(--g)); }
  .is-touch .hud-chat { width: min(64vw, calc(100vw - var(--mm-w) - 44px)); }
  .is-touch .hud-toasts { left: var(--hud-pad-l); right: calc(var(--hud-pad-r) + var(--mm-w) + 12px); transform: none; }
  .is-touch .hud-toast { max-width: 100%; }
  .hud-thermo { right: auto; left: 0; bottom: calc(100% + 4px); }
}
@media (prefers-reduced-motion: reduce) {
  .hud *, .coach-bubble { animation: none !important; transition: none !important; }
  .coach-ring { animation: pulse 1.6s ease-in-out infinite !important; }
}
.reduce-motion .hud *, .reduce-motion .coach-bubble { animation: none !important; transition: none !important; }

/* ---------------- "Oynamak için tıkla" (desktop pointer-lock prompt, SPEC 10.12; markup: game/controls.js _showResume) ----------------
   A centred 28rem surface card over the game scrim (the 100vmax spread is the scrim: static, never animated). */
.resume-hint {
  position: fixed; left: 50%; top: 50%; z-index: 40; transform: translate(-50%, -50%);
  display: none; align-items: center; gap: 1rem; width: min(28rem, calc(100vw - 2rem)); box-sizing: border-box;
  padding: 1.125rem 1.5rem; border-radius: var(--r-md); background: var(--surface-1); border: 1px solid var(--line-2);
  color: var(--text-0); font-family: var(--font-ui); cursor: pointer; user-select: none; -webkit-user-select: none; pointer-events: auto;
  box-shadow: var(--elev-2), 0 0 0 100vmax var(--scrim-game);
  animation: fadeIn var(--dur-2) var(--ease-out);
}
.resume-hint.show { display: flex; }
.resume-hint .rh-ico { flex: none; display: grid; place-items: center; width: 2.75rem; height: 2.75rem; border-radius: var(--r-sm); background: var(--accent-soft); color: var(--amber-300); }
.resume-hint .rh-ico > svg { width: 1.5rem; height: 1.5rem; }
.resume-hint .rh-tx { display: grid; gap: .5rem; min-width: 0; }
.resume-hint .rh-title { font-size: var(--fs-lg); font-weight: 600; line-height: 1.25; }
.resume-hint .rh-keys { display: flex; flex-wrap: wrap; align-items: center; gap: .375rem .5rem; color: var(--text-2); font-size: var(--fs-sm); font-weight: 500; }
.resume-hint .rh-key { display: inline-flex; align-items: center; gap: .375rem; white-space: nowrap; }
.resume-hint .rh-sep { font-style: normal; color: var(--text-3); }
@media (hover: hover) and (pointer: fine) { .resume-hint:hover { border-color: var(--accent-line); } }
