/* In-game HUD. Load order: base, hud, menu, touch.

   Layout: two flex columns hug the left and right edges (economy, streak and
   squad over vitals; feed and perks over the gun), a centred stack at the top
   carries the wave card, room code and boss bar, and everything that points at
   the world (crosshair, prompts, markers) is positioned on its own.

   Every cluster is scaled by --hud-scale (the uu.hudScale setting) with the
   individual `scale` property, so it composes with any transform already in
   use. The crosshair and world markers are deliberately left unscaled.

   A few HUD selectors carry an extra #hud / body qualifier: menu.css (loaded
   after this file) still holds older rules for #coins, #bossbar, #shop and the
   damage numbers, and the qualifier is what lets these win without touching
   that file. */

#hud { font-family: var(--font-display); --hs: var(--hud-scale, 1); }
#hud .sr, #shop .sr {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); clip-path: inset(50%); white-space: pre;
}
.tnum, #hud b, #hp-num, #ammo-num, #wave-sub, #boss-pct { font-variant-numeric: tabular-nums; }

/* A coin, drawn in CSS so it needs no asset and scales crisply. */
.coin-ico {
  display: inline-block; flex: 0 0 auto; width: 16px; height: 16px; border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #fff3c4 0 12%, var(--gold) 34%, #c98a12 100%);
  box-shadow: inset 0 0 0 1.5px rgba(120,70,0,.55), 0 0 10px rgba(255,207,77,.45);
}

/* ---------- crosshair ---------- */
#crosshair { position: absolute; left: 50%; top: 50%; width: 0; height: 0; transition: opacity var(--t-fast); }
#crosshair i {
  position: absolute; background: #fff; display: block; border-radius: 1px;
  box-shadow: 0 0 0 1px rgba(0,0,0,.55), 0 0 4px rgba(0,0,0,.35);
  transition: transform 60ms linear, opacity var(--t-fast);
}
#crosshair .h { width: 2px; height: 10px; left: -1px; }
#crosshair .v { width: 10px; height: 2px; top: -1px; }
#ch-up    { transform: translateY(calc(-100% - var(--gap))); }
#ch-down  { transform: translateY(var(--gap)); }
#ch-left  { transform: translateX(calc(-100% - var(--gap))); }
#ch-right { transform: translateX(var(--gap)); }
#ch-dot { width: 2px; height: 2px; left: -1px; top: -1px; background: #fff; }
/* A wide cone softens the cross: "not accurate right now" at a glance. */
#crosshair.wide .h, #crosshair.wide .v { opacity: .62; }

/* ---------- hitmarker ---------- */
#hitmarker {
  position: absolute; left: 50%; top: 50%; width: 0; height: 0; opacity: 0;
  --hc: #fff;
}
#hitmarker span {
  position: absolute; left: -5px; top: -1px; width: 10px; height: 2px;
  background: var(--hc); border-radius: 1px;
  box-shadow: 0 0 0 1px rgba(0,0,0,.6);
}
#hitmarker span:nth-child(1) { transform: rotate(-135deg) translateX(9px); }
#hitmarker span:nth-child(2) { transform: rotate(-45deg)  translateX(9px); }
#hitmarker span:nth-child(3) { transform: rotate(135deg)  translateX(9px); }
#hitmarker span:nth-child(4) { transform: rotate(45deg)   translateX(9px); }
/* Headshot: gold. Kill: red, longer ticks and a ring that bursts outward. */
#hitmarker.head { --hc: var(--gold); }
#hitmarker.kill { --hc: var(--danger); }
#hitmarker.kill span { width: 13px; height: 3px; left: -6.5px; top: -1.5px; }
#hitmarker.kill span:nth-child(1) { transform: rotate(-135deg) translateX(11px); }
#hitmarker.kill span:nth-child(2) { transform: rotate(-45deg)  translateX(11px); }
#hitmarker.kill span:nth-child(3) { transform: rotate(135deg)  translateX(11px); }
#hitmarker.kill span:nth-child(4) { transform: rotate(45deg)   translateX(11px); }
#hitmarker.kill.head { --hc: #ffb02e; }
#hitmarker b {
  position: absolute; left: -16px; top: -16px; width: 32px; height: 32px;
  border-radius: 50%; border: 2px solid var(--hc); opacity: 0;
}
#hitmarker.killpop b { animation: hm-ring .34s var(--ease-out) forwards; }
@keyframes hm-ring {
  from { transform: scale(.45); opacity: 1; }
  to   { transform: scale(1.6); opacity: 0; }
}

/* ---------- directional damage ---------- */
/* Each arc is a ring segment around the crosshair, rotated by hud.js so its
   middle points at whoever hit us. */
#dmgdir { position: absolute; left: 50%; top: 50%; width: 0; height: 0; }
#dmgdir .dd {
  position: absolute; left: -104px; top: -104px; width: 208px; height: 208px;
  border-radius: 50%; will-change: transform, opacity;
  background: radial-gradient(closest-side, transparent 80%, rgba(255,60,44,.95) 88%, rgba(255,60,44,0) 100%);
  -webkit-mask: conic-gradient(from -28deg, #000 0deg 56deg, transparent 56deg);
  mask: conic-gradient(from -28deg, #000 0deg 56deg, transparent 56deg);
  filter: drop-shadow(0 0 6px rgba(255,40,30,.7));
}

/* ---------- screen-space feedback ---------- */
#damage {
  position: absolute; inset: 0; opacity: 0;
  background: radial-gradient(ellipse at center, transparent 42%, rgba(200,16,10,.55) 78%, rgba(150,0,0,.9) 100%);
  transition: opacity .18s;
}
#lowhp { position: absolute; inset: 0; opacity: 0; pointer-events: none; }
#lowhp i {
  position: absolute; inset: 0;
  background: radial-gradient(ellipse at center, transparent 48%, rgba(150,0,0,.55) 82%, rgba(90,0,0,.85) 100%);
}
/* A heartbeat in the vignette, so low health is felt in peripheral vision. */
#lowhp.on i { animation: lowbeat 1.05s ease-in-out infinite; }
@keyframes lowbeat { 0%, 100% { opacity: .65; } 14% { opacity: 1; } 28% { opacity: .7; } 42% { opacity: .95; } }
#healfx {
  position: absolute; inset: 0; opacity: 0; pointer-events: none;
  background: radial-gradient(ellipse at center, transparent 55%, rgba(60,230,120,.32) 100%);
  transition: opacity .4s var(--ease-out);
}

/* ---------- side columns ---------- */
.hud-col {
  position: absolute; top: calc(18px + env(safe-area-inset-top));
  height: calc((100% - 40px - env(safe-area-inset-top) - env(safe-area-inset-bottom)) / var(--hs));
  width: 320px;
  display: flex; flex-direction: column; gap: 10px;
  scale: var(--hs);
}
#hud-left  { left: calc(22px + env(safe-area-inset-left)); align-items: flex-start; transform-origin: top left; }
#hud-right { right: calc(22px + env(safe-area-inset-right)); align-items: flex-end; transform-origin: top right; }

/* Shared glass card for HUD clusters: dark, low-contrast edge, no blur (a
   backdrop-filter on HUD furniture would be paid every frame). */
#vitals, #ammo-box, #wave-card, #team, #ffa, #prompt, #revive, #travelhud {
  background: linear-gradient(180deg, rgba(14,18,24,.78), rgba(8,11,15,.7));
  border: 1px solid var(--line-strong);
  border-radius: var(--r-md);
  box-shadow: 0 10px 28px rgba(0,0,0,.35);
}

/* ---------- economy: coins and score ---------- */
#econ { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; }
.econ-row { position: relative; display: flex; align-items: center; gap: 8px; text-shadow: var(--shadow); }
#hud #coins {
  position: relative; top: auto; right: auto;
  padding: 5px 12px 5px 8px; border-radius: 999px;
  background: rgba(10,13,18,.72); border: 1px solid rgba(255,207,77,.32);
  box-shadow: 0 6px 18px rgba(0,0,0,.3);
  font-size: inherit; letter-spacing: normal; color: var(--text);
}
#hud #coins b { color: var(--gold); font: 800 26px/1 var(--font-display); letter-spacing: .02em; }
.econ-lbl { font: 600 11px/1 var(--font-ui); letter-spacing: .2em; color: var(--text-dim); }
/* Co-op: the pot belongs to the room, and the HUD says so. */
.econ-shared {
  display: none; font: 700 10px/1 var(--font-mono); letter-spacing: .1em;
  color: var(--info); padding: 3px 6px; border-radius: 4px;
  border: 1px solid rgba(92,200,255,.4); background: rgba(92,200,255,.1);
}
#hud.coop .econ-shared { display: inline-block; }
#hud #score { position: relative; padding-left: 4px; font-size: inherit; letter-spacing: normal; }
#hud #score b { color: var(--text); font: 700 20px/1 var(--font-display); letter-spacing: .04em; }
/* "+50" floats off a counter when it grows. */
.econ-pop {
  position: absolute; left: 100%; top: 50%; margin-left: 8px;
  font: 800 18px/1 var(--font-display); color: var(--gold);
  text-shadow: 0 0 10px rgba(255,207,77,.6), var(--shadow);
  opacity: 0; pointer-events: none; white-space: nowrap;
}
#score .econ-pop { color: var(--text); text-shadow: var(--shadow); font-size: 15px; }
.econ-pop.spend { color: var(--danger); text-shadow: var(--shadow); }
.econ-pop.go { animation: econpop .9s var(--ease-out) forwards; }
@keyframes econpop {
  0%   { opacity: 0; transform: translate(-6px, -50%) scale(.8); }
  18%  { opacity: 1; transform: translate(0, -60%) scale(1.08); }
  100% { opacity: 0; transform: translate(4px, -170%) scale(1); }
}
.bump { animation: bump .18s var(--ease-out); }
@keyframes bump { 40% { scale: 1.1; } }

