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

:root {
  --bg: #08090d;
  --bg-card: #12161e;
  --bg-hover: #1a2030;
  --bg-input: #0e1118;
  --gold: #c8a44a;
  --gold-light: #e8c86a;
  --radiant: #4a9e5c;
  --radiant-dim: #2a5e3c;
  --dire: #a03838;
  --dire-dim: #6e2020;
  --text: #d8d0c0;
  --text-dim: #888074;
  --text-muted: #666070;
  --correct: #3a9e5a;
  --wrong: #9e3838;
  --best: #c8a44a;
  --border: #ffffff18;
  --transition: 0.15s ease;
}

html, body {
  height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  font-size: 14px;
  line-height: 1.5;
}

#app {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* ===== Loading / Error Screens ===== */
.loading-screen,
.error-screen,
.final-screen {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  min-height: 100vh;
  text-align: center;
  padding: 32px;
}

.loading-title {
  font-size: 28px;
  font-weight: 800;
  letter-spacing: 4px;
  color: var(--gold);
  text-shadow: 0 0 30px #c8a44a55;
}

.error-title {
  font-size: 24px;
  font-weight: 700;
  color: var(--wrong);
}

.loading-screen p,
.error-screen p {
  color: var(--text-muted);
  font-size: 13px;
}

/* ===== Spinner ===== */
.spinner {
  width: 48px;
  height: 48px;
  border: 3px solid #ffffff18;
  border-top-color: var(--gold);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

.spinner-sm {
  width: 20px;
  height: 20px;
  border: 2px solid #ffffff18;
  border-top-color: var(--gold);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  flex-shrink: 0;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* ===== Game Container ===== */
.game-container {
  width: 100%;
  max-width: 1280px;
  padding: 0 16px 40px;
  display: flex;
  flex-direction: column;
  gap: 0;
}

/* ===== Header ===== */
.game-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  background: linear-gradient(180deg, #0e1118 0%, transparent 100%);
  position: sticky;
  top: 0;
  z-index: 10;
}

.game-title {
  font-size: 20px;
  font-weight: 800;
  letter-spacing: 4px;
  color: var(--gold);
  text-shadow: 0 0 20px #c8a44a44;
}

.header-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 80px;
}

.stat-label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-muted);
}

.stat-value {
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
}

/* ===== Bracket Badge ===== */
.bracket-badge {
  text-align: center;
  padding: 6px;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: var(--gold);
  opacity: 0.7;
  border-bottom: 1px solid var(--border);
}

/* ===== Draft Board ===== */
.draft-board {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 0;
  padding: 20px 0;
  border-bottom: 1px solid var(--border);
  align-items: start;
}

.team-block {
  padding: 0 12px;
}

.team-label {
  font-size: 10px;
  letter-spacing: 2px;
  font-weight: 700;
  margin-bottom: 12px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--border);
}

.radiant-label { color: var(--radiant); }
.dire-label { color: var(--dire); }

.team-heroes {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

/* ===== Draft Hero Portrait ===== */
.draft-hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  width: 76px;
}

.draft-hero img {
  width: 76px;
  height: 48px;
  object-fit: cover;
  object-position: center top;
  border-radius: 4px;
  display: block;
}

.ally-hero img   { border: 2px solid var(--radiant-dim); }
.enemy-hero img  { border: 2px solid var(--dire-dim); }

.draft-hero-name {
  font-size: 9px;
  text-align: center;
  color: var(--text-muted);
  max-width: 76px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  letter-spacing: 0.3px;
}

/* ===== My Slot ===== */
.my-slot {
  width: 76px;
}

.slot-empty img,
.slot-empty {
  border: 2px dashed var(--gold) !important;
  border-radius: 4px;
  background: #c8a44a12;
}

.slot-question {
  width: 76px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  font-weight: 900;
  color: var(--gold);
}

.slot-filled img { border: 2px solid var(--gold) !important; }

/* ===== VS Divider ===== */
.vs-divider {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 16px;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 2px;
  color: var(--text-muted);
  padding-top: 28px;
}

/* ===== Candidates Section ===== */
.candidates-section {
  padding: 24px 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}

