/* ════════════════════════════════════════════════════════════════════════════
   LAUNCHPAD ROYALE — UI styles
   Esports × crypto terminal: dark glass, neon brand accents, crisp type.
   Layers: #game (three.js canvas) → #ui (.ui-root overlay; pointer-events only on widgets)
   ════════════════════════════════════════════════════════════════════════════ */

:root {
  color-scheme: dark;
  --bg: #04060a;
  --glass: rgba(11, 16, 25, 0.62);
  --glass-strong: rgba(8, 12, 19, 0.86);
  --glass-hi: rgba(255, 255, 255, 0.045);
  --line: rgba(150, 255, 225, 0.1);
  --line-strong: rgba(150, 255, 225, 0.24);
  --text: #eaf4f2;
  --muted: #8b9aa8;
  --dim: #5a6776;
  --accent: #19e3a7;
  --accent-2: #7cffd4;
  --accent-deep: #0fae85;
  --pink: #ff3d9a;
  --gold: #ffb627;
  --danger: #ff3b5c;
  --blue: #4db8ff;
  --purple: #b65cff;
  --good: #3ddc84;
  --font-ui: 'Space Grotesk', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, 'SF Mono', Menlo, monospace;
  --font-display: 'Unbounded', 'Space Grotesk', system-ui, sans-serif;
  --radius: 14px;
  --radius-sm: 9px;
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.45);
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-ui);
  -webkit-font-smoothing: antialiased;
  user-select: none;
}

#game {
  position: fixed;
  inset: 0;
  z-index: 1;
}

#game canvas {
  display: block;
}

#ui {
  position: fixed;
  inset: 0;
  z-index: 2;
  pointer-events: none;
}

body.lr-aiming,
body.lr-aiming #game,
body.lr-aiming #game canvas {
  cursor: none;
}

button,
input {
  font: inherit;
  color: inherit;
}

button {
  cursor: pointer;
}

button:disabled {
  cursor: default;
}

kbd {
  display: inline-grid;
  place-items: center;
  min-width: 20px;
  height: 20px;
  padding: 0 5px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-bottom-width: 2px;
  border-radius: 5px;
  background: rgba(255, 255, 255, 0.06);
  font: 700 11px/1 var(--font-mono);
  color: var(--text);
}

.hidden {
  display: none !important;
}

/* ─────────────────────────── Root + shared primitives ─────────────────────────── */

.ui-root {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
}

/* Every screen except the overlay canvas + crosshair. Zoomed by the global UI scale (Ui.applyScale):
   inside, px are "local" px, and --lvw / --lvh stand in for vw / vh (which are not zoom-aware). */
.ui-scaled {
  --feed-w: 400px; /* kill feed column width; the banner queue is sized to stay clear of it */
  position: absolute;
  inset: 0;
  zoom: var(--ui-scale, 1);
  pointer-events: none;
}

.interactive,
.ui-root button,
.ui-root input {
  pointer-events: auto;
}

.glass {
  background: linear-gradient(180deg, var(--glass-hi), transparent 42%), var(--glass);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  backdrop-filter: blur(16px) saturate(1.35);
  -webkit-backdrop-filter: blur(16px) saturate(1.35);
  box-shadow:
    var(--shadow),
    inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.panel {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 14px 16px 16px;
  min-height: 0;
}

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.panel-head h3 {
  flex: none;
  margin: 0;
  white-space: nowrap;
  font: 700 11px/1 var(--font-mono);
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--accent-2);
}

.panel-head h3::before {
  content: '';
  display: inline-block;
  width: 6px;
  height: 6px;
  margin: 0 8px 1px 0;
  border-radius: 2px;
  background: var(--accent);
  box-shadow: 0 0 10px var(--accent);
}

.panel-note {
  min-width: 0;
  font: 500 11px/1.2 var(--font-mono);
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.hint {
  font-size: 12px;
  color: var(--muted);
}

.empty {
  padding: 14px 4px;
  font: 500 12px var(--font-mono);
  color: var(--dim);
  text-align: center;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.field-label {
  font: 600 10px/1 var(--font-mono);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
}

.fill-value {
  color: var(--accent-2);
}

.bot-tag {
  margin-left: 6px;
  padding: 1px 5px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.08);
  font: 700 9px/1.4 var(--font-mono);
  letter-spacing: 0.08em;
  color: var(--muted);
  vertical-align: 1px;
}

/* Badge: brand-colored square + initial, real logo layered on top (falls back if the PNG fails). */
.badge {
  position: relative;
  flex: none;
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  font-size: 28px; /* = size, so .badge-initial (0.5em) scales with every badge variant */
  border-radius: 22%;
  background: var(--brand, #333);
  overflow: hidden;
}

.badge-initial {
  font: 800 0.5em/1 var(--font-display);
  color: #fff;
}

.badge img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.row-badge {
  width: 26px;
  height: 26px;
  font-size: 26px;
}

/* Buttons */
.btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  height: 46px;
  padding: 0 20px;
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.04);
  font: 700 14px/1 var(--font-display);
  letter-spacing: 0.08em;
  transition:
    transform 0.15s var(--ease-out),
    box-shadow 0.2s,
    background 0.2s,
    border-color 0.2s;
}

.btn:not(:disabled):hover {
  transform: translateY(-1px);
  border-color: var(--accent);
  box-shadow: 0 0 24px rgba(25, 227, 167, 0.25);
}

.btn:not(:disabled):active {
  transform: translateY(1px) scale(0.99);
}

.btn:disabled {
  opacity: 0.55;
}

.btn-primary {
  border-color: transparent;
  background: linear-gradient(135deg, var(--accent-2), var(--accent) 45%, var(--accent-deep));
  color: #03140e;
  box-shadow: 0 8px 30px rgba(25, 227, 167, 0.35);
}

.btn-ghost {
  background: transparent;
  color: var(--muted);
}

.btn-sub {
  font: 700 10px/1 var(--font-mono);
  letter-spacing: 0.2em;
  opacity: 0.7;
}

.icon-btn {
  display: grid;
  place-items: center;
  min-width: 30px;
  height: 30px;
  padding: 0 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.04);
  font: 600 12px var(--font-mono);
  color: var(--muted);
  transition:
    color 0.15s,
    border-color 0.15s;
}

.icon-btn:hover {
  color: var(--text);
  border-color: var(--line-strong);
}

/* Segmented control */
.seg {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: rgba(0, 0, 0, 0.25);
}

/* Team size: 3 × 2 grid so long labels (Squads / Fives / Sixes) never collide. */
.size-seg {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.seg-btn {
  position: relative;
  flex: 1 1 0;
  min-width: 34px;
  height: 30px;
  padding: 0 6px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  font: 600 11.5px/1 var(--font-ui);
  color: var(--muted);
  white-space: nowrap;
  transition:
    background 0.15s,
    color 0.15s,
    box-shadow 0.2s;
}

.seg-btn:not(:disabled):hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.05);
}

.seg-btn.active {
  background: linear-gradient(180deg, rgba(124, 255, 212, 0.22), rgba(25, 227, 167, 0.12));
  color: var(--accent-2);
  box-shadow:
    inset 0 0 0 1px rgba(124, 255, 212, 0.45),
    0 0 18px rgba(25, 227, 167, 0.18);
}

.seg-btn:disabled {
  cursor: default;
}

.seg-count {
  position: absolute;
  top: -5px;
  right: -3px;
  min-width: 15px;
  height: 15px;
  padding: 0 3px;
  border-radius: 8px;
  background: var(--accent);
  font: 800 9px/15px var(--font-mono);
  color: #03140e;
}

/* Range slider */
.range {
  width: 100%;
  height: 22px;
  margin: 0;
  background: transparent;
  -webkit-appearance: none;
  appearance: none;
}

.range::-webkit-slider-runnable-track {
  height: 6px;
  border-radius: 3px;
  background: linear-gradient(90deg, var(--accent-deep), var(--accent-2));
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08);
}

.range::-webkit-slider-thumb {
  width: 18px;
  height: 18px;
  margin-top: -6px;
  border: 3px solid #04120e;
  border-radius: 50%;
  background: var(--accent-2);
  box-shadow: 0 0 14px var(--accent);
  -webkit-appearance: none;
}

.range::-moz-range-track {
  height: 6px;
  border-radius: 3px;
  background: linear-gradient(90deg, var(--accent-deep), var(--accent-2));
}

.range::-moz-range-thumb {
  width: 14px;
  height: 14px;
  border: 3px solid #04120e;
  border-radius: 50%;
  background: var(--accent-2);
}

.range:disabled {
  opacity: 0.5;
}

/* Toggle switch */
.switch {
  position: relative;
  width: 42px;
  height: 24px;
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.06);
  transition: background 0.2s;
}

.switch-knob {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--muted);
  transition:
    transform 0.2s var(--ease-spring),
    background 0.2s;
}

.switch[aria-pressed='true'] {
  background: rgba(25, 227, 167, 0.25);
}

.switch[aria-pressed='true'] .switch-knob {
  transform: translateX(18px);
  background: var(--accent-2);
  box-shadow: 0 0 10px var(--accent);
}

/* ─────────────────────────── Corner: stats + settings gear ─────────────────────────── */

.corner {
  position: absolute;
  top: 16px;
  right: 18px;
  z-index: 40;
  display: flex;
  align-items: center;
  gap: 10px;
}

.gear-btn {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--glass-strong);
  color: var(--muted);
  backdrop-filter: blur(10px);
  transition:
    color 0.2s,
    transform 0.4s var(--ease-out),
    border-color 0.2s;
}

.gear-btn:hover {
  color: var(--accent-2);
  border-color: var(--line-strong);
  transform: rotate(60deg);
}

.net-stats {
  display: flex;
  gap: 8px;
  padding: 6px 10px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: rgba(4, 6, 10, 0.6);
  font: 600 11px/1 var(--font-mono);
  color: var(--accent-2);
}

.net-stats .bad {
  color: var(--gold);
}

.screen-match .corner {
  top: 12px;
  right: 234px;
}

.settings-panel {
  position: absolute;
  top: 64px;
  right: 18px;
  z-index: 45;
  width: 360px;
  max-height: calc(calc(100 * var(--lvh)) - 90px);
  padding: 16px 18px 18px;
  overflow-y: auto;
  background: var(--glass-strong);
  opacity: 0;
  transform: translateY(-8px) scale(0.98);
  transform-origin: top right;
  visibility: hidden;
  transition:
    opacity 0.2s,
    transform 0.25s var(--ease-out),
    visibility 0.2s;
}

.settings-panel.open {
  opacity: 1;
  transform: none;
  visibility: visible;
}

.settings-panel .panel-head {
  margin-bottom: 8px;
}

.settings-panel h3 {
  margin: 0;
  font: 800 16px var(--font-display);
}

.settings-panel h4 {
  margin: 16px 0 8px;
  font: 700 10px/1 var(--font-mono);
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--accent-2);
}

.set-row {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 8px 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
  font-size: 13px;
}

label.set-row {
  grid-template-columns: auto 1fr 44px;
}

.set-value {
  font: 700 12px var(--font-mono);
  color: var(--accent-2);
  text-align: right;
}

.controls-grid {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 6px 12px;
  align-items: center;
  font-size: 12.5px;
  color: var(--muted);
}

.controls-grid kbd {
  justify-self: start;
}

.emote-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 10px;
  font-size: 12px;
  color: var(--muted);
}

.emote-list span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.set-foot {
  margin: 16px 0 0;
  font: 500 11px var(--font-mono);
  color: var(--dim);
}

/* ─────────────────────────── Lobby ─────────────────────────── */

.screen {
  position: absolute;
  inset: 0;
}

.lobby {
  z-index: 20;
  display: grid;
  grid-template-rows: auto auto 1fr auto;
  gap: 12px;
  padding: 14px 24px 10px;
  pointer-events: auto;
  overflow-y: auto;
  overflow-x: hidden;
}

.lobby-bg {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(1100px 520px at 50% -8%, rgba(25, 227, 167, 0.2), transparent 65%),
    radial-gradient(700px 500px at 100% 100%, rgba(182, 92, 255, 0.14), transparent 70%),
    radial-gradient(700px 520px at 0% 100%, rgba(255, 61, 154, 0.1), transparent 70%),
    linear-gradient(180deg, rgba(3, 5, 9, 0.35), rgba(3, 5, 9, 0.72));
}

