/* EloTracker World Chess Championship Hubs — world-champ-v1.css */
.wch-page {
  max-width: 1180px;
  margin: 0 auto;
  padding: 1.25rem 1rem 3rem;
  color: #0f172a;
}
.dark .wch-page { color: #f1f5f9; }

.wch-topbar {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1rem;
  font-size: 0.85rem;
  color: #64748b;
}
.dark .wch-topbar { color: #94a3b8; }
.wch-breadcrumb {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem;
}
.wch-breadcrumb a {
  color: #2563eb;
  text-decoration: none;
  font-weight: 500;
}
.dark .wch-breadcrumb a { color: #60a5fa; }
.wch-breadcrumb a:hover { text-decoration: underline; }

.wch-cycle-nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem;
}
.wch-nav-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.32rem 0.72rem;
  border-radius: 999px;
  border: 1px solid #cbd5e1;
  background: #ffffff;
  color: #1e293b;
  font-size: 0.8rem;
  font-weight: 600;
  text-decoration: none;
  transition: background 0.15s, border-color 0.15s;
}
.dark .wch-nav-pill {
  background: #1e293b;
  border-color: #334155;
  color: #e2e8f0;
}
.wch-nav-pill:hover {
  border-color: #2563eb;
  color: #2563eb;
}
.dark .wch-nav-pill:hover {
  border-color: #60a5fa;
  color: #93c5fd;
}

/* Status pills */
.wch-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.25rem 0.65rem;
  border-radius: 999px;
  font-size: 0.73rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}
.wch-pill-live {
  background: rgba(16, 185, 129, 0.15);
  color: #047857;
  border: 1px solid rgba(16, 185, 129, 0.38);
}
.dark .wch-pill-live {
  background: rgba(16, 185, 129, 0.2);
  color: #34d399;
}
.wch-pill-ongoing {
  background: rgba(37, 99, 235, 0.12);
  color: #1d4ed8;
  border: 1px solid rgba(37, 99, 235, 0.3);
}
.dark .wch-pill-ongoing {
  background: rgba(59, 130, 246, 0.18);
  color: #93c5fd;
}
.wch-pill-upcoming {
  background: rgba(245, 158, 11, 0.14);
  color: #b45309;
  border: 1px solid rgba(245, 158, 11, 0.32);
}
.dark .wch-pill-upcoming {
  background: rgba(245, 158, 11, 0.18);
  color: #fbbf24;
}
.wch-pill-era {
  background: #f1f5f9;
  color: #475569;
  border: 1px solid #cbd5e1;
}
.dark .wch-pill-era {
  background: #1e293b;
  color: #cbd5e1;
  border-color: #334155;
}
.wch-pill-gold {
  background: rgba(234, 179, 8, 0.16);
  color: #a16207;
  border: 1px solid rgba(234, 179, 8, 0.38);
}
.dark .wch-pill-gold {
  background: rgba(234, 179, 8, 0.18);
  color: #fde047;
}
.wch-live-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #10b981;
  display: inline-block;
  box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7);
  animation: wchPulse 1.6s infinite;
}
@keyframes wchPulse {
  0% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.65); }
  70% { box-shadow: 0 0 0 7px rgba(16, 185, 129, 0); }
  100% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