/* ---------- kill streak ---------- */
#streak {
  opacity: 0; transform: translateX(-10px);
  transition: opacity .18s, transform .22s var(--ease-out);
  padding-left: 10px; border-left: 3px solid var(--sc, #fff);
}
#streak.on { opacity: 1; transform: none; }
#streak-top { display: flex; align-items: baseline; gap: 8px; }
#streak-count {
  font: 800 36px/.9 var(--font-display); color: var(--sc, #fff);
  text-shadow: 0 0 18px color-mix(in srgb, var(--sc, #fff) 55%, transparent), var(--shadow);
}
#streak-name {
  font: 700 14px/1 var(--font-display); letter-spacing: .24em;
  color: var(--sc, #fff); text-shadow: var(--shadow);
}
/* Decay meter -- drains over the 4s window so the pressure is legible. */
#streak-bar {
  margin-top: 6px; width: 150px; height: 4px; border-radius: 2px; overflow: hidden;
  background: rgba(255,255,255,.12);
}
#streak-fill { height: 100%; width: 100%; background: var(--sc, #fff); transform-origin: left; }
#streak.frozen #streak-fill { opacity: .45; }
#streak-buffs { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 6px; }
#streak-buffs span {
  font: 700 10px/1 var(--font-mono); letter-spacing: .06em; padding: 3px 5px; border-radius: 3px;
  color: var(--sc, #fff); background: color-mix(in srgb, var(--sc, #fff) 14%, transparent);
  border: 1px solid color-mix(in srgb, var(--sc, #fff) 40%, transparent);
}

/* ---------- co-op squad ---------- */
#team {
  min-width: 200px; padding: 8px 10px 9px; display: flex; flex-direction: column; gap: 7px;
  border-left: 3px solid var(--info);
}
.mate-top { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.mate-name {
  font: 700 14px/1 var(--font-display); letter-spacing: .08em; color: var(--text);
  max-width: 140px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.mate-state { font: 700 10px/1 var(--font-mono); letter-spacing: .08em; color: var(--danger); }
.mate-bar { margin-top: 4px; height: 4px; border-radius: 2px; overflow: hidden; background: rgba(255,255,255,.12); }
.mate-fill { height: 100%; background: var(--ok); transform-origin: left; transition: transform .2s; }
.mate.low .mate-fill { background: var(--warn); }
.mate.down .mate-name { color: #ff8a8a; }
.mate.down .mate-bar { background: rgba(255,77,77,.35); }
.mate.down { animation: matedown 1s ease-in-out infinite; }
@keyframes matedown { 50% { opacity: .55; } }
.mate.dead { opacity: .42; }

/* ---------- vitals ---------- */
#vitals {
  margin-top: auto; padding: 10px 14px 12px; min-width: 262px;
  display: flex; flex-direction: column; gap: 7px;
  --hpc: var(--ok);
}
#vitals[data-hp="mid"] { --hpc: var(--warn); }
#vitals[data-hp="low"] { --hpc: var(--danger); border-color: rgba(255,77,77,.5); }
#hp-row { display: flex; align-items: flex-end; gap: 6px; }
/* A medical cross, drawn with two gradients. */
.hp-ico {
  width: 18px; height: 18px; margin: 0 4px 5px 0; flex: 0 0 auto;
  background:
    linear-gradient(var(--hpc), var(--hpc)) center / 6px 100% no-repeat,
    linear-gradient(var(--hpc), var(--hpc)) center / 100% 6px no-repeat;
  filter: drop-shadow(0 0 6px color-mix(in srgb, var(--hpc) 60%, transparent));
}
#hp-num { font: 800 50px/.8 var(--font-display); color: var(--text); text-shadow: var(--shadow); transition: color .2s; }
#hp-max { font: 600 16px/1 var(--font-display); color: var(--text-faint); padding-bottom: 2px; }
#hp-label {
  margin-left: auto; padding-bottom: 3px;
  font: 600 11px/1 var(--font-ui); letter-spacing: .24em; color: var(--text-dim);
}
#vitals[data-hp="low"] #hp-num { color: var(--danger); animation: lowpulse .9s ease-in-out infinite; }
@keyframes lowpulse { 50% { opacity: .55; } }
#vitals.healed #hp-num { color: var(--ok); }
#hp-bar {
  position: relative; width: 262px; height: 12px; border-radius: 3px; overflow: hidden;
  background: rgba(0,0,0,.55); box-shadow: inset 0 0 0 1px rgba(255,255,255,.08);
}
#hp-fill, #hp-chip { position: absolute; inset: 0; transform-origin: left; }
#hp-fill {
  background: linear-gradient(180deg, color-mix(in srgb, var(--hpc) 70%, #fff), var(--hpc) 60%);
  transition: transform .12s linear, background .25s;
}
/* The chip trail: holds where health was, then drains to meet it. */
#hp-chip { background: #ffd9cf; opacity: .85; transition: transform .5s var(--ease-out) .35s; }
#hp-chip.instant { transition: none; }
#hp-segs {
  position: absolute; inset: 0; pointer-events: none;
  background: repeating-linear-gradient(90deg,
    transparent 0 calc(100% / var(--segs, 4) - 2px),
    rgba(6,8,11,.85) calc(100% / var(--segs, 4) - 2px) calc(100% / var(--segs, 4)));
}
#vitals.healed #hp-bar { box-shadow: inset 0 0 0 1px rgba(95,224,140,.6), 0 0 14px rgba(95,224,140,.55); }

/* ---------- infinity gauntlet ---------- */
#gauntlet { display: flex; align-items: center; gap: 10px; min-height: 14px; opacity: .55; }
#gauntlet.some { opacity: 1; }
#gems { display: flex; gap: 7px; }
.gem {
  width: 11px; height: 11px; transform: rotate(45deg); border-radius: 2px;
  background: rgba(255,255,255,.06);
  border: 1px solid rgba(255,255,255,.22);
  transition: background .2s, box-shadow .2s, border-color .2s;
}
.gem.on {
  background: radial-gradient(circle at 35% 35%, #fff, var(--c) 55%);
  border-color: rgba(255,255,255,.8);
  box-shadow: 0 0 8px var(--c), 0 0 16px var(--c);
}
#snap-hint { font: 700 11px/1 var(--font-display); letter-spacing: .2em; color: var(--accent); }
#snap-hint.ready {
  color: #fff;
  text-shadow: 0 0 10px #c04ae0, 0 0 20px #8b3fd4;
  animation: snappulse .9s ease-in-out infinite;
}
@keyframes snappulse { 50% { opacity: .45; } }

/* ---------- right column: feed and gun ---------- */
#feed { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; max-width: 360px; }
#feed .fi {
  position: relative; max-width: 100%;
  padding: 5px 10px 5px 12px; border-radius: 4px 0 0 4px;
  font: 700 13px/1.15 var(--font-display); letter-spacing: .08em; text-align: right;
  color: var(--c, var(--text));
  background: linear-gradient(90deg, rgba(8,11,15,0), rgba(8,11,15,.68) 22%);
  border-right: 2px solid var(--c, var(--text));
  text-shadow: 0 1px 2px rgba(0,0,0,.8);
  animation: feedin .2s var(--ease-out);
}
/* Kills get a small reticle, headshots a gold one. */
#feed .fi.kill, #feed .fi.hs { padding-left: 26px; }
#feed .fi.kill::before, #feed .fi.hs::before {
  content: ''; position: absolute; left: 9px; top: 50%; width: 9px; height: 9px; margin-top: -5.5px;
  border: 1.5px solid currentColor; border-radius: 50%;
  background: radial-gradient(circle, currentColor 0 1.5px, transparent 2px);
}
#feed .fi.hs::before { border-color: var(--gold); background: radial-gradient(circle, var(--gold) 0 1.5px, transparent 2px); }
@keyframes feedin { from { opacity: 0; transform: translateX(14px); } }

/* free-for-all scoreboard */
#ffa { min-width: 180px; padding: 8px 12px; text-align: right; }
#ffa-head { font: 600 10px/1 var(--font-mono); letter-spacing: .16em; color: var(--text-dim); margin-bottom: 6px; }
#ffa-head b { color: var(--accent); }
.ffa-row {
  display: flex; justify-content: space-between; gap: 14px;
  font: 600 14px/1.3 var(--font-display); letter-spacing: .06em; color: var(--text-dim);
}
/* You are always legible at a glance; everyone else is reference. */
.ffa-row.me { color: var(--accent); font-weight: 800; }
/* Dead players stay listed -- knowing who is about to come back matters. */
.ffa-row.dead { opacity: .45; }
.ffa-row .k { min-width: 22px; text-align: right; font-variant-numeric: tabular-nums; }

