:root {
  --ink: #080808;
  --black-light: #171717;
  --red: #cc0000;
  --red-dark: #960014;
  --yellow: #f6a917;
  --cream: #f7f5f1;
  --paper: #ffffff;
  --muted: #b8b8b8;
  --line: rgba(255, 255, 255, 0.12);
  --display: "Oswald", sans-serif;
  --body: "DM Sans", sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  min-width: 320px;
  color: var(--cream);
  background:
    radial-gradient(circle at 85% 15%, rgba(204, 0, 0, 0.22), transparent 24rem),
    var(--ink);
  font-family: var(--body);
}

button, a { font: inherit; }

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: 1240px;
  margin: 0 auto;
  padding: 1.25rem 2rem;
  border-bottom: 1px solid var(--line);
  border-top: 5px solid var(--red);
}

.brand {
  display: flex;
  gap: 0.75rem;
  align-items: center;
  color: inherit;
  text-decoration: none;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 2.65rem;
  aspect-ratio: 1;
  border-radius: 0.35rem 50% 50% 50%;
  color: var(--paper);
  background: var(--red);
  transform: rotate(-8deg);
  font: 700 0.95rem/1 var(--display);
  letter-spacing: 0.04em;
}

.brand strong {
  display: block;
  font: 600 1.25rem/1 var(--display);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.brand small, .data-status { color: var(--muted); }

.data-status { margin: 0; font-size: 0.82rem; }

.data-tools {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.sync-button {
  min-height: 2.35rem;
  padding: 0.55rem 0.85rem;
  border: 1px solid var(--red);
  color: var(--paper);
  background: var(--red);
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
}

.sync-button:hover,
.sync-button:focus-visible { background: var(--red-dark); }
.sync-button:disabled { cursor: wait; opacity: 0.65; }

.header-actions {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.site-nav { display: flex; flex-wrap: wrap; gap: 0.3rem; }

.site-nav a {
  padding: 0.55rem 0.75rem;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 700;
  text-decoration: none;
}

.site-nav a:hover,
.site-nav a:focus-visible,
.site-nav a[aria-current="page"] { color: var(--paper); background: rgba(255, 255, 255, 0.08); }

main { overflow: hidden; }

.hero,
.weekly-hero,
.dictator-hero,
.rules-intro,
.flakes-intro,
.leaderboard-section,
.stats-section,
.hall-of-fame,
.weekly-section,
.ledger-section {
  width: min(1180px, calc(100% - 4rem));
  margin-inline: auto;
}

.hero {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 4rem;
  align-items: end;
  margin-top: 2rem;
  padding: clamp(4rem, 9vw, 7rem) clamp(1.5rem, 5vw, 4rem) 3.5rem;
  overflow: hidden;
  background:
    linear-gradient(115deg, transparent 0 62%, rgba(0, 0, 0, 0.16) 62% 67%, transparent 67% 71%, rgba(0, 0, 0, 0.16) 71% 76%, transparent 76%),
    var(--red);
  box-shadow: 0 18px 0 var(--red-dark);
}

.weekly-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 4rem;
  align-items: end;
  margin-top: 2rem;
  padding: clamp(3.5rem, 7vw, 6rem) clamp(1.5rem, 5vw, 4rem) 3.5rem;
  border-left: 7px solid var(--red);
  background:
    linear-gradient(110deg, rgba(204, 0, 0, 0.34), transparent 44%),
    repeating-linear-gradient(135deg, transparent 0 42px, rgba(255, 255, 255, 0.025) 42px 44px),
    var(--black-light);
  box-shadow: 0 18px 0 #111;
}

.dictator-hero {
  display: grid;
  grid-template-columns: minmax(17rem, 0.72fr) minmax(0, 1.28fr);
  align-items: stretch;
  margin-top: 2rem;
  border-left: 7px solid var(--red);
  background:
    linear-gradient(125deg, rgba(204, 0, 0, 0.28), transparent 52%),
    var(--black-light);
  box-shadow: 0 18px 0 #111;
}

.dictator-copy {
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: clamp(2rem, 5vw, 4rem);
}

.dictator-copy h1 {
  margin-bottom: 2rem;
  font-size: clamp(4rem, 8vw, 7.5rem);
}

.dictator-name {
  margin: 0;
  color: #ff4354;
  font: 600 clamp(2rem, 4vw, 3.5rem)/1 var(--display);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.dictator-portrait {
  position: relative;
  margin: 0;
  overflow: hidden;
  border-left: 1px solid var(--line);
  background: #0e0e0e;
}

.dictator-portrait img {
  display: block;
  width: 100%;
  height: min(72vw, 47rem);
  object-fit: cover;
  object-position: center top;
}

.dictator-portrait figcaption {
  position: absolute;
  right: 1rem;
  bottom: 1rem;
  padding: 0.7rem 0.9rem;
  color: var(--paper);
  background: rgba(8, 8, 8, 0.86);
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.rules-intro {
  margin-top: 2rem;
  padding: clamp(3rem, 7vw, 5.5rem) clamp(1.5rem, 5vw, 4rem);
  border-left: 7px solid var(--red);
  background:
    linear-gradient(110deg, rgba(204, 0, 0, 0.35), transparent 50%),
    repeating-linear-gradient(135deg, transparent 0 42px, rgba(255, 255, 255, 0.025) 42px 44px),
    var(--black-light);
  box-shadow: 0 18px 0 #111;
}

.rules-intro h1 { margin-bottom: 0; }

.flakes-intro {
  margin-top: 2rem;
  padding: clamp(3rem, 7vw, 5.5rem) clamp(1.5rem, 5vw, 4rem);
  border-left: 7px solid var(--red);
  background:
    linear-gradient(110deg, rgba(204, 0, 0, 0.35), transparent 50%),
    repeating-linear-gradient(135deg, transparent 0 42px, rgba(255, 255, 255, 0.025) 42px 44px),
    var(--black-light);
  box-shadow: 0 18px 0 #111;
}

.flakes-intro h1 { margin-bottom: 0; }

.flakes-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.25rem;
  width: min(1180px, calc(100% - 4rem));
  margin-inline: auto;
  padding: 4.5rem 0 3.5rem;
}

.flake-card {
  overflow: hidden;
  border: 1px solid var(--line);
  border-top: 5px solid var(--red);
  background: var(--black-light);
}

.flake-card img {
  display: block;
  width: 100%;
  height: min(32vw, 22rem);
  object-fit: cover;
  object-position: center 28%;
}

.flake-card:nth-child(2) img { object-position: center 24%; }
.flake-card:nth-child(3) img { object-position: center 36%; }
.flake-card:nth-child(4) img { object-position: center 24%; }

.flake-card-copy {
  padding: clamp(1.5rem, 4vw, 2.25rem);
  border-top: 1px solid var(--line);
}

.flake-rank {
  margin-bottom: 0.65rem;
  color: #ff4354;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
}

.flake-card h2 { font-size: clamp(2rem, 4vw, 3.25rem); }

.flake-years {
  margin: 0.75rem 0 0;
  color: var(--muted);
  font: 600 1rem/1.4 var(--body);
  letter-spacing: 0.08em;
}

.rules-section {
  display: grid;
  gap: 1rem;
  width: min(1180px, calc(100% - 4rem));
  margin-inline: auto;
  padding: 4.5rem 0 3.5rem;
}

.rule-card {
  display: grid;
  grid-template-columns: 6rem minmax(0, 1fr);
  gap: 1.5rem;
  padding: clamp(1.5rem, 4vw, 2.5rem);
  border: 1px solid var(--line);
  border-top: 4px solid var(--red);
  background: var(--black-light);
}

.rule-number {
  color: #ff4354;
  font: 700 3.5rem/1 var(--display);
  letter-spacing: -0.04em;
}

.rule-card h2 { font-size: clamp(2rem, 4vw, 3rem); }

.rule-card ul {
  display: grid;
  gap: 0.85rem;
  margin: 1.5rem 0 0;
  padding-left: 1.25rem;
  color: #dddddd;
  font-size: 1rem;
  line-height: 1.65;
}

.rule-card li::marker { color: var(--yellow); }

.rule-warning {
  margin: 1.5rem 0 0;
  padding: 1rem 1.1rem;
  border-left: 4px solid var(--yellow);
  color: var(--paper);
  background: rgba(246, 169, 23, 0.1);
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.6;
}

.weekly-hero h1 { font-size: clamp(3.8rem, 8vw, 7rem); }
.weekly-hero .eyebrow { color: #ff8b96; }

.hero::after {
  content: "RED\A BIRD";
  position: absolute;
  right: -0.04em;
  top: -0.08em;
  color: rgba(255, 255, 255, 0.07);
  font: 700 clamp(7rem, 17vw, 15rem)/0.72 var(--display);
  letter-spacing: -0.06em;
  white-space: pre;
  transform: rotate(-4deg);
  pointer-events: none;
}

.eyebrow {
  margin: 0 0 0.75rem;
  color: #ff8b96;
  font: 600 0.75rem/1 var(--body);
  letter-spacing: 0.2em;
  text-transform: uppercase;
}

h1, h2, p { margin-top: 0; }

h1 {
  position: relative;
  z-index: 1;
  margin-bottom: 1.5rem;
  font: 700 clamp(4rem, 9vw, 8rem)/0.88 var(--display);
  letter-spacing: -0.045em;
  text-transform: uppercase;
  text-shadow: 0.04em 0.04em 0 rgba(0, 0, 0, 0.22);
}

h1 span { color: var(--paper); }

.hero .eyebrow { color: var(--paper); }

.hero-text {
  position: relative;
  z-index: 1;
  max-width: 38rem;
  margin-bottom: 0;
  color: rgba(255, 255, 255, 0.86);
  font-size: clamp(1rem, 2vw, 1.2rem);
  line-height: 1.65;
}

.season-switcher {
  position: relative;
  z-index: 1;
  min-width: 15rem;
  padding: 1.4rem;
  border: 1px solid rgba(255, 255, 255, 0.32);
  background: rgba(0, 0, 0, 0.7);
}

.season-switcher > p {
  margin-bottom: 0.9rem;
  color: var(--muted);
  font-size: 0.75rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.year-buttons { display: flex; flex-wrap: wrap; gap: 0.6rem; }

.year-btn {
  padding: 0.55rem 0.8rem;
  border: 1px solid var(--line);
  color: var(--cream);
  background: transparent;
  cursor: pointer;
}

.year-btn:hover, .year-btn:focus-visible, .year-btn.active {
  border-color: var(--yellow);
  color: var(--ink);
  background: var(--yellow);
}

.leaderboard-section,
.stats-section,
.hall-of-fame,
.weekly-section,
.ledger-section { padding: 3.5rem 0; }

.section-heading {
  display: flex;
  justify-content: space-between;
  gap: 2rem;
  align-items: end;
  margin-bottom: 1.75rem;
}

h2 {
  margin-bottom: 0;
  font: 600 clamp(2.3rem, 5vw, 4rem)/1 var(--display);
  letter-spacing: -0.02em;
  text-transform: uppercase;
}

.season-description {
  max-width: 32rem;
  margin-bottom: 0.25rem;
  color: var(--muted);
  text-align: right;
}

.table-shell {
  overflow-x: auto;
  border: 1px solid var(--line);
  background: var(--black-light);
  border-top: 5px solid var(--red);
}

.leaderboard-table {
  width: 100%;
  min-width: 600px;
  border-collapse: collapse;
}

.leaderboard-table th {
  padding: 1rem 1.25rem;
  color: var(--muted);
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-align: left;
  text-transform: uppercase;
}

.leaderboard-table td {
  padding: 1.2rem 1.25rem;
  border-top: 1px solid var(--line);
}

.leaderboard-table tbody tr { transition: background 160ms ease; }
.leaderboard-table tbody tr:hover { background: #242424; }
.leaderboard-table tbody tr.champion { background: linear-gradient(90deg, rgba(204, 0, 0, 0.48), transparent 76%); }
.leaderboard-table .rank { width: 6rem; color: #ff8b96; font: 600 1.25rem/1 var(--display); }
.leaderboard-table .manager { font-weight: 700; }
.leaderboard-table .numeric { text-align: right; font-variant-numeric: tabular-nums; }
.leaderboard-table .finish { color: #ff8b96; font-size: 0.85rem; }

.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  border: 1px solid var(--line);
  border-bottom: 5px solid var(--red);
}

.stats-grid article { padding: 2rem; border-right: 1px solid var(--line); }
.stats-grid article:last-child { border-right: 0; }
.stats-grid span { display: block; color: #ff4354; font: 600 clamp(2.5rem, 5vw, 4.5rem)/1 var(--display); }
.stats-grid p { margin: 0.6rem 0 0; color: var(--muted); }

.champions-list { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; }

.champion-card {
  position: relative;
  min-height: 13rem;
  padding: 1.75rem;
  border: 1px solid var(--line);
  background: var(--black-light);
  border-top: 4px solid var(--red);
}

.champion-card::after {
  content: attr(data-rank);
  position: absolute;
  right: 1.25rem;
  bottom: 0.4rem;
  color: rgba(255, 255, 255, 0.035);
  font: 700 6rem/1 var(--display);
}

.champion-card .crown { color: var(--yellow); font-size: 1.5rem; }
.champion-card h3 { margin: 2rem 0 0.45rem; font: 600 1.75rem/1 var(--display); text-transform: uppercase; }
.champion-card p { margin-bottom: 0.35rem; color: var(--muted); }
.champion-card .win-count { color: #ff8b96; font-weight: 700; }

.weekly-heading { align-items: center; }

.week-picker {
  display: grid;
  gap: 0.45rem;
  min-width: 12rem;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.week-picker select {
  width: 100%;
  padding: 0.8rem 2.3rem 0.8rem 0.9rem;
  border: 1px solid var(--line);
  border-radius: 0;
  color: var(--paper);
  background: var(--black-light);
  font: 700 1rem var(--body);
}

.week-summary {
  display: grid;
  grid-template-columns: 1.5fr 1.5fr 1fr 1fr;
  border: 1px solid var(--line);
  border-top: 5px solid var(--red);
  background: var(--black-light);
}

.week-summary article {
  min-width: 0;
  padding: 1.5rem;
  border-right: 1px solid var(--line);
}

.week-summary article:last-child { border-right: 0; }

.summary-label {
  margin-bottom: 1rem;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.summary-list-card ul { display: grid; gap: 0.55rem; margin: 0; padding: 0; list-style: none; }
.summary-list-card li { display: flex; justify-content: space-between; gap: 1rem; font-size: 0.9rem; }
.winners-card li strong { color: #67d798; }
.losers-card li strong { color: #ff6673; }
.summary-list-card .empty-result { color: var(--muted); }

.summary-number-card strong {
  display: block;
  color: var(--paper);
  font: 600 clamp(2rem, 4vw, 3.75rem)/1 var(--display);
  font-variant-numeric: tabular-nums;
}

.ledger-shell { max-height: min(72vh, 50rem); }

.ledger-table {
  width: max-content;
  min-width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 0.84rem;
  white-space: nowrap;
}

.ledger-table th,
.ledger-table td {
  min-width: 7rem;
  padding: 0.85rem 1rem;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.ledger-table th {
  position: sticky;
  top: 0;
  z-index: 2;
  color: var(--muted);
  background: #111;
  font-size: 0.68rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.ledger-table th:first-child,
.ledger-table td:first-child {
  position: sticky;
  left: 0;
  z-index: 1;
  min-width: 12rem;
  text-align: left;
  background: var(--black-light);
}

.ledger-table th:first-child { z-index: 3; background: #111; }
.ledger-table tr:hover td { background: #222; }
.ledger-table tr:hover td:first-child { background: #222; }
.ledger-manager { color: var(--paper); font-weight: 700; }
.money-positive { color: #67d798; }
.money-negative { color: #ff6673; }
.money-zero { color: #777; }
.ledger-net { font-weight: 800; }
.ledger-table td.empty-ledger {
  padding: 2rem;
  color: var(--muted);
  text-align: center;
}

footer {
  display: flex;
  align-items: center;
  gap: 1rem;
  max-width: 1240px;
  margin: 4rem auto 0;
  padding: 2rem;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.82rem;
}

footer p { margin: 0; }
footer p:last-child { margin-left: auto; }

@media (max-width: 780px) {
  .site-header { align-items: stretch; flex-direction: column; gap: 1rem; padding: 1rem; }
  .brand small { display: none; }
  .header-actions { align-items: stretch; flex-direction: column; gap: 0.5rem; }
  .data-tools { justify-content: space-between; }
  .site-nav { justify-content: flex-start; }
  .site-nav a { padding: 0.45rem 0.55rem; }
  .hero, .weekly-hero, .dictator-hero, .rules-intro, .flakes-intro, .flakes-grid, .rules-section, .leaderboard-section, .stats-section, .hall-of-fame, .weekly-section, .ledger-section { width: min(100% - 2rem, 1180px); }
  .hero { grid-template-columns: 1fr; gap: 2rem; padding-top: 4rem; }
  .weekly-hero { grid-template-columns: 1fr; gap: 2rem; padding-top: 3.5rem; }
  .dictator-hero { grid-template-columns: 1fr; }
  .dictator-copy { min-height: 24rem; }
  .dictator-portrait { border-top: 1px solid var(--line); border-left: 0; }
  .dictator-portrait img { height: auto; }
  .rule-card { grid-template-columns: 1fr; gap: 1rem; }
  .flakes-grid { grid-template-columns: 1fr; }
  .flake-card img { height: min(65vw, 25rem); }
  .rule-number { font-size: 2.5rem; }
  .season-switcher { min-width: 0; }
  .section-heading { display: block; }
  .week-picker { margin-top: 1.25rem; }
  .season-description { margin-top: 1rem; text-align: left; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .stats-grid article:nth-child(2) { border-right: 0; }
  .stats-grid article:nth-child(-n + 2) { border-bottom: 1px solid var(--line); }
  .champions-list { grid-template-columns: 1fr; }
  .week-summary { grid-template-columns: 1fr 1fr; }
  .week-summary article:nth-child(2) { border-right: 0; }
  .week-summary article:nth-child(-n + 2) { border-bottom: 1px solid var(--line); }
  footer p:last-child { display: none; }
}

@media (max-width: 430px) {
  .data-status { max-width: 8rem; text-align: right; }
  .site-header .data-status { display: none; }
  .stats-grid { grid-template-columns: 1fr; }
  .stats-grid article { border-right: 0; border-bottom: 1px solid var(--line); }
  .stats-grid article:last-child { border-bottom: 0; }
  .week-summary { grid-template-columns: 1fr; }
  .week-summary article { border-right: 0; border-bottom: 1px solid var(--line); }
  .week-summary article:last-child { border-bottom: 0; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; }
}
