@import url('https://fonts.googleapis.com/css2?family=Bebas+Neue&family=Barlow+Condensed:wght@400;600;700&display=swap');

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

:root {
  --bg: #0d1117;
  --panel: #161b22;
  --panel2: #1c2330;
  --border: #30363d;
  --text: #e6edf3;
  --muted: #8b949e;
  --red: #e34c4c;
  --red-dark: #c03030;
  --blue: #4c8fe3;
  --blue-dark: #2f6ec0;
  --gold: #f0c040;
  --gold-dark: #c89a1a;
  --ice: #cce8f5;
  --radius: 10px;
}

html, body {
  height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: 'Segoe UI', system-ui, sans-serif;
  overflow: hidden;
}

/* Screens */
.screen {
  display: none;
  position: fixed;
  inset: 0;
  align-items: center;
  justify-content: center;
}
.screen.active { display: flex; }

/* Game: mouse is for aim/shoot — don't highlight HUD, faceoff timer, etc. Chat stays selectable. */
#screen-game.active #game-content {
  -webkit-user-select: none;
  user-select: none;
}
#screen-game.active #game-content input,
#screen-game.active #game-content textarea,
#screen-game.active #game-content [contenteditable="true"] {
  -webkit-user-select: text;
  user-select: text;
}
#screen-game.active #game-chat-messages,
#screen-game.active #game-chat-history-list {
  -webkit-user-select: text;
  user-select: text;
}

/* Logo */
.logo {
  text-align: center;
  margin-bottom: 8px;
  line-height: 1;
}
.logo-zealot {
  display: block;
  font-family: Impact, Arial Black, sans-serif;
  font-size: 3.5rem;
  letter-spacing: 4px;
  background: linear-gradient(135deg, #fff 0%, var(--ice) 50%, var(--gold) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.logo-hockey {
  display: block;
  font-family: Impact, Arial Black, sans-serif;
  font-size: 1.6rem;
  letter-spacing: 8px;
  color: var(--muted);
}
.tagline {
  text-align: center;
  color: var(--muted);
  font-size: 0.9rem;
  letter-spacing: 2px;
  text-transform: uppercase;
  margin-bottom: 32px;
}
.welcome-msg {
  text-align: center;
  color: var(--muted);
  margin-bottom: 24px;
  font-size: 1rem;
}
.welcome-msg span { color: var(--gold); font-weight: 600; }

.menu-footer {
  margin-top: 12px;
  margin-bottom: 0;
  text-align: center;
  font-size: 0.8rem;
  color: var(--muted);
  opacity: 0.9;
  letter-spacing: 0.03em;
}

/* Cards */
.center-card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 40px 48px;
  width: 100%;
  max-width: 420px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  box-shadow: 0 8px 40px rgba(0,0,0,0.5);
}

/* Forms */
.form-group { display: flex; flex-direction: column; gap: 6px; }
input[type="text"] {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text);
  font-size: 1rem;
  padding: 12px 14px;
  width: 100%;
  outline: none;
  transition: border-color 0.15s;
}
input[type="text"]:focus { border-color: var(--blue); }
input[type="text"]::placeholder { color: var(--muted); }

.error-msg { color: var(--red); font-size: 0.85rem; min-height: 18px; }

/* Buttons */
.btn {
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: 1px;
  padding: 12px 20px;
  text-transform: uppercase;
  transition: filter 0.15s, transform 0.1s;
  width: 100%;
}
.btn:hover { filter: brightness(1.15); transform: translateY(-2px); }
.btn:active { transform: translateY(0); filter: brightness(0.9); }

.btn-primary { background: var(--blue); color: #fff; }
.btn-secondary { background: var(--panel2); color: var(--text); border: 1px solid var(--border); }
.btn-gold { background: var(--gold); color: #111; }
.btn-ghost { background: transparent; color: var(--muted); border: 1px solid var(--border); }
.btn-small { font-size: 0.8rem; padding: 8px 14px; width: auto; }
.btn-red { background: var(--red); color: #fff; }
.btn-blue { background: var(--blue); color: #fff; }
.btn-grey { background: #444; color: #ccc; }

/* Browser Screen */
.browser-container {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  width: min(700px, 95vw);
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 8px 40px rgba(0,0,0,0.5);
  overflow-x: hidden;
  overflow-y: auto;
}
.browser-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  border-bottom: 1px solid var(--border);
}
.browser-header h2 { font-size: 1.2rem; }
.header-actions { display: flex; gap: 8px; }

.lobby-list {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.lobby-list::-webkit-scrollbar { width: 6px; }
.lobby-list::-webkit-scrollbar-track { background: transparent; }
.lobby-list::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }

.empty-state { color: var(--muted); text-align: center; padding: 40px 0; }

.lobby-item {
  background: var(--panel2);
  border: 1px solid var(--border);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}
.lobby-item:hover { border-color: var(--blue); background: #1e2940; }
.lobby-item-name { font-weight: 600; font-size: 1rem; }
.lobby-item-info { color: var(--muted); font-size: 0.85rem; margin-top: 2px; }
.lobby-item-btn { flex-shrink: 0; }

.menu-activity-hint {
  color: var(--muted);
  font-size: 0.82rem;
  text-align: center;
  margin: 4px 0 0;
  min-height: 1.2em;
}

.browser-section {
  border-bottom: 1px solid var(--border);
}
.browser-section:last-of-type {
  border-bottom: none;
}
.browser-section-title {
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  padding: 12px 16px 8px;
  margin: 0;
}
.browser-section-hint {
  font-weight: 400;
  text-transform: none;
  letter-spacing: 0;
  color: var(--muted);
  opacity: 0.85;
  font-size: 0.72rem;
}
.browser-live-note {
  font-size: 0.75rem;
  color: var(--muted);
  padding: 0 16px 12px;
  margin: 0;
  opacity: 0.9;
}

.active-game-item {
  background: linear-gradient(135deg, #1a2235 0%, #151c2e 100%);
  border: 1px solid var(--border);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 18px;
}
.active-game-item-main { min-width: 0; flex: 1; }
.active-game-score {
  flex-shrink: 0;
  font-size: 1.35rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.02em;
}
.active-game-score .score-red { color: var(--red); }
.active-game-score .score-blue { color: var(--blue); }
.active-game-score .score-sep {
  color: var(--muted);
  margin: 0 4px;
  font-weight: 600;
}

.browser-container .lobby-list {
  flex: none;
  max-height: min(280px, 38vh);
}

/* Lobby Room Screen */
.lobby-room {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  width: min(900px, 95vw);
  max-height: 92vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 8px 40px rgba(0,0,0,0.5);
  overflow: visible;
}
.lobby-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  border-bottom: 1px solid var(--border);
}
.lobby-header h2 { font-size: 1.1rem; }

.teams-container {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 0;
  flex: 1;
  overflow: visible;
}
.team-column {
  padding: 16px;
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  overflow: visible;
}
.team-column:last-child { border-right: none; }

.team-header {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  font-size: 0.85rem;
  letter-spacing: 2px;
  text-transform: uppercase;
  margin-bottom: 12px;
  color: var(--muted);
}
.team-dot {
  width: 10px; height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}
.team-dot.red { background: var(--red); }
.team-dot.blue { background: var(--blue); }
.team-dot.grey { background: #555; }

.player-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  overflow-y: auto;
  flex: 1;
}

.player-chip {
  background: var(--panel2);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 12px;
}
.player-chip-bot {
  border-left: 3px solid rgba(255, 220, 60, 0.7);
  background: rgba(255, 220, 60, 0.05);
}
.player-chip-name {
  font-weight: 600;
  font-size: 0.9rem;
  margin-bottom: 6px;
}
.player-chip-name--promote-host {
  cursor: context-menu;
  border-radius: 4px;
  outline-offset: 2px;
}
.player-chip-name--promote-host:hover {
  background: rgba(255, 255, 255, 0.06);
}
.lobby-host-context-menu {
  position: fixed;
  z-index: 2500;
  min-width: 168px;
  padding: 4px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.55);
}
.lobby-host-context-menu-item {
  display: block;
  width: 100%;
  margin: 0;
  padding: 10px 12px;
  border: none;
  border-radius: 6px;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-size: 0.88rem;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
}
.lobby-host-context-menu-item:hover {
  background: rgba(76, 143, 227, 0.22);
  color: #e6edf7;
}
.chip-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.chip-actions .btn {
  font-size: 0.7rem;
  padding: 4px 10px;
  width: auto;
  direction: ltr;
  unicode-bidi: isolate;
}

.lobby-status {
  padding: 12px 24px;
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 0.85rem;
  text-align: center;
}

/* Game Screen */
.game-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100vh;
  width: 100vw;
  gap: 0;
  background: var(--bg);
  overflow: hidden;
}

#game-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  transform-origin: center center;
}

/* Fullscreen (desktop): bounding box is logical rink only; HUD + shot clock sit over the top of the ice
   so scale uses 16:9 and fills 16:9 displays without side letterboxing. Width/height set in game.js. */
#game-content.fullscreen-stack-as-overlay {
  display: block;
  position: relative;
  flex: none;
  align-items: stretch;
  max-width: none;
  box-sizing: border-box;
}
#game-content.fullscreen-stack-as-overlay .hud {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  max-width: none;
  z-index: 25;
  border-radius: 10px 10px 0 0;
}
#game-content.fullscreen-stack-as-overlay #shot-clock-bar {
  position: absolute;
  top: var(--fs-hud-h, 48px);
  left: 0;
  width: 100%;
  max-width: none;
  z-index: 24;
}
#game-content.fullscreen-stack-as-overlay .canvas-container {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  max-width: none;
  aspect-ratio: unset;
}

.hud {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  background: var(--panel);
  border: 1px solid var(--border);
  border-bottom: none;
  border-radius: 10px 10px 0 0;
  width: min(1173px, 100vw);
  /* More top room and extra right padding so HUD buttons don't overlap scores. */
  padding: 4px 72px 6px 24px;
  position: relative;
}

.btn-fullscreen {
  position: absolute;
  right: 10px;
  /* Place controls in the seam between HUD and rink (not over score text). */
  top: calc(100% + 4px);
  z-index: 20;
  background: var(--panel2);
  border: 1px solid var(--border);
  border-radius: 5px;
  color: var(--text);
  font-size: 1rem;
  cursor: pointer;
  padding: 3px 7px;
  line-height: 1;
  transition: color 0.15s, border-color 0.15s;
}
.btn-fullscreen:hover { color: var(--text); border-color: var(--blue); }
.btn-game-menu {
  position: absolute;
  right: 44px;
  /* Place controls in the seam between HUD and rink (not over score text). */
  top: calc(100% + 4px);
  z-index: 20;
  background: var(--panel2);
  border: 1px solid var(--border);
  border-radius: 4px;
  color: var(--muted);
  cursor: pointer;
  font-size: 1.1rem;
  padding: 3px 8px;
  line-height: 1;
  transition: color 0.15s, border-color 0.15s;
}
.btn-game-menu:hover { color: var(--text); border-color: var(--blue); }
.game-menu-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.75);
  display: flex;
  align-items: center;
  justify-content: center;
  /* Above .game-intro-overlay (55) so F10 menu is visible during broadcast intro */
  z-index: 60;
}
.game-menu-overlay.hidden { display: none; }
.game-menu-card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 36px 48px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-width: 260px;
  align-items: center;
}
.game-menu-card h2 { font-size: 1.6rem; font-family: Impact, sans-serif; letter-spacing: 3px; margin-bottom: 6px; }
.game-menu-main.hidden { display: none !important; }
.game-menu-vote-kick-panel { display: flex; flex-direction: column; gap: 10px; align-items: stretch; min-width: 280px; max-width: 360px; }
.game-menu-vote-kick-panel.hidden { display: none !important; }
.vote-kick-title { font-size: 1.15rem; letter-spacing: 1px; margin: 0; }
.vote-kick-hint { font-size: 0.8rem; color: var(--muted); margin: 0; line-height: 1.3; }
.vote-kick-player-list { display: flex; flex-direction: column; gap: 6px; max-height: 220px; overflow-y: auto; }
.vote-kick-row {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 6px 10px; background: var(--panel2); border: 1px solid var(--border); border-radius: 6px;
}
.vote-kick-row-name { font-size: 0.9rem; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.vote-kick-row-name.team-red { color: var(--red); }
.vote-kick-row-name.team-blue { color: var(--blue); }
.vote-kick-banner {
  position: absolute;
  top: 8px;
  left: 8px;
  z-index: 60;
  max-width: min(340px, calc(100% - 16px));
  background: rgba(22, 27, 34, 0.95);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 10px 12px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.45);
}
.vote-kick-banner.hidden { display: none; }
.vote-kick-banner-text { font-size: 0.85rem; line-height: 1.35; margin-bottom: 8px; color: var(--text); }
.vote-kick-banner-actions { display: flex; gap: 8px; margin-bottom: 6px; flex-wrap: wrap; }
.vote-kick-banner-actions.hidden { display: none !important; }
.vote-kick-banner-note { font-size: 0.75rem; color: var(--muted); margin-bottom: 4px; min-height: 1em; }
.vote-kick-banner-time { font-size: 0.8rem; font-weight: 600; color: var(--gold); font-variant-numeric: tabular-nums; }
.btn-danger { background: #7a1a1a; border-color: #c0392b; color: #fff; }
.btn-danger:hover { background: #a02020; border-color: #e74c3c; }
.hud-center {
  display: flex;
  align-items: center;
  gap: 0;
}
.hud-scoreboard {
  display: flex;
  align-items: center;
  gap: 8px;
}
.hud-divider {
  width: 1px;
  height: 28px;
  background: var(--border);
  margin: 0 18px;
}
.hud-clock-block {
  text-align: center;
}
.hud-period-block {
  text-align: center;
  display: flex;
  flex-direction: column;
  line-height: 1.05;
}
.team-label {
  font-family: Impact, sans-serif;
  font-size: 1rem;
  letter-spacing: 3px;
}
.team-label.red { color: var(--red); }
.team-label.blue { color: var(--blue); }
.score-num {
  font-family: Impact, sans-serif;
  font-size: 2rem;
  color: var(--text);
  min-width: 28px;
  text-align: center;
}
.score-dash {
  font-family: Impact, sans-serif;
  font-size: 1.6rem;
  color: var(--muted);
  margin: 0 2px;
}
#game-clock {
  font-family: Impact, 'Courier New', monospace;
  font-size: 1.8rem;
  color: var(--gold);
  letter-spacing: 2px;
}
#game-period {
  font-family: Impact, sans-serif;
  font-size: 1rem;
  letter-spacing: 2px;
  color: var(--muted);
  text-transform: uppercase;
}
.hud-shot-counter {
  margin-top: 1px;
  font-size: 0.7rem;
  letter-spacing: 0.7px;
  color: #9fb0c7;
}

.canvas-container {
  position: relative;
  width: min(1173px, 100vw);
  aspect-ratio: 16 / 9;
  flex-shrink: 0;
}
#game-canvas {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 0 0 10px 10px;
  cursor: crosshair;
}
#game-canvas:hover { cursor: crosshair; }

