/* ── Reset & Base ─────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg: #0f0f0f;
  --bg-card: #1a1a1a;
  --bg-card-hover: #222;
  --accent: #AD0000;          /* brand red — fills only (white text on top) */
  --accent-text: #ef5350;     /* red as TEXT on dark bgs — ≥4.5:1 on --bg-card */
  --accent-dim: rgba(173, 0, 0, 0.15);
  --text: #ffffff;
  --text-muted: #9ca3af;
  --border: #2a2a2a;
  --green-tint: rgba(34, 197, 94, 0.08);
  --red-tint: rgba(239, 68, 68, 0.08);
  --gold: #d4af37;
  --beak: #f8b810; /* sampled from the cardinal logo's beak */
  --font-display: 'Fraunces', Georgia, 'Times New Roman', serif; /* editorial serif headlines */
  --font-heading: 'Inter', sans-serif; /* UI labels, table headers, numerals */
  --font-body: 'Inter', sans-serif;
  --font-mono: 'IBM Plex Mono', ui-monospace, 'SF Mono', Menlo, Consolas, monospace; /* nav */
  --radius: 6px;
  --transition: 0.18s ease;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.55;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  font-optical-sizing: auto;
}

a { color: var(--accent-text); text-decoration: none; }
a:hover { text-decoration: underline; }
button { cursor: pointer; border: none; background: none; font-family: inherit; touch-action: manipulation; }
:focus-visible { outline: 2px solid var(--accent-text); outline-offset: 2px; }
img { max-width: 100%; display: block; }
svg { max-width: 100%; height: auto; }            /* charts never overflow the viewport */
body { -webkit-tap-highlight-color: rgba(0,0,0,0); } /* no grey flash on tap (focus-visible still shows) */

/* ── Header ───────────────────────────────────────────────── */
.site-header {
  background: #111;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 24px;
  gap: 16px;
}

.brand { display: flex; align-items: center; gap: 12px; cursor: pointer; }
.brand:hover { opacity: 0.85; }
.brand:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; border-radius: 4px; }
.brand-logo { width: 40px; height: 40px; object-fit: contain; }
.brand-name {
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -0.01em;
}
.brand-tagline {
  font-size: 12px;
  font-weight: 500;
  color: var(--beak);
  letter-spacing: 0.3px;
  padding-left: 12px;
  border-left: 1px solid var(--border);
  align-self: center;
}

/* ── Year Switcher ────────────────────────────────────────── */
.year-switcher {
  display: flex;
  gap: 4px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 3px;
}
.year-btn {
  padding: 4px 12px;
  border-radius: 4px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  transition: var(--transition);
}
.year-btn.active { background: var(--accent); color: #fff; }

/* ── Tab Nav ──────────────────────────────────────────────── */
.tab-nav-wrap { position: relative; }
/* Right-edge fade = "more tabs this way" when the nav overflows (class set in app.js) */
.tab-nav-wrap::after {
  content: ''; position: absolute; top: 1px; right: 0; bottom: 0; width: 44px;
  background: linear-gradient(90deg, transparent, #111 85%);
  pointer-events: none; opacity: 0; transition: opacity 0.15s;
}
.tab-nav-wrap.hscroll-on::after { opacity: 1; }

/* Generic right-edge fade for horizontally scrollable strips (rafter banners
   etc.): wrap the scroller in .hscroll-fade; attachHScrollFade (app.js)
   toggles .hscroll-on. --fade-bg matches the surface behind the strip. */
.hscroll-fade { position: relative; }
.hscroll-fade::after {
  content: ''; position: absolute; top: 0; right: 0; bottom: 0; width: 48px;
  background: linear-gradient(90deg, transparent, var(--fade-bg, var(--bg)) 85%);
  pointer-events: none; opacity: 0; transition: opacity 0.15s;
}
.hscroll-fade.hscroll-on::after { opacity: 1; }
.tab-nav {
  display: flex;
  padding: 0 24px;
  border-top: 1px solid var(--border);
  overflow-x: auto;
  scrollbar-width: none;
}
.tab-nav::-webkit-scrollbar { display: none; }

.tab-btn {
  padding: 10px 16px;
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 400;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-muted);
  border-bottom: 3px solid transparent;
  white-space: nowrap;
  transition: color var(--transition), border-color var(--transition);
}
.tab-btn:hover { color: var(--text); }
.tab-btn.active { color: var(--text); border-bottom-color: var(--accent); }


/* ── Tab Panels ───────────────────────────────────────────── */
.main-content { padding: 24px; max-width: 1200px; margin: 0 auto; }
.tab-panel { animation: fadeIn 0.2s ease; }
.tab-panel.hidden { display: none; }
.view-panel.hidden { display: none; }
/* sub-view segmented control sits just under the top nav */
.view-toggle.sub-nav { margin-bottom: 22px; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; } }

/* ── Cards ────────────────────────────────────────────────── */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius);
  padding: 16px;
}
.card:hover { background: var(--bg-card-hover); }

/* ── Tables ───────────────────────────────────────────────── */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; border-radius: var(--radius); border: 1px solid var(--border); }
table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
thead tr { background: var(--accent); }
thead th {
  padding: 10px 14px;
  text-align: left;
  font-family: var(--font-heading);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.5px;
  white-space: nowrap;
  color: #fff;
}
thead th.sortable { cursor: pointer; user-select: none; }
thead th.sortable::after { content: ' ⇅'; opacity: 0.4; font-size: 11px; }
thead th.sort-asc::after { content: ' ↑'; opacity: 1; }
thead th.sort-desc::after { content: ' ↓'; opacity: 1; }
tbody tr { border-bottom: 1px solid var(--border); transition: background var(--transition); }
tbody tr:nth-child(even) { background: rgba(255,255,255,0.02); }
tbody tr:hover { background: rgba(255,255,255,0.05); }
tbody tr.win { background: var(--green-tint); }
tbody tr.loss { background: var(--red-tint); }
td { padding: 10px 14px; color: var(--text); font-size: 14px; line-height: 1.4; }
td.muted { color: var(--text-muted); }
td img { display: inline-block; vertical-align: middle; } /* logos sit inline with the team name */

/* ── Modal ────────────────────────────────────────────────── */
.modal-backdrop {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.8);
  z-index: 1000;
  display: flex; align-items: center; justify-content: center;
  padding: 24px;
}
.modal-backdrop.hidden { display: none; }
.modal {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 32px;
  max-width: 480px;
  width: 100%;
}
.modal-title { font-family: var(--font-display); font-size: 23px; font-weight: 700; letter-spacing: -0.01em; margin-bottom: 12px; }
.modal-body { color: var(--text-muted); margin-bottom: 20px; line-height: 1.6; }
.modal-input {
  width: 100%;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  padding: 10px 14px;
  font-family: var(--font-body);
  font-size: 14px;
  margin-bottom: 12px;
  outline: none;
}
.modal-input:focus { border-color: var(--accent); }
.btn-primary {
  width: 100%;
  padding: 10px;
  background: var(--accent);
  color: #fff;
  font-family: var(--font-heading);
  font-size: 15px;
  font-weight: 600;
  border-radius: var(--radius);
  letter-spacing: 0.5px;
  transition: opacity var(--transition);
}
.btn-primary:hover { opacity: 0.9; }

/* ── Player Drawer ────────────────────────────────────────── */
.overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.6);
  z-index: 200;
}
.overlay.hidden { display: none; }
.drawer {
  position: fixed; top: 0; right: 0;
  width: min(480px, 100vw);
  height: 100vh;
  background: var(--bg-card);
  border-left: 1px solid var(--border);
  z-index: 201;
  overflow-y: auto;
  padding: 24px;
  transform: translateX(100%);
  transition: transform 0.25s ease;
}
.drawer.open { transform: translateX(0); }
.drawer.hidden { display: none; }
.drawer-close {
  position: absolute; top: 16px; right: 16px;
  color: var(--text-muted); font-size: 18px; padding: 4px 8px;
}
.drawer-close:hover { color: var(--text); }

/* ── Stat Bar ─────────────────────────────────────────────── */
.stat-bar-wrap { margin-bottom: 16px; }
.stat-bar-label {
  display: flex; justify-content: space-between;
  margin-bottom: 4px; font-size: 12px; color: var(--text-muted);
}
.stat-bar-track { height: 6px; background: var(--border); border-radius: 3px; overflow: hidden; }
.stat-bar-fill { height: 100%; background: var(--accent); border-radius: 3px; transition: width 0.5s ease; }

/* ── Error & Loading ──────────────────────────────────────── */
.error-card {
  background: rgba(239,68,68,0.08);
  border: 1px solid rgba(239,68,68,0.3);
  border-radius: var(--radius);
  padding: 20px; text-align: center; color: var(--text-muted);
}
.btn-retry {
  margin-top: 12px; padding: 8px 20px;
  border: 1px solid var(--accent); border-radius: var(--radius);
  color: var(--accent-text); font-size: 13px; font-weight: 600;
  transition: var(--transition);
}
.btn-retry:hover { background: var(--accent-dim); }
.skeleton {
  background: linear-gradient(90deg, var(--bg-card) 25%, #222 50%, var(--bg-card) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: var(--radius);
}
@keyframes shimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }
.skeleton-row { height: 44px; margin-bottom: 2px; }

/* ── Badges ───────────────────────────────────────────────── */
.pos-badge {
  display: inline-block; padding: 2px 8px;
  background: var(--accent-dim); border: 1px solid rgba(173,0,0,0.3);
  border-radius: 4px; font-size: 11px; font-weight: 600;
  color: var(--accent-text); letter-spacing: 0.5px;
}
.uofl-badge {
  display: inline-block; padding: 2px 8px;
  background: var(--accent); border-radius: 4px;
  font-size: 11px; font-weight: 700; color: #fff; letter-spacing: 0.5px;
}

/* ── Section & Position Headings ──────────────────────────── */
.section-title {
  font-family: var(--font-display); font-size: 25px; font-weight: 700;
  letter-spacing: -0.01em; margin-bottom: 18px; padding-bottom: 8px;
  border-bottom: 2px solid var(--accent);
}
.position-section { margin-bottom: 32px; }
.position-title {
  font-family: var(--font-heading); font-size: 14px; font-weight: 600;
  color: var(--text-muted); letter-spacing: 1px;
  text-transform: uppercase; margin-bottom: 12px;
}

/* ── Roster position grouping (unit header + per-position subsections) ── */
.position-group { margin-bottom: 40px; }
.position-group-title {
  font-family: var(--font-display); font-size: 21px; font-weight: 700;
  letter-spacing: -0.01em; color: var(--text); margin-bottom: 16px;
  border-bottom: 1px solid var(--border); padding-bottom: 8px;
}
.position-subsection { margin-bottom: 22px; }
.position-subtitle {
  font-family: var(--font-heading); font-size: 13px; font-weight: 600;
  color: var(--text-muted); letter-spacing: 1px;
  text-transform: uppercase; margin-bottom: 10px;
}
.position-subtitle .count { opacity: 0.6; margin-left: 6px; font-weight: 400; }
.position-group-title .count { color: var(--text-muted); margin-left: 8px; font-size: 14px; font-weight: 400; }

/* ── Drawer prev/next navigation ──────────────────────────── */
.drawer-nav { display: flex; align-items: center; gap: 12px; margin: 0 36px 16px 0; }
.drawer-nav-btn {
  width: 32px; height: 32px; border-radius: 8px;
  background: var(--bg); border: 1px solid var(--border);
  color: var(--text); font-size: 18px; line-height: 1; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: border-color var(--transition), color var(--transition);
}
.drawer-nav-btn:hover { border-color: var(--accent); color: var(--accent-text); }
.drawer-nav-pos { font-size: 12px; color: var(--text-muted); letter-spacing: 0.5px; }

/* ── Player headshot (drawer) ─────────────────────────────── */
.player-photo-wrap {
  position: relative; width: 128px; height: 128px;
  border-radius: 12px; overflow: hidden; margin-bottom: 14px;
  background: linear-gradient(160deg, #2a0d0d, var(--bg));
  border: 1px solid var(--border);
}
.player-photo {
  width: 100%; height: 100%;
  object-fit: cover; object-position: top center; display: block;
}
/* Roster card headshot (full-bleed to the card's top edge) */
.player-card-photo-wrap {
  position: relative; height: 132px;
  margin: -12px -12px 10px; overflow: hidden;
  border-radius: var(--radius) var(--radius) 0 0;
  background: linear-gradient(160deg, #2a0d0d, var(--bg));
}
.player-card-photo {
  width: 100%; height: 100%;
  object-fit: cover; object-position: top center; display: block;
}
.headshot-fallback {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-display); font-weight: 700; font-size: 30px;
  color: var(--text-muted);
}

/* ── Player Cards Grid ────────────────────────────────────── */
.player-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 10px; }
.player-card {
  background: var(--bg-card); border: 1px solid var(--border);
  border-left: 3px solid var(--accent); border-radius: var(--radius);
  padding: 12px; cursor: pointer;
  transition: background var(--transition), transform var(--transition);
}
.player-card:hover { background: var(--bg-card-hover); transform: translateY(-1px); }
.player-card-name { font-weight: 600; font-size: 14px; margin-bottom: 4px; }
.player-card-meta { font-size: 12px; color: var(--text-muted); }

