/* ==========================================================================
   One Page Season
   Mobile-first. Two themes driven by [data-theme] on <html>.

   Visual direction: a broadcast control room. Deep navy panels, chalk-white
   rules, and one loud accent (pylon orange) spent almost entirely on the
   thing the product exists to answer - what channel is the game on. The TV
   chip is styled like the network bug in the corner of a live broadcast and
   is the single boldest element on a card.
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. Tokens
   -------------------------------------------------------------------------- */
:root {
  /* Brand constants - identical in both themes */
  --pylon: #ff5c1a;         /* primary accent: end-zone pylon orange */
  --pylon-soft: rgba(255, 92, 26, 0.14);
  --turf: #17b87c;          /* college / positive states */
  --turf-soft: rgba(23, 184, 124, 0.14);
  --live: #ff3b4e;          /* live only, never decorative */
  --live-soft: rgba(255, 59, 78, 0.14);
  --gold: #f5b93a;          /* ranked teams, featured games */

  --radius-sm: 8px;
  --radius: 14px;
  --radius-lg: 20px;

  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 24px;
  --space-6: 32px;
  --space-7: 48px;
  --space-8: 64px;

  --font-display: 'Barlow Condensed', 'Arial Narrow', system-ui, sans-serif;
  --font-body: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;

  --shell-max: 1200px;
  --header-h: 60px;

  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
}

