/* ==========================================================================
   Dust Protocol — HUD stylesheet (CS2-style: flat, minimal, white-on-dark)
   Owner: hud agent. Tokens from docs/architecture.md "HUD tokens".
   ========================================================================== */

@font-face {
  font-family: "Barlow Condensed";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("../../assets/fonts/barlow-condensed-400.woff2") format("woff2");
}
@font-face {
  font-family: "Barlow Condensed";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("../../assets/fonts/barlow-condensed-600.woff2") format("woff2");
}
@font-face {
  font-family: "Barlow Condensed";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("../../assets/fonts/barlow-condensed-700.woff2") format("woff2");
}

:root {
  --hud-font: "Barlow Condensed", "Arial Narrow", Arial, sans-serif;
  --hud-text: rgba(255, 255, 255, 0.92);
  --hud-text-dim: rgba(255, 255, 255, 0.65);
  --hud-plate: rgba(11, 14, 18, 0.68);
  --hud-plate-heavy: rgba(11, 14, 18, 0.86);
  --hud-t: #eabe54;
  --hud-ct: #8cb8e8;
  --hud-red: #c0392b;
  --hud-green: #8cc63f;
  --hud-radius: 5px;
}

/* ---------- root ---------- */

#hud-root {
  position: fixed;
  inset: 0;
  z-index: 10;
  overflow: hidden;
  pointer-events: none;
  font-family: var(--hud-font);
  color: var(--hud-text);
  user-select: none;
  -webkit-user-select: none;
  font-variant-numeric: tabular-nums;
}
#hud-root .hidden { display: none !important; }
:where(#hud-root) button {
  font-family: var(--hud-font);
  cursor: pointer;
  border: none;
  background: none;
  color: inherit;
}

/* ---------- generic plate ---------- */

.hud-plate {
  background: var(--hud-plate);
  border-radius: var(--hud-radius);
}

/* ---------- radar (top-left) ---------- */

#hud-radar {
  position: absolute;
  top: 18px;
  left: 18px;
  width: 256px;
  height: 256px;
  border-radius: 6px;
  overflow: hidden;
  background: rgba(11, 14, 18, 0.55);
}
#hud-radar canvas { width: 100%; height: 100%; display: block; }

/* ---------- money (left, under radar) ---------- */

#hud-money {
  position: absolute;
  top: 288px;
  left: 18px;
  min-width: 96px;
  padding: 3px 12px 4px;
  font-size: 26px;
  font-weight: 600;
  letter-spacing: 0.02em;
  display: flex;
  align-items: baseline;
  gap: 10px;
}
#hud-money .cur { color: var(--hud-text-dim); font-size: 20px; font-weight: 400; }
#hud-money-delta {
  font-size: 20px;
  font-weight: 600;
  opacity: 0;
  transition: opacity 0.25s;
}
#hud-money-delta.gain { color: var(--hud-green); }
#hud-money-delta.loss { color: var(--hud-red); }
#hud-money-delta.show { opacity: 1; }

/* ---------- top-center score + timer ---------- */

#hud-topbar {
  position: absolute;
  top: 14px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: stretch;
  gap: 2px;
}
#hud-topbar .side {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 2px 14px 4px;
  min-width: 52px;
}
#hud-topbar .side .score { font-size: 30px; font-weight: 700; line-height: 1; padding-top: 3px; }
#hud-topbar .side.ct .score { color: var(--hud-ct); }
#hud-topbar .side.t .score { color: var(--hud-t); }
#hud-topbar .side .tag {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.14em;
  color: var(--hud-text-dim);
}
#hud-topbar .mid {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2px 16px;
  min-width: 74px;
}
#hud-timer { font-size: 27px; font-weight: 600; line-height: 1.15; }
#hud-timer.warn { color: var(--hud-red); }
#hud-round-label {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.14em;
  color: var(--hud-text-dim);
}
#hud-bomb-icon { width: 22px; height: 26px; margin: 2px 0 3px; }
#hud-bomb-icon.blink { animation: hud-blink 0.8s steps(1) infinite; }
@keyframes hud-blink { 50% { opacity: 0.15; } }

