/* ============================================================================
   ASTRIKE — css/hud.css (Agent G)
   Self-contained in-game HUD stylesheet. Assumes ONLY a global reset
   (`* { margin:0; padding:0; box-sizing:border-box }`) + body base font.
   LEAD: <link rel="stylesheet" href="./css/hud.css"> after style.css.
   All rules are scoped to the #hud subtree (plus body-level overlays inside it).
   ========================================================================== */

#hud {
  /* design tokens */
  --hx-accent: #58f08a;
  --hx-ct: #6fa8dc;
  --hx-t: #e09a4a;
  --hx-red: #ff4a3d;
  --hx-amber: #e0b13c;
  --hx-gold: #ffd24a;
  --hx-ink: #dfe5ea;
  --hx-dim: rgba(223, 229, 234, 0.55);
  --hx-panel-bg: linear-gradient(180deg, rgba(15, 20, 27, 0.78), rgba(8, 11, 15, 0.68));
  --hx-line: rgba(255, 255, 255, 0.13);
  --hx-cut: 9px;

  position: absolute;
  inset: 0;
  z-index: 5;
  pointer-events: none;
  overflow: hidden;
  font-family: 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  color: var(--hx-ink);
}
#hud * { pointer-events: none; }

.hx-num {
  font-family: Consolas, 'Cascadia Mono', 'SF Mono', Menlo, monospace;
  font-variant-numeric: tabular-nums;
  font-feature-settings: 'tnum' 1;
}
.hx-micro {
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 2.5px;
  color: var(--hx-dim);
  text-transform: uppercase;
}

/* ---- chamfered translucent panel (2 corner cuts + 1px light border) ---- */
.hx-panel {
  position: relative;
  background: var(--hx-panel-bg);
  clip-path: polygon(var(--hx-cut) 0, 100% 0, 100% calc(100% - var(--hx-cut)),
                     calc(100% - var(--hx-cut)) 100%, 0 100%, 0 var(--hx-cut));
  backdrop-filter: blur(7px);
  -webkit-backdrop-filter: blur(7px);
  border: 1px solid var(--hx-line);
}
.hx-panel::before {
  content: '';
  position: absolute;
  inset: 0;
  clip-path: polygon(var(--hx-cut) 0, 100% 0, 100% calc(100% - var(--hx-cut)),
                     calc(100% - var(--hx-cut)) 100%, 0 100%, 0 var(--hx-cut));
  padding: 1px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.28), rgba(255, 255, 255, 0.06));
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  mask-composite: exclude;
  pointer-events: none;
}

/* ==========================================================================
   TOP BAR — score cluster (CT | timer+phase | T), compass tape, round + map
   ========================================================================== */
#topbar {
  position: absolute;
  top: 10px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
}

#scoreboard-mini {
  display: flex;
  align-items: stretch;
  gap: 12px;
  padding: 5px 10px;
  --hx-cut: 8px;
}
.hx-team-chip {
  align-self: center;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 2px;
  padding: 2px 6px;
  border-radius: 2px;
}
.hx-team-chip.ct { color: #0b0e12; background: var(--hx-ct); clip-path: polygon(4px 0, 100% 0, calc(100% - 4px) 100%, 0 100%); }
.hx-team-chip.t  { color: #0b0e12; background: var(--hx-t);  clip-path: polygon(4px 0, 100% 0, calc(100% - 4px) 100%, 0 100%); }

.score {
  align-self: center;
  min-width: 30px;
  text-align: center;
  font-family: Consolas, 'Cascadia Mono', Menlo, monospace;
  font-variant-numeric: tabular-nums;
  font-size: 26px;
  font-weight: 800;
  line-height: 1;
}
.score.ct { color: var(--hx-ct); text-shadow: 0 0 14px rgba(111, 168, 220, 0.45); }
.score.t  { color: var(--hx-t);  text-shadow: 0 0 14px rgba(224, 154, 74, 0.45); }
.score.bump { animation: hx-bump 0.28s cubic-bezier(0.2, 1.6, 0.4, 1); }
@keyframes hx-bump { 0% { transform: scale(1.5); } 100% { transform: scale(1); } }

#timer-box {
  align-self: center;
  text-align: center;
  min-width: 76px;
  padding: 2px 8px 1px;
  border-left: 1px solid var(--hx-line);
  border-right: 1px solid var(--hx-line);
}
#timer {
  font-family: Consolas, 'Cascadia Mono', Menlo, monospace;
  font-variant-numeric: tabular-nums;
  font-size: 22px;
  font-weight: 700;
  line-height: 1.05;
  color: #fff;
}
#timer-box.danger #timer { color: var(--hx-red); animation: hx-timer-flash 0.9s steps(2, jump-none) infinite; }
@keyframes hx-timer-flash { 0% { opacity: 1; } 50% { opacity: 0.25; } 100% { opacity: 1; } }
#phase-label {
  display: inline-block;
  margin-top: 1px;
  padding: 0 7px;
  font-size: 8px;
  font-weight: 800;
  letter-spacing: 2.5px;
  color: var(--hx-amber);
  border: 1px solid rgba(224, 177, 60, 0.55);
  border-radius: 2px;
  clip-path: polygon(3px 0, 100% 0, calc(100% - 3px) 100%, 0 100%);
  white-space: nowrap;
}
#phase-label:empty { visibility: hidden; }