.candidates-prompt {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 3px;
  color: var(--text-muted);
}

.loading-matchups {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text-muted);
  font-size: 13px;
  padding: 32px 0;
}

/* ===== Candidates Grid ===== */
.candidates-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  width: 100%;
  max-width: 900px;
}

/* ===== Candidate Card ===== */
.candidate-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  transition: transform var(--transition), border-color var(--transition), box-shadow var(--transition);
  user-select: none;
}

.card-pickable {
  cursor: pointer;
}

.card-pickable:hover {
  transform: translateY(-4px);
  border-color: var(--gold);
  box-shadow: 0 8px 24px #c8a44a22;
  background: var(--bg-hover);
}

.card-pickable:hover .cand-img-wrap img {
  filter: brightness(1.15);
}

.card-correct {
  border-color: var(--correct);
  box-shadow: 0 0 20px #3a9e5a33;
  background: #3a9e5a0a;
}

.card-best {
  border-color: var(--gold);
  box-shadow: 0 0 20px #c8a44a33;
  background: #c8a44a08;
}

.card-wrong {
  border-color: var(--wrong);
  background: #9e38380a;
  opacity: 0.85;
}

.card-neutral {
  opacity: 0.55;
}

/* ===== Candidate Image ===== */
.cand-img-wrap {
  position: relative;
  width: 100%;
  padding-top: 56.25%;
  overflow: hidden;
}

.cand-img-wrap img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
  display: block;
}

.badge-best,
.badge-correct,
.badge-wrong {
  position: absolute;
  top: 6px;
  right: 6px;
  padding: 2px 7px;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 1px;
}

