/* ---------- Tokens ---------- */
:root {
  --ink: #0B0E14;
  --paper: #F5F1E8;
  --paper-dim: #C9C3B4;
  --gold: #D4A537;
  --gold-bright: #E8C158;
  --spoon: #8B2E2E;
  --spoon-bright: #C24545;
  --surface: #151B27;
  --surface-line: rgba(245, 241, 232, 0.1);
  --shadow: rgba(0, 0, 0, 0.45);

  --font-display: "Rockwell", "Bahnschrift", "Arial Narrow Bold", ui-sans-serif, system-ui, sans-serif;
  --font-body: -apple-system, "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  --font-mono: "SF Mono", "Cascadia Code", ui-monospace, Menlo, monospace;
}

:root[data-theme="light"] {
  --ink: #F5F1E8;
  --paper: #17130E;
  --paper-dim: #6b6454;
  --surface: #FFFFFF;
  --surface-line: rgba(11, 14, 20, 0.1);
  --shadow: rgba(180, 170, 140, 0.35);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--ink);
  color: var(--paper);
  font-family: var(--font-body);
  -webkit-font-smoothing: antialiased;
}

body {
  min-height: 100vh;
  position: relative;
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
}

.ledger,
.rivals-main {
  flex: 1;
}

/* subtle turf-flecked grain so the near-black doesn't feel flat */
.grain {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  opacity: 0.05;
  background-image:
    radial-gradient(circle at 20% 30%, var(--gold) 0.5px, transparent 0.5px),
    radial-gradient(circle at 70% 65%, var(--gold) 0.5px, transparent 0.5px),
    radial-gradient(circle at 40% 80%, var(--paper) 0.5px, transparent 0.5px);
  background-size: 140px 140px, 190px 190px, 97px 97px;
}

/* ---------- Nav ---------- */
.site-nav {
  position: relative;
  z-index: 2;
  display: flex;
  justify-content: center;
  gap: clamp(1.25rem, 4vw, 2.25rem);
  padding: 1.5rem 1.5rem 0;
}

.site-nav-link {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--paper-dim);
  padding-bottom: 0.4rem;
  border-bottom: 2px solid transparent;
  transition: color 0.15s ease, border-color 0.15s ease;
}

.site-nav-link:hover {
  color: var(--paper);
}

.site-nav-link.is-active {
  color: var(--gold-bright);
  border-color: var(--gold-bright);
}

.site-nav-link:focus-visible {
  outline: 2px solid var(--gold-bright);
  outline-offset: 3px;
}

.theme-toggle {
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  font-family: inherit;
  cursor: pointer;
  margin: 0;
}

/* ---------- Hero ---------- */
.hero {
  position: relative;
  z-index: 1;
  padding: clamp(3rem, 8vw, 6.5rem) 1.5rem 3rem;
  text-align: center;
}

.hero--compact {
  padding: clamp(2.5rem, 6vw, 4rem) 1.5rem 2rem;
}

.page-title {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(2.6rem, 8vw, 4.5rem);
  letter-spacing: 0.02em;
  color: var(--gold-bright);
  text-shadow: 0 2px 0 rgba(0,0,0,0.3), 0 0 60px rgba(212,165,55,0.25);
}

.eyebrow {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  font-size: 0.75rem;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--gold);
  margin: 0 0 1.25rem;
}

