/* ============ LLM World Cup 2026 ============ */
:root {
  --bg: #07090f;
  --bg-card: rgba(255, 255, 255, 0.04);
  --bg-card-hover: rgba(255, 255, 255, 0.07);
  --border: rgba(255, 255, 255, 0.09);
  --border-strong: rgba(255, 255, 255, 0.16);
  --text: #e8ecf3;
  --text-dim: #9aa3b5;
  --text-faint: #5c6577;
  --green: #34d399;
  --green-soft: rgba(52, 211, 153, 0.14);
  --gold: #fbbf24;
  --gold-soft: rgba(251, 191, 36, 0.14);
  --red: #f87171;
  --red-soft: rgba(248, 113, 113, 0.12);
  --blue: #60a5fa;
  --radius: 16px;
  --font-display: 'Sora', sans-serif;
  --font-body: 'Inter', system-ui, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
}

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

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  line-height: 1.55;
  min-height: 100vh;
  overflow-x: hidden;
}

.container { max-width: 1180px; margin: 0 auto; padding: 0 24px; }

/* ---- ambient glows ---- */
.bg-glow {
  position: fixed;
  border-radius: 50%;
  filter: blur(140px);
  pointer-events: none;
  z-index: 0;
  opacity: 0.55;
}
.bg-glow-1 {
  width: 640px; height: 640px;
  top: -240px; left: -160px;
  background: radial-gradient(circle, rgba(16, 185, 129, 0.28), transparent 70%);
  animation: drift 18s ease-in-out infinite alternate;
}
.bg-glow-2 {
  width: 560px; height: 560px;
  top: 20%; right: -200px;
  background: radial-gradient(circle, rgba(99, 102, 241, 0.22), transparent 70%);
  animation: drift 22s ease-in-out infinite alternate-reverse;
}
@keyframes drift {
  from { transform: translate(0, 0) scale(1); }
  to   { transform: translate(60px, 40px) scale(1.12); }
}

header, main, footer { position: relative; z-index: 1; }

/* ---- hero ---- */
.hero { padding: 72px 0 40px; text-align: center; }

.hero-badge {
  display: inline-block;
  padding: 6px 16px;
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  background: var(--bg-card);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-dim);
  margin-bottom: 22px;
  backdrop-filter: blur(8px);
}

.hero-title {
  font-family: var(--font-display);
  font-size: clamp(40px, 7vw, 72px);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.05;
}
.hero-title .grad {
  background: linear-gradient(92deg, #34d399 10%, #60a5fa 55%, #a78bfa 95%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hero-sub {
  max-width: 640px;
  margin: 18px auto 0;
  color: var(--text-dim);
  font-size: 17px;
}

/* ---- stat tiles ---- */
.stats {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 14px;
  margin-top: 36px;
}
.stat {
  min-width: 132px;
  padding: 16px 22px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-card);
  backdrop-filter: blur(8px);
}
.stat .num {
  font-family: var(--font-display);
  font-size: 30px;
  font-weight: 700;
  background: linear-gradient(180deg, #fff, #b7c2d8);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.stat .lbl {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-faint);
  margin-top: 2px;
}

.dataset-info {
  margin-top: 22px;
  font-size: 12.5px;
  color: var(--text-faint);
  font-family: var(--font-mono);
}

/* ---- panels ---- */
.panel {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-card);
  backdrop-filter: blur(8px);
  padding: 24px 26px;
  margin-bottom: 28px;
}
.panel-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 16px;
}
.panel-head h2 {
  font-family: var(--font-display);
  font-size: 21px;
  font-weight: 700;
}
.scoring-legend { font-size: 12.5px; color: var(--text-faint); }

/* ---- leaderboard ---- */
.lb-scroll {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin: 0 -8px;
  padding: 0 8px;
}
.lb-table { width: 100%; min-width: 580px; border-collapse: collapse; font-size: 14.5px; }
.lb-table td { white-space: nowrap; }
.lb-table th {
  text-align: left;
  font-size: 11.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-faint);
  padding: 8px 12px;
  border-bottom: 1px solid var(--border);
}
.lb-table td { padding: 11px 12px; border-bottom: 1px solid var(--border); }
.lb-table tr:last-child td { border-bottom: none; }
.lb-table .rank { font-family: var(--font-mono); color: var(--text-dim); width: 36px; }
.lb-table .pts { font-family: var(--font-display); font-weight: 700; font-size: 17px; color: var(--gold); }
.lb-table .num-cell { font-family: var(--font-mono); font-size: 13.5px; color: var(--text-dim); }
.lb-model { display: flex; align-items: center; gap: 10px; font-weight: 600; }
.lb-empty { color: var(--text-dim); font-size: 14.5px; padding: 6px 2px; }

.model-dot {
  width: 10px; height: 10px;
  border-radius: 50%;
  background: var(--c, var(--blue));
  box-shadow: 0 0 10px var(--c, var(--blue));
  flex-shrink: 0;
}
.model-vendor { color: var(--text-faint); font-weight: 400; font-size: 12px; }

