*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  /* Modern European Night-Match / Tactical Esports Broadcast Palette */
  --bg: #0B0E11;
  --surface: #12171D;
  --surface-2: #171E26;
  --surface-3: #1F2833;
  --surface-hover: #25303D;

  --line: rgba(244, 246, 248, 0.10);
  --line-strong: rgba(244, 246, 248, 0.22);

  --ink: #F4F6F8;
  --muted: #8A94A6;
  --subtle: #5B6578;

  /* Single Vivid Broadcast Accent: Electric Volt */
  --volt: #C8FF00;
  --volt-hover: #D9FF4D;
  --volt-ink: #0B0E11;
  --volt-dim: rgba(200, 255, 0, 0.12);
  --volt-line: rgba(200, 255, 0, 0.42);

  /* Strict Semantic Danger (leave / kick / exhausted / own-goal only) */
  --danger: #E5484D;
  --danger-dim: rgba(229, 72, 77, 0.14);

  /* Fonts */
  --font-display: 'Barlow Condensed', 'Inter', system-ui, sans-serif;
  --font-ui: 'Inter', 'Segoe UI', system-ui, -apple-system, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

  /* Architectural Radii (Strict 2px–4px, zero SaaS bubbles) */
  --r-xs: 2px;
  --r-sm: 3px;
  --r-md: 4px;

  --shadow-panel: 0 20px 48px rgba(0, 0, 0, 0.62);
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
}

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

.is-hidden {
  opacity: 0 !important;
  pointer-events: none !important;
  visibility: hidden !important;
}

.is-collapsed {
  display: none !important;
}

.is-sr {
  display: none !important;
}

#arena-canvas {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
}

button {
  font: inherit;
  color: inherit;
  border: none;
  background: none;
  cursor: pointer;
  outline: none;
}

kbd {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: var(--r-xs);
  background: var(--surface-3);
  border: 1px solid var(--line);
  color: var(--ink);
  line-height: 1.25;
  letter-spacing: 0.04em;
}

/* =========================================================
   QUIET BROADCAST TOAST
   ========================================================= */

.toast-pill {
  position: fixed;
  top: 66px;
  left: 50%;
  transform: translateX(-50%) translateY(0);
  z-index: 90;
  padding: 7px 14px;
  border-radius: var(--r-sm);
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-left: 3px solid var(--volt);
  color: var(--ink);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.01em;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.5);
  transition: opacity 0.18s ease, transform 0.18s var(--ease-out), visibility 0.18s ease;
}

.toast-pill.is-error {
  border-left-color: var(--danger);
  color: #FCA5A5;
}

.toast-pill.is-hidden {
  transform: translateX(-50%) translateY(-6px);
}

/* =========================================================
   TEXTURED LIVE JERSEY CREST / KIT BADGE
   ========================================================= */

.kit-badge {
  position: relative;
  border-radius: 50%;
  background:
    repeating-linear-gradient(
      -45deg,
      rgba(255, 255, 255, 0.08) 0px,
      rgba(255, 255, 255, 0.08) 3px,
      transparent 3px,
      transparent 7px
    ),
    radial-gradient(circle at 32% 28%, var(--kit-light, #5AA9FF), var(--kit-main, #1F7AE0) 64%, var(--kit-dark, #0E346E) 100%);
  border: 2px solid rgba(244, 246, 248, 0.85);
  box-shadow: inset 0 0 0 2px rgba(11, 14, 17, 0.55);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  overflow: hidden;
}

.kit-badge-lg {
  width: 48px;
  height: 48px;
  cursor: pointer;
  transition: transform 0.12s ease, border-color 0.12s ease;
}

.kit-badge-lg:hover {
  transform: scale(1.04);
  border-color: var(--volt);
}

.kit-badge-sm {
  width: 24px;
  height: 24px;
  border-width: 1.5px;
  box-shadow: inset 0 0 0 1.5px rgba(11, 14, 17, 0.5);
}

.kit-badge-num {
  font-family: var(--font-mono);
  font-size: 15px;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--kit-text, #F4F6F8);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.55);
  line-height: 1;
}

/* =========================================================
   IN-GAME HUD & BROADCAST SCOREBOARD CHYRON
   ========================================================= */

.game-hud {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 10;
  transition: opacity 0.18s ease, visibility 0.18s ease;
}

.hud-corner {
  position: fixed;
  top: 12px;
  display: flex;
  align-items: center;
  gap: 6px;
  pointer-events: auto;
}

.hud-top-left { left: 14px; }
.hud-top-right { right: 14px; }

.hud-pill,
.hud-icon {
  height: 32px;
  border-radius: var(--r-sm);
  background: rgba(18, 23, 29, 0.92);
  border: 1px solid var(--line);
  color: var(--ink);
  font-size: 11.5px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: background 0.12s ease, border-color 0.12s ease, color 0.12s ease;
}

.hud-pill { padding: 0 11px; }
.hud-icon { width: 32px; }

.hud-menu-btn {
  width: 34px;
  height: 34px;
}

.hud-pill-subtle {
  color: var(--muted);
}

.hud-pill kbd {
  padding: 1px 5px;
  font-size: 9.5px;
  background: var(--bg);
  color: var(--muted);
}

.hud-pill:hover,
.hud-icon:hover {
  background: var(--surface-2);
  border-color: var(--line-strong);
  color: var(--ink);
}

.hud-pill.is-active {
  background: var(--volt-dim);
  border-color: var(--volt-line);
  color: var(--volt);
}

.hud-pill.is-active kbd {
  color: var(--volt);
  border-color: var(--volt-line);
}

.hud-ping {
  height: 32px;
  padding: 0 10px;
  border-radius: var(--r-sm);
  background: rgba(18, 23, 29, 0.9);
  border: 1px solid var(--line);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--muted);
}

.ping-dot {
  width: 6px;
  height: 6px;
  border-radius: 1px;
  background: var(--volt);
}

/* UEFA / FC Sharp Broadcast Scoreboard Chyron */
.scoreboard-bar {
  position: fixed;
  top: 10px;
  left: 50%;
  transform: translateX(-50%);
  pointer-events: auto;
  height: 40px;
  border-radius: var(--r-sm);
  background: rgba(11, 14, 17, 0.94);
  border: 1px solid var(--line-strong);
  display: inline-flex;
  align-items: stretch;
  overflow: hidden;
  transition: border-color 0.2s ease;
}

.scoreboard-bar.is-goal-pulse {
  border-color: var(--volt);
}

.sb-team {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 0 12px;
  background: var(--surface);
}

.sb-dot {
  width: 4px;
  height: 18px;
  border-radius: 1px;
  flex-shrink: 0;
}

.sb-name {
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--muted);
  text-transform: uppercase;
}