#compass {
  width: min(420px, 46vw);
  height: auto;
  opacity: 0.95;
  filter: drop-shadow(0 1px 4px rgba(0, 0, 0, 0.6));
}

.hx-topsub {
  display: flex;
  align-items: center;
  gap: 10px;
}
#round-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 3.5px;
  color: rgba(223, 229, 234, 0.62);
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.8);
}
#hx-map-chip {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 2px 9px 2px 7px;
  background: rgba(8, 12, 16, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.09);
  clip-path: polygon(5px 0, 100% 0, calc(100% - 5px) 100%, 0 100%);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}
#hx-map-chip svg { width: 9px; height: 9px; fill: var(--hx-accent); }
#hx-map-name {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 2px;
  color: rgba(223, 229, 234, 0.72);
}

#conn-status {
  position: absolute;
  top: 14px;
  right: 16px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 2px;
  color: var(--hx-dim);
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.8);
}
#conn-status.ok   { color: var(--hx-accent); }
#conn-status.warn { color: var(--hx-amber); }

/* ==========================================================================
   LEFT STACK — radar / loot feed / fps chip
   ========================================================================== */
#hx-left-stack {
  position: absolute;
  top: 14px;
  left: 14px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 9px;
}

#hx-radar-wrap {
  position: relative;
  width: clamp(118px, 15vmin, 178px);
  aspect-ratio: 1;
  border-radius: 50%;
  overflow: hidden;
  background: radial-gradient(circle at 50% 50%, rgba(14, 20, 27, 0.72) 0%, rgba(7, 10, 14, 0.62) 78%);
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.17),
    0 0 0 5px rgba(8, 12, 16, 0.38),
    0 6px 20px rgba(0, 0, 0, 0.55);
}
#radar { position: absolute; inset: 0; width: 100%; height: 100%; }
.hx-radar-sweep {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: conic-gradient(from 0deg,
    rgba(88, 240, 138, 0.30) 0deg,
    rgba(88, 240, 138, 0.10) 52deg,
    rgba(88, 240, 138, 0.02) 84deg,
    transparent 100deg, transparent 360deg);
  animation: hx-sweep 3.6s linear infinite;
  mix-blend-mode: screen;
}
@keyframes hx-sweep { to { transform: rotate(360deg); } }
.hx-radar-ring {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  pointer-events: none;
  background:
    radial-gradient(circle at 50% 50%, transparent 58%, rgba(255, 255, 255, 0.05) 58.5%, transparent 60%);
}
.hx-radar-ring::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background:
    linear-gradient(rgba(255, 255, 255, 0.07), rgba(255, 255, 255, 0.07)) 50% 50% / 100% 1px no-repeat,
    linear-gradient(rgba(255, 255, 255, 0.07), rgba(255, 255, 255, 0.07)) 50% 50% / 1px 100% no-repeat;
}

#loot-feed {
  display: flex;
  flex-direction: column;
  gap: 5px;
  max-width: 250px;
}
.loot-line {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 6px 10px;
  background: linear-gradient(180deg, rgba(24, 26, 16, 0.85), rgba(12, 13, 8, 0.8));
  border-left: 2px solid var(--hx-gold);
  clip-path: polygon(0 0, 100% 0, 100% calc(100% - 6px), calc(100% - 6px) 100%, 0 100%);
  font-size: 12px;
  line-height: 1.35;
  animation: hx-feedin 0.22s ease-out;
}
.loot-line::before {
  content: '';
  flex: 0 0 12px;
  height: 12px;
  margin-top: 2px;
  background: var(--hx-gold);
  clip-path: polygon(50% 0, 100% 25%, 100% 75%, 50% 100%, 0 75%, 0 25%);
  opacity: 0.9;
}
.loot-line b { color: var(--hx-gold); font-weight: 800; letter-spacing: 0.5px; }
.loot-line span { display: block; color: #cfd6dd; font-size: 10.5px; letter-spacing: 0.4px; margin-top: 1px; }
@keyframes hx-feedin { from { transform: translateX(-24px); opacity: 0; } to { transform: none; opacity: 1; } }

#fps-counter {
  display: inline-block;
  padding: 2px 8px;
  background: rgba(8, 12, 16, 0.55);
  border: 1px solid rgba(255, 255, 255, 0.08);
  clip-path: polygon(4px 0, 100% 0, calc(100% - 4px) 100%, 0 100%);
  font-family: Consolas, Menlo, monospace;
  font-size: 9px;
  letter-spacing: 1.5px;
  color: rgba(223, 229, 234, 0.45);
}
#fps-counter.warn { color: var(--hx-amber); }
#fps-counter.bad  { color: var(--hx-red); }

/* ==========================================================================
   KILLFEED (top-right)
   ========================================================================== */
