/* Dark theme only. The accents come from the current belt holder's colors:
   app.js sets these variables from its palette on :root, and a team page sets its
   own team's on #view. The values here are Notre Dame's (navy and gold), so the
   page looks right before the script runs. */
:root {
  --bg: #0a0e17;
  --surface: #111827;
  --surface-2: #162034;
  --surface-3: #1c2942;
  --border: #233150;
  --ink: #eef2f9;
  --ink-2: #c0cadb;
  --muted: #8592ab;

  --accent: #c99700;          /* primary team color: buttons-on-gold, plate, highlights */
  --accent-ink: #e0b53a;      /* the same, light enough for text */
  --accent-soft: rgba(201, 151, 0, .14);
  --on-accent: #14110a;       /* text on an --accent background */
  --accent-2: #3a67b0;        /* secondary team color: pressed toggles, tile tops */
  --accent-2-ink: #8fb0e8;
  --accent-2-soft: rgba(58, 103, 176, .16);
  --band: #0c2340;            /* decade bands, the secondary color at full depth */

  --strap: #06101f;           /* masthead gradient */
  --strap-2: #0c1d38;
  --strap-muted: #9aa8c4;

  /* Medals and the #1 rank badge keep their metal colors on every theme. */
  --medal-gold: #e2ad2e;
  --medal-silver: #c3cad5;
  --medal-bronze: #c8834a;

  --radius: 10px;
  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --display: "Oswald", "Arial Narrow", "Segoe UI", sans-serif;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 15px/1.5 var(--font);
  font-variant-numeric: tabular-nums;
}
a { color: var(--ink); }
h1, h2, h3, h4 { margin: 0; line-height: 1.2; }
.wrap { max-width: 1160px; margin: 0 auto; padding: 0 16px; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.sub { color: var(--muted); margin: 4px 0 0; }

/* ---------- Logos ---------- */

.logo { width: 24px; height: 24px; flex: none; object-fit: contain; }
.logo.mono {
  display: inline-grid; place-items: center; border-radius: 50%;
  background: var(--surface-3); color: var(--ink-2); border: 1px solid var(--border);
  font: 700 9px/1 var(--font); letter-spacing: -.02em;
}
.logo.xl { width: 72px; height: 72px; }
.logo.xl.mono { font-size: 22px; }

/* ---------- Masthead ---------- */

.masthead {
  background:
    radial-gradient(1200px 300px at 85% -40%, color-mix(in srgb, var(--accent-2) 35%, transparent), transparent 70%),
    linear-gradient(180deg, var(--strap) 0%, var(--strap-2) 100%);
  padding-top: 26px;
  border-bottom: 1px solid var(--border);
}
.brand { display: flex; gap: 14px; align-items: center; }
.brand-mark { flex: none; width: 64px; height: 64px; filter: drop-shadow(0 4px 10px color-mix(in srgb, var(--accent) 25%, transparent)); }
.masthead h1 { font: 700 clamp(24px, 4vw, 34px)/1.1 var(--display); letter-spacing: .02em; text-transform: uppercase; }
.tagline { margin: 4px 0 0; color: var(--strap-muted); }
.home-link { color: inherit; text-decoration: none; }
a.home-link:has(.brand-mark) { display: block; flex: none; }

.hero {
  margin: 22px 0 0;
  display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: 14px;
}
.plate {
  display: flex; gap: 18px; align-items: center;
  background: linear-gradient(135deg, color-mix(in srgb, var(--accent) 75%, white) 0%, var(--accent) 55%, color-mix(in srgb, var(--accent) 70%, black) 100%);
  color: var(--on-accent);
  border-radius: 14px;
  padding: 18px 20px;
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, .25), 0 10px 30px rgba(0, 0, 0, .45);
}
/* With no next game card, the plate fills the column beside the wins card. */
.hero.no-next .plate { grid-row: span 2; }
.plate-logo {
  flex: none; width: 88px; height: 88px; border-radius: 50%; display: grid; place-items: center;
  background: var(--strap); box-shadow: 0 0 0 3px rgba(255, 255, 255, .35), 0 0 0 6px color-mix(in srgb, var(--strap) 35%, transparent);
}
.plate-logo .logo { width: 62px; height: 62px; }
.plate-text { display: flex; flex-direction: column; min-width: 0; }
.eyebrow { font: 600 12px/1 var(--font); letter-spacing: .12em; text-transform: uppercase; opacity: .75; }
.plate a { color: inherit; text-decoration: none; }
.holder { align-self: flex-start; margin: 6px 0 4px; font: 700 clamp(32px, 5.5vw, 50px)/1 var(--display); text-transform: uppercase; letter-spacing: .01em; }
.holder:hover { text-decoration: underline; text-decoration-thickness: 3px; }
/* The holder's rank in the latest AP poll, before its name. */
.holder-rank { font-size: .6em; opacity: .7; }
.hero-sub { font-weight: 500; }
.plate-stats {
  display: flex; flex-wrap: wrap; gap: 10px 28px;
  margin-top: 12px; padding-top: 10px; border-top: 1px solid color-mix(in srgb, var(--on-accent) 22%, transparent);
}
.ps-group { display: flex; flex-direction: column; gap: 5px; }
.ps-group + .ps-group { padding-left: 28px; border-left: 1px solid color-mix(in srgb, var(--on-accent) 22%, transparent); }
.ps-vals { display: flex; gap: 12px; align-items: baseline; font-size: 14px; font-weight: 500; }
.ps-vals b { font: 700 22px/1 var(--display); }
.pt-label { font: 600 11px/1 var(--font); letter-spacing: .12em; text-transform: uppercase; opacity: .75; }
/* The previous reign's dates and days; a click opens its games in .prev-pop. */
/* It doesn't fit beside the other two, so it gets a row of its own. */
.ps-group.ps-prev-group { flex-basis: 100%; flex-direction: row; flex-wrap: wrap; align-items: baseline; gap: 6px 12px; padding: 8px 0 0; border-left: 0; border-top: 1px solid color-mix(in srgb, var(--on-accent) 22%, transparent); }
.ps-prev {
  display: flex; gap: 12px; align-items: baseline; margin: -3px -6px; padding: 3px 6px; border: 0; border-radius: 6px; cursor: pointer;
  background: transparent; color: inherit; font: 500 14px/1.2 var(--font); text-align: left;
}
.ps-prev b { font: 700 22px/1 var(--display); }
.ps-prev > span { white-space: nowrap; }
.ps-prev:hover, .ps-prev[aria-expanded="true"] { background: color-mix(in srgb, var(--on-accent) 12%, transparent); }
.ps-prev .chev { align-self: center; opacity: .7; }
.prev-pop {
  position: absolute; z-index: 20; padding: 12px 14px 6px; border-radius: 12px;
  background: var(--surface-2); border: 1px solid var(--border); box-shadow: 0 12px 30px rgba(0, 0, 0, .5); color: var(--ink);
}
.prev-pop[hidden] { display: none; }
.pp-head { margin: 0 0 8px; display: flex; flex-wrap: wrap; gap: 2px 10px; align-items: baseline; font-size: 14px; }
.pp-head span { color: var(--muted); font-size: 13px; }
.prev-pop .gl { grid-template-columns: 22px minmax(0, 1fr) auto; gap: 1px 10px; }
.prev-pop .gl-when { grid-column: 2; grid-row: 1; flex-direction: row; flex-wrap: wrap; gap: 0 6px; align-items: baseline; }
.prev-pop .gl-when small::before { content: "· "; }
.prev-pop .gl-opp { grid-column: 2; grid-row: 2; }
.prev-pop .gl-place { grid-column: 2; grid-row: 3; }
.prev-pop .gl-no { grid-row: 1 / span 3; }
.prev-pop .gl-res { grid-column: 3; grid-row: 1 / span 3; }
/* The right padding keeps the scores clear of an overlay scrollbar. */
.prev-pop .game-list { max-height: min(60vh, 420px); overflow-y: auto; scrollbar-width: thin; padding-right: 12px; }

.hero-card { min-width: 0; background: rgba(255, 255, 255, .04); border: 1px solid color-mix(in srgb, var(--accent-2-ink) 14%, transparent); border-radius: 12px; padding: 12px 14px; }
.hero-card p { margin: 0; }
.card-label { display: flex; align-items: center; gap: 8px; color: var(--strap-muted); font: 500 12px/1.5 var(--font); text-transform: uppercase; letter-spacing: .08em; }
.card-big { margin-top: 2px !important; font: 600 26px/1.1 var(--display); }