/* Dark is the default: this is a scoreboard. */
:root,
[data-theme='dark'] {
  --bg: #0a101e;
  --bg-grad: radial-gradient(1200px 600px at 50% -10%, #16233c 0%, #0a101e 60%);
  --surface: #111a2c;
  --surface-2: #172236;
  --surface-3: #1e2b42;
  --border: #24334d;
  --border-strong: #334566;
  --text: #e9eefa;
  --text-muted: #94a3bd;
  --text-faint: #6b7b96;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.4), 0 8px 24px rgba(0, 0, 0, 0.28);
  --chip-bg: rgba(255, 255, 255, 0.05);
  --scrim: rgba(4, 8, 16, 0.72);
  --skeleton: linear-gradient(90deg, #16203300 0%, #22304a80 50%, #16203300 100%);
}

[data-theme='light'] {
  --bg: #eef1f6;
  --bg-grad: radial-gradient(1200px 600px at 50% -10%, #ffffff 0%, #eef1f6 60%);
  --surface: #ffffff;
  --surface-2: #f6f8fc;
  --surface-3: #edf1f8;
  --border: #d9dfea;
  --border-strong: #c3ccdb;
  --text: #0d1729;
  --text-muted: #55637c;
  --text-faint: #7b8799;
  --shadow: 0 1px 2px rgba(16, 26, 45, 0.06), 0 8px 24px rgba(16, 26, 45, 0.08);
  --chip-bg: rgba(13, 23, 41, 0.04);
  --scrim: rgba(16, 24, 40, 0.4);
  --skeleton: linear-gradient(90deg, #e9edf400 0%, #dde3ee 50%, #e9edf400 100%);
}

/* --------------------------------------------------------------------------
   2. Base
   -------------------------------------------------------------------------- */
*,
*::before,
*::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  background-image: var(--bg-grad);
  background-attachment: fixed;
  color: var(--text);
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  /* Nothing may scroll the page sideways at any width. */
  overflow-x: hidden;
}

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: 0.01em;
  line-height: 1.08;
  margin: 0;
  text-wrap: balance;
}

a { color: inherit; }

img { max-width: 100%; }

button { font: inherit; color: inherit; }

:focus-visible {
  outline: 3px solid var(--pylon);
  outline-offset: 2px;
  border-radius: 4px;
}

.visually-hidden {
  position: absolute;
  width: 1px; height: 1px;
  margin: -1px; padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute;
  left: 50%;
  top: -60px;
  transform: translateX(-50%);
  z-index: 200;
  background: var(--pylon);
  color: #fff;
  padding: 10px 18px;
  border-radius: 0 0 var(--radius-sm) var(--radius-sm);
  font-weight: 600;
  transition: top 0.18s var(--ease);
}
.skip-link:focus { top: 0; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}

/* --------------------------------------------------------------------------
   3. Layout shell
   -------------------------------------------------------------------------- */
.shell {
  width: 100%;
  max-width: var(--shell-max);
  margin-inline: auto;
  padding-inline: var(--space-4);
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 60;
  background: var(--bg); /* fallback for engines without color-mix */
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: saturate(160%) blur(12px);
  border-bottom: 1px solid var(--border);
}

.header-inner {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  height: var(--header-h);
}

/* Wordmark: the "1" is set as a chalk-marked jersey numeral. */
.wordmark {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  text-decoration: none;
  flex: 0 0 auto;
}
.wordmark-mark {
  display: grid;
  place-items: center;
  width: 30px; height: 30px;
  border-radius: 7px;
  background: var(--pylon);
  color: #fff;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 19px;
  line-height: 1;
  box-shadow: inset 0 -2px 0 rgba(0, 0, 0, 0.18);
}
.wordmark-text {
  font-family: var(--font-display);
  font-size: 21px;
  font-weight: 700;
  letter-spacing: 0.015em;
  white-space: nowrap;
}
.wordmark-text span { color: var(--pylon); }

.header-spacer { flex: 1 1 auto; }

.primary-nav { display: none; }

.nav-link {
  display: inline-block;
  padding: 7px 11px;
  border-radius: 999px;
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-muted);
  white-space: nowrap;
  transition: color 0.15s var(--ease), background 0.15s var(--ease);
}
.nav-link:hover { color: var(--text); background: var(--chip-bg); }
.nav-link[aria-current='page'] {
  color: var(--text);
  background: var(--chip-bg);
  box-shadow: inset 0 0 0 1px var(--border);
}

.nav-badge {
  display: inline-block;
  min-width: 17px;
  margin-left: 5px;
  padding: 0 5px;
  border-radius: 999px;
  background: var(--pylon);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  line-height: 17px;
  text-align: center;
}
.nav-badge[hidden] { display: none; }

.icon-btn {
  display: grid;
  place-items: center;
  width: 40px; height: 40px;
  flex: 0 0 auto;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
  cursor: pointer;
  transition: background 0.15s var(--ease), border-color 0.15s var(--ease);
}
.icon-btn:hover { background: var(--surface-2); border-color: var(--border-strong); }
.icon-btn svg { width: 18px; height: 18px; }

/* Mobile drawer */
.nav-drawer {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: none;
}
.nav-drawer[data-open='true'] { display: block; }
.nav-drawer-scrim {
  position: absolute;
  inset: 0;
  background: var(--scrim);
  animation: fade-in 0.18s var(--ease);
}
.nav-drawer-panel {
  position: absolute;
  inset: 0 0 0 auto;
  width: min(320px, 86vw);
  padding: var(--space-4);
  background: var(--surface);
  border-left: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  animation: slide-in 0.22s var(--ease);
  overflow-y: auto;
}
.nav-drawer-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-2);
}
.nav-drawer-title {
  font-family: var(--font-display);
  font-size: 13px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-faint);
}
.drawer-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  padding: 14px 14px;
  border-radius: var(--radius-sm);
  text-decoration: none;
  font-size: 16px;
  font-weight: 500;
  min-height: 48px; /* comfortable touch target */
  transition: background 0.15s var(--ease);
}
.drawer-link:hover { background: var(--surface-2); }
.drawer-link[aria-current='page'] {
  background: var(--pylon-soft);
  box-shadow: inset 3px 0 0 var(--pylon);
}

@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes slide-in { from { transform: translateX(16px); opacity: 0; } to { transform: none; opacity: 1; } }

/* Main */
.site-main {
  display: block;
  padding-block: var(--space-5) var(--space-8);
  min-height: 60vh;
}