#killfeed {
  position: absolute;
  top: 36px;
  right: 16px;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 5px;
  max-width: 46vw;
}
.kf-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 10px 4px 8px;
  background: linear-gradient(180deg, rgba(13, 18, 24, 0.86), rgba(7, 10, 14, 0.8));
  border-left: 2px solid var(--kf-atk, rgba(255, 255, 255, 0.25));
  clip-path: polygon(0 0, 100% 0, calc(100% - 7px) 100%, 0 100%);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.4);
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: 0.4px;
  animation: hx-kf-life 5.2s linear forwards;
}
@keyframes hx-kf-life {
  0%   { transform: translateX(34px); opacity: 0; }
  5%   { transform: none; opacity: 1; }
  86%  { opacity: 1; }
  100% { opacity: 0; transform: translateX(6px); }
}
.kf-atk, .kf-vic { text-shadow: 0 1px 3px rgba(0, 0, 0, 0.9); white-space: nowrap; }
.kf-mid { display: flex; align-items: center; gap: 3px; opacity: 0.95; }
.kf-mid svg { height: 11px; width: auto; fill: #e8edf2; filter: drop-shadow(0 1px 1px rgba(0, 0, 0, 0.8)); }
.kf-mid svg.kf-skull { height: 13px; fill: var(--hx-red); }
.kf-wep-txt { color: #aab4bd; font-size: 10.5px; font-weight: 600; letter-spacing: 1.5px; text-transform: uppercase; }
.kf-sys { border-left-color: rgba(255, 255, 255, 0.18); }

/* ==========================================================================
   CROSSHAIR + HITMARKER
   ========================================================================== */
#crosshair {
  --gap: 5px;
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  display: none;
}
#crosshair span {
  position: absolute;
  background: var(--hx-accent);
  box-shadow: 0 0 2px rgba(0, 0, 0, 0.9), 0 0 5px rgba(88, 240, 138, 0.35);
}
.ch-t { width: 2px; height: 8px; left: -1px; top: calc(-8px - var(--gap)); }
.ch-b { width: 2px; height: 8px; left: -1px; top: var(--gap); }
.ch-l { width: 8px; height: 2px; top: -1px; left: calc(-8px - var(--gap)); }
.ch-r { width: 8px; height: 2px; top: -1px; left: var(--gap); }
.ch-dot { width: 2px; height: 2px; left: -1px; top: -1px; box-shadow: 0 0 2px rgba(0, 0, 0, 0.9); }

#hitmarker {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  opacity: 0;
  color: rgba(255, 255, 255, 0.95);
  transform: rotate(var(--hm-rot, 0deg));
}
#hitmarker.kill { color: var(--hx-red); }
#hitmarker span {
  position: absolute;
  width: 9px;
  height: 2px;
  background: currentColor;
  box-shadow: 0 0 3px rgba(0, 0, 0, 0.9);
}
#hitmarker.kill span { width: 13px; height: 2.5px; }
#hitmarker span:nth-child(1) { transform: translate(-10px, -8px) rotate(45deg); }
#hitmarker span:nth-child(2) { transform: translate(1px, -8px) rotate(-45deg); }
#hitmarker span:nth-child(3) { transform: translate(-10px, 6px) rotate(-45deg); }
#hitmarker span:nth-child(4) { transform: translate(1px, 6px) rotate(45deg); }
#hitmarker.show { animation: hx-hm 0.2s ease-out forwards; }
@keyframes hx-hm { 0% { opacity: 1; scale: 1.35; } 70% { opacity: 0.9; } 100% { opacity: 0; scale: 0.9; } }

/* ==========================================================================
   DAMAGE FX — vignette, direction arc, low-hp overlay, damage numbers
   ========================================================================== */
#dmg-vignette {
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity 0.25s;
  background: radial-gradient(ellipse at center, transparent 40%, rgba(190, 20, 20, 0.55) 100%);
}

#dmg-dir {
  position: absolute;
  top: 50%;
  left: 50%;
  opacity: 0;
  transition: opacity 0.45s;
}
#dmg-dir .arc {
  position: absolute;
  left: -70px;
  top: -132px;
  width: 140px;
  height: 40px;
  background: radial-gradient(ellipse at 50% 100%, rgba(255, 46, 32, 0.95) 0%, rgba(255, 46, 32, 0.35) 55%, transparent 75%);
  clip-path: polygon(50% 0%, 100% 100%, 74% 100%, 50% 34%, 26% 100%, 0% 100%);
  filter: drop-shadow(0 0 10px rgba(255, 40, 20, 0.55));
}

#hx-lowhp { position: absolute; inset: 0; opacity: 0; transition: opacity 0.4s; }
#hx-lowhp.on { opacity: 1; }
.hx-lowhp-edge {
  position: absolute;
  inset: 0;
  box-shadow: inset 0 0 90px rgba(255, 26, 12, 0.42), inset 0 0 190px rgba(180, 8, 0, 0.30);
}
.hx-lowhp-pulse {
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at center, transparent 46%, rgba(255, 24, 10, 0.26) 100%);
  animation: hx-lowhp-pulse 1.15s ease-in-out infinite;
}
@keyframes hx-lowhp-pulse { 0%, 100% { opacity: 0.35; } 50% { opacity: 1; } }