/* 3D renderer: WebGL fills the rink area; 2D canvas stays for overlay pixels only */
body.renderer-3d-active #game-canvas {
  opacity: 0;
  pointer-events: none;
  position: absolute;
  width: 1px;
  height: 1px;
  left: 0;
  top: 0;
  overflow: hidden;
}

#game-3d-canvas {
  display: none;
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  max-width: 100%;
  border-radius: 0 0 10px 10px;
  cursor: crosshair;
  z-index: 1;
  object-fit: fill;
}
#game-3d-canvas.active {
  display: block;
}

/* Desktop ability row in 3D (matches canvas drawCooldownBox) */
.canvas-container .desktop-ability-overlay {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 10px;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: flex-end;
  gap: 8px 10px;
  padding: 0 8px;
  pointer-events: none;
  z-index: 6;
}
.desktop-ability-overlay.hidden {
  display: none !important;
}
.canvas-container .stick-zone-hud {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  bottom: 92px;
  pointer-events: none;
  z-index: 7;
  padding: 6px 8px 4px;
  border-radius: 10px;
  background: rgba(6, 20, 10, 0.62);
  border: 1px solid rgba(70, 200, 110, 0.45);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.45);
}
.canvas-container .stick-zone-hud canvas {
  display: block;
  width: 110px;
  height: 75px;
}
.desktop-ability-slot {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  min-width: 48px;
}
.desktop-ability-box {
  position: relative;
  width: 44px;
  height: 44px;
  border-radius: 6px;
  box-sizing: border-box;
  background: rgba(10, 10, 20, 0.85);
  border: 2px solid #555;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}
.desktop-ability-box[data-state="ready"],
.desktop-ability-box[data-state="active"] {
  background: rgba(20, 20, 40, 0.85);
  border-color: var(--ability-color, #44ccff);
  box-shadow: 0 0 10px color-mix(in srgb, var(--ability-color, #44ccff) 45%, transparent);
}
.desktop-ability-box.unavailable {
  opacity: 0.38;
  filter: grayscale(0.35);
}
.desktop-ability-fill {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 0;
  border-radius: 0 0 4px 4px;
  pointer-events: none;
}
.desktop-ability-count {
  position: absolute;
  top: 3px;
  right: 4px;
  font: 700 11px Impact, sans-serif;
  color: var(--ability-color, #44ccff);
  text-shadow: 0 0 4px rgba(0, 0, 0, 0.9);
  z-index: 1;
}
.desktop-ability-key {
  position: relative;
  z-index: 2;
  font: bold 18px Impact, Arial Black, sans-serif;
  color: #555;
  line-height: 1;
}
.desktop-ability-box[data-state="ready"] .desktop-ability-key,
.desktop-ability-box[data-state="active"] .desktop-ability-key {
  font-size: 22px;
  font-weight: bold;
  color: var(--ability-color, #44ccff);
  text-shadow: 0 0 8px var(--ability-color, #44ccff);
}
.desktop-ability-label {
  font: 600 10px Segoe UI, system-ui, sans-serif;
  color: #0a0a0a;
  text-align: center;
  max-width: 72px;
  line-height: 1.1;
}
.desktop-ability-overlay.desktop-ability-over-black .desktop-ability-label {
  color: #f2f6fc;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.9);
}

/* Desktop shot meters in 3D (aligned with drawShotBars) */
.canvas-container .desktop-shot-overlay {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  bottom: 118px;
  width: min(380px, calc(100% - 24px));
  display: flex;
  flex-direction: column;
  gap: 5px;
  pointer-events: none;
  z-index: 6;
}
.desktop-shot-overlay.hidden {
  display: none !important;
}
.desktop-shot-bar {
  box-sizing: border-box;
  border-radius: 5px;
  background: rgba(0, 0, 0, 0.75);
  border: 1px solid rgba(255, 255, 255, 0.12);
  padding: 1px;
}
.desktop-shot-bar-power {
  height: 20px;
}
.desktop-shot-bar-distance {
  height: 13px;
}
.desktop-shot-fill {
  height: 100%;
  border-radius: 3px;
  width: 0%;
  min-width: 0;
  transition: width 0.04s linear, background 0.04s linear;
}

/* Recenter hints — shared pill */
.canvas-container .third-person-recenter-hint {
  position: absolute;
  z-index: 8;
  border-radius: 999px;
  background: rgba(12, 18, 28, 0.88);
  border: 1px solid rgba(120, 145, 178, 0.35);
  color: var(--text);
  text-align: center;
  pointer-events: none;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
/* Third-person chase: above ability row, not dead center */
.canvas-container #third-person-recenter-hint.third-person-recenter-hint {
  left: 50%;
  top: auto;
  bottom: calc(86px + env(safe-area-inset-bottom, 0px));
  transform: translateX(-50%);
  max-width: min(520px, calc(100% - 24px));
  padding: 9px 18px;
  font-size: 0.97rem;
  font-weight: 600;
  line-height: 1.35;
}
/* Regular pan/zoom: large, true viewport center of rink area */
.canvas-container #regular-view-recenter-hint.third-person-recenter-hint {
  left: 50%;
  top: 50%;
  bottom: auto;
  transform: translate(-50%, -50%);
  max-width: min(720px, calc(100% - 40px));
  padding: clamp(18px, 3.5vw, 28px) clamp(28px, 5vw, 48px);
  font-size: clamp(1.35rem, 3.5vw, 2.05rem);
  font-weight: 700;
  line-height: 1.3;
}
.canvas-container .third-person-recenter-hint.hidden {
  display: none !important;
}
.recenter-hint-inner {
  color: var(--muted);
}
#regular-view-recenter-hint .recenter-hint-inner {
  color: var(--text);
  font-size: 1em;
}
.recenter-kbd {
  display: inline-block;
  padding: 2px 8px;
  margin: 0 2px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--panel2);
  color: var(--text);
  font-size: 0.8em;
  font-family: ui-monospace, Consolas, monospace;
  font-weight: 600;
}
#regular-view-recenter-hint .recenter-kbd {
  padding: 0.2em 0.55em;
  font-size: 0.72em;
  vertical-align: middle;
}
#third-person-recenter-hint .recenter-kbd {
  font-size: 0.7em;
}

/* Goal Banner */
.goal-banner {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-family: Impact, sans-serif;
  font-size: 3.85rem;
  letter-spacing: 3px;
  text-shadow: 0 0 30px currentColor, 0 4px 12px rgba(0,0,0,0.8);
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.2s;
  white-space: pre-line;
  line-height: 1.05;
  text-align: center;
}
.goal-banner.show { opacity: 1; animation: goalPop 0.3s ease-out; }
.goal-banner.hidden { display: none; }
.goal-banner.goal-red { color: var(--red); }
.goal-banner.goal-blue { color: var(--blue); }
.goal-banner.goal-own { color: #f07820; }

@keyframes goalPop {
  0% { transform: translate(-50%, -50%) scale(0.5); }
  60% { transform: translate(-50%, -50%) scale(1.1); }
  100% { transform: translate(-50%, -50%) scale(1); }
}

/* Goal banner must paint above 3D canvas (z-index 1) and its overlay canvas (z-index 3) */
.goal-banner { z-index: 4; }

/* Faceoff countdown — DOM overlay used in 3D mode (2D mode draws on canvas) */
.countdown-overlay {
  position: absolute;
  pointer-events: none;
  z-index: 4;
  font: bold 88px/1 Impact, sans-serif;
  color: #44ee44;
  text-shadow: 3px 3px 0 rgba(0,0,0,0.6), 0 0 20px #44ee44;
  text-align: center;
  transform: translateX(-50%);
  white-space: nowrap;
  -webkit-user-select: none;
  user-select: none;
}
.countdown-overlay.hidden { display: none; }

/* Ping (3D) / goalie opt-in toast — top-left of the rink view.
   Fullscreen: sit below HUD + shot-clock bar so it is not covered by the HUD (z-index 25). */
.game-notice-overlay {
  position: absolute;
  top: 6px;
  left: 6px;
  right: auto;
  text-align: left;
  pointer-events: none;
  z-index: 12;
  font: bold 15px/1.4 'Segoe UI', sans-serif;
  background: rgba(0,0,0,0.62);
  padding: 4px 8px;
  border-radius: 4px;
  color: #e0e0e0;
  box-shadow: 0 1px 6px rgba(0,0,0,0.45);
}
#game-content.fullscreen-stack-as-overlay .game-notice-overlay {
  top: calc(var(--fs-hud-h, 48px) + 6px + 6px);
}
.game-notice-overlay.hidden { display: none; }

/* Goalie rotation panel — same corner as .game-notice-overlay (opt-in toast); below it in z-order */
.goalie-rotation-overlay-dom {
  position: absolute;
  top: 6px;
  left: 6px;
  pointer-events: none;
  z-index: 11;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
#game-content.fullscreen-stack-as-overlay .goalie-rotation-overlay-dom {
  top: calc(var(--fs-hud-h, 48px) + 6px + 6px);
}
.goalie-rotation-overlay-dom.hidden { display: none; }
.goalie-rotation-block {
  background: rgba(0,0,0,0.62);
  border: 1.4px solid currentColor;
  padding: 6px 8px;
  font: 12px 'Segoe UI', sans-serif;
  min-width: 200px;
}
.goalie-rotation-title {
  font-weight: bold;
  margin-bottom: 4px;
}
.goalie-rotation-row { padding: 1px 0; color: #dbe7fb; white-space: nowrap; }
.goalie-rotation-row.current { background: rgba(255,255,255,0.14); color: #fff4a3; }

/* Offscreen puck arrow indicator */
.offscreen-puck-indicator {
  position: absolute;
  width: 42px;
  height: 30px;
  pointer-events: none;
  z-index: 5;
}
.offscreen-puck-indicator.hidden { display: none; }
.offscreen-puck-indicator--third-person { width: 126px; height: 90px; }
.offscreen-puck-indicator-arrow {
  width: 100%;
  height: 100%;
  /* Arrow pointing right — rotated inline by JS to point toward puck */
  clip-path: polygon(93% 50%, 21% 17%, 32% 37%, 0% 37%, 0% 63%, 32% 63%, 21% 83%);
  background: linear-gradient(90deg, #6aa5ff, #b4eaff, #ecfbff);
  filter: drop-shadow(0 0 5px rgba(120,220,255,0.85));
}

/* Third-person minimap — bottom-right corner */
.third-person-minimap-wrap {
  position: absolute;
  bottom: 14px;
  right: 14px;
  pointer-events: none;
  z-index: 4;
  border-radius: 6px;
  overflow: hidden;
  box-shadow: 0 2px 10px rgba(0,0,0,0.5);
}
.third-person-minimap-wrap.hidden { display: none; }

/* One-timer bars — 2D mode only; 3D draws these on WebGL overlay canvas */
.onetime-overlay {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 4;
}
.onetime-overlay.hidden { display: none; }
.onetime-player-bar {
  position: absolute;
  width: 60px;
  height: 4px;
  background: rgba(0,0,0,0.6);
  border-radius: 4px;
  overflow: hidden;
  transform: translateX(-50%);
}
.onetime-player-bar-fill {
  height: 100%;
  background: #f0c040;
  border-radius: 4px;
  transition: width 0.04s linear;
}

/* End Overlay */
.end-overlay {
  position: fixed;
  inset: 0;
  z-index: 10;
  background: rgba(0,0,0,0.8);
  display: flex;
  align-items: center;
  justify-content: center;
}
.end-overlay.hidden { display: none; }
.end-card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 40px 48px;
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-width: 320px;
  width: min(1560px, 96vw);
  max-width: 100%;
}
.end-card h2 { font-size: 2rem; font-family: Impact, sans-serif; letter-spacing: 3px; }
.end-score { font-size: 1.1rem; color: var(--muted); }
.end-score strong { color: var(--text); }

/* Period Break Overlay */
.period-break-overlay {
  position: fixed;
  inset: 0;
  z-index: 10;
  background: rgba(0,0,0,0.82);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 14px;
}
.period-break-overlay.hidden { display: none; }
.break-card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 14px;
  width: min(1560px, 99vw);
  box-shadow: 0 16px 60px rgba(0,0,0,0.6);
  display: flex;
  flex-direction: column;
  min-height: 0;
  max-height: min(94vh, 900px);
  max-height: min(94dvh, 900px);
  overflow: hidden;
}
.break-card h2 {
  font-size: 1.6rem;
  font-family: Impact, sans-serif;
  letter-spacing: 3px;
  flex-shrink: 0;
}
.break-subtitle {
  margin-top: 2px;
  color: var(--muted);
  font-size: 0.82rem;
  flex-shrink: 0;
}
.break-teams {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 10px;
  min-width: 0;
}
.break-team {
  background: var(--panel2);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 6px 6px 4px;
  min-width: 0;
}
.break-team-title {
  font-family: Impact, sans-serif;
  letter-spacing: 3px;
  font-size: 1.02rem;
  margin-bottom: 3px;
}
.break-team.break-red .break-team-title { color: var(--red); }
.break-team.break-blue .break-team-title { color: var(--blue); }

.break-player-row {
  display: flex;
  gap: 5px;
  padding: 3px 2px;
  border-top: 1px solid rgba(255,255,255,0.06);
  min-width: 0;
}
.break-player-row:first-child { border-top: none; }
.break-player-name {
  width: 82px;
  flex-shrink: 0;
  font-weight: 700;
  color: var(--text);
  letter-spacing: 0.3px;
  font-size: 0.93rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.break-leader-crown {
  color: #f0c040;
  font-size: 0.88rem;
  vertical-align: baseline;
}
.break-player-stats {
  flex: 1;
  display: grid;
  /* 12 stats + wider PTS column (last) so blue-side box score doesn’t clip */
  grid-template-columns: repeat(12, minmax(26px, 1fr)) minmax(48px, 1.5fr);
  gap: 2px;
  min-width: 0;
}
.break-stat-cell {
  background: rgba(0,0,0,0.18);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 5px;
  padding: 3px 2px 2px;
  text-align: center;
  position: relative;
  cursor: help;
}
.break-stat-cell::after {
  content: attr(data-tooltip);
  position: absolute;
  left: 50%;
  bottom: calc(100% + 6px);
  transform: translateX(-50%);
  background: rgba(10, 12, 16, 0.98);
  color: #e6edf7;
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 6px;
  padding: 6px 8px;
  font-size: 0.8rem;
  line-height: 1.2;
  letter-spacing: 0.2px;
  white-space: nowrap;
  box-shadow: 0 6px 18px rgba(0,0,0,0.45);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.12s ease;
  z-index: 5;
}
.break-stat-cell:hover::after {
  opacity: 1;
}
.break-stat-label {
  font-size: 0.55rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.4px;
  line-height: 1;
}
.break-stat-value {
  margin-top: 1px;
  font-family: Impact, 'Courier New', monospace;
  font-size: 0.85rem;
  line-height: 1;
  color: var(--text);
}
.break-stat-cell--points {
  border-color: rgba(240, 192, 64, 0.45);
  background: linear-gradient(180deg, rgba(240, 192, 64, 0.18), rgba(0, 0, 0, 0.22));
}
.break-stat-label--points {
  color: #ffd77a;
  font-size: 0.56rem;
  letter-spacing: 0.5px;
}
.break-stat-value--points {
  color: #ffd77a;
  font-size: 0.95rem;
  font-weight: 900;
}
.break-stat-value--best {
  font-weight: 800;
  color: #3fb950;
}
.break-stat-value--worst {
  color: #e34c4c;
}

/* Period break — tabs & shot map */
.break-tabs {
  display: flex;
  gap: 6px;
  margin: 8px 0 6px;
  border-bottom: 1px solid var(--border);
  padding-bottom: 2px;
  flex-shrink: 0;
}
.break-tab {
  flex: 1;
  max-width: 220px;
  padding: 10px 14px;
  border: none;
  border-radius: 10px 10px 0 0;
  background: rgba(0, 0, 0, 0.2);
  color: var(--muted);
  font-family: inherit;
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  cursor: pointer;
  transition: color 0.15s, background 0.15s, box-shadow 0.15s;
}
.break-tab:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.04);
}
.break-tab-active {
  color: #e6edf7;
  background: linear-gradient(180deg, rgba(76, 143, 227, 0.22), rgba(22, 27, 34, 0.95));
  box-shadow: 0 -2px 0 0 var(--blue) inset;
}
.break-tab-panel-hidden,
.break-tab-panel[hidden] {
  display: none !important;
}
/* Box score tab: fill card below tabs, scroll if roster is tall */
#break-tab-stats:not(.break-tab-panel-hidden):not([hidden]) {
  flex: 1 1 auto;
  min-height: 0;
  min-width: 0;
  overflow-x: hidden;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}
/* ── Goal Replay Tab ─────────────────────────────────────────────────────── */
.replay-period-tabs {
  display: flex;
  gap: 3px;
  flex-wrap: wrap;
  justify-content: flex-end;
}
.replay-period-tab {
  padding: 1px 6px;
  border-radius: 20px;
  border: 1px solid rgba(255,255,255,0.14);
  background: transparent;
  color: var(--muted);
  font-family: Impact, sans-serif;
  font-size: 0.62rem;
  letter-spacing: 1px;
  cursor: pointer;
  transition: background 0.12s, color 0.12s, border-color 0.12s;
  line-height: 1.6;
}
.replay-period-tab:hover {
  background: rgba(255,255,255,0.06);
  color: var(--text);
}
.replay-period-tab-active {
  background: rgba(76,143,227,0.2);
  border-color: var(--blue);
  color: #e6edf7;
}
#break-tab-replay:not(.break-tab-panel-hidden):not([hidden]) {
  flex: 1 1 auto;
  min-height: min(52vh, 460px);
  min-height: min(52dvh, 460px);
  overflow: hidden;
  display: flex;
}
.replay-layout {
  display: flex;
  gap: 10px;
  flex: 1;
  min-height: 0;
  padding: 4px 0 2px;
}
.replay-player-col {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}
.replay-video-wrap {
  position: relative;
  flex: 1;
  background: #000814;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 0 0 1px rgba(255,255,255,0.12), 0 4px 30px rgba(0,0,0,0.7);
  min-height: 120px;
}
.replay-video {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}
/* "REPLAY" broadcast badge */
.replay-badge {
  position: absolute;
  top: 10px;
  left: 12px;
  background: #f0c040;
  color: #000;
  font-family: Impact, sans-serif;
  font-size: 0.72rem;
  letter-spacing: 3px;
  padding: 3px 9px 2px;
  border-radius: 3px;
  z-index: 10;
  animation: replayBadgePulse 1.8s ease-in-out infinite;
  pointer-events: none;
}
@keyframes replayBadgePulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.55; }
}
/* Broadcast lower-third info banner */
.replay-info-banner {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: linear-gradient(transparent, rgba(0,0,0,0.92) 38%);
  padding: 28px 14px 10px;
  z-index: 10;
  pointer-events: none;
}
.replay-info-banner.hidden { display: none; }
.replay-lower-third {
  display: flex;
  align-items: baseline;
  gap: 10px;
}
.replay-scorer-name {
  font-family: Impact, sans-serif;
  font-size: 1.25rem;
  letter-spacing: 2px;
  color: #fff;
  text-shadow: 0 2px 6px rgba(0,0,0,0.9);
}
.replay-score-str {
  font-family: Impact, sans-serif;
  font-size: 1.05rem;
  letter-spacing: 1px;
  color: #f0c040;
  text-shadow: 0 2px 6px rgba(0,0,0,0.9);
}
/* Team accent bar under scorer name */
.replay-info-banner[data-team="red"] .replay-scorer-name { border-bottom: 3px solid var(--red); }
.replay-info-banner[data-team="blue"] .replay-scorer-name { border-bottom: 3px solid var(--blue); }
/* No goals fallback */
.replay-no-goals {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  font-size: 0.88rem;
  font-style: italic;
}
.replay-no-goals.hidden { display: none; }
/* Goal list sidebar */
.replay-list-col {
  width: 175px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  background: rgba(0,0,0,0.28);
  border: 1px solid rgba(255,255,255,0.07);
  border-radius: 8px;
  overflow: hidden;
}
.replay-list-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 4px;
  font-family: Impact, sans-serif;
  letter-spacing: 3px;
  font-size: 0.68rem;
  color: var(--muted);
  padding: 7px 10px 6px;
  background: rgba(255,255,255,0.03);
  border-bottom: 1px solid rgba(255,255,255,0.07);
  flex-shrink: 0;
}
.replay-goal-list {
  flex: 1;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,0.14) transparent;
}
.replay-goal-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-bottom: 1px solid rgba(255,255,255,0.05);
  cursor: pointer;
  transition: background 0.12s;
  position: relative;
  user-select: none;
}
.replay-goal-item:hover { background: rgba(255,255,255,0.05); }
.replay-goal-item.replay-active { background: rgba(76,143,227,0.13); }
.replay-goal-item.replay-active::before {
  content: '';
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 3px;
  background: var(--blue);
  border-radius: 0 2px 2px 0;
}
.replay-goal-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  flex-shrink: 0;
}
.replay-goal-dot.red  { background: var(--red);  box-shadow: 0 0 4px var(--red); }
.replay-goal-dot.blue { background: var(--blue); box-shadow: 0 0 4px var(--blue); }
.replay-goal-details { flex: 1; min-width: 0; }
.replay-goal-scorer {
  font-size: 0.81rem;
  font-weight: 700;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.replay-goal-score {
  font-size: 0.7rem;
  color: #f0c040;
  letter-spacing: 0.4px;
  margin-top: 1px;
}
.replay-goal-num {
  font-family: Impact, sans-serif;
  font-size: 0.7rem;
  color: var(--muted);
  flex-shrink: 0;
  letter-spacing: 1px;
}
.replay-goal-item.replay-active .replay-goal-num {
  color: var(--blue);
  animation: replayNumPulse 1.1s ease-in-out infinite;
}
@keyframes replayNumPulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.35; }
}
/* Replay tab button — subtle play-icon accent */
.break-tab-replay-btn { gap: 4px; }