/* active potion perks (left column, under the squad) */
#effects { display: flex; flex-direction: column; gap: 6px; align-items: flex-start; width: 210px; }
#effects:empty { display: none; }
.fx {
  width: 100%; padding: 6px 9px 7px; text-align: left; border-radius: 0 6px 6px 0;
  background: linear-gradient(90deg, rgba(8,11,15,.8), rgba(8,11,15,.45));
  border-left: 3px solid var(--c);
}
.fx-top { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.fx-name { font: 800 13px/1 var(--font-display); letter-spacing: .12em; color: var(--c); text-shadow: var(--shadow); }
.fx-time { font: 700 11px/1 var(--font-mono); color: var(--text-dim); font-variant-numeric: tabular-nums; }
.fx-blurb { font: 500 10px/1.25 var(--font-ui); color: var(--text-dim); margin-top: 3px; }
.fx-bar { margin-top: 5px; height: 3px; border-radius: 2px; background: rgba(255,255,255,.12); overflow: hidden; }
.fx-fill { height: 100%; background: var(--c); transform-origin: left; }
.fx.expiring { animation: fxblink .5s steps(2) infinite; }
@keyframes fxblink { 50% { opacity: .45; } }

/* weapon slots: compact cards, the drawn one lit */
#weapons { margin-top: auto; display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
.wep {
  display: flex; align-items: center; gap: 8px; height: 26px; padding: 0 10px 0 4px;
  border-radius: 6px; border: 1px solid var(--line);
  background: rgba(8,11,15,.5);
  font: 700 13px/1 var(--font-display); letter-spacing: .1em; color: var(--text-dim);
  opacity: .72; transition: opacity var(--t-fast), background var(--t-fast), border-color var(--t-fast);
  --tc: transparent;
  box-shadow: inset -3px 0 0 var(--tc);
}
.wep .slot {
  display: inline-grid; place-items: center; min-width: 19px; height: 18px; padding: 0 4px;
  border-radius: 4px; border: 1px solid var(--line-strong); background: rgba(255,255,255,.07);
  font: 700 11px/1 var(--font-mono); color: var(--text);
}
.wep.tier-uncommon { --tc: #6fe08a; }
.wep.tier-rare { --tc: #4db6ff; }
.wep.tier-epic { --tc: #c084fc; }
.wep.tier-legendary { --tc: #ffd24a; }
.wep.active {
  opacity: 1; color: var(--text); height: 30px; font-size: 15px;
  border-color: rgba(255,107,44,.7);
  background: linear-gradient(90deg, rgba(255,107,44,.08), rgba(255,107,44,.3));
  box-shadow: inset -3px 0 0 var(--tc), 0 6px 16px rgba(0,0,0,.35);
}
.wep.active .slot { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }

/* ammo */
#ammo-box {
  min-width: 230px; padding: 10px 14px 10px;
  display: flex; flex-direction: column; align-items: flex-end; gap: 4px; text-align: right;
}
#ammo-name { font: 800 15px/1 var(--font-display); letter-spacing: .2em; color: var(--text); }
/* Weapon names carry their rarity's colour, so a box pull is recognisable at a
   glance without reading the feed. Kept in step with TIERS in weapons.js.
   Common stays the plain HUD colour on purpose: five glowing tiers would make
   the glow mean nothing, so only uncommon and up light up. */
#ammo-name.tier-common { color: var(--hud); opacity: .85; }
#ammo-name.tier-uncommon { color: #6fe08a; opacity: 1; }
#ammo-name.tier-rare {
  color: #4db6ff; opacity: 1;
  text-shadow: 0 0 7px rgba(77,182,255,.55), 0 2px 0 #000;
}
#ammo-name.tier-epic {
  color: #c084fc; opacity: 1;
  text-shadow: 0 0 8px rgba(192,132,252,.65), 0 2px 0 #000;
}
#ammo-name.tier-legendary {
  color: #ffd24a; opacity: 1;
  text-shadow: 0 0 8px rgba(255,210,74,.7), 0 2px 0 #000;
}
#ammo-num { font: 800 56px/.82 var(--font-display); color: var(--text); text-shadow: var(--shadow); }
#ammo-num small { font-size: 24px; font-weight: 600; color: var(--text-faint); }
#ammo-box[data-state="low"] #ammo-num { color: var(--warn); }
#ammo-num.empty,
#ammo-box[data-state="out"] #ammo-num { color: var(--danger); }
#ammo-box[data-state="empty"], #ammo-box[data-state="out"] { border-color: rgba(255,77,77,.55); }
#reload-bar {
  width: 100%; height: 4px; border-radius: 2px; overflow: hidden;
  background: rgba(255,255,255,.1); opacity: 0; transition: opacity var(--t-fast);
}
#reload-bar.on { opacity: 1; }
#reload-fill { height: 100%; background: var(--info); transform-origin: left; transform: scaleX(0); }
#reload-hint {
  min-height: 13px; font: 800 12px/1 var(--font-display); letter-spacing: .2em; color: var(--accent);
}
#ammo-box[data-state="reloading"] #reload-hint { color: var(--info); }
#ammo-box[data-state="out"] #reload-hint { color: var(--danger); }
#reload-hint.blink { animation: blink .7s steps(2, start) infinite; }
@keyframes blink { 50% { opacity: 0; } }

/* ---------- top centre: wave, room, boss ---------- */
#topbar {
  position: absolute; top: calc(16px + env(safe-area-inset-top)); left: 0; right: 0;
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  scale: var(--hs); transform-origin: top center;
}
#wave-card {
  position: relative; min-width: 210px; padding: 7px 20px 8px; text-align: center;
}
#wave-num { font: 800 22px/1 var(--font-display); letter-spacing: .18em; color: var(--text); }
#wave-sub {
  margin-top: 4px; font: 600 11px/1 var(--font-mono); letter-spacing: .12em; color: var(--text-dim);
}
#wave-sub.countdown { font: 800 28px/1 var(--font-display); letter-spacing: .06em; color: var(--gold); margin-top: 3px; }
#wave-card.urgent #wave-sub { color: var(--danger); animation: urgent .5s steps(2) infinite; }
@keyframes urgent { 50% { opacity: .55; } }
#wave-prog { margin-top: 7px; height: 3px; border-radius: 2px; overflow: hidden; background: rgba(255,255,255,.1); }
#wave-prog-fill { height: 100%; background: var(--accent); transform-origin: left; transform: scaleX(0); transition: transform .25s var(--ease-out); }
#wave-card[data-mode="break"] { border-color: rgba(255,207,77,.4); }
#wave-card[data-mode="break"] #wave-num { color: var(--gold); }
#wave-card[data-mode="break"] #wave-prog-fill { background: var(--gold); transition-duration: 1s; transition-timing-function: linear; }
/* Enemies still standing, as a badge on the card's corner. */
#wave-card[data-mode="fight"]:not([data-left=""])::after {
  content: attr(data-left) " LEFT";
  position: absolute; right: -10px; top: -9px;
  padding: 3px 6px; border-radius: 4px;
  font: 800 11px/1 var(--font-display); letter-spacing: .1em;
  color: #fff; background: var(--danger); box-shadow: 0 3px 10px rgba(0,0,0,.4);
}
#wave-card[data-left="0"]::after { background: var(--ok); color: #04140a; }

/* co-op room code: the one thing a host reads out to a friend, so it stays. */
#roomtag {
  display: none; align-items: center; gap: 8px;
  padding: 4px 10px; border-radius: 999px;
  background: rgba(10,13,18,.7); border: 1px solid rgba(92,200,255,.35);
}
#roomtag.on { display: flex; }
#roomtag-code {
  font: 700 13px/1 var(--font-mono); letter-spacing: .12em; color: var(--info);
  text-shadow: 0 0 10px rgba(92,200,255,.6);
}
#roomtag-players { font: 600 11px/1 var(--font-display); letter-spacing: .16em; color: var(--text-dim); }

/* boss bar: the boss's name, a phase-marked bar and a chip trail */
#hud #bossbar {
  position: relative; top: auto; left: auto; transform: none;
  width: min(620px, 70vw); text-align: left; pointer-events: none;
  animation: bossin .4s var(--ease-out);
}
@keyframes bossin { from { opacity: 0; transform: translateY(-8px) scaleX(.92); } }
#boss-head { display: flex; align-items: center; gap: 10px; margin-bottom: 6px; }
#boss-tag {
  font: 700 10px/1 var(--font-mono); letter-spacing: .16em; padding: 3px 6px; border-radius: 3px;
  color: #fff; background: rgba(255,77,77,.85);
}
#hud #boss-name {
  margin: 0; font: 800 20px/1 var(--font-display); letter-spacing: .2em; color: #fff;
  text-shadow: 0 0 14px rgba(255,77,77,.55), var(--shadow);
}
#boss-pct { margin-left: auto; font: 700 13px/1 var(--font-mono); color: var(--text-dim); text-shadow: var(--shadow); }
#hud #boss-track {
  position: relative; height: 14px; border-radius: 3px; overflow: hidden;
  background: rgba(0,0,0,.62); border: 1px solid rgba(255,100,90,.5);
  box-shadow: 0 0 18px rgba(255,60,50,.25);
}
#hud #boss-fill, #boss-chip { position: absolute; inset: 0; width: auto; height: auto; transform-origin: left; }
#boss-chip { background: #ffe3d6; opacity: .8; transition: transform .6s var(--ease-out) .3s; }
#hud #boss-fill {
  background: linear-gradient(180deg, rgba(255,255,255,.25), rgba(255,255,255,0) 55%), linear-gradient(90deg, #ff3b3b, #ff8a3d);
  transition: transform .12s linear;
}
#bossbar[data-phase="2"] #boss-fill { background: linear-gradient(180deg, rgba(255,255,255,.25), rgba(255,255,255,0) 55%), linear-gradient(90deg, #ff3b3b, #ff5d3b); }
#bossbar[data-phase="3"] #boss-fill { background: linear-gradient(180deg, rgba(255,255,255,.25), rgba(255,255,255,0) 55%), linear-gradient(90deg, #d6122a, #ff3b3b); animation: bosslow .6s ease-in-out infinite; }
@keyframes bosslow { 50% { filter: brightness(1.45); } }
#hud #boss-fill.enraged { background: linear-gradient(180deg, rgba(255,255,255,.25), rgba(255,255,255,0) 55%), linear-gradient(90deg, #9b2ee0, #ff4d4d); }
#bossbar.enraged #boss-tag { background: #9b2ee0; }
#bossbar.enraged #boss-tag::after { content: ' · ENRAGED'; }
.boss-tick { position: absolute; top: 0; bottom: 0; left: var(--at); width: 2px; background: rgba(0,0,0,.7); }