/* Hero card */
.wch-hero {
  background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
  border: 1px solid #dbe3eb;
  border-radius: 16px;
  padding: 1.5rem 1.6rem;
  margin-bottom: 1.25rem;
  box-shadow: 0 4px 20px rgba(15, 23, 42, 0.04);
}
.dark .wch-hero {
  background: linear-gradient(135deg, #1e293b 0%, #111827 100%);
  border-color: #334155;
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.25);
}
.wch-hero-live {
  border-color: rgba(16, 185, 129, 0.45);
}
.wch-hero-head {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  margin-bottom: 1rem;
}
.wch-hero-badges {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem;
  margin-bottom: 0.5rem;
}
.wch-title {
  font-size: clamp(1.45rem, 2.8vw, 2.05rem);
  font-weight: 800;
  line-height: 1.2;
  letter-spacing: -0.02em;
  margin: 0 0 0.35rem;
}
.wch-subtitle {
  font-size: 0.92rem;
  color: #475569;
  margin: 0;
  line-height: 1.5;
}
.dark .wch-subtitle { color: #94a3b8; }

.wch-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
}
.wch-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.55rem 1rem;
  border-radius: 10px;
  font-size: 0.86rem;
  font-weight: 600;
  text-decoration: none;
  border: 1px solid #cbd5e1;
  background: #ffffff;
  color: #0f172a;
  cursor: pointer;
  transition: transform 0.12s, background 0.15s, border-color 0.15s;
}
.dark .wch-btn {
  background: #0f172a;
  border-color: #334155;
  color: #f1f5f9;
}
.wch-btn:hover {
  border-color: #2563eb;
  color: #2563eb;
}
.dark .wch-btn:hover {
  border-color: #60a5fa;
  color: #93c5fd;
}
.wch-btn-primary {
  background: #059669;
  border-color: #059669;
  color: #ffffff;
}
.wch-btn-primary:hover {
  background: #047857;
  border-color: #047857;
  color: #ffffff;
}
.wch-btn-blue {
  background: #2563eb;
  border-color: #2563eb;
  color: #ffffff;
}
.wch-btn-blue:hover {
  background: #1d4ed8;
  border-color: #1d4ed8;
  color: #ffffff;
}