.lobby-bg::after {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(124, 255, 212, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(124, 255, 212, 0.035) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(ellipse at 50% 30%, #000 20%, transparent 75%);
  animation: grid-drift 24s linear infinite;
}

@keyframes grid-drift {
  to {
    background-position: 48px 48px;
  }
}

.lobby-header {
  position: relative;
  display: flex;
  justify-content: center;
  padding-top: 6px;
}

/* Logo: shine sweep + RGB-split glitch */
.logo {
  text-align: center;
  animation: logo-in 0.9s var(--ease-out) both;
}

@keyframes logo-in {
  from {
    opacity: 0;
    transform: translateY(-16px) scale(0.97);
    filter: blur(8px);
  }
}

.logo-kicker {
  margin-bottom: 6px;
  font: 700 11px/1 var(--font-mono);
  letter-spacing: 0.42em;
  text-transform: uppercase;
  color: var(--accent-2);
  opacity: 0.8;
}

.logo-title {
  position: relative;
  display: inline-block;
  margin: 0 0.12em;
  font: 900 clamp(38px, calc(5 * var(--lvw)), 84px) / 0.95 var(--font-display);
  letter-spacing: -0.02em;
  background: linear-gradient(
    100deg,
    #ffffff 0%,
    #d6fff1 38%,
    #ffffff 46%,
    #7cffd4 50%,
    #ffffff 54%,
    #d6fff1 62%,
    #ffffff 100%
  );
  background-size: 250% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: drop-shadow(0 0 22px rgba(25, 227, 167, 0.35));
  animation: shine 5.5s ease-in-out infinite;
}

.logo-title--royale {
  background-image: linear-gradient(
    100deg,
    var(--accent-2) 0%,
    var(--accent) 38%,
    #ffffff 50%,
    var(--accent) 62%,
    var(--accent-deep) 100%
  );
  background-size: 250% 100%;
  animation-delay: 0.4s;
}

@keyframes shine {
  0%,
  35% {
    background-position: 100% 0;
  }
  70%,
  100% {
    background-position: 0% 0;
  }
}

.logo-title::before,
.logo-title::after {
  content: attr(data-text);
  position: absolute;
  inset: 0;
  -webkit-background-clip: initial;
  background: none;
  pointer-events: none;
  opacity: 0;
}

.logo-title::before {
  color: #ff2bd6;
  animation: glitch-a 4.2s steps(1) infinite;
}

.logo-title::after {
  color: #00f0ff;
  animation: glitch-b 4.2s steps(1) infinite;
}

@keyframes glitch-a {
  0%,
  88%,
  100% {
    opacity: 0;
    transform: none;
    clip-path: inset(0 0 100% 0);
  }
  89% {
    opacity: 0.85;
    transform: translate(-4px, 1px);
    clip-path: inset(12% 0 58% 0);
  }
  91% {
    opacity: 0.85;
    transform: translate(3px, -1px);
    clip-path: inset(62% 0 8% 0);
  }
  93% {
    opacity: 0.8;
    transform: translate(-2px, 0);
    clip-path: inset(40% 0 38% 0);
  }
}

@keyframes glitch-b {
  0%,
  89%,
  100% {
    opacity: 0;
    transform: none;
    clip-path: inset(100% 0 0 0);
  }
  90% {
    opacity: 0.8;
    transform: translate(4px, -1px);
    clip-path: inset(55% 0 20% 0);
  }
  92% {
    opacity: 0.85;
    transform: translate(-3px, 1px);
    clip-path: inset(8% 0 70% 0);
  }
  94% {
    opacity: 0.75;
    transform: translate(2px, 0);
    clip-path: inset(30% 0 45% 0);
  }
}

.logo-sub {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 10px;
  font: 500 13px/1 var(--font-mono);
  letter-spacing: 0.04em;
  color: var(--muted);
}

.lobby-corner {
  position: absolute;
  top: 0;
  left: 0;
}

.wallet-btn {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  height: 38px;
  padding: 0 16px;
  border: 1px solid rgba(255, 182, 39, 0.35);
  border-radius: 11px;
  background: linear-gradient(135deg, rgba(255, 182, 39, 0.16), rgba(255, 61, 154, 0.1));
  font: 700 13px/1 var(--font-ui);
  color: #ffe1a3;
  transition:
    box-shadow 0.2s,
    transform 0.15s;
}

.wallet-btn:hover {
  box-shadow: 0 0 26px rgba(255, 182, 39, 0.3);
  transform: translateY(-1px);
}

.wallet-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--gold);
  box-shadow: 0 0 10px var(--gold);
  animation: blink 1.4s ease-in-out infinite;
}

.wallet-btn.nope {
  animation: nope 0.45s ease;
}

@keyframes nope {
  20%,
  60% {
    transform: translateX(-6px);
  }
  40%,
  80% {
    transform: translateX(6px);
  }
}

@keyframes blink {
  50% {
    opacity: 0.35;
  }
}

.lobby-banner {
  justify-self: center;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 6px 6px 6px 16px;
  border: 1px solid rgba(255, 59, 92, 0.45);
  border-radius: 999px;
  background: rgba(255, 59, 92, 0.1);
  font: 700 12px var(--font-mono);
  letter-spacing: 0.06em;
  color: #ffc2cf;
}

.lobby-banner .watch-btn {
  height: 30px;
  padding: 0 14px;
  border-radius: 999px;
  font-size: 12px;
}

/* Pulsing red "LIVE" dot (lobby live-match strip + spectator banner). */
.live-dot {
  flex: none;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--danger);
  box-shadow: 0 0 10px var(--danger);
  animation: blink 1.2s ease-in-out infinite;
}

.lobby-main {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
  gap: 16px;
  width: min(1560px, 100%);
  justify-self: center;
}

.lobby-col {
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-width: 0;
}

/* Lobby panels never shrink below their content: on short screens the whole lobby scrolls instead. */
.lobby-col > * {
  flex-shrink: 0;
}

.lobby-left {
  animation: rise 0.7s 0.1s var(--ease-out) both;
}

.lobby-right {
  animation: rise 0.7s 0.2s var(--ease-out) both;
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(18px);
  }
}

.pick-panel {
  flex: none;
}

/* Field manual */
.manual-panel {
  flex: 1;
}

.manual-rules {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px 16px;
}

.manual-rule {
  display: flex;
  gap: 12px;
}

.manual-step {
  font: 800 20px/1 var(--font-display);
  color: transparent;
  -webkit-text-stroke: 1px var(--accent);
  opacity: 0.8;
}

.manual-title {
  font: 700 13px var(--font-ui);
}

.manual-text {
  margin-top: 2px;
  font-size: 11.5px;
  line-height: 1.4;
  color: var(--muted);
}

.manual-keys {
  margin-top: auto;
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
  font: 500 11.5px var(--font-mono);
  color: var(--muted);
}

.manual-key {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

/* Character grid */
.char-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
}

.char-card {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  min-width: 0;
  padding: 14px 8px 10px;
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 13px;
  background:
    radial-gradient(120% 80% at 50% 0%, color-mix(in srgb, var(--brand) 16%, transparent), transparent 70%),
    rgba(255, 255, 255, 0.025);
  overflow: hidden;
  isolation: isolate;
  transition:
    transform 0.2s var(--ease-out),
    border-color 0.2s,
    box-shadow 0.25s,
    background 0.25s;
}

.char-card:hover {
  transform: translateY(-3px);
  border-color: color-mix(in srgb, var(--brand) 60%, transparent);
  box-shadow: 0 10px 30px color-mix(in srgb, var(--brand) 22%, transparent);
}

.char-glow {
  position: absolute;
  inset: -40%;
  z-index: -1;
  background: conic-gradient(from 0deg, transparent, var(--brand), var(--brand2), transparent 40%);
  opacity: 0;
  animation: spin 3.5s linear infinite;
  transition: opacity 0.3s;
}

.char-card::after {
  content: '';
  position: absolute;
  inset: 1.5px;
  z-index: -1;
  border-radius: 12px;
  background:
    radial-gradient(120% 80% at 50% 0%, color-mix(in srgb, var(--brand) 22%, transparent), transparent 70%), #0a0f17;
}

.char-card.selected {
  transform: translateY(-3px);
  border-color: transparent;
  box-shadow:
    0 0 0 1px var(--brand),
    0 0 34px color-mix(in srgb, var(--brand) 55%, transparent),
    0 14px 40px rgba(0, 0, 0, 0.5);
}

.char-card.selected .char-glow {
  opacity: 1;
}

@keyframes spin {
  to {
    transform: rotate(1turn);
  }
}

.char-badge {
  width: 52px;
  height: 52px;
  font-size: 52px;
  border-radius: 13px;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.45);
  transition: transform 0.3s var(--ease-spring);
}

.char-card:hover .char-badge,
.char-card.selected .char-badge {
  transform: scale(1.08) rotate(-3deg);
}

.char-name {
  margin-top: 4px;
  font: 800 13px/1.1 var(--font-display);
  letter-spacing: 0.02em;
}

.char-tag {
  width: 100%;
  font-size: 10.5px;
  line-height: 1.25;
  color: var(--muted);
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.char-taken {
  max-width: 100%;
  min-height: 15px;
  font: 600 9.5px/15px var(--font-mono);
  color: var(--brand2);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.char-card.is-taken .char-taken::before {
  content: '● ';
  color: var(--brand);
}

/* Character detail */
.char-detail {
  display: grid;
  grid-template-columns: 124px 1fr;
  gap: 18px;
  align-items: center;
  padding: 14px 16px;
  border: 1px solid color-mix(in srgb, var(--brand) 35%, transparent);
  border-radius: 14px;
  background:
    radial-gradient(90% 140% at 0% 50%, color-mix(in srgb, var(--brand) 22%, transparent), transparent 70%),
    rgba(0, 0, 0, 0.25);
  transition:
    border-color 0.3s,
    background 0.3s;
}

.detail-art {
  position: relative;
  display: grid;
  place-items: center;
  width: 124px;
  height: 124px;
}

.detail-ring {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: conic-gradient(
    from 0deg,
    var(--brand),
    transparent 30%,
    var(--brand2) 50%,
    transparent 80%,
    var(--brand)
  );
  mask: radial-gradient(circle, transparent 57%, #000 58%, #000 61%, transparent 62%);
  animation: spin 6s linear infinite;
  filter: drop-shadow(0 0 8px var(--brand));
}

.detail-badge {
  width: 88px;
  height: 88px;
  font-size: 88px;
  border-radius: 22px;
  box-shadow:
    0 0 40px color-mix(in srgb, var(--brand) 55%, transparent),
    0 10px 30px rgba(0, 0, 0, 0.5);
  animation: float 4s ease-in-out infinite;
}

@keyframes float {
  50% {
    transform: translateY(-5px);
  }
}

.detail-body {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}

.detail-head {
  display: flex;
  align-items: baseline;
  gap: 12px;
}

.detail-name {
  font: 900 26px/1 var(--font-display);
  letter-spacing: -0.01em;
}

.detail-site {
  font: 600 12px var(--font-mono);
  color: var(--brand2);
  opacity: 0.85;
}

.detail-tag {
  font: 600 14px var(--font-ui);
  color: var(--brand2);
}

.detail-blurb {
  margin: 0;
  font-size: 13px;
  line-height: 1.45;
  color: #b9c6d2;
}

.ability-card {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 12px;
  margin-top: 4px;
  padding: 10px 12px;
  border-radius: 11px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.07);
}

.ability-key {
  width: 30px;
  height: 30px;
  font-size: 14px;
  border-color: var(--brand);
  color: var(--brand2);
  box-shadow: 0 0 14px color-mix(in srgb, var(--brand) 45%, transparent);
}

.ability-name {
  font: 700 14px var(--font-ui);
}

.ability-desc {
  font-size: 12px;
  line-height: 1.35;
  color: var(--muted);
}

.ability-meta {
  padding: 5px 8px;
  border-radius: 7px;
  background: rgba(0, 0, 0, 0.35);
  font: 700 11px var(--font-mono);
  color: var(--brand2);
  white-space: nowrap;
}

/* Right column */
.lobby-right-top,
.lobby-right-mid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 14px;
  min-height: 0;
}

.name-input {
  width: 100%;
  height: 42px;
  padding: 0 14px;
  border: 1px solid var(--line-strong);
  border-radius: 11px;
  background: rgba(0, 0, 0, 0.35);
  font: 700 16px var(--font-ui);
  color: var(--text);
  outline: none;
  transition:
    border-color 0.2s,
    box-shadow 0.2s;
}

.name-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(25, 227, 167, 0.18);
}