.sb-score {
  font-family: var(--font-mono);
  font-size: 18px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  color: var(--ink);
  min-width: 20px;
  text-align: center;
  transition: transform 0.18s var(--ease-out), color 0.18s ease;
}

.sb-score.is-pop {
  transform: scale(1.22);
  color: var(--volt);
}

.sb-mid {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-width: 84px;
  padding: 0 14px;
  background: var(--bg);
  border-left: 1px solid var(--line);
  border-right: 1px solid var(--line);
}

.sb-clock {
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--ink);
  line-height: 1.05;
}

.sb-clock.is-overtime {
  color: var(--volt);
}

.sb-tag {
  font-family: var(--font-mono);
  font-size: 8.5px;
  font-weight: 700;
  letter-spacing: 0.1em;
  color: var(--volt);
  margin-top: 2px;
  text-transform: uppercase;
}

/* Bottom Tactical Telemetry Strip */
.hud-bottom-strip {
  position: fixed;
  left: 50%;
  bottom: 12px;
  transform: translateX(-50%);
  pointer-events: none;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.sr-tip {
  display: none;
}

.telemetry-pill {
  pointer-events: auto;
  height: 30px;
  padding: 0 14px;
  border-radius: var(--r-sm);
  background: rgba(11, 14, 17, 0.9);
  border: 1px solid var(--line);
  display: inline-flex;
  align-items: center;
  gap: 12px;
}

.mini-stamina {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.stamina-track {
  width: 72px;
  height: 4px;
  border-radius: 1px;
  background: var(--surface-3);
  overflow: hidden;
}

.stamina-fill {
  width: 100%;
  height: 100%;
  background: var(--ink);
  transition: width 0.05s linear, background-color 0.14s ease;
}

.stamina-fill.is-sprinting { background: var(--volt); }
.stamina-fill.is-low { background: #F59E0B; }
.stamina-fill.is-exhausted { background: var(--danger); }

.strip-divider {
  width: 1px;
  height: 12px;
  background: var(--line-strong);
}

.mini-shot-readout {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.mini-val {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--ink);
}

.mini-sep {
  color: var(--subtle);
  font-size: 10px;
}

#shot-spin[data-dir='left'],
#shot-spin[data-dir='right'] {
  color: var(--volt);
}

.mini-hint {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--muted);
  padding-left: 10px;
  border-left: 1px solid var(--line);
  text-transform: uppercase;
}

.spec-chip {
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--volt);
}

/* Live TAB Stats Overlay (Zero permanent clutter, pointer-events: none) */
.live-stats-overlay {
  position: fixed;
  inset: 0;
  z-index: 25;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  pointer-events: none;
  transition: opacity 0.12s ease, visibility 0.12s ease;
}

.live-stats-card {
  width: min(560px, 100%);
  padding: 14px 16px;
  border-radius: var(--r-md);
  background: rgba(11, 14, 17, 0.94);
  border: 1px solid var(--line-strong);
  border-top: 2px solid var(--volt);
  box-shadow: var(--shadow-panel);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.live-stats-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 0 4px 10px;
  border-bottom: 1px solid var(--line);
}