/* Scoreboard */
.wch-scoreboard {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  gap: 1rem;
  align-items: center;
  margin-top: 0.9rem;
  padding: 1rem 1.15rem;
  border-radius: 14px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
}
.dark .wch-scoreboard {
  background: rgba(15, 23, 42, 0.7);
  border-color: #334155;
}
.wch-player-card {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  min-width: 0;
}
.wch-player-card.is-right {
  text-align: right;
  align-items: flex-end;
}
.wch-player-name-row {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  flex-wrap: wrap;
}
.wch-player-card.is-right .wch-player-name-row {
  justify-content: flex-end;
}
.wch-player-name {
  font-size: 1.15rem;
  font-weight: 800;
  color: inherit;
  text-decoration: none;
}
.wch-player-name:hover {
  color: #2563eb;
  text-decoration: underline;
}
.dark .wch-player-name:hover { color: #60a5fa; }
.wch-player-meta {
  font-size: 0.8rem;
  color: #64748b;
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  align-items: center;
}
.dark .wch-player-meta { color: #94a3b8; }
.wch-player-card.is-right .wch-player-meta {
  justify-content: flex-end;
}
.wch-winner-crown {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.14rem 0.5rem;
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 700;
  background: rgba(234, 179, 8, 0.2);
  color: #a16207;
}
.dark .wch-winner-crown {
  background: rgba(234, 179, 8, 0.22);
  color: #fde047;
}
.wch-score-center {
  text-align: center;
  padding: 0.45rem 1rem;
  border-radius: 12px;
  background: #ffffff;
  border: 1px solid #dbe3eb;
  min-width: 112px;
}
.dark .wch-score-center {
  background: #1e293b;
  border-color: #475569;
}
.wch-score-big {
  font-size: 1.65rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  line-height: 1.15;
  white-space: nowrap;
}
.wch-score-sub {
  font-size: 0.74rem;
  color: #64748b;
  margin-top: 0.15rem;
}
.dark .wch-score-sub { color: #94a3b8; }

/* Round progression strip */
.wch-prog-strip {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem;
  margin-top: 0.9rem;
}
.wch-prog-label {
  font-size: 0.76rem;
  font-weight: 600;
  color: #64748b;
  margin-right: 0.25rem;
}
.dark .wch-prog-label { color: #94a3b8; }
.wch-rd-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 30px;
  height: 26px;
  padding: 0 0.4rem;
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  text-decoration: none;
  border: 1px solid transparent;
  transition: transform 0.1s;
}
.wch-rd-chip:hover { transform: translateY(-1px); }
.wch-rd-win { background: rgba(16, 185, 129, 0.18); color: #047857; border-color: rgba(16, 185, 129, 0.35); }
.dark .wch-rd-win { background: rgba(16, 185, 129, 0.22); color: #34d399; }
.wch-rd-loss { background: rgba(239, 68, 68, 0.14); color: #b91c1c; border-color: rgba(239, 68, 68, 0.3); }
.dark .wch-rd-loss { background: rgba(239, 68, 68, 0.2); color: #fca5a5; }
.wch-rd-draw { background: #e2e8f0; color: #334155; border-color: #cbd5e1; }
.dark .wch-rd-draw { background: #334155; color: #cbd5e1; border-color: #475569; }
.wch-rd-live { background: #059669; color: #ffffff; border-color: #047857; }
.wch-rd-empty { background: transparent; color: #94a3b8; border-color: #cbd5e1; border-style: dashed; }
.dark .wch-rd-empty { border-color: #475569; color: #64748b; }

/* Live Stage (embedded pure-CSS board + eval + live panel) */
.wch-live-stage {
  display: grid;
  grid-template-columns: minmax(0, 410px) minmax(0, 1fr);
  gap: 1.25rem;
  align-items: start;
  background: #ffffff;
  border: 1px solid rgba(16, 185, 129, 0.42);
  border-radius: 16px;
  padding: 1.25rem;
  margin-bottom: 1.25rem;
}
.dark .wch-live-stage {
  background: #1e293b;
  border-color: rgba(16, 185, 129, 0.4);
}
.wch-board-wrap {
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr);
  gap: 8px;
  align-items: stretch;
  max-width: 396px;
  width: 100%;
  margin: 0 auto;
}
.wch-eval-bar {
  position: relative;
  border-radius: 6px;
  overflow: hidden;
  background: #1e293b;
  border: 1px solid #475569;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
}
.wch-eval-fill {
  width: 100%;
  background: #f8fafc;
  transition: height 0.45s ease;
  height: 50%;
}
.wch-eval-label {
  position: absolute;
  left: 0;
  right: 0;
  text-align: center;
  font-size: 0.62rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  padding: 3px 1px;
  z-index: 2;
  color: #f8fafc;
  top: 2px;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.7);
}
.wch-eval-label.is-white-adv {
  top: auto;
  bottom: 2px;
  color: #0f172a;
  text-shadow: none;
}
.wch-board-col {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}
.wch-board-mount {
  width: 100%;
  aspect-ratio: 1 / 1;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid #cbd5e1;
}
.dark .wch-board-mount { border-color: #475569; }
.wch-clock-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
  padding: 0.35rem 0.65rem;
  border-radius: 8px;
  background: #f1f5f9;
  font-size: 0.84rem;
  font-weight: 600;
}
.dark .wch-clock-bar { background: #0f172a; }
.wch-clock-bar.is-turn {
  box-shadow: inset 0 0 0 1.5px #10b981;
}
.wch-clock-time {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  padding: 0.12rem 0.45rem;
  border-radius: 5px;
  background: #ffffff;
  color: #0f172a;
}
.dark .wch-clock-time {
  background: #1e293b;
  color: #f8fafc;
}
.wch-live-side {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  min-width: 0;
}
.wch-wdl-bar {
  display: flex;
  height: 10px;
  border-radius: 999px;
  overflow: hidden;
  background: #e2e8f0;
  border: 1px solid #cbd5e1;
}
.dark .wch-wdl-bar { border-color: #475569; }
.wch-wdl-w { background: #f8fafc; }
.wch-wdl-d { background: #94a3b8; }
.wch-wdl-b { background: #1e293b; }
.wch-wdl-legend {
  display: flex;
  justify-content: space-between;
  font-size: 0.76rem;
  color: #64748b;
  font-variant-numeric: tabular-nums;
}
.dark .wch-wdl-legend { color: #94a3b8; }
.wch-live-moves {
  max-height: 170px;
  overflow-y: auto;
  padding: 0.65rem 0.8rem;
  border-radius: 10px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.8rem;
  line-height: 1.65;
  color: #1e293b;
}
.dark .wch-live-moves {
  background: #0f172a;
  border-color: #334155;
  color: #e2e8f0;
}

/* KPI Grid */
.wch-kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.85rem;
  margin-bottom: 1.25rem;
}
.wch-kpi {
  background: #ffffff;
  border: 1px solid #dbe3eb;
  border-radius: 12px;
  padding: 0.9rem 1rem;
}
.dark .wch-kpi {
  background: #1e293b;
  border-color: #334155;
}
.wch-kpi-label {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #64748b;
}
.dark .wch-kpi-label { color: #94a3b8; }
.wch-kpi-val {
  font-size: 1.45rem;
  font-weight: 800;
  margin-top: 0.25rem;
  font-variant-numeric: tabular-nums;
}
.wch-kpi-sub {
  font-size: 0.78rem;
  color: #64748b;
  margin-top: 0.15rem;
}
.dark .wch-kpi-sub { color: #94a3b8; }

/* Sections & Cards */
.wch-card {
  background: #ffffff;
  border: 1px solid #dbe3eb;
  border-radius: 14px;
  padding: 1.2rem 1.35rem;
  margin-bottom: 1.25rem;
}
.dark .wch-card {
  background: #1e293b;
  border-color: #334155;
}
.wch-card-head {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.9rem;
}
.wch-card-title {
  font-size: 1.08rem;
  font-weight: 800;
  margin: 0;
}
.wch-2col {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.1rem;
  margin-bottom: 1.25rem;
}

/* Filter bar & tabs */
.wch-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}
.wch-tab {
  padding: 0.36rem 0.78rem;
  border-radius: 8px;
  border: 1px solid #cbd5e1;
  background: transparent;
  color: #475569;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
}
.dark .wch-tab {
  border-color: #475569;
  color: #cbd5e1;
}
.wch-tab.is-active {
  background: #2563eb;
  border-color: #2563eb;
  color: #ffffff;
}
.wch-search-input {
  padding: 0.42rem 0.75rem;
  border-radius: 8px;
  border: 1px solid #cbd5e1;
  background: #f8fafc;
  color: #0f172a;
  font-size: 0.85rem;
  min-width: 210px;
}
.dark .wch-search-input {
  background: #0f172a;
  border-color: #475569;
  color: #f1f5f9;
}

/* Tables */
.wch-table-wrap {
  overflow-x: auto;
}
.wch-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
}
.wch-table th {
  text-align: left;
  padding: 0.6rem 0.65rem;
  font-size: 0.73rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #64748b;
  border-bottom: 1px solid #e2e8f0;
  white-space: nowrap;
}
.dark .wch-table th {
  color: #94a3b8;
  border-color: #334155;
}
.wch-table td {
  padding: 0.62rem 0.65rem;
  border-bottom: 1px solid #f1f5f9;
  vertical-align: middle;
}
.dark .wch-table td {
  border-color: rgba(51, 65, 85, 0.55);
}
.wch-table tbody tr:hover {
  background: rgba(37, 99, 235, 0.04);
}
.dark .wch-table tbody tr:hover {
  background: rgba(59, 130, 246, 0.08);
}
.wch-table a {
  color: #1d4ed8;
  text-decoration: none;
  font-weight: 600;
}
.dark .wch-table a { color: #93c5fd; }
.wch-table a:hover { text-decoration: underline; }

.wch-res-badge {
  display: inline-block;
  padding: 0.16rem 0.48rem;
  border-radius: 6px;
  font-size: 0.78rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  background: #f1f5f9;
  color: #0f172a;
}
.dark .wch-res-badge {
  background: #334155;
  color: #f8fafc;
}
.wch-res-badge.is-live {
  background: #059669;
  color: #ffffff;
}
.wch-eco-pill {
  display: inline-block;
  padding: 0.12rem 0.4rem;
  border-radius: 5px;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.74rem;
  font-weight: 700;
  background: #eff6ff;
  color: #1d4ed8;
  margin-right: 0.35rem;
}
.dark .wch-eco-pill {
  background: rgba(59, 130, 246, 0.18);
  color: #93c5fd;
}

/* Stacked outcome bar & Opening bars */
.wch-outcome-bar {
  display: flex;
  height: 12px;
  border-radius: 999px;
  overflow: hidden;
  background: #e2e8f0;
  margin: 0.4rem 0 0.55rem;
}
.wch-ob-w { background: #3b82f6; }
.wch-ob-d { background: #94a3b8; }
.wch-ob-b { background: #0f172a; }
.dark .wch-ob-b { background: #f59e0b; }

.wch-stat-list {
  list-style: none;
  margin: 0.65rem 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.wch-stat-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.86rem;
  padding-bottom: 0.45rem;
  border-bottom: 1px dashed #e2e8f0;
}
.dark .wch-stat-row { border-color: #334155; }
.wch-stat-row:last-child { border-bottom: 0; padding-bottom: 0; }

/* Champions Grid on Index */
.wch-champs-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(195px, 1fr));
  gap: 0.7rem;
}
.wch-champ-tile {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  padding: 0.72rem 0.85rem;
  border-radius: 10px;
  border: 1px solid #e2e8f0;
  background: #f8fafc;
  text-decoration: none;
  color: inherit;
  transition: border-color 0.15s, transform 0.12s;
}
.dark .wch-champ-tile {
  background: #0f172a;
  border-color: #334155;
}
.wch-champ-tile:hover {
  border-color: #2563eb;
  transform: translateY(-1px);
}
.wch-champ-num {
  font-size: 0.72rem;
  font-weight: 800;
  color: #d97706;
}
.dark .wch-champ-num { color: #fbbf24; }
.wch-champ-name {
  font-size: 0.92rem;
  font-weight: 700;
}
.wch-champ-reign {
  font-size: 0.78rem;
  color: #64748b;
}
.dark .wch-champ-reign { color: #94a3b8; }

/* FAQ */
.wch-faq-item {
  border-bottom: 1px solid #e2e8f0;
  padding: 0.75rem 0;
}
.dark .wch-faq-item { border-color: #334155; }
.wch-faq-item:last-child { border-bottom: 0; }
.wch-faq-item summary {
  cursor: pointer;
  font-weight: 700;
  font-size: 0.94rem;
  list-style: none;
}
.wch-faq-item p {
  margin: 0.45rem 0 0;
  font-size: 0.88rem;
  line-height: 1.55;
  color: #475569;
}
.dark .wch-faq-item p { color: #cbd5e1; }

.wch-flag-inline {
  display: inline-flex;
  align-items: center;
  vertical-align: middle;
}

/* Split-match jump bar */
.wch-split-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

@media (max-width: 960px) {
  .wch-live-stage {
    grid-template-columns: minmax(0, 1fr);
  }
  .wch-kpi-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .wch-2col {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 720px) {
  .wch-page { padding: 0.9rem 0.7rem 2.25rem; }
  .wch-hero { padding: 1.1rem 1rem; }
  .wch-scoreboard {
    grid-template-columns: minmax(0, 1fr);
    text-align: left;
    gap: 0.65rem;
  }
  .wch-player-card.is-right {
    text-align: left;
    align-items: flex-start;
  }
  .wch-player-card.is-right .wch-player-name-row,
  .wch-player-card.is-right .wch-player-meta {
    justify-content: flex-start;
  }
  .wch-score-center {
    width: fit-content;
  }
  .wch-col-hide-sm {
    display: none;
  }
  .wch-search-input {
    width: 100%;
    min-width: 0;
  }
}