/* ---- controls ---- */
.controls {
  position: sticky;
  top: 12px;
  z-index: 5;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: rgba(10, 13, 20, 0.85);
  backdrop-filter: blur(16px);
  margin-bottom: 30px;
}

.view-toggle {
  display: flex;
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
}
.toggle-btn {
  padding: 8px 18px;
  background: transparent;
  border: none;
  color: var(--text-dim);
  font-family: var(--font-body);
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.18s;
}
.toggle-btn.active { background: var(--green-soft); color: var(--green); }
.toggle-btn:not(.active):hover { color: var(--text); }

.select, .search {
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 13.5px;
  outline: none;
  transition: border-color 0.18s;
}
.select:focus, .search:focus { border-color: var(--green); }
.select option { background: #0d1119; }
.search { flex: 1; min-width: 140px; }

/* ---- group sections ---- */
.group-section, .date-section { margin-bottom: 44px; }

.section-head {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 18px;
}
.section-head h3 {
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -0.01em;
}
.section-head .line { flex: 1; height: 1px; background: linear-gradient(90deg, var(--border-strong), transparent); }
.section-head .count { font-size: 12.5px; color: var(--text-faint); font-family: var(--font-mono); white-space: nowrap; }

.group-letter {
  width: 44px; height: 44px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 800;
  background: linear-gradient(135deg, rgba(52, 211, 153, 0.22), rgba(96, 165, 250, 0.18));
  border: 1px solid var(--border-strong);
  color: #d6fff0;
}

.group-body {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 290px;
  gap: 18px;
  align-items: start;
}
@media (max-width: 900px) {
  .group-body { grid-template-columns: 1fr; }
}

/* ---- match grid & cards ---- */
.match-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(330px, 1fr));
  gap: 18px;
}

.match-card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-card);
  padding: 18px;
  transition: transform 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}
.match-card:hover {
  transform: translateY(-3px);
  border-color: var(--border-strong);
  background: var(--bg-card-hover);
}
.match-card.played { border-color: rgba(52, 211, 153, 0.28); }

.match-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11.5px;
  color: var(--text-faint);
  font-family: var(--font-mono);
  margin-bottom: 14px;
}
.match-meta .spacer { flex: 1; }

.chip {
  padding: 2px 9px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.04);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
}
.chip.live-chip { border-color: rgba(52, 211, 153, 0.4); color: var(--green); background: var(--green-soft); }
.chip.upcoming-chip { color: var(--text-dim); }

.match-teams {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 8px;
  margin-bottom: 14px;
}
.team { display: flex; flex-direction: column; align-items: center; gap: 4px; min-width: 0; }
.team .flag { font-size: 34px; line-height: 1; filter: drop-shadow(0 2px 6px rgba(0,0,0,0.5)); }
.team .code {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 15px;
  letter-spacing: 0.04em;
}

.score-box { text-align: center; min-width: 86px; }
.score-real {
  font-family: var(--font-display);
  font-size: 30px;
  font-weight: 800;
  letter-spacing: 0.02em;
  color: #fff;
  text-shadow: 0 0 24px rgba(52, 211, 153, 0.5);
}
.score-vs {
  font-family: var(--font-display);
  font-size: 17px;
  font-weight: 700;
  color: var(--text-faint);
}
.score-sub { font-size: 11px; color: var(--text-faint); margin-top: 2px; font-family: var(--font-mono); }

/* ---- predictions inside card ---- */
.preds { border-top: 1px solid var(--border); padding-top: 10px; display: flex; flex-direction: column; gap: 4px; }

.pred details { border-radius: 10px; }
.pred summary {
  list-style: none;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  column-gap: 9px;
  row-gap: 5px;
  padding: 7px 8px;
  border-radius: 10px;
  cursor: pointer;
  border: 1px solid transparent;
  transition: background 0.15s, border-color 0.15s;
}
.pred summary::-webkit-details-marker { display: none; }
.pred summary:hover { background: rgba(255, 255, 255, 0.05); }
.pred details[open] summary {
  background: rgba(255, 255, 255, 0.055);
  border-color: var(--border);
}

.pred .model-name {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-dim);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.pred .pred-score {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 14px;
  white-space: nowrap;
}

.pred-subline {
  grid-column: 2 / -1;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 7px;
  min-width: 0;
}