/* ---------- announcements ---------- */
#announce {
  position: absolute; left: 0; right: 0; top: 24%;
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  text-align: center; pointer-events: none; opacity: 0;
  scale: var(--hs); transform-origin: top center;
  --ac: var(--gold);
}
.an-main {
  display: block; padding: 6px 48px;
  font: 800 44px/1 var(--font-display); letter-spacing: .14em; color: var(--ac);
  text-shadow: 0 2px 0 rgba(0,0,0,.55), 0 0 26px color-mix(in srgb, var(--ac) 45%, transparent);
  background: linear-gradient(90deg, transparent, rgba(6,8,11,.55) 22%, rgba(6,8,11,.55) 78%, transparent);
}
#announce[data-kind="wave"] .an-main,
#announce[data-kind="boss"] .an-main { font-size: 64px; letter-spacing: .16em; padding: 8px 70px; }
#announce[data-kind="boss"] .an-main { color: #ff4d4d; }
.an-bonus {
  font: 800 24px/1 var(--font-display); letter-spacing: .06em; color: var(--gold);
  padding: 4px 14px; border-radius: 999px;
  background: rgba(255,207,77,.14); border: 1px solid rgba(255,207,77,.45);
  text-shadow: 0 0 12px rgba(255,207,77,.5);
}
#announce.go .an-main { animation: an-in .42s var(--ease-out); }
#announce.go[data-kind="wave"] .an-main,
#announce.go[data-kind="boss"] .an-main { animation: an-slam .55s var(--ease-out); }
#announce.go .an-bonus { animation: an-pop .5s var(--ease-out) .12s backwards; }
@keyframes an-in { from { opacity: 0; transform: scale(1.25); letter-spacing: .32em; } }
@keyframes an-slam {
  0%   { opacity: 0; transform: scale(1.7); filter: blur(6px); }
  60%  { opacity: 1; transform: scale(.97); filter: none; }
  100% { transform: none; }
}
@keyframes an-pop { from { opacity: 0; transform: translateY(8px) scale(.85); } }

/* ---------- interaction prompt ---------- */
/* A key-cap chip and the label. Hidden "PRESS " / " — " text keeps the
   element's content identical to the game's prompt string. */
#prompt {
  position: absolute; left: 0; right: 0; top: calc(50% + 62px);
  width: fit-content; max-width: min(92vw, 760px); margin: 0 auto;
  display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 6px 10px;
  padding: 8px 16px; border-radius: 999px;
  font: 700 15px/1.15 var(--font-display); letter-spacing: .14em; color: var(--text);
  text-shadow: 0 1px 2px rgba(0,0,0,.8);
  opacity: 0; transform: translateY(6px);
  transition: opacity var(--t-fast), transform var(--t-med) var(--ease-out);
  scale: var(--hs); transform-origin: top center;
}
#prompt.on { opacity: 1; transform: none; }
#prompt.keyed { padding-left: 7px; }
#prompt .kc {
  display: inline-grid; place-items: center; flex: 0 0 auto;
  min-width: 28px; height: 28px; padding: 0 8px; border-radius: 6px;
  font: 700 14px/1 var(--font-mono); letter-spacing: 0; color: #0b0e12; text-shadow: none;
  background: linear-gradient(180deg, #ffffff, #d5dbe1);
  box-shadow: 0 2px 0 #7d878f, 0 4px 10px rgba(0,0,0,.45);
}
#prompt .kc.wide { font-size: 12px; }
#prompt .pgap { font-size: 0; width: 1px; height: 20px; margin: 0 6px; background: var(--line-strong); }
#prompt .pp.price { color: var(--gold); }
#prompt .pp.price::before {
  content: ''; display: inline-block; width: 11px; height: 11px; margin: 0 4px 0 2px; vertical-align: -1px;
  border-radius: 50%; background: radial-gradient(circle at 35% 30%, #fff3c4 0 12%, var(--gold) 34%, #c98a12 100%);
}
#prompt .pp.price.short, #prompt .pp.need { color: var(--danger); }
#prompt .pp.free {
  color: var(--ok); padding: 1px 6px; border-radius: 4px;
  border: 1px solid rgba(95,224,140,.5); background: rgba(95,224,140,.1);
}
#prompt.rolling { color: var(--gold); letter-spacing: .3em; border-color: rgba(255,207,77,.5); }
#prompt.warn { color: var(--warn); border-color: rgba(255,176,32,.6); }

/* ---------- revive ---------- */
#revive {
  position: absolute; left: 0; right: 0; bottom: 24%;
  width: fit-content; min-width: 280px; margin: 0 auto;
  display: none; align-items: center; gap: 14px;
  padding: 9px 20px 9px 9px; border-radius: 999px; text-align: left;
  scale: var(--hs); transform-origin: bottom center;
  --rc: var(--ok);
}
#revive.on { display: flex; }
#revive.bleed { --rc: var(--danger); border-color: rgba(255,77,77,.5); }
.rv-ring { position: relative; width: 48px; height: 48px; flex: 0 0 auto; }
.rv-ring::before {
  content: ''; position: absolute; inset: 0; border-radius: 50%;
  background: conic-gradient(var(--rc) calc(var(--p, 0) * 1turn), rgba(255,255,255,.13) 0);
  -webkit-mask: radial-gradient(circle, transparent 56%, #000 58%);
  mask: radial-gradient(circle, transparent 56%, #000 58%);
}
.rv-core {
  position: absolute; inset: 15px;
  background:
    linear-gradient(var(--rc), var(--rc)) center / 6px 100% no-repeat,
    linear-gradient(var(--rc), var(--rc)) center / 100% 6px no-repeat;
}
#revive.bleed .rv-core { animation: lowpulse .8s ease-in-out infinite; }
.rv-title { font: 800 18px/1 var(--font-display); letter-spacing: .16em; color: var(--gold); }
#revive.bleed .rv-title { color: var(--danger); }
.rv-sub { margin-top: 5px; font: 600 11px/1 var(--font-mono); letter-spacing: .08em; color: var(--text-dim); }
/* The ring is the progress; the old bar stays in the markup, unused. */
#revive .rv-bar { display: none; }
#revive .rv-fill { transform-origin: left; }

/* ---------- travel / hazard readout ---------- */
#travelhud {
  position: fixed; left: 0; right: 0; bottom: calc(92px + env(safe-area-inset-bottom));
  width: fit-content; min-width: 300px; max-width: 92vw; margin: 0 auto;
  padding: 9px 18px 10px; text-align: center;
  display: flex; flex-direction: column; gap: 5px;
  opacity: 0; transform: translateY(8px);
  transition: opacity .2s, transform var(--t-med) var(--ease-out);
  pointer-events: none;
  scale: var(--hs); transform-origin: bottom center;
  --tc: #7de0ff;
  border-color: color-mix(in srgb, var(--tc) 55%, transparent);
  box-shadow: 0 0 22px color-mix(in srgb, var(--tc) 22%, transparent), 0 10px 28px rgba(0,0,0,.35);
}
#travelhud.on { opacity: 1; transform: none; }
#travelhud b {
  font: 800 17px/1 var(--font-display); letter-spacing: .2em; color: var(--tc);
  text-shadow: 0 0 12px color-mix(in srgb, var(--tc) 60%, transparent);
}
#travelhud span { font: 600 11px/1.3 var(--font-mono); letter-spacing: .08em; color: #b8cfdc; }
#travelhud.banana { --tc: #ffe04a; }
#travelhud.threat {
  --tc: #ff5a4d;
  background:
    repeating-linear-gradient(-45deg, rgba(255,90,77,.12) 0 10px, transparent 10px 20px),
    linear-gradient(180deg, rgba(30,8,8,.82), rgba(16,6,6,.76));
  animation: threat 1s ease-in-out infinite;
}
@keyframes threat { 50% { box-shadow: 0 0 34px rgba(255,90,77,.55), 0 10px 28px rgba(0,0,0,.35); } }

/* ---------- FPS counter (uu.showFps) ---------- */
#fps {
  position: absolute; left: 0; right: 0; bottom: calc(6px + env(safe-area-inset-bottom));
  width: fit-content; margin: 0 auto; padding: 2px 7px; border-radius: 4px;
  font: 700 11px/1.2 var(--font-mono); color: var(--ok); background: rgba(0,0,0,.5);
}
#fps[data-tier="mid"] { color: var(--warn); }
#fps[data-tier="low"] { color: var(--danger); }