.site-footer {
  border-top: 1px solid var(--border);
  padding-block: var(--space-5);
  color: var(--text-faint);
  font-size: 13px;
}
.site-footer p { margin: 0 0 6px; }
.site-footer a { color: var(--text-muted); }

/* --------------------------------------------------------------------------
   4. Type utilities and section headers
   -------------------------------------------------------------------------- */
.eyebrow {
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--text-faint);
  margin: 0;
}

.section {
  margin-block: var(--space-6);
}
.section:first-child { margin-top: 0; }

.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--space-3);
  flex-wrap: wrap;
  margin-bottom: var(--space-4);
}
.section-title {
  font-size: clamp(22px, 5vw, 28px);
  text-transform: uppercase;
  letter-spacing: 0.02em;
}
.section-note { font-size: 13px; color: var(--text-faint); }

.page-title {
  font-size: clamp(30px, 8vw, 46px);
  text-transform: uppercase;
  margin-bottom: var(--space-2);
}
.page-sub { color: var(--text-muted); margin: 0 0 var(--space-5); font-size: 15px; }

/* --------------------------------------------------------------------------
   5. Buttons
   -------------------------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 46px;
  padding: 11px 20px;
  border: 1px solid transparent;
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--text);
  font-size: 15px;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.12s var(--ease), background 0.15s var(--ease), border-color 0.15s var(--ease);
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: none; }
.btn--primary { background: var(--pylon); color: #fff; }
.btn--primary:hover { background: #ff6f36; }
.btn--ghost { background: transparent; border-color: var(--border-strong); }
.btn--ghost:hover { background: var(--chip-bg); }
.btn--sm { min-height: 38px; padding: 8px 14px; font-size: 14px; }
.btn--block { width: 100%; }
.btn[disabled] { opacity: 0.5; cursor: not-allowed; transform: none; }

/* --------------------------------------------------------------------------
   6. Hero
   -------------------------------------------------------------------------- */
.hero {
  position: relative;
  padding: var(--space-6) 0 var(--space-5);
  overflow: hidden;
}

/* Signature: chalked yard lines receding behind the headline. */
.hero-field {
  position: absolute;
  inset: auto 0 0 0;
  height: 180px;
  pointer-events: none;
  opacity: 0.5;
  background-image: repeating-linear-gradient(
    90deg,
    color-mix(in srgb, var(--text) 12%, transparent) 0 1px,
    transparent 1px 56px
  );
  mask-image: linear-gradient(to top, #000 0%, transparent 92%);
  -webkit-mask-image: linear-gradient(to top, #000 0%, transparent 92%);
}

.hero-inner { position: relative; }

.hero h1 {
  font-size: clamp(40px, 12vw, 82px);
  line-height: 0.92;
  text-transform: uppercase;
  letter-spacing: -0.005em;
  margin-bottom: var(--space-3);
}
.hero h1 em {
  font-style: normal;
  color: var(--pylon);
  display: block;
}
.hero-tagline {
  font-size: clamp(16px, 4vw, 20px);
  color: var(--text-muted);
  max-width: 38ch;
  margin: 0 0 var(--space-5);
}
.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
}

/* --------------------------------------------------------------------------
   7. Game card
   -------------------------------------------------------------------------- */
.card-grid {
  display: grid;
  gap: var(--space-3);
  grid-template-columns: 1fr;
}

.game-card {
  position: relative;
  display: block;
  padding: var(--space-4);
  padding-left: calc(var(--space-4) + 6px);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  text-decoration: none;
  overflow: hidden;
  transition: border-color 0.15s var(--ease), transform 0.15s var(--ease);
}
.game-card:hover { border-color: var(--border-strong); transform: translateY(-2px); }

/* Left rail encodes the league. Colour alone never carries meaning - the
   league name is also printed in the card meta row. */
.game-card::before {
  content: '';
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 4px;
  background: var(--pylon);
}
.game-card[data-league='college']::before { background: var(--turf); }
.game-card[data-live='true']::before {
  background: var(--live);
  animation: rail-pulse 2.4s ease-in-out infinite;
}
@keyframes rail-pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.45; } }