.badge-best    { background: var(--gold);    color: #1a1200; }
.badge-correct { background: var(--correct); color: #fff; }
.badge-wrong   { background: var(--wrong);   color: #fff; font-size: 14px; }

/* ===== Candidate Body ===== */
.cand-body {
  padding: 10px 12px 12px;
}

.cand-name {
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cand-base-wr {
  font-size: 11px;
  color: var(--text-muted);
}

/* ===== Score Breakdown ===== */
.score-breakdown {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-top: 6px;
}

.score-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 11px;
  color: var(--text-muted);
}

.score-total {
  font-weight: 700;
  color: var(--text);
  border-top: 1px solid var(--border);
  padding-top: 4px;
  margin-top: 2px;
}

.pos { color: #5ec87a; }
.neg { color: #e06060; }

/* ===== Win Rate Bar ===== */
.score-bar-bg {
  height: 4px;
  background: #ffffff12;
  border-radius: 2px;
  margin-top: 6px;
  overflow: hidden;
}

.score-bar-fill {
  height: 100%;
  border-radius: 2px;
  transition: width 0.4s ease;
}

.bar-best   { background: var(--gold); }
.bar-normal { background: #4466aa; }

/* ===== Result Banner ===== */
.result-banner {
  width: 100%;
  max-width: 900px;
  padding: 12px 20px;
  border-radius: 6px;
  text-align: center;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.5px;
}

.banner-correct {
  background: #3a9e5a20;
  border: 1px solid var(--correct);
  color: #7ed0a0;
}

.banner-wrong {
  background: #9e383820;
  border: 1px solid var(--wrong);
  color: #e08080;
}

/* ===== Action Button ===== */
.btn-action {
  padding: 12px 36px;
  background: var(--gold);
  color: #1a1200;
  border: none;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 800;
  letter-spacing: 1px;
  cursor: pointer;
  text-transform: uppercase;
  transition: background var(--transition), transform var(--transition);
}

.btn-action:hover {
  background: var(--gold-light);
  transform: translateY(-2px);
}

.btn-action:active {
  transform: translateY(0);
}

/* ===== Final Screen ===== */
.final-title {
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 4px;
  color: var(--text-muted);
}

.final-score {
  font-size: 80px;
  font-weight: 900;
  color: var(--gold);
  line-height: 1;
  text-shadow: 0 0 40px #c8a44a55;
}

.final-sub {
  font-size: 14px;
  color: var(--text-muted);
}

.final-msg {
  font-size: 16px;
  font-weight: 600;
  color: var(--text);
  max-width: 320px;
  text-align: center;
}

.final-pts {
  font-size: 13px;
  color: var(--text-muted);
}

/* ===== Name modal ===== */
.name-modal {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 28px 32px;
  min-width: 280px;
}

.name-modal-title {
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: var(--text-muted);
}

.name-input {
  width: 100%;
  text-align: center;
  font-size: 16px !important;
}

/* ===== Mode selector ===== */
.mode-selector { gap: 24px; }

.mode-player-name {
  font-size: 13px;
  color: var(--text-muted);
}

.mode-player-name strong { color: var(--text); }

.mode-cards {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
  justify-content: center;
}

.mode-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 28px 36px;
  cursor: pointer;
  transition: border-color var(--transition), transform var(--transition), box-shadow var(--transition);
  min-width: 180px;
}

.mode-card:hover {
  border-color: var(--gold);
  transform: translateY(-4px);
  box-shadow: 0 8px 28px #c8a44a22;
}

.mode-card-icon {
  font-size: 32px;
  color: var(--gold);
  line-height: 1;
}

.mode-card-title {
  font-size: 16px;
  font-weight: 800;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--text);
}

.mode-card-desc {
  font-size: 12px;
  color: var(--text-muted);
  text-align: center;
  max-width: 160px;
}

/* ===== VS shared ===== */
.vs-wrap {
  width: 100%;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.vs-center {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  min-height: 100vh;
  text-align: center;
  padding: 32px;
}

.vs-error {
  color: var(--wrong);
  font-size: 14px;
}

.vs-input {
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text);
  font-size: 14px;
  padding: 9px 14px;
  outline: none;
  transition: border-color var(--transition);
  width: 100%;
}

.vs-input:focus { border-color: var(--gold); }

.vs-input-code {
  text-transform: uppercase;
  letter-spacing: 4px;
  font-size: 20px !important;
  text-align: center;
  max-width: 160px;
}

.vs-input-link {
  font-size: 11px !important;
  color: var(--text-muted);
  cursor: text;
}

.btn-secondary {
  padding: 9px 24px;
  background: transparent;
  color: var(--text-muted);
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  letter-spacing: 0.5px;
  transition: border-color var(--transition), color var(--transition);
}

.btn-secondary:hover { border-color: var(--text-muted); color: var(--text); }

.btn-exit {
  background: none; border: none; color: var(--text-muted);
  font-size: 11px; letter-spacing: 1px; text-transform: uppercase;
  cursor: pointer; padding: 0; display: block; margin-bottom: 4px;
}
.btn-exit:hover { color: var(--gold); }

/* ===== VS Lobby setup ===== */
.vs-lobby-setup {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 24px;
  padding: 40px 16px;
  width: 100%;
  max-width: 700px;
}

.vs-title {
  font-size: 22px;
  font-weight: 800;
  letter-spacing: 4px;
  color: var(--gold);
  text-shadow: 0 0 20px #c8a44a44;
}

.vs-setup-options {
  display: flex;
  align-items: flex-start;
  gap: 20px;
  flex-wrap: wrap;
  justify-content: center;
  width: 100%;
}

.vs-or {
  padding: 40px 8px 0;
  font-size: 11px;
  letter-spacing: 2px;
  color: var(--text-muted);
  font-weight: 700;
}

.vs-panel {
  display: flex;
  flex-direction: column;
  gap: 12px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 24px;
  min-width: 220px;
}

.vs-panel-title {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: var(--gold);
  font-weight: 700;
  margin-bottom: 4px;
}

.vs-label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-muted);
}

/* ===== VS Lobby room ===== */
.vs-lobby {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
  padding: 40px 16px;
  width: 100%;
  max-width: 480px;
}

.vs-room-code {
  font-size: 13px;
  color: var(--text-muted);
}

.vs-code {
  font-size: 20px;
  font-weight: 800;
  letter-spacing: 4px;
  color: var(--gold);
}

.vs-invite {
  display: flex;
  gap: 8px;
  align-items: center;
  width: 100%;
}

.vs-invite .vs-input { flex: 1; }

.vs-player-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  width: 100%;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px;
  min-height: 80px;
}

.vs-player-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  border-radius: 5px;
}