/* ---------- floating damage numbers ---------- */
#dmgnums .dmgnum {
  font: 800 22px/1 var(--font-display); letter-spacing: .02em; color: #f4f7f9;
  -webkit-text-stroke: .5px rgba(0,0,0,.6);
  text-shadow: 0 2px 0 rgba(0,0,0,.55), 0 0 12px rgba(0,0,0,.55);
}
#dmgnums .dmgnum.headshot { color: var(--gold); font-size: 28px; text-shadow: 0 2px 0 rgba(0,0,0,.55), 0 0 14px rgba(255,207,77,.6); }
#dmgnums .dmgnum.weak { color: #ff9b30; font-size: 28px; }
#dmgnums .dmgnum.kill { color: #ff5c5c; font-size: 28px; }

/* ---------- sniper scope ---------- */
/* The black surround is a radial gradient in vh units so the aperture stays
   circular on any aspect ratio; the reticle lives in a clipped round box. */
#scope { position: absolute; inset: 0; opacity: 0; will-change: opacity; }
#scope .lens {
  position: absolute; inset: 0;
  background: radial-gradient(circle at 50% 50%,
    rgba(0,0,0,0) 0 30.5vh,
    rgba(0,0,0,.55) 30.6vh 31.4vh,
    rgba(0,0,0,.985) 32vh 100%);
}
#scope .optic {
  position: absolute; left: 50%; top: 50%;
  width: 61vh; height: 61vh; margin: -30.5vh 0 0 -30.5vh;
  border-radius: 50%; overflow: hidden;
  box-shadow: inset 0 0 3vh rgba(0,0,0,.35);
}
#scope .optic i { position: absolute; display: block; }
/* Reticle ink, near-black so it silhouettes against terrain. The aiming dot is
   excluded: it is the one mark that has to carry a colour, and a blanket
   `.optic i` rule outranks .rdot's own background and paints it black. */
#scope .optic i:not(.rdot) { background: rgba(9,11,13,.92); }

/* Lens glass: a faint cool tint plus darkening toward the rim, which is what
   sells "looking through an optic" rather than "a circle cut out of a mask".
   Every one of these veils costs contrast, and at 4.3x magnification contrast
   is the sight picture -- so the darkening is held out at the rim where it
   reads as a lens, and the middle two thirds of the aperture is left alone. */
#scope .glass {
  position: absolute; inset: 0; border-radius: 50%;
  background:
    radial-gradient(circle at 38% 30%, rgba(190,225,255,.05), rgba(190,225,255,0) 40%),
    radial-gradient(circle at 50% 50%, rgba(120,175,205,.025) 0 74%, rgba(0,12,22,.14) 91%, rgba(0,8,16,.42) 100%);
}
/* Off-axis glare streak across the top-left of the lens. Kept faint: a milky
   wash over a quarter of the glass is exactly what makes a target vanish. */
#scope .glare {
  position: absolute; left: 8%; top: 6%; width: 58%; height: 30%;
  border-radius: 50%; transform: rotate(-24deg);
  background: linear-gradient(105deg, rgba(255,255,255,.07), rgba(255,255,255,.01) 62%, transparent 78%);
  filter: blur(6px);
}
/* Inner rim shadow, so the aperture has depth. */
#scope .edge {
  position: absolute; inset: 0; border-radius: 50%;
  box-shadow: inset 0 0 2.4vh 0.6vh rgba(0,0,0,.5), inset 0 0 0 2px rgba(0,0,0,.85);
}

/* Duplex reticle: heavy posts from the rim that stop short of centre, with a
   fine crosshair between them. Draws the eye inward without hiding the target. */
#scope .post { background: rgba(8,10,12,.95); }
#scope .pl { left: 0;  top: 50%; width: 19vh; height: 4px; margin-top: -2px; }
#scope .pr { right: 0; top: 50%; width: 19vh; height: 4px; margin-top: -2px; }
#scope .pt { top: 0;    left: 50%; width: 4px; height: 19vh; margin-left: -2px; }
#scope .pb { bottom: 0; left: 50%; width: 4px; height: 19vh; margin-left: -2px; }

#scope .rv { left: 50%; top: 12%; width: 1.5px; height: 76%; margin-left: -0.75px; }
#scope .rh { top: 50%; left: 12%; height: 1.5px; width: 76%; margin-top: -0.75px; }

/* Mil-dots, drawn as one element repeated with box-shadow. */
#scope .milh {
  left: 50%; top: 50%; width: 3.5px; height: 3.5px; margin: -1.75px 0 0 -1.75px;
  border-radius: 50%; background: transparent;
  box-shadow:
    -4.6vh 0 0 rgba(8,10,12,.95),  -9.2vh 0 0 rgba(8,10,12,.95), -13.8vh 0 0 rgba(8,10,12,.95),
     4.6vh 0 0 rgba(8,10,12,.95),   9.2vh 0 0 rgba(8,10,12,.95),  13.8vh 0 0 rgba(8,10,12,.95);
}
#scope .milv {
  left: 50%; top: 50%; width: 3.5px; height: 3.5px; margin: -1.75px 0 0 -1.75px;
  border-radius: 50%; background: transparent;
  box-shadow:
    0 -4.6vh 0 rgba(8,10,12,.95), 0 -9.2vh 0 rgba(8,10,12,.95),
    0  4.6vh 0 rgba(8,10,12,.95), 0  9.2vh 0 rgba(8,10,12,.95), 0 13.8vh 0 rgba(8,10,12,.95);
}

/* The aiming point, and the only red thing in the sight. A hair larger than
   the mil-dots so it stays findable where the two stadia cross. */
#scope .rdot {
  left: 50%; top: 50%; width: 4.5px; height: 4.5px; margin: -2.25px 0 0 -2.25px;
  border-radius: 50%; background: #e0402f;
  box-shadow: 0 0 4px rgba(224,64,47,.9);
}

/* Holdover numbers beside the lower stadia. */
#scope .marks b {
  position: absolute; left: 50%; margin-left: 8px;
  font-size: 10px; font-weight: 400; color: rgba(12,14,16,.9);
  letter-spacing: .05em;
}
#scope .m1 { top: calc(50% + 4.6vh); transform: translateY(-50%); }
#scope .m2 { top: calc(50% + 9.2vh); transform: translateY(-50%); }
#scope .m3 { top: calc(50% + 13.8vh); transform: translateY(-50%); }

/* Machined bezel ring around the aperture. */
#scope .bezel {
  position: absolute; left: 50%; top: 50%;
  width: 65vh; height: 65vh; margin: -32.5vh 0 0 -32.5vh;
  border-radius: 50%; pointer-events: none;
  background: conic-gradient(from 210deg,
    #2c3238, #6d7780 12%, #3a4148 26%, #838d96 42%,
    #2a3036 58%, #5c666f 74%, #333940 88%, #2c3238);
  -webkit-mask: radial-gradient(circle at 50% 50%, transparent 0 30.6vh, #000 30.7vh 32.4vh, transparent 32.5vh);
  mask: radial-gradient(circle at 50% 50%, transparent 0 30.6vh, #000 30.7vh 32.4vh, transparent 32.5vh);
}

/* ---------- bazooka aim sight ---------- */
/* An open ranging sight, not a scope: the surround only darkens the edges of
   the view instead of masking it, because a launcher is aimed with peripheral
   vision. Sized in vh so the ladder keeps its proportions on any aspect. */
#bsight { position: absolute; inset: 0; opacity: 0; will-change: opacity; }
#bsight .vig {
  position: absolute; inset: 0;
  background: radial-gradient(ellipse 68% 62% at 50% 50%,
    rgba(0,0,0,0) 55%, rgba(0,0,0,.42) 82%, rgba(0,0,0,.72) 100%);
}
/* Faintly tinted window, matching the launcher's optic glass. */
#bsight .pane {
  position: absolute; left: 50%; top: 50%;
  width: 44vh; height: 32vh; margin: -16vh 0 0 -22vh;
  background:
    linear-gradient(118deg, rgba(255,255,255,.07) 0 24%, rgba(255,255,255,0) 46%),
    radial-gradient(ellipse at 50% 50%, rgba(120,190,205,.05) 0 60%, rgba(0,14,18,.26) 100%);
}
/* Corner brackets, which is what reads as "sight housing" without boxing the
   view in with a full frame. */
#bsight .br {
  position: absolute; width: 3.4vh; height: 3.4vh;
  border: 3px solid rgba(232,214,150,.8);
}
#bsight .b1 { left: 50%; top: 50%; margin: -16vh 0 0 -22vh; border-right: 0; border-bottom: 0; }
#bsight .b2 { left: 50%; top: 50%; margin: -16vh 0 0 calc(22vh - 3.4vh); border-left: 0; border-bottom: 0; }
#bsight .b3 { left: 50%; top: 50%; margin: calc(16vh - 3.4vh) 0 0 -22vh; border-right: 0; border-top: 0; }
#bsight .b4 { left: 50%; top: 50%; margin: calc(16vh - 3.4vh) 0 0 calc(22vh - 3.4vh); border-left: 0; border-top: 0; }

#bsight i, #bsight b {
  position: absolute; display: block;
  filter: drop-shadow(0 0 2px rgba(0,0,0,.9));
}
/* Centre chevron: the aim point. Open at the bottom so the target stays
   visible through it, unlike a solid dot at this size. */