.game-card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-3);
  margin-bottom: var(--space-3);
}

.game-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 10px;
  font-size: 12px;
  color: var(--text-faint);
  min-width: 0;
}
.game-meta .dot { opacity: 0.5; }
.game-kickoff { color: var(--text); font-weight: 600; }

/* The broadcast bug: the loudest thing on the card, by design. */
.tv-bug {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex: 0 0 auto;
  padding: 6px 11px 6px 9px;
  border: 1.5px solid var(--pylon);
  border-radius: 7px;
  background: var(--pylon-soft);
  color: var(--pylon);
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  line-height: 1.1;
  white-space: nowrap;
  max-width: 46vw;
  overflow: hidden;
  text-overflow: ellipsis;
}
.tv-bug::before {
  content: '';
  width: 3px;
  height: 14px;
  border-radius: 2px;
  background: currentColor;
  flex: 0 0 auto;
}
.tv-bug--tbd {
  border-color: var(--border-strong);
  background: var(--chip-bg);
  color: var(--text-faint);
}
.tv-bug--stream {
  border-color: var(--turf);
  background: var(--turf-soft);
  color: var(--turf);
}

.matchup { display: grid; gap: 2px; }

.team-row {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr) auto;
  align-items: center;
  gap: var(--space-3);
  padding: 6px 0;
}
.team-row + .team-row { border-top: 1px dashed var(--border); }

.team-logo {
  width: 28px; height: 28px;
  object-fit: contain;
  flex: 0 0 auto;
}
/* Fallback when a logo 404s or is missing: initials on a tinted tile, so the
   grid never collapses because of a broken image. */
.team-logo-fallback {
  display: grid;
  place-items: center;
  width: 28px; height: 28px;
  border-radius: 7px;
  background: var(--surface-3);
  color: var(--text-muted);
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.team-name {
  min-width: 0;
  display: flex;
  align-items: baseline;
  gap: 7px;
  flex-wrap: wrap;
}
.team-name-main {
  font-weight: 600;
  font-size: 15px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.team-record { font-size: 12px; color: var(--text-faint); }
.team-rank {
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 700;
  color: var(--gold);
}

.team-score {
  font-family: var(--font-display);
  font-size: 26px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  line-height: 1;
  min-width: 34px;
  text-align: right;
}
.team-row[data-loser='true'] .team-name-main,
.team-row[data-loser='true'] .team-score { color: var(--text-faint); }

.game-card-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  margin-top: var(--space-3);
  padding-top: var(--space-3);
  border-top: 1px solid var(--border);
  font-size: 12.5px;
  color: var(--text-faint);
  min-width: 0;
}
.game-venue {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Status pill. Always carries a word, never only a colour. */
.status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--chip-bg);
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  white-space: nowrap;
  flex: 0 0 auto;
}
.status--live { background: var(--live-soft); color: var(--live); }
.status--final { background: var(--chip-bg); color: var(--text-muted); }
.status--warn { background: rgba(245, 185, 58, 0.15); color: var(--gold); }
.status--scheduled { color: var(--text-muted); }

.live-dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: currentColor;
  animation: blink 1.6s ease-in-out infinite;
}
@keyframes blink { 0%, 100% { opacity: 1; } 50% { opacity: 0.25; } }

.for-teams {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: var(--space-3);
}
.for-team-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 9px;
  border-radius: 999px;
  background: var(--pylon-soft);
  color: var(--pylon);
  font-size: 11.5px;
  font-weight: 600;
}
.for-team-chip[data-league='college'] { background: var(--turf-soft); color: var(--turf); }

.game-note {
  margin-top: var(--space-2);
  font-size: 12.5px;
  color: var(--gold);
  font-weight: 500;
}

/* --------------------------------------------------------------------------
   8. Filters
   -------------------------------------------------------------------------- */