#hx-dmg-nums {
  position: absolute;
  left: 50%;
  top: 52%;
  width: 0;
  height: 0;
}
.hx-dnum {
  position: absolute;
  left: calc(26px + var(--dx, 0px));
  top: calc(-10px + var(--dy, 0px));
  font-family: Consolas, 'Cascadia Mono', Menlo, monospace;
  font-variant-numeric: tabular-nums;
  font-size: 17px;
  font-weight: 800;
  color: #ffe9dd;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.9), 0 0 8px rgba(255, 90, 40, 0.5);
  animation: hx-dnum 0.72s ease-out forwards;
}
.hx-dnum.big {
  font-size: 24px;
  color: var(--hx-gold);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.9), 0 0 12px rgba(255, 190, 40, 0.75);
}
@keyframes hx-dnum {
  0%   { transform: translate(0, 6px) scale(0.8); opacity: 0; }
  14%  { transform: translate(0, 0) scale(1.12); opacity: 1; }
  100% { transform: translate(0, -44px) scale(0.94); opacity: 0; }
}

/* ==========================================================================
   BANNERS — round start slam, sub-banner, streak
   ========================================================================== */
#banner {
  display: none;
  position: absolute;
  top: 21%;
  left: 50%;
  transform: translateX(-50%);
  font-size: clamp(26px, 6vmin, 46px);
  font-weight: 900;
  letter-spacing: 7px;
  color: #fff;
  text-shadow: 0 2px 16px rgba(0, 0, 0, 0.85), 0 0 34px rgba(88, 240, 138, 0.18);
  white-space: nowrap;
}
#banner.win { color: var(--hx-accent); text-shadow: 0 2px 16px rgba(0, 0, 0, 0.85), 0 0 40px rgba(88, 240, 138, 0.45); }
#banner.show { animation: hx-slam 0.5s cubic-bezier(0.18, 1.25, 0.32, 1) both; }
@keyframes hx-slam {
  0%   { opacity: 0; transform: translateX(-50%) scale(1.32); letter-spacing: 22px; filter: blur(5px); }
  55%  { opacity: 1; filter: blur(0); }
  100% { opacity: 1; transform: translateX(-50%) scale(1); letter-spacing: 7px; }
}
#subbanner {
  display: none;
  position: absolute;
  top: calc(21% + 60px);
  left: 50%;
  transform: translateX(-50%);
  font-size: clamp(12px, 2.2vmin, 17px);
  font-weight: 700;
  letter-spacing: 4px;
  color: var(--hx-amber);
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.9);
  white-space: nowrap;
}
#subbanner.show { animation: hx-subin 0.45s 0.14s ease-out both; }
@keyframes hx-subin { from { opacity: 0; transform: translateX(-50%) translateY(10px); } to { opacity: 1; transform: translateX(-50%); } }

#streak-banner {
  position: absolute;
  top: 31%;
  left: 50%;
  transform: translateX(-50%);
  font-size: clamp(20px, 4.4vmin, 32px);
  font-weight: 900;
  letter-spacing: 6px;
  color: var(--hx-gold);
  text-shadow: 0 0 20px rgba(255, 180, 30, 0.7), 0 2px 8px #000;
  opacity: 0;
  white-space: nowrap;
}
#streak-banner.r3 { color: #9fd8ff; text-shadow: 0 0 18px rgba(120, 190, 255, 0.65), 0 2px 8px #000; }
#streak-banner.r5 { color: var(--hx-gold); text-shadow: 0 0 22px rgba(255, 190, 40, 0.8), 0 2px 8px #000; }
#streak-banner.r8 { color: var(--hx-red); text-shadow: 0 0 26px rgba(255, 60, 40, 0.85), 0 2px 8px #000; }
#streak-banner.show { animation: hx-streak 2.3s ease-out forwards; }
@keyframes hx-streak {
  0%   { opacity: 0; transform: translateX(-50%) scale(0.55); letter-spacing: 16px; }
  12%  { opacity: 1; transform: translateX(-50%) scale(1.14); }
  22%  { transform: translateX(-50%) scale(1); letter-spacing: 6px; }
  80%  { opacity: 1; }
  100% { opacity: 0; transform: translateX(-50%) scale(1) translateY(-18px); }
}

/* ==========================================================================
   DEATH SCREEN + SPECTATE BAR
   ========================================================================== */