.live-stats-meta {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.live-stats-score {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 15px;
  font-weight: 800;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}

.live-stats-score .sb-dot {
  height: 12px;
}

/* Bottom-Left Margin Match Chat */
.match-chat-box {
  position: fixed;
  left: 14px;
  bottom: 12px;
  width: min(300px, 34vw);
  display: flex;
  flex-direction: column;
  gap: 5px;
  pointer-events: none;
  z-index: 15;
}

.match-chat-feed {
  display: flex;
  flex-direction: column;
  gap: 3px;
  max-height: 76px;
  overflow: hidden;
  transition: opacity 0.35s ease;
}

.match-chat-box.is-quiet .match-chat-feed {
  opacity: 0;
}

.match-chat-box.is-open .match-chat-feed {
  opacity: 1;
  max-height: 96px;
}

.chat-line {
  flex-shrink: 0;
  width: fit-content;
  max-width: 100%;
  padding: 3px 9px;
  border-radius: var(--r-xs);
  background: rgba(11, 14, 17, 0.88);
  border-left: 2px solid var(--line-strong);
  font-size: 11.5px;
  line-height: 1.35;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.chat-line.is-system {
  color: var(--muted);
  font-size: 11px;
  border-left-color: var(--subtle);
}

.chat-nick {
  font-weight: 700;
  margin-right: 6px;
}

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

.match-chat-form input {
  width: 100%;
  height: 32px;
  padding: 0 10px;
  border-radius: var(--r-sm);
  background: var(--bg);
  border: 1px solid var(--volt);
  color: var(--ink);
  font: inherit;
  font-size: 12px;
  outline: none;
}

/* =========================================================
   TACTICAL NIGHT-MATCH MAIN MENU (ANTI-SLOP BROADCAST)
   ========================================================= */

.title-screen {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  padding: clamp(24px, 5vw, 68px);
  transition: opacity 0.24s ease, visibility 0.24s ease;
}

.title-scrim {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(
    94deg,
    rgba(11, 14, 17, 0.96) 0%,
    rgba(11, 14, 17, 0.88) 29%,
    rgba(11, 14, 17, 0.36) 54%,
    rgba(11, 14, 17, 0.06) 78%,
    transparent 100%
  );
}

.title-stage {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: 396px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.title-hero {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.hero-kicker-row {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.kicker-bar {
  width: 18px;
  height: 2px;
  background: var(--volt);
}

.hero-kicker {
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.14em;
  color: var(--muted);
  text-transform: uppercase;
}

.logo-lockup {
  display: flex;
  align-items: center;
  gap: 10px;
}

.logo-word {
  font-family: var(--font-display);
  font-size: clamp(64px, 7.6vw, 88px);
  font-weight: 800;
  line-height: 0.88;
  letter-spacing: 0.02em;
  color: var(--ink);
  text-transform: uppercase;
}

.logo-swoosh {
  width: clamp(62px, 6.2vw, 76px);
  height: auto;
  margin-top: 2px;
}

.hero-tagline {
  margin-top: 4px;
  font-size: 13.5px;
  font-weight: 500;
  color: var(--muted);
  letter-spacing: 0.01em;
}

/* Player Identity + Textured Jersey Badge Module */
.identity-module {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 10px 12px;
  border-radius: var(--r-md);
  background: rgba(18, 23, 29, 0.92);
  border: 1px solid var(--line);
  transition: border-color 0.15s ease;
}

.identity-module:focus-within {
  border-color: var(--volt-line);
}

.identity-fields {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 10px;
}

.id-field {
  display: flex;
  flex-direction: column;
  gap: 2px;
  cursor: text;
}

.id-field-nick {
  flex: 1;
  min-width: 0;
}

.id-field-num {
  width: 54px;
  flex-shrink: 0;
}

.id-field-lbl {
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.1em;
  color: var(--subtle);
}

.id-field input {
  width: 100%;
  background: none;
  border: none;
  outline: none;
  color: var(--ink);
  font-family: var(--font-ui);
  font-size: 14px;
  font-weight: 600;
}

.id-field input::placeholder {
  color: var(--subtle);
}

.id-field-divider {
  width: 1px;
  height: 28px;
  background: var(--line);
  flex-shrink: 0;
}

.id-num-wrap {
  display: flex;
  align-items: center;
  gap: 2px;
}

.id-hash {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 700;
  color: var(--volt);
}

.id-field-num input {
  font-family: var(--font-mono);
  font-size: 14px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

/* Sharp Segmented Mode Selector */
.menu-mode-block {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.mode-pill-track {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  border-radius: var(--r-sm);
  background: rgba(18, 23, 29, 0.92);
  border: 1px solid var(--line);
  overflow: hidden;
}

.mode-pill {
  height: 36px;
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  border-right: 1px solid var(--line);
  position: relative;
  transition: background 0.14s ease, color 0.14s ease;
}

.mode-pill:last-child {
  border-right: none;
}

.mode-pill:hover {
  color: var(--ink);
  background: var(--surface-2);
}

.mode-pill.is-selected {
  background: var(--surface-3);
  color: var(--ink);
}

.mode-pill.is-selected::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 2px;
  background: var(--volt);
}

.mode-caption {
  font-size: 12px;
  font-weight: 500;
  color: var(--muted);
}

/* Sharp Broadcast CTAs */
.title-cta-stack {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.btn-volt-primary {
  height: 50px;
  padding: 0 20px;
  border-radius: var(--r-sm);
  background: var(--volt);
  color: var(--volt-ink);
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 800;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  display: flex;
  align-items: center;
  justify-content: space-between;
  transition: background 0.12s ease, transform 0.1s ease;
}

.btn-volt-primary:hover {
  background: var(--volt-hover);
}

.btn-volt-primary:active {
  transform: translateY(1px);
}

.cta-arrow {
  font-family: var(--font-mono);
  font-size: 18px;
  font-weight: 800;
  transition: transform 0.15s var(--ease-out);
}

.btn-volt-primary:hover .cta-arrow {
  transform: translateX(3px);
}

.btn-chalk-secondary {
  height: 44px;
  padding: 0 18px;
  border-radius: var(--r-sm);
  background: rgba(18, 23, 29, 0.92);
  border: 1px solid var(--line-strong);
  color: var(--ink);
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  display: flex;
  align-items: center;
  justify-content: space-between;
  transition: background 0.12s ease, border-color 0.12s ease;
}

.btn-chalk-secondary:hover {
  background: var(--surface-2);
  border-color: var(--ink);
}

.title-sub-pills {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}

.btn-hairline {
  height: 40px;
  padding: 0 12px;
  border-radius: var(--r-sm);
  background: rgba(18, 23, 29, 0.84);
  border: 1px solid var(--line);
  color: var(--muted);
  font-size: 12.5px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: background 0.12s ease, border-color 0.12s ease, color 0.12s ease;
}

.btn-hairline:hover {
  background: var(--surface-2);
  border-color: var(--line-strong);
  color: var(--ink);
}

/* Quiet Bottom-Left Info & Legal Corner (Main Menu only) */
.menu-legal-corner {
  position: fixed;
  left: clamp(24px, 5vw, 68px);
  bottom: 16px;
  z-index: 3;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--subtle);
}

.legal-corner-link {
  color: var(--muted);
  text-decoration: none;
  transition: color 0.14s ease;
}

.legal-corner-link:hover {
  color: var(--volt);
}

.legal-corner-sep {
  color: var(--subtle);
}

/* Bottom-Right v0.1 Early Access & Patch Notes Dock (Main Menu only) */
.patch-dock {
  position: fixed;
  right: 18px;
  bottom: 16px;
  z-index: 3;
  width: 304px;
  border-radius: var(--r-sm);
  background: rgba(11, 14, 17, 0.9);
  border: 1px solid var(--line-strong);
  border-top: 2px solid var(--volt);
  overflow: hidden;
  transition: width 0.16s var(--ease-out);
}

.patch-dock.is-collapsed-body {
  width: auto;
}

.patch-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 7px 10px;
  background: rgba(18, 23, 29, 0.92);
  border-bottom: 1px solid var(--line);
}

.patch-dock.is-collapsed-body .patch-head {
  border-bottom: none;
}

.patch-head-left {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
}

.patch-ver {
  display: inline-flex;
  align-items: center;
  padding: 1px 6px;
  border-radius: var(--r-xs);
  background: var(--volt);
  color: var(--volt-ink);
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.04em;
  line-height: 1.35;
}

.patch-kicker {
  font-family: var(--font-mono);
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--muted);
  white-space: nowrap;
}

.patch-toggle {
  width: 22px;
  height: 22px;
  border-radius: var(--r-xs);
  background: var(--surface-2);
  border: 1px solid var(--line);
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 700;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: color 0.12s ease, border-color 0.12s ease;
}

.patch-toggle:hover {
  color: var(--ink);
  border-color: var(--line-strong);
}

.patch-body {
  padding: 10px 12px 9px;
  display: flex;
  flex-direction: column;
  gap: 9px;
}

.patch-dock.is-collapsed-body .patch-body {
  display: none;
}

.patch-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.patch-list li {
  position: relative;
  padding-left: 11px;
  font-size: 11.5px;
  line-height: 1.38;
  color: var(--muted);
}

.patch-list li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 6px;
  width: 4px;
  height: 4px;
  background: var(--volt);
}

.patch-list strong {
  color: var(--ink);
  font-weight: 600;
}

.patch-list kbd {
  padding: 0 4px;
  font-size: 9px;
}

.patch-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding-top: 7px;
  border-top: 1px solid var(--line);
}

.patch-foot-note {
  font-family: var(--font-mono);
  font-size: 9.5px;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--subtle);
}

.patch-foot-btn {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--volt);
  transition: color 0.12s ease;
}

.patch-foot-btn:hover {
  color: var(--volt-hover);
}

.live-pulse {
  width: 6px;
  height: 6px;
  border-radius: 1px;
  background: var(--volt);
  animation: liveBlink 1.8s steps(2, start) infinite;
}