.wordmark {
  margin: 0;
  text-wrap: balance;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.wordmark .the {
  display: block;
  font-family: var(--font-body);
  font-weight: 600;
  font-style: italic;
  font-size: clamp(1.1rem, 2.4vw, 1.6rem);
  color: var(--paper);
  letter-spacing: 0.05em;
  line-height: 1;
  margin-bottom: clamp(0.6rem, 2vw, 1.1rem);
}

.wordmark .main {
  display: block;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(3.2rem, 13vw, 8.5rem);
  line-height: 0.92;
  letter-spacing: 0.02em;
  color: var(--gold-bright);
  text-shadow: 0 2px 0 rgba(0,0,0,0.3), 0 0 60px rgba(212,165,55,0.25);
}

.wordmark .league {
  display: block;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(1.8rem, 6vw, 3.6rem);
  line-height: 0.92;
  letter-spacing: 0.35em;
  padding-left: 0.35em;
  color: var(--paper);
  margin-top: -0.35em;
}

.tagline {
  margin: 1.5rem auto 0;
  max-width: 32rem;
  font-size: clamp(0.95rem, 1.6vw, 1.1rem);
  color: var(--paper-dim);
}

.reigning {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.35rem;
  width: min(90%, 30rem);
  margin: 3rem auto 0;
  padding: 2rem 2rem 2.25rem;
  border-radius: 20px;
  background: linear-gradient(180deg, rgba(212, 165, 55, 0.08), var(--surface) 55%);
  border: 1px solid rgba(212, 165, 55, 0.4);
  box-shadow: 0 0 0 1px rgba(212, 165, 55, 0.08), 0 20px 50px var(--shadow), 0 0 60px rgba(212, 165, 55, 0.1);
  animation: reigning-glow 3.5s ease-in-out infinite;
}

@keyframes reigning-glow {
  0%, 100% {
    border-color: rgba(212, 165, 55, 0.4);
    box-shadow: 0 0 0 1px rgba(212, 165, 55, 0.08), 0 20px 50px var(--shadow), 0 0 60px rgba(212, 165, 55, 0.1);
  }
  50% {
    border-color: rgba(232, 193, 88, 0.75);
    box-shadow: 0 0 0 1px rgba(212, 165, 55, 0.16), 0 20px 50px var(--shadow), 0 0 90px rgba(212, 165, 55, 0.28);
  }
}


.reigning-mark {
  display: inline-flex;
  color: var(--gold-bright);
  filter: drop-shadow(0 0 14px rgba(212, 165, 55, 0.5));
}

.reigning-mark svg {
  width: 2.25rem;
  height: 2.25rem;
}

.reigning-label {
  margin: 0.4rem 0 0;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--gold);
}

#reigning-year {
  font-variant-numeric: tabular-nums;
}

.reigning-team {
  margin: 0.35rem 0 0;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(1.5rem, 4vw, 2.1rem);
  line-height: 1.05;
  text-wrap: balance;
  color: var(--gold-bright);
}

.reigning-manager {
  margin: 0.3rem 0 0;
  font-size: 0.95rem;
  color: var(--paper-dim);
}

.hero-line {
  width: min(90%, 720px);
  height: 1px;
  margin: 3rem auto 0;
  background: linear-gradient(90deg, transparent, var(--surface-line) 20%, var(--surface-line) 80%, transparent);
}

/* ---------- Ledger (two columns) ---------- */
.ledger {
  position: relative;
  z-index: 1;
  max-width: 1100px;
  margin: 0 auto;
  padding: 2.5rem 1.5rem 5rem;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: clamp(1.5rem, 4vw, 3rem);
  align-items: start;
}

.divider {
  width: 1px;
  align-self: stretch;
  background: linear-gradient(180deg, transparent, var(--surface-line) 10%, var(--surface-line) 90%, transparent);
}

.column-head {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.15rem;
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 2px solid var(--surface-line);
}

.column-mark {
  display: inline-block;
  font-size: 0.85em;
  transform: translateY(-0.05em);
}

.column-mark--svg svg {
  width: 0.85em;
  height: 0.85em;
  vertical-align: -0.1em;
}

.column--champions .column-mark { color: var(--gold-bright); }
.column--losers .column-mark { color: var(--spoon-bright); }

.column-head h2 {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(1.4rem, 3vw, 1.9rem);
  letter-spacing: 0.03em;
  margin: 0;
}

.column--champions .column-head h2 { color: var(--gold-bright); }
.column--losers .column-head h2 { color: var(--spoon-bright); }

.column-sub {
  margin: 0;
  font-size: 0.8rem;
  color: var(--paper-dim);
  letter-spacing: 0.04em;
}

.rows {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.row {
  display: grid;
  grid-template-columns: 3.2rem 1fr;
  align-items: center;
  gap: 0.9rem;
  padding: 0.85rem 1rem;
  border-radius: 10px;
  background: var(--surface);
  border: 1px solid var(--surface-line);
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}

.row:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px var(--shadow);
}