/* alive dots under score */
.alive-row { display: flex; gap: 3px; padding: 3px 0 2px; min-height: 11px; }
.alive-row i {
  width: 5px;
  height: 8px;
  border-radius: 1px;
  background: currentColor;
  opacity: 0.9;
}
.alive-row i.dead { opacity: 0.22; }
#hud-topbar .side.ct .alive-row { color: var(--hud-ct); }
#hud-topbar .side.t .alive-row { color: var(--hud-t); }

/* ---------- kill feed (top-right) ---------- */

#hud-killfeed {
  position: absolute;
  top: 18px;
  right: 18px;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 5px;
  max-width: 460px;
}
.kf-entry {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 27px;
  padding: 0 10px;
  background: var(--hud-plate);
  border-radius: 4px;
  border: 1px solid transparent;
  font-size: 16.5px;
  font-weight: 600;
  letter-spacing: 0.015em;
  white-space: nowrap;
  transition: opacity 0.55s;
}
.kf-entry.self { border-color: rgba(192, 57, 43, 0.95); background: rgba(24, 10, 8, 0.78); }
.kf-entry.fading { opacity: 0; }
.kf-entry .n-ct { color: var(--hud-ct); }
.kf-entry .n-t { color: var(--hud-t); }
.kf-entry .wpn {
  display: flex;
  align-items: center;
  color: rgba(255, 255, 255, 0.88);
}
.kf-entry .wpn svg { height: 15px; width: auto; display: block; }
.kf-entry .hs svg { height: 13px; width: auto; display: block; }

/* ---------- health + armor (bottom-left) ---------- */

#hud-health {
  position: absolute;
  left: 22px;
  bottom: 22px;
  display: flex;
  align-items: center;
  padding: 8px 18px 9px 14px;
  gap: 18px;
  min-width: 210px;
}
#hud-health.low { animation: hud-lowpulse 1.1s ease-in-out infinite; }
@keyframes hud-lowpulse {
  0%, 100% { background: var(--hud-plate); }
  50% { background: rgba(90, 16, 10, 0.72); }
}
.vital { display: flex; align-items: center; gap: 9px; }
.vital svg { width: 21px; height: 21px; opacity: 0.92; flex: none; }
.vital .num { font-size: 42px; font-weight: 600; line-height: 0.95; min-width: 54px; }
#hud-hp-num.low { color: var(--hud-red); }
.vital.armor .num { font-size: 30px; font-weight: 600; color: var(--hud-text-dim); min-width: 40px; }
.vital.armor svg { width: 18px; height: 18px; opacity: 0.7; }
#hud-hpbar {
  position: absolute;
  left: 14px;
  right: 14px;
  bottom: 4px;
  height: 2px;
  background: rgba(255, 255, 255, 0.14);
  border-radius: 1px;
  overflow: hidden;
}
#hud-hpbar i {
  display: block;
  height: 100%;
  background: var(--hud-text);
  width: 100%;
  transition: width 0.18s ease-out;
}
#hud-hpbar i.low { background: var(--hud-red); }

/* ---------- ammo (bottom-right) ---------- */

#hud-ammo {
  position: absolute;
  right: 22px;
  bottom: 22px;
  padding: 6px 16px 9px;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  min-width: 150px;
}
#hud-weapon-name {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.16em;
  color: var(--hud-text-dim);
  padding-bottom: 1px;
}
#hud-ammo .counts { display: flex; align-items: baseline; gap: 7px; }
#hud-ammo-mag { font-size: 42px; font-weight: 700; line-height: 0.95; }
#hud-ammo-mag.dry { color: var(--hud-red); }
#hud-ammo .sep { font-size: 24px; color: rgba(255, 255, 255, 0.4); font-weight: 400; }
#hud-ammo-reserve { font-size: 23px; font-weight: 400; color: var(--hud-text-dim); }

/* ---------- crosshair ---------- */

#hud-crosshair {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 0;
  height: 0;
}
#hud-crosshair .xline {
  position: absolute;
  background: var(--xh-color, rgba(160, 240, 160, 0.95));
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.35);
}

/* hitmarker */
#hud-hitmarker { position: absolute; left: 50%; top: 50%; opacity: 0; }
#hud-hitmarker .tick {
  position: absolute;
  width: 2px;
  height: 8px;
  background: #fff;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.3);
}
#hud-hitmarker.hs .tick { background: #e8452f; }
#hud-hitmarker.show { opacity: 1; }