/* =========================================================
   LEGAL, PRIVACY, TERMS & HOW-TO-PLAY MODAL + STANDALONE PAGE
   ========================================================= */

.sheet-legal {
  max-width: 640px;
  border-top: 2px solid var(--volt);
  display: flex;
  flex-direction: column;
}

.legal-head-title {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.legal-tabs {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  background: var(--bg);
  border-bottom: 1px solid var(--line);
}

.legal-tab {
  height: 36px;
  padding: 0 8px;
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--muted);
  border-right: 1px solid var(--line);
  position: relative;
  transition: color 0.12s ease, background 0.12s ease;
}

.legal-tab:last-child {
  border-right: none;
}

.legal-tab:hover {
  color: var(--ink);
  background: var(--surface);
}

.legal-tab.is-active {
  color: var(--volt);
  background: var(--surface);
}

.legal-tab.is-active::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 2px;
  background: var(--volt);
}

.legal-body {
  padding: 18px 20px;
  max-height: min(56vh, 420px);
  overflow-y: auto;
}

.legal-pane {
  display: none;
  flex-direction: column;
  gap: 10px;
}

.legal-pane.is-active {
  display: flex;
}

.legal-pane h3 {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ink);
}

.legal-pane p {
  font-size: 13px;
  line-height: 1.55;
  color: var(--muted);
}

.legal-pane a {
  color: var(--volt);
  text-decoration: none;
}

.legal-pane a:hover {
  text-decoration: underline;
}

.legal-meta {
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--subtle);
}

.legal-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.legal-list li {
  padding: 9px 11px;
  border-radius: var(--r-xs);
  background: var(--bg);
  border: 1px solid var(--line);
  border-left: 2px solid var(--line-strong);
  font-size: 12.5px;
  line-height: 1.5;
  color: var(--muted);
}

.legal-list strong {
  color: var(--ink);
}

.legal-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 18px;
  background: var(--bg);
  border-top: 1px solid var(--line);
}

/* Standalone /legal.html (/privacy, /terms, /how-to-play, /about) */
body.legal-page-body {
  overflow-y: auto;
  user-select: text;
  background: var(--bg);
  padding: 28px 18px 56px;
}

.legal-page-shell {
  max-width: 780px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.legal-page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--line-strong);
  flex-wrap: wrap;
}

.legal-page-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--ink);
}

.legal-page-brand h1 {
  font-family: var(--font-display);
  font-size: 30px;
  font-weight: 800;
  letter-spacing: 0.04em;
  line-height: 1;
}

.legal-page-nav {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.legal-page-card {
  padding: 20px 22px;
  border-radius: var(--r-sm);
  background: var(--surface);
  border: 1px solid var(--line);
  border-top: 2px solid var(--volt);
  display: flex;
  flex-direction: column;
  gap: 11px;
}

.legal-page-card h2 {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ink);
}

.legal-page-card p {
  font-size: 13.5px;
  line-height: 1.6;
  color: var(--muted);
}

@keyframes liveBlink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.3; }
}

/* =========================================================
   SHARED ARCHITECTURAL OVERLAYS & CONTROLS
   ========================================================= */

.sheet-backdrop {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(6, 9, 12, 0.74);
  backdrop-filter: blur(4px);
  transition: opacity 0.16s ease, visibility 0.16s ease;
}

.sheet-shell {
  width: 100%;
  border-radius: var(--r-md);
  background: var(--surface);
  border: 1px solid var(--line-strong);
  box-shadow: var(--shadow-panel);
  overflow: hidden;
  max-height: calc(100vh - 40px);
  transform: translateY(0);
  transition: transform 0.2s var(--ease-out);
}

.sheet-backdrop.is-hidden .sheet-shell {
  transform: translateY(8px);
}

.sheet-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 18px;
  background: var(--bg);
  border-bottom: 1px solid var(--line);
}

.sheet-title {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--ink);
  line-height: 1.05;
}

.sheet-sub {
  margin-top: 3px;
  font-size: 12.5px;
  color: var(--muted);
}

.field-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}

.field-label strong {
  color: var(--ink);
}

.field-hint {
  font-size: 11px;
  color: var(--subtle);
}

.hairline {
  width: 100%;
  height: 1px;
  background: var(--line);
}

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

.icon-close {
  width: 30px;
  height: 30px;
  border-radius: var(--r-sm);
  background: var(--surface-2);
  border: 1px solid var(--line);
  color: var(--muted);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background 0.12s ease, border-color 0.12s ease, color 0.12s ease;
}

.icon-close:hover {
  background: var(--surface-3);
  border-color: var(--line-strong);
  color: var(--ink);
}

/* Sharp Inputs & Buttons */
.flat-input {
  width: 100%;
  height: 36px;
  padding: 0 11px;
  border-radius: var(--r-sm);
  background: var(--bg);
  border: 1px solid var(--line);
  color: var(--ink);
  font: inherit;
  font-size: 12.5px;
  font-weight: 600;
  outline: none;
  transition: border-color 0.14s ease;
}

.flat-input::placeholder {
  color: var(--subtle);
  font-weight: 500;
}

.flat-input:focus {
  border-color: var(--volt);
}

.flat-input-sm {
  height: 32px;
  font-size: 12px;
  padding: 0 10px;
}

.code-input {
  font-family: var(--font-mono);
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-weight: 800;
}

.passcode-input {
  font-family: var(--font-mono);
  letter-spacing: 0.04em;
}

.passcode-masked {
  font-family: var(--font-mono);
  -webkit-text-security: disc;
}

.flat-select {
  width: 100%;
  height: 34px;
  padding: 0 30px 0 10px;
  border-radius: var(--r-sm);
  background-color: var(--bg);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%238A94A6' stroke-width='2.4' stroke-linecap='square'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  border: 1px solid var(--line);
  color: var(--ink);
  font-family: var(--font-mono);
  font-size: 11.5px;
  font-weight: 700;
  outline: none;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  transition: border-color 0.14s ease, background-color 0.14s ease;
}

.flat-select:hover:not(:disabled) {
  border-color: var(--line-strong);
  background-color: var(--surface-2);
}

.flat-select:focus {
  border-color: var(--volt);
}

.flat-select:disabled {
  opacity: 0.5;
  cursor: default;
}

.flat-select option {
  background: #12171D;
  color: #F4F6F8;
}

.btn-sage {
  height: 36px;
  padding: 0 16px;
  border-radius: var(--r-sm);
  background: var(--volt);
  color: var(--volt-ink);
  font-family: var(--font-display);
  font-size: 14.5px;
  font-weight: 800;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  white-space: nowrap;
  transition: background 0.12s ease, transform 0.1s ease;
}