/* Shot map tab: column layout — toolbar strip, then chart | insights.
   break-card only has max-height, so flex-basis 0 + min-height 0 collapsed the body to 0px. */
#break-tab-shotmap:not(.break-tab-panel-hidden):not([hidden]) {
  flex: 1 1 auto;
  min-height: min(52vh, 480px);
  min-height: min(52dvh, 480px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  gap: 6px;
}
.break-shotmap-toolbar {
  position: relative;
  z-index: 3;
  display: flex;
  flex-wrap: wrap;
  gap: 12px 18px;
  align-items: flex-end;
  margin-bottom: 12px;
  padding: 10px 12px;
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
}
#break-tab-shotmap .break-shotmap-toolbar {
  flex-shrink: 0;
  gap: 8px 14px;
  margin-bottom: 0;
  padding: 6px 10px;
  border-radius: 8px;
}
/* Left: chart grows; right: insights scroll — min-height so grid gets real space without a fixed card height */
.break-shotmap-body {
  flex: 1 1 auto;
  min-height: min(44vh, 400px);
  min-height: min(44dvh, 400px);
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(220px, 34%);
  gap: 10px;
  align-items: stretch;
}
.break-shotmap-chart-col {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  gap: 6px;
}
.break-shotmap-insights-col {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
}
.break-shotmap-insights-col .break-insights {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  margin-top: 0;
  overflow: hidden;
}
.break-shotmap-insights-col .break-insights-list {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  padding-right: 4px;
}
.break-shotmap-label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.9px;
  text-transform: uppercase;
  color: var(--muted);
}
#break-tab-shotmap .break-shotmap-label {
  gap: 2px;
  font-size: 0.58rem;
  letter-spacing: 0.55px;
}
.break-shotmap-select {
  min-width: 140px;
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  font-size: 0.88rem;
  font-family: inherit;
  cursor: pointer;
}
#break-tab-shotmap .break-shotmap-select {
  min-width: 118px;
  padding: 4px 8px;
  border-radius: 6px;
  font-size: 0.72rem;
}
/* Custom select dropdowns — replaces native <select> in shotmap toolbar so Tab key
   (held to view stats) doesn't close the popup (Chrome closes native popups on Tab natively). */
.csw { position: relative; display: inline-block; }
.csw-btn {
  display: block;
  text-align: left;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  width: 100%;
}
.csw-panel {
  position: absolute;
  z-index: 2000;
  top: calc(100% + 3px);
  left: 0;
  min-width: 100%;
  background: #1a2430;
  border: 1px solid rgba(255,255,255,0.18);
  border-radius: 7px;
  box-shadow: 0 6px 24px rgba(0,0,0,0.65);
  overflow: hidden;
}
.csw-option {
  display: block;
  width: 100%;
  padding: 8px 14px;
  background: none;
  border: none;
  color: #cdd8e0;
  font: inherit;
  font-size: 0.85rem;
  text-align: left;
  cursor: pointer;
  white-space: nowrap;
}
.csw-option:hover { background: rgba(255,255,255,0.09); }
.csw-option.csw-active { background: rgba(255,255,255,0.13); color: #fff; }
/* Rink area grows with chart column; SVG stays letterboxed inside (max-width/max-height 100%). */
.break-shotmap-wrap {
  position: relative;
  width: 100%;
  flex: 1 1 auto;
  min-height: 200px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid rgba(76, 143, 227, 0.35);
  box-shadow:
    0 0 0 1px rgba(0, 0, 0, 0.35),
    0 6px 22px rgba(0, 0, 0, 0.4),
    inset 0 1px 0 rgba(255, 255, 255, 0.05);
  background: radial-gradient(ellipse 120% 80% at 50% 45%, #1a2332 0%, #0a0e14 55%, #06080c 100%);
}
.break-shotmap-svg {
  display: block;
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: 100%;
  flex-shrink: 1;
  vertical-align: middle;
}
.break-shotmap-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 14px 20px;
  margin-top: 10px;
  font-size: 0.78rem;
  color: var(--muted);
}
#break-tab-shotmap .break-shotmap-chart-col .break-shotmap-legend {
  flex-shrink: 0;
  gap: 6px 10px;
  margin-top: 0;
  font-size: 0.68rem;
}
.break-shotmap-legend-item {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
#break-tab-shotmap .break-shotmap-legend-item {
  gap: 5px;
}
.break-shotmap-legend-dot {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  flex-shrink: 0;
  box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.5);
}
#break-tab-shotmap .break-shotmap-legend-dot {
  width: 8px;
  height: 8px;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.5);
}
.break-shotmap-count {
  margin-top: 6px;
  font-size: 0.8rem;
  color: var(--muted);
}
#break-tab-shotmap .break-shotmap-chart-col .break-shotmap-count {
  flex-shrink: 0;
  margin-top: 0;
  font-size: 0.72rem;
  line-height: 1.35;
}
.break-insights {
  margin-top: 16px;
  padding: 14px 16px;
  border-radius: 12px;
  background: linear-gradient(145deg, rgba(76, 143, 227, 0.08), rgba(0, 0, 0, 0.35));
  border: 1px solid rgba(255, 255, 255, 0.08);
}
.break-shotmap-insights-col .break-insights {
  padding: 10px 12px;
  border-radius: 10px;
}
.break-insights-title {
  font-family: Impact, sans-serif;
  letter-spacing: 2px;
  font-size: 0.95rem;
  color: #8ab4f8;
  margin-bottom: 10px;
}
.break-shotmap-insights-col .break-insights-title {
  flex-shrink: 0;
  font-size: 0.78rem;
  letter-spacing: 1.4px;
  margin-bottom: 8px;
}
.break-insights-list {
  margin: 0;
  padding-left: 1.15rem;
  color: var(--text);
  font-size: 0.86rem;
  line-height: 1.55;
}
.break-shotmap-insights-col .break-insights-list {
  padding-left: 1.05rem;
  font-size: 0.8rem;
  line-height: 1.48;
}
.break-insights-list li {
  margin-bottom: 8px;
}
.break-shotmap-insights-col .break-insights-list li {
  margin-bottom: 6px;
}
.break-insights-list li:last-child {
  margin-bottom: 0;
}

/* Period break + shot map on phones / touch (safe areas, dvh, 44px tap targets) */
@media (max-width: 640px) {
  .period-break-overlay {
    padding: max(8px, env(safe-area-inset-top, 0px)) max(10px, env(safe-area-inset-right, 0px))
      max(10px, env(safe-area-inset-bottom, 0px)) max(10px, env(safe-area-inset-left, 0px));
    align-items: flex-start;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }
  .break-card {
    width: 100%;
    max-width: 100%;
    padding: 12px max(10px, env(safe-area-inset-right, 10px)) 12px max(10px, env(safe-area-inset-left, 10px));
    margin: auto 0;
  }
  .break-card h2 {
    font-size: 1.25rem;
    letter-spacing: 2px;
  }
  .break-tabs {
    gap: 4px;
    margin: 10px 0 8px;
  }
  .break-tab {
    flex: 1;
    max-width: none;
    min-height: 44px;
    padding: 10px 6px;
    font-size: 0.68rem;
    letter-spacing: 0.4px;
    touch-action: manipulation;
  }
  #break-tab-shotmap:not(.break-tab-panel-hidden):not([hidden]) {
    min-height: min(70vh, 560px);
    min-height: min(70dvh, 560px);
  }
  .break-shotmap-body {
    grid-template-columns: 1fr;
    grid-template-rows: auto minmax(200px, 1fr);
    min-height: min(58vh, 480px);
    min-height: min(58dvh, 480px);
    gap: 8px;
  }
  .break-shotmap-chart-col {
    min-height: 200px;
    max-height: min(46dvh, 340px);
  }
  .break-shotmap-wrap {
    flex: 1 1 auto;
    min-height: 160px;
    max-height: min(40dvh, 300px);
  }
  .break-shotmap-insights-col {
    min-height: 180px;
  }
  .break-shotmap-insights-col .break-insights {
    min-height: 160px;
  }
  #break-tab-shotmap .break-shotmap-toolbar {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
    padding: 10px;
  }
  #break-tab-shotmap .break-shotmap-label {
    gap: 4px;
    font-size: 0.62rem;
  }
  #break-tab-shotmap .break-shotmap-select,
  #break-tab-shotmap .csw,
  #break-tab-shotmap .csw-btn {
    min-width: 0;
    width: 100%;
    min-height: 44px;
    padding: 10px 12px;
    font-size: 16px;
    border-radius: 8px;
  }
  #break-tab-replay:not(.break-tab-panel-hidden):not([hidden]) {
    min-height: min(62vh, 480px);
    min-height: min(62dvh, 480px);
  }
  .replay-layout { flex-direction: column; gap: 8px; }
  .replay-list-col { width: 100%; flex-direction: row; max-height: 100px; border-radius: 6px; }
  .replay-goal-list { display: flex; flex-direction: row; overflow-x: auto; overflow-y: hidden; }
  .replay-goal-item { flex-shrink: 0; flex-direction: column; align-items: center; gap: 4px; padding: 6px 10px; border-bottom: none; border-right: 1px solid rgba(255,255,255,0.05); width: 80px; }
  .replay-goal-details { text-align: center; }
  .replay-goal-item.replay-active::before { top: 0; bottom: auto; left: 0; right: 0; width: auto; height: 3px; border-radius: 0 0 2px 2px; }
  .replay-list-header { padding: 6px 10px 4px; }
}