#death-screen {
  display: none;
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at center, rgba(70, 4, 0, 0.38) 0%, rgba(4, 2, 2, 0.72) 100%);
  flex-direction: column;
  align-items: center;
  justify-content: center;
}
#death-screen.on .hx-death-inner { animation: hx-deathin 0.5s cubic-bezier(0.2, 1.2, 0.35, 1) both; }
@keyframes hx-deathin { from { opacity: 0; transform: scale(1.12); } to { opacity: 1; transform: none; } }
.hx-death-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  text-align: center;
}
.hx-death-skull { width: 44px; height: 44px; fill: rgba(255, 74, 61, 0.85); filter: drop-shadow(0 0 14px rgba(255, 50, 30, 0.6)); }
#death-title {
  font-size: clamp(30px, 7vmin, 50px);
  font-weight: 900;
  letter-spacing: 12px;
  text-indent: 12px;
  color: var(--hx-red);
  text-shadow: 0 0 30px rgba(255, 40, 20, 0.55), 0 2px 10px #000;
}
#death-killer { font-size: 16px; letter-spacing: 1px; color: #dfe5ea; }
#death-killer b { color: #fff; }
.hx-death-wep {
  display: inline-block;
  margin-left: 8px;
  padding: 1px 8px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 2px;
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: 2px;
  color: #cfd6dd;
  vertical-align: 1px;
}
#death-hint { font-size: 11px; letter-spacing: 2px; color: rgba(223, 229, 234, 0.55); }

#hx-spectate-bar {
  display: none;
  position: absolute;
  bottom: 23%;
  left: 50%;
  transform: translateX(-50%);
  align-items: center;
  gap: 9px;
  padding: 7px 16px;
  background: rgba(8, 12, 16, 0.72);
  border: 1px solid rgba(255, 255, 255, 0.12);
  clip-path: polygon(7px 0, 100% 0, calc(100% - 7px) 100%, 0 100%);
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
}
#hx-spectate-bar.on { display: flex; animation: hx-specin 0.3s ease-out; }
@keyframes hx-specin { from { opacity: 0; transform: translateX(-50%) translateY(10px); } to { opacity: 1; transform: translateX(-50%); } }
.hx-spec-dot {
  width: 7px;
  height: 7px;
  background: var(--hx-accent);
  border-radius: 50%;
  animation: hx-specdot 1.2s ease-in-out infinite;
}
@keyframes hx-specdot { 0%, 100% { opacity: 0.35; } 50% { opacity: 1; } }
#spectate-label { font-size: 12px; font-weight: 700; letter-spacing: 2px; color: #cfd6dd; white-space: pre; }

/* ==========================================================================
   BOTTOM-LEFT — vitals
   ========================================================================== */
#bottom-left {
  position: absolute;
  left: 18px;
  bottom: 18px;
  width: min(292px, 30vw);
  min-width: 208px;
}
.hx-vitals { padding: 9px 12px 10px; display: flex; flex-direction: column; gap: 6px; }
.hx-vital-top { display: flex; align-items: baseline; gap: 10px; }
#health-val {
  font-size: clamp(24px, 4.6vmin, 36px);
  font-weight: 800;
  line-height: 0.95;
  color: #fff;
  transition: color 0.25s;
}
.hx-armor-pill {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 2px 8px;
  background: rgba(90, 155, 212, 0.12);
  border: 1px solid rgba(111, 168, 220, 0.35);
  clip-path: polygon(4px 0, 100% 0, calc(100% - 4px) 100%, 0 100%);
}
.hx-armor-pill svg { width: 11px; height: 11px; fill: var(--hx-ct); }
#armor-val { font-size: 14px; font-weight: 800; color: var(--hx-ct); }
#armor-val.none { opacity: 0.35; }

.hx-hp-track {
  position: relative;
  height: 12px;
  background: rgba(255, 255, 255, 0.07);
  clip-path: polygon(0 0, 100% 0, calc(100% - 5px) 100%, 0 100%);
  overflow: hidden;
}
#health-bar {
  height: 100%;
  width: 100%;
  background: var(--hx-accent);
  transition: width 0.15s ease-out, background-color 0.3s;
  box-shadow: 0 0 10px rgba(88, 240, 138, 0.35);
}
/* 10-segment notches */
.hx-hp-track::after {
  content: '';
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(90deg,
    transparent 0, transparent calc(10% - 2px),
    rgba(5, 8, 11, 0.92) calc(10% - 2px), rgba(5, 8, 11, 0.92) 10%);
  pointer-events: none;
}
#bottom-left.hx-hp-mid #health-val,
#bottom-left.hx-hp-mid #health-bar { color: var(--hx-amber); }
#bottom-left.hx-hp-mid #health-bar { background: var(--hx-amber); box-shadow: 0 0 10px rgba(224, 177, 60, 0.35); }
#bottom-left.hx-hp-low #health-val { color: var(--hx-red); }
#bottom-left.hx-hp-low #health-bar {
  background: var(--hx-red);
  box-shadow: 0 0 12px rgba(255, 60, 40, 0.5);
  animation: hx-hp-low-pulse 0.9s ease-in-out infinite;
}
@keyframes hx-hp-low-pulse { 0%, 100% { filter: brightness(0.85); } 50% { filter: brightness(1.25); } }