.btn-sage:hover { background: var(--volt-hover); }
.btn-sage:active { transform: translateY(1px); }

.btn-lg {
  height: 42px;
  font-size: 16px;
}

.full-w { width: 100%; }

.btn-ghost {
  height: 36px;
  padding: 0 14px;
  border-radius: var(--r-sm);
  background: var(--surface-2);
  border: 1px solid var(--line);
  color: var(--ink);
  font-family: var(--font-display);
  font-size: 13.5px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
  transition: background 0.12s ease, border-color 0.12s ease;
}

.btn-ghost:hover:not(:disabled) {
  background: var(--surface-3);
  border-color: var(--line-strong);
}

.btn-ghost:disabled {
  opacity: 0.4;
  cursor: default;
}

.btn-ghost-rose {
  color: var(--danger);
}

.btn-sm {
  height: 32px;
  padding: 0 12px;
  font-size: 12px;
}

.btn-text {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  padding: 4px 7px;
  border-radius: var(--r-xs);
  transition: color 0.12s ease, background 0.12s ease;
  white-space: nowrap;
}

.btn-text:hover {
  color: var(--ink);
  background: rgba(244, 246, 248, 0.06);
}

.btn-text-volt,
.btn-text-sky { color: var(--volt); }
.btn-text-volt:hover,
.btn-text-sky:hover { color: var(--volt-hover); }

.btn-text-rose { color: var(--danger); }
.btn-text-rose:hover { color: #FCA5A5; }

.mono-chip {
  padding: 2px 7px;
  border-radius: var(--r-xs);
  background: var(--surface-2);
  border: 1px solid var(--line);
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--muted);
}

/* =========================================================
   ONLINE ROOM BROWSER (LIVE MATCH BULLETIN TABLE)
   ========================================================= */

.sheet-browser {
  max-width: 720px;
  display: flex;
  flex-direction: column;
}

.browser-title-row {
  display: inline-flex;
  align-items: center;
  gap: 12px;
}

.status-inline {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}

.conn-dot {
  width: 6px;
  height: 6px;
  border-radius: 1px;
  background: #F59E0B;
}

.status-inline.is-online .conn-dot { background: var(--volt); }
.status-inline.is-offline .conn-dot { background: var(--danger); }

.browser-controls-grid {
  display: grid;
  grid-template-columns: 1.35fr 0.85fr;
  gap: 16px;
  padding: 16px 18px;
  border-bottom: 1px solid var(--line);
  background: var(--surface);
}

.create-room-form,
.join-code-form {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.join-code-form {
  padding-left: 16px;
  border-left: 1px solid var(--line);
}

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

.flex-1 {
  flex: 1;
  min-width: 0;
}

.inline-row .btn-sage,
.inline-row .btn-ghost {
  min-width: 84px;
}

.room-create-opts {
  display: flex;
  align-items: center;
  gap: 6px;
}

.chip-toggle {
  height: 32px;
  padding: 0 10px;
  border-radius: var(--r-sm);
  background: var(--bg);
  border: 1px solid var(--line);
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--muted);
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
  transition: border-color 0.12s ease, color 0.12s ease, background 0.12s ease;
}

.chip-toggle input {
  accent-color: var(--volt);
  width: 13px;
  height: 13px;
  cursor: pointer;
}

.chip-toggle:has(input:checked) {
  border-color: var(--volt-line);
  background: var(--volt-dim);
  color: var(--volt);
}

.browser-rooms-section {
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.bulletin-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 18px 8px;
  background: rgba(11, 14, 17, 0.45);
}

.bulletin-cols,
.room-row {
  display: grid;
  grid-template-columns: 1.7fr 0.72fr 0.68fr 0.62fr 0.68fr 74px;
  align-items: center;
  gap: 10px;
  padding: 0 18px;
}

.bulletin-cols {
  height: 28px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: var(--bg);
  font-family: var(--font-mono);
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.1em;
  color: var(--subtle);
}

.rooms-feed {
  max-height: 248px;
  min-height: 112px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}

.empty-state {
  margin: auto 0;
  padding: 28px 18px;
  text-align: center;
  font-size: 12.5px;
  color: var(--muted);
}

.room-row {
  min-height: 46px;
  border-bottom: 1px solid var(--line);
  transition: background 0.1s ease;
}

.room-row:last-child { border-bottom: none; }
.room-row:hover { background: var(--surface-2); }

.room-row-title {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
}

.room-row-title-text {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.room-kit-bars {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  flex-shrink: 0;
}

.room-kit-bar {
  width: 3px;
  height: 14px;
  border-radius: 1px;
}

.room-cell-mono {
  font-family: var(--font-mono);
  font-size: 11.5px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: var(--muted);
  white-space: nowrap;
}

.room-state-tag {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--muted);
}

.room-state-tag.is-live {
  color: var(--volt);
}

.room-lock-badge {
  font-family: var(--font-mono);
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink);
  background: var(--surface-3);
  border: 1px solid var(--line-strong);
  padding: 1px 5px;
  border-radius: var(--r-xs);
  flex-shrink: 0;
}

.room-row .btn-ghost {
  height: 28px;
  padding: 0 10px;
  font-size: 12px;
}

/* =========================================================
   ONLINE LOBBY (TACTICAL MATCH LINEUP BOARD)
   ========================================================= */

.sheet-lobby {
  max-width: 700px;
  display: flex;
  flex-direction: column;
}

.lobby-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 14px 18px;
  background: var(--bg);
  border-bottom: 1px solid var(--line);
  flex-wrap: wrap;
}

.lobby-head-left,
.lobby-head-right {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.code-tag {
  padding: 3px 9px;
  border-radius: var(--r-xs);
  background: var(--surface-2);
  border: 1px solid var(--line-strong);
  color: var(--volt);
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.12em;
  transition: border-color 0.12s ease, background 0.12s ease;
}

.code-tag:hover {
  border-color: var(--volt);
  background: var(--surface-3);
}

.lobby-meta-pill {
  padding: 2px 7px;
  border-radius: var(--r-xs);
  background: var(--surface-2);
  border: 1px solid var(--line);
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.06em;
}

.lobby-meta-pill.is-lock {
  border-color: var(--volt-line);
  color: var(--volt);
}

.lobby-body {
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  overflow-y: auto;
  max-height: calc(100vh - 170px);
}

.teams-split {
  flex-shrink: 0;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
  min-height: 124px;
}

.team-pane {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 12px;
  border-radius: var(--r-sm);
  background: var(--bg);
  border: 1px solid var(--line);
}

.team-accent-bar {
  height: 2px;
  background: var(--volt);
}

.team-pane-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.team-title-row {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.team-pane-name {
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink);
}

.muted-count {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  color: var(--muted);
  padding: 1px 5px;
  background: var(--surface-2);
  border-radius: var(--r-xs);
}

.roster-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.roster-empty {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--subtle);
  padding: 8px 2px;
}