/* damage direction indicators */
.dmg-ind {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 150px;
  height: 150px;
  margin: -75px 0 0 -75px;
  border: 4px solid transparent;
  border-top-color: rgba(200, 44, 30, 0.9);
  border-radius: 50%;
  pointer-events: none;
}

/* ---------- plant / defuse progress (lower-center) ---------- */

#hud-progress {
  position: absolute;
  left: 50%;
  bottom: 27%;
  transform: translateX(-50%);
  width: 300px;
  padding: 7px 12px 10px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
#hud-progress .row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.18em;
}
#hud-progress .row svg { height: 16px; width: auto; opacity: 0.85; }
#hud-progress .track {
  height: 5px;
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.16);
  overflow: hidden;
}
#hud-progress .fill {
  display: block;
  height: 100%;
  width: 0%;
  background: var(--hud-text);
  border-radius: 2px;
}

/* ---------- vignette ---------- */

#hud-vignette {
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at center, rgba(192, 57, 43, 0) 52%, rgba(170, 26, 12, 0.55) 100%);
  opacity: 0;
  pointer-events: none;
}

/* ---------- center announcements + messages ---------- */

#hud-announce {
  position: absolute;
  top: 19%;
  left: 50%;
  transform: translateX(-50%);
  padding: 6px 26px 8px;
  font-size: 26px;
  font-weight: 700;
  letter-spacing: 0.24em;
  text-align: center;
  white-space: nowrap;
  opacity: 0;
  transition: opacity 0.3s;
}
#hud-announce.show { opacity: 1; }
#hud-announce.danger { color: #ff8c76; }

#hud-message {
  position: absolute;
  bottom: 19%;
  left: 50%;
  transform: translateX(-50%);
  padding: 4px 18px 6px;
  font-size: 18px;
  font-weight: 600;
  letter-spacing: 0.08em;
  color: var(--hud-text-dim);
  white-space: nowrap;
  opacity: 0;
  transition: opacity 0.3s;
}
#hud-message.show { opacity: 1; }

/* ---------- round-end banner ---------- */

#hud-roundend {
  position: absolute;
  top: 24%;
  left: 50%;
  transform: translateX(-50%);
  text-align: center;
  padding: 14px 46px 16px;
  background: var(--hud-plate-heavy);
  border-radius: 6px;
}
#hud-roundend .winner {
  font-size: 40px;
  font-weight: 700;
  letter-spacing: 0.18em;
  line-height: 1.05;
}
#hud-roundend .winner.ct { color: var(--hud-ct); }
#hud-roundend .winner.t { color: var(--hud-t); }
#hud-roundend .reason {
  padding-top: 4px;
  font-size: 16px;
  font-weight: 600;
  letter-spacing: 0.22em;
  color: var(--hud-text-dim);
}

/* ==========================================================================
   FULL-SCREEN OVERLAYS (pointer events enabled)
   ========================================================================== */

.hud-overlay {
  position: absolute;
  inset: 0;
  pointer-events: auto;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
}

/* ---------- buy menu ---------- */