.hx-armor-row { display: flex; align-items: center; gap: 8px; }
.hx-armor-track {
  flex: 1;
  height: 4px;
  background: rgba(255, 255, 255, 0.07);
  clip-path: polygon(0 0, 100% 0, calc(100% - 3px) 100%, 0 100%);
  overflow: hidden;
}
#armor-bar {
  height: 100%;
  width: 100%;
  background: linear-gradient(90deg, #4d7fae, var(--hx-ct));
  box-shadow: 0 0 8px rgba(111, 168, 220, 0.4);
  transition: width 0.15s ease-out;
}

/* ==========================================================================
   BOTTOM-RIGHT — weapon / ammo / reload / slots
   ========================================================================== */
#bottom-right {
  position: absolute;
  right: 18px;
  bottom: 18px;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 7px;
}
.hx-weapon { padding: 9px 12px 10px; min-width: 218px; display: flex; flex-direction: column; gap: 4px; }
.hx-wep-top { display: flex; align-items: center; gap: 8px; justify-content: flex-end; }
#weapon-name {
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 2px;
  color: #cfd6dd;
  text-transform: uppercase;
  white-space: nowrap;
}
#hx-mod-chips { display: flex; gap: 4px; }
#hx-mod-chips:empty { display: none; }
.hx-mod-chip {
  font-size: 8px;
  font-weight: 800;
  letter-spacing: 1.5px;
  padding: 1.5px 5px;
  color: var(--hx-accent);
  border: 1px solid rgba(88, 240, 138, 0.45);
  background: rgba(88, 240, 138, 0.08);
  clip-path: polygon(3px 0, 100% 0, calc(100% - 3px) 100%, 0 100%);
}

.hx-wep-mid { display: flex; align-items: flex-end; justify-content: flex-end; gap: 12px; }
#hx-wep-icon { width: 74px; height: auto; fill: #aab6c0; opacity: 0.9; }
#ammo-line {
  font-variant-numeric: tabular-nums;
  line-height: 1;
  text-align: right;
  white-space: nowrap;
}
#ammo-mag { font-size: clamp(30px, 5.6vmin, 44px); font-weight: 800; color: #fff; }
#ammo-res { font-size: clamp(16px, 3vmin, 22px); font-weight: 700; color: rgba(170, 180, 190, 0.85); margin-left: 5px; }
#ammo-line.low #ammo-mag { color: var(--hx-red); text-shadow: 0 0 12px rgba(255, 60, 40, 0.55); }
#ammo-line.low #ammo-mag { animation: hx-low-ammo 0.5s ease-in-out infinite; }
#ammo-line.empty #ammo-mag { animation: hx-low-ammo 0.22s steps(2, jump-none) infinite; }
@keyframes hx-low-ammo {
  0%, 100% { transform: translate(0, 0); }
  25% { transform: translate(-1.4px, 0.6px); }
  50% { transform: translate(1.2px, -0.6px); }
  75% { transform: translate(-0.8px, -0.4px); }
}

#hx-reload {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 0;
  opacity: 0;
  overflow: hidden;
  transition: height 0.12s, opacity 0.12s;
}
#hx-reload.on { height: 14px; opacity: 1; }
#hx-reload .hx-micro { color: var(--hx-amber); }
.hx-reload-track {
  flex: 1;
  height: 4px;
  background: rgba(255, 255, 255, 0.09);
  clip-path: polygon(0 0, 100% 0, calc(100% - 3px) 100%, 0 100%);
  overflow: hidden;
}
#hx-reload-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--hx-amber), #ffd97a);
  box-shadow: 0 0 8px rgba(224, 177, 60, 0.6);
}

#slots { display: flex; gap: 6px; justify-content: flex-end; }
.slot {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 4px 9px;
  background: rgba(8, 12, 16, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.12);
  clip-path: polygon(4px 0, 100% 0, calc(100% - 4px) 100%, 0 100%);
  color: #7d8892;
  transition: border-color 0.12s, background 0.12s, color 0.12s;
}
.slot b { font-family: Consolas, Menlo, monospace; font-size: 11px; font-weight: 800; }
.slot svg { width: 22px; height: 11px; fill: currentColor; opacity: 0.75; }
.slot.active {
  color: var(--hx-accent);
  border-color: rgba(88, 240, 138, 0.65);
  background: rgba(88, 240, 138, 0.10);
  box-shadow: 0 0 10px rgba(88, 240, 138, 0.15);
}
.slot.active svg { opacity: 1; }

/* ==========================================================================
   CHAT
   ========================================================================== */
#chat-log {
  position: absolute;
  left: 18px;
  bottom: 132px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  max-width: min(430px, 44vw);
  transition: opacity 0.6s;
}
#chat-log.dim { opacity: 0; }
.chat-line {
  width: max-content;
  max-width: 100%;
  padding: 4px 9px;
  background: rgba(8, 12, 16, 0.58);
  border-left: 2px solid rgba(255, 255, 255, 0.14);
  clip-path: polygon(0 0, 100% 0, calc(100% - 5px) 100%, 0 100%);
  font-size: 12.5px;
  line-height: 1.4;
  animation: hx-feedin 0.2s ease-out;
  overflow-wrap: anywhere;
}
.chat-line b { font-weight: 800; }