.player-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  padding: 6px 8px;
  border-radius: var(--r-xs);
  background: var(--surface);
  border: 1px solid var(--line);
  font-size: 12.5px;
  font-weight: 600;
  color: var(--ink);
}

.player-row.is-me {
  border-left: 2px solid var(--volt);
  background: var(--surface-2);
}

.player-row-name {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.roster-tag-chip {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 800;
  padding: 1px 5px;
  border-radius: var(--r-xs);
  background: var(--surface-3);
  color: var(--ink);
  flex-shrink: 0;
}

.host-crown {
  color: var(--volt);
  font-size: 11px;
}

.player-row-tools {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  opacity: 0.45;
  transition: opacity 0.12s ease;
}

.player-row:hover .player-row-tools {
  opacity: 1;
}

.tiny-move-btn {
  width: 21px;
  height: 21px;
  border-radius: var(--r-xs);
  background: var(--surface-3);
  border: 1px solid var(--line);
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: color 0.12s ease, border-color 0.12s ease;
}

.tiny-move-btn:hover {
  color: var(--ink);
  border-color: var(--line-strong);
}

.tiny-move-btn.is-kick:hover {
  color: var(--danger);
  border-color: var(--danger);
}

/* Spectators Strip */
.spec-strip {
  flex-shrink: 0;
  padding-top: 10px;
  border-top: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  gap: 6px;
}

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

.spec-chips {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.spec-chips .player-row {
  padding: 4px 9px;
  font-size: 11.5px;
}

.spec-chips .roster-empty {
  display: none;
}

/* Collapsible Match Config Bar */
.lobby-config-wrap {
  flex-shrink: 0;
  border-radius: var(--r-sm);
  background: var(--bg);
  border: 1px solid var(--line);
  overflow: hidden;
}

.lobby-config-bar {
  width: 100%;
  padding: 10px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: var(--ink);
  transition: background 0.12s ease;
}

.lobby-config-bar:hover {
  background: var(--surface-2);
}

.config-summary-left {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.config-swatch-pair {
  display: inline-flex;
  align-items: center;
  gap: 3px;
}

.config-swatch-pair .sb-dot {
  width: 4px;
  height: 14px;
}

.config-summary-text {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 700;
  color: var(--ink);
}

.config-toggle-label {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--volt);
}

.config-chevron {
  transition: transform 0.18s ease;
}

.lobby-config-bar[aria-expanded='true'] .config-chevron {
  transform: rotate(180deg);
}

.lobby-config-panel {
  padding: 12px;
  border-top: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  gap: 12px;
  background: var(--surface);
}

.lobby-config-panel.is-hidden {
  display: none;
}

.cfg-select-grid {
  display: grid;
  grid-template-columns: 1.55fr 0.85fr 0.85fr;
  gap: 10px;
}

.cfg-colors-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

.cfg-pair-row {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

.cfg-section {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.seg-group {
  display: flex;
  align-items: center;
  gap: 2px;
  padding: 2px;
  border-radius: var(--r-sm);
  background: var(--bg);
  border: 1px solid var(--line);
  flex-wrap: wrap;
}

.seg-opt {
  flex: 1;
  min-width: 38px;
  height: 28px;
  padding: 0 7px;
  border-radius: var(--r-xs);
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  color: var(--muted);
  transition: background 0.12s ease, color 0.12s ease;
  white-space: nowrap;
}

.seg-opt:hover:not(:disabled) {
  color: var(--ink);
  background: var(--surface-2);
}

.seg-opt.is-active {
  background: var(--volt);
  color: var(--volt-ink);
  font-weight: 800;
}

.seg-opt:disabled {
  opacity: 0.45;
  cursor: default;
}

.color-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.color-side-lbl {
  width: 28px;
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--muted);
}

.swatch-row {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.color-swatch {
  width: 22px;
  height: 22px;
  border-radius: var(--r-xs);
  border: 1px solid rgba(244, 246, 248, 0.2);
  transition: transform 0.12s ease, border-color 0.12s ease, opacity 0.12s ease;
}

.color-swatch:hover:not(:disabled) {
  transform: scale(1.1);
}

.color-swatch.is-selected {
  border: 2px solid var(--volt);
  box-shadow: 0 0 0 1px var(--bg);
}

.color-swatch:disabled {
  opacity: 0.22;
  cursor: default;
}

/* Embedded Lobby Chat */
.lobby-chat-pane {
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.lobby-chat-feed {
  flex-shrink: 0;
  max-height: 132px;
  overflow-y: auto;
  overscroll-behavior: contain;
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 8px 10px;
  border-radius: var(--r-sm);
  background: var(--bg);
  border: 1px solid var(--line);
}

.lobby-chat-feed.is-empty {
  display: none;
}

.lobby-chat-feed .chat-line {
  flex-shrink: 0;
  width: 100%;
  background: none;
  border-left: none;
  padding: 1px 0;
  font-size: 12px;
  line-height: 1.4;
  overflow: visible;
  text-overflow: clip;
  white-space: normal;
  word-break: break-word;
}

.chat-input-row {
  display: flex;
  align-items: center;
  gap: 6px;
}

/* Lobby Footer */
.lobby-footer {
  padding: 12px 18px;
  border-top: 1px solid var(--line);
  background: var(--bg);
}

.lobby-footer-host {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.lobby-footer-host .btn-sage {
  min-width: 168px;
}

.host-utility-row {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.dot-sep {
  color: var(--subtle);
}

.guest-note {
  text-align: center;
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--muted);
  padding: 4px 0;
}

/* =========================================================
   SETTINGS RIGHT-EDGE TACTICAL SLIDE DRAWER
   ========================================================= */

.drawer-backdrop {
  position: fixed;
  inset: 0;
  z-index: 60;
  background: rgba(6, 9, 12, 0.56);
  backdrop-filter: blur(3px);
  display: flex;
  justify-content: flex-end;
  padding: 12px;
  transition: opacity 0.16s ease, visibility 0.16s ease;
}

.drawer-panel {
  width: min(348px, 100%);
  height: 100%;
  border-radius: var(--r-md);
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-top: 2px solid var(--volt);
  box-shadow: var(--shadow-panel);
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  overflow-y: auto;
  transform: translateX(0);
  transition: transform 0.22s var(--ease-out);
}

.drawer-backdrop.is-hidden .drawer-panel {
  transform: translateX(28px);
}

.drawer-section {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.drawer-setting-block {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 10px 0;
}

.toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 10px 0;
  cursor: pointer;
}

.toggle-row.is-compact {
  padding: 4px 0 0;
}

.toggle-copy {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.toggle-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--ink);
}

.toggle-sub {
  font-size: 11.5px;
  color: var(--muted);
}

/* Sharp Modular Toggle Switch */
.switch-wrap {
  position: relative;
  display: inline-flex;
  flex-shrink: 0;
}

.switch-wrap input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.switch-track {
  width: 40px;
  height: 22px;
  border-radius: var(--r-xs);
  background: var(--bg);
  border: 1px solid var(--line-strong);
  padding: 2px;
  display: flex;
  align-items: center;
  transition: background 0.14s ease, border-color 0.14s ease;
}

.switch-thumb {
  width: 16px;
  height: 16px;
  border-radius: 1px;
  background: var(--muted);
  transform: translateX(0);
  transition: transform 0.16s var(--ease-out), background 0.14s ease;
}

.switch-wrap input:checked + .switch-track {
  background: var(--volt);
  border-color: var(--volt);
}

.switch-wrap input:checked + .switch-track .switch-thumb {
  transform: translateX(18px);
  background: var(--volt-ink);
}

.volume-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 0 10px;
  transition: opacity 0.15s ease;
}

.volume-row.is-muted {
  opacity: 0.35;
}

.volume-label {
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--muted);
  white-space: nowrap;
}

.volume-slider {
  flex: 1;
  -webkit-appearance: none;
  appearance: none;
  height: 3px;
  border-radius: 1px;
  background: var(--surface-3);
  outline: none;
  cursor: pointer;
}

.volume-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 12px;
  height: 12px;
  border-radius: 1px;
  background: var(--volt);
  cursor: pointer;
}

.volume-slider::-moz-range-thumb {
  width: 12px;
  height: 12px;
  border: none;
  border-radius: 1px;
  background: var(--volt);
}

.volume-val {
  min-width: 34px;
  text-align: right;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--ink);
}

.avatar-mini-input {
  width: 56px;
  height: 34px;
  padding: 0 6px;
  font-family: var(--font-mono);
  text-align: center;
  text-transform: uppercase;
  font-weight: 800;
  letter-spacing: 0.06em;
  flex-shrink: 0;
}

.drawer-controls-ref {
  display: flex;
  flex-direction: column;
  gap: 9px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

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

.key-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12px;
  color: var(--muted);
}

.drawer-footer {
  margin-top: auto;
}

/* =========================================================
   ROOM PASSWORD PROMPT & POST-MATCH SUMMARY MVP CARD
   ========================================================= */

.sheet-password {
  max-width: 360px;
  padding: 18px;
  border-top: 2px solid var(--volt);
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.password-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.pass-error {
  font-size: 12px;
  font-weight: 600;
  color: var(--danger);
}

.password-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 4px;
}

.sheet-summary {
  max-width: 600px;
  border-top: 2px solid var(--volt);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.summary-hero {
  padding: 20px 20px 16px;
  background: var(--bg);
  border-bottom: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  text-align: center;
}

.summary-meta {
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}

.summary-title {
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ink);
  line-height: 1;
}

.summary-score-row {
  margin-top: 4px;
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 6px 16px;
  border-radius: var(--r-sm);
  background: var(--surface);
  border: 1px solid var(--line);
}

.summary-score-row .sb-dot {
  height: 16px;
}

.summary-team-name {
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.summary-score-num {
  font-family: var(--font-mono);
  font-size: 22px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  color: var(--ink);
  min-width: 18px;
}

.summary-score-dash {
  color: var(--subtle);
  font-family: var(--font-mono);
  font-weight: 700;
}

.summary-table-wrap {
  padding: 12px 16px 10px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  max-height: 290px;
  overflow-y: auto;
}

.summary-table-head,
.summary-row {
  display: grid;
  grid-template-columns: 1fr 34px 34px 34px 60px 56px;
  align-items: center;
  gap: 6px;
  padding: 0 10px;
}

.summary-table-head {
  font-family: var(--font-mono);
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--subtle);
  padding-bottom: 6px;
  border-bottom: 1px solid var(--line);
}

.summary-table-head span:not(:first-child),
.summary-row .s-num {
  text-align: center;
  font-variant-numeric: tabular-nums;
}

.summary-rows {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.summary-row {
  padding: 8px 10px;
  border-radius: var(--r-xs);
  background: var(--bg);
  border: 1px solid var(--line);
  font-size: 12.5px;
  font-weight: 600;
  color: var(--ink);
}

.summary-row.is-mvp {
  border-left: 3px solid var(--volt);
  background: rgba(200, 255, 0, 0.05);
}

.summary-row.is-me {
  border-color: var(--line-strong);
}

.summary-player-cell {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.summary-tag {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 1.5px solid rgba(244, 246, 248, 0.65);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  font-size: 9.5px;
  font-weight: 800;
  flex-shrink: 0;
}

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

.mvp-badge {
  padding: 2px 6px;
  border-radius: var(--r-xs);
  background: var(--volt);
  color: var(--volt-ink);
  font-family: var(--font-mono);
  font-size: 9.5px;
  font-weight: 800;
  letter-spacing: 0.06em;
  flex-shrink: 0;
}

.s-num {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--muted);
}

.s-pts {
  font-size: 12.5px;
  font-weight: 800;
  color: var(--ink);
}

.rating-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 22px;
  min-width: 40px;
  padding: 0 6px;
  border-radius: var(--r-xs);
  font-family: var(--font-mono);
  font-size: 11.5px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  background: var(--surface-3);
  color: var(--ink);
}

.rating-pill.is-high {
  background: rgba(244, 246, 248, 0.14);
  color: var(--ink);
  border: 1px solid var(--line-strong);
}

.rating-pill.is-elite {
  background: var(--volt);
  color: var(--volt-ink);
}

.summary-highlight {
  margin: 4px 16px 12px;
  padding: 9px 12px;
  border-radius: var(--r-xs);
  background: var(--bg);
  border: 1px solid var(--line);
  border-left: 2px solid var(--volt);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  font-size: 12px;
  flex-wrap: wrap;
}

.summary-hi-label {
  font-family: var(--font-mono);
  font-weight: 800;
  color: var(--volt);
  text-transform: uppercase;
  font-size: 10px;
  letter-spacing: 0.08em;
}

.summary-hi-text {
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--ink);
  font-weight: 600;
}