.name-input::placeholder {
  color: var(--dim);
}

.host-panel.readonly .seg,
.host-panel.readonly .range {
  opacity: 0.6;
}

/* Player list + leaderboard */
.players-panel,
.board-panel {
  max-height: 250px;
}

.player-list,
.board-list {
  display: flex;
  flex-direction: column;
  gap: 5px;
  min-height: 0;
  overflow-y: auto;
  scrollbar-width: thin;
}

.player-row {
  display: grid;
  grid-template-columns: auto 1fr auto auto;
  align-items: center;
  gap: 10px;
  padding: 6px 8px;
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.025);
  border: 1px solid transparent;
  animation: row-in 0.35s var(--ease-out) both;
}

@keyframes row-in {
  from {
    opacity: 0;
    transform: translateX(-8px);
  }
}

.player-row.me {
  border-color: color-mix(in srgb, var(--brand) 45%, transparent);
  background: color-mix(in srgb, var(--brand) 9%, transparent);
}

.player-main {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.player-name {
  font: 700 13px var(--font-ui);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.crown {
  margin-right: 5px;
  color: var(--gold);
  text-shadow: 0 0 10px var(--gold);
}

.player-sub {
  font: 500 10.5px var(--font-mono);
  color: var(--muted);
}

.ping {
  font: 600 11px var(--font-mono);
}

.ping.good {
  color: var(--good);
}

.ping.ok {
  color: var(--gold);
}

.ping.bad {
  color: var(--danger);
}

.player-row.bots {
  grid-template-columns: auto 1fr;
  opacity: 0.75;
  border: 1px dashed rgba(255, 255, 255, 0.08);
  background: transparent;
}

.bot-chip {
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.06);
  font-size: 14px;
}

.board-row {
  display: grid;
  grid-template-columns: 20px auto 1fr auto auto auto;
  align-items: center;
  gap: 9px;
  padding: 6px 8px;
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.025);
  font-size: 12.5px;
}

.board-rank {
  font: 800 12px var(--font-mono);
  color: var(--dim);
  text-align: center;
}

.board-row.top1 .board-rank {
  color: var(--gold);
  text-shadow: 0 0 10px var(--gold);
}

.board-row.top2 .board-rank {
  color: #d9e2ec;
}

.board-row.top3 .board-rank {
  color: #e0915a;
}

.board-name {
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.board-stat {
  font: 600 11px var(--font-mono);
  color: var(--muted);
}

.board-pnl {
  min-width: 64px;
  font: 800 12px var(--font-mono);
  color: var(--good);
  text-align: right;
}

.board-pnl.neg,
.res-pnl.neg,
.ds-val.neg,
.pnl-chip.neg {
  color: var(--danger);
}

.board-pnl.blaze,
.res-pnl.blaze,
.pnl-chip.blaze {
  color: #9dff5c;
  text-shadow: 0 0 12px #6bff2f;
}

.chat-panel {
  flex: 1;
  min-height: 170px;
}

.chat-slot {
  display: flex;
  flex: 1;
  min-height: 0;
}

/* Tips ticker */
.lobby-header {
  grid-row: 1;
}

.lobby-banner {
  grid-row: 2;
}

.lobby-main {
  grid-row: 3;
}

/* Pinned to the last row; never stretched (it's a pill). */
.tips {
  grid-row: 4;
  align-self: end;
  justify-self: center;
  display: flex;
  align-items: center;
  gap: 12px;
  max-width: min(900px, 100%);
  padding: 8px 16px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(4, 6, 10, 0.6);
  font: 500 12.5px var(--font-mono);
  color: #c3d2de;
  backdrop-filter: blur(8px);
}

.tip-label {
  padding: 3px 8px;
  border-radius: 6px;
  background: var(--accent);
  font: 800 10px var(--font-mono);
  letter-spacing: 0.16em;
  color: #03140e;
}

.tip-text {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tip-in {
  animation: tip-in 0.5s var(--ease-out);
}

@keyframes tip-in {
  from {
    opacity: 0;
    transform: translateY(8px);
    filter: blur(4px);
  }
}

/* Countdown overlay */
.countdown {
  position: absolute;
  inset: 0;
  z-index: 30;
  display: grid;
  place-content: center;
  justify-items: center;
  pointer-events: none;
  background: radial-gradient(circle at 50% 50%, rgba(4, 6, 10, 0.3), rgba(4, 6, 10, 0.75));
  animation: fade-in 0.3s both;
}

.cd-rings {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 420px;
  height: 420px;
  margin: -210px 0 0 -210px;
  border-radius: 50%;
  border: 2px solid rgba(124, 255, 212, 0.25);
  box-shadow:
    0 0 60px rgba(25, 227, 167, 0.25),
    inset 0 0 60px rgba(25, 227, 167, 0.15);
  animation: ring-pulse 1s ease-out infinite;
}

@keyframes ring-pulse {
  from {
    transform: scale(0.7);
    opacity: 1;
  }
  to {
    transform: scale(1.25);
    opacity: 0;
  }
}

.cd-sub {
  font: 700 14px var(--font-mono);
  letter-spacing: 0.5em;
  text-transform: uppercase;
  color: var(--accent-2);
}

.cd-num {
  font: 900 220px/1 var(--font-display);
  color: #fff;
  text-shadow:
    0 0 40px var(--accent),
    0 0 90px rgba(25, 227, 167, 0.6);
}

.cd-num.pop {
  animation: cd-pop 0.9s var(--ease-out) both;
}

@keyframes cd-pop {
  from {
    transform: scale(1.8);
    opacity: 0;
    filter: blur(10px);
  }
  30% {
    transform: scale(1);
    opacity: 1;
    filter: none;
  }
  to {
    transform: scale(0.92);
    opacity: 0.85;
  }
}

.countdown.lfg {
  background: radial-gradient(circle, rgba(25, 227, 167, 0.25), rgba(4, 6, 10, 0) 70%);
}

.countdown.lfg .cd-num {
  background: linear-gradient(135deg, #fff, var(--accent-2) 40%, var(--gold));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: drop-shadow(0 0 30px rgba(25, 227, 167, 0.7));
}

@keyframes fade-in {
  from {
    opacity: 0;
  }
}

/* ─────────────────────────── Chat ─────────────────────────── */

.chat {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 0;
  pointer-events: auto;
}

.chat--lobby {
  flex: 1;
}

.chat-log {
  display: flex;
  flex-direction: column;
  gap: 3px;
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  scrollbar-width: thin;
  font-size: 13px;
  line-height: 1.35;
  user-select: text;
}

.chat--lobby .chat-log {
  max-height: 120px;
}

.chat-line {
  overflow-wrap: anywhere;
  animation: chat-in 0.25s var(--ease-out) both;
}

@keyframes chat-in {
  from {
    opacity: 0;
    transform: translateY(4px);
  }
}

.chat-name {
  margin-right: 7px;
  font-weight: 700;
}

.chat-name::after {
  content: ':';
  color: var(--dim);
}

.chat-text {
  color: #d4dfe8;
}

.chat-line.mine .chat-text {
  color: #fff;
}

.chat-line.system {
  font: 500 12px var(--font-mono);
}

.chat-line.system .chat-text {
  color: var(--sys, var(--gold));
}

.chat-line.system::before {
  content: '◆ ';
  color: var(--sys, var(--gold));
}

.chat-input-row {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 38px;
  padding: 0 12px;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.4);
}

.chat-caret {
  font: 800 16px var(--font-mono);
  color: var(--accent);
}

.chat-input {
  flex: 1;
  min-width: 0;
  height: 100%;
  border: 0;
  background: transparent;
  outline: none;
  font-size: 13.5px;
}

.chat-input::placeholder {
  color: var(--dim);
}

/* In-match chat: bottom-left, lines fade unless open */
.chat--match {
  position: absolute;
  left: 18px;
  bottom: 150px;
  z-index: 12;
  width: 380px;
  pointer-events: none;
}

.chat--match .chat-log {
  max-height: 180px;
  overflow: hidden;
  justify-content: flex-end;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.9);
}

.chat--match .chat-line {
  animation:
    chat-in 0.25s var(--ease-out) both,
    chat-fade 0.8s 9s forwards;
}

@keyframes chat-fade {
  to {
    opacity: 0;
  }
}

.chat--match .chat-input-row {
  display: none;
}

.chat--match.open {
  pointer-events: auto;
}

.chat--match.open .chat-log {
  overflow-y: auto;
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(4, 6, 10, 0.7);
  backdrop-filter: blur(10px);
}

.chat--match.open .chat-line {
  animation: none;
  opacity: 1;
}

.chat--match.open .chat-input-row {
  display: flex;
}

.screen-results .chat--match {
  z-index: 26;
  bottom: 20px;
}

/* The results table owns the bottom of the screen: the chat log only shows while chat is open (Enter). */
.screen-results .chat--match:not(.open) .chat-log {
  display: none;
}

/* ─────────────────────────── HUD: top-left ─────────────────────────── */

.hud {
  position: absolute;
  inset: 0;
  z-index: 5;
  pointer-events: none;
}

.hud-tl {
  position: absolute;
  top: 16px;
  left: 18px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 290px;
}

.stat-row {
  display: flex;
  align-items: stretch;
  padding: 10px 6px;
  border-radius: 13px;
}

.stat {
  display: flex;
  flex-direction: column;
  flex: 1;
  align-items: center;
  gap: 3px;
  padding: 0 8px;
}

.stat + .stat {
  border-left: 1px solid var(--line);
}

.stat-num {
  font: 900 26px/1 var(--font-display);
  font-variant-numeric: tabular-nums;
}

.stat-alive .stat-num {
  color: #fff;
  text-shadow: 0 0 18px rgba(255, 255, 255, 0.35);
}

.stat-kills .stat-num {
  color: var(--pink);
  text-shadow: 0 0 18px rgba(255, 61, 154, 0.5);
}

.stat-label {
  font: 600 9.5px/1 var(--font-mono);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  white-space: nowrap;
}

.block-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 4px;
  font: 600 11.5px var(--font-mono);
  color: #c3d2de;
  text-shadow: 0 1px 3px #000;
}

.block-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 10px var(--accent);
  animation: blink 1s steps(2) infinite;
}

.block-clock {
  color: var(--muted);
}

.pnl-chip {
  margin-left: auto;
  padding: 3px 8px;
  border-radius: 6px;
  background: rgba(61, 220, 132, 0.12);
  color: var(--good);
  font-weight: 800;
}

.zone-box {
  padding: 10px 12px 11px;
  border-radius: 12px;
  border-color: rgba(182, 92, 255, 0.25);
}

.zone-top {
  display: flex;
  align-items: center;
  gap: 8px;
}

.zone-icon {
  font-size: 15px;
  color: var(--purple);
  text-shadow: 0 0 10px var(--purple);
}

.zone-name {
  font: 700 13px var(--font-ui);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.zone-mid {
  display: flex;
  justify-content: space-between;
  margin-top: 5px;
  font: 600 11.5px var(--font-mono);
}

.zone-timer {
  color: #fff;
}

.zone-gas {
  color: var(--purple);
}

.zone-bar {
  height: 4px;
  margin-top: 7px;
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
}

.zone-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--purple), #ff5ce1);
  transform-origin: left;
  box-shadow: 0 0 10px var(--purple);
}

.hud-tl.zone-shrinking .zone-box {
  border-color: rgba(255, 92, 225, 0.55);
  animation: zone-alert 1.2s ease-in-out infinite;
}

@keyframes zone-alert {
  50% {
    box-shadow:
      var(--shadow),
      0 0 26px rgba(255, 92, 225, 0.35);
  }
}

/* ─────────────────────────── HUD: top-right (minimap + killfeed) ─────────────────────────── */