#bsight .chev {
  left: 50%; top: 50%; width: 2.6vh; height: 2.6vh;
  /* Rotating a top+left border corner by 45deg swings its vertex straight up;
     the offset margin drops the box so that vertex lands on the exact centre,
     which is the aim point. */
  margin: 0.54vh 0 0 -1.3vh;
  border-left: 3px solid #ffd24a; border-top: 3px solid #ffd24a;
  transform: rotate(45deg); transform-origin: 50% 50%;
  background: transparent;
}
#bsight .cdot {
  left: 50%; top: 50%; width: 3px; height: 3px; margin: -1.5px 0 0 -1.5px;
  border-radius: 50%; background: #ff5a3c;
}
/* Horizontal wings, stopping short of centre. */
#bsight .wl, #bsight .wr {
  top: 50%; height: 3px; width: 7.5vh; margin-top: -1.5px;
  background: rgba(255,210,74,.9);
}
#bsight .wl { left: 50%; margin-left: -15vh; }
#bsight .wr { left: 50%; margin-left: 7.5vh; }

/* Ranging ladder: holdover steps below the aim point, since a rocket drops.
   Spacing is tuned so the whole ladder falls inside the model's sight window
   -- both scale with viewport height, so the fit holds at any size. */
#bsight .lad {
  left: 50%; top: 50%; width: 2px; height: 8.4vh; margin: 0 0 0 -1px;
  background: linear-gradient(rgba(255,210,74,.85), rgba(255,210,74,.35));
}
#bsight .rung {
  left: 50%; height: 2px; background: rgba(255,210,74,.85);
}
#bsight .r1 { top: calc(50% + 3vh);   width: 4.6vh; margin-left: -2.3vh; }
#bsight .r2 { top: calc(50% + 5.6vh); width: 3.6vh; margin-left: -1.8vh; }
#bsight .r3 { top: calc(50% + 8vh);   width: 2.6vh; margin-left: -1.3vh; }
#bsight .marks b {
  left: 50%; font-size: 10px; font-weight: 400; letter-spacing: .08em;
  color: rgba(255,222,130,.9); text-shadow: 0 0 3px #000;
}
#bsight .n1 { top: calc(50% + 3vh);   margin: -6px 0 0 2.9vh; }
#bsight .n2 { top: calc(50% + 5.6vh); margin: -6px 0 0 2.4vh; }
#bsight .n3 { top: calc(50% + 8vh);   margin: -6px 0 0 1.9vh; }

/* ---------- projected sights: holo / red dot / laser / thermal ---------- */
/* These are reticles floating on glass, not scopes, so none of them mask the
   view. They read as "cool optic" purely through reticle shape and colour,
   which is also what keeps them cheap: a handful of divs each. */
.psight { position: absolute; inset: 0; opacity: 0; will-change: opacity; }
.psight i, .psight b {
  position: absolute; display: block;
  filter: drop-shadow(0 0 3px rgba(0,0,0,.85));
}
/* Every projected reticle glows; the colour is the weapon's identity. */
.psight .ring {
  left: 50%; top: 50%; border-radius: 50%;
  border: 2px solid var(--rc); background: transparent;
  box-shadow: 0 0 6px var(--rc), inset 0 0 6px var(--rc);
}
.psight .dot {
  left: 50%; top: 50%; border-radius: 50%; background: var(--rc);
  box-shadow: 0 0 6px var(--rc), 0 0 14px var(--rc);
}
.psight .tick { left: 50%; top: 50%; background: var(--rc); box-shadow: 0 0 5px var(--rc); }

/* ---- holographic: big broken circle, centre dot, wing ticks ---- */
#holo { --rc: #6fe08a; }
#holo.cyan { --rc: #63dcff; }
/* The gap in the ring is what makes a holo sight read as a holo sight. */
#holo .ring {
  width: 15vh; height: 15vh; margin: -7.5vh 0 0 -7.5vh;
  border-color: var(--rc) transparent var(--rc) transparent;
  border-width: 2px;
}
#holo .ring2 {
  width: 15vh; height: 15vh; margin: -7.5vh 0 0 -7.5vh;
  border-color: transparent var(--rc) transparent var(--rc);
  border-width: 2px; opacity: .45;
}
#holo .dot { width: 5px; height: 5px; margin: -2.5px 0 0 -2.5px; }
/* Ticks at the ring's edge, pointing in. */
#holo .t1 { width: 2px; height: 2.2vh; margin: -9.9vh 0 0 -1px; }
#holo .t2 { width: 2px; height: 2.2vh; margin: 7.7vh 0 0 -1px; }
#holo .t3 { width: 2.2vh; height: 2px; margin: -1px 0 0 -9.9vh; }
#holo .t4 { width: 2.2vh; height: 2px; margin: -1px 0 0 7.7vh; }
/* Faint green wash, so the glass reads as coated. */
#holo .wash {
  position: absolute; left: 50%; top: 50%;
  width: 30vh; height: 22vh; margin: -11vh 0 0 -15vh;
  background: radial-gradient(ellipse at 50% 50%,
    color-mix(in srgb, var(--rc) 9%, transparent) 0 42%, transparent 78%);
}

/* ---- red dot: tight tube, single crisp dot ---- */
#reddot { --rc: #ff4436; }
/* Soft vignette standing in for the tube walls -- much lighter than the
   sniper's mask, because a red dot is a see-through optic. */
#reddot .tube {
  position: absolute; inset: 0;
  background: radial-gradient(circle at 50% 50%,
    rgba(0,0,0,0) 0 17vh, rgba(0,0,0,.34) 23vh, rgba(0,0,0,.62) 30vh, rgba(0,0,0,.75) 100%);
}
#reddot .ring {
  width: 34vh; height: 34vh; margin: -17vh 0 0 -17vh;
  border: 2px solid rgba(232,195,87,.55);   /* gold tube rim, matching the gun */
  box-shadow: 0 0 10px rgba(0,0,0,.8);
}
#reddot .dot { width: 7px; height: 7px; margin: -3.5px 0 0 -3.5px; }
#reddot .halo {
  left: 50%; top: 50%; width: 20px; height: 20px; margin: -10px 0 0 -10px;
  border-radius: 50%; background: radial-gradient(circle, rgba(255,68,54,.4), transparent 70%);
}

/* ---- laser: no optic at all, just the projected dot plus a jitter halo ---- */
#laserdot { --rc: #ff3b28; }
#laserdot .dot { width: 6px; height: 6px; margin: -3px 0 0 -3px; }
/* Bloom around the dot, animated so it reads as a live emitter rather than a
   painted-on crosshair. */
#laserdot .halo {
  left: 50%; top: 50%; width: 26px; height: 26px; margin: -13px 0 0 -13px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255,59,40,.5), rgba(255,59,40,.12) 45%, transparent 72%);
  animation: laserpulse .9s ease-in-out infinite;
}
@keyframes laserpulse { 50% { transform: scale(1.35); opacity: .7; } }
/* Faint beam haze up the middle, as if the emitter is cutting through dust. */
#laserdot .beam {
  left: 50%; top: 50%; width: 2px; height: 26vh; margin: 0 0 0 -1px;
  background: linear-gradient(rgba(255,59,40,.22), transparent);
}

/* ---- thermal: green digital screen, boxed frame, range readout ---- */
#thermal { --rc: #b8ffb0; }
/* Tints the whole view: a thermal optic replaces what you see, and that
   wholesale change of image is the point of carrying one.
   A green film laid over a colour photograph is the wrong way round, and it is
   what made this sight useless: a green zombie in green foliage under a green
   wash has nothing left to separate it. Desaturating the backdrop first turns
   the same green into a sensor readout, and targets then separate on
   brightness -- which survives the tint -- instead of on hue, which does not.
   The vignette is held out past 38vh so the whole reticle frame, corner
   brackets included, sits in clear picture. */
#thermal .screen {
  position: absolute; inset: 0;
  backdrop-filter: grayscale(.9) contrast(1.18) brightness(1.06);
  -webkit-backdrop-filter: grayscale(.9) contrast(1.18) brightness(1.06);
  background:
    radial-gradient(circle at 50% 50%, rgba(0,0,0,0) 0 38vh, rgba(2,10,4,.42) 52vh, rgba(1,6,2,.9) 66vh),
    linear-gradient(rgba(60,255,120,.13), rgba(60,255,120,.13));
  mix-blend-mode: normal;
}
/* Scanlines. Cheap, and they do most of the "digital" work -- but at 3x they
   are drawn across the target too, so they stay light enough to read through. */