.conf {
  display: inline-block;
  width: 52px; height: 5px;
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
}
.conf-fill {
  display: block;
  height: 100%;
  border-radius: 3px;
  background: linear-gradient(90deg, #34d399, #60a5fa);
}
.conf-val { font-size: 11px; color: var(--text-faint); font-family: var(--font-mono); width: 34px; text-align: right; }

.badge {
  font-size: 10.5px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 999px;
  white-space: nowrap;
}
.badge.exact { background: var(--gold-soft); color: var(--gold); border: 1px solid rgba(251, 191, 36, 0.35); }
.badge.outcome { background: var(--green-soft); color: var(--green); border: 1px solid rgba(52, 211, 153, 0.35); }
.badge.miss { background: var(--red-soft); color: var(--red); border: 1px solid rgba(248, 113, 113, 0.3); }
.badge.pending { background: rgba(255,255,255,0.05); color: var(--text-faint); border: 1px solid var(--border); }

.rationale-trigger {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-width: 86px;
  justify-content: center;
  padding: 3px 9px;
  border: 1px solid rgba(96, 165, 250, 0.34);
  border-radius: 999px;
  color: #bfdbfe;
  background: rgba(96, 165, 250, 0.11);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.02em;
  white-space: nowrap;
}
.rationale-trigger::after {
  content: "⌄";
  font-size: 12px;
  line-height: 1;
  transition: transform 0.15s;
}
.pred details[open] .rationale-trigger::after { transform: rotate(180deg); }

.rationale-panel {
  margin: 6px 8px 4px 27px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: rgba(96, 165, 250, 0.07);
}
.rationale-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 5px;
  color: var(--text);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.rationale-confidence {
  color: var(--text-faint);
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 600;
  text-transform: none;
  letter-spacing: 0;
  white-space: nowrap;
}
.rationale-panel p {
  font-size: 12.5px;
  color: var(--text-dim);
  font-style: italic;
}

/* ---- standings table ---- */
.standings {
  position: sticky;
  top: 84px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-card);
  padding: 16px 14px;
}
.standings h4 {
  font-size: 11.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  color: var(--text-faint);
  margin-bottom: 10px;
  padding-left: 4px;
}
.standings table { width: 100%; border-collapse: collapse; font-size: 13px; }
.standings th {
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-faint);
  text-align: right;
  padding: 4px 6px;
  font-weight: 600;
}
.standings th:first-child, .standings td:first-child { text-align: left; }
.standings td { padding: 6px; border-top: 1px solid var(--border); text-align: right; font-family: var(--font-mono); font-size: 12.5px; }
.standings td.team-cell { font-family: var(--font-body); font-weight: 600; font-size: 13px; }
.standings tr.qualify td { background: rgba(52, 211, 153, 0.05); }
.standings tr.qualify td:first-child { box-shadow: inset 3px 0 0 var(--green); }
.standings .real-pts { color: var(--gold); font-weight: 700; }

/* ---- loading / error / empty ---- */
.loading { text-align: center; padding: 70px 0; color: var(--text-dim); }
.loading .ball { font-size: 44px; animation: bounce 1s ease-in-out infinite; }
@keyframes bounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-16px); }
}

.error {
  text-align: center;
  padding: 40px;
  border: 1px solid rgba(248, 113, 113, 0.3);
  border-radius: var(--radius);
  background: var(--red-soft);
  color: var(--red);
  font-size: 15px;
}

.empty-state { text-align: center; padding: 60px 0; color: var(--text-faint); font-size: 15px; }

/* ---- footer ---- */
.footer {
  margin-top: 70px;
  padding: 34px 0 44px;
  border-top: 1px solid var(--border);
  text-align: center;
  font-size: 13.5px;
  color: var(--text-dim);
}
.footer .muted { color: var(--text-faint); margin-top: 6px; font-size: 12.5px; }

@media (max-width: 640px) {
  .container { padding: 0 16px; }

  .hero { padding: 44px 0 28px; }
  .hero-sub { font-size: 15px; }
  .stats { gap: 10px; margin-top: 28px; }
  .stat { flex: 1 1 calc(50% - 10px); min-width: calc(50% - 10px); padding: 12px 16px; }
  .stat .num { font-size: 24px; }
  .dataset-info { margin-top: 16px; }

  .panel { padding: 18px 14px; }
  .panel-head h2 { font-size: 18px; }
  .lb-table { font-size: 13px; }
  .lb-table th, .lb-table td { padding: 8px; }
  .lb-table .pts { font-size: 15px; }

  .controls { position: static; padding: 10px; }
  .view-toggle { width: 100%; }
  .toggle-btn { flex: 1; }
  .select { flex: 1 1 calc(50% - 10px); min-width: 0; }
  .search { flex: 1 1 100%; }

  .section-head { gap: 10px; }
  .section-head h3 { font-size: 19px; }
  .group-letter { width: 36px; height: 36px; font-size: 16px; border-radius: 10px; }

  .match-grid { grid-template-columns: 1fr; }
  .match-card { padding: 14px; }
  .match-meta { flex-wrap: wrap; row-gap: 4px; }
  .team .flag { font-size: 30px; }
  .score-real { font-size: 26px; }

  .standings { position: static; }

  .pred .conf, .pred .conf-val { display: none; }
  .rationale-trigger {
    flex: 1 1 100%;
    margin-top: 2px;
  }
  .rationale-panel { margin-left: 8px; }
  .rationale-head {
    align-items: flex-start;
    flex-direction: column;
    gap: 2px;
  }
}