.hud-tr {
  position: absolute;
  top: 14px;
  right: 16px;
  z-index: 6;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 10px;
  pointer-events: none;
}

.minimap {
  position: relative;
  width: 206px;
  height: 206px;
  border: 1px solid var(--line-strong);
  border-radius: 18px;
  overflow: hidden;
  background: #05080d;
  box-shadow:
    0 12px 40px rgba(0, 0, 0, 0.55),
    0 0 0 4px rgba(4, 6, 10, 0.45),
    inset 0 0 24px rgba(0, 0, 0, 0.6);
}

.minimap-canvas {
  display: block;
  width: 100%;
  height: 100%;
}

.minimap-n {
  position: absolute;
  top: 6px;
  left: 50%;
  transform: translateX(-50%);
  font: 800 10px var(--font-mono);
  color: var(--accent-2);
  text-shadow: 0 0 6px #000;
}

.minimap-loc {
  position: absolute;
  left: 50%;
  bottom: 7px;
  max-width: 150px;
  padding: 3px 9px;
  transform: translateX(-50%);
  border-radius: 999px;
  background: rgba(4, 7, 12, 0.8);
  border: 1px solid rgba(255, 227, 163, 0.25);
  font: 700 10px var(--font-mono);
  color: #ffe3a3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.minimap-key {
  position: absolute;
  right: 7px;
  top: 6px;
  padding: 1px 5px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 4px;
  font: 700 9px var(--font-mono);
  color: rgba(234, 244, 242, 0.7);
}

.killfeed {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 5px;
  max-width: var(--feed-w);
}

.kf-row {
  display: flex;
  align-items: center;
  max-width: 100%;
  overflow: hidden;
  gap: 7px;
  padding: 5px 10px;
  border-radius: 9px;
  background: rgba(4, 7, 12, 0.72);
  border: 1px solid rgba(255, 255, 255, 0.06);
  font-size: 12.5px;
  white-space: nowrap;
  backdrop-filter: blur(8px);
  animation: kf-in 0.35s var(--ease-out) both;
  transition:
    opacity 0.8s,
    transform 0.8s;
}

@keyframes kf-in {
  from {
    opacity: 0;
    transform: translateX(30px);
  }
}

.kf-row.out {
  opacity: 0;
  transform: translateX(12px);
}

.kf-row.mine {
  border-color: rgba(124, 255, 212, 0.55);
  background: linear-gradient(90deg, rgba(25, 227, 167, 0.18), rgba(4, 7, 12, 0.78));
}

.kf-row.me-dead {
  border-color: rgba(255, 59, 92, 0.55);
  background: linear-gradient(90deg, rgba(255, 59, 92, 0.2), rgba(4, 7, 12, 0.78));
}

.kf-row.team {
  border-color: rgba(61, 220, 132, 0.3);
}

.kf-name {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-weight: 700;
  text-shadow: 0 0 10px rgba(0, 0, 0, 0.6);
}

.kf-row > * {
  flex-shrink: 0;
}

/* Names give way first when a row would overflow the column (the other parts never clip). */
.kf-row > .kf-name {
  flex-shrink: 1;
  min-width: 0;
}

.kf-name-text {
  min-width: 0;
  max-width: 110px;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

/* "X's bags": glue the possessive to the victim's name. */
.kf-poss {
  margin-left: -6px;
}

.kf-badge {
  width: 16px;
  height: 16px;
  font-size: 16px;
  border-radius: 4px;
}

.kf-weapon {
  padding: 1px 6px;
  border-radius: 5px;
  background: rgba(255, 255, 255, 0.08);
  font: 600 10.5px var(--font-mono);
  color: #cfd9e3;
}

.kf-verb {
  font-style: italic;
  color: var(--muted);
}

/* ─────────────────────────── HUD: bottom center ─────────────────────────── */

.hud-bottom {
  position: absolute;
  left: 50%;
  bottom: 18px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  transform: translateX(-50%);
}

.prompt {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 8px 14px;
  border: 1px solid var(--line-strong);
  border-radius: 11px;
  background: rgba(4, 7, 12, 0.8);
  font: 700 14px var(--font-ui);
  backdrop-filter: blur(10px);
  animation: prompt-in 0.25s var(--ease-spring) both;
}

@keyframes prompt-in {
  from {
    opacity: 0;
    transform: translateY(6px) scale(0.95);
  }
}

.prompt kbd {
  height: 24px;
  min-width: 24px;
  border-color: var(--accent);
  color: var(--accent-2);
  box-shadow: 0 0 12px rgba(25, 227, 167, 0.35);
}

.pr-rar {
  font: 700 10px var(--font-mono);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  opacity: 0.85;
}

.pr-note {
  font: 500 11px var(--font-mono);
  color: var(--muted);
}

.progress {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  width: 260px;
}

.progress-label {
  font: 600 11px var(--font-mono);
  letter-spacing: 0.06em;
  color: #fff;
  text-shadow: 0 1px 3px #000;
}

.progress-track {
  width: 100%;
  height: 5px;
  border-radius: 3px;
  background: rgba(0, 0, 0, 0.6);
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #ffe07a, var(--gold));
  transform-origin: left;
  box-shadow: 0 0 10px var(--gold);
}

.progress.heal .progress-fill {
  background: linear-gradient(90deg, var(--accent-deep), var(--accent-2));
  box-shadow: 0 0 10px var(--accent);
}

.buff-chip {
  padding: 4px 12px;
  border: 1px solid var(--brand, var(--accent));
  border-radius: 999px;
  background: rgba(4, 7, 12, 0.75);
  font: 800 11px var(--font-mono);
  letter-spacing: 0.1em;
  color: var(--brand, var(--accent-2));
  box-shadow: 0 0 18px color-mix(in srgb, var(--brand, var(--accent)) 45%, transparent);
  animation: blink 0.9s ease-in-out infinite;
}

.vitals {
  display: flex;
  flex-direction: column;
  gap: 5px;
  width: 440px;
}

.armor-line {
  display: flex;
  align-items: center;
  gap: 8px;
}

.armor-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 4px;
  flex: 1;
}

.armor-seg {
  height: 7px;
  border-radius: 2px;
  background: rgba(77, 184, 255, 0.12);
  border: 1px solid rgba(77, 184, 255, 0.2);
  overflow: hidden;
}

.armor-seg-fill {
  height: 100%;
  background: linear-gradient(90deg, #2d8bff, #7fd4ff);
  transform-origin: left;
  box-shadow: 0 0 10px #3fa9ff;
  transition: transform 0.2s;
}

.armor-text {
  min-width: 28px;
  font: 800 12px var(--font-mono);
  color: #7fd4ff;
  text-align: right;
}

.hp-bar {
  position: relative;
  height: 22px;
  border-radius: 7px;
  background: rgba(4, 7, 12, 0.78);
  border: 1px solid rgba(255, 255, 255, 0.1);
  overflow: hidden;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.45);
}

.hp-ghost,
.hp-fill {
  position: absolute;
  inset: 0;
  transform-origin: left;
}

.hp-ghost {
  background: rgba(255, 255, 255, 0.55);
}

.hp-fill {
  --hp-hue: 130;
  background: linear-gradient(90deg, hsl(var(--hp-hue) 80% 38%), hsl(var(--hp-hue) 90% 55%));
  box-shadow: 0 0 14px hsl(var(--hp-hue) 90% 50% / 0.6);
  transition: transform 0.12s linear;
}

.hp-ticks {
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(
    90deg,
    transparent 0,
    transparent calc(10% - 1px),
    rgba(0, 0, 0, 0.35) calc(10% - 1px),
    rgba(0, 0, 0, 0.35) 10%
  );
}

.hp-text {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font: 900 13px/1 var(--font-display);
  color: #fff;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.9);
}

.loadout {
  display: flex;
  align-items: stretch;
  gap: 8px;
}

.slot-key {
  position: absolute;
  top: 6px;
  left: 7px;
  height: 17px;
  min-width: 17px;
  font-size: 10px;
}