.summary-footer {
  padding: 12px 16px;
  border-top: 1px solid var(--line);
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.summary-footer .btn-sage {
  min-width: 148px;
}

.summary-guest-note {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--muted);
}

/* =========================================================
   IN-GAME ESC MENU (SHARP SINGLE MODULAR CARD)
   ========================================================= */

.pause-backdrop {
  background: rgba(6, 9, 12, 0.62);
  backdrop-filter: blur(3px);
}

.pause-card {
  max-width: 340px;
  padding: 18px;
  border-top: 2px solid var(--volt);
  display: flex;
  flex-direction: column;
  gap: 14px;
  overflow-y: auto;
}

.pause-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.pause-title {
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--ink);
  line-height: 1;
}

.pause-sub {
  margin-top: 4px;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
}

.pause-block {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.pause-modes .seg-opt {
  min-width: 0;
  height: 30px;
}

.pause-host-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
}

.pause-host-row .btn-ghost {
  height: 34px;
  padding: 0 8px;
}

.pause-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding-top: 8px;
  border-top: 1px solid var(--line);
}

.pause-row {
  height: 40px;
  padding: 0 10px;
  border-radius: var(--r-xs);
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
  text-align: left;
  transition: background 0.12s ease;
}

.pause-row svg {
  color: var(--muted);
  flex-shrink: 0;
}