#hud-buymenu {
  background: rgba(8, 10, 13, 0.82);
  backdrop-filter: blur(3px);
  justify-content: flex-start;
}
#hud-buymenu .buy-head {
  width: min(1180px, 94vw);
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  padding: 34px 6px 18px;
}
#hud-buymenu .buy-title {
  font-size: 30px;
  font-weight: 700;
  letter-spacing: 0.22em;
}
#hud-buymenu .buy-title small {
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.18em;
  color: var(--hud-text-dim);
  padding-left: 14px;
}
#hud-buymenu .buy-money {
  font-size: 30px;
  font-weight: 700;
  color: var(--hud-green);
}
#hud-buymenu .buy-money small {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.14em;
  color: var(--hud-text-dim);
  padding-right: 10px;
}
#hud-buymenu .buy-cols {
  width: min(1180px, 94vw);
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 14px;
  align-items: start;
}
.buy-col .col-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.2em;
  color: var(--hud-text-dim);
  padding: 0 2px 8px;
}
.buy-col .col-label::after {
  content: "";
  flex: 1;
  height: 1px;
  background: rgba(255, 255, 255, 0.14);
}
.buy-col .col-label b {
  color: rgba(255, 255, 255, 0.5);
  font-weight: 600;
  font-size: 12px;
}
.buy-items { display: flex; flex-direction: column; gap: 8px; }
.buy-card {
  position: relative;
  display: flex;
  flex-direction: column;
  padding: 9px 12px 8px;
  background: linear-gradient(180deg, rgba(52, 58, 66, 0.62), rgba(24, 27, 31, 0.72));
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 4px;
  text-align: left;
  transition: background 0.12s, border-color 0.12s;
}
.buy-card::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 2px;
  border-radius: 0 0 4px 4px;
  background: var(--card-accent, rgba(255, 255, 255, 0.35));
  opacity: 0.85;
}
.buy-card:hover {
  background: linear-gradient(180deg, rgba(74, 82, 92, 0.72), rgba(34, 38, 43, 0.8));
  border-color: rgba(255, 255, 255, 0.28);
}
.buy-card .sil { height: 44px; display: flex; align-items: center; justify-content: center; padding: 2px 0 4px; }
.buy-card .sil svg { max-height: 38px; width: auto; max-width: 92%; }
.buy-card .sil svg path,
.buy-card .sil svg polygon,
.buy-card .sil svg rect,
.buy-card .sil svg circle { fill: rgba(235, 240, 245, 0.9); }
.buy-card .meta { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.buy-card .name {
  font-size: 16px;
  font-weight: 600;
  letter-spacing: 0.05em;
  white-space: nowrap;
}
.buy-card .price { font-size: 15px; font-weight: 600; color: var(--hud-green); }
.buy-card .key {
  position: absolute;
  top: 5px;
  left: 8px;
  font-size: 11px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.38);
}
.buy-card.owned .price { color: var(--hud-text-dim); }
.buy-card.disabled { pointer-events: none; }
.buy-card.disabled .sil svg path,
.buy-card.disabled .sil svg polygon,
.buy-card.disabled .sil svg rect,
.buy-card.disabled .sil svg circle { fill: rgba(235, 240, 245, 0.25); }
.buy-card.disabled .name { color: rgba(255, 255, 255, 0.35); }
.buy-card.disabled .price { color: rgba(192, 57, 43, 0.85); }
.buy-card.disabled { background: linear-gradient(180deg, rgba(30, 33, 37, 0.55), rgba(18, 20, 23, 0.6)); }
#hud-buymenu .buy-foot {
  width: min(1180px, 94vw);
  padding: 20px 6px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.14em;
  color: rgba(255, 255, 255, 0.42);
}

/* ---------- scoreboard ---------- */

#hud-scoreboard { background: rgba(8, 10, 13, 0.72); }
#hud-scoreboard .sb-panel {
  width: 560px;
  background: var(--hud-plate-heavy);
  border-radius: 6px;
  padding: 20px 26px 22px;
}
#hud-scoreboard .sb-title {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  font-size: 22px;
  font-weight: 700;
  letter-spacing: 0.2em;
  padding-bottom: 12px;
}
#hud-scoreboard .sb-title .score { font-size: 22px; }
#hud-scoreboard .sb-title .score .ct { color: var(--hud-ct); }
#hud-scoreboard .sb-title .score .t { color: var(--hud-t); }
#hud-scoreboard table { width: 100%; border-collapse: collapse; }
#hud-scoreboard th {
  text-align: left;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.18em;
  color: rgba(255, 255, 255, 0.42);
  padding: 4px 8px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}
#hud-scoreboard th.num, #hud-scoreboard td.num { text-align: right; width: 64px; }
#hud-scoreboard td {
  font-size: 17px;
  font-weight: 600;
  padding: 5px 8px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}
#hud-scoreboard tr.team-head td {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.2em;
  padding-top: 12px;
  border-bottom: none;
}
#hud-scoreboard tr.team-head.ct td { color: var(--hud-ct); }
#hud-scoreboard tr.team-head.t td { color: var(--hud-t); }
#hud-scoreboard tr.me td { background: rgba(255, 255, 255, 0.06); }
#hud-scoreboard tr.dead td:first-child { color: rgba(255, 255, 255, 0.4); }

/* ---------- start menu ---------- */