.slot {
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
  width: 168px;
  height: 66px;
  padding: 8px 10px 8px 32px;
  border: 1px solid color-mix(in srgb, var(--rar, #fff) 30%, transparent);
  border-radius: 12px;
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--rar, #fff) 14%, transparent), transparent 60%),
    rgba(4, 7, 12, 0.72);
  backdrop-filter: blur(10px);
  opacity: 0.72;
  transition:
    transform 0.2s var(--ease-out),
    opacity 0.2s,
    box-shadow 0.2s;
}

.slot.active {
  opacity: 1;
  transform: translateY(-4px);
  border-color: var(--rar);
  box-shadow:
    0 0 26px color-mix(in srgb, var(--rar) 40%, transparent),
    0 10px 24px rgba(0, 0, 0, 0.45);
}

.slot.empty {
  opacity: 0.45;
  border-style: dashed;
}

.slot-body {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-width: 0;
}

.slot-rarity {
  font: 700 8.5px/1 var(--font-mono);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--rar);
}

.slot-name {
  margin: 3px 0 2px;
  font: 700 13px/1.1 var(--font-ui);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.slot-ammo {
  font-variant-numeric: tabular-nums;
}

.slot-mag {
  font: 900 18px/1 var(--font-display);
}

.slot-mag.low {
  color: var(--danger);
  text-shadow: 0 0 10px var(--danger);
}

.slot-sep {
  margin: 0 3px;
  color: var(--dim);
}

.slot-res {
  font: 600 12px var(--font-mono);
  color: var(--muted);
}

.slot-reload {
  position: relative;
  display: none;
  width: 34px;
  height: 34px;
}

.slot.reloading .slot-reload {
  display: block;
}

.slot-ring {
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}

.ring-track,
.ring-fill {
  fill: none;
  stroke-width: 3.5;
}

.ring-track {
  stroke: rgba(255, 255, 255, 0.12);
}

.ring-fill {
  stroke: var(--gold);
  stroke-linecap: round;
  filter: drop-shadow(0 0 4px var(--gold));
}

.slot-reload-text {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font: 800 11px var(--font-mono);
  color: var(--gold);
}

.cons-stack {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.cons {
  position: relative;
  display: flex;
  align-items: center;
  gap: 6px;
  width: 78px;
  height: 31px;
  padding: 0 8px 0 30px;
  border: 1px solid color-mix(in srgb, var(--rar) 35%, transparent);
  border-radius: 9px;
  background: rgba(4, 7, 12, 0.72);
  backdrop-filter: blur(10px);
}

.cons .slot-key {
  top: 6px;
  left: 6px;
}

.cons-glyph {
  display: grid;
  place-items: center;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: color-mix(in srgb, var(--rar) 25%, transparent);
  font: 800 11px/1 var(--font-mono);
  color: var(--rar);
}

.cons-stable .cons-glyph {
  color: var(--good);
  background: rgba(61, 220, 132, 0.2);
}

.cons-count {
  font: 800 13px var(--font-mono);
}

.cons.empty {
  opacity: 0.4;
}

.cons.active {
  border-color: var(--accent);
  box-shadow: 0 0 16px rgba(25, 227, 167, 0.4);
}

.ability {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  width: 96px;
}

.ab-icon {
  position: relative;
  width: 54px;
  height: 54px;
  border-radius: 14px;
  box-shadow: 0 0 0 1px var(--brand, #fff);
}

.ability-badge {
  width: 54px;
  height: 54px;
  font-size: 54px;
  border-radius: 14px;
}

.ab-sweep {
  position: absolute;
  inset: 0;
  border-radius: 14px;
  background: conic-gradient(rgba(2, 4, 8, 0.78) calc(var(--cd, 0) * 360deg), transparent 0);
}

.ab-cd {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font: 900 18px/1 var(--font-display);
  color: #fff;
  text-shadow: 0 1px 4px #000;
}

.ab-buff {
  position: absolute;
  inset: -5px;
  border-radius: 18px;
  background: conic-gradient(var(--brand) calc(var(--buff, 0) * 360deg), transparent 0);
  mask: radial-gradient(closest-side, transparent calc(100% - 3px), #000 calc(100% - 3px));
  -webkit-mask:
    linear-gradient(#000 0 0) content-box,
    linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  padding: 3px;
  filter: drop-shadow(0 0 6px var(--brand));
}

.ability.ready .ab-icon {
  box-shadow:
    0 0 0 1.5px var(--brand),
    0 0 22px var(--brand);
  animation: ab-ready 1.6s ease-in-out infinite;
}

@keyframes ab-ready {
  50% {
    box-shadow:
      0 0 0 1.5px var(--brand),
      0 0 34px var(--brand);
  }
}

.ab-meta {
  display: flex;
  align-items: center;
  gap: 5px;
  max-width: 100%;
}

.ab-meta .slot-key {
  position: static;
}

.ab-name {
  font: 600 10px var(--font-mono);
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.dash {
  position: relative;
  align-self: center;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: conic-gradient(var(--accent-2) calc(var(--dash, 1) * 360deg), rgba(255, 255, 255, 0.08) 0);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.4);
}

.dash::before {
  content: '';
  position: absolute;
  inset: 3px;
  border-radius: 50%;
  background: rgba(4, 7, 12, 0.92);
}

.dash-label {
  position: relative;
  font: 800 8.5px var(--font-mono);
  letter-spacing: 0.1em;
  color: var(--muted);
}

.dash.ready {
  box-shadow: 0 0 18px rgba(124, 255, 212, 0.45);
}

.dash.ready .dash-label {
  color: var(--accent-2);
}

/* Emote hint (bottom-right) */
.emote-hint {
  position: absolute;
  right: 18px;
  bottom: 18px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 8px 10px;
  border-radius: 10px;
  background: rgba(4, 7, 12, 0.5);
  font: 500 11px var(--font-mono);
  color: rgba(234, 244, 242, 0.65);
}

.emote-item {
  display: flex;
  align-items: center;
  gap: 6px;
}

.emote-item kbd {
  height: 16px;
  min-width: 16px;
  font-size: 9.5px;
}

/* Vignettes */
.vignette {
  position: absolute;
  inset: 0;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.35s;
}

.vignette-low {
  background: radial-gradient(ellipse at center, transparent 45%, rgba(255, 20, 50, 0.55) 100%);
}

.vignette-low.pulse {
  animation: low-pulse 0.9s ease-in-out infinite;
}

@keyframes low-pulse {
  50% {
    filter: brightness(1.6);
  }
}

.vignette-zone {
  background:
    radial-gradient(ellipse at center, transparent 52%, rgba(182, 92, 255, 0.42) 100%),
    repeating-linear-gradient(0deg, rgba(182, 92, 255, 0.05) 0 2px, transparent 2px 4px);
  animation: zone-flicker 1.4s ease-in-out infinite;
}

@keyframes zone-flicker {
  50% {
    filter: hue-rotate(25deg) brightness(1.3);
  }
}

.vignette-hurt {
  background: radial-gradient(ellipse at center, transparent 30%, rgba(255, 0, 40, 0.6) 100%);
  transition: none;
}

.zone-warn {
  position: absolute;
  top: 110px;
  left: 50%;
  transform: translateX(-50%);
  padding: 8px 18px;
  border: 1px solid rgba(255, 92, 225, 0.6);
  border-radius: 999px;
  background: rgba(40, 6, 40, 0.75);
  font: 800 12px var(--font-mono);
  letter-spacing: 0.08em;
  color: #ffb6f3;
  box-shadow: 0 0 30px rgba(255, 92, 225, 0.35);
  animation: blink 0.8s ease-in-out infinite;
}

/* Spectating bar */
.spectate {
  position: absolute;
  left: 50%;
  bottom: 26px;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 10px 12px;
  transform: translateX(-50%);
  border-radius: 16px;
  animation: rise 0.4s var(--ease-out) both;
}

.spec-btn {
  width: 40px;
  height: 40px;
  border: 1px solid var(--line-strong);
  border-radius: 11px;
  background: rgba(255, 255, 255, 0.05);
  font: 800 16px var(--font-mono);
  color: var(--accent-2);
  transition:
    background 0.15s,
    transform 0.15s;
}

.spec-btn:hover {
  background: rgba(124, 255, 212, 0.14);
  transform: scale(1.05);
}

.spec-mid {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 260px;
}

.spec-top {
  display: flex;
  align-items: center;
  gap: 9px;
}

.spec-eye {
  padding: 2px 7px;
  border-radius: 5px;
  background: var(--danger);
  font: 800 9px/1.5 var(--font-mono);
  letter-spacing: 0.16em;
  color: #fff;
  animation: blink 1.6s ease-in-out infinite;
}

.spec-badge {
  width: 22px;
  height: 22px;
  font-size: 22px;
}

.spec-name {
  font: 800 16px var(--font-display);
}

.spec-hp {
  height: 5px;
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.1);
  overflow: hidden;
}

.spec-hp-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent-deep), var(--accent-2));
  transform-origin: left;
}

.spec-note {
  font: 500 11px var(--font-mono);
  color: var(--muted);
}

/* ─────────────────────────── Crosshair ─────────────────────────── */

.crosshair {
  --gap: 8px;
  position: absolute;
  top: 0;
  left: 0;
  z-index: 60;
  width: 0;
  height: 0;
  pointer-events: none;
  will-change: transform;
}

.ch-line {
  position: absolute;
  background: #fff;
  box-shadow:
    0 0 0 1px rgba(0, 0, 0, 0.55),
    0 0 8px rgba(124, 255, 212, 0.7);
  border-radius: 1px;
}

.ch-t,
.ch-b {
  left: -1px;
  width: 2px;
  height: 9px;
}

.ch-l,
.ch-r {
  top: -1px;
  width: 9px;
  height: 2px;
}

.ch-t {
  top: calc(-1 * var(--gap) - 9px);
}

.ch-b {
  top: var(--gap);
}

.ch-l {
  left: calc(-1 * var(--gap) - 9px);
}

.ch-r {
  left: var(--gap);
}

.ch-dot {
  position: absolute;
  top: -2px;
  left: -2px;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--accent-2);
  box-shadow: 0 0 6px var(--accent);
}

.crosshair.reloading .ch-line {
  background: var(--gold);
  opacity: 0.5;
}

.ch-hit {
  position: absolute;
  top: 0;
  left: 0;
  width: 30px;
  height: 30px;
  opacity: 0;
  transform: translate(-50%, -50%) rotate(45deg);
}

.ch-hit i {
  position: absolute;
  background: #fff;
  box-shadow: 0 0 6px rgba(255, 255, 255, 0.8);
}

.ch-hit i:nth-child(1),
.ch-hit i:nth-child(2) {
  left: calc(50% - 1px);
  width: 2px;
  height: 9px;
}

.ch-hit i:nth-child(1) {
  top: 0;
}

.ch-hit i:nth-child(2) {
  bottom: 0;
}

.ch-hit i:nth-child(3),
.ch-hit i:nth-child(4) {
  top: calc(50% - 1px);
  width: 9px;
  height: 2px;
}

.ch-hit i:nth-child(3) {
  left: 0;
}

.ch-hit i:nth-child(4) {
  right: 0;
}

.ch-hit--armor i {
  background: #5cc8ff;
  box-shadow: 0 0 8px #3fa9ff;
}

.ch-hit--kill {
  width: 40px;
  height: 40px;
}

.ch-hit--kill i {
  background: var(--danger);
  box-shadow: 0 0 12px var(--danger);
}

.ch-hit--kill i:nth-child(1),
.ch-hit--kill i:nth-child(2) {
  width: 3px;
  height: 13px;
}

.ch-hit--kill i:nth-child(3),
.ch-hit--kill i:nth-child(4) {
  width: 13px;
  height: 3px;
}

/* ─────────────────────────── Overlay canvas ─────────────────────────── */

.overlay-canvas {
  position: absolute;
  inset: 0;
  z-index: 3;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

/* ─────────────────────────── Announcements / toasts / RUGGED ─────────────────────────── */

.announcer {
  position: absolute;
  inset: 0;
  z-index: 35;
  pointer-events: none;
}

/* Stacked queue (max 2, newest on top) in the band between the top-left stats and the top-right
   minimap + kill feed column; headlines stay on one line (Announcer.fitBanner shrinks the font). */
.banners {
  position: absolute;
  top: 118px;
  left: 50%;
  display: flex;
  flex-direction: column;
  align-items: center;
  /* Never under the kill feed column (right) or its mirror on the left: 16px screen margin + 8px air. */
  width: clamp(420px, calc(100% - 2 * (var(--feed-w) + 24px)), 880px);
  transform: translateX(-50%);
}

.banner {
  --accent: var(--accent-2);
  position: relative;
  max-width: 100%;
  max-height: 150px;
  margin-bottom: 10px;
  padding: 10px 44px 12px;
  text-align: center;
  animation: banner-in 0.55s var(--ease-spring) both;
  transition:
    opacity 0.35s,
    transform 0.35s,
    max-height 0.35s,
    margin 0.35s,
    padding 0.35s;
}

.banner::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(
    90deg,
    transparent,
    color-mix(in srgb, var(--accent) 22%, rgba(4, 6, 10, 0.7)) 20%,
    color-mix(in srgb, var(--accent) 22%, rgba(4, 6, 10, 0.7)) 80%,
    transparent
  );
  border-top: 1px solid color-mix(in srgb, var(--accent) 60%, transparent);
  border-bottom: 1px solid color-mix(in srgb, var(--accent) 60%, transparent);
  mask-image: linear-gradient(90deg, transparent, #000 15%, #000 85%, transparent);
  z-index: -1;
}

@keyframes banner-in {
  from {
    opacity: 0;
    transform: scale(1.35);
    filter: blur(8px);
  }
}

.banner.out {
  max-height: 0;
  margin-bottom: 0;
  padding-top: 0;
  padding-bottom: 0;
  overflow: hidden;
  opacity: 0;
  transform: scale(0.96);
}

.banner-text {
  position: relative;
  white-space: nowrap;
  font: 900 34px/1.1 var(--font-display);
  letter-spacing: 0.02em;
  color: #fff;
  text-shadow:
    0 0 20px var(--accent),
    0 0 50px color-mix(in srgb, var(--accent) 50%, transparent),
    0 2px 0 rgba(0, 0, 0, 0.5);
}

.banner-sub {
  margin-top: 5px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font: 600 13px var(--font-mono);
  letter-spacing: 0.06em;
  color: color-mix(in srgb, var(--accent) 50%, #fff);
}

.banner--genesis .banner-text {
  font-size: 44px;
  background: linear-gradient(180deg, #fff3cf, var(--gold));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  text-shadow: none;
  filter: drop-shadow(0 0 18px rgba(255, 182, 39, 0.8));
}

.banner--streak .banner-text {
  font-size: 46px;
  font-style: italic;
  animation: streak-shake 0.5s 0.1s ease;
}

@keyframes streak-shake {
  20% {
    transform: translateX(-6px) rotate(-2deg);
  }
  40% {
    transform: translateX(5px) rotate(1deg);
  }
  60% {
    transform: translateX(-3px);
  }
}

.banner--zone .banner-text {
  font-size: 28px;
}

.banner--wipe .banner-text {
  font-size: 26px;
}

.kill-toasts {
  position: absolute;
  bottom: 250px;
  left: 50%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  transform: translateX(-50%);
}

.kill-toast {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 14px;
  border-radius: 10px;
  background: rgba(4, 7, 12, 0.72);
  border: 1px solid rgba(61, 220, 132, 0.4);
  backdrop-filter: blur(8px);
  animation: kill-in 0.4s var(--ease-spring) both;
  transition:
    opacity 0.45s,
    transform 0.45s;
}

@keyframes kill-in {
  from {
    opacity: 0;
    transform: translateY(14px) scale(0.8);
  }
}

.kill-toast.out {
  opacity: 0;
  transform: translateY(-8px);
}

.kt-amount {
  font: 900 16px var(--font-display);
  color: var(--good);
  text-shadow: 0 0 14px rgba(61, 220, 132, 0.8);
}

.kt-text {
  font: 700 13px var(--font-ui);
}

.toasts {
  position: absolute;
  left: 50%;
  bottom: 190px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  transform: translateX(-50%);
}

.screen-match .toasts {
  left: auto;
  right: 18px;
  bottom: 196px;
  align-items: flex-end;
  transform: none;
}

.screen-lobby .toasts {
  bottom: 70px;
}

.toast {
  --accent: var(--accent-2);
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 16px;
  border: 1px solid color-mix(in srgb, var(--accent) 50%, transparent);
  border-radius: 11px;
  background: rgba(6, 9, 15, 0.88);
  font: 700 13px var(--font-ui);
  color: #fff;
  box-shadow:
    0 10px 30px rgba(0, 0, 0, 0.5),
    0 0 20px color-mix(in srgb, var(--accent) 25%, transparent);
  backdrop-filter: blur(10px);
  animation: kill-in 0.35s var(--ease-spring) both;
  transition:
    opacity 0.45s,
    transform 0.45s;
}

.toast.out {
  opacity: 0;
  transform: translateY(8px);
}

.toast--good {
  --accent: var(--good);
}

.toast--bad {
  --accent: var(--danger);
}

.toast--gold {
  --accent: var(--gold);
  color: #ffe6ad;
}

.toast--pickup {
  padding: 6px 13px;
  font-size: 12.5px;
  color: var(--accent);
}

.toast-plus {
  font: 900 14px var(--font-mono);
}

.rugged {
  position: absolute;
  inset: 0;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 10px;
  background: radial-gradient(circle, rgba(255, 0, 60, 0.22), rgba(20, 0, 8, 0.65));
  overflow: hidden;
}

.rugged.play {
  animation: rug-bg 2.6s ease both;
}

@keyframes rug-bg {
  0% {
    opacity: 0;
  }
  6% {
    opacity: 1;
    filter: invert(1);
  }
  10% {
    filter: none;
  }
  80% {
    opacity: 1;
  }
  100% {
    opacity: 0;
  }
}

.rug-noise {
  position: absolute;
  inset: -50%;
  background: repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.05) 0 1px, transparent 1px 3px);
  animation: noise 0.2s steps(3) infinite;
}

@keyframes noise {
  to {
    transform: translateY(6px);
  }
}

.rug-title {
  position: relative;
  font: 900 clamp(90px, calc(15 * var(--lvw)), 220px) / 0.9 var(--font-display);
  letter-spacing: -0.03em;
  color: #fff;
  text-shadow:
    0 0 40px #ff003c,
    0 0 100px #ff003c;
  animation: rug-shake 0.12s linear 12;
}

.rug-title::before,
.rug-title::after {
  content: attr(data-text);
  position: absolute;
  inset: 0;
  text-shadow: none;
}

.rug-title::before {
  color: #00f0ff;
  transform: translate(-6px, 2px);
  clip-path: inset(10% 0 55% 0);
  mix-blend-mode: screen;
  animation: glitch-slice 0.3s steps(2) infinite;
}

.rug-title::after {
  color: #ff2bd6;
  transform: translate(6px, -2px);
  clip-path: inset(55% 0 10% 0);
  mix-blend-mode: screen;
  animation: glitch-slice 0.25s steps(2) infinite reverse;
}

@keyframes glitch-slice {
  0% {
    clip-path: inset(10% 0 60% 0);
  }
  50% {
    clip-path: inset(62% 0 5% 0);
  }
  100% {
    clip-path: inset(35% 0 35% 0);
  }
}

@keyframes rug-shake {
  25% {
    transform: translate(-5px, 3px) skewX(-4deg);
  }
  75% {
    transform: translate(5px, -3px) skewX(4deg);
  }
}

.rug-sub {
  position: relative;
  font: 800 18px var(--font-mono);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #ffc2cf;
}

/* ─────────────────────────── Deploy picker ─────────────────────────── */

.deploy {
  position: absolute;
  top: 50%;
  right: 24px;
  z-index: 15;
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: min(600px, calc(calc(100 * var(--lvh)) - 150px), calc(46 * var(--lvw)));
  padding: 14px 16px 16px;
  transform: translateY(-50%);
  background: var(--glass-strong);
  animation: deploy-in 0.6s var(--ease-out) both;
}

@keyframes deploy-in {
  from {
    opacity: 0;
    transform: translate(40px, -50%);
  }
}

.deploy-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.deploy-title {
  display: flex;
  align-items: baseline;
  gap: 10px;
  font: 900 20px/1 var(--font-display);
  letter-spacing: 0.02em;
}

.deploy-sep {
  color: var(--dim);
}

.deploy-timer {
  color: var(--accent-2);
  text-shadow: 0 0 16px var(--accent);
  font-variant-numeric: tabular-nums;
}

.deploy-timer.urgent {
  color: var(--gold);
  animation: blink 0.5s steps(2) infinite;
}

.deploy-sub {
  font: 500 11.5px var(--font-mono);
  color: var(--muted);
}

.deploy-map {
  position: relative;
  aspect-ratio: 1;
  width: 100%;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--line-strong);
}

.deploy-canvas {
  display: block;
  cursor: crosshair;
}

.deploy-hover {
  position: absolute;
  top: 0;
  left: 0;
  padding: 4px 8px;
  border-radius: 6px;
  background: rgba(4, 7, 12, 0.88);
  border: 1px solid var(--line-strong);
  font: 700 11px var(--font-mono);
  color: var(--accent-2);
  pointer-events: none;
  white-space: nowrap;
}

.deploy.collapsed {
  top: 16px;
  right: 50%;
  width: auto;
  transform: translateX(50%);
  animation: none;
}

.deploy.collapsed .deploy-sub,
.deploy.collapsed .deploy-map {
  display: none;
}

.deploy.collapsed .deploy-head {
  gap: 16px;
}

/* ─────────────────────────── Big map ─────────────────────────── */

.bigmap {
  position: absolute;
  inset: 0;
  z-index: 18;
  display: grid;
  place-items: center;
  background: rgba(2, 4, 8, 0.55);
  animation: fade-in 0.2s both;
}

.bigmap-frame {
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: min(calc(86 * var(--lvh)), calc(92 * var(--lvw)));
  padding: 14px 16px;
  background: var(--glass-strong);
  animation: pop-in 0.3s var(--ease-out) both;
}

@keyframes pop-in {
  from {
    opacity: 0;
    transform: scale(0.96);
  }
}

.bigmap-head {
  display: flex;
  align-items: center;
  gap: 14px;
}

.bigmap-title {
  font: 900 16px var(--font-display);
  letter-spacing: 0.04em;
}

.bigmap-zone {
  flex: 1;
  font: 600 12px var(--font-mono);
  color: var(--purple);
}

.bigmap-hint {
  font: 500 11px var(--font-mono);
  color: var(--muted);
}

.bigmap-body {
  aspect-ratio: 1;
  width: 100%;
  max-height: calc(calc(86 * var(--lvh)) - 110px);
  display: grid;
  place-items: center;
  border-radius: 12px;
  overflow: hidden;
}

.bigmap-canvas {
  display: block;
  border-radius: 12px;
}

.bigmap-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  font: 500 11px var(--font-mono);
  color: var(--muted);
}