#thermal .scan {
  position: absolute; inset: 0;
  background: repeating-linear-gradient(
    rgba(0,0,0,0) 0 3px, rgba(0,40,10,.16) 3px 4px);
}
#thermal .frame {
  position: absolute; left: 50%; top: 50%;
  width: 52vh; height: 52vh; margin: -26vh 0 0 -26vh;
  border: 2px solid rgba(150,255,150,.35);
}
/* Corner brackets inside the frame. */
#thermal .cbr {
  position: absolute; width: 3vh; height: 3vh;
  border: 2px solid rgba(180,255,180,.8);
}
#thermal .c1 { left: 50%; top: 50%; margin: -24vh 0 0 -24vh; border-right: 0; border-bottom: 0; }
#thermal .c2 { left: 50%; top: 50%; margin: -24vh 0 0 calc(24vh - 3vh); border-left: 0; border-bottom: 0; }
#thermal .c3 { left: 50%; top: 50%; margin: calc(24vh - 3vh) 0 0 -24vh; border-right: 0; border-top: 0; }
#thermal .c4 { left: 50%; top: 50%; margin: calc(24vh - 3vh) 0 0 calc(24vh - 3vh); border-left: 0; border-top: 0; }
/* Fine crosshair with a gap, plus a centre pip. */
#thermal .t1 { width: 2px; height: 9vh; margin: -13vh 0 0 -1px; }
#thermal .t2 { width: 2px; height: 9vh; margin: 4vh 0 0 -1px; }
#thermal .t3 { width: 9vh; height: 2px; margin: -1px 0 0 -13vh; }
#thermal .t4 { width: 9vh; height: 2px; margin: -1px 0 0 4vh; }
#thermal .dot { width: 4px; height: 4px; margin: -2px 0 0 -2px; }
#thermal .ring { width: 6vh; height: 6vh; margin: -3vh 0 0 -3vh; border-width: 1px; opacity: .5; }
/* Readout text, bottom-left of the frame. */
#thermal .hud {
  position: absolute; left: 50%; top: 50%;
  margin: calc(24vh - 3.4vh) 0 0 -21vh;
  font-size: 10px; letter-spacing: .16em; line-height: 1.5;
  color: rgba(190,255,190,.9); text-shadow: 0 0 4px rgba(60,255,120,.6);
}
#thermal .hud2 {
  position: absolute; left: 50%; top: 50%;
  margin: -24vh 0 0 calc(21vh - 6ch);
  font-size: 10px; letter-spacing: .16em;
  color: rgba(190,255,190,.9); text-shadow: 0 0 4px rgba(60,255,120,.6);
}


/* ---------- world markers ---------- */
/* last-few-enemies tracker */
#trackers { position: absolute; inset: 0; }
.trk {
  position: absolute; left: 0; top: 0; will-change: transform;
  transform-origin: center; margin: -14px 0 0 -14px;
  width: 28px; height: 28px;
}
.trk .arrow {
  position: absolute; inset: 0;
  width: 0; height: 0; margin: 4px auto 0;
  border-left: 9px solid transparent;
  border-right: 9px solid transparent;
  border-bottom: 14px solid var(--danger);
  filter: drop-shadow(0 0 4px rgba(255,77,77,.6)) drop-shadow(0 0 2px rgba(0,0,0,.9));
}
.trk .dist {
  position: absolute; top: 20px; left: 50%; transform: translateX(-50%);
  font: 700 11px/1 var(--font-display); letter-spacing: .08em; color: #fff;
  text-shadow: 0 0 4px #000, 0 1px 0 #000; white-space: nowrap;
}
.trk.edge .dist { display: none; }
.trk.onscreen .arrow { border-bottom-color: var(--accent); opacity: .95; filter: drop-shadow(0 0 4px rgba(255,107,44,.6)) drop-shadow(0 0 2px rgba(0,0,0,.9)); }

/* Downed teammates. Urgent, so unlike the chest markers these keep an edge
   arrow when the teammate is off-screen: a partner bleeding out behind you is
   exactly the case where a marker has to work without line of sight. */
#downmarks { position: absolute; inset: 0; }
.dmk {
  position: absolute; left: 0; top: 0; will-change: transform;
  margin: -16px 0 0 -16px; width: 32px; height: 32px;
}
.dmk .ico {
  position: absolute; inset: 3px; border-radius: 50%;
  border: 2px solid #ff4d4d; background: rgba(255,77,77,.28);
  box-shadow: 0 0 12px rgba(255,77,77,.9), 0 0 3px rgba(0,0,0,.9);
  animation: dmkpulse .8s ease-in-out infinite;
}
.dmk .ico::after {
  content: ''; position: absolute; inset: 6px;
  background:
    linear-gradient(#fff, #fff) center / 4px 100% no-repeat,
    linear-gradient(#fff, #fff) center / 100% 4px no-repeat;
}
.dmk::before {
  content: ''; position: absolute; inset: -6px; border-radius: 50%;
  border: 2px solid rgba(255,77,77,.6); animation: dmkring 1.2s ease-out infinite;
}
@keyframes dmkpulse { 50% { transform: scale(1.12); opacity: .7; } }
@keyframes dmkring { from { transform: scale(.6); opacity: 1; } to { transform: scale(1.5); opacity: 0; } }
.dmk .txt {
  position: absolute; top: 36px; left: 50%; transform: translateX(-50%);
  padding: 3px 7px; border-radius: 4px; background: rgba(40,6,6,.75);
  font: 800 12px/1 var(--font-display); letter-spacing: .1em;
  color: #ffb3b3; white-space: nowrap;
}

/* Nearby chest markers. Understated next to the enemy trackers: a chest is an
   opportunity, not a threat, and it must never pull the eye in a firefight. */
#chestmarks { position: absolute; inset: 0; }
.cmk {
  position: absolute; left: 0; top: 0; will-change: transform;
  margin: -12px 0 0 -12px; width: 24px; height: 24px; opacity: .95;
}
.cmk .box {
  position: absolute; left: 5px; top: 5px; width: 14px; height: 14px;
  transform: rotate(45deg); border-radius: 2px;
  background: linear-gradient(135deg, #fff1c2, var(--gold) 60%, #c98a12);
  box-shadow: 0 0 10px rgba(255,207,77,.85), 0 0 0 1px rgba(60,35,0,.6);
}
.cmk .d {
  position: absolute; top: 25px; left: 50%; transform: translateX(-50%);
  font: 700 11px/1 var(--font-display); letter-spacing: .1em;
  color: #ffe6a0; white-space: nowrap;
  text-shadow: 0 0 5px #000, 0 1px 0 #000;
}

/* Treasure-map waypoint. Same projection as the enemy tracker, but it
   persists until the stone the map revealed has been collected. */
#waypoint {
  position: absolute; left: 0; top: 0; display: none;
  will-change: transform; margin: -16px 0 0 -16px;
  width: 32px; height: 32px;
}
#wp-arrow {
  position: absolute; inset: 0;
  width: 0; height: 0; margin: 3px auto 0;
  border-left: 10px solid transparent;
  border-right: 10px solid transparent;
  border-bottom: 16px solid var(--c, #fff);
  filter: drop-shadow(0 0 7px var(--c, #fff)) drop-shadow(0 0 2px rgba(0,0,0,.9));
  animation: wppulse 1.1s ease-in-out infinite;
}
@keyframes wppulse { 50% { opacity: .45; } }
#wp-label {
  position: absolute; top: 26px; left: 50%; transform: translateX(-50%);
  padding: 3px 7px; border-radius: 4px; background: rgba(6,8,11,.7);
  border: 1px solid color-mix(in srgb, var(--c, #fff) 50%, transparent);
  font: 700 11px/1 var(--font-display); letter-spacing: .12em; color: #fff; white-space: nowrap;
}
#waypoint.edge #wp-label { display: none; }

/* ---------- between-wave ARMOURY ---------- */
/* Lives outside #hud (and #overlay) so the world stays visible behind it.
   `body #shop` / `#shop .x` outrank the older rules still in menu.css. */
body #shop {
  position: fixed; inset: 0; z-index: 40;
  display: flex; align-items: center; justify-content: center;
  padding: calc(16px + env(safe-area-inset-top)) calc(16px + env(safe-area-inset-right))
           calc(16px + env(safe-area-inset-bottom)) calc(16px + env(safe-area-inset-left));
  background: radial-gradient(ellipse at center, rgba(4,7,10,.45), rgba(4,7,10,.82));
  backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px);
  font-family: var(--font-ui);
}
body #shop.hidden { display: none; }
#shop .shop-panel {
  position: relative; width: min(880px, 100%); max-height: 100%; overflow-y: auto;
  padding: 20px 22px 0; border-radius: var(--r-lg);
  background: var(--glass-strong); border: 1px solid var(--line-strong);
  box-shadow: var(--shadow-panel);
  animation: shopin .22s var(--ease-out);
}
@keyframes shopin { from { opacity: 0; transform: translateY(10px) scale(.98); } }
#shop .shop-head {
  display: grid; grid-template-columns: 1fr auto auto; align-items: start; gap: 16px;
  padding-bottom: 14px; margin-bottom: 12px; border-bottom: 1px solid var(--line);
}
#shop .shop-title {
  font: 800 36px/1 var(--font-display); letter-spacing: .12em; color: var(--text);
}
#shop .shop-title::after {
  content: ''; display: block; width: 46px; height: 3px; margin-top: 8px; border-radius: 2px; background: var(--accent);
}
#shop .shop-sub { margin-top: 8px; font: 600 12px/1.3 var(--font-ui); letter-spacing: .12em; color: var(--text-dim); }
#shop .shop-sub b { color: var(--accent); font-weight: 700; }
#shop .shop-right { display: flex; flex-direction: column; align-items: flex-end; gap: 7px; text-align: right; }
#shop .shop-coinbox {
  display: flex; align-items: center; gap: 8px;
  font: 600 11px/1 var(--font-ui); letter-spacing: .2em; color: var(--text-dim);
}
#shop .shop-coinbox .coin-ico { width: 20px; height: 20px; }
#shop .shop-coinbox b { font: 800 34px/1 var(--font-display); color: var(--gold); letter-spacing: .02em; font-variant-numeric: tabular-nums; }
#shop-pot {
  display: none; font: 700 10px/1 var(--font-mono); letter-spacing: .1em; color: var(--info);
  padding: 3px 7px; border-radius: 4px; border: 1px solid rgba(92,200,255,.4); background: rgba(92,200,255,.1);
}
#shop.coop #shop-pot { display: inline-block; }
#shop #shop-timer {
  margin: 0; padding: 5px 10px; border-radius: 999px;
  font: 700 11px/1.2 var(--font-mono); letter-spacing: .06em; color: var(--gold);
  background: rgba(255,207,77,.1); border: 1px solid rgba(255,207,77,.32);
  max-width: 300px;
}
#shop .shop-x {
  display: grid; place-items: center; width: 40px; height: 40px; border-radius: 10px;
  font: 400 26px/1 var(--font-ui); color: var(--text-dim);
  background: rgba(255,255,255,.05); border: 1px solid var(--line-strong); cursor: pointer;
  transition: background var(--t-fast), color var(--t-fast), border-color var(--t-fast);
}
#shop .shop-x:hover { color: var(--text); background: rgba(255,255,255,.1); }
#shop .shop-x:focus-visible, #shop .shop-item:focus-visible, #shop #shop-close:focus-visible {
  outline: 2px solid var(--accent); outline-offset: 2px;
}