.vs-player-row.vs-me { background: #c8a44a0e; }

.vs-player-name { font-size: 14px; color: var(--text); flex: 1; }

.vs-host-badge, .vs-you-badge {
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 1px;
  padding: 2px 6px;
  border-radius: 3px;
}

.vs-host-badge { background: var(--gold); color: #1a1200; }
.vs-you-badge  { background: #4466aa; color: #fff; }

.vs-lobby-meta {
  font-size: 11px;
  color: var(--text-muted);
  letter-spacing: 0.5px;
}

.vs-waiting {
  font-size: 13px;
  color: var(--text-muted);
  font-style: italic;
}

/* ===== VS Round ===== */
.vs-timer {
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
  transition: color 0.3s;
}

.vs-timer-urgent { color: #e06060; }

.vs-round-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
}

.vs-picked-info {
  font-size: 11px;
  color: var(--text-muted);
  letter-spacing: 1px;
}

/* ===== Hero search ===== */
.vs-search-bar { width: 100%; }

.vs-search-input {
  width: 280px !important;
  font-size: 13px !important;
}

/* ===== Hero grid — 4 column Dota layout ===== */
.vs-hero-grid-wrapper {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  width: 100%;
  align-items: start;
}

.attr-section { display: flex; flex-direction: column; gap: 5px; }

.attr-section-label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 2px;
  padding-bottom: 5px;
  border-bottom-width: 1px;
  border-bottom-style: solid;
}

.attr-str { color: #d06060; border-bottom-color: #d0606050; }
.attr-agi { color: #50c870; border-bottom-color: #50c87050; }
.attr-int { color: #5090e0; border-bottom-color: #5090e050; }
.attr-all { color: #b060d8; border-bottom-color: #b060d850; }

/* Attribute icons */
.attr-icon {
  display: inline-block;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  flex-shrink: 0;
}
.attr-icon-str { background: #d06060; box-shadow: 0 0 6px #d0606088; }
.attr-icon-agi { background: #50c870; box-shadow: 0 0 6px #50c87088; }
.attr-icon-int { background: #5090e0; box-shadow: 0 0 6px #5090e088; }
.attr-icon-all { background: linear-gradient(135deg, #d06060, #50c870, #5090e0, #b060d8); }

.attr-heroes-row {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 3px;
}

/* ===== Hero pick card ===== */
.vs-pick-card {
  border: 2px solid transparent;
  border-radius: 3px;
  overflow: hidden;
  cursor: pointer;
  user-select: none;
  transition: border-color 0.1s, filter 0.15s, box-shadow 0.1s;
  position: relative;
}

.vs-pick-card img {
  width: 100%;
  aspect-ratio: 235 / 272;
  object-fit: cover;
  object-position: center top;
  display: block;
}

.vs-pick-card.card-pickable:hover {
  border-color: var(--gold);
  box-shadow: 0 0 10px #c8a44a55;
  z-index: 1;
}

.vs-pick-card.vs-pick-selected {
  border-color: var(--gold);
  box-shadow: 0 0 16px #c8a44a88;
}

.vs-pick-card.vs-pick-faded { opacity: 0.3; }

.vs-pick-card.vs-pick-dimmed {
  filter: grayscale(100%) brightness(0.45);
}

/* Tooltip-style name on hover via ::after */
.vs-pick-card:hover::after {
  content: attr(title);
  position: absolute;
  bottom: calc(100% + 4px);
  left: 50%;
  transform: translateX(-50%);
  background: #0e1118ee;
  color: var(--text);
  font-size: 10px;
  font-weight: 600;
  white-space: nowrap;
  padding: 3px 7px;
  border-radius: 4px;
  border: 1px solid var(--border);
  pointer-events: none;
  z-index: 10;
  letter-spacing: 0.3px;
}

/* ===== Scoreboard mini ===== */
.vs-scoreboard-mini {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  padding: 12px 0 0;
  justify-content: center;
  width: 100%;
  border-top: 1px solid var(--border);
  margin-top: 8px;
}

.vs-score-row {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 4px 10px;
  font-size: 12px;
}

.vs-score-row.vs-me { border-color: var(--gold); background: #c8a44a0a; }
.vs-score-name { color: var(--text-muted); }
.vs-score-pts  { font-weight: 700; color: var(--text); }

/* ===== Round verdict ===== */
.vs-round-verdict {
  width: 100%;
  padding: 10px 16px;
  border-radius: 6px;
  text-align: center;
  font-size: 13px;
  font-weight: 600;
  background: var(--bg-card);
  border: 1px solid var(--border);
}

.vs-verdict-correct { color: #7ed0a0; }
.vs-verdict-wrong   { color: var(--text-muted); }

/* ===== VS Round end ===== */
.vs-best-hero {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 20px;
  background: #c8a44a0a;
  border: 1px solid var(--gold);
  border-radius: 8px;
  margin: 16px 0 0;
}

.vs-best-label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: var(--gold);
  font-weight: 700;
}

.vs-best-img {
  width: 60px;
  height: 38px;
  object-fit: cover;
  object-position: center top;
  border-radius: 4px;
  border: 1px solid var(--gold);
}

.vs-best-name {
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
}

.vs-best-score {
  font-size: 12px;
  color: var(--text-muted);
  margin-left: auto;
}

.vs-results-table {
  width: 100%;
  max-width: 900px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  margin-top: 16px;
}

.vs-results-header {
  display: grid;
  grid-template-columns: 24px 1fr 1.6fr 64px 68px 68px 64px 48px 52px;
  gap: 10px;
  padding: 10px 16px;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
  background: #ffffff05;
}

.vs-results-row {
  display: grid;
  grid-template-columns: 24px 1fr 1.6fr 64px 68px 68px 64px 48px 52px;
  gap: 10px;
  padding: 10px 16px;
  align-items: center;
  font-size: 13px;
  border-bottom: 1px solid var(--border);
  transition: background var(--transition);
}

.vs-results-row:last-child { border-bottom: none; }
.vs-results-row.vs-me { background: #c8a44a08; }
.vs-results-row.vs-first { background: #3a9e5a0a; }

.vs-res-rank  { font-size: 11px; color: var(--text-muted); font-weight: 700; }
.vs-res-name  { font-weight: 600; color: var(--text); }
.vs-res-hero  {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--text-muted);
  font-size: 12px;
}
.vs-res-hero-img {
  width: 36px;
  height: 23px;
  object-fit: cover;
  object-position: center top;
  border-radius: 3px;
}
.vs-res-score { font-size: 11px; color: var(--text-muted); font-variant-numeric: tabular-nums; }
.vs-res-bonus { font-size: 11px; font-variant-numeric: tabular-nums; }
.vs-res-delta { font-size: 11px; font-weight: 700; font-variant-numeric: tabular-nums; }
.vs-res-pts   { font-weight: 700; font-size: 14px; }
.vs-res-total { font-size: 13px; color: var(--text-muted); font-weight: 600; }

/* ===== VS Final / leaderboard ===== */
.vs-final { gap: 20px; }

.vs-winner-block {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.vs-winner-crown {
  font-size: 36px;
  color: var(--gold);
  text-shadow: 0 0 20px #c8a44a88;
}

.vs-winner-name {
  font-size: 24px;
  font-weight: 800;
  color: var(--text);
}

.vs-winner-score {
  font-size: 14px;
  color: var(--text-muted);
}

.vs-you-won {
  font-size: 16px;
  font-weight: 700;
  color: var(--correct);
  letter-spacing: 1px;
}

.vs-leaderboard {
  display: flex;
  flex-direction: column;
  gap: 0;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  width: 100%;
  max-width: 400px;
}

.vs-lb-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 16px;
  border-bottom: 1px solid var(--border);
  font-size: 14px;
}

.vs-lb-row:last-child { border-bottom: none; }
.vs-lb-row.vs-me { background: #c8a44a0a; }

.vs-lb-rank {
  font-size: 11px;
  font-weight: 800;
  color: var(--text-muted);
  min-width: 20px;
}

.vs-lb-name { flex: 1; font-weight: 600; color: var(--text); }
.vs-lb-score { font-weight: 700; color: var(--gold); }

/* ===== Responsive ===== */
@media (max-width: 900px) {
  .draft-board {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .vs-divider {
    display: none;
  }

  .candidates-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .game-title {
    font-size: 14px;
    letter-spacing: 2px;
  }
}

@media (max-width: 500px) {
  .team-heroes { gap: 4px; }
  .draft-hero  { width: 60px; }
  .draft-hero img { width: 60px; height: 38px; }
  .slot-question { width: 60px; height: 38px; }
}

/* ===== CM (Captain's Mode 1v1) ===== */
.cm-tagline {
  color: var(--text-muted);
  font-size: 13px;
  margin: -6px 0 12px;
}
.cm-panel-hint {
  color: var(--text-muted);
  font-size: 12px;
  margin: 4px 0 12px;
}

.cm-board {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 0;
  padding: 20px 0;
  border-bottom: 1px solid var(--border);
  align-items: start;
}

.cm-team-block { padding: 0 12px; }
.cm-team-mine .cm-team-label::after {
  content: '';
  display: inline-block;
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--gold);
  margin-left: 8px;
  vertical-align: middle;
}

.cm-team-label {
  font-size: 10px;
  letter-spacing: 2px;
  font-weight: 700;
  margin-bottom: 12px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--border);
}
.cm-label-radiant { color: var(--radiant); }
.cm-label-dire    { color: var(--dire); }

.cm-team-slots {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.cm-team-slot {
  width: 76px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}
.cm-team-slot img {
  width: 76px;
  height: 48px;
  object-fit: cover;
  object-position: center top;
  border-radius: 4px;
  display: block;
}
.cm-team-radiant .cm-slot-filled img { border: 2px solid var(--radiant-dim); }
.cm-team-dire    .cm-slot-filled img { border: 2px solid var(--dire-dim); }

.cm-slot-empty {
  border: 2px dashed var(--border);
  border-radius: 4px;
  width: 76px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #ffffff04;
}
.cm-slot-empty .slot-question {
  color: var(--text-muted);
  font-size: 22px;
}

.cm-turn-active {
  color: var(--gold);
  text-shadow: 0 0 8px #c8a44a55;
}

/* End screen */
.cm-end-verdict {
  padding: 14px 18px;
  border-radius: 6px;
  text-align: center;
  font-weight: 600;
  font-size: 14px;
  letter-spacing: 0.3px;
  margin: 8px 0 4px;
}

.cm-end-board {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  padding: 16px 0;
}
.cm-end-team {
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--bg-card);
}
.cm-end-winner {
  border-color: var(--gold);
  box-shadow: 0 0 0 1px #c8a44a44 inset;
}
.cm-end-heroes {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}
.cm-end-hero {
  width: 70px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
}
.cm-end-hero img {
  width: 70px;
  height: 44px;
  object-fit: cover;
  object-position: center top;
  border-radius: 3px;
}

.cm-score-table {
  max-width: 720px;
  margin: 12px auto 0;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 6px 0;
}
.cm-score-row {
  display: grid;
  grid-template-columns: 1fr 120px 1fr;
  align-items: center;
  padding: 8px 16px;
  font-variant-numeric: tabular-nums;
  font-size: 13px;
}
.cm-score-row + .cm-score-row { border-top: 1px solid var(--border); }
.cm-score-side {
  text-align: center;
  color: var(--text-muted);
}
.cm-side-win {
  color: var(--gold);
  font-weight: 700;
}
.cm-score-label {
  text-align: center;
  text-transform: uppercase;
  letter-spacing: 1px;
  font-size: 10px;
  color: var(--text-muted);
}
.cm-score-total {
  font-size: 15px;
  font-weight: 700;
}
.cm-score-total .cm-score-side { color: var(--text); }
.cm-score-total .cm-side-win  { color: var(--gold); }
.cm-score-total .cm-score-label { font-size: 11px; }

.cm-rematch {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  margin-top: 16px;
}
.cm-rematch-status {
  font-size: 12px;
  color: var(--text-muted);
  min-height: 16px;
}

@media (max-width: 700px) {
  .cm-board { grid-template-columns: 1fr; }
  .cm-end-board { grid-template-columns: 1fr; }
}