/* End-game stats section */
.end-stats {
  margin-top: 8px;
}
.end-stats.hidden { display: none; }
.end-stats-teams {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.end-team {
  background: var(--panel2);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 8px 8px 5px;
}
.end-team-title {
  font-family: Impact, sans-serif;
  letter-spacing: 3px;
  font-size: 0.95rem;
  margin-bottom: 4px;
}
.end-team.end-red .end-team-title { color: var(--red); }
.end-team.end-blue .end-team-title { color: var(--blue); }

@media (max-width: 980px) {
  .break-teams,
  .end-stats-teams {
    grid-template-columns: 1fr;
  }
}

/* Options Modal */
.options-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.78);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 18px;
  overflow-y: auto;
}
.options-overlay.hidden { display: none; }
.options-card {
  width: min(880px, 96vw);
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 22px 80px rgba(0,0,0,0.65);
  padding: 0;
  max-height: calc(100dvh - 36px);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.options-header {
  padding: 22px 24px 12px;
  flex-shrink: 0;
  border-bottom: 1px solid var(--border);
}
.options-body {
  flex: 1;
  overflow-y: auto;
  min-height: 0;
  padding: 4px 24px 8px;
}
.options-card h2 {
  font-size: 2rem;
  font-family: Impact, sans-serif;
  letter-spacing: 3px;
  margin-bottom: 6px;
}
.options-help {
  color: var(--muted);
  font-size: 0.95rem;
  margin-bottom: 0;
}
.options-section { margin-top: 16px; }
.options-toggle-row {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.92rem;
  color: var(--text);
  cursor: pointer;
  user-select: none;
}
.options-toggle-row input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: var(--blue);
  cursor: pointer;
}
.options-slider-row {
  background: var(--panel2);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 10px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 8px;
}
.options-slider-label {
  font-weight: 700;
  color: var(--text);
  letter-spacing: 0.2px;
}
.options-slider-control {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 230px;
}
.options-slider-control input[type="range"] {
  width: 180px;
  accent-color: var(--blue);
}
.options-slider-value {
  min-width: 44px;
  text-align: right;
  color: var(--muted);
  font-weight: 700;
}
.options-section-title {
  font-family: Impact, sans-serif;
  letter-spacing: 3px;
  font-size: 1.05rem;
  color: var(--gold);
  margin-bottom: 10px;
}
.rebind-list {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px 14px;
}
.rebind-row {
  background: var(--panel2);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 10px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.rebind-label {
  font-weight: 700;
  color: var(--text);
  letter-spacing: 0.2px;
}
.rebind-key {
  min-width: 64px;
  height: 36px;
  padding: 0 10px;
  border-radius: 10px;
  border: 1px solid rgba(255,255,255,0.12);
  background: rgba(0,0,0,0.18);
  color: var(--text);
  font-family: Impact, 'Courier New', monospace;
  font-size: 1.05rem;
  cursor: pointer;
  transition: transform 0.1s, border-color 0.15s, filter 0.15s;
}
.rebind-key:hover {
  border-color: rgba(76,143,227,0.6);
  filter: brightness(1.1);
}
.rebind-key:disabled {
  cursor: not-allowed;
  opacity: 0.6;
  filter: none;
}
.options-name-row {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--panel2);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px;
}
.options-name-label {
  color: var(--muted);
  font-weight: 700;
}
.options-name-input {
  flex: 0 0 220px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  padding: 10px 12px;
  outline: none;
}
.options-name-lock {
  color: var(--muted);
  font-size: 0.85rem;
}
.options-actions {
  display: flex;
  gap: 12px;
  flex-shrink: 0;
  padding: 14px 24px;
  border-top: 1px solid var(--border);
  background: var(--panel);
}
.options-actions .btn { width: auto; }
.options-subhint {
  display: block;
  font-size: 0.78rem;
  color: var(--muted);
  margin-top: 2px;
}
.options-select-row {
  background: var(--panel2);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}
.options-select-label {
  font-weight: 700;
  color: var(--text);
}
.options-select {
  background: var(--panel);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 5px 10px;
  font-size: 0.9rem;
  cursor: pointer;
}
.options-select:focus { outline: 1px solid var(--blue); }
.gchat-translation {
  color: #a0c8ff;
  font-style: italic;
  font-size: 0.92em;
}
.chat-translation {
  color: #a0c8ff;
  font-style: italic;
  font-size: 0.92em;
}

/* ── Lobby Name Modal ────────────────────────────────────────────────────── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.65);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2000;
  backdrop-filter: blur(4px);
}
.modal-overlay.hidden { display: none; }
.modal-card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 32px;
  width: min(420px, 90vw);
  display: flex;
  flex-direction: column;
  gap: 18px;
  box-shadow: 0 16px 60px rgba(0,0,0,0.7);
}
.modal-title {
  font-family: Impact, Arial Black, sans-serif;
  letter-spacing: 3px;
  font-size: 1.5rem;
  color: var(--gold);
}
.modal-actions {
  display: flex;
  gap: 10px;
}
.modal-actions .btn { flex: 1; }
.modal-card-wide { width: min(460px, 94vw); }

.lobby-game-info {
  padding: 8px 20px 4px;
  font-size: 0.88rem;
  color: var(--muted);
  text-align: center;
  line-height: 1.45;
}
.lobby-game-mode {
  display: inline-block;
  font-weight: 700;
  color: var(--gold);
  margin-right: 6px;
}
.lobby-game-rules {
  display: block;
  margin-top: 4px;
  font-size: 0.82rem;
  color: var(--text);
}
.lobby-go-mode-row {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.lobby-go-radio {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  color: var(--text);
  font-size: 0.95rem;
}
.lobby-practice-rules {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 12px 0 4px;
  border-top: 1px solid var(--border);
  margin-top: 4px;
}
.lobby-practice-rules.hidden { display: none; }
.lobby-go-hint {
  font-size: 0.8rem;
  color: var(--muted);
  margin-bottom: 2px;
}
.lobby-rule-check {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  color: var(--text);
  font-size: 0.9rem;
}

/* ── Customize Screen ────────────────────────────────────────────────────── */
.customize-card {
  max-width: 520px;
  width: min(520px, 95vw);
  max-height: 90vh;
  min-height: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-sizing: border-box;
}
.customize-card-header {
  flex-shrink: 0;
}
.customize-card-scroll {
  flex: 1;
  overflow-y: auto;
  min-height: 0;
  -webkit-overflow-scrolling: touch;
}
.customize-card-scroll::-webkit-scrollbar { width: 5px; }
.customize-card-scroll::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
.customize-section {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.customize-section-title {
  font-family: Impact, Arial Black, sans-serif;
  letter-spacing: 2px;
  font-size: 1rem;
  color: var(--gold);
  display: flex;
  align-items: baseline;
  gap: 8px;
}
.customize-section-sub {
  color: var(--muted);
  font-family: 'Segoe UI', system-ui, sans-serif;
  font-size: 0.78rem;
  letter-spacing: 0;
  font-weight: 400;
  text-transform: none;
}
.customize-name-row {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.name-lock-msg {
  color: var(--muted);
  font-size: 0.8rem;
}
.name-lock-msg.hidden { display: none; }
.player-skin-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.player-skin-card {
  background: var(--panel2);
  border: 2px solid var(--border);
  border-radius: 10px;
  padding: 10px;
  cursor: pointer;
  user-select: none;
  transition: border-color 0.15s, background 0.15s;
}
.player-skin-card:hover { border-color: var(--blue); background: #1a2235; }
.player-skin-card.selected {
  border-color: var(--gold);
  background: rgba(240, 192, 64, 0.07);
}
.player-skin-previews {
  display: flex;
  gap: 8px;
  margin-bottom: 8px;
}
.player-skin-preview {
  width: 56px;
  height: 56px;
  object-fit: contain;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: rgba(0, 0, 0, 0.25);
  padding: 3px;
}
.player-skin-preview-new {
  transform: scale(0.9);
  transform-origin: center;
}
.player-skin-name {
  font-weight: 700;
  font-size: 0.9rem;
}
.player-skin-sub {
  margin-top: 2px;
  font-size: 0.75rem;
  color: var(--muted);
}

/* Horn selection grid */
.horn-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.horn-card {
  background: var(--panel2);
  border: 2px solid var(--border);
  border-radius: 8px;
  padding: 11px 14px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  transition: border-color 0.15s, background 0.15s;
  user-select: none;
}
.horn-card:hover { border-color: var(--blue); background: #1a2235; }
.horn-card.selected {
  border-color: var(--gold);
  background: rgba(240, 192, 64, 0.07);
}
.horn-card-wide {
  grid-column: span 2;
}
.horn-card-name {
  font-weight: 600;
  font-size: 0.9rem;
}
.horn-upload-icon {
  width: 22px;
  height: 22px;
  color: var(--muted);
  flex-shrink: 0;
  transition: color 0.15s;
}
.horn-card:hover .horn-upload-icon { color: var(--blue); }
.horn-card.selected .horn-upload-icon { color: var(--gold); }
.horn-preview-btn {
  background: rgba(255,255,255,0.05);
  border: 1px solid var(--border);
  border-radius: 50%;
  color: var(--muted);
  cursor: pointer;
  font-size: 0.65rem;
  height: 28px;
  width: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background 0.12s, color 0.12s, border-color 0.12s;
}
.horn-preview-btn:hover {
  background: var(--blue);
  color: #fff;
  border-color: var(--blue);
}
.horn-custom-status {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.5px;
  padding: 2px 9px;
  border-radius: 999px;
  margin-top: 3px;
  display: inline-block;
}
.horn-custom-status:empty { display: none; }
.horn-custom-status.pending { background: rgba(158,106,3,.25); color: #f0c040; border: 1px solid #9e6a03; }
.horn-custom-status.approved { background: rgba(26,71,48,.35); color: #3fb950; border: 1px solid #238636; }
.horn-custom-status.denied { background: rgba(61,20,20,.35); color: #f85149; border: 1px solid #da3633; }

/* Custom upload section */
.custom-horn-section {
  background: var(--panel2);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.custom-horn-section.hidden { display: none; }
.upload-instructions { color: var(--muted); font-size: 0.82rem; }
.upload-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.upload-file-label {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text);
  cursor: pointer;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 1px;
  padding: 7px 13px;
  text-transform: uppercase;
  white-space: nowrap;
  transition: border-color 0.15s;
  flex-shrink: 0;
}
.upload-file-label:hover { border-color: var(--blue); }
.upload-file-label input[type="file"] { display: none; }
.horn-file-name {
  color: var(--muted);
  font-size: 0.82rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1;
  min-width: 0;
}
.horn-upload-success { color: #3fb950; font-size: 0.85rem; }
.horn-upload-success.hidden { display: none; }

.customize-actions {
  display: flex;
  gap: 10px;
  margin-top: 0;
  padding-top: 12px;
  padding-bottom: max(4px, env(safe-area-inset-bottom, 0px));
  border-top: 1px solid var(--border);
  flex-shrink: 0;
  background: var(--panel);
  position: relative;
  z-index: 1;
}
.customize-actions .btn { flex: 1; }

/* Password section in Customize */
.pw-section { display: flex; flex-direction: column; gap: 10px; }
.pw-show-wrap { display: flex; flex-direction: row; align-items: center; gap: 6px; }
.pw-show-wrap input { flex: 1; }
.btn-show-pw {
  background: var(--panel2);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--muted);
  cursor: pointer;
  padding: 7px 10px;
  display: flex;
  align-items: center;
  transition: color 0.15s, border-color 0.15s;
  flex-shrink: 0;
}
.btn-show-pw:hover { color: var(--text); border-color: var(--blue); }
.pw-success { color: #3fb950; font-size: 0.85rem; }
.pw-success.hidden { display: none; }

/* Auth phase (name entry screen) */
.auth-phase { display: flex; flex-direction: column; gap: 10px; }
.auth-phase.hidden { display: none; }
.auth-msg { color: var(--muted); font-size: 0.88rem; text-align: center; }
#confirm-row.hidden { display: none; }

.login-password-help {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 4px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}
.login-password-help.hidden { display: none; }
.login-password-help-line {
  margin: 0;
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.45;
  text-align: center;
}
.login-password-help .btn { width: 100%; margin-top: 4px; }

/* Pause Overlay */
.pause-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.72);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 60;
}
.pause-overlay.hidden { display: none; }
.pause-card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 36px 44px;
  text-align: center;
  min-width: 300px;
  box-shadow: 0 16px 60px rgba(0,0,0,0.7);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}
.pause-title {
  font-family: Impact, sans-serif;
  font-size: 2.2rem;
  letter-spacing: 4px;
  color: var(--text);
  margin: 0;
}
.pause-team-label {
  font-size: 0.95rem;
  color: var(--muted);
  letter-spacing: 1px;
}
.pause-unpause-countdown {
  font-family: Impact, sans-serif;
  font-size: 2rem;
  letter-spacing: 2px;
  color: #5cdb7a;
  line-height: 1.2;
}
.pause-unpause-countdown.hidden { display: none; }
.pause-countdown {
  font-family: Impact, sans-serif;
  font-size: 3.2rem;
  letter-spacing: 2px;
  color: var(--text);
  line-height: 1;
  min-height: 3.5rem;
}
.pause-countdown.pause-countdown--dimmed {
  opacity: 0.45;
  font-size: 2.4rem;
  min-height: 2.8rem;
}
.pause-countdown.low { color: #e34c4c; }
.pause-expired-msg {
  font-size: 0.88rem;
  color: var(--muted);
}
.pause-expired-msg.hidden { display: none; }
.pause-hint {
  font-size: 0.8rem;
  color: var(--muted);
  opacity: 0.7;
}

/* Custom horn multi-slot */
.custom-slot {
  border-top: 1px solid var(--border);
  padding-top: 12px;
  margin-top: 12px;
}
.custom-slot:first-of-type { border-top: none; margin-top: 4px; }
.custom-slot-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}
.custom-slot-num {
  font-weight: 700;
  font-size: 0.88rem;
  color: var(--text);
  letter-spacing: 0.5px;
}

/* ── Horn Picker Row (customize screen) ─────────────────────────────────── */
.horn-picker-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 4px;
}
.horn-current-label {
  flex: 1;
  padding: 8px 12px;
  background: var(--panel2);
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 0.92rem;
  color: var(--text);
}
.customize-current-preview-wrap {
  margin-top: 6px;
  display: flex;
  align-items: center;
}
.customize-boost-preview {
  width: 220px;
  height: 60px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: #080e1a;
  display: block;
}

.model-skins-preview-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 14px;
  margin: 8px 0 12px;
  justify-content: space-between;
}
.model-skin-preview-fig {
  margin: 0;
  flex: 1 1 72px;
  min-width: 68px;
  max-width: 92px;
  text-align: center;
}
.model-skin-thumb-frame {
  position: relative;
  width: 56px;
  height: 56px;
  margin: 0 auto 4px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: rgba(0, 0, 0, 0.35);
  overflow: hidden;
}
.model-skin-preview-canvas {
  display: block;
  width: 100%;
  height: 100%;
  vertical-align: top;
}
.model-skin-preview-fallback {
  position: absolute;
  inset: 0;
  border-radius: 9px;
}
.model-skin-preview-fig figcaption {
  font-size: 0.65rem;
  line-height: 1.2;
  color: var(--muted);
  font-weight: 600;
  letter-spacing: 0.02em;
}

/* ── Goal Horn Modal ─────────────────────────────────────────────────────── */
.horn-modal-card {
  width: min(720px, 96vw);
  max-height: 88vh;
  overflow-y: auto;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 22px 80px rgba(0,0,0,0.65);
  padding: 28px 26px 24px;
}
.horn-modal-header {
  margin-bottom: 16px;
}
.horn-modal-title {
  font-size: 1.9rem;
  font-family: Impact, sans-serif;
  letter-spacing: 3px;
  margin-bottom: 4px;
}
.horn-modal-sub {
  color: var(--muted);
  font-size: 0.88rem;
}
.horn-modal-actions {
  display: flex;
  gap: 10px;
  margin-top: 22px;
}
.horn-subsection-title {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--muted);
  margin: 0 0 8px;
  font-weight: 700;
}
.horn-playlist-block {
  margin-bottom: 18px;
}
.horn-playlist-mount {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.horn-playlist-slot-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  padding: 10px 12px;
  background: var(--panel2);
  border: 1px solid var(--border);
  border-radius: 8px;
}
.horn-slot-num {
  font-weight: 800;
  font-size: 0.78rem;
  color: var(--gold);
  min-width: 4.2rem;
}
.horn-slot-label {
  flex: 1;
  min-width: 120px;
  font-size: 0.88rem;
  color: var(--text);
}
.horn-library-block {
  margin-bottom: 18px;
}
.horn-library-sub {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--muted);
  margin: 12px 0 6px;
}
.horn-library-sub:first-of-type {
  margin-top: 0;
}
.horn-library-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.horn-lib-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  padding: 8px 10px;
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid var(--border);
  border-radius: 8px;
}
.horn-lib-name {
  flex: 1;
  min-width: 140px;
  font-size: 0.86rem;
  font-weight: 600;
}
.horn-lib-empty {
  margin: 0;
  font-size: 0.82rem;
  color: var(--muted);
  font-style: italic;
}
.horn-upload-summary {
  font-size: 0.82rem;
  color: var(--muted);
  margin-bottom: 2px;
}
.horn-upload-summary:empty {
  display: none;
}