.filter-bar {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  padding: var(--space-4);
  margin-bottom: var(--space-4);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.filter-group { display: flex; flex-direction: column; gap: 7px; min-width: 0; }
.filter-label {
  font-family: var(--font-display);
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-faint);
}

.segmented {
  display: flex;
  gap: 4px;
  padding: 4px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 999px;
  overflow-x: auto;
  scrollbar-width: none;
}
.segmented::-webkit-scrollbar { display: none; }
.segmented button {
  flex: 1 0 auto;
  min-height: 38px;
  padding: 7px 14px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--text-muted);
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
  transition: background 0.15s var(--ease), color 0.15s var(--ease);
}
.segmented button:hover { color: var(--text); }
.segmented button[aria-pressed='true'] {
  background: var(--pylon);
  color: #fff;
}

.field {
  width: 100%;
  min-height: 46px;
  padding: 11px 14px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface-2);
  color: var(--text);
  font-size: 16px; /* 16px avoids the iOS zoom-on-focus */
}
.field::placeholder { color: var(--text-faint); }

select.field {
  appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, currentColor 50%),
    linear-gradient(135deg, currentColor 50%, transparent 50%);
  background-position: calc(100% - 19px) 21px, calc(100% - 14px) 21px;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
  padding-right: 38px;
}

.filter-row {
  display: grid;
  gap: var(--space-3);
  grid-template-columns: 1fr;
}

.result-count {
  font-size: 13px;
  color: var(--text-faint);
  margin-bottom: var(--space-3);
}

/* --------------------------------------------------------------------------
   9. Standings tables
   -------------------------------------------------------------------------- */
.standings-block { margin-bottom: var(--space-6); }
.standings-group-title {
  font-size: 20px;
  text-transform: uppercase;
  margin-bottom: var(--space-3);
  padding-bottom: var(--space-2);
  border-bottom: 2px solid var(--pylon);
  display: inline-block;
}

.table-wrap {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

table.standings {
  width: 100%;
  min-width: 560px;
  border-collapse: collapse;
  font-size: 14px;
  font-variant-numeric: tabular-nums;
}
table.standings caption {
  caption-side: top;
  text-align: left;
  padding: var(--space-3) var(--space-4) 0;
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
table.standings th,
table.standings td {
  padding: 11px var(--space-3);
  text-align: right;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
table.standings th {
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-faint);
  position: sticky;
  top: 0;
  background: var(--surface-2);
}
table.standings th:first-child,
table.standings td:first-child {
  text-align: left;
  position: sticky;
  left: 0;
  background: var(--surface);
  z-index: 1;
}
table.standings th:first-child { background: var(--surface-2); z-index: 2; }
table.standings tbody tr:last-child td { border-bottom: 0; }
table.standings tbody tr:hover td { background: var(--surface-2); }

.standings-team {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
}
.standings-team img,
.standings-team .team-logo-fallback { width: 22px; height: 22px; }
.standings-team span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 180px;
}

/* Playoff position: a marker plus a legend, not colour alone. */
.seed-marker {
  display: inline-block;
  min-width: 20px;
  margin-right: 7px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 13px;
  color: var(--text-faint);
}
tr[data-playoff='true'] .seed-marker { color: var(--turf); }
tr[data-playoff='true'] td:first-child { box-shadow: inset 3px 0 0 var(--turf); }
.legend {
  margin-top: var(--space-3);
  font-size: 12.5px;
  color: var(--text-faint);
}
.legend b { color: var(--turf); }

/* Rankings */
.rank-list {
  display: grid;
  gap: var(--space-2);
  grid-template-columns: 1fr;
  list-style: none;
  margin: 0;
  padding: 0;
}
.rank-item {
  display: grid;
  grid-template-columns: 42px 26px minmax(0, 1fr) auto;
  align-items: center;
  gap: var(--space-3);
  padding: 11px var(--space-4);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}
.rank-number {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--gold);
}
.rank-item .team-logo,
.rank-item .team-logo-fallback { width: 26px; height: 26px; }
.rank-name {
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.rank-record { font-size: 13px; color: var(--text-faint); font-variant-numeric: tabular-nums; }
.rank-trend { font-size: 12px; margin-left: 6px; }
.rank-trend[data-dir='up'] { color: var(--turf); }
.rank-trend[data-dir='down'] { color: var(--live); }

/* --------------------------------------------------------------------------
   10. Breaking News - message thread
   -------------------------------------------------------------------------- */
.thread {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  padding: var(--space-4) 0;
}

.bubble {
  position: relative;
  align-self: flex-start;
  max-width: min(92%, 620px);
  padding: var(--space-4);
  background: var(--surface);
  border: 1px solid var(--border);
  /* Asymmetric radius: the flattened bottom-left corner is the "tail". */
  border-radius: var(--radius-lg) var(--radius-lg) var(--radius-lg) 5px;
  box-shadow: var(--shadow);
  text-decoration: none;
  display: block;
  transition: border-color 0.15s var(--ease), transform 0.15s var(--ease);
}
.bubble:hover { border-color: var(--border-strong); transform: translateY(-1px); }
.bubble--new { animation: bubble-in 0.4s var(--ease); }
@keyframes bubble-in {
  from { opacity: 0; transform: translateY(10px) scale(0.985); }
  to { opacity: 1; transform: none; }
}

.bubble-head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: var(--space-2);
  flex-wrap: wrap;
}
.bubble-tag {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-family: var(--font-display);
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--pylon);
}
.bubble-tag[data-category='college'] { color: var(--turf); }
.bubble-tag[data-category='breaking'],
.bubble-tag[data-category='injury'] { color: var(--live); }
.bubble-tag[data-category='rankings'] { color: var(--gold); }
.bubble-tag[data-category='trade'],
.bubble-tag[data-category='recruiting'] { color: var(--text-muted); }