.bigmap-legend span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.lg-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
}

.lg-diamond {
  border-radius: 1px;
  transform: rotate(45deg);
}

.lg-ring {
  width: 12px;
  height: 12px;
  border: 1.5px dashed #fff;
  border-radius: 50%;
}

/* ─────────────────────────── Scoreboard (Tab) ─────────────────────────── */

.scoreboard {
  position: absolute;
  top: 50%;
  left: 50%;
  z-index: 22;
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: min(940px, calc(92 * var(--lvw)));
  max-height: calc(84 * var(--lvh));
  padding: 18px 20px;
  transform: translate(-50%, -50%);
  background: var(--glass-strong);
  animation: pop-in 0.2s var(--ease-out) both;
}

.sb-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
}

.sb-title {
  font: 900 20px var(--font-display);
  letter-spacing: 0.06em;
  background: linear-gradient(90deg, #fff, var(--accent-2));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.sb-summary {
  font: 600 12px var(--font-mono);
  color: var(--muted);
}

.sb-body {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-height: 0;
  overflow-y: auto;
}

.sb-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(420px, 1fr));
  gap: 10px;
}

.sb-col .sb-colhead {
  padding-bottom: 6px;
}

.sb-team {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: rgba(255, 255, 255, 0.02);
}

.sb-team.mine {
  border-color: rgba(61, 220, 132, 0.5);
  background: rgba(61, 220, 132, 0.06);
}

.sb-team.wiped {
  opacity: 0.5;
}

.sb-team-head {
  display: flex;
  justify-content: space-between;
  padding: 2px 4px 5px;
  font: 800 11px var(--font-mono);
  letter-spacing: 0.12em;
}

.sb-team-meta {
  font-weight: 500;
  letter-spacing: 0;
  color: var(--muted);
}

.sb-row {
  display: grid;
  grid-template-columns: 16px 26px 1fr 80px 32px 52px;
  align-items: center;
  gap: 9px;
  padding: 4px 6px;
  border-radius: 8px;
  font-size: 13px;
}

.sb-row.me {
  background: color-mix(in srgb, var(--brand) 14%, transparent);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--brand) 45%, transparent);
}

.sb-row.dead {
  opacity: 0.45;
}

.sb-row.dead .sb-name {
  text-decoration: line-through;
  text-decoration-color: rgba(255, 59, 92, 0.6);
}

.sb-colhead {
  font: 700 10px var(--font-mono);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--dim);
}

.sb-status {
  font-size: 10px;
  color: var(--good);
}

.sb-row.dead .sb-status {
  color: var(--danger);
}

.sb-name {
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sb-brand {
  font: 500 11px var(--font-mono);
  color: var(--brand, var(--muted));
}

.sb-kills {
  font: 800 13px var(--font-mono);
  text-align: right;
}

.sb-ping {
  font: 500 11px var(--font-mono);
  color: var(--muted);
  text-align: right;
}

.sb-foot {
  font: 500 10.5px var(--font-mono);
  color: var(--dim);
  text-align: center;
}

/* ─────────────────────────── Death screen ─────────────────────────── */

.death {
  z-index: 24;
  display: grid;
  place-items: center;
  background: radial-gradient(ellipse at center, rgba(40, 0, 10, 0.55), rgba(4, 0, 2, 0.85));
  backdrop-filter: grayscale(0.85) blur(2px);
  -webkit-backdrop-filter: grayscale(0.85) blur(2px);
}

.death.play {
  animation: fade-in 0.6s both;
}

.death-scan {
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(0deg, rgba(255, 0, 60, 0.05) 0 2px, transparent 2px 4px);
  pointer-events: none;
}

.death-card {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  text-align: center;
}

.death.play .death-card {
  animation: rise 0.8s 0.2s var(--ease-out) both;
}

.death-title {
  position: relative;
  font: 900 clamp(110px, calc(16 * var(--lvw)), 210px) / 0.85 var(--font-display);
  letter-spacing: -0.04em;
  color: #ff2a52;
  text-shadow:
    0 0 50px rgba(255, 42, 82, 0.7),
    0 0 120px rgba(255, 42, 82, 0.35);
}

.death-title::before,
.death-title::after {
  content: attr(data-text);
  position: absolute;
  inset: 0;
  text-shadow: none;
}

.death-title::before {
  color: #00f0ff;
  opacity: 0.7;
  mix-blend-mode: screen;
  animation: glitch-a 2.6s steps(1) infinite;
}

.death-title::after {
  color: #fff;
  opacity: 0.6;
  mix-blend-mode: screen;
  animation: glitch-b 2.6s steps(1) infinite;
}

.death-cope {
  font: 600 15px var(--font-mono);
  color: #ffc2cf;
}

.death-killer {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 8px;
  font: 800 22px var(--font-display);
}

.death-by {
  font: 600 13px var(--font-mono);
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.14em;
}

.death-badge {
  width: 34px;
  height: 34px;
  font-size: 34px;
  border-radius: 9px;
}

.death-cause {
  font: 500 13px var(--font-mono);
  color: var(--muted);
}

.death-place {
  margin-top: 6px;
  padding: 6px 16px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 999px;
  font: 800 16px var(--font-display);
  letter-spacing: 0.04em;
}

.death-stats {
  display: grid;
  grid-template-columns: repeat(4, 120px);
  gap: 10px;
  margin-top: 8px;
}

.ds {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 12px 8px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.35);
}

.ds-val {
  font: 900 22px/1 var(--font-display);
  font-variant-numeric: tabular-nums;
}

.ds-pnl .ds-val {
  color: var(--good);
}