/* ── Boost Skin Modal ────────────────────────────────────────────────────── */
.boost-modal-card {
  width: min(780px, 96vw);
}
.boost-skin-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-bottom: 18px;
}
.boost-skin-card {
  background: var(--panel2);
  border: 2px solid var(--border);
  border-radius: 10px;
  padding: 10px 10px 8px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  transition: border-color 0.15s, background 0.15s;
  user-select: none;
}
.boost-skin-card:hover { border-color: var(--blue); background: #1a2235; }
.boost-skin-card.selected {
  border-color: var(--gold);
  background: rgba(240, 192, 64, 0.07);
}
.boost-skin-preview {
  width: 120px;
  height: 70px;
  border-radius: 6px;
  background: #080e1a;
  display: block;
}
.boost-skin-name {
  font-weight: 600;
  font-size: 0.85rem;
  color: var(--text);
  text-align: center;
}

/* ── Lobby Chat ─────────────────────────────────────────────────────────── */
.lobby-chat {
  border-top: 1px solid var(--border);
  margin-top: 10px;
  padding: 8px 12px 10px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.lobby-chat-messages {
  max-height: 110px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-size: 0.82rem;
  color: var(--text);
  scrollbar-width: thin;
}
.lobby-chat-messages .chat-msg {
  line-height: 1.4;
  word-break: break-word;
}
.lobby-chat-messages .chat-msg .chat-sender {
  font-weight: 700;
  margin-right: 4px;
}
.lobby-chat-messages .chat-msg .chat-sender.team-red  { color: var(--red); }
.lobby-chat-messages .chat-msg .chat-sender.team-blue { color: var(--blue); }
.lobby-chat-messages .chat-msg .chat-sender.team-spectator { color: var(--muted); }
.lobby-chat-input-row {
  display: flex;
  gap: 6px;
}
.lobby-chat-input {
  flex: 1;
  background: var(--panel2);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text);
  padding: 5px 10px;
  font-size: 0.85rem;
  outline: none;
}
.lobby-chat-input:focus { border-color: var(--blue); }

/* ── In-game Chat Overlay ────────────────────────────────────────────────── */
#game-chat-overlay {
  position: absolute;
  left: 10px;
  bottom: 52px;
  width: 340px;
  pointer-events: none;
  z-index: 30;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
#game-chat-messages {
  display: flex;
  flex-direction: column;
  gap: 1px;
  max-height: 160px;
  overflow: hidden;
  justify-content: flex-end;
}
.gchat-msg {
  font-size: 0.8rem;
  line-height: 1.35;
  padding: 2px 6px;
  border-radius: 4px;
  background: rgba(0,0,0,0.52);
  color: #e8f0f8;
  word-break: break-word;
  transition: opacity 1s ease;
  max-width: 100%;
}
.gchat-msg.fading { opacity: 0; }
.gchat-msg .gchat-sender { font-weight: 700; margin-right: 4px; }
.gchat-msg .gchat-sender.team-red  { color: #f07070; }
.gchat-msg .gchat-sender.team-blue { color: #70a8f0; }
.gchat-msg .gchat-scope-all { color: rgba(255,220,60,0.75); font-size: 0.72rem; margin-right: 3px; }
.gchat-msg .gchat-pause-line { color: rgba(230, 232, 240, 0.92); font-size: 0.88rem; }
.gchat-msg.gchat-system { color: var(--muted); font-size: 0.82rem; line-height: 1.3; }
#game-chat-input-bar {
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(0,0,0,0.68);
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 6px;
  padding: 4px 8px;
  pointer-events: auto;
}
#game-chat-input-bar.hidden { display: none; }
#game-chat-scope-badge {
  font-size: 0.72rem;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 3px;
  white-space: nowrap;
  cursor: default;
  user-select: none;
}
#game-chat-scope-badge.chat-scope-team {
  background: rgba(76,143,227,0.25);
  color: #70a8f0;
  border: 1px solid rgba(76,143,227,0.4);
}
#game-chat-scope-badge.chat-scope-all {
  background: rgba(240,192,64,0.2);
  color: #f0c040;
  border: 1px solid rgba(240,192,64,0.4);
}
#game-chat-input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  color: #e8f0f8;
  font-size: 0.83rem;
  font-family: inherit;
  caret-color: #f0c040;
}
#game-chat-close {
  flex-shrink: 0;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 4px;
  color: #c9d1d9;
  font-size: 0.8rem;
  line-height: 1;
  padding: 3px 7px;
  cursor: pointer;
  user-select: none;
  transition: background 0.12s, color 0.12s, border-color 0.12s;
}
#game-chat-close:hover {
  background: rgba(229,76,76,0.85);
  border-color: rgba(229,76,76,0.9);
  color: #fff;
}
.game-chat-history-overlay {
  position: absolute;
  inset: 0;
  z-index: 75;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(6, 10, 18, 0.62);
}
.game-chat-history-overlay.hidden { display: none; }
.game-chat-history-card {
  width: min(720px, 92vw);
  max-height: min(520px, 78vh);
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 14px;
  border-radius: 12px;
  border: 1px solid rgba(200, 220, 255, 0.22);
  background: linear-gradient(180deg, rgba(9,16,30,0.98), rgba(6,11,20,0.96));
  box-shadow: 0 16px 40px rgba(0,0,0,0.5);
}
.game-chat-history-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.game-chat-history-header h3 {
  margin: 0;
  font-size: 1rem;
  letter-spacing: 0.04em;
}
.game-chat-history-list {
  overflow-y: auto;
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 8px;
  padding: 10px;
  background: rgba(0,0,0,0.2);
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-height: 180px;
}
.gchat-history-row {
  font-size: 0.86rem;
  line-height: 1.3;
  color: #dce9ff;
  word-break: break-word;
}
.gchat-history-row .name {
  font-weight: 700;
}
.gchat-history-row .name.team-red { color: var(--red); }
.gchat-history-row .name.team-blue { color: var(--blue); }
.gchat-history-row .scope {
  color: #9fb8df;
  font-size: 0.74rem;
  margin-right: 6px;
}