/* ── View Toggle ──────────────────────────────────────────── */
.view-toggle {
  display: flex; gap: 4px; background: var(--bg-card);
  border: 1px solid var(--border); border-radius: var(--radius);
  padding: 3px; margin-bottom: 20px; width: fit-content;
}
.view-toggle-btn {
  padding: 5px 16px; border-radius: 4px;
  font-size: 13px; font-weight: 600; color: var(--text-muted); transition: var(--transition);
}
.view-toggle-btn.active { background: var(--accent); color: #fff; }

/* ── Filter Bar ───────────────────────────────────────────── */
.search-input {
  width: 100%;
  max-width: 440px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  padding: 9px 13px;
  font-family: var(--font-body);
  font-size: 15px;
  margin-bottom: 20px;
  outline: none;
}
.search-input:focus { border-color: var(--accent); }
/* ── Per-tab controls row (season selector + view toggle / search) ── */
.tab-controls { display: flex; align-items: center; gap: 10px; margin-bottom: 20px; flex-wrap: wrap; }
.tab-controls .view-toggle,
.tab-controls .search-input { margin-bottom: 0; }

/* ── Schedule season selector + bowl rows ─────────────────── */
.schedule-controls { display: flex; align-items: center; gap: 10px; margin-bottom: 20px; flex-wrap: wrap; }
.schedule-controls .search-input,
.schedule-controls .view-toggle { margin-bottom: 0; }
.season-select {
  background: var(--bg); border: 1px solid var(--border); color: var(--text);
  border-radius: var(--radius); padding: 8px 12px;
  font-family: var(--font-body); font-size: 15px; cursor: pointer; outline: none;
}
.season-select:focus { border-color: var(--accent); }
.schedule-divider td {
  background: var(--bg); color: var(--text-muted);
  font-family: var(--font-heading); font-size: 12px; font-weight: 600;
  letter-spacing: 1px; text-transform: uppercase; padding: 10px 16px;
}
.game-row { cursor: pointer; }
.boxscore th, .boxscore td { text-align: center; padding: 7px 10px; }
.boxscore th:first-child, .boxscore td:first-child { text-align: left; white-space: nowrap; }

/* ── Game detail: matchup header ──────────────────────────── */
.matchup {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 10px; margin: 6px 0 2px;
}
.matchup-team {
  display: flex; flex-direction: column; align-items: center; gap: 7px;
  flex: 1 1 0; min-width: 0;
}
.matchup-logo { width: 46px; height: 46px; object-fit: contain; }
.matchup-name {
  font-family: var(--font-heading); font-size: 14px; font-weight: 600;
  text-align: center; line-height: 1.2;
}
.matchup-center { flex: 0 0 auto; text-align: center; padding: 4px 4px 0; }
.matchup-score {
  font-family: var(--font-heading); font-size: 40px; font-weight: 700;
  line-height: 1; letter-spacing: 0; font-variant-numeric: tabular-nums; white-space: nowrap;
}
.matchup-score .dash { margin: 0 8px; color: var(--text-muted); font-weight: 400; }
.matchup-score.vs { font-size: 24px; color: var(--text-muted); }
.matchup-status {
  font-size: 11px; font-weight: 600; letter-spacing: 1.5px;
  text-transform: uppercase; color: var(--text-muted); margin-top: 8px;
}
.matchup-date { text-align: center; color: var(--text-muted); font-size: 12px; margin: 4px 0 4px; }

/* ── Game-detail drawer tabs ──────────────────────────────── */
.gd-tabs {
  display: flex; gap: 4px; margin: 14px 0 6px;
  background: var(--bg); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 3px;
}
.gd-tab {
  flex: 1; padding: 6px 4px; border-radius: 4px;
  font-size: 12px; font-weight: 600; color: var(--text-muted);
  white-space: nowrap; transition: var(--transition);
}
.gd-tab:hover { color: var(--text); }
.gd-tab.active { background: var(--accent); color: #fff; }
.gd-panel.hidden { display: none; }

/* ── Game detail: team-stat comparison (value | LABEL | value) ── */
.cmp { margin-top: 6px; }
/* Which column is which team — Louisville is always the left/red column */
.cmp-teams {
  display: flex; justify-content: space-between; gap: 10px;
  margin-bottom: 2px; font-size: 12px; font-weight: 700; letter-spacing: 0.3px;
}
.cmp-teams .cmp-team-lou { color: var(--accent-text); }
.cmp-teams .cmp-team-opp { color: #94a3b8; }
.cmp-row { padding: 9px 0; border-top: 1px solid var(--border); }
.cmp-row:first-child { border-top: none; }
.cmp-head {
  display: flex; align-items: baseline; justify-content: space-between;
  gap: 10px; margin-bottom: 7px;
}
.cmp-val {
  font-family: var(--font-heading); font-size: 17px; font-weight: 600;
  font-variant-numeric: tabular-nums; min-width: 46px; flex: 0 0 auto;
}
.cmp-val:last-child { text-align: right; }
.cmp-label {
  flex: 1 1 auto; text-align: center; font-size: 11px; font-weight: 600;
  letter-spacing: 1px; text-transform: uppercase; color: var(--text-muted);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.cmp-bar { display: flex; gap: 3px; height: 6px; }
.cmp-bar-half {
  flex: 1; background: var(--border); border-radius: 3px;
  display: flex; overflow: hidden;
}
.cmp-bar-half.left { justify-content: flex-end; }
.cmp-bar-half.right { justify-content: flex-start; }
.cmp-fill { height: 100%; border-radius: 3px; transition: width 0.5s ease; }
.cmp-fill.lou { background: var(--accent); }
.cmp-fill.opp { background: #64748b; }

/* ── Poll rankings ────────────────────────────────────────── */
.rank-badge {
  font-family: var(--font-heading); font-size: 11px; font-weight: 700;
  color: var(--gold); margin-right: 5px; vertical-align: 1px;
}
.matchup-rank {
  font-size: 11px; font-weight: 600; color: var(--gold);
  margin-top: 3px; text-align: center; letter-spacing: 0.3px;
}
tbody tr.rank-lou { background: var(--accent-dim); }
tbody tr.rank-lou:hover { background: rgba(173, 0, 0, 0.22); }

.bowl-badge {
  display: inline-block; margin-left: 6px; padding: 1px 7px;
  background: rgba(212, 175, 55, 0.15); border: 1px solid rgba(212, 175, 55, 0.5);
  border-radius: 4px; font-size: 10px; font-weight: 700; letter-spacing: 0.5px;
  color: var(--gold); vertical-align: middle;
}

.show-more-bar { display: flex; align-items: center; gap: 12px; margin: 0 0 8px; }
.show-more-bar .filter-btn { padding: 5px 12px; font-size: 12px; }
.filter-bar { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 20px; }
.filter-btn {
  padding: 6px 16px; border: 1px solid var(--border);
  border-radius: 20px; font-size: 13px; font-weight: 600;
  color: var(--text-muted); transition: var(--transition);
}
.filter-btn:hover { border-color: var(--accent); color: var(--text); }
.filter-btn.active { background: var(--accent); border-color: var(--accent); color: #fff; }

/* ── Hero Leader Cards ────────────────────────────────────── */
.leader-heroes { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-bottom: 28px; }
@media (max-width: 640px) { .leader-heroes { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 420px) { .leader-heroes { grid-template-columns: 1fr; } }
.hero-card {
  background: var(--bg-card); border: 1px solid var(--border);
  border-top: 3px solid var(--accent); border-radius: var(--radius);
  padding: 16px; text-align: center;
}
.hero-card-category { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 1px; color: var(--accent-text); margin-bottom: 8px; }
.hero-card-name { font-family: var(--font-display); font-size: 19px; font-weight: 700; letter-spacing: -0.01em; margin-bottom: 4px; }
.hero-card-stat { font-family: var(--font-heading); font-size: 30px; font-weight: 700; color: var(--accent-text); font-variant-numeric: tabular-nums; letter-spacing: -0.01em; }
.hero-card-sublabel { font-size: 12px; color: var(--text-muted); margin-top: 2px; }

/* ── Home / Overview ──────────────────────────────────────── */
.home-feature { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 14px; margin-bottom: 14px; }
.home-grid    { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; }
.home-card { cursor: pointer; transition: background var(--transition), transform var(--transition); }
.home-card:hover { background: var(--bg-card-hover); transform: translateY(-1px); }
.home-card-label { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 1px; color: var(--accent-text); margin-bottom: 10px; }
.home-card-link { margin-top: 12px; font-size: 12px; font-weight: 600; color: var(--text-muted); }
.home-card:hover .home-card-link { color: var(--accent-text); }
.home-game-line { display: flex; align-items: center; gap: 10px; }
.home-game-opp { font-family: var(--font-display); font-size: 20px; font-weight: 700; letter-spacing: -0.01em; }
.home-sub { color: var(--text-muted); font-size: 13px; margin-top: 6px; }
.home-record { font-family: var(--font-display); font-size: 34px; font-weight: 700; letter-spacing: -0.01em; line-height: 1; }
.home-pills { display: flex; gap: 6px; }
.home-pill { display: inline-flex; align-items: center; justify-content: center; width: 26px; height: 26px; border-radius: 6px; color: #fff; font-weight: 700; font-size: 13px; }
.home-leader { display: flex; align-items: baseline; gap: 8px; padding: 4px 0; }
.home-leader-cat { font-size: 11px; font-weight: 700; color: var(--text-muted); width: 34px; }
.home-leader-name { flex: 1; font-size: 14px; }
.home-leader-val { font-weight: 700; font-variant-numeric: tabular-nums; }
.home-rank { padding: 3px 0; font-size: 14px; }
.home-rank.is-lou { color: var(--accent-text); font-weight: 700; }
.home-rank-n { display: inline-block; width: 22px; color: var(--text-muted); font-variant-numeric: tabular-nums; }
.home-rank.is-lou .home-rank-n { color: var(--accent-text); }

/* Home hero banner */
.home-hero {
  display: flex; align-items: center; gap: 18px;
  background: linear-gradient(135deg, rgba(173,0,0,0.22), var(--bg-card) 60%);
  border: 1px solid var(--border); border-left: 3px solid var(--accent);
  border-radius: var(--radius); padding: 20px 22px; margin-bottom: 16px;
}
.home-hero-logo { width: 64px; height: 64px; object-fit: contain; flex: 0 0 auto; }
.home-hero-name { font-family: var(--font-display); font-size: 28px; font-weight: 700; letter-spacing: -0.01em; line-height: 1.1; }
.home-hero-sub { color: var(--text-muted); font-size: 12px; margin: 3px 0 12px; font-family: var(--font-mono); text-transform: uppercase; letter-spacing: 1.5px; }
.home-chips { display: flex; gap: 8px; flex-wrap: wrap; }
.home-chip { background: var(--bg); border: 1px solid var(--border); border-radius: 20px; padding: 5px 12px; font-size: 13px; color: var(--text-muted); }
.home-chip b { color: var(--text); font-family: var(--font-heading); font-weight: 700; }
.home-result { display: flex; align-items: center; gap: 10px; padding: 5px 0; font-size: 14px; }
.home-result + .home-result { border-top: 1px solid var(--border); }
.home-result-wl { font-weight: 700; width: 14px; text-align: center; }
.home-result-opp { flex: 1; }
.home-result-score { color: var(--text-muted); font-variant-numeric: tabular-nums; }
@media (max-width: 600px) {
  .home-hero { padding: 16px; gap: 14px; }
  .home-hero-logo { width: 48px; height: 48px; }
  .home-hero-name { font-size: 22px; }
}

/* ── Info tooltips (.tip) ─────────────────────────────────── */
/* Outer .tip = 28px invisible tap/click target (WCAG 2.2 target size);
   inner .tip-i = the 14px visual circle. Negative margins keep the old
   14px layout footprint so table rows/labels don't grow. */
.tip {
  display: inline-flex; align-items: center; justify-content: center;
  width: 28px; height: 28px; margin: -7px -7px -7px -3px;
  cursor: help; vertical-align: middle; position: relative; user-select: none;
}
.tip-i {
  display: inline-flex; align-items: center; justify-content: center;
  width: 14px; height: 14px; border-radius: 50%;
  border: 1px solid var(--border); color: var(--text-muted);
  font-family: var(--font-heading); font-size: 9px; font-weight: 700; font-style: normal;
  line-height: 1;
}
.tip:hover .tip-i, .tip:focus .tip-i { color: #fff; background: var(--accent); border-color: var(--accent); }
.tip:focus { outline: none; }
.tip::after {
  content: attr(data-tip);
  position: absolute; top: calc(100% + 1px); left: 50%; transform: translateX(-50%);
  width: max-content; max-width: 230px; padding: 8px 11px;
  background: #000; border: 1px solid var(--border); border-radius: 6px;
  color: var(--text); font-family: var(--font-body); font-size: 12px; font-weight: 400;
  line-height: 1.45; text-align: left; text-transform: none; letter-spacing: 0; white-space: normal;
  box-shadow: 0 6px 18px rgba(0,0,0,0.55); z-index: 400;
  display: none; /* not laid out when hidden — a visibility-hidden bubble still adds phantom scroll to .table-wrap and the page */
}
.tip::before {
  content: ''; position: absolute; top: calc(100% - 5px); left: 50%; transform: translateX(-50%);
  border: 5px solid transparent; border-bottom-color: #000; z-index: 401;
  display: none;
}
.tip:hover::after, .tip:focus::after, .tip:hover::before, .tip:focus::before { display: block; }

/* ── Rafter banners (History → March) ─────────────────────── */
.banner-rafters {
  display: flex; gap: 14px; align-items: flex-start;
  overflow-x: auto; padding: 0 2px 18px; margin-bottom: 6px;
  -webkit-overflow-scrolling: touch; scrollbar-width: none;
}
.banner-rafters::-webkit-scrollbar { display: none; }
.banner {
  flex: 0 0 auto; width: 104px; min-height: 148px;
  display: flex; flex-direction: column; align-items: center;
  text-align: center; padding: 14px 8px 26px; gap: 6px;
  border-top: 5px solid #3a3a3a; /* the rod it hangs from */
  clip-path: polygon(0 0, 100% 0, 100% 86%, 50% 100%, 0 86%); /* pennant tail */
  box-shadow: inset 0 0 0 2px rgba(212, 175, 55, 0.45);
}
.banner.champ { background: linear-gradient(180deg, #900000, var(--accent) 45%, #7d0000); color: #fff; }
.banner-label { font-family: var(--font-heading); font-size: 9px; font-weight: 700; letter-spacing: 2px; }
.banner-title { font-family: var(--font-heading); font-size: 11px; font-weight: 700; letter-spacing: 1px; text-transform: uppercase; line-height: 1.35; }
.banner-year  { font-family: var(--font-display); font-size: 27px; font-weight: 700; color: var(--gold); margin-top: auto; }
.banner.ff {
  width: 88px; min-height: 124px; padding-bottom: 22px;
  background: linear-gradient(180deg, #232323, #191919);
  box-shadow: inset 0 0 0 2px rgba(173, 0, 0, 0.5);
  color: var(--accent-text);
}
.banner.ff .banner-year { font-size: 21px; color: #fff; }

/* ── Shot profile (Efficiency tab) ────────────────────────── */
.shotdiet { display: flex; height: 14px; border-radius: 7px; overflow: hidden; background: var(--border); }
.shotdiet span { display: block; height: 100%; cursor: pointer; transition: opacity 0.15s; }
.shotdiet span.dim { opacity: 0.3; }
.legend-dot { display: inline-block; width: 9px; height: 9px; border-radius: 2px; margin-right: 7px; vertical-align: middle; }

/* ── Responsive ───────────────────────────────────────────── */
@media (max-width: 600px) {
  /* Header — compact, and clear of the notch in landscape */
  .site-header { padding-top: env(safe-area-inset-top); }
  .header-inner { padding: 10px 16px; gap: 10px; }
  .brand-logo { width: 32px; height: 32px; }
  .brand-name { font-size: 16px; }
  .brand-tagline { padding-left: 8px; }

  /* Top nav + segmented sub-nav: scroll horizontally instead of overflowing
     the page (History has four sub-tabs that won't fit on a phone). */
  .tab-nav { padding: 0 8px; }
  .tab-btn { padding: 12px 12px; }
  .view-toggle {
    width: auto; max-width: 100%; flex-wrap: nowrap;
    overflow-x: auto; -webkit-overflow-scrolling: touch; scrollbar-width: none;
  }
  .view-toggle::-webkit-scrollbar { display: none; }
  .view-toggle-btn { flex: 0 0 auto; padding: 9px 16px; font-size: 14px; }

  /* Content */
  .main-content { padding: 14px; }
  .section-title { font-size: 21px; margin-bottom: 14px; }

  /* Form controls ≥16px so iOS doesn't zoom the page on focus; bigger hit area */
  .season-select, .search-input, .modal-input { font-size: 16px; padding: 11px 13px; }
  .search-input { max-width: 100%; }

  /* Denser tables → fewer clipped columns; the wrap still scrolls smoothly */
  thead th { padding: 9px 10px; font-size: 12px; }
  td { padding: 9px 10px; font-size: 13px; }
  /* Low-priority columns (venue/TV/tip-off) yield so Result stays on screen */
  .col-hide-m { display: none; }

  /* Filter pills / toggles: comfortable tap targets */
  .filter-btn { padding: 9px 16px; }

  /* Drawer is full-screen on phones — reclaim padding, respect the home bar */
  .drawer { padding: 16px; padding-bottom: calc(16px + env(safe-area-inset-bottom)); }
  .drawer-close { top: calc(8px + env(safe-area-inset-top)); right: 8px; font-size: 22px; padding: 8px 12px; }
  .drawer-nav { margin-right: 44px; }
  .player-photo-wrap { width: 104px; height: 104px; }
  /* Headshots are landscape with the head against the top edge, so cover crops
     them on narrow cards. Show the whole player over the gradient instead. */
  .player-card-photo, .player-photo { object-fit: contain; object-position: center bottom; }
  .matchup-score { font-size: 34px; }
  .matchup-logo { width: 40px; height: 40px; }

  /* Live banner */
  .live-inner { padding: 9px 16px; gap: 10px; }

  /* Slightly smaller card minimums so two columns still fit on a phone */
  .player-cards { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
  .modal { padding: 24px; }
}

/* ── Change API Key button ─────────────────────────────────── */
.change-key-btn {
  font-size: 12px;
  color: var(--text-muted);
  padding: 4px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: var(--transition);
}
.change-key-btn:hover { color: var(--text); border-color: var(--accent); }

/* ── Live game-day banner ─────────────────────────────────────── */
.live-banner {
  background: linear-gradient(90deg, rgba(173,0,0,0.20), rgba(173,0,0,0.05));
  border-top: 1px solid rgba(173,0,0,0.40);
}
.live-banner.hidden { display: none; }
.live-banner.pre  { background: linear-gradient(90deg, rgba(212,175,55,0.16), rgba(212,175,55,0.04)); border-top-color: rgba(212,175,55,0.4); }
.live-banner.post { background: var(--bg-card); border-top: 1px solid var(--border); }
.live-inner {
  max-width: 1200px; margin: 0 auto; padding: 9px 24px;
  display: flex; align-items: center; gap: 14px;
  color: var(--text); text-decoration: none; font-size: 14px; cursor: pointer;
}
.live-pill {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--accent); color: #fff; font-family: var(--font-heading);
  font-weight: 700; font-size: 12px; letter-spacing: 1px;
  padding: 3px 9px; border-radius: 4px; white-space: nowrap;
}
.live-pill.gold  { background: var(--gold); color: #1a1a1a; }
.live-pill.muted { background: #2a2a2a; color: var(--text-muted); }
.live-dot { width: 7px; height: 7px; border-radius: 50%; background: #fff; animation: livepulse 1.2s infinite; }
@keyframes livepulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.25; } }
.live-clock { font-family: var(--font-heading); font-weight: 600; color: var(--text-muted); font-size: 13px; letter-spacing: 0.5px; white-space: nowrap; }
.live-score { margin-left: auto; display: flex; align-items: center; gap: 8px; font-family: var(--font-heading); white-space: nowrap; }
.live-logo { width: 22px; height: 22px; object-fit: contain; }
.live-abbr { font-weight: 600; font-size: 14px; color: var(--text-muted); }
.live-abbr.lou { color: #fff; }
.live-score b { font-size: 18px; font-weight: 700; }
.live-score b.lou { color: #fff; }
.live-sep { color: var(--text-muted); margin: 0 2px; }
.live-vs { color: var(--text-muted); font-weight: 600; margin-right: 2px; }
.live-win { color: #22c55e; }
.live-loss { color: #ef4444; }
@media (prefers-reduced-motion: reduce) {
  .live-dot, .skeleton, .tab-panel { animation: none; }
  .drawer { transition: none; }
  .stat-bar-fill, .cmp-fill { transition: none; }
  .player-card:hover, .home-card:hover { transform: none; }
}
/* ── Reset & Base ─────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg: #0f0f0f;
  --bg-card: #1a1a1a;
  --bg-card-hover: #222;
  --accent: #AD0000;          /* brand red — fills only (white text on top) */
  --accent-text: #ef5350;     /* red as TEXT on dark bgs — ≥4.5:1 on --bg-card */
  --accent-dim: rgba(173, 0, 0, 0.15);
  --text: #ffffff;
  --text-muted: #9ca3af;
  --border: #2a2a2a;
  --green-tint: rgba(34, 197, 94, 0.08);
  --red-tint: rgba(239, 68, 68, 0.08);
  --gold: #d4af37;
  --beak: #f8b810; /* sampled from the cardinal logo's beak */
  --font-display: 'Fraunces', Georgia, 'Times New Roman', serif; /* editorial serif headlines */
  --font-heading: 'Inter', sans-serif; /* UI labels, table headers, numerals */
  --font-body: 'Inter', sans-serif;
  --font-mono: 'IBM Plex Mono', ui-monospace, 'SF Mono', Menlo, Consolas, monospace; /* nav */
  --radius: 6px;
  --transition: 0.18s ease;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.55;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  font-optical-sizing: auto;
}

a { color: var(--accent-text); text-decoration: none; }
a:hover { text-decoration: underline; }
button { cursor: pointer; border: none; background: none; font-family: inherit; touch-action: manipulation; }
:focus-visible { outline: 2px solid var(--accent-text); outline-offset: 2px; }
img { max-width: 100%; display: block; }
svg { max-width: 100%; height: auto; }            /* charts never overflow the viewport */
body { -webkit-tap-highlight-color: rgba(0,0,0,0); } /* no grey flash on tap (focus-visible still shows) */

/* ── Header ───────────────────────────────────────────────── */
.site-header {
  background: #111;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 24px;
  gap: 16px;
}

.brand { display: flex; align-items: center; gap: 12px; cursor: pointer; }
.brand:hover { opacity: 0.85; }
.brand:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; border-radius: 4px; }
.brand-logo { width: 40px; height: 40px; object-fit: contain; }
.brand-name {
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -0.01em;
}
.brand-tagline {
  font-size: 12px;
  font-weight: 500;
  color: var(--beak);
  letter-spacing: 0.3px;
  padding-left: 12px;
  border-left: 1px solid var(--border);
  align-self: center;
}

/* ── Year Switcher ────────────────────────────────────────── */
.year-switcher {
  display: flex;
  gap: 4px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 3px;
}
.year-btn {
  padding: 4px 12px;
  border-radius: 4px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  transition: var(--transition);
}
.year-btn.active { background: var(--accent); color: #fff; }

/* ── Tab Nav ──────────────────────────────────────────────── */
.tab-nav-wrap { position: relative; }
/* Right-edge fade = "more tabs this way" when the nav overflows (class set in app.js) */
.tab-nav-wrap::after {
  content: ''; position: absolute; top: 1px; right: 0; bottom: 0; width: 44px;
  background: linear-gradient(90deg, transparent, #111 85%);
  pointer-events: none; opacity: 0; transition: opacity 0.15s;
}
.tab-nav-wrap.hscroll-on::after { opacity: 1; }

/* Generic right-edge fade for horizontally scrollable strips (rafter banners
   etc.): wrap the scroller in .hscroll-fade; attachHScrollFade (app.js)
   toggles .hscroll-on. --fade-bg matches the surface behind the strip. */
.hscroll-fade { position: relative; }
.hscroll-fade::after {
  content: ''; position: absolute; top: 0; right: 0; bottom: 0; width: 48px;
  background: linear-gradient(90deg, transparent, var(--fade-bg, var(--bg)) 85%);
  pointer-events: none; opacity: 0; transition: opacity 0.15s;
}
.hscroll-fade.hscroll-on::after { opacity: 1; }
.tab-nav {
  display: flex;
  padding: 0 24px;
  border-top: 1px solid var(--border);
  overflow-x: auto;
  scrollbar-width: none;
}
.tab-nav::-webkit-scrollbar { display: none; }

.tab-btn {
  padding: 10px 16px;
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 400;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-muted);
  border-bottom: 3px solid transparent;
  white-space: nowrap;
  transition: color var(--transition), border-color var(--transition);
}
.tab-btn:hover { color: var(--text); }
.tab-btn.active { color: var(--text); border-bottom-color: var(--accent); }


/* ── Tab Panels ───────────────────────────────────────────── */
.main-content { padding: 24px; max-width: 1200px; margin: 0 auto; }
.tab-panel { animation: fadeIn 0.2s ease; }
.tab-panel.hidden { display: none; }
.view-panel.hidden { display: none; }
/* sub-view segmented control sits just under the top nav */
.view-toggle.sub-nav { margin-bottom: 22px; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; } }

/* ── Cards ────────────────────────────────────────────────── */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius);
  padding: 16px;
}
.card:hover { background: var(--bg-card-hover); }

/* ── Tables ───────────────────────────────────────────────── */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; border-radius: var(--radius); border: 1px solid var(--border); }
table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
thead tr { background: var(--accent); }
thead th {
  padding: 10px 14px;
  text-align: left;
  font-family: var(--font-heading);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.5px;
  white-space: nowrap;
  color: #fff;
}
thead th.sortable { cursor: pointer; user-select: none; }
thead th.sortable::after { content: ' ⇅'; opacity: 0.4; font-size: 11px; }
thead th.sort-asc::after { content: ' ↑'; opacity: 1; }
thead th.sort-desc::after { content: ' ↓'; opacity: 1; }
tbody tr { border-bottom: 1px solid var(--border); transition: background var(--transition); }
tbody tr:nth-child(even) { background: rgba(255,255,255,0.02); }
tbody tr:hover { background: rgba(255,255,255,0.05); }
tbody tr.win { background: var(--green-tint); }
tbody tr.loss { background: var(--red-tint); }
td { padding: 10px 14px; color: var(--text); font-size: 14px; line-height: 1.4; }
td.muted { color: var(--text-muted); }
td img { display: inline-block; vertical-align: middle; } /* logos sit inline with the team name */

/* ── Modal ────────────────────────────────────────────────── */
.modal-backdrop {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.8);
  z-index: 1000;
  display: flex; align-items: center; justify-content: center;
  padding: 24px;
}
.modal-backdrop.hidden { display: none; }
.modal {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 32px;
  max-width: 480px;
  width: 100%;
}
.modal-title { font-family: var(--font-display); font-size: 23px; font-weight: 700; letter-spacing: -0.01em; margin-bottom: 12px; }
.modal-body { color: var(--text-muted); margin-bottom: 20px; line-height: 1.6; }
.modal-input {
  width: 100%;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  padding: 10px 14px;
  font-family: var(--font-body);
  font-size: 14px;
  margin-bottom: 12px;
  outline: none;
}
.modal-input:focus { border-color: var(--accent); }
.btn-primary {
  width: 100%;
  padding: 10px;
  background: var(--accent);
  color: #fff;
  font-family: var(--font-heading);
  font-size: 15px;
  font-weight: 600;
  border-radius: var(--radius);
  letter-spacing: 0.5px;
  transition: opacity var(--transition);
}
.btn-primary:hover { opacity: 0.9; }

/* ── Player Drawer ────────────────────────────────────────── */
.overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.6);
  z-index: 200;
}
.overlay.hidden { display: none; }
.drawer {
  position: fixed; top: 0; right: 0;
  width: min(480px, 100vw);
  height: 100vh;
  background: var(--bg-card);
  border-left: 1px solid var(--border);
  z-index: 201;
  overflow-y: auto;
  padding: 24px;
  transform: translateX(100%);
  transition: transform 0.25s ease;
}
.drawer.open { transform: translateX(0); }
.drawer.hidden { display: none; }
.drawer-close {
  position: absolute; top: 16px; right: 16px;
  color: var(--text-muted); font-size: 18px; padding: 4px 8px;
}
.drawer-close:hover { color: var(--text); }

/* ── Stat Bar ─────────────────────────────────────────────── */
.stat-bar-wrap { margin-bottom: 16px; }
.stat-bar-label {
  display: flex; justify-content: space-between;
  margin-bottom: 4px; font-size: 12px; color: var(--text-muted);
}
.stat-bar-track { height: 6px; background: var(--border); border-radius: 3px; overflow: hidden; }
.stat-bar-fill { height: 100%; background: var(--accent); border-radius: 3px; transition: width 0.5s ease; }

/* ── Error & Loading ──────────────────────────────────────── */
.error-card {
  background: rgba(239,68,68,0.08);
  border: 1px solid rgba(239,68,68,0.3);
  border-radius: var(--radius);
  padding: 20px; text-align: center; color: var(--text-muted);
}
.btn-retry {
  margin-top: 12px; padding: 8px 20px;
  border: 1px solid var(--accent); border-radius: var(--radius);
  color: var(--accent-text); font-size: 13px; font-weight: 600;
  transition: var(--transition);
}
.btn-retry:hover { background: var(--accent-dim); }
.skeleton {
  background: linear-gradient(90deg, var(--bg-card) 25%, #222 50%, var(--bg-card) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: var(--radius);
}
@keyframes shimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }
.skeleton-row { height: 44px; margin-bottom: 2px; }

/* ── Badges ───────────────────────────────────────────────── */
.pos-badge {
  display: inline-block; padding: 2px 8px;
  background: var(--accent-dim); border: 1px solid rgba(173,0,0,0.3);
  border-radius: 4px; font-size: 11px; font-weight: 600;
  color: var(--accent-text); letter-spacing: 0.5px;
}
.uofl-badge {
  display: inline-block; padding: 2px 8px;
  background: var(--accent); border-radius: 4px;
  font-size: 11px; font-weight: 700; color: #fff; letter-spacing: 0.5px;
}

/* ── Section & Position Headings ──────────────────────────── */
.section-title {
  font-family: var(--font-display); font-size: 25px; font-weight: 700;
  letter-spacing: -0.01em; margin-bottom: 18px; padding-bottom: 8px;
  border-bottom: 2px solid var(--accent);
}
.position-section { margin-bottom: 32px; }
.position-title {
  font-family: var(--font-heading); font-size: 14px; font-weight: 600;
  color: var(--text-muted); letter-spacing: 1px;
  text-transform: uppercase; margin-bottom: 12px;
}

/* ── Roster position grouping (unit header + per-position subsections) ── */
.position-group { margin-bottom: 40px; }
.position-group-title {
  font-family: var(--font-display); font-size: 21px; font-weight: 700;
  letter-spacing: -0.01em; color: var(--text); margin-bottom: 16px;
  border-bottom: 1px solid var(--border); padding-bottom: 8px;
}
.position-subsection { margin-bottom: 22px; }
.position-subtitle {
  font-family: var(--font-heading); font-size: 13px; font-weight: 600;
  color: var(--text-muted); letter-spacing: 1px;
  text-transform: uppercase; margin-bottom: 10px;
}
.position-subtitle .count { opacity: 0.6; margin-left: 6px; font-weight: 400; }
.position-group-title .count { color: var(--text-muted); margin-left: 8px; font-size: 14px; font-weight: 400; }

/* ── Drawer prev/next navigation ──────────────────────────── */
.drawer-nav { display: flex; align-items: center; gap: 12px; margin: 0 36px 16px 0; }
.drawer-nav-btn {
  width: 32px; height: 32px; border-radius: 8px;
  background: var(--bg); border: 1px solid var(--border);
  color: var(--text); font-size: 18px; line-height: 1; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: border-color var(--transition), color var(--transition);
}
.drawer-nav-btn:hover { border-color: var(--accent); color: var(--accent-text); }
.drawer-nav-pos { font-size: 12px; color: var(--text-muted); letter-spacing: 0.5px; }

/* ── Player headshot (drawer) ─────────────────────────────── */
.player-photo-wrap {
  position: relative; width: 128px; height: 128px;
  border-radius: 12px; overflow: hidden; margin-bottom: 14px;
  background: linear-gradient(160deg, #2a0d0d, var(--bg));
  border: 1px solid var(--border);
}
.player-photo {
  width: 100%; height: 100%;
  object-fit: cover; object-position: top center; display: block;
}
/* Roster card headshot (full-bleed to the card's top edge) */
.player-card-photo-wrap {
  position: relative; height: 132px;
  margin: -12px -12px 10px; overflow: hidden;
  border-radius: var(--radius) var(--radius) 0 0;
  background: linear-gradient(160deg, #2a0d0d, var(--bg));
}
.player-card-photo {
  width: 100%; height: 100%;
  object-fit: cover; object-position: top center; display: block;
}
.headshot-fallback {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-display); font-weight: 700; font-size: 30px;
  color: var(--text-muted);
}

/* ── Player Cards Grid ────────────────────────────────────── */
.player-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 10px; }
.player-card {
  background: var(--bg-card); border: 1px solid var(--border);
  border-left: 3px solid var(--accent); border-radius: var(--radius);
  padding: 12px; cursor: pointer;
  transition: background var(--transition), transform var(--transition);
}
.player-card:hover { background: var(--bg-card-hover); transform: translateY(-1px); }
.player-card-name { font-weight: 600; font-size: 14px; margin-bottom: 4px; }
.player-card-meta { font-size: 12px; color: var(--text-muted); }

/* ── View Toggle ──────────────────────────────────────────── */
.view-toggle {
  display: flex; gap: 4px; background: var(--bg-card);
  border: 1px solid var(--border); border-radius: var(--radius);
  padding: 3px; margin-bottom: 20px; width: fit-content;
}
.view-toggle-btn {
  padding: 5px 16px; border-radius: 4px;
  font-size: 13px; font-weight: 600; color: var(--text-muted); transition: var(--transition);
}
.view-toggle-btn.active { background: var(--accent); color: #fff; }

/* ── Filter Bar ───────────────────────────────────────────── */
.search-input {
  width: 100%;
  max-width: 440px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  padding: 9px 13px;
  font-family: var(--font-body);
  font-size: 15px;
  margin-bottom: 20px;
  outline: none;
}
.search-input:focus { border-color: var(--accent); }
/* ── Per-tab controls row (season selector + view toggle / search) ── */
.tab-controls { display: flex; align-items: center; gap: 10px; margin-bottom: 20px; flex-wrap: wrap; }
.tab-controls .view-toggle,
.tab-controls .search-input { margin-bottom: 0; }

/* ── Schedule season selector + bowl rows ─────────────────── */
.schedule-controls { display: flex; align-items: center; gap: 10px; margin-bottom: 20px; flex-wrap: wrap; }
.schedule-controls .search-input,
.schedule-controls .view-toggle { margin-bottom: 0; }
.season-select {
  background: var(--bg); border: 1px solid var(--border); color: var(--text);
  border-radius: var(--radius); padding: 8px 12px;
  font-family: var(--font-body); font-size: 15px; cursor: pointer; outline: none;
}
.season-select:focus { border-color: var(--accent); }
.schedule-divider td {
  background: var(--bg); color: var(--text-muted);
  font-family: var(--font-heading); font-size: 12px; font-weight: 600;
  letter-spacing: 1px; text-transform: uppercase; padding: 10px 16px;
}
.game-row { cursor: pointer; }
.boxscore th, .boxscore td { text-align: center; padding: 7px 10px; }
.boxscore th:first-child, .boxscore td:first-child { text-align: left; white-space: nowrap; }

/* ── Game detail: matchup header ──────────────────────────── */
.matchup {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 10px; margin: 6px 0 2px;
}
.matchup-team {
  display: flex; flex-direction: column; align-items: center; gap: 7px;
  flex: 1 1 0; min-width: 0;
}
.matchup-logo { width: 46px; height: 46px; object-fit: contain; }
.matchup-name {
  font-family: var(--font-heading); font-size: 14px; font-weight: 600;
  text-align: center; line-height: 1.2;
}
.matchup-center { flex: 0 0 auto; text-align: center; padding: 4px 4px 0; }
.matchup-score {
  font-family: var(--font-heading); font-size: 40px; font-weight: 700;
  line-height: 1; letter-spacing: 0; font-variant-numeric: tabular-nums; white-space: nowrap;
}
.matchup-score .dash { margin: 0 8px; color: var(--text-muted); font-weight: 400; }
.matchup-score.vs { font-size: 24px; color: var(--text-muted); }
.matchup-status {
  font-size: 11px; font-weight: 600; letter-spacing: 1.5px;
  text-transform: uppercase; color: var(--text-muted); margin-top: 8px;
}
.matchup-date { text-align: center; color: var(--text-muted); font-size: 12px; margin: 4px 0 4px; }

/* ── Game-detail drawer tabs ──────────────────────────────── */
.gd-tabs {
  display: flex; gap: 4px; margin: 14px 0 6px;
  background: var(--bg); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 3px;
}
.gd-tab {
  flex: 1; padding: 6px 4px; border-radius: 4px;
  font-size: 12px; font-weight: 600; color: var(--text-muted);
  white-space: nowrap; transition: var(--transition);
}
.gd-tab:hover { color: var(--text); }
.gd-tab.active { background: var(--accent); color: #fff; }
.gd-panel.hidden { display: none; }

/* ── Game detail: team-stat comparison (value | LABEL | value) ── */
.cmp { margin-top: 6px; }
/* Which column is which team — Louisville is always the left/red column */
.cmp-teams {
  display: flex; justify-content: space-between; gap: 10px;
  margin-bottom: 2px; font-size: 12px; font-weight: 700; letter-spacing: 0.3px;
}
.cmp-teams .cmp-team-lou { color: var(--accent-text); }
.cmp-teams .cmp-team-opp { color: #94a3b8; }
.cmp-row { padding: 9px 0; border-top: 1px solid var(--border); }
.cmp-row:first-child { border-top: none; }
.cmp-head {
  display: flex; align-items: baseline; justify-content: space-between;
  gap: 10px; margin-bottom: 7px;
}
.cmp-val {
  font-family: var(--font-heading); font-size: 17px; font-weight: 600;
  font-variant-numeric: tabular-nums; min-width: 46px; flex: 0 0 auto;
}
.cmp-val:last-child { text-align: right; }
.cmp-label {
  flex: 1 1 auto; text-align: center; font-size: 11px; font-weight: 600;
  letter-spacing: 1px; text-transform: uppercase; color: var(--text-muted);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.cmp-bar { display: flex; gap: 3px; height: 6px; }
.cmp-bar-half {
  flex: 1; background: var(--border); border-radius: 3px;
  display: flex; overflow: hidden;
}
.cmp-bar-half.left { justify-content: flex-end; }
.cmp-bar-half.right { justify-content: flex-start; }
.cmp-fill { height: 100%; border-radius: 3px; transition: width 0.5s ease; }
.cmp-fill.lou { background: var(--accent); }
.cmp-fill.opp { background: #64748b; }

/* ── Poll rankings ────────────────────────────────────────── */
.rank-badge {
  font-family: var(--font-heading); font-size: 11px; font-weight: 700;
  color: var(--gold); margin-right: 5px; vertical-align: 1px;
}
.matchup-rank {
  font-size: 11px; font-weight: 600; color: var(--gold);
  margin-top: 3px; text-align: center; letter-spacing: 0.3px;
}
tbody tr.rank-lou { background: var(--accent-dim); }
tbody tr.rank-lou:hover { background: rgba(173, 0, 0, 0.22); }

.bowl-badge {
  display: inline-block; margin-left: 6px; padding: 1px 7px;
  background: rgba(212, 175, 55, 0.15); border: 1px solid rgba(212, 175, 55, 0.5);
  border-radius: 4px; font-size: 10px; font-weight: 700; letter-spacing: 0.5px;
  color: var(--gold); vertical-align: middle;
}

.show-more-bar { display: flex; align-items: center; gap: 12px; margin: 0 0 8px; }
.show-more-bar .filter-btn { padding: 5px 12px; font-size: 12px; }
.filter-bar { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 20px; }
.filter-btn {
  padding: 6px 16px; border: 1px solid var(--border);
  border-radius: 20px; font-size: 13px; font-weight: 600;
  color: var(--text-muted); transition: var(--transition);
}
.filter-btn:hover { border-color: var(--accent); color: var(--text); }
.filter-btn.active { background: var(--accent); border-color: var(--accent); color: #fff; }

/* ── Hero Leader Cards ────────────────────────────────────── */
.leader-heroes { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-bottom: 28px; }
@media (max-width: 640px) { .leader-heroes { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 420px) { .leader-heroes { grid-template-columns: 1fr; } }
.hero-card {
  background: var(--bg-card); border: 1px solid var(--border);
  border-top: 3px solid var(--accent); border-radius: var(--radius);
  padding: 16px; text-align: center;
}
.hero-card-category { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 1px; color: var(--accent-text); margin-bottom: 8px; }
.hero-card-name { font-family: var(--font-display); font-size: 19px; font-weight: 700; letter-spacing: -0.01em; margin-bottom: 4px; }
.hero-card-stat { font-family: var(--font-heading); font-size: 30px; font-weight: 700; color: var(--accent-text); font-variant-numeric: tabular-nums; letter-spacing: -0.01em; }
.hero-card-sublabel { font-size: 12px; color: var(--text-muted); margin-top: 2px; }

/* ── Home / Overview ──────────────────────────────────────── */
.home-feature { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 14px; margin-bottom: 14px; }
.home-grid    { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; }
.home-card { cursor: pointer; transition: background var(--transition), transform var(--transition); }
.home-card:hover { background: var(--bg-card-hover); transform: translateY(-1px); }
.home-card-label { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 1px; color: var(--accent-text); margin-bottom: 10px; }
.home-card-link { margin-top: 12px; font-size: 12px; font-weight: 600; color: var(--text-muted); }
.home-card:hover .home-card-link { color: var(--accent-text); }
.home-game-line { display: flex; align-items: center; gap: 10px; }
.home-game-opp { font-family: var(--font-display); font-size: 20px; font-weight: 700; letter-spacing: -0.01em; }
.home-sub { color: var(--text-muted); font-size: 13px; margin-top: 6px; }
.home-record { font-family: var(--font-display); font-size: 34px; font-weight: 700; letter-spacing: -0.01em; line-height: 1; }
.home-pills { display: flex; gap: 6px; }
.home-pill { display: inline-flex; align-items: center; justify-content: center; width: 26px; height: 26px; border-radius: 6px; color: #fff; font-weight: 700; font-size: 13px; }
.home-leader { display: flex; align-items: baseline; gap: 8px; padding: 4px 0; }
.home-leader-cat { font-size: 11px; font-weight: 700; color: var(--text-muted); width: 34px; }
.home-leader-name { flex: 1; font-size: 14px; }
.home-leader-val { font-weight: 700; font-variant-numeric: tabular-nums; }
.home-rank { padding: 3px 0; font-size: 14px; }
.home-rank.is-lou { color: var(--accent-text); font-weight: 700; }
.home-rank-n { display: inline-block; width: 22px; color: var(--text-muted); font-variant-numeric: tabular-nums; }
.home-rank.is-lou .home-rank-n { color: var(--accent-text); }

/* Home hero banner */
.home-hero {
  display: flex; align-items: center; gap: 18px;
  background: linear-gradient(135deg, rgba(173,0,0,0.22), var(--bg-card) 60%);
  border: 1px solid var(--border); border-left: 3px solid var(--accent);
  border-radius: var(--radius); padding: 20px 22px; margin-bottom: 16px;
}
.home-hero-logo { width: 64px; height: 64px; object-fit: contain; flex: 0 0 auto; }
.home-hero-name { font-family: var(--font-display); font-size: 28px; font-weight: 700; letter-spacing: -0.01em; line-height: 1.1; }
.home-hero-sub { color: var(--text-muted); font-size: 12px; margin: 3px 0 12px; font-family: var(--font-mono); text-transform: uppercase; letter-spacing: 1.5px; }
.home-chips { display: flex; gap: 8px; flex-wrap: wrap; }
.home-chip { background: var(--bg); border: 1px solid var(--border); border-radius: 20px; padding: 5px 12px; font-size: 13px; color: var(--text-muted); }
.home-chip b { color: var(--text); font-family: var(--font-heading); font-weight: 700; }
.home-result { display: flex; align-items: center; gap: 10px; padding: 5px 0; font-size: 14px; }
.home-result + .home-result { border-top: 1px solid var(--border); }
.home-result-wl { font-weight: 700; width: 14px; text-align: center; }
.home-result-opp { flex: 1; }
.home-result-score { color: var(--text-muted); font-variant-numeric: tabular-nums; }
@media (max-width: 600px) {
  .home-hero { padding: 16px; gap: 14px; }
  .home-hero-logo { width: 48px; height: 48px; }
  .home-hero-name { font-size: 22px; }
}

/* ── Info tooltips (.tip) ─────────────────────────────────── */
/* Outer .tip = 28px invisible tap/click target (WCAG 2.2 target size);
   inner .tip-i = the 14px visual circle. Negative margins keep the old
   14px layout footprint so table rows/labels don't grow. */
.tip {
  display: inline-flex; align-items: center; justify-content: center;
  width: 28px; height: 28px; margin: -7px -7px -7px -3px;
  cursor: help; vertical-align: middle; position: relative; user-select: none;
}
.tip-i {
  display: inline-flex; align-items: center; justify-content: center;
  width: 14px; height: 14px; border-radius: 50%;
  border: 1px solid var(--border); color: var(--text-muted);
  font-family: var(--font-heading); font-size: 9px; font-weight: 700; font-style: normal;
  line-height: 1;
}
.tip:hover .tip-i, .tip:focus .tip-i { color: #fff; background: var(--accent); border-color: var(--accent); }
.tip:focus { outline: none; }
.tip::after {
  content: attr(data-tip);
  position: absolute; top: calc(100% + 1px); left: 50%; transform: translateX(-50%);
  width: max-content; max-width: 230px; padding: 8px 11px;
  background: #000; border: 1px solid var(--border); border-radius: 6px;
  color: var(--text); font-family: var(--font-body); font-size: 12px; font-weight: 400;
  line-height: 1.45; text-align: left; text-transform: none; letter-spacing: 0; white-space: normal;
  box-shadow: 0 6px 18px rgba(0,0,0,0.55); z-index: 400;
  display: none; /* not laid out when hidden — a visibility-hidden bubble still adds phantom scroll to .table-wrap and the page */
}
.tip::before {
  content: ''; position: absolute; top: calc(100% - 5px); left: 50%; transform: translateX(-50%);
  border: 5px solid transparent; border-bottom-color: #000; z-index: 401;
  display: none;
}
.tip:hover::after, .tip:focus::after, .tip:hover::before, .tip:focus::before { display: block; }

/* ── Rafter banners (History → March) ─────────────────────── */
.banner-rafters {
  display: flex; gap: 14px; align-items: flex-start;
  overflow-x: auto; padding: 0 2px 18px; margin-bottom: 6px;
  -webkit-overflow-scrolling: touch; scrollbar-width: none;
}
.banner-rafters::-webkit-scrollbar { display: none; }
.banner {
  flex: 0 0 auto; width: 104px; min-height: 148px;
  display: flex; flex-direction: column; align-items: center;
  text-align: center; padding: 14px 8px 26px; gap: 6px;
  border-top: 5px solid #3a3a3a; /* the rod it hangs from */
  clip-path: polygon(0 0, 100% 0, 100% 86%, 50% 100%, 0 86%); /* pennant tail */
  box-shadow: inset 0 0 0 2px rgba(212, 175, 55, 0.45);
}
.banner.champ { background: linear-gradient(180deg, #900000, var(--accent) 45%, #7d0000); color: #fff; }
.banner-label { font-family: var(--font-heading); font-size: 9px; font-weight: 700; letter-spacing: 2px; }
.banner-title { font-family: var(--font-heading); font-size: 11px; font-weight: 700; letter-spacing: 1px; text-transform: uppercase; line-height: 1.35; }
.banner-year  { font-family: var(--font-display); font-size: 27px; font-weight: 700; color: var(--gold); margin-top: auto; }
.banner.ff {
  width: 88px; min-height: 124px; padding-bottom: 22px;
  background: linear-gradient(180deg, #232323, #191919);
  box-shadow: inset 0 0 0 2px rgba(173, 0, 0, 0.5);
  color: var(--accent-text);
}
.banner.ff .banner-year { font-size: 21px; color: #fff; }

/* ── Shot profile (Efficiency tab) ────────────────────────── */
.shotdiet { display: flex; height: 14px; border-radius: 7px; overflow: hidden; background: var(--border); }
.shotdiet span { display: block; height: 100%; cursor: pointer; transition: opacity 0.15s; }
.shotdiet span.dim { opacity: 0.3; }
.legend-dot { display: inline-block; width: 9px; height: 9px; border-radius: 2px; margin-right: 7px; vertical-align: middle; }

/* ── Responsive ───────────────────────────────────────────── */
@media (max-width: 600px) {
  /* Header — compact, and clear of the notch in landscape */
  .site-header { padding-top: env(safe-area-inset-top); }
  .header-inner { padding: 10px 16px; gap: 10px; }
  .brand-logo { width: 32px; height: 32px; }
  .brand-name { font-size: 16px; }
  .brand-tagline { padding-left: 8px; }

  /* Top nav + segmented sub-nav: scroll horizontally instead of overflowing
     the page (History has four sub-tabs that won't fit on a phone). */
  .tab-nav { padding: 0 8px; }
  .tab-btn { padding: 12px 12px; }
  .view-toggle {
    width: auto; max-width: 100%; flex-wrap: nowrap;
    overflow-x: auto; -webkit-overflow-scrolling: touch; scrollbar-width: none;
  }
  .view-toggle::-webkit-scrollbar { display: none; }
  .view-toggle-btn { flex: 0 0 auto; padding: 9px 16px; font-size: 14px; }

  /* Content */
  .main-content { padding: 14px; }
  .section-title { font-size: 21px; margin-bottom: 14px; }

  /* Form controls ≥16px so iOS doesn't zoom the page on focus; bigger hit area */
  .season-select, .search-input, .modal-input { font-size: 16px; padding: 11px 13px; }
  .search-input { max-width: 100%; }

  /* Denser tables → fewer clipped columns; the wrap still scrolls smoothly */
  thead th { padding: 9px 10px; font-size: 12px; }
  td { padding: 9px 10px; font-size: 13px; }
  /* Low-priority columns (venue/TV/tip-off) yield so Result stays on screen */
  .col-hide-m { display: none; }

  /* Filter pills / toggles: comfortable tap targets */
  .filter-btn { padding: 9px 16px; }

  /* Drawer is full-screen on phones — reclaim padding, respect the home bar */
  .drawer { padding: 16px; padding-bottom: calc(16px + env(safe-area-inset-bottom)); }
  .drawer-close { top: calc(8px + env(safe-area-inset-top)); right: 8px; font-size: 22px; padding: 8px 12px; }
  .drawer-nav { margin-right: 44px; }
  .player-photo-wrap { width: 104px; height: 104px; }
  /* Headshots are landscape with the head against the top edge, so cover crops
     them on narrow cards. Show the whole player over the gradient instead. */
  .player-card-photo, .player-photo { object-fit: contain; object-position: center bottom; }
  .matchup-score { font-size: 34px; }
  .matchup-logo { width: 40px; height: 40px; }

  /* Live banner */
  .live-inner { padding: 9px 16px; gap: 10px; }

  /* Slightly smaller card minimums so two columns still fit on a phone */
  .player-cards { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
  .modal { padding: 24px; }
}

/* ── Change API Key button ─────────────────────────────────── */
.change-key-btn {
  font-size: 12px;
  color: var(--text-muted);
  padding: 4px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: var(--transition);
}
.change-key-btn:hover { color: var(--text); border-color: var(--accent); }

/* ── Live game-day banner ─────────────────────────────────────── */
.live-banner {
  background: linear-gradient(90deg, rgba(173,0,0,0.20), rgba(173,0,0,0.05));
  border-top: 1px solid rgba(173,0,0,0.40);
}
.live-banner.hidden { display: none; }
.live-banner.pre  { background: linear-gradient(90deg, rgba(212,175,55,0.16), rgba(212,175,55,0.04)); border-top-color: rgba(212,175,55,0.4); }
.live-banner.post { background: var(--bg-card); border-top: 1px solid var(--border); }
.live-inner {
  max-width: 1200px; margin: 0 auto; padding: 9px 24px;
  display: flex; align-items: center; gap: 14px;
  color: var(--text); text-decoration: none; font-size: 14px; cursor: pointer;
}
.live-pill {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--accent); color: #fff; font-family: var(--font-heading);
  font-weight: 700; font-size: 12px; letter-spacing: 1px;
  padding: 3px 9px; border-radius: 4px; white-space: nowrap;
}
.live-pill.gold  { background: var(--gold); color: #1a1a1a; }
.live-pill.muted { background: #2a2a2a; color: var(--text-muted); }
.live-dot { width: 7px; height: 7px; border-radius: 50%; background: #fff; animation: livepulse 1.2s infinite; }
@keyframes livepulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.25; } }
.live-clock { font-family: var(--font-heading); font-weight: 600; color: var(--text-muted); font-size: 13px; letter-spacing: 0.5px; white-space: nowrap; }
.live-score { margin-left: auto; display: flex; align-items: center; gap: 8px; font-family: var(--font-heading); white-space: nowrap; }
.live-logo { width: 22px; height: 22px; object-fit: contain; }
.live-abbr { font-weight: 600; font-size: 14px; color: var(--text-muted); }
.live-abbr.lou { color: #fff; }
.live-score b { font-size: 18px; font-weight: 700; }
.live-score b.lou { color: #fff; }
.live-sep { color: var(--text-muted); margin: 0 2px; }
.live-vs { color: var(--text-muted); font-weight: 600; margin-right: 2px; }
.live-win { color: #22c55e; }
.live-loss { color: #ef4444; }
@media (prefers-reduced-motion: reduce) {
  .live-dot, .skeleton, .tab-panel { animation: none; }
  .drawer { transition: none; }
  .stat-bar-fill, .cmp-fill { transition: none; }
  .player-card:hover, .home-card:hover { transform: none; }
}
/* ── Reset & Base ─────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg: #0f0f0f;
  --bg-card: #1a1a1a;
  --bg-card-hover: #222;
  --accent: #AD0000;          /* brand red — fills only (white text on top) */
  --accent-text: #ef5350;     /* red as TEXT on dark bgs — ≥4.5:1 on --bg-card */
  --accent-dim: rgba(173, 0, 0, 0.15);
  --text: #ffffff;
  --text-muted: #9ca3af;
  --border: #2a2a2a;
  --green-tint: rgba(34, 197, 94, 0.08);
  --red-tint: rgba(239, 68, 68, 0.08);
  --gold: #d4af37;
  --beak: #f8b810; /* sampled from the cardinal logo's beak */
  --font-display: 'Fraunces', Georgia, 'Times New Roman', serif; /* editorial serif headlines */
  --font-heading: 'Inter', sans-serif; /* UI labels, table headers, numerals */
  --font-body: 'Inter', sans-serif;
  --font-mono: 'IBM Plex Mono', ui-monospace, 'SF Mono', Menlo, Consolas, monospace; /* nav */
  --radius: 6px;
  --transition: 0.18s ease;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.55;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  font-optical-sizing: auto;
}

a { color: var(--accent-text); text-decoration: none; }
a:hover { text-decoration: underline; }
button { cursor: pointer; border: none; background: none; font-family: inherit; touch-action: manipulation; }
:focus-visible { outline: 2px solid var(--accent-text); outline-offset: 2px; }
img { max-width: 100%; display: block; }
svg { max-width: 100%; height: auto; }            /* charts never overflow the viewport */
body { -webkit-tap-highlight-color: rgba(0,0,0,0); } /* no grey flash on tap (focus-visible still shows) */

/* ── Header ───────────────────────────────────────────────── */
.site-header {
  background: #111;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 24px;
  gap: 16px;
}

.brand { display: flex; align-items: center; gap: 12px; cursor: pointer; }
.brand:hover { opacity: 0.85; }
.brand:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; border-radius: 4px; }
.brand-logo { width: 40px; height: 40px; object-fit: contain; }
.brand-name {
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -0.01em;
}
.brand-tagline {
  font-size: 12px;
  font-weight: 500;
  color: var(--beak);
  letter-spacing: 0.3px;
  padding-left: 12px;
  border-left: 1px solid var(--border);
  align-self: center;
}

/* ── Year Switcher ────────────────────────────────────────── */
.year-switcher {
  display: flex;
  gap: 4px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 3px;
}
.year-btn {
  padding: 4px 12px;
  border-radius: 4px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  transition: var(--transition);
}
.year-btn.active { background: var(--accent); color: #fff; }

/* ── Tab Nav ──────────────────────────────────────────────── */
.tab-nav-wrap { position: relative; }
/* Right-edge fade = "more tabs this way" when the nav overflows (class set in app.js) */
.tab-nav-wrap::after {
  content: ''; position: absolute; top: 1px; right: 0; bottom: 0; width: 44px;
  background: linear-gradient(90deg, transparent, #111 85%);
  pointer-events: none; opacity: 0; transition: opacity 0.15s;
}
.tab-nav-wrap.hscroll-on::after { opacity: 1; }

/* Generic right-edge fade for horizontally scrollable strips (rafter banners
   etc.): wrap the scroller in .hscroll-fade; attachHScrollFade (app.js)
   toggles .hscroll-on. --fade-bg matches the surface behind the strip. */
.hscroll-fade { position: relative; }
.hscroll-fade::after {
  content: ''; position: absolute; top: 0; right: 0; bottom: 0; width: 48px;
  background: linear-gradient(90deg, transparent, var(--fade-bg, var(--bg)) 85%);
  pointer-events: none; opacity: 0; transition: opacity 0.15s;
}
.hscroll-fade.hscroll-on::after { opacity: 1; }
.tab-nav {
  display: flex;
  padding: 0 24px;
  border-top: 1px solid var(--border);
  overflow-x: auto;
  scrollbar-width: none;
}
.tab-nav::-webkit-scrollbar { display: none; }

.tab-btn {
  padding: 10px 16px;
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 400;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-muted);
  border-bottom: 3px solid transparent;
  white-space: nowrap;
  transition: color var(--transition), border-color var(--transition);
}
.tab-btn:hover { color: var(--text); }
.tab-btn.active { color: var(--text); border-bottom-color: var(--accent); }


/* ── Tab Panels ───────────────────────────────────────────── */
.main-content { padding: 24px; max-width: 1200px; margin: 0 auto; }
.tab-panel { animation: fadeIn 0.2s ease; }
.tab-panel.hidden { display: none; }
.view-panel.hidden { display: none; }
/* sub-view segmented control sits just under the top nav */
.view-toggle.sub-nav { margin-bottom: 22px; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; } }

/* ── Cards ────────────────────────────────────────────────── */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius);
  padding: 16px;
}
.card:hover { background: var(--bg-card-hover); }

/* ── Tables ───────────────────────────────────────────────── */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; border-radius: var(--radius); border: 1px solid var(--border); }
table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
thead tr { background: var(--accent); }
thead th {
  padding: 10px 14px;
  text-align: left;
  font-family: var(--font-heading);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.5px;
  white-space: nowrap;
  color: #fff;
}
thead th.sortable { cursor: pointer; user-select: none; }
thead th.sortable::after { content: ' ⇅'; opacity: 0.4; font-size: 11px; }
thead th.sort-asc::after { content: ' ↑'; opacity: 1; }
thead th.sort-desc::after { content: ' ↓'; opacity: 1; }
tbody tr { border-bottom: 1px solid var(--border); transition: background var(--transition); }
tbody tr:nth-child(even) { background: rgba(255,255,255,0.02); }
tbody tr:hover { background: rgba(255,255,255,0.05); }
tbody tr.win { background: var(--green-tint); }
tbody tr.loss { background: var(--red-tint); }
td { padding: 10px 14px; color: var(--text); font-size: 14px; line-height: 1.4; }
td.muted { color: var(--text-muted); }
td img { display: inline-block; vertical-align: middle; } /* logos sit inline with the team name */

/* ── Modal ────────────────────────────────────────────────── */
.modal-backdrop {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.8);
  z-index: 1000;
  display: flex; align-items: center; justify-content: center;
  padding: 24px;
}
.modal-backdrop.hidden { display: none; }
.modal {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 32px;
  max-width: 480px;
  width: 100%;
}
.modal-title { font-family: var(--font-display); font-size: 23px; font-weight: 700; letter-spacing: -0.01em; margin-bottom: 12px; }
.modal-body { color: var(--text-muted); margin-bottom: 20px; line-height: 1.6; }
.modal-input {
  width: 100%;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  padding: 10px 14px;
  font-family: var(--font-body);
  font-size: 14px;
  margin-bottom: 12px;
  outline: none;
}
.modal-input:focus { border-color: var(--accent); }
.btn-primary {
  width: 100%;
  padding: 10px;
  background: var(--accent);
  color: #fff;
  font-family: var(--font-heading);
  font-size: 15px;
  font-weight: 600;
  border-radius: var(--radius);
  letter-spacing: 0.5px;
  transition: opacity var(--transition);
}
.btn-primary:hover { opacity: 0.9; }

/* ── Player Drawer ────────────────────────────────────────── */
.overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.6);
  z-index: 200;
}
.overlay.hidden { display: none; }
.drawer {
  position: fixed; top: 0; right: 0;
  width: min(480px, 100vw);
  height: 100vh;
  background: var(--bg-card);
  border-left: 1px solid var(--border);
  z-index: 201;
  overflow-y: auto;
  padding: 24px;
  transform: translateX(100%);
  transition: transform 0.25s ease;
}
.drawer.open { transform: translateX(0); }
.drawer.hidden { display: none; }
.drawer-close {
  position: absolute; top: 16px; right: 16px;
  color: var(--text-muted); font-size: 18px; padding: 4px 8px;
}
.drawer-close:hover { color: var(--text); }

/* ── Stat Bar ─────────────────────────────────────────────── */
.stat-bar-wrap { margin-bottom: 16px; }
.stat-bar-label {
  display: flex; justify-content: space-between;
  margin-bottom: 4px; font-size: 12px; color: var(--text-muted);
}
.stat-bar-track { height: 6px; background: var(--border); border-radius: 3px; overflow: hidden; }
.stat-bar-fill { height: 100%; background: var(--accent); border-radius: 3px; transition: width 0.5s ease; }

/* ── Error & Loading ──────────────────────────────────────── */
.error-card {
  background: rgba(239,68,68,0.08);
  border: 1px solid rgba(239,68,68,0.3);
  border-radius: var(--radius);
  padding: 20px; text-align: center; color: var(--text-muted);
}
.btn-retry {
  margin-top: 12px; padding: 8px 20px;
  border: 1px solid var(--accent); border-radius: var(--radius);
  color: var(--accent-text); font-size: 13px; font-weight: 600;
  transition: var(--transition);
}
.btn-retry:hover { background: var(--accent-dim); }
.skeleton {
  background: linear-gradient(90deg, var(--bg-card) 25%, #222 50%, var(--bg-card) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: var(--radius);
}
@keyframes shimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }
.skeleton-row { height: 44px; margin-bottom: 2px; }

/* ── Badges ───────────────────────────────────────────────── */
.pos-badge {
  display: inline-block; padding: 2px 8px;
  background: var(--accent-dim); border: 1px solid rgba(173,0,0,0.3);
  border-radius: 4px; font-size: 11px; font-weight: 600;
  color: var(--accent-text); letter-spacing: 0.5px;
}
.uofl-badge {
  display: inline-block; padding: 2px 8px;
  background: var(--accent); border-radius: 4px;
  font-size: 11px; font-weight: 700; color: #fff; letter-spacing: 0.5px;
}

/* ── Section & Position Headings ──────────────────────────── */
.section-title {
  font-family: var(--font-display); font-size: 25px; font-weight: 700;
  letter-spacing: -0.01em; margin-bottom: 18px; padding-bottom: 8px;
  border-bottom: 2px solid var(--accent);
}
.position-section { margin-bottom: 32px; }
.position-title {
  font-family: var(--font-heading); font-size: 14px; font-weight: 600;
  color: var(--text-muted); letter-spacing: 1px;
  text-transform: uppercase; margin-bottom: 12px;
}

/* ── Roster position grouping (unit header + per-position subsections) ── */
.position-group { margin-bottom: 40px; }
.position-group-title {
  font-family: var(--font-display); font-size: 21px; font-weight: 700;
  letter-spacing: -0.01em; color: var(--text); margin-bottom: 16px;
  border-bottom: 1px solid var(--border); padding-bottom: 8px;
}
.position-subsection { margin-bottom: 22px; }
.position-subtitle {
  font-family: var(--font-heading); font-size: 13px; font-weight: 600;
  color: var(--text-muted); letter-spacing: 1px;
  text-transform: uppercase; margin-bottom: 10px;
}
.position-subtitle .count { opacity: 0.6; margin-left: 6px; font-weight: 400; }
.position-group-title .count { color: var(--text-muted); margin-left: 8px; font-size: 14px; font-weight: 400; }

/* ── Drawer prev/next navigation ──────────────────────────── */
.drawer-nav { display: flex; align-items: center; gap: 12px; margin: 0 36px 16px 0; }
.drawer-nav-btn {
  width: 32px; height: 32px; border-radius: 8px;
  background: var(--bg); border: 1px solid var(--border);
  color: var(--text); font-size: 18px; line-height: 1; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: border-color var(--transition), color var(--transition);
}
.drawer-nav-btn:hover { border-color: var(--accent); color: var(--accent-text); }
.drawer-nav-pos { font-size: 12px; color: var(--text-muted); letter-spacing: 0.5px; }

/* ── Player headshot (drawer) ─────────────────────────────── */
.player-photo-wrap {
  position: relative; width: 128px; height: 128px;
  border-radius: 12px; overflow: hidden; margin-bottom: 14px;
  background: linear-gradient(160deg, #2a0d0d, var(--bg));
  border: 1px solid var(--border);
}
.player-photo {
  width: 100%; height: 100%;
  object-fit: cover; object-position: top center; display: block;
}
/* Roster card headshot (full-bleed to the card's top edge) */
.player-card-photo-wrap {
  position: relative; height: 132px;
  margin: -12px -12px 10px; overflow: hidden;
  border-radius: var(--radius) var(--radius) 0 0;
  background: linear-gradient(160deg, #2a0d0d, var(--bg));
}
.player-card-photo {
  width: 100%; height: 100%;
  object-fit: cover; object-position: top center; display: block;
}
.headshot-fallback {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-display); font-weight: 700; font-size: 30px;
  color: var(--text-muted);
}

/* ── Player Cards Grid ────────────────────────────────────── */
.player-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 10px; }
.player-card {
  background: var(--bg-card); border: 1px solid var(--border);
  border-left: 3px solid var(--accent); border-radius: var(--radius);
  padding: 12px; cursor: pointer;
  transition: background var(--transition), transform var(--transition);
}
.player-card:hover { background: var(--bg-card-hover); transform: translateY(-1px); }
.player-card-name { font-weight: 600; font-size: 14px; margin-bottom: 4px; }
.player-card-meta { font-size: 12px; color: var(--text-muted); }

/* ── View Toggle ──────────────────────────────────────────── */
.view-toggle {
  display: flex; gap: 4px; background: var(--bg-card);
  border: 1px solid var(--border); border-radius: var(--radius);
  padding: 3px; margin-bottom: 20px; width: fit-content;
}
.view-toggle-btn {
  padding: 5px 16px; border-radius: 4px;
  font-size: 13px; font-weight: 600; color: var(--text-muted); transition: var(--transition);
}
.view-toggle-btn.active { background: var(--accent); color: #fff; }

/* ── Filter Bar ───────────────────────────────────────────── */
.search-input {
  width: 100%;
  max-width: 440px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  padding: 9px 13px;
  font-family: var(--font-body);
  font-size: 15px;
  margin-bottom: 20px;
  outline: none;
}
.search-input:focus { border-color: var(--accent); }
/* ── Per-tab controls row (season selector + view toggle / search) ── */
.tab-controls { display: flex; align-items: center; gap: 10px; margin-bottom: 20px; flex-wrap: wrap; }
.tab-controls .view-toggle,
.tab-controls .search-input { margin-bottom: 0; }

/* ── Schedule season selector + bowl rows ─────────────────── */
.schedule-controls { display: flex; align-items: center; gap: 10px; margin-bottom: 20px; flex-wrap: wrap; }
.schedule-controls .search-input,
.schedule-controls .view-toggle { margin-bottom: 0; }
.season-select {
  background: var(--bg); border: 1px solid var(--border); color: var(--text);
  border-radius: var(--radius); padding: 8px 12px;
  font-family: var(--font-body); font-size: 15px; cursor: pointer; outline: none;
}
.season-select:focus { border-color: var(--accent); }
.schedule-divider td {
  background: var(--bg); color: var(--text-muted);
  font-family: var(--font-heading); font-size: 12px; font-weight: 600;
  letter-spacing: 1px; text-transform: uppercase; padding: 10px 16px;
}
.game-row { cursor: pointer; }
.boxscore th, .boxscore td { text-align: center; padding: 7px 10px; }
.boxscore th:first-child, .boxscore td:first-child { text-align: left; white-space: nowrap; }

/* ── Game detail: matchup header ──────────────────────────── */
.matchup {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 10px; margin: 6px 0 2px;
}
.matchup-team {
  display: flex; flex-direction: column; align-items: center; gap: 7px;
  flex: 1 1 0; min-width: 0;
}
.matchup-logo { width: 46px; height: 46px; object-fit: contain; }
.matchup-name {
  font-family: var(--font-heading); font-size: 14px; font-weight: 600;
  text-align: center; line-height: 1.2;
}
.matchup-center { flex: 0 0 auto; text-align: center; padding: 4px 4px 0; }
.matchup-score {
  font-family: var(--font-heading); font-size: 40px; font-weight: 700;
  line-height: 1; letter-spacing: 0; font-variant-numeric: tabular-nums; white-space: nowrap;
}
.matchup-score .dash { margin: 0 8px; color: var(--text-muted); font-weight: 400; }
.matchup-score.vs { font-size: 24px; color: var(--text-muted); }
.matchup-status {
  font-size: 11px; font-weight: 600; letter-spacing: 1.5px;
  text-transform: uppercase; color: var(--text-muted); margin-top: 8px;
}
.matchup-date { text-align: center; color: var(--text-muted); font-size: 12px; margin: 4px 0 4px; }

/* ── Game-detail drawer tabs ──────────────────────────────── */
.gd-tabs {
  display: flex; gap: 4px; margin: 14px 0 6px;
  background: var(--bg); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 3px;
}
.gd-tab {
  flex: 1; padding: 6px 4px; border-radius: 4px;
  font-size: 12px; font-weight: 600; color: var(--text-muted);
  white-space: nowrap; transition: var(--transition);
}
.gd-tab:hover { color: var(--text); }
.gd-tab.active { background: var(--accent); color: #fff; }
.gd-panel.hidden { display: none; }

/* ── Game detail: team-stat comparison (value | LABEL | value) ── */
.cmp { margin-top: 6px; }
/* Which column is which team — Louisville is always the left/red column */
.cmp-teams {
  display: flex; justify-content: space-between; gap: 10px;
  margin-bottom: 2px; font-size: 12px; font-weight: 700; letter-spacing: 0.3px;
}
.cmp-teams .cmp-team-lou { color: var(--accent-text); }
.cmp-teams .cmp-team-opp { color: #94a3b8; }
.cmp-row { padding: 9px 0; border-top: 1px solid var(--border); }
.cmp-row:first-child { border-top: none; }
.cmp-head {
  display: flex; align-items: baseline; justify-content: space-between;
  gap: 10px; margin-bottom: 7px;
}
.cmp-val {
  font-family: var(--font-heading); font-size: 17px; font-weight: 600;
  font-variant-numeric: tabular-nums; min-width: 46px; flex: 0 0 auto;
}
.cmp-val:last-child { text-align: right; }
.cmp-label {
  flex: 1 1 auto; text-align: center; font-size: 11px; font-weight: 600;
  letter-spacing: 1px; text-transform: uppercase; color: var(--text-muted);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.cmp-bar { display: flex; gap: 3px; height: 6px; }
.cmp-bar-half {
  flex: 1; background: var(--border); border-radius: 3px;
  display: flex; overflow: hidden;
}
.cmp-bar-half.left { justify-content: flex-end; }
.cmp-bar-half.right { justify-content: flex-start; }
.cmp-fill { height: 100%; border-radius: 3px; transition: width 0.5s ease; }
.cmp-fill.lou { background: var(--accent); }
.cmp-fill.opp { background: #64748b; }

/* ── Poll rankings ────────────────────────────────────────── */
.rank-badge {
  font-family: var(--font-heading); font-size: 11px; font-weight: 700;
  color: var(--gold); margin-right: 5px; vertical-align: 1px;
}
.matchup-rank {
  font-size: 11px; font-weight: 600; color: var(--gold);
  margin-top: 3px; text-align: center; letter-spacing: 0.3px;
}
tbody tr.rank-lou { background: var(--accent-dim); }
tbody tr.rank-lou:hover { background: rgba(173, 0, 0, 0.22); }

.bowl-badge {
  display: inline-block; margin-left: 6px; padding: 1px 7px;
  background: rgba(212, 175, 55, 0.15); border: 1px solid rgba(212, 175, 55, 0.5);
  border-radius: 4px; font-size: 10px; font-weight: 700; letter-spacing: 0.5px;
  color: var(--gold); vertical-align: middle;
}

.show-more-bar { display: flex; align-items: center; gap: 12px; margin: 0 0 8px; }
.show-more-bar .filter-btn { padding: 5px 12px; font-size: 12px; }
.filter-bar { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 20px; }
.filter-btn {
  padding: 6px 16px; border: 1px solid var(--border);
  border-radius: 20px; font-size: 13px; font-weight: 600;
  color: var(--text-muted); transition: var(--transition);
}
.filter-btn:hover { border-color: var(--accent); color: var(--text); }
.filter-btn.active { background: var(--accent); border-color: var(--accent); color: #fff; }

/* ── Hero Leader Cards ────────────────────────────────────── */
.leader-heroes { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-bottom: 28px; }
@media (max-width: 640px) { .leader-heroes { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 420px) { .leader-heroes { grid-template-columns: 1fr; } }
.hero-card {
  background: var(--bg-card); border: 1px solid var(--border);
  border-top: 3px solid var(--accent); border-radius: var(--radius);
  padding: 16px; text-align: center;
}
.hero-card-category { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 1px; color: var(--accent-text); margin-bottom: 8px; }
.hero-card-name { font-family: var(--font-display); font-size: 19px; font-weight: 700; letter-spacing: -0.01em; margin-bottom: 4px; }
.hero-card-stat { font-family: var(--font-heading); font-size: 30px; font-weight: 700; color: var(--accent-text); font-variant-numeric: tabular-nums; letter-spacing: -0.01em; }
.hero-card-sublabel { font-size: 12px; color: var(--text-muted); margin-top: 2px; }

/* ── Home / Overview ──────────────────────────────────────── */
.home-feature { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 14px; margin-bottom: 14px; }
.home-grid    { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; }
.home-card { cursor: pointer; transition: background var(--transition), transform var(--transition); }
.home-card:hover { background: var(--bg-card-hover); transform: translateY(-1px); }
.home-card-label { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 1px; color: var(--accent-text); margin-bottom: 10px; }
.home-card-link { margin-top: 12px; font-size: 12px; font-weight: 600; color: var(--text-muted); }
.home-card:hover .home-card-link { color: var(--accent-text); }
.home-game-line { display: flex; align-items: center; gap: 10px; }
.home-game-opp { font-family: var(--font-display); font-size: 20px; font-weight: 700; letter-spacing: -0.01em; }
.home-sub { color: var(--text-muted); font-size: 13px; margin-top: 6px; }
.home-record { font-family: var(--font-display); font-size: 34px; font-weight: 700; letter-spacing: -0.01em; line-height: 1; }
.home-pills { display: flex; gap: 6px; }
.home-pill { display: inline-flex; align-items: center; justify-content: center; width: 26px; height: 26px; border-radius: 6px; color: #fff; font-weight: 700; font-size: 13px; }
.home-leader { display: flex; align-items: baseline; gap: 8px; padding: 4px 0; }
.home-leader-cat { font-size: 11px; font-weight: 700; color: var(--text-muted); width: 34px; }
.home-leader-name { flex: 1; font-size: 14px; }
.home-leader-val { font-weight: 700; font-variant-numeric: tabular-nums; }
.home-rank { padding: 3px 0; font-size: 14px; }
.home-rank.is-lou { color: var(--accent-text); font-weight: 700; }
.home-rank-n { display: inline-block; width: 22px; color: var(--text-muted); font-variant-numeric: tabular-nums; }
.home-rank.is-lou .home-rank-n { color: var(--accent-text); }

/* Home hero banner */
.home-hero {
  display: flex; align-items: center; gap: 18px;
  background: linear-gradient(135deg, rgba(173,0,0,0.22), var(--bg-card) 60%);
  border: 1px solid var(--border); border-left: 3px solid var(--accent);
  border-radius: var(--radius); padding: 20px 22px; margin-bottom: 16px;
}
.home-hero-logo { width: 64px; height: 64px; object-fit: contain; flex: 0 0 auto; }
.home-hero-name { font-family: var(--font-display); font-size: 28px; font-weight: 700; letter-spacing: -0.01em; line-height: 1.1; }
.home-hero-sub { color: var(--text-muted); font-size: 12px; margin: 3px 0 12px; font-family: var(--font-mono); text-transform: uppercase; letter-spacing: 1.5px; }
.home-chips { display: flex; gap: 8px; flex-wrap: wrap; }
.home-chip { background: var(--bg); border: 1px solid var(--border); border-radius: 20px; padding: 5px 12px; font-size: 13px; color: var(--text-muted); }
.home-chip b { color: var(--text); font-family: var(--font-heading); font-weight: 700; }
.home-result { display: flex; align-items: center; gap: 10px; padding: 5px 0; font-size: 14px; }
.home-result + .home-result { border-top: 1px solid var(--border); }
.home-result-wl { font-weight: 700; width: 14px; text-align: center; }
.home-result-opp { flex: 1; }
.home-result-score { color: var(--text-muted); font-variant-numeric: tabular-nums; }
@media (max-width: 600px) {
  .home-hero { padding: 16px; gap: 14px; }
  .home-hero-logo { width: 48px; height: 48px; }
  .home-hero-name { font-size: 22px; }
}

/* ── Info tooltips (.tip) ─────────────────────────────────── */
/* Outer .tip = 28px invisible tap/click target (WCAG 2.2 target size);
   inner .tip-i = the 14px visual circle. Negative margins keep the old
   14px layout footprint so table rows/labels don't grow. */
.tip {
  display: inline-flex; align-items: center; justify-content: center;
  width: 28px; height: 28px; margin: -7px -7px -7px -3px;
  cursor: help; vertical-align: middle; position: relative; user-select: none;
}
.tip-i {
  display: inline-flex; align-items: center; justify-content: center;
  width: 14px; height: 14px; border-radius: 50%;
  border: 1px solid var(--border); color: var(--text-muted);
  font-family: var(--font-heading); font-size: 9px; font-weight: 700; font-style: normal;
  line-height: 1;
}
.tip:hover .tip-i, .tip:focus .tip-i { color: #fff; background: var(--accent); border-color: var(--accent); }
.tip:focus { outline: none; }
.tip::after {
  content: attr(data-tip);
  position: absolute; top: calc(100% + 1px); left: 50%; transform: translateX(-50%);
  width: max-content; max-width: 230px; padding: 8px 11px;
  background: #000; border: 1px solid var(--border); border-radius: 6px;
  color: var(--text); font-family: var(--font-body); font-size: 12px; font-weight: 400;
  line-height: 1.45; text-align: left; text-transform: none; letter-spacing: 0; white-space: normal;
  box-shadow: 0 6px 18px rgba(0,0,0,0.55); z-index: 400;
  display: none; /* not laid out when hidden — a visibility-hidden bubble still adds phantom scroll to .table-wrap and the page */
}
.tip::before {
  content: ''; position: absolute; top: calc(100% - 5px); left: 50%; transform: translateX(-50%);
  border: 5px solid transparent; border-bottom-color: #000; z-index: 401;
  display: none;
}
.tip:hover::after, .tip:focus::after, .tip:hover::before, .tip:focus::before { display: block; }

/* ── Rafter banners (History → March) ─────────────────────── */
.banner-rafters {
  display: flex; gap: 14px; align-items: flex-start;
  overflow-x: auto; padding: 0 2px 18px; margin-bottom: 6px;
  -webkit-overflow-scrolling: touch; scrollbar-width: none;
}
.banner-rafters::-webkit-scrollbar { display: none; }
.banner {
  flex: 0 0 auto; width: 104px; min-height: 148px;
  display: flex; flex-direction: column; align-items: center;
  text-align: center; padding: 14px 8px 26px; gap: 6px;
  border-top: 5px solid #3a3a3a; /* the rod it hangs from */
  clip-path: polygon(0 0, 100% 0, 100% 86%, 50% 100%, 0 86%); /* pennant tail */
  box-shadow: inset 0 0 0 2px rgba(212, 175, 55, 0.45);
}
.banner.champ { background: linear-gradient(180deg, #900000, var(--accent) 45%, #7d0000); color: #fff; }
.banner-label { font-family: var(--font-heading); font-size: 9px; font-weight: 700; letter-spacing: 2px; }
.banner-title { font-family: var(--font-heading); font-size: 11px; font-weight: 700; letter-spacing: 1px; text-transform: uppercase; line-height: 1.35; }
.banner-year  { font-family: var(--font-display); font-size: 27px; font-weight: 700; color: var(--gold); margin-top: auto; }
.banner.ff {
  width: 88px; min-height: 124px; padding-bottom: 22px;
  background: linear-gradient(180deg, #232323, #191919);
  box-shadow: inset 0 0 0 2px rgba(173, 0, 0, 0.5);
  color: var(--accent-text);
}
.banner.ff .banner-year { font-size: 21px; color: #fff; }

/* ── Shot profile (Efficiency tab) ────────────────────────── */
.shotdiet { display: flex; height: 14px; border-radius: 7px; overflow: hidden; background: var(--border); }
.shotdiet span { display: block; height: 100%; cursor: pointer; transition: opacity 0.15s; }
.shotdiet span.dim { opacity: 0.3; }
.legend-dot { display: inline-block; width: 9px; height: 9px; border-radius: 2px; margin-right: 7px; vertical-align: middle; }

/* ── Responsive ───────────────────────────────────────────── */
@media (max-width: 600px) {
  /* Header — compact, and clear of the notch in landscape */
  .site-header { padding-top: env(safe-area-inset-top); }
  .header-inner { padding: 10px 16px; gap: 10px; }
  .brand-logo { width: 32px; height: 32px; }
  .brand-name { font-size: 16px; }
  .brand-tagline { padding-left: 8px; }

  /* Top nav + segmented sub-nav: scroll horizontally instead of overflowing
     the page (History has four sub-tabs that won't fit on a phone). */
  .tab-nav { padding: 0 8px; }
  .tab-btn { padding: 12px 12px; }
  .view-toggle {
    width: auto; max-width: 100%; flex-wrap: nowrap;
    overflow-x: auto; -webkit-overflow-scrolling: touch; scrollbar-width: none;
  }
  .view-toggle::-webkit-scrollbar { display: none; }
  .view-toggle-btn { flex: 0 0 auto; padding: 9px 16px; font-size: 14px; }

  /* Content */
  .main-content { padding: 14px; }
  .section-title { font-size: 21px; margin-bottom: 14px; }

  /* Form controls ≥16px so iOS doesn't zoom the page on focus; bigger hit area */
  .season-select, .search-input, .modal-input { font-size: 16px; padding: 11px 13px; }
  .search-input { max-width: 100%; }

  /* Denser tables → fewer clipped columns; the wrap still scrolls smoothly */
  thead th { padding: 9px 10px; font-size: 12px; }
  td { padding: 9px 10px; font-size: 13px; }
  /* Low-priority columns (venue/TV/tip-off) yield so Result stays on screen */
  .col-hide-m { display: none; }

  /* Filter pills / toggles: comfortable tap targets */
  .filter-btn { padding: 9px 16px; }

  /* Drawer is full-screen on phones — reclaim padding, respect the home bar */
  .drawer { padding: 16px; padding-bottom: calc(16px + env(safe-area-inset-bottom)); }
  .drawer-close { top: calc(8px + env(safe-area-inset-top)); right: 8px; font-size: 22px; padding: 8px 12px; }
  .drawer-nav { margin-right: 44px; }
  .player-photo-wrap { width: 104px; height: 104px; }
  /* Headshots are landscape with the head against the top edge, so cover crops
     them on narrow cards. Show the whole player over the gradient instead. */
  .player-card-photo, .player-photo { object-fit: contain; object-position: center bottom; }
  .matchup-score { font-size: 34px; }
  .matchup-logo { width: 40px; height: 40px; }

  /* Live banner */
  .live-inner { padding: 9px 16px; gap: 10px; }

  /* Slightly smaller card minimums so two columns still fit on a phone */
  .player-cards { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
  .modal { padding: 24px; }
}

/* ── Change API Key button ─────────────────────────────────── */
.change-key-btn {
  font-size: 12px;
  color: var(--text-muted);
  padding: 4px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: var(--transition);
}
.change-key-btn:hover { color: var(--text); border-color: var(--accent); }

/* ── Live game-day banner ─────────────────────────────────────── */
.live-banner {
  background: linear-gradient(90deg, rgba(173,0,0,0.20), rgba(173,0,0,0.05));
  border-top: 1px solid rgba(173,0,0,0.40);
}
.live-banner.hidden { display: none; }
.live-banner.pre  { background: linear-gradient(90deg, rgba(212,175,55,0.16), rgba(212,175,55,0.04)); border-top-color: rgba(212,175,55,0.4); }
.live-banner.post { background: var(--bg-card); border-top: 1px solid var(--border); }
.live-inner {
  max-width: 1200px; margin: 0 auto; padding: 9px 24px;
  display: flex; align-items: center; gap: 14px;
  color: var(--text); text-decoration: none; font-size: 14px; cursor: pointer;
}
.live-pill {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--accent); color: #fff; font-family: var(--font-heading);
  font-weight: 700; font-size: 12px; letter-spacing: 1px;
  padding: 3px 9px; border-radius: 4px; white-space: nowrap;
}
.live-pill.gold  { background: var(--gold); color: #1a1a1a; }
.live-pill.muted { background: #2a2a2a; color: var(--text-muted); }
.live-dot { width: 7px; height: 7px; border-radius: 50%; background: #fff; animation: livepulse 1.2s infinite; }
@keyframes livepulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.25; } }
.live-clock { font-family: var(--font-heading); font-weight: 600; color: var(--text-muted); font-size: 13px; letter-spacing: 0.5px; white-space: nowrap; }
.live-score { margin-left: auto; display: flex; align-items: center; gap: 8px; font-family: var(--font-heading); white-space: nowrap; }
.live-logo { width: 22px; height: 22px; object-fit: contain; }
.live-abbr { font-weight: 600; font-size: 14px; color: var(--text-muted); }
.live-abbr.lou { color: #fff; }
.live-score b { font-size: 18px; font-weight: 700; }
.live-score b.lou { color: #fff; }
.live-sep { color: var(--text-muted); margin: 0 2px; }
.live-vs { color: var(--text-muted); font-weight: 600; margin-right: 2px; }
.live-win { color: #22c55e; }
.live-loss { color: #ef4444; }
@media (prefers-reduced-motion: reduce) {
  .live-dot, .skeleton, .tab-panel { animation: none; }
  .drawer { transition: none; }
  .stat-bar-fill, .cmp-fill { transition: none; }
  .player-card:hover, .home-card:hover { transform: none; }
}
