/* WARBORN ARENA — UI layer. Dark ember palette, thin lines, solid panels. */
:root {
  --bg: #0d0809;
  --panel: rgba(18, 11, 11, .86);
  --panel-solid: #150e0e;
  --text: #f3e9df;
  --muted: #a8978a;
  --dim: #6e6159;
  --accent: #ff7a2f;
  --accent-hi: #ffa266;
  --line: rgba(255, 235, 220, .12);
  --line-2: rgba(255, 235, 220, .22);
  --good: #7fd88a;
  --bad: #ff6a5a;
  --f-display: 'Philosopher', Georgia, serif;
  --f-ui: 'Inter Tight', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --r: 10px;
  --ease: cubic-bezier(.2, .7, .2, 1);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body {
  margin: 0; height: 100%; overflow: hidden;
  background: var(--bg); color: var(--text);
  font: 15px/1.45 var(--f-ui);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}
button, input { font: inherit; color: inherit; }
h1, h2, h3, p { margin: 0; }
svg { display: block; }
kbd { font-family: var(--f-ui); }

#stage { position: fixed; inset: 0; width: 100%; height: 100%; display: block; outline: none; }
body.in-game #stage { cursor: crosshair; }
#labels { position: fixed; inset: 0; pointer-events: none; overflow: hidden; z-index: 1; contain: strict; }
#hud { position: fixed; inset: 0; pointer-events: none; z-index: 2; user-select: none; }
#ui { position: fixed; inset: 0; overflow-y: auto; z-index: 3; overscroll-behavior: contain; }

/* ───────── Buttons and fields ───────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 46px; padding: 0 20px;
  border: 1px solid var(--line-2); border-radius: var(--r);
  background: rgba(255, 240, 225, .04);
  font-weight: 600; font-size: 15px; letter-spacing: .01em; white-space: nowrap;
  cursor: pointer;
  transition: background-color .18s var(--ease), border-color .18s var(--ease), color .18s var(--ease), transform .12s var(--ease);
}
.btn svg { width: 18px; height: 18px; flex: none; }
.btn:hover { background: rgba(255, 240, 225, .09); border-color: rgba(255, 235, 220, .36); }
.btn:active { transform: translateY(1px); }
.btn:focus-visible, .ct:focus-visible, .sl-x:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #1a0a03; }
.btn.primary:hover { background: var(--accent-hi); border-color: var(--accent-hi); }
.btn.ghost { background: transparent; border-color: transparent; color: var(--muted); }
.btn.ghost:hover { color: var(--text); background: rgba(255, 240, 225, .06); }
.btn.big { min-height: 54px; font-size: 16px; padding: 0 28px; }
.btn.small { min-height: 34px; padding: 0 14px; font-size: 13px; }
.btn:disabled { opacity: .4; cursor: not-allowed; transform: none; }
.btn.done { border-color: var(--good); color: var(--good); }

.field { display: grid; gap: 6px; }
.f-l { font-size: 12px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.field input {
  height: 48px; padding: 0 14px; width: 100%;
  border: 1px solid var(--line-2); border-radius: var(--r);
  background: rgba(8, 4, 4, .6);
  font-size: 16px; outline: none;
  transition: border-color .18s var(--ease), background-color .18s var(--ease);
}
.field input::placeholder { color: var(--dim); }
.field input:focus { border-color: var(--accent); background: rgba(8, 4, 4, .8); }
#m-code { text-transform: uppercase; letter-spacing: .3em; font-weight: 700; }
#m-code::placeholder { letter-spacing: .3em; font-weight: 500; }

.ui-err { color: var(--bad); font-size: 14px; }
.sec-h { font: 600 12px/1 var(--f-ui); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }

/* ───────── Menu / lobby screens ───────── */
.screen {
  position: relative; min-height: 100%;
  display: grid;
  grid-template-columns: minmax(320px, 400px) 1fr minmax(360px, 440px);
  column-gap: 40px;
  padding: 44px 48px;
  align-items: start;
}
/* Scrim: dark at both edges, open in the middle where the hero stands. */
.screen::before {
  content: ''; position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background:
    linear-gradient(90deg, rgba(13, 8, 9, .94) 0%, rgba(13, 8, 9, .72) 24%, rgba(13, 8, 9, 0) 40%,
      rgba(13, 8, 9, 0) 58%, rgba(13, 8, 9, .74) 72%, rgba(13, 8, 9, .95) 100%),
    linear-gradient(180deg, rgba(13, 8, 9, .5) 0%, rgba(13, 8, 9, 0) 22%, rgba(13, 8, 9, 0) 78%, rgba(13, 8, 9, .6) 100%);
}
.m-col { display: grid; gap: 28px; align-content: start; min-width: 0; }
.m-main { grid-column: 1; }
.m-classes { grid-column: 3; gap: 16px; }

.screen.boot { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; text-align: center; }
.screen.boot h1 { line-height: 0; }
.screen.boot .wa-logo { width: min(520px, 80vw); }
.screen.boot p { color: var(--muted); }
.screen.boot::before { background: rgba(13, 8, 9, .55); }

/* Logo A: shared defs live in public/js/logo.js; the lettering waits for its Cinzel faces. */
.wa-logo { display: block; width: 100%; height: auto; aspect-ratio: 696 / 424; overflow: visible; }
.wa-logo .wa-t { transition: opacity .3s var(--ease); }
html:not(.wa-fonts) .wa-logo .wa-t { opacity: 0; }
.vh {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; border: 0;
}
.m-head h1 { line-height: 0; }
.m-head .wa-logo { width: min(100%, 340px); }
.m-tag { margin-top: 14px; font-size: 17px; color: var(--muted); max-width: 30ch; }
.m-form { display: grid; gap: 20px; }
.m-btns { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.m-btns .btn { padding: 0 12px; }
.m-join { display: grid; grid-template-columns: 1fr auto; gap: 10px; align-items: end; padding-top: 20px; border-top: 1px solid var(--line); }
.m-join .btn { min-height: 48px; }
.m-touch { display: none; font-size: 13px; color: var(--muted); }
@media (pointer: coarse) { .m-touch { display: block; } }

/* class tabs */
.ct-row { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; }
.ct {
  display: grid; justify-items: center; gap: 4px;
  padding: 12px 4px 10px;
  border: 1px solid var(--line); border-radius: var(--r);
  background: rgba(20, 12, 12, .7);
  cursor: pointer; text-align: center;
  transition: border-color .18s var(--ease), background-color .18s var(--ease);
}
.ct:hover { border-color: var(--line-2); background: rgba(30, 18, 16, .85); }
.ct-em { width: 26px; height: 26px; color: var(--muted); transition: color .18s var(--ease); }
.ct-em svg { width: 100%; height: 100%; }
.ct-name { font-weight: 600; font-size: 13px; line-height: 1.15; }
.ct-role { font-size: 11px; color: var(--dim); line-height: 1.1; }
/* Seven heroes: 4 + 3 tiles that fill both rows edge to edge (12-column track). */
.ct-row.ct-cls { grid-template-columns: repeat(12, minmax(0, 1fr)); }
.ct-cls .ct { grid-column: span 3; min-width: 0; padding: 10px 4px 9px; }
.ct-cls .ct:nth-child(n+5) { grid-column: span 4; }
.ct.on { border-color: var(--cc); background: color-mix(in srgb, var(--cc) 14%, rgba(20, 12, 12, .9)); }
.ct.on .ct-em, .ct:hover .ct-em { color: var(--cc); }
.ct.on .ct-role { color: var(--muted); }

/* class detail */
.cls-detail { min-height: 0; }
.cd {
  display: grid; gap: 16px;
  padding: 20px;
  border: 1px solid var(--line); border-radius: 14px;
  background: var(--panel);
}
.cd-head { display: flex; align-items: center; gap: 14px; }
.cd-em {
  width: 48px; height: 48px; flex: none; display: grid; place-items: center;
  border-radius: 12px; color: var(--cc);
  background: color-mix(in srgb, var(--cc) 16%, transparent);
  border: 1px solid color-mix(in srgb, var(--cc) 45%, transparent);
}
.cd-em svg { width: 26px; height: 26px; }
.cd-head h3 { font: 700 26px/1.05 var(--f-display); }
.cd-head h3 .en { margin-left: 4px; font: 700 13px/1 'Cinzel', Georgia, serif; letter-spacing: .08em; color: var(--muted); white-space: nowrap; }
.cd-head p { margin-top: 3px; font-size: 13px; color: var(--muted); }
.cd-lore { color: var(--text); opacity: .86; font-size: 14px; }
.cd-story summary {
  display: inline-flex; align-items: center; gap: 8px; width: fit-content;
  list-style: none; cursor: pointer; color: var(--muted); font-size: 13px; font-weight: 600;
  transition: color .2s var(--ease);
}
.cd-story summary::-webkit-details-marker { display: none; }
.cd-story summary::before {
  content: ''; width: 6px; height: 6px; margin-left: 1px;
  border: solid currentColor; border-width: 0 1.5px 1.5px 0;
  transform: translateX(-1px) rotate(-45deg); transition: transform .25s var(--ease);
}
.cd-story[open] summary::before { transform: translateY(-2px) rotate(45deg); }
.cd-story summary:hover { color: var(--text); }
.cd-story summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px; }
.cd-story p { margin-top: 8px; color: var(--text); opacity: .78; font-size: 14px; line-height: 1.5; max-width: 62ch; }
.cd-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 20px; }
.st { display: flex; align-items: center; justify-content: space-between; gap: 10px; font-size: 12px; color: var(--muted); }
.st i { display: flex; gap: 3px; }
.st b { width: 12px; height: 5px; border-radius: 2px; background: rgba(255, 235, 220, .14); }
.st b.on { background: var(--cc); }
.cd-abil { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; border-top: 1px solid var(--line); padding-top: 10px; }
.cd-abil li { display: grid; grid-template-columns: 34px 1fr; gap: 12px; align-items: start; padding: 7px 0; }
.ab-ic {
  width: 34px; height: 34px; display: grid; place-items: center;
  border-radius: 8px; border: 1px solid var(--line-2); color: var(--text);
  background: rgba(255, 240, 225, .03);
}
.ab-ic svg { width: 19px; height: 19px; }
.cd-abil li.ult .ab-ic { color: var(--cc); border-color: color-mix(in srgb, var(--cc) 60%, transparent); background: color-mix(in srgb, var(--cc) 14%, transparent); }
.ab-h { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; font-size: 14px; line-height: 1.3; }
.ab-h kbd {
  font-size: 10px; font-weight: 700; letter-spacing: .04em;
  padding: 2px 5px; border-radius: 4px; border: 1px solid var(--line-2); color: var(--muted);
  transform: translateY(-1px);
}
.ab-h em { margin-left: auto; font-style: normal; font-size: 12px; color: var(--dim); }
.cd-abil li.ult .ab-h em { color: var(--cc); }
.ab-d { margin-top: 2px; font-size: 13px; line-height: 1.4; color: var(--muted); }