/* Spans both rows beside the plate and next game; the list scrolls once it is taller than they are. */
.wins { grid-row: span 2; display: flex; flex-direction: column; container: wins / inline-size; }
.wins-sort {
  margin-left: auto; display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border-radius: 6px; cursor: pointer;
  border: 1px solid color-mix(in srgb, var(--accent-2-ink) 20%, transparent); background: transparent; color: var(--ink-2); font: 600 11px/1.5 var(--font); letter-spacing: .06em; text-transform: uppercase;
}
.wins-sort:hover { color: var(--ink); border-color: color-mix(in srgb, var(--accent-2-ink) 40%, transparent); }
.wins-sort span { font-size: 13px; color: var(--accent-ink); }
.wins-list {
  list-style: none; margin: 6px 0 0; padding: 0;
  flex: 1 1 auto; min-height: 160px; contain: size; overflow-y: auto; scrollbar-width: thin; scrollbar-gutter: stable;
}
/* Fixed side columns keep every row's number, location and score lined up. */
.wins-list li {
  display: grid; grid-template-columns: 18px minmax(0, 1fr) 104px 80px; align-items: center; gap: 4px 10px;
  margin-right: 8px; padding: 5px 8px 5px 4px; border: 1px solid transparent; border-bottom-color: color-mix(in srgb, var(--accent-2-ink) 10%, transparent);
}
.wins-list li:last-child { border-bottom-color: transparent; }
.wins-list li.belt-win { margin-top: 2px; margin-bottom: 4px; border-color: color-mix(in srgb, var(--accent) 35%, transparent); border-radius: 8px; background: var(--accent-soft); }
.w-no { text-align: center; color: var(--strap-muted); font: 600 15px/1 var(--display); }
.belt-win .w-no { color: var(--accent-ink); font-size: 14px; }
.wins-list .team-link { min-width: 0; }
.wins-list .logo { width: 26px; height: 26px; }
.w-name { display: flex; flex-direction: column; min-width: 0; line-height: 1.3; }
.w-name > * { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* The "Won the belt" tag drops under the name when the row is too narrow for both. */
.belt-win .w-team { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 4px; white-space: normal; }
.w-name small { color: var(--strap-muted); font: 500 12px var(--font); }
.w-at { color: var(--strap-muted); font-weight: 500; font-size: 13px; }
.w-tag { display: inline-block; margin-left: 4px; padding: 0 6px; border-radius: 99px; background: var(--accent); color: var(--on-accent); font: 700 10px/1.6 var(--font); letter-spacing: .06em; text-transform: uppercase; vertical-align: 1px; }
.wins-list .team-link:hover .w-name { text-decoration: none; }
/* Underline only the rank + name (one inline run), not "vs." or the "Won the belt" tag. */
.wins-list .team-link:hover .w-opp { text-decoration: underline; }
.w-place { display: flex; flex-direction: column; min-width: 0; color: var(--strap-muted); font-size: 12px; line-height: 1.3; }
/* "OT" / "2OT" beside a score. */
.ot { display: inline-block; margin-left: .3em; font: 600 .6em/1 var(--font); letter-spacing: .04em; opacity: .8; }
/* Lists keep a slot for it on every row, so scores and W/L badges line up whether or not a game went to overtime. */
.w-score, .gl-score { display: inline-flex; align-items: baseline; justify-content: flex-end; }
.w-score:not(:has(.ot))::after { content: ""; flex: none; width: 2.2em; margin-left: .3em; font-size: .6em; }
.w-score { text-align: right; white-space: nowrap; font: 600 18px/1 var(--display); color: var(--accent-ink); }

/* Matchup on the left, when/where on the right; stacks on narrow cards. */
.next-game {
  display: flex; align-items: center; justify-content: space-between; gap: 8px 20px; flex-wrap: wrap;
  border-color: color-mix(in srgb, var(--accent) 35%, transparent); background: linear-gradient(90deg, color-mix(in srgb, var(--accent) 10%, transparent), color-mix(in srgb, var(--accent-2) 8%, transparent));
  container: next-game / inline-size;
}
.next-game .card-label { color: var(--accent-ink); }
.next-game .matchup { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; font: 600 20px/1.2 var(--display); text-transform: uppercase; letter-spacing: .02em; margin-top: 4px; }
.next-game .matchup .team-link { gap: 8px; font-weight: 600; }
.next-game .matchup .logo { width: 30px; height: 30px; }
.next-game .at { font: 500 13px var(--font); color: var(--strap-muted); text-transform: none; }
.ng-info { text-align: right; margin-left: auto; min-width: 0; max-width: 100%; }
.next-game .when { display: flex; flex-wrap: wrap; justify-content: flex-end; align-items: center; gap: 4px 8px; font: 500 14px/1.4 var(--font); color: var(--ink); }
.next-game .tv { padding: 0 7px; border-radius: 6px; border: 1px solid color-mix(in srgb, var(--accent) 45%, transparent); color: var(--accent-ink); font: 700 11px/1.6 var(--font); letter-spacing: .06em; }
.next-game .where { display: flex; flex-direction: column; color: var(--strap-muted); font-size: 13px; line-height: 1.35; margin-top: 2px; }
/* No margin here: the space after the rank is what separates it, and it keeps the hover underline unbroken. */
.next-game .matchup .poll-rank { font-size: 13px; vertical-align: 2px; }
/* The toggle and poll source run along the bottom; the rest of the schedule opens beneath them. */
.next-game.expandable { cursor: pointer; }
.ng-foot {
  flex: 1 1 100%; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 4px 12px;
  padding-top: 8px; border-top: 1px solid color-mix(in srgb, var(--accent-2-ink) 12%, transparent);
}
.ng-toggle {
  display: inline-flex; align-items: center; gap: 6px; padding: 0; border: 0; background: none; cursor: pointer;
  color: var(--accent-ink); font: 600 12px/1.5 var(--font); letter-spacing: .08em; text-transform: uppercase;
}
/* Underline only the label: a flex item would otherwise inherit the button's underline, count badge included. */
.next-game.expandable:hover .ng-label { text-decoration: underline; }
.ng-toggle .chev { margin-left: 2px; }
.ng-count { display: inline-block; text-decoration: none; padding: 0 6px; border-radius: 99px; background: var(--accent); color: var(--on-accent); font-size: 11px; letter-spacing: 0; }
.ng-count[hidden] { display: none; }
.ng-list li.ng-cond, .ng-list li.ng-bowl { display: block; padding-top: 0; }
.ng-list li.ng-cond .ng-note { margin: 0; }
.ng-poll { margin-left: auto; color: var(--strap-muted); font-size: 12px; }
.ng-more { flex: 1 1 100%; min-width: 0; cursor: auto; }
.ng-note { color: var(--strap-muted); font-size: 12px; margin-bottom: 2px !important; }
.ng-winner { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 2px 0 6px; }
.ng-winner-label { margin-right: 2px; color: var(--strap-muted); font-size: 12px; }
.ng-pick {
  display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px 3px 6px; border-radius: 99px; cursor: pointer;
  border: 1px solid color-mix(in srgb, var(--accent-2-ink) 22%, transparent); background: transparent; color: var(--ink-2); font: 600 12px/1.4 var(--font);
}
.ng-pick .logo { width: 18px; height: 18px; }
.ng-pick:hover { color: var(--ink); border-color: color-mix(in srgb, var(--accent-2-ink) 45%, transparent); }
.ng-pick[aria-pressed="true"] { background: var(--accent-soft); border-color: var(--accent); color: var(--accent-ink); }
.ng-list { list-style: none; margin: 0; padding: 0; }
.ng-list li {
  display: grid; grid-template-columns: 92px minmax(0, 1fr) minmax(0, 170px) 64px; align-items: center; gap: 4px 10px;
  padding: 6px 2px; border-bottom: 1px solid color-mix(in srgb, var(--accent-2-ink) 10%, transparent);
}
.ng-list li:last-child { border-bottom: 0; padding-bottom: 0; }
.u-when { display: flex; flex-direction: column; line-height: 1.3; font-size: 13px; }
.u-when b { font-weight: 600; }
.u-when small { color: var(--strap-muted); font: 500 12px var(--font); }
.ng-list .team-link { min-width: 0; }
.ng-list .logo { width: 24px; height: 24px; }
.u-team { min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-weight: 600; }
.u-team .poll-rank { color: var(--strap-muted); font-size: 12px; }
.u-place { display: flex; flex-direction: column; min-width: 0; color: var(--strap-muted); font-size: 12px; line-height: 1.3; }
.u-tv { text-align: right; }

.tabs { margin-top: 22px; position: sticky; top: 0; z-index: 5; background: color-mix(in srgb, var(--strap-2) 96%, transparent); backdrop-filter: blur(6px); border-top: 1px solid color-mix(in srgb, var(--accent-2-ink) 10%, transparent); }
.tabs-inner { display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; }
.tabs a {
  color: var(--strap-muted); text-decoration: none; white-space: nowrap;
  padding: 14px 14px 12px; font-weight: 600; border-bottom: 3px solid transparent;
}
.tabs a:hover { color: var(--ink); }
.tabs a[aria-current] { color: var(--ink); border-bottom-color: var(--accent); }

main.wrap { padding-top: 44px; padding-bottom: 40px; outline: none; }

/* ---------- Shared pieces ---------- */

.section-intro { margin-bottom: 16px; }
.section-intro h2, .team-head h2 { font: 600 26px/1.2 var(--display); text-transform: uppercase; letter-spacing: .02em; }
/* A tab's description, or where a panel's numbers come from, lives in a tip on its heading. */
.section-intro { position: relative; }
.tip-h { width: fit-content; cursor: help; }
.tip-h:focus { outline: none; }
.tip-h:focus-visible { outline: 2px solid var(--accent-2-ink); outline-offset: 2px; }
.tip-h:hover .tip, .tip-h:focus .tip { display: block; }
.section-intro .tip { width: min(420px, 100%); }
/* A hover or tap tip, placed under its positioned parent. */
.tip {
  position: absolute; left: 0; top: calc(100% + 6px); z-index: 20; display: none; width: min(320px, 100%); pointer-events: none;
  padding: 10px 12px; border-radius: 10px; background: var(--surface-2); border: 1px solid var(--border); box-shadow: 0 12px 30px rgba(0, 0, 0, .5);
  color: var(--ink); font: 400 13px/1.4 var(--font); letter-spacing: normal; text-transform: none; text-decoration: none; text-align: left;
}
.panel { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px; margin-bottom: 20px; }
.panel-head { margin-bottom: 12px; }
.panel-head h3 { font: 600 18px/1.2 var(--display); text-transform: uppercase; letter-spacing: .03em; }

.toolbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin: 0 0 12px; }
.search { flex: 0 1 300px; }
.search input, .select select {
  width: 100%; font: inherit; color: var(--ink);
  background: var(--surface); border: 1px solid var(--border); border-radius: 8px; padding: 9px 12px;
}
.select select { width: auto; padding-right: 30px; cursor: pointer; }
.select select optgroup { color: var(--muted); }
.select select option { color: var(--ink); background: var(--surface); }
.search input:focus, .select select:focus, button:focus-visible, a:focus-visible {
  outline: 2px solid var(--accent-2-ink); outline-offset: 2px;
}
.count { color: var(--muted); font-size: 14px; }
.mobile-only { display: none; }