#chat-input-wrap {
  position: absolute;
  left: 18px;
  bottom: 96px;
  display: none;
  align-items: center;
  gap: 9px;
  padding: 7px 11px;
  background: rgba(8, 12, 16, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.18);
  clip-path: polygon(6px 0, 100% 0, calc(100% - 6px) 100%, 0 100%);
  pointer-events: auto !important;
  z-index: 3;
}
#chat-input-wrap span { font-size: 10px; font-weight: 800; letter-spacing: 2.5px; color: var(--hx-amber); }
#chat-input {
  pointer-events: auto;
  background: transparent;
  border: none;
  outline: none;
  color: #fff;
  font-family: inherit;
  font-size: 13.5px;
  width: min(320px, 34vw);
}
#chat-input::placeholder { color: rgba(170, 180, 190, 0.45); }

/* ==========================================================================
   SCOPE OVERLAY
   ========================================================================== */
#scope-overlay {
  display: none;
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at center,
    rgba(0, 0, 0, 0.14) 0, rgba(0, 0, 0, 0.14) 26vmin,
    rgba(0, 0, 0, 0.86) 32vmin, rgba(0, 0, 0, 0.985) 34.5vmin);
}
.scope-cross-h { position: absolute; top: 50%; left: 0; width: 100%; height: 1px; background: rgba(0, 0, 0, 0.88); }
.scope-cross-v { position: absolute; left: 50%; top: 0; height: 100%; width: 1px; background: rgba(0, 0, 0, 0.88); }
.scope-ring {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 62vmin;
  height: 62vmin;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  border: 2px solid rgba(0, 0, 0, 0.9);
  box-shadow: inset 0 0 60px rgba(0, 0, 0, 0.55), 0 0 0 1px rgba(255, 255, 255, 0.04);
}
.scope-ring::before {
  content: '';
  position: absolute;
  inset: -3.4vmin;
  border-radius: 50%;
  background: repeating-conic-gradient(rgba(0, 0, 0, 0.85) 0deg 0.6deg, transparent 0.6deg 30deg);
}

/* ==========================================================================
   FULL MAP (M)
   ========================================================================== */
#fullmap-wrap {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  display: none;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  z-index: 8;
}
#fullmap-wrap.show { animation: hx-fm-in 0.16s ease-out; }
@keyframes hx-fm-in { from { opacity: 0; transform: translate(-50%, -50%) scale(0.97); } to { opacity: 1; transform: translate(-50%, -50%) scale(1); } }
#fullmap-head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 6px 14px;
  background: rgba(8, 12, 16, 0.88);
  border: 1px solid rgba(255, 255, 255, 0.14);
  clip-path: polygon(8px 0, 100% 0, calc(100% - 8px) 100%, 0 100%);
  font-size: 11.5px;
  font-weight: 800;
  letter-spacing: 2.5px;
}
#hx-fm-map { color: var(--hx-accent); }
.hx-fm-hint { font-size: 9px; font-weight: 600; letter-spacing: 2px; color: rgba(223, 229, 234, 0.45); }
#fullmap {
  width: min(560px, 86vmin);
  height: auto;
  border: 1px solid rgba(255, 255, 255, 0.2);
  box-shadow: 0 0 0 5px rgba(8, 12, 16, 0.6), 0 18px 50px rgba(0, 0, 0, 0.7);
  background: rgba(8, 12, 16, 0.85);
}

/* ==========================================================================
   SCOREBOARD (TAB)
   ========================================================================== */
#scoreboard {
  display: none;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: min(640px, 92vw);
  background: linear-gradient(180deg, rgba(11, 15, 20, 0.92), rgba(6, 9, 12, 0.9));
  border: 1px solid rgba(255, 255, 255, 0.14);
  clip-path: polygon(14px 0, 100% 0, 100% calc(100% - 14px), calc(100% - 14px) 100%, 0 100%, 0 14px);
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(9px);
  -webkit-backdrop-filter: blur(9px);
}
#scoreboard.show { animation: hx-sb-in 0.16s ease-out; }
@keyframes hx-sb-in { from { opacity: 0; transform: translate(-50%, -50%) scale(0.965); } to { opacity: 1; transform: translate(-50%, -50%) scale(1); } }
#sb-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 18px;
  background: rgba(255, 255, 255, 0.05);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}
.hx-sb-title { font-size: 12px; font-weight: 900; letter-spacing: 4px; }
.hx-sb-score { display: flex; align-items: center; gap: 12px; font-size: 11px; letter-spacing: 2px; color: var(--hx-dim); }
.hx-sb-score b { font-size: 19px; font-weight: 800; }
.hx-sb-score b.ct { color: var(--hx-ct); }
.hx-sb-score b.t { color: var(--hx-t); }

#sb-body {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1px;
  background: rgba(255, 255, 255, 0.05);
}
.hx-sb-team { background: rgba(8, 11, 15, 0.6); padding: 8px 10px 10px; }
.hx-sb-colhead {
  display: grid;
  grid-template-columns: 26px 1fr 24px 24px 30px;
  gap: 6px;
  padding: 5px 8px 7px;
  font-size: 9.5px;
  font-weight: 800;
  letter-spacing: 2px;
  color: var(--hx-dim);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}