/* Short laptop screens: the whole class card fits without scrolling. */
@media (min-width: 901px) and (max-height: 860px) {
  .screen { padding-top: 24px; padding-bottom: 24px; }
  .m-classes { gap: 12px; }
  .cd { gap: 10px; padding: 16px 18px; }
  .cd-em { width: 40px; height: 40px; }
  .cd-abil { padding-top: 6px; }
  .cd-abil li { padding: 4px 0; }
  .ab-d { line-height: 1.35; }
}

/* lobby */
.l-title { font: 700 clamp(40px, 4vw, 52px)/1 var(--f-display); }
.l-head { display: grid; gap: 12px; }
.l-code-row { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.l-code { font: 700 56px/1 var(--f-display); letter-spacing: .14em; color: var(--accent); }
.l-help { color: var(--muted); font-size: 14px; max-width: 38ch; }
.l-champ { display: flex; align-items: center; gap: 8px; font-size: 14px; color: var(--accent-hi); }
.l-champ svg { width: 18px; height: 18px; flex: none; }
.l-champ b { color: var(--text); }

.l-slots { display: grid; gap: 8px; }
.l-maps { display: grid; gap: 10px; }
.l-map-hint { margin: 0; font-size: 13px; line-height: 1.45; color: var(--muted); }
.l-map-hint b { color: var(--text); font-weight: 600; }
.slot {
  position: relative;
  display: flex; align-items: center; gap: 14px;
  min-height: 70px; padding: 12px 14px 12px 16px;
  border: 1px solid var(--line); border-radius: var(--r);
  background: var(--panel);
}
.slot.me { border-color: color-mix(in srgb, var(--c) 50%, var(--line)); }
.sl-em {
  width: 40px; height: 40px; flex: none; display: grid; place-items: center;
  border-radius: 10px; color: var(--cc); background: color-mix(in srgb, var(--cc) 14%, transparent);
}
.sl-em svg { width: 22px; height: 22px; }
.sl-main { min-width: 0; flex: 1; }
.sl-name { display: flex; align-items: center; gap: 8px; min-width: 0; font-size: 15px; }
.sl-name b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sl-you { font-size: 11px; font-weight: 700; color: var(--c); letter-spacing: .04em; }
.sl-host { width: 16px; height: 16px; color: var(--accent-hi); flex: none; }
.sl-host svg { width: 100%; height: 100%; }
.sl-bot { display: inline-flex; align-items: center; gap: 4px; font-size: 11px; color: var(--dim); flex: none; }
.sl-bot svg { width: 14px; height: 14px; }
.sl-cls { font-size: 13px; color: var(--muted); }
.sl-stat { font-size: 12px; color: var(--dim); margin-top: 1px; }
.sl-x {
  width: 34px; height: 34px; flex: none; display: grid; place-items: center;
  border: 0; border-radius: 8px; background: transparent; color: var(--dim); cursor: pointer;
  transition: background-color .18s var(--ease), color .18s var(--ease);
}
.sl-x svg { width: 16px; height: 16px; }
.sl-x:hover { background: rgba(255, 240, 225, .08); color: var(--text); }
.slot.empty { justify-content: space-between; border-style: dashed; background: rgba(18, 11, 11, .45); }
.sl-free { color: var(--dim); font-size: 14px; }

.l-actions { display: grid; grid-template-columns: 1fr auto; gap: 10px; align-items: center; }
.l-wait { color: var(--muted); font-size: 14px; }
.l-hint { color: var(--muted); font-size: 13px; }

/* Start/leave dock: stays in view while the lobby scrolls. */
.l-foot {
  position: sticky; bottom: 16px; z-index: 2;
  display: grid; gap: 8px; padding: 10px;
  border: 1px solid var(--line-2); border-radius: calc(var(--r) + 4px);
  background: var(--panel-solid); box-shadow: 0 14px 36px rgba(0, 0, 0, .55);
}
.l-foot .l-hint, .l-foot .ui-err { padding: 0 6px 2px; }
.l-foot .l-wait { padding-left: 6px; }

/* Laptop and 1080p screens: slots, maps, voice and the dock fit in one view where they can. */
@media (min-width: 901px) and (max-height: 1100px) {
  .l-main { gap: 20px; }
  .l-code { font-size: 44px; }
  .l-help { max-width: none; }
  .l-slots { gap: 6px; }
  .slot { min-height: 60px; padding-block: 8px; }
}

/* ───────── Narrow screens: hero on top, panels below ───────── */
@media (max-width: 900px) {
  .screen { grid-template-columns: 1fr; padding: 0 16px 32px; row-gap: 28px; }
  .screen.boot { padding: 16px; }
  .m-main { grid-column: 1; padding-top: 40vh; }
  .m-classes { grid-column: 1; }
  .screen::before {
    background: linear-gradient(180deg, rgba(13, 8, 9, .35) 0%, rgba(13, 8, 9, 0) 14%, rgba(13, 8, 9, 0) 30%,
      rgba(13, 8, 9, .86) 46%, rgba(13, 8, 9, .96) 64%);
  }
  .m-head .wa-logo { width: min(100%, 300px); }
  .m-tag { font-size: 16px; margin-top: 10px; }
  .l-code { font-size: 46px; }
  .screen.lobby { padding-bottom: 150px; }
  .l-foot {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 4;
    border-width: 1px 0 0; border-radius: 0;
    padding: 10px 16px calc(10px + env(safe-area-inset-bottom));
    box-shadow: 0 -14px 32px rgba(0, 0, 0, .5);
  }
}
@media (max-width: 480px) {
  .ct-role { display: none; }
  .ct { padding: 10px 2px 9px; }
  .ct-name { font-size: 12px; }
  .m-btns { grid-template-columns: 1fr; }
  .cd { padding: 16px; }
  .cd-stats { grid-template-columns: 1fr; }
}
@media (max-width: 360px) {
  .ct-name { font-size: 11px; letter-spacing: -.01em; }
}

/* ───────── Hero labels and damage numbers ───────── */
.hl { position: absolute; left: 0; top: 0; width: 84px; margin-left: -42px; margin-top: -30px; will-change: transform; }
.hl-n {
  font: 600 12px/1 var(--f-ui); text-align: center; color: #fff;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  text-shadow: 0 1px 2px rgba(0, 0, 0, .9), 0 0 6px rgba(0, 0, 0, .6);
  margin-bottom: 4px;
}
.hl.mine .hl-n { color: var(--slot); }
.hl-b {
  position: relative; height: 7px; border-radius: 3px; overflow: hidden;
  background: rgba(10, 5, 5, .78); box-shadow: 0 0 0 1px rgba(0, 0, 0, .55);
}
.hl-hp { position: absolute; left: 0; top: 0; bottom: 0; background: var(--slot); transition: width .12s linear; }
.hl-sh { position: absolute; top: 0; bottom: 0; background: #e8eef5; transition: width .12s linear, left .12s linear; }
.hl.low .hl-hp { animation: lowhp .7s ease-in-out infinite alternate; }
@keyframes lowhp { to { filter: brightness(1.6); } }

.dn {
  position: absolute; left: 0; top: 0;
  font: 800 17px/1 var(--f-ui); white-space: nowrap; color: #fff;
  text-shadow: 0 1px 2px rgba(0, 0, 0, .95), 0 0 8px rgba(0, 0, 0, .55);
  will-change: transform, opacity;
}
.dn.other { color: #f2e6da; }
.dn.mine { color: #ffd166; }
.dn.me { color: #ff5a4a; }
.dn.shield { color: #cfe3f5; font-size: 15px; }
.dn.buff { color: var(--accent-hi); font-size: 16px; font-weight: 700; }
.dn.gold { color: #ffd86a; font-size: 18px; font-weight: 800; }
.dn.big { font-size: 24px; }
.dn.dim { opacity: .7; font-size: 14px; }

/* ───────── HUD ───────── */
#hud { font-size: 14px; }
.hud-vignette {
  position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(ellipse at center, transparent 55%, rgba(170, 10, 0, .75) 100%);
  opacity: var(--hit, 0);
}
.hud-vignette.low { animation: vig 1.1s ease-in-out infinite alternate; }
@keyframes vig { from { box-shadow: inset 0 0 90px rgba(200, 20, 0, .25); } to { box-shadow: inset 0 0 160px rgba(200, 20, 0, .55); } }

.hud-top {
  position: absolute; left: 16px; right: 16px; top: 14px;
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: start; gap: 16px;
}
.hud-board {
  justify-self: start; display: grid; gap: 4px; min-width: 196px;
  padding: 10px 12px; border-radius: var(--r);
  background: rgba(14, 8, 8, .72); border: 1px solid var(--line);
}
.hb-row { display: grid; grid-template-columns: 9px 1fr auto; align-items: center; gap: 8px; font-size: 13px; transition: opacity .2s; }
.hb-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--c); }
.hb-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 130px; }
.hb-row.me .hb-name { font-weight: 700; }
.hb-row.dead { opacity: .42; }
.hb-row.dead .hb-name { text-decoration: line-through; text-decoration-color: rgba(255, 235, 220, .45); }
.hb-row.wait { opacity: .55; }
.hb-pips { display: flex; gap: 3px; }
.hb-pips i { width: 8px; height: 8px; border-radius: 2px; border: 1px solid rgba(255, 235, 220, .3); }
.hb-pips i.on { background: var(--accent); border-color: var(--accent); }

.hud-round {
  display: grid; justify-items: center; gap: 2px; min-width: 140px;
  padding: 8px 18px 9px; border-radius: var(--r);
  background: rgba(14, 8, 8, .72); border: 1px solid var(--line);
  text-align: center;
}
.hr-n { font: 700 12px/1.2 var(--f-ui); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.hr-t { font: 700 24px/1 var(--f-ui); font-variant-numeric: tabular-nums; }
.hud-zone { display: none; font-size: 12px; font-weight: 600; color: var(--accent-hi); }
.hud-zone.on { display: block; }
.hud-zone.warn { color: var(--bad); animation: blink .8s steps(2, end) infinite; }
@keyframes blink { 50% { opacity: .45; } }
.hud-omen {
  display: none; margin-top: 4px; padding: 2px 9px; border-radius: 999px;
  font-size: 11px; font-weight: 700; letter-spacing: .04em; white-space: nowrap;
  color: #d4bcff; background: rgba(140, 90, 255, .14); border: 1px solid rgba(176, 130, 255, .38);
}
.hud-omen.on { display: block; }

.hud-feed { justify-self: end; display: grid; gap: 4px; justify-items: end; max-width: 360px; }
.kf {
  display: flex; align-items: center; gap: 7px;
  padding: 6px 10px; border-radius: 8px;
  background: rgba(14, 8, 8, .72); border: 1px solid var(--line);
  font-size: 13px; white-space: nowrap;
  animation: kfin .25s var(--ease);
  transition: opacity .8s;
}
.kf.me { border-color: rgba(255, 122, 47, .55); }
.kf.old { opacity: 0; }
.kf b { font-weight: 700; }
.kf-x { width: 13px; height: 13px; color: var(--muted); }
.kf-x svg { width: 100%; height: 100%; }
.kf-t { color: var(--muted); }
@keyframes kfin { from { opacity: 0; transform: translateX(14px); } }

.hud-toast {
  position: absolute; left: 50%; top: 92px; transform: translate(-50%, -8px);
  padding: 9px 16px; border-radius: 999px;
  background: rgba(14, 8, 8, .82); border: 1px solid var(--line-2);
  font-size: 14px; white-space: nowrap;
  opacity: 0; transition: opacity .25s, transform .25s var(--ease);
}
.hud-toast.on { opacity: 1; transform: translate(-50%, 0); }
.hud-toast b { color: var(--accent-hi); }

/* Announcer calls: first blood, multi-kills, duel, sudden death. */
.hud-call {
  position: absolute; left: 0; right: 0; top: max(18%, 138px);
  display: grid; justify-items: center; gap: 4px; text-align: center;
  pointer-events: none; opacity: 0; transition: opacity .35s;
}
.hud-call.on { opacity: 1; }
.hc-big {
  font: 700 clamp(28px, 4vw, 46px)/1.05 var(--f-display); color: var(--accent-hi);
  text-shadow: 0 3px 22px rgba(0, 0, 0, .85), 0 1px 3px rgba(0, 0, 0, .9);
}
.hc-sub { font-size: 15px; text-shadow: 0 1px 6px rgba(0, 0, 0, .9); }
.hc-sub b { font-weight: 700; }
.hud-call.on .hc-big { animation: callIn .5s var(--ease); }
@keyframes callIn { from { transform: scale(1.4); opacity: 0; letter-spacing: .12em; } }
.hud-call.k-blood .hc-big { color: #ff5a4a; }
.hud-call.k-multi .hc-big { color: #ffd27a; }
.hud-call.k-ghost .hc-big { color: #c79bff; }
.hud-call.k-duel .hc-big { color: var(--text); }
.hud-call.k-sd .hc-big { color: var(--bad); }
.hud-call.k-zone .hc-big { color: #ffc46b; }

.hud-center {
  position: absolute; left: 0; right: 0; top: 30%;
  display: grid; justify-items: center; gap: 10px; text-align: center;
  opacity: 0; transition: opacity .3s;
}
.hud-center.on { opacity: 1; }
.hb-big {
  font: 700 clamp(48px, 8vw, 96px)/1 var(--f-display);
  text-shadow: 0 4px 30px rgba(0, 0, 0, .8), 0 2px 4px rgba(0, 0, 0, .9);
}
.hb-sub { font-size: 17px; color: var(--text); opacity: .9; text-shadow: 0 1px 6px rgba(0, 0, 0, .9); }
.hb-omen { max-width: min(560px, 90vw); font-size: 15px; opacity: .92; text-shadow: 0 1px 6px rgba(0, 0, 0, .9); }
.hb-omen:empty { display: none; }
.hb-omen b { color: #d4bcff; }
.hud-center.k-count .hb-big { font-family: var(--f-ui); font-weight: 800; font-size: clamp(64px, 10vw, 128px); }
.hud-center.k-go .hb-big { color: var(--accent); }
.hud-center.k-win .hb-big { color: var(--bc, #ffd27a); }
.hud-center.k-lose .hb-big { color: var(--bc, #ff7a6a); }
.hud-center.k-draw .hb-big { color: var(--muted); }
.hud-center.pop .hb-big { animation: pop .45s var(--ease); }
@keyframes pop { from { transform: scale(1.35); opacity: 0; } }

.hud-spec {
  position: absolute; left: 50%; bottom: 120px; transform: translateX(-50%);
  display: none; flex-direction: column; align-items: center; gap: 4px;
  padding: 10px 18px; border-radius: var(--r);
  background: rgba(14, 8, 8, .78); border: 1px solid var(--line);
  text-align: center; white-space: nowrap;
}
.hud-spec.on { display: flex; }
.hs-big { font-size: 15px; }
.hs-small { font-size: 12px; color: var(--muted); }
.hud-spec.ghost { border-color: rgba(176, 108, 255, .55); box-shadow: 0 0 24px rgba(150, 90, 255, .18); }
.hud-spec.ghost .hs-big { color: #d4b8ff; }

.hud-hint {
  position: absolute; left: 50%; bottom: 128px; transform: translateX(-50%);
  font-size: 12px; color: var(--muted); white-space: nowrap;
  padding: 6px 12px; border-radius: 999px; background: rgba(14, 8, 8, .6);
  opacity: 0; transition: opacity .4s;
}
.hud-hint.on { opacity: 1; }

.hud-bottom {
  position: absolute; left: 50%; bottom: 16px; transform: translateX(-50%);
  display: grid; justify-items: center; gap: 8px;
  transition: opacity .3s;
}
.hud-bottom.off { opacity: 0; }
.hud-status { display: flex; gap: 6px; min-height: 22px; align-items: end; }
.chip {
  font-size: 11px; font-weight: 700; letter-spacing: .03em;
  padding: 3px 8px; border-radius: 999px;
  background: rgba(14, 8, 8, .8); border: 1px solid var(--line-2);
}
.chip.good { color: var(--good); border-color: rgba(127, 216, 138, .45); }
.chip.bad { color: var(--bad); border-color: rgba(255, 106, 90, .45); }

.hud-hp {
  position: relative; width: 352px; height: 20px; border-radius: 6px; overflow: hidden;
  background: rgba(10, 5, 5, .85); border: 1px solid rgba(255, 235, 220, .2);
}
.hud-hp i { position: absolute; top: 0; bottom: 0; left: 0; }
.hp-lag { background: rgba(255, 220, 190, .5); transition: width .5s ease-out .15s; }
.hp-fill { background: linear-gradient(180deg, #7fdc8c, #4caa5b); transition: width .1s linear; }
.hud-hp.low .hp-fill { background: linear-gradient(180deg, #ff7a6a, #d23b2c); }
.hp-sh { background: rgba(232, 238, 245, .92); transition: width .1s linear, left .1s linear; }
.hp-num {
  position: absolute; inset: 0; display: grid; place-items: center;
  font: 700 12px/1 var(--f-ui); font-variant-numeric: tabular-nums;
  text-shadow: 0 1px 2px rgba(0, 0, 0, .9);
}
.hp-num em { font-style: normal; color: #e8eef5; }

.hud-skills { display: flex; gap: 8px; }
.sk {
  position: relative; width: 64px; height: 64px; border-radius: 10px; overflow: hidden;
  background: rgba(14, 8, 8, .86); border: 1px solid rgba(255, 235, 220, .22);
  display: grid; place-items: center;
}
.sk-ic { width: 30px; height: 30px; color: var(--text); position: relative; z-index: 1; transition: opacity .15s; }
.sk-ic svg { width: 100%; height: 100%; }
.sk-cd {
  position: absolute; inset: 0; z-index: 2;
  background: conic-gradient(rgba(6, 3, 3, .78) calc(var(--p, 0) * 360deg), transparent 0);
}
.sk-n {
  position: absolute; inset: 0; z-index: 3; display: grid; place-items: center;
  font: 800 19px/1 var(--f-ui); font-variant-numeric: tabular-nums;
  text-shadow: 0 1px 3px rgba(0, 0, 0, .9);
}
.sk kbd {
  position: absolute; left: 4px; bottom: 3px; z-index: 3;
  font-size: 10px; font-weight: 700; color: var(--muted); letter-spacing: .02em;
}
.sk.cool .sk-ic { opacity: .45; }
.sk.off .sk-ic { opacity: .3; }
.sk.off { border-color: rgba(255, 235, 220, .1); }
.sk.pop { animation: skpop .35s var(--ease); }
@keyframes skpop { 40% { transform: scale(1.1); border-color: var(--accent-hi); } }
.sk-en { position: absolute; left: 0; right: 0; bottom: 0; height: 0; background: rgba(255, 122, 47, .26); z-index: 0; }
.sk-r { border-color: rgba(255, 122, 47, .4); }
.sk-r.charging .sk-ic { opacity: .55; }
.sk-r.ready { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent), 0 0 18px rgba(255, 122, 47, .55); }
.sk-r.ready .sk-ic { color: var(--accent-hi); }
.sk-r.ready .sk-en { background: rgba(255, 122, 47, .32); }
/* Recast window: the slot glows in the hero colour, a ring drains as the window closes,
   and the timer moves to the corner so the icon stays readable. */
.sk.rc {
  border-color: var(--rc-c, var(--accent));
  box-shadow: 0 0 0 1px var(--rc-c, var(--accent)), 0 0 14px color-mix(in srgb, var(--rc-c, var(--accent)) 50%, transparent);
  animation: rcpulse .7s ease-in-out infinite alternate;
}
.sk.rc .sk-cd { opacity: 0; }
.sk.rc .sk-ic { opacity: 1; color: var(--rc-c, var(--accent-hi)); }
.sk.rc .sk-n { place-items: start end; padding: 5px 6px; font-size: 12px; color: var(--rc-c, var(--accent-hi)); }
.sk.rc.off { animation: none; }
.sk.rc.off .sk-ic { opacity: .35; }
@keyframes rcpulse {
  to { box-shadow: 0 0 0 1px var(--rc-c, var(--accent)), 0 0 24px color-mix(in srgb, var(--rc-c, var(--accent)) 80%, transparent); }
}
/* Empowered next basic attack (dash, ambush, hook pull). */
.sk-basic.emp {
  border-color: var(--rc-c, var(--accent));
  box-shadow: 0 0 0 1px var(--rc-c, var(--accent)), 0 0 14px color-mix(in srgb, var(--rc-c, var(--accent)) 45%, transparent);
}
.sk-basic.emp .sk-ic { color: var(--rc-c, var(--accent-hi)); }

/* Esc menu */
.hud-menu {
  position: absolute; inset: 0; pointer-events: auto;
  display: grid; place-items: center; padding: 16px;
  background: rgba(8, 4, 4, .62); backdrop-filter: blur(3px);
}
.hm-card {
  width: min(420px, 100%); display: grid; gap: 18px;
  padding: 26px; border-radius: 16px;
  background: var(--panel-solid); border: 1px solid var(--line-2);
  box-shadow: 0 30px 80px rgba(0, 0, 0, .6);
}
.hm-card h2 { font: 700 30px/1 var(--f-display); }
.hm-note { color: var(--muted); font-size: 14px; }
.hm-actions { display: grid; gap: 8px; }
.hm-keys { margin: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 6px 18px; padding-top: 16px; border-top: 1px solid var(--line); }
.hm-keys div { display: flex; justify-content: space-between; gap: 10px; font-size: 13px; }
.hm-keys dt { font-weight: 700; }
.hm-keys dd { margin: 0; color: var(--muted); text-align: right; }

@media (max-width: 760px) {
  .hud-feed { display: none; }
  .hud-board { min-width: 0; padding: 8px 10px; }
  .hb-name { max-width: 84px; }
  .hud-hp { width: min(352px, calc(100vw - 32px)); }
  .sk { width: 54px; height: 54px; }
  .hud-hint { display: none; }
}

/* ───────── Voice chat: lobby panel, slot badges, speaking marks, HUD pill ───────── */
.l-voice {
  display: flex; flex-wrap: wrap; align-items: center; gap: 12px 16px;
  padding: 14px 16px;
  border: 1px solid var(--line); border-radius: var(--r); background: var(--panel);
}
.vc-txt { flex: 1 1 240px; min-width: 0; display: grid; gap: 4px; }
.vc-txt p:not(.f-l) { font-size: 13px; line-height: 1.45; color: var(--muted); }
.vc-txt p.vc-warn { color: var(--accent-hi); }
.vc-btns { display: flex; flex-wrap: wrap; gap: 8px; }
.vc-mic.on { border-color: color-mix(in srgb, var(--good) 55%, var(--line-2)); color: var(--good); }
.vc-mic kbd, .hud-voice kbd {
  font-size: 10px; font-weight: 700; letter-spacing: .04em;
  padding: 2px 5px; border-radius: 4px; border: 1px solid var(--line-2); color: var(--muted);
}
.sl-mic { width: 16px; height: 16px; flex: none; color: var(--good); }
.sl-mic.off { color: var(--dim); }
.sl-mic svg { width: 100%; height: 100%; }
.slot.talk {
  border-color: color-mix(in srgb, var(--good) 60%, var(--line));
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--good) 35%, transparent), 0 0 18px color-mix(in srgb, var(--good) 16%, transparent);
}
.hb-row.talk .hb-dot { box-shadow: 0 0 0 2px var(--good); animation: talk .6s ease-in-out infinite alternate; }
.hb-row.talk .hb-name { color: var(--good); }
@keyframes talk {
  from { box-shadow: 0 0 0 2px var(--good); }
  to { box-shadow: 0 0 0 4px color-mix(in srgb, var(--good) 45%, transparent); }
}
.hl.talk .hl-n::before {
  content: ''; display: inline-block; width: 7px; height: 7px; margin: 0 4px 1px 0; border-radius: 50%;
  background: var(--good); box-shadow: 0 0 6px var(--good); vertical-align: middle;
  animation: talkdot .6s ease-in-out infinite alternate;
}
@keyframes talkdot { from { opacity: .45; } }
.hud-tl { justify-self: start; display: grid; gap: 6px; justify-items: start; min-width: 0; }
.hud-voice {
  pointer-events: auto; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 32px; padding: 0 10px 0 8px; border-radius: 999px;
  background: rgba(14, 8, 8, .72); border: 1px solid var(--line);
  font: 600 12px/1 var(--f-ui); color: var(--good);
  transition: border-color .18s var(--ease), color .18s var(--ease);
}
.hud-voice:hover { border-color: var(--line-2); }
.hud-voice.off { color: var(--muted); }
.hud-voice:disabled { cursor: default; color: var(--dim); }
.hud-voice:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.hud-voice svg { width: 16px; height: 16px; flex: none; }
@media (hover: none) {
  .vc-mic kbd, .hud-voice kbd { display: none; }
}
@media (max-width: 760px) {
  .hud-voice { width: 32px; padding: 0; }
  .hud-voice span, .hud-voice kbd { display: none; }
}
@media (max-width: 480px) {
  .vc-btns { width: 100%; }
  .vc-btns .btn { flex: 1; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

/* ---- Mana (v3) ---- */
.hud-mp {
  position: relative; width: 352px; height: 14px; margin-top: -4px; border-radius: 5px; overflow: hidden;
  background: rgba(5, 8, 20, .85); border: 1px solid rgba(160, 200, 255, .22);
}
.mp-fill { position: absolute; top: 0; bottom: 0; left: 0; background: linear-gradient(180deg, #8cc4ff, #2f6dff); transition: width .12s linear; }
.mp-num {
  position: absolute; inset: 0; display: grid; place-items: center;
  font: 700 10px/1 var(--f-ui); font-variant-numeric: tabular-nums; color: #eaf3ff;
  text-shadow: 0 1px 2px rgba(0, 0, 0, .9);
}
.sk-mp {
  position: absolute; right: 4px; top: 3px; z-index: 3;
  font: 700 10px/1 var(--f-ui); font-variant-numeric: tabular-nums; color: #8cc4ff;
  text-shadow: 0 1px 2px rgba(0, 0, 0, .9);
}
.sk-mp:empty, .sk.rc .sk-mp { display: none; }
.sk.nomp { border-color: rgba(90, 150, 255, .5); box-shadow: inset 0 0 0 100px rgba(40, 80, 200, .22); }
.sk.nomp .sk-ic { opacity: .3; color: #8cc4ff; }
.dn.crit { font-size: 22px; }
.dn.crit.big { font-size: 26px; }
.dn.dim.crit { font-size: 16px; }
.dn.mine.crit { color: #ff9f3a; }
.dn.barrier { color: #9cc8ff; }
.dn.mana { color: #8cc4ff; font-size: 16px; font-weight: 700; }
.cd-abil li.pas .ab-ic, .cd-abil li.pas .ab-h kbd { color: var(--cc); border-color: color-mix(in srgb, var(--cc) 45%, transparent); }
@media (max-width: 760px) { .hud-mp { width: min(352px, calc(100vw - 32px)); } }

/* ───────── Game modes: mode tabs, team columns, team scoreboard ───────── */
.ct-row.ct-mode { grid-template-columns: repeat(3, 1fr); }
.l-modes { display: grid; gap: 10px; }
.l-teams { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.l-team { display: grid; gap: 6px; align-content: start; min-width: 0; }
.lt-head { display: flex; align-items: center; gap: 8px; min-height: 30px; }
.lt-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--c); flex: none; }
.lt-name { flex: 1; font-weight: 700; font-size: 14px; color: var(--c); letter-spacing: .02em; }
.lt-head .btn { min-height: 28px; padding: 0 10px; font-size: 12px; }
.l-team .l-slots { gap: 6px; }
.l-team .slot { min-height: 54px; gap: 10px; padding: 8px 8px 8px 12px; }
.l-team .sl-em { width: 30px; height: 30px; border-radius: 8px; }
.l-team .sl-em svg { width: 18px; height: 18px; }
.l-team .sl-name { font-size: 14px; gap: 6px; }
.l-team .sl-cls { font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.l-team .sl-x { width: 28px; height: 28px; }
.l-team .slot.empty { justify-content: center; }
.hb-team { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 8px; margin-top: 4px; font: 700 11px/1.2 var(--f-ui); letter-spacing: .08em; text-transform: uppercase; color: var(--c); }
.hb-team:first-child { margin-top: 0; }
.hb-team .hb-pips i.on { background: var(--c); border-color: var(--c); }
.hb-row.tm { grid-template-columns: 9px 1fr; }
.hb-side { display: grid; gap: 4px; }
@media (max-width: 480px) {
  .hb-side { display: flex; flex-wrap: wrap; gap: 6px; padding: 3px 0 2px; }
  .hb-side .hb-row { grid-template-columns: 9px; }
  .hb-side .hb-name { display: none; }
  .hb-side .hb-row.me:not(.talk) .hb-dot { box-shadow: 0 0 0 2px rgba(255, 244, 230, .9); }
}
@media (max-width: 600px) { .l-teams { grid-template-columns: 1fr; } }