.bubble-new-flag {
  padding: 2px 7px;
  border-radius: 999px;
  background: var(--pylon);
  color: #fff;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.bubble-headline {
  font-size: 16px;
  font-weight: 600;
  line-height: 1.35;
  margin: 0 0 6px;
}
.bubble-summary {
  margin: 0;
  font-size: 14px;
  color: var(--text-muted);
  line-height: 1.5;
}
.bubble-foot {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: var(--space-3);
  font-size: 12px;
  color: var(--text-faint);
  flex-wrap: wrap;
}

.thread-status {
  align-self: center;
  padding: 6px 14px;
  border-radius: 999px;
  background: var(--chip-bg);
  color: var(--text-faint);
  font-size: 12px;
}

/* --------------------------------------------------------------------------
   11. Team picker / My Season
   -------------------------------------------------------------------------- */
.picker { position: relative; }

.picker-results {
  position: absolute;
  z-index: 40;
  top: calc(100% + 6px);
  left: 0; right: 0;
  max-height: 340px;
  overflow-y: auto;
  padding: var(--space-2);
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.picker-results[hidden] { display: none; }
.picker-group-label {
  padding: 8px 10px 4px;
  font-family: var(--font-display);
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-faint);
}
.picker-option {
  display: flex;
  align-items: center;
  gap: 11px;
  width: 100%;
  min-height: 48px;
  padding: 9px 10px;
  border: 0;
  border-radius: var(--radius-sm);
  background: transparent;
  text-align: left;
  cursor: pointer;
}
.picker-option:hover,
.picker-option[data-active='true'] { background: var(--surface-2); }
.picker-option img,
.picker-option .team-logo-fallback { width: 24px; height: 24px; }
.picker-option span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.picker-option em {
  font-style: normal;
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-faint);
}