.mobile-shot-bars {
  position: absolute;
  left: 50%;
  bottom: 10px;
  transform: translateX(-50%);
  width: min(320px, 68vw);
  display: flex;
  flex-direction: column;
  gap: 5px;
  z-index: 33;
  pointer-events: none;
}
.mobile-shot-bars.hidden { display: none; }
.mobile-shot-bar-row {
  display: grid;
  grid-template-columns: 34px 1fr;
  align-items: center;
  gap: 7px;
}
.mobile-shot-bar-label {
  font-family: Impact, sans-serif;
  letter-spacing: 1.2px;
  font-size: 0.68rem;
  color: #d8e9ff;
  text-align: right;
  text-shadow: 0 1px 3px rgba(0,0,0,0.8);
}
.mobile-shot-bar-track {
  height: 10px;
  border-radius: 999px;
  background: rgba(6, 10, 18, 0.78);
  border: 1px solid rgba(186, 212, 245, 0.34);
  overflow: hidden;
  box-shadow: 0 2px 10px rgba(0,0,0,0.38);
}
.mobile-shot-bar-fill {
  height: 100%;
  width: 0%;
  transition: width 0.04s linear;
}
.mobile-shot-bar-fill-power {
  background: linear-gradient(90deg, #2f9bff 0%, #77d4ff 55%, #d1f3ff 100%);
}
.mobile-shot-bar-fill-distance {
  background: linear-gradient(90deg, #4a92ff 0%, #9f7fff 60%, #dc86ff 100%);
}

/* ── Shot Clock Bar ─────────────────────────────────────────────────────── */
.shot-clock-bar {
  display: flex;
  width: min(1173px, 100vw);
  height: 6px;
  gap: 2px;
  flex-shrink: 0;
}
.sc-half {
  flex: 1;
  background: #1c2330;
  border-radius: 3px;
  overflow: hidden;
  position: relative;
}
.sc-half-red { border-radius: 3px 3px 3px 3px; }
.sc-half-blue { border-radius: 3px 3px 3px 3px; }
/* Red fill drains right→left; blue fill drains left→right */
.sc-fill-red {
  position: absolute;
  top: 0; left: 0;
  height: 100%;
  width: 100%;
  background: #4c8fe3;
  border-radius: 3px;
  transform-origin: left center;
  transition: width 0.12s linear, background-color 0.3s;
}
.sc-fill-blue {
  position: absolute;
  top: 0; right: 0;
  height: 100%;
  width: 100%;
  background: #4c8fe3;
  border-radius: 3px;
  transform-origin: right center;
  transition: width 0.12s linear, background-color 0.3s;
}
.sc-fill-red.sc-urgent, .sc-fill-blue.sc-urgent {
  background: #e34c4c;
}
.sc-fill-red.sc-inactive, .sc-fill-blue.sc-inactive {
  opacity: 0.25;
}

/* ── Loading Screen ──────────────────────────────────────────────────────── */
.loading-screen {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding: 48px 32px;
  width: 90vw;
  max-width: 560px;
}
.loading-main-panel {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  width: 100%;
  max-width: 520px;
  min-width: 380px;
  padding: 28px 32px 24px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: 0 8px 48px rgba(0,0,0,0.6);
}
.loading-tips {
  width: 100%;
  max-width: 520px;
  padding: 14px 16px 12px;
  background: linear-gradient(165deg, rgba(30, 40, 58, 0.95) 0%, var(--panel2) 55%, rgba(20, 28, 42, 0.98) 100%);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: 0 4px 28px rgba(0,0,0,0.45), inset 0 1px 0 rgba(255,255,255,0.04);
}
.loading-tips-inner {
  transition: opacity 0.32s ease, transform 0.32s ease;
}
.loading-tips-inner--out {
  opacity: 0;
  transform: translateY(5px);
}
.loading-tips-badge {
  position: relative;
  display: inline-flex;
  align-items: center;
  margin-bottom: 10px;
  padding: 5px 14px 6px;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid rgba(88, 166, 255, 0.35);
  background: linear-gradient(120deg, rgba(56, 139, 253, 0.12) 0%, rgba(240, 180, 60, 0.08) 100%);
}
.loading-tips-badge-glow {
  position: absolute;
  inset: -40% -20%;
  background: radial-gradient(ellipse at 30% 50%, rgba(88, 166, 255, 0.25), transparent 55%),
    radial-gradient(ellipse at 70% 80%, rgba(240, 180, 60, 0.12), transparent 50%);
  pointer-events: none;
  animation: loadingTipsBadgeShimmer 4.5s ease-in-out infinite;
}
@keyframes loadingTipsBadgeShimmer {
  0%, 100% { opacity: 0.85; transform: translateX(0); }
  50% { opacity: 1; transform: translateX(4%); }
}
.loading-tips-badge-label {
  position: relative;
  z-index: 1;
  font-family: Impact, Arial Black, sans-serif;
  font-size: 1.15rem;
  font-weight: 400;
  letter-spacing: 0.06em;
  line-height: 1.1;
  background: linear-gradient(100deg, #b8e8ff 0%, var(--ice) 40%, var(--gold) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  filter: drop-shadow(0 0 10px rgba(88, 166, 255, 0.22));
}
.loading-tips-copy {
  font-size: 0.88rem;
  line-height: 1.5;
  color: var(--text);
}
.loading-tips-copy p {
  margin: 0 0 8px;
}
.loading-tips-copy p:last-child {
  margin-bottom: 0;
}
.loading-tips-keys {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  margin-top: 10px;
  font-size: 0.78rem;
  color: var(--muted);
}
.loading-tips-track {
  display: flex;
  justify-content: center;
  gap: 7px;
  margin-top: 12px;
  padding-top: 2px;
}
.loading-tips-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--border);
  opacity: 0.45;
  transition: background 0.25s ease, opacity 0.25s ease, transform 0.25s ease;
}
.loading-tips-dot.active {
  background: var(--ice);
  opacity: 1;
  transform: scale(1.2);
  box-shadow: 0 0 8px rgba(136, 220, 255, 0.35);
}
.loading-logo {
  font-family: Impact, Arial Black, sans-serif;
  font-size: 2.4rem;
  letter-spacing: 4px;
  background: linear-gradient(135deg, #fff 0%, var(--ice) 50%, var(--gold) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.loading-logo span {
  background: linear-gradient(135deg, var(--ice) 0%, var(--blue) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.loading-subtitle {
  color: var(--muted);
  font-size: 0.85rem;
  letter-spacing: 3px;
  text-transform: uppercase;
  margin-bottom: 4px;
}
.loading-spinner-row {
  display: flex;
  gap: 8px;
  margin-bottom: 8px;
}
.loading-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--blue);
  animation: loadingBounce 1.2s ease-in-out infinite;
}
.loading-dot:nth-child(2) { animation-delay: 0.2s; background: var(--ice); }
.loading-dot:nth-child(3) { animation-delay: 0.4s; background: var(--gold); }
@keyframes loadingBounce {
  0%, 80%, 100% { transform: scale(0.7); opacity: 0.5; }
  40% { transform: scale(1.1); opacity: 1; }
}
.loading-players-list {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 8px 0 4px;
}
.loading-player-row {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.loading-player-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.88rem;
}
.loading-player-name {
  font-weight: 600;
  color: var(--text);
}
.loading-player-status {
  font-size: 0.78rem;
  color: var(--muted);
  font-weight: 500;
}
.loading-player-status.ready {
  color: #3fb950;
}
.loading-bar-track {
  width: 100%;
  height: 8px;
  background: var(--panel2);
  border-radius: 4px;
  overflow: hidden;
  border: 1px solid var(--border);
}
.loading-bar-fill {
  height: 100%;
  border-radius: 4px;
  width: 0%;
  transition: width 0.4s ease;
  background: linear-gradient(90deg, var(--blue-dark), var(--blue), var(--ice));
}
.loading-bar-fill.ready {
  width: 100%;
  background: linear-gradient(90deg, #2ea043, #3fb950, #7ee787);
}
.loading-footer {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  width: 100%;
  max-width: 520px;
  padding-top: 4px;
  margin-top: 2px;
}
.loading-status-text {
  color: var(--muted);
  font-size: 0.85rem;
  text-align: center;
}

/* Loading Leave Confirm */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 200;
}
.modal-backdrop.hidden { display: none; }
.modal-box {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 28px 28px 24px;
  width: 90vw;
  box-shadow: 0 8px 40px rgba(0,0,0,0.7);
}
.modal-title {
  font-size: 1.2rem;
  font-weight: 700;
  margin-bottom: 12px;
  color: var(--text);
}

/* ═══════════════════════════════════════════════════════════════════════════
   GAME INTRO OVERLAY — TV Broadcast Style
   ═══════════════════════════════════════════════════════════════════════════ */

.game-intro-overlay {
  position: absolute;
  inset: 0;
  z-index: 55;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  overflow: hidden;
  opacity: 0;
  transition: opacity 0.85s cubic-bezier(0.22, 1, 0.36, 1);
  pointer-events: none;
  font-family: 'Barlow Condensed', 'Impact', sans-serif;
}
.game-intro-overlay.hidden { display: none !important; }
.game-intro-overlay.intro-visible {
  opacity: 1;
  pointer-events: auto;
}
.game-intro-overlay.intro-fading {
  opacity: 0;
  transition: opacity 0.65s ease-in;
}

/* ── Deep atmosphere background ──────────────────────────────────────────── */
.intro-bg-layer {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 80% 50% at 50% -10%, rgba(227,76,76,0.12) 0%, transparent 60%),
    radial-gradient(ellipse 80% 50% at 50% 110%, rgba(76,143,227,0.12) 0%, transparent 60%),
    radial-gradient(ellipse 120% 80% at 50% 50%, rgba(4,8,20,0.0) 0%, rgba(2,5,15,0.97) 100%),
    linear-gradient(180deg, #020510 0%, #04091a 50%, #020510 100%);
  z-index: 0;
}

/* Subtle CRT scanlines for broadcast texture */
.intro-scanlines {
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 2px,
    rgba(0, 0, 0, 0.07) 2px,
    rgba(0, 0, 0, 0.07) 4px
  );
  z-index: 1;
  pointer-events: none;
}

/* Ice reflection at bottom */
.intro-ice-reflect {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 35%;
  background: linear-gradient(0deg,
    rgba(180,220,255,0.06) 0%,
    rgba(140,200,255,0.03) 40%,
    transparent 100%);
  z-index: 1;
  pointer-events: none;
}

/* Dramatic angled spotlights from top corners */
.intro-spotlight {
  position: absolute;
  top: 0;
  width: 45%;
  height: 75%;
  z-index: 2;
  pointer-events: none;
}
.intro-spotlight--left {
  left: -5%;
  background: conic-gradient(from -12deg at 15% 0%,
    transparent 0deg,
    rgba(227,76,76,0.10) 14deg,
    rgba(227,76,76,0.04) 24deg,
    transparent 38deg);
  animation: intro-spot-pulse 3.5s ease-in-out infinite;
}
.intro-spotlight--right {
  right: -5%;
  background: conic-gradient(from 192deg at 85% 0%,
    transparent 0deg,
    rgba(76,143,227,0.10) 14deg,
    rgba(76,143,227,0.04) 24deg,
    transparent 38deg);
  animation: intro-spot-pulse 3.5s ease-in-out infinite 1.75s;
}
@keyframes intro-spot-pulse {
  0%, 100% { opacity: 0.65; }
  50%       { opacity: 1; }
}

/* ── Broadcast header bar ────────────────────────────────────────────────── */
.intro-network-bar {
  position: relative;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 18px 7px;
  background: linear-gradient(90deg,
    rgba(0,0,0,0.85) 0%,
    rgba(10,16,35,0.92) 50%,
    rgba(0,0,0,0.85) 100%);
  border-bottom: 1px solid rgba(255,255,255,0.06);
  flex-shrink: 0;
}
.intro-network-logo {
  font-family: 'Bebas Neue', 'Impact', sans-serif;
  font-size: 1.15rem;
  letter-spacing: 6px;
  background: linear-gradient(135deg, #fff 0%, var(--ice) 45%, var(--gold) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.intro-network-right {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}
/* Fullscreen + menu in intro header (same actions as HUD; avoids canvas overlay covering seam buttons) */
.intro-top-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-right: 4px;
}
.intro-top-actions .btn-intro-bar {
  position: relative !important;
  top: auto !important;
  right: auto !important;
  flex-shrink: 0;
}
.intro-live-badge {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 0.72rem;
  letter-spacing: 3px;
  color: #fff;
  background: #c01818;
  padding: 2px 8px 1px;
  border-radius: 3px;
  animation: intro-live-blink 1.0s step-start infinite;
}
@keyframes intro-live-blink {
  0%, 49% { opacity: 1; }
  50%, 100% { opacity: 0.3; }
}
.intro-period-pill {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 0.72rem;
  letter-spacing: 3px;
  color: var(--gold);
  border: 1px solid rgba(240,192,64,0.4);
  padding: 2px 10px 1px;
  border-radius: 4px;
}

/* ── Main roster card ────────────────────────────────────────────────────── */
.intro-main-card {
  position: relative;
  z-index: 10;
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 10px 24px 6px;
  min-height: 0;
  overflow: hidden;
}

.intro-matchup-label {
  font-family: 'Bebas Neue', 'Impact', sans-serif;
  font-size: 1.25rem;
  letter-spacing: 8px;
  color: rgba(255,255,255,0.92);
  text-align: center;
  margin-bottom: 10px;
  animation: intro-label-fadein 0.6s ease both;
  animation-delay: 0.2s;
}
@keyframes intro-label-fadein {
  from { opacity: 0; letter-spacing: 14px; }
  to   { opacity: 1; letter-spacing: 8px; }
}

/* ── Team block ──────────────────────────────────────────────────────────── */
.intro-team-block {
  background: rgba(8,12,26,0.82);
  border-radius: 10px;
  overflow: hidden;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  margin-bottom: 0;
}
.intro-team-block--red {
  border: 1px solid rgba(227,76,76,0.22);
  box-shadow: 0 0 50px rgba(227,76,76,0.10), inset 0 1px 0 rgba(227,76,76,0.12);
}
.intro-team-block--blue {
  border: 1px solid rgba(76,143,227,0.22);
  box-shadow: 0 0 50px rgba(76,143,227,0.10), inset 0 1px 0 rgba(76,143,227,0.12);
}

.intro-team-header {
  position: relative;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 10px 16px 9px;
  overflow: hidden;
}
.intro-team-header--red { background: linear-gradient(90deg, rgba(227,76,76,0.18) 0%, rgba(227,76,76,0.04) 60%, transparent 100%); }
.intro-team-header--blue { background: linear-gradient(90deg, rgba(76,143,227,0.18) 0%, rgba(76,143,227,0.04) 60%, transparent 100%); }

.intro-team-accent {
  width: 4px;
  height: 42px;
  border-radius: 3px;
  flex-shrink: 0;
}
.intro-team-accent--red  { background: var(--red);  box-shadow: 0 0 14px rgba(227,76,76,0.8); }
.intro-team-accent--blue { background: var(--blue); box-shadow: 0 0 14px rgba(76,143,227,0.8); }

.intro-team-title-group {
  display: flex;
  align-items: baseline;
  gap: 8px;
}
.intro-team-name-text {
  font-family: 'Bebas Neue', 'Impact', sans-serif;
  font-size: 2.2rem;
  letter-spacing: 8px;
  line-height: 1;
}
.intro-team-sub {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 0.72rem;
  letter-spacing: 5px;
  color: rgba(255,255,255,0.35);
  font-weight: 600;
  text-transform: uppercase;
  padding-bottom: 3px;
}
.intro-team-glow {
  position: absolute;
  right: 0; top: 0; bottom: 0;
  width: 40%;
  pointer-events: none;
}
.intro-team-glow--red  { background: radial-gradient(ellipse at right center, rgba(227,76,76,0.08) 0%, transparent 70%); }
.intro-team-glow--blue { background: radial-gradient(ellipse at right center, rgba(76,143,227,0.08) 0%, transparent 70%); }

/* ── Player rows ─────────────────────────────────────────────────────────── */
.intro-player-list {
  padding: 4px 10px 6px;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.intro-player-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 5px 10px;
  background: rgba(255,255,255,0.035);
  border: 1px solid rgba(255,255,255,0.055);
  border-radius: 7px;
  opacity: 0;
  transform: translateX(-22px);
  animation: intro-row-slide 0.4s cubic-bezier(0.22,1,0.36,1) forwards;
  transition: background 0.2s ease;
}
.intro-team-block--blue .intro-player-row {
  transform: translateX(22px);
}
@keyframes intro-row-slide {
  to { opacity: 1; transform: translateX(0); }
}

.intro-player-name {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 1rem;
  font-weight: 700;
  color: var(--text);
  letter-spacing: 0.5px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 220px;
}
.intro-player-self {
  color: var(--gold);
}
.intro-bot-tag {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 0.6rem;
  font-weight: 600;
  color: var(--muted);
  letter-spacing: 2px;
  margin-left: 6px;
  vertical-align: middle;
  opacity: 0.7;
}

/* Goalie badge: dim = opted out, glowing gold = opted in */
.intro-goalie-badge {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 0.75rem;
  letter-spacing: 2px;
  padding: 3px 9px 2px;
  border-radius: 5px;
  border: 1px solid rgba(255,255,255,0.1);
  color: rgba(255,255,255,0.2);
  background: rgba(255,255,255,0.04);
  transition: all 0.22s ease;
  user-select: none;
  flex-shrink: 0;
}
.intro-goalie-active {
  color: var(--gold);
  background: rgba(240,192,64,0.14);
  border-color: rgba(240,192,64,0.55);
  box-shadow: 0 0 10px rgba(240,192,64,0.35), inset 0 1px 0 rgba(240,192,64,0.2);
}

/* ── VS divider ──────────────────────────────────────────────────────────── */
.intro-vs-row {
  display: flex;
  align-items: center;
  gap: 0;
  margin: 8px 4px;
  animation: intro-vs-fadein 0.5s ease both;
  animation-delay: 0.15s;
}
@keyframes intro-vs-fadein {
  from { opacity: 0; transform: scaleX(0.85); }
  to   { opacity: 1; transform: scaleX(1); }
}
.intro-vs-line {
  flex: 1;
  height: 1px;
}
.intro-vs-line--red  { background: linear-gradient(90deg, transparent, rgba(227,76,76,0.6)); }
.intro-vs-line--blue { background: linear-gradient(90deg, rgba(76,143,227,0.6), transparent); }

.intro-vs-badge {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1px;
  padding: 0 16px;
}
.intro-vs-puck-icon {
  font-size: 1.4rem;
  animation: intro-puck-spin 5s linear infinite;
  filter: drop-shadow(0 0 6px rgba(255,255,255,0.3));
}
@keyframes intro-puck-spin {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}
.intro-vs-text {
  font-family: 'Bebas Neue', 'Impact', sans-serif;
  font-size: 1.1rem;
  letter-spacing: 6px;
  color: var(--gold);
  text-shadow: 0 0 18px rgba(240,192,64,0.55);
}

/* ── Bottom bar ──────────────────────────────────────────────────────────── */
.intro-bottom-bar {
  position: relative;
  z-index: 10;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 7px;
  padding: 8px 20px 12px;
  background: linear-gradient(0deg, rgba(2,5,15,0.92) 0%, transparent 100%);
  flex-shrink: 0;
}
.intro-goalie-hint {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 0.82rem;
  font-weight: 400;
  color: rgba(255,255,255,0.35);
  letter-spacing: 1px;
  text-align: center;
  animation: intro-hint-fadein 0.6s ease both;
  animation-delay: 1.2s;
}
@keyframes intro-hint-fadein {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}
.intro-kbd {
  display: inline-block;
  font-family: 'Barlow Condensed', monospace;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--gold);
  background: rgba(240,192,64,0.1);
  border: 1px solid rgba(240,192,64,0.4);
  border-radius: 4px;
  padding: 1px 7px;
  margin: 0 2px;
}

.intro-progress-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  width: min(520px, 88%);
}
.intro-progress-track {
  width: 100%;
  height: 3px;
  background: rgba(255,255,255,0.08);
  border-radius: 3px;
  overflow: hidden;
  position: relative;
}
.intro-progress-fill {
  height: 100%;
  width: 100%;
  border-radius: 3px;
  background: linear-gradient(90deg,
    var(--red) 0%,
    #e87030 25%,
    var(--gold) 50%,
    #30a0e8 75%,
    var(--blue) 100%);
  transition: width 0.28s linear;
  box-shadow: 0 0 8px rgba(240,192,64,0.4);
}
.intro-progress-shine {
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent 0%, rgba(255,255,255,0.3) 50%, transparent 100%);
  animation: intro-shine-sweep 2.5s linear infinite;
}
@keyframes intro-shine-sweep {
  from { transform: translateX(-100%); }
  to   { transform: translateX(200%); }
}
.intro-countdown-label {
  font-family: 'Bebas Neue', 'Impact', sans-serif;
  font-size: 0.72rem;
  letter-spacing: 4px;
  color: rgba(255,255,255,0.35);
  text-align: center;
}