/* A team's AP rank before its name in a game: "#5 Ohio State". */
.poll-rank { color: var(--muted); font: 600 .85em/1 var(--font); letter-spacing: 0; text-transform: none; font-variant-numeric: tabular-nums; }
.hero .poll-rank { color: var(--strap-muted); }
.mt-head .poll-rank { margin-left: 0; }
.team-link { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; text-decoration: none; vertical-align: middle; }
/* Only the outer span, so the rank and the name inside it share one unbroken line. */
.team-link:hover > span { text-decoration: underline; }
.team-link.small { gap: 5px; font-weight: 500; color: var(--ink-2); }
.team-link.small .logo { width: 18px; height: 18px; }
.team-link.small .logo.mono { font-size: 7px; }
.badge {
  display: inline-block; margin-left: 8px; padding: 2px 8px; border-radius: 999px; vertical-align: 1px;
  background: var(--accent-soft); color: var(--accent-ink); font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase;
}
.badge.big { font-size: 12px; vertical-align: 5px; font-family: var(--font); }
.chip {
  display: inline-block; padding: 1px 9px; margin-right: 6px; border-radius: 999px;
  background: var(--accent-2-soft); color: var(--accent-2-ink); font-size: 12px; font-weight: 600;
}
.detail { display: block; color: var(--muted); font-size: 13px; }
.detail .team-link { align-items: baseline; vertical-align: baseline; }
.detail .team-link .logo { align-self: center; }
.back { margin: 0 0 12px; }
.back a { color: var(--accent-2-ink); text-decoration: none; font-weight: 500; }
.back a:hover { text-decoration: underline; }

/* ---------- Tables ---------- */