.ds-label {
  font: 600 9.5px var(--font-mono);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
}

.death-team {
  font: 700 13px var(--font-mono);
  color: var(--good);
}

.death-actions {
  display: flex;
  gap: 10px;
  margin-top: 10px;
}

/* ─────────────────────────── Results ─────────────────────────── */

.results {
  z-index: 25;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  padding: 26px 26px 18px;
  overflow-y: auto;
  background: radial-gradient(900px 500px at 50% 0%, rgba(124, 255, 212, 0.12), transparent 70%), rgba(3, 5, 9, 0.88);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

.results.won {
  background: radial-gradient(900px 520px at 50% 0%, rgba(255, 182, 39, 0.25), transparent 70%), rgba(3, 5, 9, 0.86);
}

.results.play .res-head {
  animation: res-title-in 0.9s var(--ease-spring) both;
}

.results.play .podium {
  animation: rise 0.7s 0.35s var(--ease-out) both;
}

.results.play .res-body {
  animation: rise 0.7s 0.55s var(--ease-out) both;
}

@keyframes res-title-in {
  from {
    opacity: 0;
    transform: scale(1.4);
    filter: blur(12px);
  }
}

.res-head {
  text-align: center;
}

.res-title {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin: 0;
  font: 900 clamp(38px, calc(5.6 * var(--lvw)), 84px) / 0.98 var(--font-display);
  letter-spacing: -0.01em;
}

.res-line {
  display: block;
}

.res-gold {
  background: linear-gradient(180deg, #fff6d6 10%, var(--gold) 55%, #ff8a2b);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: drop-shadow(0 0 28px rgba(255, 182, 39, 0.6));
}

.results.won .res-line:first-child {
  color: #fff;
  text-shadow: 0 0 30px rgba(255, 255, 255, 0.4);
}

.res-dim {
  font-size: 0.5em;
  color: var(--accent-2);
  text-shadow: 0 0 26px rgba(25, 227, 167, 0.5);
}

.res-sub {
  margin-top: 10px;
  font: 600 14px var(--font-mono);
  color: #c3d2de;
}

.podium {
  display: flex;
  align-items: flex-end;
  gap: 14px;
}

.pod {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  width: 170px;
}

.pod-crown {
  height: 22px;
  font-size: 22px;
  color: var(--gold);
  text-shadow: 0 0 14px var(--gold);
}

.pod-badge {
  width: 64px;
  height: 64px;
  font-size: 64px;
  border-radius: 16px;
  box-shadow: 0 0 30px color-mix(in srgb, var(--brand) 60%, transparent);
}

.pod-1 .pod-badge {
  width: 84px;
  height: 84px;
  font-size: 84px;
  border-radius: 20px;
  animation: float 3s ease-in-out infinite;
}

.pod-name {
  max-width: 100%;
  font: 800 15px var(--font-display);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.pod.me .pod-name {
  color: var(--accent-2);
}

.pod-stats {
  font: 600 11px var(--font-mono);
  color: var(--muted);
}

.pod-block {
  display: grid;
  place-items: center;
  width: 100%;
  margin-top: 4px;
  border: 1px solid color-mix(in srgb, var(--brand) 50%, transparent);
  border-bottom: 0;
  border-radius: 12px 12px 0 0;
  background: linear-gradient(180deg, color-mix(in srgb, var(--brand) 30%, transparent), rgba(4, 6, 10, 0.2));
  font: 900 30px var(--font-display);
}

.pod-1 .pod-block {
  height: 92px;
  color: var(--gold);
}

.pod-2 .pod-block {
  height: 64px;
  color: #d9e2ec;
}

.pod-3 .pod-block {
  height: 46px;
  color: #e0915a;
}

.pod-empty {
  width: 170px;
}

.res-body {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr);
  gap: 14px;
  width: min(1240px, 100%);
  min-height: 0;
}

.res-table {
  display: flex;
  flex-direction: column;
  gap: 3px;
  max-height: calc(38 * var(--lvh));
  overflow-y: auto;
}

.res-row {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr) 90px 50px 60px 130px;
  align-items: center;
  gap: 10px;
  padding: 6px 10px;
  border-radius: 8px;
  font-size: 13px;
  background: rgba(255, 255, 255, 0.02);
}

.res-table.teams .res-row {
  grid-template-columns: 28px minmax(0, 1fr) 90px 40px 50px 60px 130px;
}

.res-headrow {
  position: sticky;
  top: 0;
  background: rgba(8, 12, 19, 0.95);
  font: 700 10px var(--font-mono);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--dim);
}

.res-row.me {
  background: color-mix(in srgb, var(--brand) 14%, transparent);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--brand) 55%, transparent);
}

.res-row.first .res-place {
  color: var(--gold);
}

.res-place {
  font: 900 14px var(--font-display);
  color: var(--muted);
}