/* ── Reconnect overlay ─────────────────────────────────────────────── */
.reconnect-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.82);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 200;
}
.reconnect-overlay.hidden { display: none; }
.reconnect-card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 40px 52px;
  text-align: center;
  min-width: 300px;
  box-shadow: 0 16px 60px rgba(0,0,0,0.8);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}
.reconnect-title {
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: 1px;
  color: var(--text);
  margin: 0;
}
.reconnect-msg {
  color: rgba(255,255,255,0.55);
  font-size: 0.9rem;
  margin: 0;
}
.reconnect-leave-btn {
  margin-top: 8px;
  padding: 10px 28px;
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: 1px;
}
@keyframes reconnect-spin {
  to { transform: rotate(360deg); }
}
.reconnect-spinner {
  width: 44px;
  height: 44px;
  border: 4px solid rgba(255,255,255,0.15);
  border-top-color: #60a5fa;
  border-radius: 50%;
  animation: reconnect-spin 0.9s linear infinite;
}

/* ── Fight system UI ─────────────────────────────────────────────────────────── */
/* ── Fight challenge prompt ───────────────────────────────────────────────── */
.fight-challenge-overlay {
  position: fixed; inset: 0; z-index: 3200;
  display: flex; align-items: center; justify-content: center;
  pointer-events: none;
}
.fight-challenge-overlay.hidden { display: none; }
.fight-challenge-card {
  pointer-events: all;
  background: rgba(8,12,20,0.97);
  border: 2px solid rgba(255,255,255,0.14);
  border-radius: 16px;
  padding: 30px 40px 22px;
  text-align: center;
  min-width: 300px;
  box-shadow: 0 0 80px rgba(0,0,0,0.9), 0 0 30px rgba(220,40,40,0.18);
  animation: fight-card-in 0.16s ease-out;
}
@keyframes fight-card-in { from { transform: scale(0.9) translateY(10px); opacity:0; } to { transform:scale(1) translateY(0); opacity:1; } }
.fight-challenge-title {
  font-size: 1.05rem; font-weight: 700; color: #e6edf3; margin-bottom: 20px; line-height: 1.4;
}
.fight-challenge-btns { display: flex; gap: 12px; justify-content: center; margin-bottom: 16px; }
.fight-btn {
  padding: 13px 26px; border: none; border-radius: 9px;
  font-size: 1rem; font-weight: 900; letter-spacing: 2px; cursor: pointer;
  color: #fff; transition: transform 0.07s, filter 0.07s;
}
.fight-btn:hover { filter: brightness(1.18); transform: scale(1.05); }
.fight-btn-fight { background: #c0392b; box-shadow: 0 0 20px rgba(192,57,43,0.55); }
.fight-btn-slide  { background: #1a3a5c; }
.fight-challenge-timer-bar { height: 4px; background: rgba(255,255,255,0.08); border-radius: 2px; overflow: hidden; }
.fight-challenge-timer-fill { height: 100%; width: 100%; background: #60a5fa; transition: width linear; }

/* ── Fight approach instructions (fighters only, shown during approach) ──── */
.fight-instructions {
  position: fixed; top: 50%; left: 50%; transform: translate(-50%, -50%);
  z-index: 3150; pointer-events: none;
  background: rgba(4,8,18,0.88); border: 1px solid rgba(255,255,255,0.13);
  border-radius: 16px; padding: 18px 28px 14px;
  display: flex; flex-direction: column; align-items: center; gap: 12px;
  animation: fight-instr-in 0.3s ease-out;
  backdrop-filter: blur(6px);
}
.fight-instructions.hidden { display: none; }
@keyframes fight-instr-in {
  from { opacity: 0; transform: translate(-50%, calc(-50% + 12px)); }
  to   { opacity: 1; transform: translate(-50%, -50%); }
}
.fight-instr-header {
  font-size: 0.65rem; font-weight: 900; letter-spacing: 5px;
  color: #e8221a; text-transform: uppercase;
}
.fight-instr-actions {
  display: flex; gap: 20px; align-items: center;
}
.fight-instr-action {
  display: flex; flex-direction: column; align-items: center; gap: 6px;
}
.fight-instr-key {
  min-width: 40px; height: 40px; padding: 0 8px;
  display: flex; align-items: center; justify-content: center;
  background: rgba(255,255,255,0.1); border: 1px solid rgba(255,255,255,0.22);
  border-radius: 8px; border-bottom: 3px solid rgba(255,255,255,0.32);
  font-size: 1.1rem; font-weight: 900; color: #fff;
}
.fight-instr-desc {
  font-size: 0.56rem; font-weight: 800; letter-spacing: 2px;
  color: rgba(255,255,255,0.45); text-transform: uppercase;
}
.fight-instr-tip {
  font-size: 0.54rem; color: rgba(255,255,255,0.28);
  letter-spacing: 0.5px; text-align: center; padding-top: 2px;
  border-top: 1px solid rgba(255,255,255,0.07); width: 100%;
  padding-top: 8px; margin-top: 2px;
}

/* ── Fight banner (shown to everyone) ────────────────────────────────────── */
.fight-hud-banner {
  position: fixed; top: 20px; left: 50%; transform: translateX(-50%);
  font-size: 2.6rem; font-weight: 900; letter-spacing: 8px; color: #e8221a;
  text-shadow: 0 0 30px rgba(220,40,40,0.95), 0 0 60px rgba(220,40,40,0.4), 0 2px 0 #000;
  z-index: 3400; pointer-events: none;
  animation: fight-banner-flash 0.3s ease-out;
}
.fight-hud-banner.hidden { display: none; }
@keyframes fight-banner-flash {
  from { opacity:0; transform: translateX(-50%) scale(1.4) translateY(-8px); }
  to   { opacity:1; transform: translateX(-50%) scale(1)   translateY(0);    }
}

/* ── Active fight HUD (fighters only) ────────────────────────────────────── */
.fight-hud {
  position: fixed; inset: 0; z-index: 3100; pointer-events: none;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding-top: 80px; padding-bottom: 0;
}
.fight-hud.hidden { display: none; }

/* Hit pips + names — the #1 piece of info */
.fight-vs-row {
  display: flex; align-items: center; gap: 10px; margin-bottom: 8px;
}
.fight-name {
  font-size: 0.78rem; font-weight: 700; letter-spacing: 1px;
  color: rgba(255,255,255,0.5); min-width: 72px;
}
.fight-name-me  { text-align: right; }
.fight-name-opp { text-align: left; }
.fight-pips { display: flex; gap: 7px; }
.fight-pips-opp { flex-direction: row-reverse; }
.fight-hit-pip {
  width: 22px; height: 22px; border-radius: 50%;
  border: 2px solid rgba(255,255,255,0.22);
  background: transparent;
  transition: background 0.1s, border-color 0.1s, box-shadow 0.1s;
}
.fight-hit-pip.hit {
  background: #e8221a; border-color: #ff3a2e;
  box-shadow: 0 0 14px rgba(232,34,26,0.95);
}
.fight-vs-divider {
  font-size: 0.68rem; font-weight: 900; color: rgba(255,255,255,0.2);
  letter-spacing: 3px; padding: 0 6px;
}

/* Readiness bar — drains while on cooldown, disappears when ready */
.fight-ready-bar-wrap {
  width: 340px; max-width: 88vw; height: 4px;
  background: rgba(255,255,255,0.07); border-radius: 2px;
  overflow: hidden; margin-bottom: 10px;
}
.fight-ready-fill {
  height: 100%; width: 0; background: #4c8fe3;
  border-radius: 2px; transition: none;
}

/* Action buttons: key chip + label */
.fight-actions-row {
  display: flex; gap: 8px; align-items: stretch;
}
.fight-action {
  display: flex; flex-direction: column; align-items: center; gap: 5px;
  background: rgba(255,255,255,0.06); border: 1px solid rgba(255,255,255,0.1);
  border-radius: 11px; padding: 10px 16px 8px;
  min-width: 86px; position: relative; overflow: hidden;
  transition: opacity 0.12s, background 0.12s, border-color 0.12s;
}
.fight-action.on-cooldown { opacity: 0.28; }
.fight-action-key {
  font-size: 1.35rem; font-weight: 900; color: #fff;
  width: 38px; height: 38px;
  display: flex; align-items: center; justify-content: center;
  background: rgba(255,255,255,0.1); border-radius: 8px;
  letter-spacing: 0; line-height: 1;
  transition: background 0.1s, color 0.1s;
}
.fight-action-label {
  font-size: 0.58rem; font-weight: 800; letter-spacing: 2px;
  color: rgba(255,255,255,0.42); text-transform: uppercase; white-space: nowrap;
  transition: color 0.1s;
}

/* Dodge button: pulse yellow when you can dodge an incoming punch */
.fight-action-dodge-wrap.dodge-incoming {
  background: rgba(255,200,0,0.14); border-color: rgba(255,200,0,0.65);
  animation: fight-dodge-pulse 0.28s ease infinite alternate;
}
.fight-action-dodge-wrap.dodge-incoming .fight-action-key {
  background: rgba(255,200,0,0.25); color: #ffd700;
}
.fight-action-dodge-wrap.dodge-incoming .fight-action-label { color: #ffd700; }
@keyframes fight-dodge-pulse {
  from { box-shadow: 0 0 0 0 rgba(255,200,0,0); }
  to   { box-shadow: 0 0 0 7px rgba(255,200,0,0.3); }
}

/* Draining timer bar at the bottom edge of the dodge button */
.fight-dodge-timer {
  position: absolute; bottom: 0; left: 0; right: 0; height: 4px;
  background: rgba(255,200,0,0.12);
}
.fight-dodge-timer.hidden { display: none; }
.fight-dodge-fill { height: 100%; width: 100%; background: #ffd700; }

/* Haymaker button: pulse orange when opponent is winding up */
.fight-action-haymaker.haymaker-incoming {
  background: rgba(255,80,0,0.14); border-color: rgba(255,80,0,0.65);
  animation: fight-haymaker-pulse 0.2s ease infinite alternate;
}
.fight-action-haymaker.haymaker-incoming .fight-action-key { color: #ff6600; }
.fight-action-haymaker.haymaker-incoming .fight-action-label { color: rgba(255,140,0,0.9); }
@keyframes fight-haymaker-pulse {
  from { box-shadow: 0 0 0 0 rgba(255,80,0,0); }
  to   { box-shadow: 0 0 0 9px rgba(255,80,0,0.35); }
}

/* Fight timer */
.fight-timeout {
  font-size: 0.65rem; color: rgba(255,255,255,0.28); margin-top: 8px; letter-spacing: 2px;
}

/* ── Dodge / haymaker timing prompt ─────────────────────────────────────── */
.fight-timing-prompt {
  display: flex; flex-direction: column; align-items: center; gap: 7px;
  margin-top: 14px;
}
.fight-timing-prompt.hidden { display: none; }

.fight-timing-prompt-text {
  font-size: 1.7rem; font-weight: 900; letter-spacing: 7px;
  color: #ffd700;
  text-shadow: 0 0 18px rgba(255,210,0,0.9), 0 0 36px rgba(255,180,0,0.45);
  animation: timing-pulse 0.16s ease infinite alternate;
}
.fight-timing-prompt.haymaker-warn .fight-timing-prompt-text {
  color: #ff7020;
  text-shadow: 0 0 18px rgba(255,90,0,0.9), 0 0 36px rgba(255,60,0,0.45);
}
@keyframes timing-pulse {
  from { opacity: 0.78; transform: scale(0.975); }
  to   { opacity: 1;    transform: scale(1.025); }
}

.fight-timing-bar-wrap {
  width: 200px; max-width: 52vw; height: 6px;
  background: rgba(255,210,0,0.13); border-radius: 3px; overflow: hidden;
}
.fight-timing-prompt.haymaker-warn .fight-timing-bar-wrap {
  background: rgba(255,90,0,0.13);
}
.fight-timing-bar-fill {
  height: 100%; width: 100%; border-radius: 3px;
  background: #ffd700;
}
.fight-timing-prompt.haymaker-warn .fight-timing-bar-fill {
  background: #ff6018;
}

/* ── KO overlay ───────────────────────────────────────────────────────────── */
.fight-ko-overlay {
  position: fixed; inset: 0; z-index: 3300; pointer-events: none;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  background: rgba(0,0,0,0.6);
}
.fight-ko-overlay.hidden { display: none; }
.fight-ko-text {
  font-size: 4.5rem; font-weight: 900; letter-spacing: 10px; color: #e8221a;
  text-shadow: 0 0 50px rgba(220,40,40,0.9), 0 3px 0 #000;
  animation: fight-ko-in 0.22s ease-out;
}
@keyframes fight-ko-in { from { transform: scale(2.8); opacity:0; } to { transform:scale(1); opacity:1; } }
.fight-ko-timer { font-size: 1.8rem; font-weight: 800; color: #ffe680; margin-bottom: 18px; letter-spacing: 1px; text-shadow: 0 2px 8px rgba(0,0,0,0.8); }

/* ── Spectator bar (non-fighters) ────────────────────────────────────────── */
.fight-spectator-bar {
  position: fixed; top: 10px; left: 50%; transform: translateX(-50%);
  z-index: 3050; background: rgba(5,8,15,0.85);
  border: 1px solid rgba(255,255,255,0.12); border-radius: 9px;
  padding: 6px 18px; display: flex; align-items: center; gap: 10px;
  font-size: 0.8rem; font-weight: 700; letter-spacing: 1px; color: #e6edf3;
  pointer-events: none;
}
.fight-spectator-bar.hidden { display: none; }
.fight-spec-label { color: #e8221a; font-size: 0.82rem; letter-spacing: 3px; }
.fight-spec-hits { color: rgba(255,255,255,0.5); font-size: 0.8rem; letter-spacing: 2px; }

/* ── Spotlight vignette canvas ───────────────────────────────────────────── */
#fight-spotlight-canvas {
  position: fixed; inset: 0; z-index: 3000;
  pointer-events: none; opacity: 0; transition: opacity 0.4s ease;
}
#fight-spotlight-canvas.active { opacity: 1; }

/* ═══════════════════════════════════════════════════════════════════════════
   TUTORIAL SYSTEM
   ═══════════════════════════════════════════════════════════════════════════ */

/* ── Welcome modal ─────────────────────────────────────────────────────────── */
#tutorial-welcome-modal {
  position: fixed; inset: 0; z-index: 900;
  background: rgba(5,8,15,0.82);
  display: flex; align-items: center; justify-content: center;
  backdrop-filter: blur(4px);
}
#tutorial-welcome-modal.hidden { display: none; }

.tut-welcome-card {
  background: #161b22;
  border: 1px solid #30363d;
  border-radius: 16px;
  padding: 36px 40px 32px;
  max-width: 780px; width: 92%;
  box-shadow: 0 24px 60px rgba(0,0,0,0.7);
  text-align: center;
}
.tut-welcome-logo {
  font-size: 2rem; font-weight: 900; letter-spacing: 4px; margin-bottom: 8px;
}
.tut-welcome-desc {
  color: #8b949e; font-size: 0.95rem; margin: 0 0 20px;
}
.tut-welcome-heading {
  color: #f0c040; font-size: 0.85rem; letter-spacing: 3px;
  text-transform: uppercase; margin: 0 0 20px; font-weight: 700;
}
.tut-section-cards {
  display: flex; gap: 16px; margin-bottom: 24px;
}
.tut-section-card {
  position: relative;
  flex: 1; background: linear-gradient(135deg, #1c2333 0%, #161b22 100%);
  border: 2px solid #30363d; border-radius: 12px;
  padding: 20px 16px; cursor: pointer; text-align: left;
  transition: border-color 0.2s, transform 0.15s, box-shadow 0.15s;
}
.tut-section-card:hover {
  border-color: #f0c040;
  transform: translateY(-3px);
  box-shadow: 0 8px 24px rgba(240,192,64,0.18);
}
.tut-section-card.completed {
  border-color: #2ea043;
  background: linear-gradient(135deg, #16241b 0%, #121a15 100%);
  box-shadow: 0 0 0 1px rgba(46,160,67,0.45), 0 6px 20px rgba(46,160,67,0.16);
}
.tut-section-card.completed:hover {
  border-color: #3fb950;
  box-shadow: 0 0 0 1px rgba(63,185,80,0.6), 0 10px 26px rgba(46,160,67,0.26);
}
.tut-section-card.completed::after {
  content: '✓ DONE';
  position: absolute; top: 9px; right: 9px;
  background: #2ea043; color: #fff;
  font-size: 0.6rem; font-weight: 800; letter-spacing: 1px;
  padding: 3px 8px; border-radius: 999px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.4);
}
.tut-section-card.completed .tut-section-name { color: #57d977; }
.tut-section-icon {
  font-size: 2rem; margin-bottom: 8px;
}
.tut-section-name {
  font-size: 0.92rem; font-weight: 800; letter-spacing: 2px;
  color: #e6edf3; margin-bottom: 10px; min-height: 2.4em;
}
.tut-section-skills {
  list-style: none; padding: 0; margin: 0;
  color: #8b949e; font-size: 0.8rem; line-height: 1.8;
}
.tut-section-skills li::before { content: '›  '; color: #f0c040; }
.tut-close-btn { margin-top: 4px; }

/* ── In-game tutorial overlay ──────────────────────────────────────────────── */
#tutorial-overlay {
  position: absolute; inset: 0;
  pointer-events: none; z-index: 60;
}
#tutorial-overlay.hidden { display: none; }

/* Steal zone legend (persistent top-left panel during steal steps) */
#tutorial-steal-legend {
  position: absolute; top: 52px; left: 14px;
  background: rgba(13,17,23,0.88);
  border: 1px solid rgba(255,135,185,0.4);
  border-radius: 10px; padding: 12px 16px 10px;
  pointer-events: none; min-width: 190px;
}
#tutorial-steal-legend.hidden { display: none; }
.steal-legend-title {
  color: #ff87b9; font-size: 0.65rem; font-weight: 800;
  letter-spacing: 3px; text-transform: uppercase; margin-bottom: 9px;
}
.steal-legend-item {
  display: flex; align-items: center; gap: 8px;
  color: #c9d1d9; font-size: 0.78rem; margin-bottom: 5px;
}
.steal-legend-dot {
  display: inline-block; width: 11px; height: 11px;
  border-radius: 50%; flex-shrink: 0; border: 2px solid;
}
.steal-dot-gold   { background: rgba(200,155,20,0.42); border-color: rgba(230,195,45,0.97); }
.steal-legend-cross {
  display: inline-block; width: 11px; height: 11px;
  flex-shrink: 0; position: relative;
}
.steal-legend-cross::before, .steal-legend-cross::after {
  content: ''; position: absolute;
}
.steal-cross-dark::before {
  width: 3px; height: 100%; left: 50%; top: 0;
  transform: translateX(-50%); background: #000;
  box-shadow: 0 0 0 1px rgba(255,255,255,0.95);
}
.steal-cross-dark::after {
  width: 100%; height: 3px; top: 50%; left: 0;
  transform: translateY(-50%); background: #000;
  box-shadow: 0 0 0 1px rgba(255,255,255,0.95);
}
.steal-dot-pink   { background: rgba(255,95,165,0.38); border-color: rgba(255,135,185,0.97); }
.steal-dot-green  { background: rgba(40,200,80,0.42);  border-color: rgba(60,230,100,0.98); }
.steal-legend-hint {
  color: #8b949e; font-size: 0.72rem; margin-top: 8px;
  padding-top: 7px; border-top: 1px solid rgba(255,255,255,0.08);
}
.steal-legend-hint b { color: #e6c840; }

/* Header bar */
#tutorial-header {
  position: absolute; top: 0; left: 0; right: 0;
  display: flex; align-items: center; justify-content: space-between;
  padding: 8px 16px;
  background: rgba(5,8,15,0.78);
  border-bottom: 1px solid rgba(240,192,64,0.25);
  pointer-events: auto;
}
#tutorial-section-label {
  color: #f0c040; font-size: 0.72rem; font-weight: 800;
  letter-spacing: 3px; text-transform: uppercase;
}
#tutorial-progress-dots {
  display: flex; gap: 7px; align-items: center;
}
.tut-dot {
  width: 9px; height: 9px; border-radius: 50%;
  background: rgba(255,255,255,0.18);
  transition: background 0.25s, transform 0.2s;
}
.tut-dot.done { background: #f0c040; }
.tut-dot.current {
  background: transparent;
  border: 2px solid #e6edf3;
  width: 10px; height: 10px;
}
.tut-exit-btn {
  background: rgba(200,50,50,0.18);
  border: 1px solid rgba(220,80,80,0.45);
  color: #e88; border-radius: 7px;
  padding: 7px 18px; font-size: 0.8rem; font-weight: 700;
  cursor: pointer; letter-spacing: 1.5px; text-transform: uppercase;
  transition: color 0.15s, border-color 0.15s, background 0.15s;
}
.tut-exit-btn:hover {
  color: #fdd; border-color: rgba(240,100,100,0.75);
  background: rgba(200,50,50,0.35);
}

/* Step panel — just below the header bar */
#tutorial-step-panel {
  position: absolute; top: 52px;
  left: 50%; transform: translateX(-50%);
  max-width: 520px; width: calc(100% - 48px);
  background: rgba(13,17,23,0.88);
  border: 1px solid rgba(240,192,64,0.45);
  border-radius: 12px; padding: 18px 22px 16px;
  pointer-events: none;
  box-shadow: 0 8px 32px rgba(0,0,0,0.6);
  transition: opacity 0.2s, transform 0.25s;
}
#tutorial-step-panel.tut-step-enter {
  animation: tutStepSlideDown 0.28s cubic-bezier(0.22,1,0.36,1) both;
}
@keyframes tutStepSlideDown {
  from { opacity:0; transform: translateX(-50%) translateY(-14px); }
  to   { opacity:1; transform: translateX(-50%) translateY(0); }
}
#tutorial-step-badge {
  display: inline-block; font-size: 0.6rem; font-weight: 800;
  letter-spacing: 2.5px; text-transform: uppercase;
  padding: 2px 9px; border-radius: 4px; margin-bottom: 8px;
}
#tutorial-step-badge.badge-learn {
  background: rgba(76,143,227,0.18); border: 1px solid rgba(76,143,227,0.5);
  color: #7ab0f5;
}
#tutorial-step-badge.badge-learn::before { content: '📖  LEARN'; }
#tutorial-step-badge.badge-task {
  background: rgba(240,192,64,0.12); border: 1px solid rgba(240,192,64,0.4);
  color: #f0c040;
}
#tutorial-step-badge.badge-task::before { content: '🎯  DO IT'; }
#tutorial-step-badge:empty { display: none; }
#tutorial-step-title {
  color: #f0c040; font-size: 0.88rem; font-weight: 800;
  letter-spacing: 3px; text-transform: uppercase; margin-bottom: 7px;
}
#tutorial-step-instruction {
  color: #e6edf3; font-size: 0.92rem; line-height: 1.6;
}
#tutorial-step-tip {
  color: #8b949e; font-size: 0.78rem; margin-top: 8px; line-height: 1.5;
  padding-top: 7px; border-top: 1px solid rgba(255,255,255,0.07);
}
#tutorial-step-tip:empty { display: none; }
#tutorial-step-progress {
  color: #f0c040; font-size: 0.82rem; font-weight: 700;
  letter-spacing: 2px; margin-top: 6px;
}
#tutorial-step-progress:empty { display: none; }
/* Auto-advance timer bar */
/* Hide scoreboard HUD during tutorial */
body.in-tutorial .hud-center,
body.in-tutorial #shot-clock-bar { display: none !important; }