table { width: 100%; border-collapse: separate; border-spacing: 0; }
.lineage, .teams { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.panel .lineage { border: 0; border-radius: 0; background: none; }
th, td { text-align: left; padding: 10px 12px; vertical-align: top; }
thead th {
  font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 600;
  border-bottom: 1px solid var(--border); background: var(--surface-2); white-space: nowrap;
}
thead th button {
  all: unset; cursor: pointer; display: inline-flex; gap: 5px; align-items: center;
}
thead th button:hover { color: var(--ink); }
thead th .arrow { color: color-mix(in srgb, var(--accent-2-ink) 35%, var(--surface-2)); font-size: 11px; }
thead th button:hover .arrow { color: var(--muted); }
thead th[aria-sort="descending"], thead th[aria-sort="ascending"] { color: var(--ink); }
thead th[aria-sort="descending"] .arrow, thead th[aria-sort="ascending"] .arrow { color: var(--accent-ink); }
thead th.c-num button { flex-direction: row-reverse; }
tbody td { border-bottom: 1px solid var(--border); }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:not(.decade-row):hover td { background: color-mix(in srgb, var(--accent-2-ink) 4%, transparent); }
.c-num { text-align: right; }
.c-no { width: 48px; color: var(--muted); }
.date { display: block; font-weight: 500; }
.kickoff { margin-left: 8px; font-weight: 500; font-size: 12px; color: var(--accent-2-ink); }
.place { display: block; color: var(--muted); font-size: 12px; margin-top: 1px; }
/* A long place line is cut off rather than widening its column past this. */
.place.trunc { max-width: min(320px, 22vw); }
/* Location lines stay on one line; a long one ends in "…" and shows in full on hover (app.js). */
.trunc { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* Where the two location lines sit side by side on narrow screens, they run as one line
   that's cut off once at the end. */
.where, .w-place, .gl-place { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* Clicking a game row unwraps whatever it cut off. */
.gl, .wins-list > li, .ng-list > li { cursor: pointer; }
.expanded .trunc, .expanded .w-place, .expanded .gl-place, .expanded .where { white-space: normal; overflow: visible; text-overflow: clip; }
.expanded .place.trunc { max-width: none; }
.event { font-weight: 600; }
.reign { display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: 13px; margin-left: 32px; }
.holder-line { display: contents; }
/* --logo-scale evens out round badges (SEC) against the wide wordmarks at the same height. */
.conf-logo { display: block; height: calc(20px * var(--logo-scale, 1)); width: auto; max-width: 56px; object-fit: contain; }
.reign .conf-logo { height: calc(15px * var(--logo-scale, 1)); max-width: 44px; }
.conf-logo[data-conf="SEC"] { --logo-scale: 1.25; }
.conf-text { color: var(--ink-2); }
.reign .conf-text { color: var(--muted); }
.reign.solo { color: var(--ink); font-size: 15px; font-weight: 600; display: inline; margin: 0; }
.still { color: var(--accent-ink); font-weight: 600; }
.decade-row th {
  background: var(--band); color: color-mix(in srgb, var(--accent-2-ink) 35%, white);
  font: 600 16px/1.2 var(--display); letter-spacing: .04em;
  border-top: 1px solid color-mix(in srgb, var(--accent-2-ink) 25%, transparent); border-bottom: 1px solid color-mix(in srgb, var(--accent-2-ink) 25%, transparent);
  box-shadow: inset 4px 0 0 var(--accent);
}
.decade-row th span { font: 500 12px var(--font); color: var(--accent-2-ink); letter-spacing: 0; margin-left: 8px; }
tr.is-current td { background: var(--accent-soft); }
tr.is-current:hover td { background: var(--accent-soft); }
.empty td { text-align: center; color: var(--muted); padding: 32px; }

/* Reigns with more than one game open to list them; the games count is the toggle. */
.chev {
  display: inline-block; width: 7px; height: 7px; margin-left: 7px; vertical-align: 2px;
  border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(45deg); transition: transform .15s;
}
[aria-expanded="true"] > .chev { transform: rotate(-135deg); vertical-align: -1px; }
tr.expandable { cursor: pointer; }
.expand {
  all: unset; cursor: pointer; display: inline-flex; align-items: center; padding: 1px 6px; margin: -1px -6px 0 0; border-radius: 6px;
  color: var(--ink); font-weight: 600;
}
.expand .chev { color: var(--accent-2-ink); }
/* Lines plain counts up with the counts that carry a chevron. */
.no-expand { padding-right: 14px; }
tr.expandable:hover .expand, .expand:hover { background: var(--accent-2-soft); }
.expand:focus-visible { outline: 2px solid var(--accent-2-ink); outline-offset: 2px; }
tr.open td { border-bottom-color: transparent; }
.reign-games td { padding: 0 12px 14px; background: var(--surface) !important; }
tr.is-current + .reign-games td { background: var(--accent-soft) !important; }
.reign-games .game-list { background: var(--bg); border: 1px solid var(--border); border-radius: 8px; padding: 4px 10px; }

/* One belt game per row: number, date, opponent, place, result. */
.game-list { list-style: none; margin: 0; padding: 0; }
.gl {
  display: grid; grid-template-columns: 28px 132px minmax(0, 1.2fr) minmax(0, 1fr) 112px; gap: 2px 12px; align-items: center;
  padding: 7px 0; border-bottom: 1px solid var(--border); font-size: 14px;
}
.gl:last-child { border-bottom: 0; }
.gl-no { text-align: center; color: var(--muted); font: 600 14px/1 var(--display); }
.gl.belt-win .gl-no { color: var(--accent-ink); }
.gl-when { display: flex; flex-direction: column; line-height: 1.3; }
.gl-date { font-weight: 500; white-space: nowrap; }
.gl-when small { color: var(--muted); font-size: 12px; }
.gl-opp { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 6px; min-width: 0; }
.gl-opp > .w-at:first-child { min-width: 24px; } /* "at" and "vs." take the same room, so the logos line up */
.gl-opp .team-link.small { color: var(--ink); font-weight: 600; }
.gl-tag { white-space: nowrap; padding: 0 7px; border-radius: 99px; font: 700 10px/1.7 var(--font); letter-spacing: .06em; text-transform: uppercase; background: var(--surface-3); color: var(--ink-2); }
.gl.belt-win .gl-tag { background: var(--accent); color: var(--on-accent); }
.gl.belt-loss .gl-tag { background: rgba(232, 93, 93, .18); color: #ff9c9c; }
.gl.closest .gl-tag { background: var(--accent-2-soft); color: var(--accent-2-ink); }
.gl-as { color: var(--muted); font-size: 12px; font-style: italic; }

/* Medals on record games, and the list of records they open. */
.medal {
  --metal: var(--medal-gold);
  display: inline-grid; place-items: center; width: 22px; height: 24px; margin: 0 0 0 4px; vertical-align: -6px;
  border-radius: 5px; cursor: help;
}
.medal.silver { --metal: var(--medal-silver); }
.medal.bronze { --metal: var(--medal-bronze); }
.medal svg { width: 16px; height: 19px; overflow: visible; filter: drop-shadow(0 1px 1px rgba(0, 0, 0, .5)); }
.medal .m-ribbon { fill: color-mix(in srgb, var(--metal) 45%, #b23a3a); }
.medal .m-disc { fill: var(--metal); }
.medal .m-ring { fill: none; stroke: color-mix(in srgb, var(--metal) 55%, white); stroke-width: 1.2; }
.medal:hover, .medal[aria-describedby] { background: color-mix(in srgb, var(--metal) 20%, transparent); }
.medal:focus-visible { outline: 2px solid var(--accent-2-ink); outline-offset: 1px; }
.gl-res .medal { margin: 0 2px 0 0; }
/* Above the popups (z-index 20), since a medal inside one shows its tip over it. */
#medal-tip, #slow-tip {
  position: absolute; z-index: 30; padding: 10px 12px; border-radius: 10px;
  background: var(--surface-2); border: 1px solid var(--border); box-shadow: 0 12px 30px rgba(0, 0, 0, .5);
  color: var(--ink); font-size: 13px; line-height: 1.4;
}
#medal-tip[hidden], #slow-tip[hidden] { display: none; }
#slow-tip { pointer-events: none; }
.mt-head { margin: 0 0 6px; font-weight: 600; }
.mt-head span { color: var(--muted); font-weight: 500; margin-left: 4px; }
#medal-tip ul { list-style: none; margin: 0; padding: 0; }
#medal-tip li { display: flex; gap: 8px; align-items: flex-start; padding: 5px 0; border-top: 1px solid var(--border); }
#medal-tip small { display: block; color: var(--muted); font-size: 12px; }
.mt-place { flex: none; min-width: 34px; padding: 1px 0; border-radius: 99px; text-align: center; font-size: 11px; font-weight: 700; color: #14110a; background: var(--medal-gold); }
.mt-place.silver { background: var(--medal-silver); }
.mt-place.bronze { background: var(--medal-bronze); }
.mt-val { color: var(--accent-ink); font-weight: 600; white-space: nowrap; }
.gl-place { display: flex; flex-direction: column; min-width: 0; color: var(--muted); font-size: 12px; line-height: 1.3; }
.gl-res { display: flex; align-items: center; justify-content: flex-end; gap: 8px; white-space: nowrap; }
.gl-score { min-width: 50px; text-align: right; font: 600 17px/1 var(--display); }
/* A list with an overtime game widens every score box by the room the "OT" label takes, so the W/L badges stay in one column. */
.game-list:has(.ot) .gl-score { min-width: 76px; }
.res { display: inline-grid; place-items: center; width: 20px; height: 20px; border-radius: 5px; font: 700 11px/1 var(--font); }
.res-W { background: rgba(76, 175, 120, .18); color: #7fdca6; }
.res-L { background: rgba(232, 93, 93, .18); color: #ff9c9c; }
.res-T { background: var(--surface-3); color: var(--ink-2); }
.panel .game-list .gl:first-child { padding-top: 0; }
.team-page .main-table .game-list .gl:first-child { padding-top: 7px; }

.table-scroll { overflow-x: auto; }

/* ---------- Opportunities ---------- */
.odds .c-way { min-width: 220px; font-size: 13px; color: var(--ink-2); }
.odds .way-if { color: var(--muted); }
.odds .c-reg, .odds .c-post, .odds .c-end { white-space: nowrap; }
.team-link.plain:hover span { text-decoration: none; }
/* Labels hold two lines, so the numbers line up and the table stays put as the switches change. */
.odds-tiles .tile-label { flex: 1 0 auto; min-height: 2.7em; line-height: 1.35; }
/* Wide enough for every conference, so it keeps its width as the switches change who's listed. */
#odds-conf { min-width: 13rem; }
.odds-foot { margin-top: 14px; font-size: 13px; max-width: 90ch; }

.odds-panel .sub a { color: var(--accent-2-ink); }
.odds-panel .panel-head { position: relative; }
.op-sum { display: flex; align-items: baseline; gap: 10px; margin-bottom: 8px; }
.op-big { font: 600 36px/1 var(--display); color: var(--accent-ink); }
.op-chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 4px 0 10px; }
.op-chip { padding: 3px 10px; border-radius: 99px; background: var(--surface-2); border: 1px solid var(--border); font-size: 13px; color: var(--ink-2); }
.op-chip b { color: var(--ink); }
.op-h { margin: 18px 0 2px; font: 600 15px/1.2 var(--display); text-transform: uppercase; letter-spacing: .06em; }
.op-h span { margin-left: 6px; color: var(--accent-ink); }
.op-note { margin-bottom: 8px; font-size: 13px; }
.op-more { margin-top: 8px; font-size: 13px; }
.routes { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.route { border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface-2); padding: 10px 12px; }
.route-head { display: flex; align-items: center; gap: 10px; }
.route-no { flex: none; width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; background: var(--surface-3); color: var(--ink-2); font-size: 12px; font-weight: 700; }
.route-chain { flex: 1; min-width: 0; font-weight: 600; }
.route-p { font: 600 20px/1 var(--display); color: var(--accent-ink); }
.steps { list-style: none; margin: 8px 0 0; padding: 0; }
.steps li {
  display: grid; grid-template-columns: 56px minmax(0, 1fr) 56px; gap: 2px 10px; align-items: center;
  padding: 5px 4px; border-top: 1px solid var(--border); font-size: 14px; color: var(--ink-2);
}
.steps li.change { color: var(--ink); }
.steps.keep li:first-child { border-top: 0; }
.st-when { color: var(--muted); font-size: 13px; }
.st-game small { display: block; color: var(--muted); font-size: 12px; }
.st-tag { margin-left: 6px; padding: 0 6px; border-radius: 99px; background: var(--accent); color: var(--on-accent); font: 700 10px/1.6 var(--font); letter-spacing: .06em; text-transform: uppercase; vertical-align: 1px; }
.st-p { text-align: right; font-weight: 600; color: var(--ink); }
.c-conf { color: var(--ink-2); white-space: nowrap; }
.c-bar { min-width: 160px; white-space: nowrap; }
.c-bar > span:last-child { display: inline-block; min-width: 48px; }
.inline-bar { display: inline-block; width: 90px; height: 8px; margin-right: 8px; vertical-align: 1px; background: var(--surface-3); border-radius: 4px; }
.inline-bar span { display: block; height: 100%; min-width: 2px; background: var(--accent); border-radius: 4px; }
.teams .short { display: none; }
.teams td, .teams th { padding-left: 10px; padding-right: 10px; }
/* "yrs ago" sits beside the date in a fixed-width slot so the dates still line up. */
.teams .c-last { white-space: nowrap; }
.teams td.c-last .detail { display: inline-block; min-width: 84px; margin-left: 6px; font-size: 12px; }

/* ---------- Team detail ---------- */

.team-head { display: flex; gap: 16px; align-items: center; margin-bottom: 18px; }
.team-head .sub { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; }

/* Team pages: a banner in the team's own primary color (with dark text when it's light),
   edged and ringed in its secondary color, which also marks the tiles. */
.team-banner {
  position: relative; overflow: hidden; display: flex; gap: 18px; align-items: center;
  margin-bottom: 18px; padding: 18px 22px; border-radius: 14px;
  background: linear-gradient(115deg, var(--team-1) 0%, var(--team-1) 55%, var(--team-1-deep) 100%);
  color: var(--on-team-1); border-bottom: 6px solid var(--team-2);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .08), 0 10px 26px rgba(0, 0, 0, .35);
}
.tb-logo {
  position: relative; z-index: 1; flex: none; width: 96px; height: 96px; border-radius: 50%; display: grid; place-items: center;
  background: #0b0f17; box-shadow: 0 0 0 4px var(--team-2), 0 4px 14px rgba(0, 0, 0, .4);
}
.tb-logo .logo.xl { width: 66px; height: 66px; }
/* A round logo is the circle itself: no plate, no ring, full size. */
.tb-logo.round, .plate-logo.round { background: none; box-shadow: none; }
.tb-logo.round .logo.xl, .plate-logo.round .logo { width: 100%; height: 100%; }
.team-page .main-table .logo.round { padding: 0; background: none; }
.tb-text { position: relative; z-index: 1; min-width: 0; }
.team-banner h2 { font: 700 30px/1.1 var(--display); text-transform: uppercase; letter-spacing: .02em; }
.tb-nick { font-weight: 500; opacity: .82; }
.team-banner .badge { background: var(--team-2); color: color-mix(in srgb, var(--team-2) 10%, var(--on-team-1)); }
.tb-sub { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; margin: 6px 0 0; font-weight: 500; opacity: .88; }
.team-banner .chip { background: color-mix(in srgb, var(--on-team-1) 16%, transparent); color: inherit; }
.team-page .tile:nth-child(odd) { border-top-color: var(--accent); }
.team-page .tile:nth-child(even) { border-top-color: var(--team-2-line); }
.team-page .tile-label { color: var(--team-2-ink); }
/* The main table (reigns, or every shot for a never-held team) sits on the team's
   primary color when it's a deep one. Its text colors are swapped for ones that read on it, logos get a
   dark backing so a logo in the same color as the page still shows, and results
   are told apart by letter rather than red and green. */
body:not(.team-light) .team-page .main-table {
  --ink: var(--on-team-1); --ink-2: var(--on-team-1); --muted: var(--t1-muted); --border: var(--t1-line);
  --surface-2: var(--t1-shade); --accent-ink: var(--t1-hi); --accent-2-ink: var(--t1-hi);
  background: var(--team-1); border-color: var(--t1-line); color: var(--on-team-1);
}
body:not(.team-light) .team-page .main-table .lineage thead th { background: var(--t1-shade); color: var(--t1-muted); }
body:not(.team-light) .team-page .main-table thead th[aria-sort] { color: var(--on-team-1); }
body:not(.team-light) .team-page .main-table tbody tr:not(.decade-row):hover td { background: color-mix(in srgb, var(--on-team-1) 6%, transparent); }
body:not(.team-light) .team-page .main-table tr.is-current td { background: color-mix(in srgb, var(--on-team-1) 10%, transparent); }
body:not(.team-light) .team-page .main-table .reign-games td { background: transparent !important; }
body:not(.team-light) .team-page .main-table .game-list { background: var(--t1-shade); border: 1px solid var(--t1-line); border-radius: 8px; padding: 4px 10px; }
body:not(.team-light) .team-page .main-table .logo:not(.xl) { padding: 2px; border-radius: 50%; background: #0b0f17; box-sizing: content-box; }
body:not(.team-light) .team-page .main-table .logo.mono { padding: 0; }
body:not(.team-light) .team-page .main-table .res { background: color-mix(in srgb, var(--on-team-1) 14%, transparent); color: var(--on-team-1); }
body:not(.team-light) .team-page .main-table .gl-tag { background: color-mix(in srgb, var(--on-team-1) 14%, transparent); color: var(--on-team-1); }
body:not(.team-light) .team-page .main-table .gl.belt-win .gl-tag { background: var(--t1-hi); color: var(--team-1); }
body:not(.team-light) .team-page .main-table .gl.belt-win .gl-no { color: var(--t1-hi); }
body:not(.team-light) .team-page .main-table .expand .chev { color: var(--t1-hi); }
body:not(.team-light) .team-page .main-table .w-at, body:not(.team-light) .team-page .main-table .gl-as { color: var(--t1-muted); }
body:not(.team-light) .team-page .main-table tr.expandable:hover .expand, body:not(.team-light) .team-page .main-table .expand:hover { background: color-mix(in srgb, var(--on-team-1) 12%, transparent); }
/* With a light primary (gold, orange, light blue), a whole table in it is loud, so the
   rows stay on a dark surface tinted with it; the primary marks the section's header
   band, the table's header row and its border. */
body.team-light .team-page .main-table {
  background: color-mix(in srgb, var(--team-1) 7%, var(--surface)); border: 2px solid var(--team-1); padding-top: 0; overflow: hidden;
}
body.team-light .team-page .main-table .panel-head {
  margin: 0 -18px 14px; padding: 13px 18px 12px; background: var(--team-1); color: var(--on-team-1);
}
body.team-light .team-page .main-table .panel-head .sub { color: color-mix(in srgb, var(--on-team-1) 75%, var(--team-1)); }
body.team-light .team-page .main-table .lineage thead th {
  background: color-mix(in srgb, var(--team-1) 22%, var(--surface-2)); color: var(--ink); border-bottom-color: color-mix(in srgb, var(--team-1) 55%, transparent);
}
body.team-light .team-page .main-table .game-list { border-color: color-mix(in srgb, var(--team-1) 35%, var(--border)); }
body.team-light .team-page .main-table .kickoff { color: var(--team-1); }
.team-page .back a { color: var(--team-2-ink); }
.tiles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 20px; }
.tile { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 16px; display: flex; flex-direction: column; border-top: 3px solid var(--accent-2); }
.tile:first-child { border-top-color: var(--accent); }
.tile-label { font-size: 12px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); font-weight: 600; }
.tile-value { font: 600 32px/1.15 var(--display); margin: 4px 0 2px; }
.tile-sub { color: var(--muted); font-size: 13px; }
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.two-col .panel { margin-bottom: 0; }
.tally { list-style: none; margin: 0; padding: 0; columns: 2; column-gap: 24px; }
.tally li { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 6px 0; border-bottom: 1px solid var(--border); break-inside: avoid; }
.tally li > span { color: var(--muted); }
.tiles.two { grid-template-columns: repeat(2, minmax(0, 1fr)); max-width: 50%; }
.panel-head .sub { font-size: 13px; }

/* ---------- Never held ---------- */

.group-title { font: 600 15px/1 var(--display); text-transform: uppercase; letter-spacing: .1em; color: var(--accent-2-ink); margin: 26px 0 12px; }
.toolbar + .group-title, .section-intro + .group-title { margin-top: 8px; }
.conf-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; align-items: start; }
.conf-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; }
.conf-grid.p4 .conf-card { border-top: 3px solid var(--accent); }
.conf-card h3 { font: 600 17px/1.2 var(--display); text-transform: uppercase; letter-spacing: .03em; display: flex; justify-content: space-between; align-items: baseline; }
.conf-card h3 span { font: 600 13px var(--font); color: var(--accent-2-ink); background: var(--accent-2-soft); border-radius: 999px; padding: 1px 9px; }
.conf-card ul { list-style: none; margin: 10px 0 0; padding: 0; }
.conf-card li { display: flex; align-items: center; gap: 9px; padding: 6px 0; border-top: 1px solid var(--border); }
.conf-card .all-held { margin: 10px 0 0; color: var(--accent-ink); font-size: 14px; }
.conf-card li .team-link { min-width: 0; font-weight: 500; }
.shots {
  margin-left: auto; flex: none; min-width: 24px; padding: 0 7px; border-radius: 999px; text-align: center;
  background: var(--surface-2); border: 1px solid var(--border); color: var(--ink-2); font-size: 12px; font-weight: 600;
}
.group-count { font: 600 13px var(--font); color: var(--accent-2-ink); background: var(--accent-2-soft); border-radius: 999px; padding: 1px 9px; margin-left: 6px; letter-spacing: 0; vertical-align: 1px; }
.group-sub { margin: -6px 0 12px; font-size: 14px; }
.card-note { margin: 4px 0 0; color: var(--muted); font-size: 12px; }
/* Each never-held team: name and shots, then the last shot when the switches ask for it. */
.conf-card li { flex-direction: column; align-items: stretch; gap: 2px; }
.nv-top { display: flex; align-items: center; gap: 9px; min-width: 0; }
.nv-line { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 8px; padding-left: 32px; color: var(--muted); font-size: 12px; line-height: 1.5; }
.nv-date { color: var(--ink-2); font-weight: 500; }
.nv-time { margin-left: 6px; color: var(--accent-2-ink); font-weight: 500; }
.nv-game { display: inline-flex; align-items: center; gap: 5px; color: var(--ink-2); }
.nv-game .res { width: 17px; height: 17px; font-size: 10px; }
.nv-where { flex-basis: 100%; }
.nv-none { font-style: italic; }
.switches { display: flex; flex-wrap: wrap; gap: 8px; }
.switch {
  display: inline-flex; align-items: center; gap: 8px; padding: 7px 12px 7px 8px; border-radius: 8px; cursor: pointer;
  background: var(--surface); border: 1px solid var(--border); color: var(--ink-2); font: 600 13px/1 var(--font);
}
.switch:hover { color: var(--ink); }
.switch-track { position: relative; width: 28px; height: 16px; border-radius: 99px; background: var(--surface-3); border: 1px solid var(--border); transition: background .15s; }
.switch-track::after { content: ""; position: absolute; top: 2px; left: 2px; width: 10px; height: 10px; border-radius: 50%; background: var(--muted); transition: transform .15s, background .15s; }
.switch[aria-pressed="true"] { color: var(--ink); }
.switch[aria-pressed="true"] .switch-track { background: var(--accent); border-color: transparent; }
.switch[aria-pressed="true"] .switch-track::after { transform: translateX(12px); background: var(--on-accent); }

/* ---------- Records ---------- */

/* Each card is a subgrid of four rows (header, note, list, "more" button), so cards
   side by side share row heights and their first records line up even when only
   one has toggles or a note. */
.rec-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.rec-card {
  display: grid; grid-row: span 4; grid-template-rows: subgrid; row-gap: 0;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px;
}
.rec-card.wide { grid-column: 1 / -1; }
.rec-card header.tall { min-height: 54px; }
.rec-card header, .sg-card header { display: flex; flex-wrap: wrap; align-items: center; align-content: center; justify-content: space-between; gap: 8px 12px; padding-bottom: 8px; }
.rec-card h4, .sg-card h4 { font: 600 17px/1.25 var(--display); text-transform: uppercase; letter-spacing: .02em; }
h4.has-tip { cursor: help; }
h4.has-tip:focus { outline: none; }
h4.has-tip:focus-visible { outline: 2px solid var(--accent-2-ink); outline-offset: 2px; }
.rec-note { margin: 0; padding-bottom: 6px; color: var(--muted); font-size: 13px; }
.rec-note:empty { padding: 0; }
/* Cards whose note comes and goes with a toggle keep its line, so the rows below don't shift. */
.rec-note.reserve:empty { padding-bottom: 6px; }
.rec-note.reserve:empty::before { content: "\00a0"; }
.toggles { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 8px; margin-left: auto; }
.rec-card ol { align-self: start; }
.rec-foot { align-self: start; min-height: 38px; }
.seg { display: inline-flex; background: var(--surface-2); border: 1px solid var(--border); border-radius: 8px; padding: 2px; }
.seg button {
  font: 600 12px/1 var(--font); color: var(--muted); background: none; border: 0; border-radius: 6px;
  padding: 7px 10px; cursor: pointer;
}
.seg button:hover { color: var(--ink); }
/* The era switch stacks its two options so it takes less width beside the other toggles. */
.seg-stack { flex-direction: column; }
.seg.ghost { visibility: hidden; pointer-events: none; }
.seg-stack button { padding: 4px 10px; text-align: center; }
.seg button[aria-pressed="true"] { background: var(--accent); color: var(--on-accent); }
.seg-lg button { font-size: 14px; padding: 9px 14px; }
.rec-card ol { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: 24px minmax(0, 1fr) auto auto 26px; column-gap: 10px; }
.rec-card li { padding: 7px 0; border-top: 1px solid var(--border); }
/* One line per record: rank, team, date, value, details button. The rows share the list's columns
   (subgrid), so the dates and values line up from row to row. */
.rec-row { display: grid; grid-column: 1 / -1; grid-template-columns: subgrid; align-items: center; cursor: pointer; }
.rec-row:hover .rec-more { color: var(--ink); background: var(--accent-2-soft); }
.rec-who { min-width: 0; font-weight: 600; }
.rec-who .team-link { max-width: 100%; min-width: 0; }
.rec-who .team-link > span, .season-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.season-name { display: block; }
.rec-when { color: var(--muted); font-size: 13px; white-space: nowrap; }
.rec-more {
  flex: none; width: 26px; height: 26px; display: grid; place-items: center; padding: 0 0 2px; margin-right: -4px;
  border: 0; border-radius: 6px; background: none; color: var(--muted); cursor: pointer;
}
.rec-more .chev { margin: 0; }
.rec-more[aria-expanded="true"] { padding: 4px 0 0; }
.rec-detail {
  grid-column: 1 / -1; margin: 8px 0 2px 34px; padding: 8px 12px; cursor: auto;
  background: var(--surface-2); border-radius: 8px; font-size: 13px;
}
.rd-line { display: block; line-height: 1.6; }
.rd-line b { font-weight: 600; }
.rd-muted { color: var(--muted); }
.rd-belt { color: var(--accent-ink); font-weight: 500; }
.rd-line .team-link.small { color: var(--ink); vertical-align: baseline; align-items: baseline; }
.rd-line .team-link .logo { align-self: center; }
.rank {
  flex: none; width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center;
  font-size: 12px; font-weight: 700; background: var(--surface-2); color: var(--ink-2); border: 1px solid var(--border);
}
.rank.r1 { background: var(--medal-gold); color: #14110a; border-color: transparent; }
.rec-val { text-align: right; white-space: nowrap; font: 600 19px/1.1 var(--display); font-variant-numeric: tabular-nums; }
/* Pieces that vary in width get a fixed one, so the text beside them lines up from row to row: a unit
   that starts at the same place (kickoff time zones), a rank on each side of "over", and a hidden year. */
.rec-val .u-box { display: inline-block; min-width: 4.4em; text-align: left; }
.rec-val .tag { display: inline-block; min-width: 1.8em; text-align: right; }
.rec-val .ghost { visibility: hidden; }
.rec-val small { margin-left: 4px; font: 500 11px var(--font); color: var(--muted); text-transform: uppercase; letter-spacing: .06em; font-variant-numeric: tabular-nums; }
.rec-val small.mid { margin: 0 5px; }
.rec-val small.rec-yrs { display: inline-block; min-width: 7.2em; margin-left: 8px; padding-left: 8px; text-align: left; border-left: 1px solid var(--border); }
.rec-val small.rec-kick { margin: 0 6px 0 0; text-transform: none; letter-spacing: 0; }
/* A long list in a row's details scrolls inside it. */
.rd-scroll { display: block; max-height: 260px; overflow-y: auto; }
.more {
  display: block; margin: 8px 0 0; padding: 6px 10px; border-radius: 6px; cursor: pointer;
  background: none; border: 1px solid var(--border); color: var(--accent-2-ink); font: 600 13px var(--font);
}
.more:hover { background: var(--accent-2-soft); }

/* Scorigami: a square per score (or pair of AP ranks), filled once it has happened. Axis
   labels sit in the grid's first row and column; a wide grid scrolls sideways on phones. */
.sg-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px;
  /* Heatmap ends: the rarest scores the team color, the most common a near-white tint of it. */
  --heat-lo: color-mix(in oklab, var(--accent) 85%, var(--surface-2));
  --heat-hi: color-mix(in oklab, var(--accent) 25%, white);
}
.sg-readout { flex: 1 1 auto; min-width: 0; text-align: right; color: var(--ink-2); font: 600 14px/1.2 var(--font); white-space: nowrap; }
.sg-card .toggles { margin-left: 0; }
.sg-frame { display: grid; grid-template-columns: auto minmax(0, 1fr); grid-template-rows: auto auto auto; gap: 4px 6px; }
.sg-axis-x { grid-column: 2; color: var(--muted); font: 600 11px/1 var(--font); text-transform: uppercase; letter-spacing: .06em; padding-left: 28px; }
.sg-axis-y {
  grid-column: 1; grid-row: 2; writing-mode: vertical-rl; transform: rotate(180deg); text-align: right;
  color: var(--muted); font: 600 11px/1 var(--font); text-transform: uppercase; letter-spacing: .06em; padding-bottom: 28px;
}
.sg-scroll { grid-column: 2; grid-row: 2; overflow-x: auto; scrollbar-width: thin; padding-bottom: 4px; }
/* The right padding leaves room for the last column's label to hang over. */
.sg-grid { display: grid; gap: 1px; padding-right: 8px; grid-template-columns: 24px repeat(var(--sg-cols), minmax(8px, 1fr)); }
.sg-grid.sg-rank { grid-template-columns: 28px repeat(var(--sg-cols), minmax(16px, 30px)); }
.sg-ax { display: flex; align-items: flex-end; justify-content: center; overflow: visible; white-space: nowrap; color: var(--muted); font: 600 10px/1 var(--font); }
.sg-ax b { position: relative; padding: 2px 3px; border-radius: 3px; font-weight: inherit; }
.sg-ax.minor b { visibility: hidden; }
/* The pointed-at square's place on each axis, drawn over its neighbors' labels. */
.sg-ax.hl b { visibility: visible; z-index: 2; background: var(--accent); color: var(--on-accent); }
.sg-top { padding-bottom: 1px; }
.sg-side { align-items: center; justify-content: flex-end; padding-right: 2px; }
.sg-cell { display: block; aspect-ratio: 1; min-width: 0; padding: 0; border: 0; border-radius: 1px; background: color-mix(in srgb, var(--ink) 9%, transparent); }
.sg-rank .sg-cell { border-radius: 3px; }
.sg-cell.sg-x { background: none; }
.sg-cell.on { background: var(--accent); cursor: pointer; }
.sg-grid.heat .sg-cell.on { background: color-mix(in oklab, var(--heat-hi) calc(var(--h) * 100%), var(--heat-lo)); }
.sg-legend { grid-column: 2; display: flex; align-items: center; gap: 8px; padding-left: 28px; color: var(--muted); font: 600 11px/1 var(--font); }
.sg-legend i { width: 140px; height: 10px; border-radius: 2px; background: linear-gradient(90deg, var(--heat-lo), var(--heat-hi)); }
.sg-cell.on:hover, .sg-cell.sel { outline: 2px solid var(--ink); outline-offset: 0; position: relative; z-index: 1; }
.sg-cell:not(.on):not(.sg-x):hover { background: color-mix(in srgb, var(--ink) 20%, transparent); }
.sg-pop .gl { grid-template-columns: minmax(0, 1fr) auto; gap: 1px 10px; }
.sg-pop .gl-when { grid-column: 1; grid-row: 1; flex-direction: row; flex-wrap: wrap; gap: 0 6px; align-items: baseline; }
.sg-pop .gl-when small::before { content: "· "; }
.sg-pop .gl-opp { grid-column: 1; grid-row: 2; }
.sg-pop .gl-place { grid-column: 1; grid-row: 3; }
.sg-pop .gl-res { grid-column: 2; grid-row: 1 / span 3; }
.sg-pop .w-at { color: var(--muted); font-size: 13px; }

.footer { color: var(--muted); font-size: 13px; padding-bottom: 32px; }
.footer p { margin: 0; padding-top: 16px; border-top: 1px solid var(--border); }
.footer code { font-size: 12px; }

/* ---------- Small screens ---------- */

/* The hero cards stack their contents by their own width, which differs between tablets and phones. */
@container next-game (max-width: 520px) {
  .ng-info { text-align: left; margin-left: 0; }
  .next-game .when { justify-content: flex-start; }
  .next-game .where { display: block; }
  .next-game .where .trunc { display: inline; }
  .next-game .where .trunc + .trunc::before { content: " · "; }
  .ng-list li { grid-template-columns: 76px minmax(0, 1fr) auto; }
  .u-place { grid-column: 2; grid-row: 2; display: block; padding-left: 32px; }
  .u-place .trunc { display: inline; }
  .u-place .trunc + .trunc::before { content: " · "; }
  .u-when { grid-row: 1 / span 2; align-self: start; }
  .u-tv { grid-column: 3; grid-row: 1 / span 2; }
  .ng-poll { margin-left: 0; }
}
@container wins (max-width: 480px) {
  .wins-list li { grid-template-columns: 18px minmax(0, 1fr) auto; }
  .wins-list .team-link { grid-column: 2; }
  .w-place { grid-column: 2; grid-row: 2; display: block; padding-left: 34px; }
  .w-place .trunc { display: inline; }
  .w-place .trunc + .trunc::before { content: " · "; }
  .w-no { grid-row: 1 / span 2; }
  .w-score { grid-column: 3; grid-row: 1 / span 2; }
}

@media (max-width: 1000px) {
  .teams td.c-last .detail { display: block; min-width: 0; margin-left: 0; }
  .teams .inline-bar { display: none; }
  .teams .c-bar { min-width: 0; }
  .teams .c-first { white-space: nowrap; }
}

@media (max-width: 960px) {
  .conf-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  /* Place moves under the opponent. */
  .gl { grid-template-columns: 28px 120px minmax(0, 1fr) 112px; }
  .gl-place { grid-column: 3; grid-row: 2; display: block; }
  .gl-place .trunc { display: inline; }
  .gl-place .trunc + .trunc::before { content: " · "; }
  .gl-res { grid-column: 4; grid-row: 1 / span 2; }
  .gl-no, .gl-when { grid-row: 1 / span 2; align-self: start; }
  .gl-no { padding-top: 3px; }
}

@media (max-width: 860px) {
  .hero { grid-template-columns: minmax(0, 1fr); }
  .wins, .hero.no-next .plate { grid-row: auto; }
  .wins-list { contain: none; min-height: 0; max-height: 330px; }
  .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .two-col { grid-template-columns: 1fr; }
  .teams .c-first { display: none; }
}


@media (max-width: 720px) {
  .mobile-only { display: block; }
  .search { flex: 1 1 100%; }
  .plate { padding: 14px 16px; gap: 14px; }
  .plate-logo { width: 64px; height: 64px; }
  .plate-logo .logo { width: 44px; height: 44px; }
  .plate-logo.round .logo { width: 100%; height: 100%; }
  /* The previous reign's dates, days and games wrap instead of running off the card. */
  .ps-group.ps-prev-group { min-width: 0; }
  .ps-prev { flex-wrap: wrap; gap: 2px 12px; max-width: calc(100% + 12px); }
  /* Stat groups left-align under one another, with no divider; each group's numbers stay on one line. */
  .ps-group + .ps-group { padding-left: 0; border-left: 0; }
  .ps-vals { flex-wrap: wrap; gap: 2px 10px; }
  .ps-vals > span { white-space: nowrap; }
  /* The previous reign: dates on their own line, then days and games together. */
  .ps-prev > span:first-child { flex-basis: 100%; }

  /* Lineage rows become cards; sorting moves to the <select>. */
  .lineage thead { display: none; }
  .lineage, .lineage tbody, .lineage tr, .lineage td, .lineage th { display: block; }
  .lineage { background: none; border: 0; overflow: visible; }
  .lineage tbody tr:not(.decade-row) {
    display: grid; grid-template-columns: 1fr 1fr; gap: 8px 12px;
    background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
    padding: 12px 14px; margin-bottom: 10px;
  }
  .lineage tbody tr.is-current { background: var(--accent-soft); }
  .lineage td { padding: 0; border: 0 !important; background: none !important; text-align: left; min-width: 0; }
  .lineage .place.trunc { max-width: none; }
  .lineage td::before {
    content: attr(data-label); display: block; font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); font-weight: 600;
  }
  .lineage td.c-no { display: none; }
  .lineage td.c-holder { grid-column: 1 / -1; font-size: 17px; }
  .lineage td.c-holder::before { display: none; }
  /* "8th reign · conference" shares the name's line when it fits, else drops beneath it (.wrapped, set in app.js). */
  .holder-line { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 10px; }
  .holder-line .reign { margin-left: 0; white-space: nowrap; }
  .holder-line.wrapped .reign { margin-left: 32px; }
  .lineage td[data-label="Won"]::before { display: none; }
  .lineage .decade-row th { padding: 10px 12px; margin-bottom: 8px; border-radius: 8px; border: 0; }
  .panel .lineage tbody tr:not(.decade-row) { background: var(--surface-2); }
  body:not(.team-light) .team-page .main-table .lineage tbody tr:not(.decade-row) { background: var(--t1-shade); border-color: var(--t1-line); }
  .lineage .empty td { grid-column: 1 / -1; }
  /* An open reign's games hang off the bottom of its card. */
  .lineage tbody tr.open { margin-bottom: 0; border-bottom-left-radius: 0; border-bottom-right-radius: 0; }
  .lineage tbody tr.reign-games {
    display: block; padding: 0 10px 10px; margin: 0 0 10px; border-top: 0; border-radius: 0 0 var(--radius) var(--radius);
  }
  .lineage tbody tr.is-current + tr.reign-games { background: var(--accent-soft); }
  .panel .lineage tbody tr.reign-games { background: var(--surface-2); }
  .reign-games td { padding: 0; }
  .reign-games td::before { display: none; }
  .expand { margin: 0; padding: 1px 6px 1px 0; }

  /* On a phone a reign card shows only the win that got the belt; tap the card for the games, the loss and the rest. */
  .lineage td[data-label="Games"], .lineage td[data-label="Days"], .lineage td[data-label="Lost"] { display: none; }
  .lineage td[data-label="Won"] { grid-column: 1 / -1; }
  .lineage tbody tr.expandable { position: relative; cursor: pointer; padding-right: 40px; }
  .lineage tbody tr.expandable::after {
    content: ""; position: absolute; right: 18px; top: 19px; width: 7px; height: 7px;
    border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted); transform: rotate(45deg); transition: transform .15s;
  }
  .lineage tbody tr.expandable.open::after { transform: rotate(225deg); top: 22px; }

  .gl { grid-template-columns: 22px minmax(0, 1fr) auto; gap: 1px 10px; }
  .gl-when { grid-column: 2; grid-row: 1; flex-direction: row; flex-wrap: wrap; gap: 0 6px; align-items: baseline; }
  .gl-when small::before { content: "· "; }
  .gl-opp { grid-column: 2; grid-row: 2; }
  .gl-place { grid-column: 2; grid-row: 3; }
  .gl-no { grid-row: 1 / span 3; }
  .gl-res { grid-column: 3; grid-row: 1 / span 3; }
  .tiles.two { max-width: none; }
  .rec-detail { margin-left: 0; }
  .rec-card ol { column-gap: 8px; }
  .rec-when { font-size: 12px; }
  .rec-val { font-size: 17px; }
  /* A record row is two lines so the team name keeps its room: the date sits under the name, and the
     "157 years" chip under the number. Columns: rank, name/date, (unused), value, details. */
  .rec-row > .rank, .rec-row > .rec-val, .rec-row > .rec-more { grid-row: 1 / span 2; }
  .rec-row > .rank { grid-column: 1; align-self: center; }
  .rec-row > .rec-who { grid-column: 2; grid-row: 1; align-self: end; }
  .rec-row > .rec-when { grid-column: 2; grid-row: 2; align-self: start; white-space: normal; line-height: 1.25; }
  .rec-row > .rec-val { grid-column: 3 / 5; }
  .rec-row > .rec-more { grid-column: 5; }
  .rec-val small.rec-yrs { display: block; min-width: 0; margin: 2px 0 0; padding: 0; border-left: 0; text-align: right; }
  .nv-line { padding-left: 0; }

  .teams .c-conf, .teams .c-reigns, .teams .inline-bar { display: none; }
  .odds .c-reg, .odds .c-post, .odds .c-way { display: none; }
  .teams .c-bar { min-width: 0; }
  .teams .long, .teams td.c-last .detail { display: none; }
  .teams .short { display: inline; }
  .teams td.c-num { white-space: nowrap; }
  .teams thead th { font-size: 11px; letter-spacing: .02em; white-space: normal; }
  th, td { padding: 9px 8px; }
  /* Teams table: fits the screen with no sideways scroll. Team, games, days and last held only,
     in fixed narrow columns; the team name takes the rest and wraps. */
  .teams { table-layout: fixed; font-size: 13px; }
  .teams th, .teams td { padding: 9px 4px; vertical-align: middle; }
  .teams th:first-child, .teams td:first-child { padding-left: 10px; }
  .teams th:last-child, .teams td:last-child { padding-right: 10px; }
  .teams th:nth-child(4), .teams td:nth-child(4) { width: 50px; }
  .teams th:nth-child(5), .teams td:nth-child(5) { width: 54px; }
  .teams th:nth-child(7), .teams td:nth-child(7) { width: 58px; }
  .teams thead th { font-size: 10px; line-height: 1.2; letter-spacing: 0; vertical-align: bottom; }
  .teams thead th button { gap: 2px; white-space: normal; text-align: right; }
  .teams thead th:first-child button { text-align: left; }
  .teams thead th .arrow { font-size: 9px; }
  .teams .team-link { gap: 6px; min-width: 0; }
  .teams .team-link .logo { width: 20px; height: 20px; }
  .teams .badge { margin-left: 4px; padding: 1px 5px; font-size: 9px; }
  .tally { columns: 1; }
  /* minmax(0, ...) lets the column shrink below its widest row instead of widening the page. */
  .rec-grid { grid-template-columns: minmax(0, 1fr); }
  .conf-grid { grid-template-columns: minmax(0, 1fr); }
  .logo.xl { width: 56px; height: 56px; }
  .team-banner { padding: 14px 16px; gap: 14px; }
  .tb-logo { width: 68px; height: 68px; }
  .tb-logo .logo.xl { width: 46px; height: 46px; }
  .tb-logo.round .logo.xl { width: 100%; height: 100%; }
  .team-banner h2 { font-size: 22px; }
  .tb-nick { display: block; font-size: 17px; }
}

/* Lists with an overtime game give the result column room for the wider scores (after every .gl layout above). */
.game-list:has(.ot) .gl { grid-template-columns: 28px 132px minmax(0, 1.2fr) minmax(0, 1fr) 140px; }
@media (max-width: 960px) { .game-list:has(.ot) .gl { grid-template-columns: 28px 120px minmax(0, 1fr) 140px; } }
@media (max-width: 720px) { .game-list:has(.ot) .gl { grid-template-columns: 22px minmax(0, 1fr) auto; } }
/* The popups keep their own narrow layouts when a game in them went to overtime. */
.prev-pop .game-list:has(.ot) .gl { grid-template-columns: 22px minmax(0, 1fr) auto; }
.sg-pop .game-list:has(.ot) .gl { grid-template-columns: minmax(0, 1fr) auto; }