/* What you already have: the drawn gun's upgrade levels and your vitality. */
#shop-owned { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-bottom: 12px; }
#shop-owned:empty { display: none; }
#shop-owned .own-lbl { font: 700 10px/1 var(--font-mono); letter-spacing: .14em; color: var(--text-faint); margin-right: 2px; }
#shop-owned .own {
  padding: 4px 8px; border-radius: 4px; border: 1px solid var(--line-strong); background: rgba(255,255,255,.04);
  font: 700 12px/1 var(--font-display); letter-spacing: .1em; color: var(--text-dim);
}
#shop-owned .own b { color: var(--text); }

/* Catalogue cards */
#shop #shop-items {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 10px; margin-bottom: 16px;
}
#shop .shop-item {
  position: relative; display: flex; flex-direction: column; align-items: stretch; gap: 6px;
  min-height: 132px; padding: 13px 14px 12px; text-align: left;
  border-radius: var(--r-md); border: 1px solid var(--line-strong);
  background: linear-gradient(180deg, rgba(255,255,255,.065), rgba(255,255,255,.02));
  color: var(--text); font: inherit; cursor: pointer;
  transition: transform var(--t-fast) var(--ease-out), border-color var(--t-fast), background var(--t-fast), box-shadow var(--t-fast);
  --kc: var(--accent);
}
#shop .shop-item:hover {
  transform: translateY(-2px); border-color: var(--kc);
  background: linear-gradient(180deg, color-mix(in srgb, var(--kc) 18%, transparent), rgba(255,255,255,.02));
  box-shadow: 0 10px 24px rgba(0,0,0,.35);
}
#shop .shop-item:active { transform: translateY(0) scale(.985); }
#shop .shop-item[data-cat="supply"] { --kc: var(--ok); }
#shop .shop-item[data-cat="perk"] { --kc: #c084fc; }
#shop .shop-item[data-cat="upgrade"], #shop .shop-item[data-cat="gun"] { --kc: var(--accent); }
#shop .shop-item[data-cat="weapon"] { --kc: var(--gold); }
#shop .si-cat {
  display: flex; align-items: center; gap: 6px;
  font: 700 10px/1 var(--font-mono); letter-spacing: .14em; color: var(--kc);
}
#shop .si-cat::before { content: ''; width: 6px; height: 6px; border-radius: 1px; background: var(--kc); transform: rotate(45deg); }
#shop .si-name { font: 800 21px/1.05 var(--font-display); letter-spacing: .08em; color: var(--text); }
#shop .si-pips { display: flex; gap: 3px; }
#shop .si-pips i { width: 16px; height: 4px; border-radius: 2px; background: rgba(255,255,255,.15); }
#shop .si-pips i.on { background: var(--kc); box-shadow: 0 0 6px color-mix(in srgb, var(--kc) 60%, transparent); }
#shop .si-blurb { font: 500 12.5px/1.35 var(--font-ui); letter-spacing: 0; color: var(--text-dim); margin: 0; }
#shop .si-foot { margin-top: auto; display: flex; align-items: center; justify-content: space-between; gap: 10px; padding-top: 6px; }
#shop .si-cost {
  display: flex; align-items: center; gap: 6px;
  font: 800 24px/1 var(--font-display); color: var(--gold); font-variant-numeric: tabular-nums;
}
#shop .si-need { font: 700 10px/1 var(--font-mono); letter-spacing: .06em; color: var(--danger); }
#shop .si-buy {
  font: 800 12px/1 var(--font-display); letter-spacing: .16em; padding: 6px 10px; border-radius: 6px;
  color: var(--accent-ink); background: var(--kc);
}
/* Priced out rather than hidden: seeing what you cannot afford yet is half
   the reason to keep a wave alive. */
#shop .shop-item.unaffordable { cursor: not-allowed; opacity: .62; }
#shop .shop-item.unaffordable:hover { transform: none; border-color: rgba(255,77,77,.4); background: linear-gradient(180deg, rgba(255,255,255,.065), rgba(255,255,255,.02)); box-shadow: none; }
#shop .shop-item.unaffordable .si-cost { color: color-mix(in srgb, var(--gold) 55%, var(--danger)); }
#shop .shop-item.unaffordable .si-buy { display: none; }
#shop .shop-item:not(.unaffordable) .si-need { display: none; }
/* Maxed / owned: shown, so the card says what you have, but not buyable. */
#shop .shop-item:disabled { cursor: default; opacity: .5; transform: none; box-shadow: none; }
#shop .shop-item:disabled:hover { border-color: var(--line-strong); background: linear-gradient(180deg, rgba(255,255,255,.065), rgba(255,255,255,.02)); }
#shop .si-done {
  font: 800 13px/1 var(--font-display); letter-spacing: .18em; color: var(--ok);
  padding: 5px 8px; border-radius: 4px; border: 1px solid rgba(95,224,140,.45);
}

/* The way out: full-width, pinned to the bottom of the panel, always visible. */
#shop #shop-close {
  position: sticky; bottom: 0; z-index: 5; display: block;
  width: calc(100% + 44px); margin: 0 -22px; padding: 16px 20px calc(16px + env(safe-area-inset-bottom) * 0);
  border: 0; border-radius: 0 0 var(--r-lg) var(--r-lg);
  font: 800 18px/1 var(--font-display); letter-spacing: .18em; white-space: pre;
  color: var(--accent-ink); background: var(--accent); cursor: pointer;
  box-shadow: 0 -12px 24px rgba(6,8,11,.85);
  transition: background var(--t-fast);
}
#shop #shop-close:hover { background: var(--accent-hi); }

@media (max-width: 560px) {
  #shop .shop-panel { padding: 16px 14px 0; }
  #shop .shop-head { grid-template-columns: 1fr auto; }
  #shop .shop-right { grid-column: 1 / -1; grid-row: 2; flex-direction: row; flex-wrap: wrap; align-items: center; justify-content: space-between; }
  #shop .shop-title { font-size: 30px; }
  #shop #shop-items { grid-template-columns: 1fr 1fr; gap: 8px; }
  #shop .shop-item { min-height: 0; padding: 10px; }
  #shop .si-name { font-size: 17px; }
  #shop .si-blurb { font-size: 11px; }
  #shop #shop-close { width: calc(100% + 28px); margin: 0 -14px; }
}
@media (max-width: 360px) { #shop #shop-items { grid-template-columns: 1fr; } }
@media (max-height: 520px) {
  #shop .shop-item { min-height: 0; padding: 9px 11px; gap: 4px; }
  #shop .si-blurb { display: none; }
  #shop .shop-title { font-size: 26px; }
  #shop .shop-title::after { display: none; }
}

/* ---------- reduced motion ---------- */
/* uu.reducedMotion (html.hud-rm) or the OS setting: no pulsing, sliding or
   popping. State changes still show; they just do not move. */
html.hud-rm #hud *, html.hud-rm #hud *::before, html.hud-rm #hud *::after,
html.hud-rm #shop *, html.hud-rm #shop *::before, html.hud-rm #shop *::after {
  animation: none !important; transition: none !important;
}
@media (prefers-reduced-motion: reduce) {
  #hud *, #hud *::before, #hud *::after, #shop *, #shop *::before, #shop *::after {
    animation: none !important; transition: none !important;
  }
}
/* With animation off the pops would never fade, so they are simply not shown. */
html.hud-rm .econ-pop { display: none; }
@media (prefers-reduced-motion: reduce) { .econ-pop { display: none; } }

/* A narrow window on a mouse-and-keyboard browser (a desktop window dragged
   thin, or a phone browser that reports no touch) gets the desktop layout, so
   shrink every cluster to keep the corners from colliding. Touch devices use
   the layout in touch.css instead. */
@media (max-width: 720px) {
  body:not(.touch) #hud { --hs: calc(var(--hud-scale, 1) * .78); }
  body:not(.touch) #feed { max-width: 46vw; }
}
@media (max-width: 480px) {
  body:not(.touch) #hud { --hs: calc(var(--hud-scale, 1) * .6); }
  body:not(.touch) #feed { max-width: 30vw; }
}