.favorites-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  list-style: none;
  margin: var(--space-4) 0 0;
  padding: 0;
}
.favorite-item {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: 10px var(--space-3);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}
.favorite-item img,
.favorite-item .team-logo-fallback { width: 28px; height: 28px; }
.favorite-name { flex: 1; min-width: 0; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.favorite-league {
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-faint);
}
.reorder-group { display: flex; gap: 4px; }
.mini-btn {
  display: grid;
  place-items: center;
  width: 36px; height: 36px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface-2);
  cursor: pointer;
  font-size: 15px;
  line-height: 1;
}
.mini-btn:hover { background: var(--surface-3); }
.mini-btn[disabled] { opacity: 0.35; cursor: not-allowed; }
.mini-btn--danger:hover { background: var(--live-soft); color: var(--live); }

.season-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
  margin-bottom: var(--space-5);
}

.panel {
  padding: var(--space-4);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

/* --------------------------------------------------------------------------
   12. States: loading, empty, error, toast
   -------------------------------------------------------------------------- */
.skeleton {
  height: 108px;
  border-radius: var(--radius);
  background-color: var(--surface);
  background-image: var(--skeleton);
  background-size: 200% 100%;
  animation: shimmer 1.3s linear infinite;
}
@keyframes shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }

.state {
  padding: var(--space-6) var(--space-4);
  text-align: center;
  background: var(--surface);
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius);
}
.state h3 { font-size: 20px; margin-bottom: var(--space-2); text-transform: uppercase; }
.state p { margin: 0 auto var(--space-4); color: var(--text-muted); max-width: 46ch; }
.state--error { border-color: var(--live); border-style: solid; }

.notice {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px var(--space-4);
  margin-bottom: var(--space-4);
  border-radius: var(--radius-sm);
  background: rgba(245, 185, 58, 0.12);
  border: 1px solid rgba(245, 185, 58, 0.35);
  color: var(--text);
  font-size: 13.5px;
}

.updated-stamp {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 12.5px;
  color: var(--text-faint);
}
.updated-stamp::before {
  content: '';
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--turf);
}
.updated-stamp[data-stale='true']::before { background: var(--gold); }

.toast {
  position: fixed;
  left: 50%;
  bottom: 22px;
  transform: translateX(-50%);
  z-index: 120;
  padding: 12px 20px;
  border-radius: 999px;
  background: var(--text);
  color: var(--bg);
  font-size: 14px;
  font-weight: 600;
  box-shadow: var(--shadow);
  animation: toast-in 0.22s var(--ease);
  max-width: calc(100vw - 32px);
  text-align: center;
}
@keyframes toast-in { from { opacity: 0; transform: translate(-50%, 10px); } to { opacity: 1; transform: translate(-50%, 0); } }

/* --------------------------------------------------------------------------
   13. Breakpoints - 375 / 430 / 768 / 1024 / 1440 / 1920
   -------------------------------------------------------------------------- */
@media (min-width: 600px) {
  .card-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .filter-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .rank-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (min-width: 768px) {
  body { font-size: 15.5px; }
  .shell { padding-inline: var(--space-5); }
  .filter-bar { flex-direction: row; flex-wrap: wrap; align-items: flex-end; }
  .filter-bar .filter-group { flex: 1 1 190px; }
  .site-main { padding-block: var(--space-6) var(--space-8); }
  .tv-bug { max-width: none; font-size: 16px; }
}

@media (min-width: 900px) {
  :root { --header-h: 68px; }
  .primary-nav { display: flex; align-items: center; gap: 2px; }
  .nav-toggle { display: none; }
  .card-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .rank-list { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .hero { padding-block: var(--space-8) var(--space-6); }
  .filter-row { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

@media (min-width: 1200px) {
  .card-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (min-width: 1600px) {
  :root { --shell-max: 1360px; }
  .card-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

/* Single-column variants used by My Season and search results, where a wide
   row reads better than a grid. */
.card-grid--list { grid-template-columns: 1fr !important; }
.card-grid--list .game-card { max-width: 100%; }

@media print {
  .site-header, .site-footer, .filter-bar, .season-actions, .toast { display: none; }
  body { background: #fff; color: #000; }
  .game-card { break-inside: avoid; border-color: #999; box-shadow: none; }
}