.column--champions .row:hover { border-color: rgba(212, 165, 55, 0.4); }
.column--losers .row:hover { border-color: rgba(194, 69, 69, 0.4); }

.row-year {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  font-size: 1.5rem;
  font-weight: 700;
  line-height: 1;
  color: var(--paper-dim);
}

.column--champions .row-year { color: var(--gold); }
.column--losers .row-year { color: var(--spoon-bright); }

.row-body {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  min-width: 0;
}

.row-team {
  font-weight: 700;
  font-size: 1rem;
  color: var(--paper);
  overflow-wrap: break-word;
}

.row-manager {
  font-size: 0.85rem;
  color: var(--paper-dim);
}

.row--placeholder .row-team,
.row--placeholder .row-manager {
  color: var(--paper-dim);
  font-style: italic;
  font-weight: 500;
}

/* ---------- Rivals ---------- */
.rivals-main {
  position: relative;
  z-index: 1;
  max-width: 1100px;
  margin: 0 auto;
  padding: 1rem 1.5rem 5rem;
}

.rivals-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(20rem, 1fr));
  gap: 1.5rem;
}

.matchup-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.1rem;
  padding: 1.75rem 1.25rem 2rem;
  border-radius: 20px;
  background: var(--surface);
  border: 1px solid var(--surface-line);
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}

.matchup-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 14px 36px var(--shadow);
  border-color: rgba(212, 165, 55, 0.35);
}

.matchup-title {
  margin: 0;
  font-family: var(--font-mono);
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--paper-dim);
  text-align: center;
}

.matchup-pair {
  position: relative;
  width: 100%;
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid var(--surface-line);
}

.matchup-swirl {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
}

.matchup-row {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 1fr 1fr;
}

.matchup-player {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  padding: 1.75rem 2.25rem;
  min-width: 0;
}

.matchup-player--one {
  align-items: flex-start;
  text-align: left;
}

.matchup-player--two {
  align-items: flex-end;
  text-align: right;
}

.matchup-player-name {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(1.5rem, 4vw, 1.9rem);
  letter-spacing: 0.01em;
  line-height: 1;
  overflow-wrap: break-word;
}

.matchup-player--one .matchup-player-name {
  color: var(--gold-bright);
  text-shadow: 0 0 24px rgba(212, 165, 55, 0.35);
}

.matchup-player--two .matchup-player-name {
  color: var(--spoon-bright);
  text-shadow: 0 0 24px rgba(194, 69, 69, 0.35);
}

.matchup-player-note {
  font-size: 0.82rem;
  font-style: italic;
  color: var(--paper-dim);
  overflow-wrap: break-word;
}

.matchup-vs {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 3.25rem;
  height: 3.25rem;
  border-radius: 999px;
  background: radial-gradient(circle at 35% 30%, #232b3c, var(--ink) 70%);
  border: 2px solid var(--gold-bright);
  box-shadow: 0 0 24px rgba(212, 165, 55, 0.45), 0 6px 18px var(--shadow);
}

.matchup-vs-text {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 0.92rem;
  line-height: 1;
  letter-spacing: 0.06em;
  color: var(--gold-bright);
  position: relative;
  top: 0.1em;
}

@media (max-width: 420px) {
  .matchup-player-name {
    font-size: 1rem;
  }
  .matchup-player {
    padding: 1rem 0.75rem;
  }
}

/* ---------- Footer ---------- */
.site-footer {
  position: relative;
  z-index: 1;
  text-align: center;
  padding: 2rem 1.5rem 3rem;
  font-size: 0.78rem;
  color: var(--paper-dim);
  border-top: 1px solid var(--surface-line);
}

.site-footer code {
  font-family: var(--font-mono);
  background: var(--surface);
  padding: 0.1rem 0.4rem;
  border-radius: 4px;
  border: 1px solid var(--surface-line);
}

/* ---------- Responsive ---------- */
@media (max-width: 720px) {
  .ledger {
    grid-template-columns: 1fr;
  }
  .divider {
    width: 100%;
    height: 1px;
    margin: 0.5rem 0;
  }
  .row {
    grid-template-columns: 2.6rem 1fr;
  }
}

@media (prefers-reduced-motion: reduce) {
  .row { transition: none; }
  .reigning { animation: none; }
}