.pause-row:hover {
  background: var(--surface-2);
}

.pause-row:hover svg {
  color: var(--volt);
}

.row-chevron {
  margin-left: auto;
  font-family: var(--font-mono);
  font-size: 15px;
  color: var(--subtle);
}

.pause-exit {
  align-self: center;
}

/* =========================================================
   FALSO TUTORIAL (3 SHORT TACTICAL STEPS)
   ========================================================= */

.sheet-tutorial {
  max-width: 570px;
  border-top: 2px solid var(--volt);
  display: flex;
  flex-direction: column;
  overflow-y: auto;
}

.tut-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px 0 18px;
}

.tut-kicker {
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}

.tut-kicker span {
  margin-left: 6px;
  color: var(--volt);
}

.tut-step {
  display: none;
  flex-direction: column;
}

.tut-step.is-active {
  display: flex;
  animation: tutStepIn 0.24s var(--ease-out);
}

@keyframes tutStepIn {
  from { opacity: 0; transform: translateX(8px); }
  to { opacity: 1; transform: translateX(0); }
}

.tut-visual {
  margin: 12px 16px 0;
  border-radius: var(--r-sm);
  overflow: hidden;
  background: #123A25;
  border: 1px solid var(--line);
}

.tut-svg {
  display: block;
  width: 100%;
  height: auto;
}

.tut-defs {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

.tut-copy {
  padding: 16px 18px 4px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 162px;
}

.tut-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.tut-title {
  font-family: var(--font-display);
  font-size: 25px;
  font-weight: 800;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--ink);
  line-height: 1.05;
}

.tut-text {
  font-size: 13.5px;
  line-height: 1.55;
  color: var(--muted);
  max-width: 490px;
}

.tut-text strong {
  color: var(--ink);
  font-weight: 700;
}

.tut-dir-switch {
  flex-wrap: nowrap;
}

.tut-dir-switch .seg-opt {
  min-width: 0;
  padding: 0 10px;
}

.tut-keys {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 2px;
}

.key-cap {
  min-width: 34px;
  height: 32px;
  padding: 0 10px;
  border-radius: var(--r-xs);
  background: var(--bg);
  border: 1px solid var(--line-strong);
  box-shadow: 0 2px 0 rgba(0, 0, 0, 0.7);
  color: var(--ink);
  font-size: 12px;
  font-weight: 800;
}

.key-wide {
  min-width: 72px;
}

.key-plus {
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 700;
  color: var(--subtle);
}

.tut-rule {
  margin-left: 6px;
  font-size: 12px;
  color: var(--muted);
}

.tut-rule strong {
  color: var(--volt);
}

.tut-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 18px 18px;
  border-top: 1px solid var(--line);
  margin-top: 10px;
  background: var(--bg);
}

.tut-dots {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.tut-dot {
  width: 10px;
  height: 3px;
  border-radius: 1px;
  background: var(--surface-3);
  transition: width 0.18s var(--ease-out), background 0.16s ease;
}

.tut-dot.is-active {
  width: 24px;
  background: var(--volt);
}

.tut-nav {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.tut-nav .btn-sage {
  min-width: 118px;
}

.tut-nav .btn-ghost:disabled {
  visibility: hidden;
}

/* Scrollbar Polish */
.rooms-feed::-webkit-scrollbar,
.lobby-body::-webkit-scrollbar,
.lobby-chat-feed::-webkit-scrollbar,
.summary-table-wrap::-webkit-scrollbar,
.drawer-panel::-webkit-scrollbar,
.sheet-tutorial::-webkit-scrollbar,
.legal-body::-webkit-scrollbar {
  width: 5px;
}

.rooms-feed::-webkit-scrollbar-thumb,
.lobby-body::-webkit-scrollbar-thumb,
.lobby-chat-feed::-webkit-scrollbar-thumb,
.summary-table-wrap::-webkit-scrollbar-thumb,
.drawer-panel::-webkit-scrollbar-thumb,
.sheet-tutorial::-webkit-scrollbar-thumb,
.legal-body::-webkit-scrollbar-thumb {
  background: var(--surface-3);
}

/* Responsive */
@media (max-width: 820px) {
  .patch-dock {
    width: 248px;
  }
  .patch-dock .patch-body {
    display: none;
  }
  .patch-dock.is-force-open .patch-body {
    display: flex;
  }
  .legal-tabs {
    grid-template-columns: repeat(2, 1fr);
  }
  .legal-tab {
    border-bottom: 1px solid var(--line);
  }
}

@media (max-width: 720px) {
  .browser-controls-grid { grid-template-columns: 1fr; }
  .join-code-form { padding-left: 0; border-left: none; padding-top: 12px; border-top: 1px solid var(--line); }
  .bulletin-cols,
  .room-row { grid-template-columns: 1.5fr 0.7fr 0.7fr 0.6fr 68px; }
  .bulletin-cols span:nth-child(5),
  .room-row .room-cell-code { display: none; }
}

@media (max-width: 620px) {
  .sb-name { display: none; }
  .teams-split,
  .cfg-pair-row,
  .cfg-select-grid,
  .cfg-colors-grid { grid-template-columns: 1fr; }
  .lobby-footer-host { flex-direction: column; align-items: stretch; }
  .lobby-footer-host .host-utility-row { justify-content: center; }
  .title-sub-pills { grid-template-columns: 1fr; }
  .patch-dock { display: none; }
  .menu-legal-corner { left: 16px; bottom: 12px; font-size: 9.5px; }
}