.hx-sb-team.ct .hx-sb-colhead { color: var(--hx-ct); }
.hx-sb-team.t .hx-sb-colhead { color: var(--hx-t); }
.hx-sb-colhead :nth-child(n + 3) { text-align: right; }
.hx-sb-row {
  display: grid;
  grid-template-columns: 26px 1fr 24px 24px 30px;
  gap: 6px;
  align-items: center;
  padding: 5px 8px;
  font-size: 13px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}
.hx-sb-row:last-child { border-bottom: none; }
.hx-sb-tag {
  font-size: 8.5px;
  font-weight: 900;
  letter-spacing: 1px;
  text-align: center;
  padding: 1.5px 0;
  color: #0b0e12;
  border-radius: 2px;
}
.hx-sb-tag.CT { background: var(--hx-ct); }
.hx-sb-tag.T { background: var(--hx-t); }
.hx-sb-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.hx-sb-name i {
  font-style: normal;
  font-size: 8px;
  font-weight: 800;
  letter-spacing: 1px;
  color: rgba(223, 229, 234, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.18);
  padding: 0 4px;
  margin-left: 6px;
  vertical-align: 1px;
}
.hx-sb-row :nth-child(n + 3) {
  text-align: right;
  font-family: Consolas, Menlo, monospace;
  font-variant-numeric: tabular-nums;
  font-weight: 700;
}
.hx-sb-row .hx-sb-streak { color: var(--hx-gold); }
.hx-sb-row.me { background: rgba(88, 240, 138, 0.09); box-shadow: inset 2px 0 0 var(--hx-accent); }
.hx-sb-empty { padding: 10px 8px; font-size: 11px; letter-spacing: 1.5px; color: rgba(223, 229, 234, 0.35); }

/* ==========================================================================
   RESPONSIVE — small landscape screens
   ========================================================================== */
@media (max-width: 820px) and (orientation: landscape) {
  #topbar { top: 6px; gap: 3px; }
  #scoreboard-mini { padding: 3px 8px; gap: 8px; --hx-cut: 6px; }
  .score { font-size: 19px; min-width: 24px; }
  #timer { font-size: 16px; }
  #timer-box { min-width: 60px; padding: 1px 6px; }
  #compass { width: min(300px, 40vw); }
  #round-label { font-size: 8.5px; letter-spacing: 2.5px; }
  #hx-radar-wrap { width: 122px; }
  #hx-left-stack { top: 10px; left: 10px; gap: 6px; }
  .loot-line { font-size: 10.5px; padding: 4px 8px; max-width: 190px; }
  .loot-line span { font-size: 9.5px; }
  #killfeed { top: 30px; right: 10px; gap: 4px; }
  .kf-row { font-size: 11px; padding: 3px 8px 3px 6px; }
  #conn-status { top: 10px; right: 12px; font-size: 9px; }
  #bottom-left { left: 12px; bottom: 12px; width: 196px; min-width: 0; }
  .hx-vitals { padding: 7px 10px 8px; gap: 4px; }
  #health-val { font-size: 22px; }
  .hx-hp-track { height: 10px; }
  #bottom-right { right: 12px; bottom: 12px; gap: 5px; }
  .hx-weapon { min-width: 176px; padding: 7px 10px 8px; }
  #ammo-mag { font-size: 30px; }
  #ammo-res { font-size: 15px; }
  #hx-wep-icon { width: 58px; }
  .slot { padding: 3px 7px; }
  .slot svg { width: 18px; }
  #banner { top: 17%; }
  #subbanner { top: calc(17% + 44px); }
  #streak-banner { top: 27%; }
  #chat-log { bottom: 108px; }
  #chat-input-wrap { bottom: 78px; }
  #death-title { letter-spacing: 8px; text-indent: 8px; }
}

/* ==========================================================================
   TOUCH DEVICES — shrink radar, keep bottom corners clear for touch controls
   ========================================================================== */
@media (pointer: coarse) {
  #hx-radar-wrap { width: 112px; }
  #hx-left-stack { top: 10px; left: 10px; gap: 6px; }
  #fps-counter { font-size: 8px; padding: 1px 6px; }
  #killfeed { top: 32px; right: 10px; }
  .kf-row { font-size: 11px; }
  #loot-feed { max-width: 180px; }
  .loot-line { font-size: 10.5px; padding: 4px 8px; }
  /* lift corner panels above the touch stick (bottom-left) and buttons (bottom-right) */
  #bottom-left { left: 12px; bottom: 236px; width: 200px; min-width: 0; }
  #bottom-right { right: 12px; bottom: 246px; }
  .hx-weapon { min-width: 186px; }
  #ammo-mag { font-size: 32px; }
  #chat-log { bottom: 390px; }
  #chat-input-wrap { bottom: 356px; }
  #compass { width: min(280px, 38vw); }
  #banner { font-size: 24px; }
  #fullmap { width: min(520px, 92vmin); }
}