.res-name {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.res-name .row-badge {
  width: 22px;
  height: 22px;
  font-size: 22px;
}

.res-brand {
  font: 500 11px var(--font-mono);
  color: var(--brand);
}

.res-team {
  font: 700 11px var(--font-mono);
  color: var(--muted);
}

.num {
  font: 700 12.5px var(--font-mono);
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.res-pnl {
  font-weight: 800;
  color: var(--good);
}

.res-board-panel .board-list {
  max-height: calc(38 * var(--lvh));
}

.res-foot {
  font: 600 12px var(--font-mono);
  color: var(--muted);
}

.res-timer {
  color: var(--accent-2);
}

.confetti {
  position: fixed;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}

.confetti i {
  position: absolute;
  top: -20px;
  width: 9px;
  height: 14px;
  border-radius: 2px;
  background: var(--c);
  opacity: 0;
  animation: confetti var(--d) var(--delay) linear infinite;
}

.confetti i.coin {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: radial-gradient(circle at 35% 30%, #fff1b8, var(--gold) 55%, #b86f00);
  font: 900 13px/1 var(--font-display);
  font-style: normal;
  color: #6b3c00;
}

@keyframes confetti {
  0% {
    opacity: 1;
    transform: translate(0, 0) rotate(0);
  }
  100% {
    opacity: 1;
    transform: translate(var(--x), calc(105 * var(--lvh))) rotate(var(--r));
  }
}

/* ─────────────────────────── Responsive ─────────────────────────── */

/* local viewport (max-width: 1360px) (class set by Ui.applyScale) */
.ui-w1360 .lobby-main {
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
}
.ui-w1360 .board-panel .board-stat {
  display: none;
}
.ui-w1360 .manual-rules {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
/* local viewport (max-width: 1100px) (class set by Ui.applyScale) */
.ui-w1100 .lobby-main {
  grid-template-columns: 1fr;
}
.ui-w1100 .char-grid {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

/* local viewport (max-width: 820px) (class set by Ui.applyScale) */
.ui-w820 .char-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.ui-w820 .lobby-right-top,
.ui-w820 .lobby-right-mid {
  grid-template-columns: 1fr;
}
.ui-w820 .char-detail {
  grid-template-columns: 1fr;
  justify-items: center;
  text-align: center;
}
.ui-w820 .lobby-corner {
  position: static;
}
.ui-w820 .lobby-header {
  flex-direction: column;
  align-items: center;
  gap: 10px;
}
.ui-w820 .vitals {
  width: 320px;
}
.ui-w820 .slot {
  width: 130px;
}
.ui-w820 .res-body {
  grid-template-columns: 1fr;
}
.ui-w820 .death-stats {
  grid-template-columns: repeat(2, 120px);
}

/* local viewport (max-height: 960px) (class set by Ui.applyScale) */
.ui-h960 .logo-title {
  font-size: clamp(34px, calc(3.4 * var(--lvw)), 50px);
}
.ui-h960 .logo-sub {
  margin-top: 6px;
}
.ui-h960 .manual-rule .manual-step {
  font-size: 16px;
}
.ui-h960 .players-panel,
.ui-h960 .board-panel {
  max-height: 210px;
}
.ui-h960 .logo-kicker {
  display: none;
}
.ui-h960 .char-card {
  padding: 10px 6px 8px;
}
.ui-h960 .char-badge {
  width: 44px;
  height: 44px;
  font-size: 44px;
}
.ui-h960 .detail-art {
  width: 100px;
  height: 100px;
}
.ui-h960 .char-detail {
  grid-template-columns: 100px 1fr;
}
.ui-h960 .detail-badge {
  width: 70px;
  height: 70px;
  font-size: 70px;
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}

/* Death screen / scoreboard own the center: hide stacked announcements while they're up. */
.center-busy .banners,
.center-busy .kill-toasts,
.center-busy .toasts {
  opacity: 0;
}

.res-headrow .num {
  font: inherit;
}

/* Very short local viewports (e.g. 800×600): collapse the field manual to its key strip. */
.ui-h820 .manual-rules {
  display: none;
}

.ui-h820 .manual-keys {
  padding-top: 0;
  border-top: 0;
}

/* ≤960 local px tall (most laptops at scale 1): tighten the lobby so it fits without scrolling. */
.ui-h960 .lobby {
  gap: 8px;
  padding-top: 8px;
  padding-bottom: 8px;
}

.ui-h960 .manual-step {
  display: none;
}

.ui-h960 .manual-panel {
  gap: 8px;
  padding-top: 12px;
  padding-bottom: 12px;
}

.ui-h960 .manual-text {
  font-size: 11px;
}

.ui-h960 .tips {
  padding-top: 6px;
  padding-bottom: 6px;
}

.ui-h960 .char-detail {
  padding-top: 10px;
  padding-bottom: 10px;
}

.ui-w1360 .ui-scaled {
  --feed-w: 340px;
}

.ui-w1100 .ui-scaled {
  --feed-w: 300px;
}

.ui-w1360 .banner {
  padding-left: 24px;
  padding-right: 24px;
}

/* ─────────────────────────── Ready check (lobby hero action) ─────────────────────────── */

.profile-panel {
  gap: 10px;
}

.ready-check {
  --rc: var(--accent);
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: auto;
  padding: 12px;
  border: 1px solid color-mix(in srgb, var(--rc) 35%, transparent);
  border-radius: 14px;
  background:
    radial-gradient(120% 120% at 0% 0%, color-mix(in srgb, var(--rc) 16%, transparent), transparent 60%),
    rgba(0, 0, 0, 0.3);
  transition:
    border-color 0.3s,
    box-shadow 0.3s;
}

.ready-check.urgent {
  --rc: var(--danger);
  box-shadow: 0 0 30px rgba(255, 59, 92, 0.25);
}

.ready-check.state-launching {
  --rc: var(--gold);
}

.ready-check.state-live {
  --rc: var(--purple);
}

.rc-top {
  display: flex;
  align-items: center;
  gap: 12px;
}

.rc-ring {
  position: relative;
  flex: none;
  width: 68px;
  height: 68px;
}

.rc-ring-svg {
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}

.rc-ring-track,
.rc-ring-fill {
  fill: none;
  stroke-width: 5;
}

.rc-ring-track {
  stroke: rgba(255, 255, 255, 0.08);
}

.rc-ring-fill {
  stroke: var(--rc);
  stroke-linecap: round;
  filter: drop-shadow(0 0 5px var(--rc));
  transition:
    stroke-dashoffset 0.25s linear,
    stroke 0.3s;
}

.rc-ring-text {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.rc-ring-num {
  font: 900 20px/1 var(--font-display);
  color: #fff;
  font-variant-numeric: tabular-nums;
}

.rc-ring-unit {
  margin-top: 3px;
  font: 700 7.5px/1 var(--font-mono);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.ready-check.urgent .rc-ring-num {
  color: #ffb3c1;
  animation: rc-tick 1s ease-in-out infinite;
}

@keyframes rc-tick {
  0% {
    transform: scale(1.18);
  }
  40%,
  100% {
    transform: scale(1);
  }
}

.rc-status {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.rc-title {
  font: 900 18px/1.1 var(--font-display);
  color: #fff;
}

.ready-check.state-launching .rc-title {
  color: var(--gold);
  text-shadow: 0 0 18px rgba(255, 182, 39, 0.6);
}

.rc-sub {
  font: 500 11px/1.3 var(--font-mono);
  color: var(--muted);
}

.rc-pips {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 2px;
}

.rc-pip {
  position: relative;
  width: 22px;
  height: 22px;
  border-radius: 6px;
  opacity: 0.35;
  filter: grayscale(0.8);
  transition:
    opacity 0.25s,
    filter 0.25s,
    transform 0.25s var(--ease-spring);
}

.rc-pip.on {
  opacity: 1;
  filter: none;
  transform: translateY(-1px);
  box-shadow:
    0 0 0 1.5px var(--accent),
    0 0 12px rgba(25, 227, 167, 0.5);
}

.rc-pip.me:not(.on) {
  opacity: 0.6;
  box-shadow: 0 0 0 1px dashed rgba(255, 255, 255, 0.5);
}

.rc-pip-badge {
  width: 22px;
  height: 22px;
  font-size: 22px;
  border-radius: 6px;
}

.rc-pip-check {
  position: absolute;
  right: -4px;
  bottom: -4px;
  display: grid;
  place-items: center;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--accent);
  font: 900 8px/1 var(--font-mono);
  color: #03140e;
}

.rc-pip-more {
  display: grid;
  place-items: center;
  height: 22px;
  padding: 0 6px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.08);
  font: 700 10px var(--font-mono);
  color: var(--muted);
}

/* The hero button: glowing call to action when not ready, solid mint when ready. */
.rc-btn {
  width: 100%;
  height: 54px;
  flex-direction: column;
  gap: 3px;
  border: 0;
  background: linear-gradient(135deg, #ffe07a, var(--gold) 45%, #ff7a2f);
  color: #1c0e00;
  box-shadow:
    0 10px 34px rgba(255, 182, 39, 0.35),
    inset 0 1px 0 rgba(255, 255, 255, 0.5);
  overflow: hidden;
}

.rc-btn::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(100deg, transparent 30%, rgba(255, 255, 255, 0.55) 50%, transparent 70%);
  transform: translateX(-120%);
  animation: sweep 2.6s ease-in-out infinite;
}

@keyframes sweep {
  60%,
  100% {
    transform: translateX(120%);
  }
}

.rc-btn:not(:disabled):hover {
  border: 0;
  box-shadow: 0 0 44px rgba(255, 182, 39, 0.6);
}

.rc-btn-label {
  font: 900 18px/1 var(--font-display);
  letter-spacing: 0.06em;
}

.rc-btn-sub {
  font: 700 9.5px/1 var(--font-mono);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  opacity: 0.7;
}

.ready-check.is-ready .rc-btn {
  background: linear-gradient(135deg, var(--accent-2), var(--accent) 50%, var(--accent-deep));
  color: #03140e;
  box-shadow: 0 0 30px rgba(25, 227, 167, 0.45);
}

.ready-check.is-ready .rc-btn::after {
  animation: none;
}

.ready-check.state-launching .rc-btn {
  opacity: 0.85;
}

/* Host force-start: secondary action now that the ready check launches matches. */
.btn-force {
  width: 100%;
  height: 38px;
  margin-top: auto;
  border-color: rgba(255, 182, 39, 0.45);
  background: rgba(255, 182, 39, 0.08);
  font-size: 12px;
  color: #ffd98a;
}

.btn-force:not(:disabled):hover {
  border-color: var(--gold);
  box-shadow: 0 0 24px rgba(255, 182, 39, 0.3);
}

.host-note {
  font: 500 10.5px var(--font-mono);
  color: var(--dim);
  text-align: center;
}

.host-panel.readonly .host-note {
  margin-top: auto;
}

/* Player list: prominent per-player ready state. */
.ready-tag {
  padding: 3px 7px;
  border: 1px solid var(--line);
  border-radius: 6px;
  font: 700 9.5px/1 var(--font-mono);
  letter-spacing: 0.08em;
  color: var(--dim);
  white-space: nowrap;
}

.player-row.ready .ready-tag {
  border-color: transparent;
  background: var(--accent);
  color: #03140e;
  box-shadow: 0 0 12px rgba(25, 227, 167, 0.5);
}

.player-row.ready {
  border-color: rgba(25, 227, 167, 0.25);
}

/* Spectator banner (no seat in the running match): pre-ready for the next game or go back to the lobby. */
.spec-banner {
  position: absolute;
  top: 14px;
  left: 50%;
  z-index: 8;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 8px 8px 16px;
  transform: translateX(-50%);
  border-color: rgba(255, 59, 92, 0.4);
  border-radius: 999px;
  white-space: nowrap;
}

.spec-banner-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.spec-banner-text strong {
  font: 900 13px/1 var(--font-display);
  letter-spacing: 0.04em;
}

.spec-banner-text span {
  font: 500 10.5px var(--font-mono);
  color: var(--muted);
}

.spec-banner .btn {
  height: 34px;
  padding: 0 14px;
  border-radius: 999px;
  font-size: 12px;
}

.spec-ready-btn {
  border: 0;
  background: linear-gradient(135deg, #ffe07a, var(--gold));
  color: #1c0e00;
}

.spec-ready-btn.on {
  background: linear-gradient(135deg, var(--accent-2), var(--accent));
  color: #03140e;
  box-shadow: 0 0 20px rgba(25, 227, 167, 0.45);
}

/* Results: ready hint fades in near the end. */
.res-ready-hint {
  opacity: 0;
  transition: opacity 0.4s;
  color: var(--gold);
}

.res-ready-hint.show {
  opacity: 1;
}

.res-ready-hint kbd {
  height: 18px;
  min-width: 18px;
  font-size: 10px;
}

/* ─────────────────────────── Lobby browser (no room) ─────────────────────────── */

.browser {
  z-index: 20;
  display: grid;
  grid-template-rows: auto 1fr;
  gap: 18px;
  padding: 18px 24px 16px;
  pointer-events: auto;
  overflow-y: auto;
  overflow-x: hidden;
}

.rb-main {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 16px;
  align-items: start;
  width: min(1320px, 100%);
  justify-self: center;
  animation: rise 0.7s 0.1s var(--ease-out) both;
}

.rb-list-panel {
  min-height: 420px;
}

.rb-side {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.rb-row {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1fr) 96px;
  align-items: center;
  gap: 14px;
  padding: 10px 12px;
}

.rb-head {
  padding-top: 0;
  padding-bottom: 2px;
  font: 700 10px var(--font-mono);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--dim);
}

.rb-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: calc(100 * var(--lvh) - 330px);
  min-height: 0;
  overflow-y: auto;
  scrollbar-width: thin;
}

.rb-room {
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.025);
  animation: row-in 0.35s var(--ease-out) both;
  transition:
    border-color 0.2s,
    background 0.2s;
}

.rb-room:hover {
  border-color: var(--line-strong);
  background: rgba(124, 255, 212, 0.05);
}

.rb-room-name {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}

.rb-host {
  font: 700 14px var(--font-ui);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.rb-code {
  font: 700 11px var(--font-mono);
  letter-spacing: 0.18em;
  color: var(--accent-2);
}

.rb-seats {
  display: flex;
  flex-direction: column;
  gap: 5px;
  font: 600 11px var(--font-mono);
  color: #c3d2de;
}

.rb-seats-bar {
  height: 4px;
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
}

.rb-seats-fill {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, var(--accent-deep), var(--accent-2));
  transform-origin: left;
  transition: transform 0.4s var(--ease-out);
}

.rb-mode {
  font: 600 12px var(--font-ui);
  color: #c3d2de;
}

.rb-state {
  font: 700 11.5px var(--font-mono);
  color: var(--muted);
}

.rb-room.launching .rb-state {
  color: var(--gold);
}

.rb-room.live .rb-state {
  color: #ff8aa0;
}

.rb-room.live .rb-state::before {
  content: '● ';
  color: var(--danger);
  animation: blink 1.2s ease-in-out infinite;
}

.rb-join {
  height: 36px;
  padding: 0 12px;
  border: 0;
  background: linear-gradient(135deg, var(--accent-2), var(--accent) 50%, var(--accent-deep));
  font-size: 12px;
  color: #03140e;
}

.rb-room.live .rb-join {
  border: 1px solid rgba(255, 59, 92, 0.5);
  background: rgba(255, 59, 92, 0.12);
  color: #ffc2cf;
}

.rb-empty {
  display: grid;
  place-items: center;
  gap: 6px;
  padding: 60px 20px;
  border: 1px dashed var(--line-strong);
  border-radius: 14px;
  text-align: center;
}

.rb-empty-title {
  font: 900 20px var(--font-display);
}

.rb-empty-sub {
  font: 500 12px var(--font-mono);
  color: var(--muted);
}

.rb-foot {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: auto;
  font: 500 11px var(--font-mono);
  color: var(--dim);
}

.rb-poll-dot {
  width: 7px;
  height: 7px;
  background: var(--accent);
  box-shadow: 0 0 8px var(--accent);
}

.rb-status.bad {
  color: var(--danger);
}

.rb-foot:has(.rb-status.bad) .rb-poll-dot,
.rb-foot:has(.rb-status.stale) .rb-poll-dot {
  background: var(--danger);
  box-shadow: 0 0 8px var(--danger);
}

.rb-create {
  width: 100%;
  height: 54px;
  flex-direction: column;
  gap: 3px;
  border: 0;
  background: linear-gradient(135deg, #ffe07a, var(--gold) 45%, #ff7a2f);
  color: #1c0e00;
  font-size: 17px;
  box-shadow:
    0 10px 34px rgba(255, 182, 39, 0.35),
    inset 0 1px 0 rgba(255, 255, 255, 0.5);
}

.rb-create:not(:disabled):hover {
  border: 0;
  box-shadow: 0 0 44px rgba(255, 182, 39, 0.6);
}

.rb-code-row {
  display: flex;
  gap: 8px;
}

.rb-code-input {
  flex: 1;
  min-width: 0;
  height: 46px;
  padding: 0 14px;
  border: 1px solid var(--line-strong);
  border-radius: 11px;
  background: rgba(0, 0, 0, 0.35);
  font: 800 20px var(--font-mono);
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--accent-2);
  outline: none;
}

.rb-code-input::placeholder {
  color: rgba(255, 255, 255, 0.12);
}

.rb-code-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(25, 227, 167, 0.18);
}

.rb-code-join {
  height: 46px;
}

.ui-w1100 .rb-main {
  grid-template-columns: 1fr;
}

.ui-w1100 .rb-row {
  grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr) minmax(0, 1fr) 84px;
}

.ui-w1100 .rb-row > :nth-child(3) {
  display: none;
}

.screen-browser .toasts {
  bottom: 40px;
}

/* ─────────────────────────── In-room bar (under the logo) ─────────────────────────── */

.room-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 8px;
}

.room-label {
  font: 700 10px var(--font-mono);
  letter-spacing: 0.24em;
  color: var(--muted);
}

.room-code {
  padding: 4px 10px;
  border: 1px solid rgba(124, 255, 212, 0.4);
  border-radius: 8px;
  background: rgba(25, 227, 167, 0.1);
  font: 800 16px/1.2 var(--font-mono);
  letter-spacing: 0.22em;
  color: var(--accent-2);
  text-shadow: 0 0 12px rgba(124, 255, 212, 0.5);
  user-select: text;
}

.room-vis {
  height: 28px;
  padding: 0 10px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.05);
  font: 700 10.5px var(--font-mono);
  letter-spacing: 0.1em;
  color: #ffd98a;
}

.room-vis.public {
  color: var(--accent-2);
}

.room-vis.editable:hover {
  border-color: var(--line-strong);
  background: rgba(124, 255, 212, 0.1);
}

.room-bar .btn {
  height: 28px;
  padding: 0 12px;
  border-radius: 999px;
  font-size: 11px;
}

.room-copy {
  border-color: rgba(124, 255, 212, 0.45);
  color: var(--accent-2);
}

.room-leave {
  color: var(--muted);
}

.room-leave:hover {
  color: #ffc2cf;
}

.browser .lobby-bg {
  background:
    radial-gradient(1100px 520px at 50% -8%, rgba(25, 227, 167, 0.18), transparent 65%),
    linear-gradient(180deg, rgba(3, 5, 9, 0.55), rgba(3, 5, 9, 0.82));
}

.browser .panel.glass {
  background: linear-gradient(180deg, var(--glass-hi), transparent 42%), var(--glass-strong);
}
