:root {
  --paper: #f7f2e4;
  --ink: #1f1c17;
  --muted: #5c564a;
  --rule: #b9b09a;
  --link: #1f1c17;
  --shame: #9c2b1b;
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper: #1b1a17;
    --ink: #eee8d8;
    --muted: #b3ab98;
    --rule: #4f4a3f;
    --link: #eee8d8;
    --shame: #ee9180;
  }
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 17px/1.5 "Source Serif 4", Georgia, "Times New Roman", serif;
}

a { color: var(--link); text-underline-offset: 2px; }

.masthead {
  max-width: 1040px;
  margin: 0 auto;
  padding: 22px 16px 0;
  text-align: center;
}

.brand {
  display: block;
  color: var(--ink);
  font: 400 clamp(2.5rem, 9vw, 5rem)/1.05 "UnifrakturMaguntia", Georgia, serif;
  text-decoration: none;
}

.tagline {
  margin: 8px 0 0;
  padding: 5px 0;
  border-top: 1px solid var(--ink);
  border-bottom: 1px solid var(--ink);
  color: var(--muted);
  font-size: 0.85rem;
  font-style: italic;
}

nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 2px 22px;
  padding: 8px 0;
  border-bottom: 3px double var(--ink);
}

nav a {
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-decoration: none;
  text-transform: uppercase;
}

nav a[aria-current="page"] { text-decoration: underline; }

.menu-group { position: relative; }

.menu-group summary {
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  list-style: none;
  cursor: pointer;
}

.menu-group summary::-webkit-details-marker { display: none; }
.menu-group summary::after { content: " ▾"; }
.menu-group:has(a[aria-current="page"]) summary { text-decoration: underline; }

.menu-panel {
  position: absolute;
  top: calc(100% + 8px);
  left: 50%;
  z-index: 10;
  display: flex;
  flex-direction: column;
  min-width: 170px;
  transform: translateX(-50%);
  padding: 4px 0;
  background: var(--paper);
  border: 1px solid var(--ink);
  text-align: left;
}

.menu-panel a { padding: 9px 14px; white-space: nowrap; }
.menu-panel a:hover { background: var(--rule); }

@media (max-width: 520px) {
  .menu-group { position: static; }
  nav { position: relative; gap: 2px 12px; }
  nav a, .menu-group summary { letter-spacing: 0.03em; }
  .menu-panel { left: 0; right: 0; top: 100%; transform: none; }
}

.sample-banner {
  max-width: 1040px;
  margin: 12px auto 0;
  padding: 0 16px;
  color: var(--shame);
  font-size: 0.9rem;
}

main { max-width: 1040px; margin: 0 auto; padding: 18px 16px 56px; }

h1, h2, h3 {
  font-family: "Playfair Display", Georgia, serif;
  font-weight: 700;
  line-height: 1.15;
}

h1 { margin: 10px 0 12px; font-size: clamp(2rem, 5vw, 3rem); }
h2 { margin: 30px 0 10px; font-size: 1.5rem; }
h3 { margin: 0 0 6px; font-size: 1.25rem; }

.lead { padding: 10px 0 20px; border-bottom: 1px solid var(--ink); text-align: center; }
.lead h1 { margin: 6px auto 10px; max-width: 18ch; font-size: clamp(2.4rem, 7vw, 4.4rem); }
.lead h1 a { text-decoration: none; }
.deck { margin: 0; color: var(--muted); font-size: 1.2rem; font-style: italic; }

.kicker {
  margin: 0;
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.columns {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  border-bottom: 1px solid var(--ink);
}

.column { padding: 18px 20px; border-left: 1px solid var(--rule); }
.column:first-child { padding-left: 0; border-left: 0; }
.column:last-child { padding-right: 0; }
.column p { margin: 8px 0 0; }

.shame-head { color: var(--shame); }

.home-lower { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 0 32px; align-items: start; }
.feed-item { padding: 9px 0; border-bottom: 1px solid var(--rule); }
.feed-item p { margin: 0; }
.feed-item p + p { margin-top: 3px; }
.feed-item a { text-decoration: none; }
.feed-item a:hover, .feed-item a:focus-visible { text-decoration: underline; }
.feed-empty { color: var(--muted); }
/* The feed is the newer news, so on a phone it comes before sixteen years of champions. */
@media (max-width: 760px) {
  .home-lower { grid-template-columns: minmax(0, 1fr); }
  .league-feed { order: -1; }
}

.champions { max-width: 520px; }
.champions th:first-child, .champions td:first-child { width: 80px; }
.champions td:first-child { font-weight: 600; }
.champions a { text-decoration: none; }
.champions a:hover, .champions a:focus-visible { text-decoration: underline; }

.rankings { padding-left: 28px; }
.rankings li { padding: 8px 0; border-bottom: 1px solid var(--rule); }
.rankings strong { font-weight: 600; }
.rankings span { display: block; color: var(--muted); font-size: 0.92rem; font-style: italic; }

.sort-button { all: unset; cursor: pointer; }
.sort-button:hover { text-decoration: underline; }
.sort-button:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
th[aria-sort="ascending"] .sort-button::after { content: " \25B2"; }
th[aria-sort="descending"] .sort-button::after { content: " \25BC"; }
.table-wrap { overflow-x: auto; margin: 16px 0; }
table { width: 100%; border-collapse: collapse; font-size: 0.95rem; font-variant-numeric: tabular-nums; }
th, td { padding: 7px 10px; border-bottom: 1px solid var(--rule); text-align: left; white-space: nowrap; }
tbody th { font-weight: 600; }
thead th {
  border-top: 2px solid var(--ink);
  border-bottom: 2px solid var(--ink);
  font-size: 0.75rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.card-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 0 24px;
  padding: 0;
  list-style: none;
}

.card { padding: 14px 0; border-bottom: 1px solid var(--rule); }
.card h2, .card h3 { margin: 0 0 6px; }
.card p { margin: 3px 0; }
.shame-card h3 a { color: var(--shame); }

.plain-list { padding-left: 20px; }

.stats { display: flex; flex-wrap: wrap; gap: 32px; margin: 18px 0; padding: 12px 0; border-top: 1px solid var(--ink); border-bottom: 1px solid var(--ink); }
.stats dt { color: var(--muted); font-size: 0.75rem; letter-spacing: 0.08em; text-transform: uppercase; }
.stats dd { margin: 0; font: 700 1.8rem "Playfair Display", Georgia, serif; }

@media (max-width: 720px) {
  .columns { grid-template-columns: minmax(0, 1fr); }
  .column, .column:first-child, .column:last-child { padding: 16px 0; border-left: 0; border-bottom: 1px solid var(--rule); }
  .column:last-child { border-bottom: 0; }
}

.stack { display: flex; flex-direction: column; gap: 8px; max-width: 360px; }
.stack label { font-weight: 600; }
.stack input, .callout input { font: inherit; padding: 8px 10px; width: 100%; border: 1px solid var(--rule); background: transparent; color: var(--ink); }
.account-page button { font: inherit; padding: 8px 14px; background: var(--ink); color: var(--paper); border: 1px solid var(--ink); cursor: pointer; }
.account-page button.small { padding: 3px 10px; font-size: 15px; }
.account-page .note { color: var(--muted); font-size: 15px; }
.callout { display: flex; flex-direction: column; gap: 6px; padding: 12px; margin-bottom: 14px; border: 1px solid var(--ink); }
.account-page th, .account-page td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--rule); }
.account-page table { width: 100%; border-collapse: collapse; }
.table-scroll { overflow-x: auto; }