#hud-menu {
  background:
    radial-gradient(ellipse at 50% 30%, rgba(64, 52, 34, 0.35), rgba(8, 10, 13, 0) 60%),
    linear-gradient(180deg, #101418 0%, #0b0e12 55%, #07090c 100%);
}
#hud-menu .menu-kicker {
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.55em;
  color: var(--hud-t);
  padding-left: 0.55em;
}
#hud-menu .menu-title {
  font-size: 92px;
  font-weight: 700;
  letter-spacing: 0.1em;
  line-height: 1;
  padding: 6px 0 2px;
  text-align: center;
}
#hud-menu .menu-sub {
  font-size: 15px;
  font-weight: 400;
  letter-spacing: 0.3em;
  color: var(--hud-text-dim);
  padding-bottom: 44px;
}
.menu-btn {
  min-width: 260px;
  padding: 12px 40px 14px;
  font-size: 22px;
  font-weight: 700;
  letter-spacing: 0.3em;
  color: #101418;
  background: var(--hud-t);
  border-radius: 4px;
  transition: filter 0.12s, transform 0.12s;
}
.menu-btn:hover { filter: brightness(1.12); transform: translateY(-1px); }
.menu-btn.ghost {
  background: transparent;
  color: var(--hud-text);
  border: 1px solid rgba(255, 255, 255, 0.35);
}
#hud-menu .team-row { display: flex; gap: 18px; }
.team-card {
  width: 250px;
  padding: 22px 24px 20px;
  background: var(--hud-plate);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 6px;
  text-align: left;
  transition: border-color 0.12s, background 0.12s, transform 0.12s;
}
.team-card:hover { transform: translateY(-2px); background: rgba(20, 25, 31, 0.8); }
.team-card.ct:hover { border-color: var(--hud-ct); }
.team-card.t:hover { border-color: var(--hud-t); }
.team-card .abbr { font-size: 44px; font-weight: 700; line-height: 1; }
.team-card.ct .abbr { color: var(--hud-ct); }
.team-card.t .abbr { color: var(--hud-t); }
.team-card .full {
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.16em;
  padding: 6px 0 2px;
}
.team-card .desc { font-size: 13px; color: var(--hud-text-dim); letter-spacing: 0.04em; }
#hud-menu .controls {
  position: absolute;
  bottom: 30px;
  display: flex;
  gap: 26px;
  font-size: 14px;
  letter-spacing: 0.06em;
  color: rgba(255, 255, 255, 0.55);
}
#hud-menu .controls b {
  color: var(--hud-text);
  font-weight: 600;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 3px;
  padding: 0 6px 1px;
  margin-right: 6px;
  font-size: 12.5px;
  letter-spacing: 0.08em;
}

/* ---------- pause ---------- */

#hud-pause { background: rgba(8, 10, 13, 0.78); backdrop-filter: blur(2px); }
#hud-pause .pause-title {
  font-size: 46px;
  font-weight: 700;
  letter-spacing: 0.34em;
  padding-bottom: 26px;
  padding-left: 0.34em;
}
#hud-pause .menu-btn + .menu-btn { margin-top: 12px; }
#hud-pause .hint {
  padding-top: 26px;
  font-size: 13px;
  letter-spacing: 0.14em;
  color: rgba(255, 255, 255, 0.45);
}

/* ---------- match end ---------- */

#hud-matchend { background: rgba(8, 10, 13, 0.88); }
#hud-matchend .verdict {
  font-size: 84px;
  font-weight: 700;
  letter-spacing: 0.22em;
  padding-left: 0.22em;
  line-height: 1;
}
#hud-matchend .verdict.win { color: var(--hud-t); }
#hud-matchend .verdict.lose { color: var(--hud-red); }
#hud-matchend .final {
  display: flex;
  align-items: baseline;
  gap: 20px;
  padding: 26px 0 40px;
  font-size: 58px;
  font-weight: 700;
}
#hud-matchend .final .ct { color: var(--hud-ct); }
#hud-matchend .final .t { color: var(--hud-t); }
#hud-matchend .final .dash { color: rgba(255, 255, 255, 0.4); font-size: 42px; }
#hud-matchend .final small {
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.2em;
  color: var(--hud-text-dim);
  align-self: center;
}
