/* === DESIGN TOKENS (per 11-WEBSITE-SPEC.md) === */
:root {
  --bg-primary: #0a0a12;
  --bg-secondary: #12121f;
  --bg-waveform: #060612;
  --brand-blue: #017bfc;
  --brand-yellow: #f3b652;
  --brand-red: #f15f59;
  --brand-green: #7ed7ac;
  --text-primary: #e8e8f0;
  --text-muted: rgba(232, 232, 240, 0.45);
  --border-subtle: rgba(232, 232, 240, 0.08);
}

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

/* === BASE === */
html { font-size: 16px; }
body {
  background: var(--bg-primary);
  color: var(--text-primary);
  font-family: 'HelveticaNow', 'Helvetica Neue', Arial, sans-serif;
  line-height: 1.5;
  min-height: 100vh;
}

/* === TYPOGRAPHY === */
.wordmark {
  font-family: 'Gunplay', 'Impact', 'Arial Black', sans-serif;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-size: clamp(2rem, 6vw, 4rem);
  color: var(--text-primary);
}
.section-heading {
  font-family: 'Gunplay', 'Impact', 'Arial Black', sans-serif;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: clamp(1rem, 2.5vw, 1.5rem);
  color: var(--text-muted);
  margin-bottom: 1rem;
}

/* === LAYOUT === */
.container { max-width: 960px; margin: 0 auto; padding: 0 1rem; }

/* === HEADER / NAV === */
.site-header {
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border-subtle);
  padding: 1rem 0;
}
.site-header .container { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 1rem; }
.site-nav { display: flex; gap: 0.5rem; }
.site-nav a {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  padding: 0.4rem 0.75rem;
  border-radius: 4px;
  transition: color 0.15s, background 0.15s;
}
.site-nav a:hover, .site-nav a.active { color: var(--text-primary); background: rgba(1, 123, 252, 0.15); }

/* === HERO === */
.hero {
  padding: 3rem 0 2rem;
  border-bottom: 1px solid var(--border-subtle);
}
.hero .container { display: flex; flex-direction: column; gap: 1.5rem; }
.stats-bar { display: flex; gap: 2rem; flex-wrap: wrap; }
.stat { display: flex; flex-direction: column; gap: 0.25rem; }
.stat-value {
  font-family: 'HelveticaNow', 'Helvetica Neue', Arial, sans-serif;
  font-size: 2rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--brand-blue);
}
.stat-label { font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.12em; color: var(--text-muted); }

/* === LEADERBOARD TABLE (desktop) === */
.lb-table { width: 100%; border-collapse: collapse; }
.lb-table thead th {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--text-muted);
  padding: 0.5rem 0.75rem;
  text-align: left;
  border-bottom: 1px solid var(--border-subtle);
}
.lb-table tbody tr {
  border-bottom: 1px solid var(--border-subtle);
  transition: background 0.1s;
}
.lb-table tbody tr:hover { background: rgba(1, 123, 252, 0.05); }
.lb-table td { padding: 0.65rem 0.75rem; font-variant-numeric: tabular-nums; }

/* === RANK TREATMENT (per WEBSITE-SPEC.md) === */
.rank-1 { color: #ffffff; }
.rank-1 .lb-rank {
  text-shadow: 0 0 12px var(--brand-blue), 0 0 24px rgba(1, 123, 252, 0.5);
  color: var(--brand-blue);
  font-weight: 800;
}
.rank-2-3 { color: var(--brand-yellow); }
.rank-4plus { color: var(--brand-green); }

/* === LEADERBOARD CARD (mobile) === */
.lb-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border-subtle);
  border-radius: 6px;
  padding: 0.75rem 1rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}
.lb-card-rank { font-size: 1.25rem; font-weight: 800; font-variant-numeric: tabular-nums; min-width: 2.5rem; }
.lb-card-info { flex: 1; min-width: 0; }
.lb-card-name { font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lb-card-meta { font-size: 0.75rem; color: var(--text-muted); }
.lb-card-score { font-size: 1.1rem; font-weight: 700; font-variant-numeric: tabular-nums; text-align: right; }

/* === EVENT CARDS === */
.event-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  padding: 1.25rem;
  text-decoration: none;
  color: var(--text-primary);
  display: block;
  transition: border-color 0.15s, transform 0.1s;
}
.event-card:hover { border-color: var(--brand-blue); transform: translateY(-1px); }
.event-card-name { font-size: 1.1rem; font-weight: 700; margin-bottom: 0.25rem; }
.event-card-meta { font-size: 0.8rem; color: var(--text-muted); display: flex; gap: 1rem; flex-wrap: wrap; }

/* === FOOTER === */
.site-footer {
  margin-top: 4rem;
  padding: 2rem 0;
  border-top: 1px solid var(--border-subtle);
  text-align: center;
  color: var(--text-muted);
  font-size: 0.8rem;
}
.site-footer a { color: var(--brand-blue); text-decoration: none; }

/* === STALE INDICATOR === */
.stale-indicator { font-size: 0.75rem; color: var(--text-muted); text-align: right; margin-top: 0.5rem; }

/* === LOADING / EMPTY STATES === */
.loading { color: var(--text-muted); text-align: center; padding: 3rem; }
.empty { color: var(--text-muted); text-align: center; padding: 2rem; }

/* === SECTION === */
.section { padding: 2rem 0; }
.cards-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 1rem; }
.lb-stack { display: flex; flex-direction: column; gap: 0.5rem; }

/* === EVENT META === */
.event-meta-header {
  padding: 2rem 0 1.5rem;
  border-bottom: 1px solid var(--border-subtle);
}
.event-title {
  font-family: 'Gunplay', 'Impact', 'Arial Black', sans-serif;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-size: clamp(1.5rem, 4vw, 2.5rem);
  color: var(--text-primary);
  margin-bottom: 0.5rem;
}
.event-meta {
  font-size: 0.875rem;
  color: var(--text-muted);
}
.back-link {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  display: inline-block;
  margin-bottom: 1rem;
  transition: color 0.15s;
}
.back-link:hover { color: var(--text-primary); }

/* === RESPONSIVE: desktop shows table, mobile shows cards === */
@media (min-width: 640px) {
  .lb-stack { display: none; }
  .lb-table { display: table; }
}
@media (max-width: 639px) {
  .lb-stack { display: flex; }
  .lb-table { display: none; }
}