#tutorial-timer-bar-wrap {
  margin-top: 12px; height: 3px; border-radius: 2px;
  background: rgba(255,255,255,0.1); overflow: hidden;
}
#tutorial-timer-bar-wrap.hidden { display: none; }
#tutorial-timer-bar {
  height: 100%; width: 0%; border-radius: 2px;
  background: linear-gradient(90deg, #4c8fe3, #f0c040);
  transition: none;
}
#tutorial-timer-bar.tut-timer-running {
  animation: tutTimerFill var(--tut-timer-dur, 8s) linear forwards;
}
@keyframes tutTimerFill {
  from { width: 0%; }
  to   { width: 100%; }
}
#tutorial-step-progress:empty { display: none; }

/* Flash message — centered pop-up for steal/check feedback */
#tutorial-flash {
  position: absolute; left: 50%; top: 38%;
  transform: translate(-50%, -50%);
  background: rgba(13,17,23,0.92);
  border: 2px solid #f0c040; border-radius: 14px;
  color: #f0c040; font-size: 1.35rem; font-weight: 800;
  letter-spacing: 2px; padding: 16px 36px;
  pointer-events: none; text-align: center;
  box-shadow: 0 0 40px rgba(240,192,64,0.25);
}
#tutorial-flash.hidden { display: none; }
#tutorial-flash.tut-flash-in {
  animation: tutFlashPop 1.8s ease-out forwards;
}
@keyframes tutFlashPop {
  0%   { opacity: 0; transform: translate(-50%, -50%) scale(0.85); }
  12%  { opacity: 1; transform: translate(-50%, -50%) scale(1.05); }
  25%  { opacity: 1; transform: translate(-50%, -50%) scale(1); }
  75%  { opacity: 1; }
  100% { opacity: 0; transform: translate(-50%, -50%) scale(1); }
}

/* Key badge */
.tut-key {
  display: inline-block;
  background: #1a2540; border: 1px solid #4c8fe3;
  color: #7ab0f5; border-radius: 5px;
  padding: 1px 7px; font-size: 0.78rem; font-weight: 700;
  font-family: monospace; letter-spacing: 0.5px;
  vertical-align: middle; line-height: 1.6;
  box-shadow: 0 1px 3px rgba(76,143,227,0.3);
}

/* Completion panel */
#tutorial-complete-panel {
  position: absolute; inset: 0;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  pointer-events: auto;
  background: rgba(5,8,15,0.72);
}
#tutorial-complete-panel.hidden { display: none; }
.tut-complete-inner {
  background: #161b22; border: 1px solid #30363d;
  border-radius: 16px; padding: 36px 40px 32px;
  text-align: center; max-width: 420px;
  box-shadow: 0 20px 50px rgba(0,0,0,0.7);
}
.tut-complete-icon {
  font-size: 3.2rem; color: #f0c040; margin-bottom: 8px;
  animation: tutCompleteIcon 0.5s cubic-bezier(0.22,1,0.36,1) both;
}
@keyframes tutCompleteIcon {
  from { transform: scale(0.4); opacity: 0; }
  to   { transform: scale(1); opacity: 1; }
}
.tut-complete-title {
  color: #e6edf3; font-size: 1.4rem; font-weight: 800;
  letter-spacing: 2px; margin-bottom: 18px;
}
.tut-complete-list {
  list-style: none; padding: 0; margin: 0 0 24px;
  text-align: left; display: inline-block;
}
.tut-complete-list li {
  color: #8b949e; font-size: 0.85rem; padding: 3px 0;
}
.tut-complete-list li::before { content: '✓  '; color: #f0c040; font-weight: 700; }
.tut-complete-actions {
  display: flex; flex-direction: column; gap: 10px;
}
.tut-action-btn { min-width: 220px; }

/* Target ring */
#tutorial-target-ring {
  position: absolute; width: 52px; height: 52px;
  border: 3px solid #f0c040; border-radius: 50%;
  pointer-events: none;
  transform: translate(-50%, -50%);
  animation: tutRingPulse 1.2s ease-in-out infinite;
}
#tutorial-target-ring.hidden { display: none; }
@keyframes tutRingPulse {
  0%,100% { opacity:0.9; transform: translate(-50%,-50%) scale(1); }
  50%      { opacity:0.4; transform: translate(-50%,-50%) scale(1.4); }
}

/* Arrow indicator */
#tutorial-arrow-indicator {
  position: absolute;
  pointer-events: none;
  font-size: 48px;
  line-height: 1;
  color: #1e7a34;
  text-shadow: 0 0 5px rgba(0,0,0,0.6), 0 0 2px rgba(0,0,0,0.8);
  animation: tutArrowPulse 0.8s ease-in-out infinite;
}
/* Stemmed arrow glyph (points right by default; JS rotates it toward the target). */
#tutorial-arrow-indicator::before { content: '\279C'; }
#tutorial-arrow-indicator.hidden { display: none; }
@keyframes tutArrowPulse {
  0%,100% { opacity:1; }
  50%      { opacity:0.45; }
}
