/* Game Center — plain static website.
   Team identity (colours, name, logo) comes from team-config.js and is
   applied as CSS custom properties; this file only uses var(--brand) etc. */

:root {
  /* Brand colours: set at runtime from team-config.js (var --brand etc.).
     These fallbacks are generic — no team colour lives in this file. */
  --brand: #2563eb;
  --brand-dark: #1d4ed8;
  --ink: #14181f;
  --ink-soft: #3c4450;
  --muted: #6b7280;
  --line: #e5e7eb;
  --bg: #f4f5f7;
  --card: #ffffff;
  --dark: #0d1117;
  --dark-2: #161b22;
  --dark-3: #21262d;
  --dark-text: #d1d5db;
  --dark-muted: #9aa0a6;
  --green: #15803d;
  --amber: #b45309;
  --radius: 12px;
  --shadow: 0 1px 3px rgba(16, 24, 40, .08), 0 1px 2px rgba(16, 24, 40, .04);
  --shadow-lg: 0 10px 28px rgba(16, 24, 40, .14);
  --sidebar-w: 240px;
  --sidebar-w-collapsed: 68px;
  /* Legacy alias: the body stack now lives in typography.css (--font-body). */
  --font: var(--font-body);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font);
  color: var(--ink);
  background: var(--bg);
  font-size: var(--text-body);
  line-height: var(--lh-body);
  -webkit-font-smoothing: antialiased;
}
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; }
button { font-family: var(--font-interface); font-weight: var(--weight-semibold); cursor: pointer; }
h1, h2, h3 { line-height: 1.25; margin: 0 0 .5rem; }
p { margin: 0 0 .75rem; }
.muted { color: var(--muted); }
.hidden { display: none !important; }
[hidden] { display: none !important; }

/* ---------------- Login ---------------- */
.login-screen {
  position: relative;
  isolation: isolate;
  min-height: 100vh;
  background: #000;
  overflow-x: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 16px;
}
.login-wrap { position: relative; width: min(640px, 92vw); }
#login-form { width: 100%; max-width: 360px; margin: 0 auto; }
.login-logo {
  display: block;
  width: 100%;
  height: auto;
  margin: 0 auto 36px;
  border-radius: 12px;
  /* The hero image (1600x1049) is a wide landscape banner shown at the
     login column's full width (640px desktop), natural aspect ratio, no
     cropping. The form below stays at its 360px column. */
}
.login-label { display: block; font-family: var(--font-body); font-size: var(--text-label); font-weight: var(--weight-medium); color: #d1d5db; margin-bottom: .4rem; }
.password-row { display: flex; gap: 8px; }
.password-row input {
  flex: 1;
  background: rgba(20, 24, 29, .9);
  color: #fff;
  border: 1px solid #3a414d;
  border-radius: 10px;
  padding: .7rem .9rem;
  font-family: var(--font-body);
  font-size: 1rem;
  min-width: 0;
}
.password-row input:focus { border-color: var(--brand); box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 30%, transparent); outline: none; }
.show-password {
  background: #1f242c; color: #d1d5db; border: 1px solid #3a414d;
  border-radius: 10px; padding: 0 .8rem; font-family: var(--font-body); font-size: 1.05rem;
  display: flex; align-items: center; justify-content: center;
}
/* Simple cartoon-style outline eye (show / hide password). The SVG is
   inline in the button; JS swaps it for the slashed-eye version when the
   password is visible. */
.show-password svg { display: block; width: 20px; height: 20px; }
.btn-signin {
  width: 100%;
  margin-top: 14px;
  background: var(--brand);
  color: #fff;
  border: none;
  border-radius: 10px;
  padding: .8rem 1rem;
  font-family: var(--font-interface);
  font-size: 1.05rem;
  font-weight: var(--weight-semibold);
}
.btn-signin:hover { background: var(--brand-dark); }
.btn-signin:disabled { opacity: .6; cursor: wait; }
.login-error { color: #fda4af; font-size: .9rem; margin: .6rem 0 0; }

/* ---------------- App layout ---------------- */
.app { display: flex; min-height: 100vh; }
.main { flex: 1; min-width: 0; display: flex; flex-direction: column; margin-left: var(--sidebar-w); }

/* Sidebar — fixed to the viewport (position: fixed, top: 0, bottom: 0),
   so it is always exactly viewport-height and the bottom collapse button
   is always fully visible, whatever the page height or scroll position.
   Only the middle nav area scrolls internally if it overflows. The main
   content carries a left margin equal to the sidebar width (see .main). */
.sidebar {
  width: var(--sidebar-w);
  flex: none;
  background: #000;
  color: #fff;
  position: fixed;
  top: 0;
  bottom: 0;
  left: 0;
  display: flex;
  flex-direction: column;
  padding: 18px 12px;
  transition: width .2s ease;
  overflow: hidden;
  z-index: 40;
}
.app.collapsed .sidebar { width: var(--sidebar-w-collapsed); }
.app.collapsed .main { margin-left: var(--sidebar-w-collapsed); }
.side-top { flex: none; display: flex; align-items: center; justify-content: center; padding: 2px 6px 16px; border-bottom: 1px solid var(--dark-3); margin-bottom: 14px; }
/* Sidebar top: the Game Center logo image only, full sidebar width
   when expanded, scaled down to the narrow icon rail when collapsed. */
.sidebar-logo { display: block; width: 100%; max-width: 216px; height: auto; object-fit: contain; }
.app.collapsed .sidebar-logo { max-width: 44px; }
.side-nav { flex: 1 1 auto; min-height: 0; overflow-y: auto; overflow-x: hidden; display: flex; flex-direction: column; gap: 4px; }
.side-nav a {
  display: flex; align-items: center; gap: .7rem;
  color: #fff !important; text-decoration: none;
  padding: .6rem .7rem; border-radius: 9px;
  font-family: var(--font-interface); font-size: var(--text-navigation); font-weight: var(--weight-semibold); white-space: nowrap;
}
.side-nav a .nav-label { color: #fff !important; }
.side-nav a svg { color: #fff !important; }
.side-nav a:hover { background: var(--dark-2); color: #fff; text-decoration: none; }
.side-nav a.active { background: var(--brand); color: #fff; }
.side-nav a svg { flex: none; width: 20px; height: 20px; }
.app.collapsed .side-nav a { justify-content: center; padding: .65rem 0; }
.app.collapsed .side-nav a .nav-label { display: none; }

/* Sticky top bar */
.topbar {
  position: sticky; top: 0; z-index: 30;
  background: #000;
  color: #fff;
  display: flex; align-items: center; gap: 14px;
  padding: 10px 20px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, .25);
}
/* Bottom sidebar collapse control: pinned to the bottom of the sidebar.
   Expanded: "<<" + "Collapse Sidebar". Collapsed (68px rail): just ">>". */
.side-collapse {
  flex: none;
  margin-top: auto;
  display: flex; align-items: center; gap: .6rem;
  width: 100%;
  background: var(--dark-2); color: #fff !important;
  border: 1px solid var(--dark-3); border-radius: 9px;
  padding: .65rem .7rem;
  font-family: var(--font-interface); font-size: var(--text-navigation); font-weight: var(--weight-semibold); white-space: nowrap;
  cursor: pointer;
}
.side-collapse:hover { background: var(--dark-3); }
.side-collapse .collapse-glyph { flex: none; letter-spacing: .05em; }
.side-collapse .collapse-label { color: #fff !important; }
.app.collapsed .side-collapse { justify-content: center; padding: .65rem 0; }
.app.collapsed .side-collapse .collapse-label { display: none; }
.topbar-logo { flex: none; width: 42px; height: 42px; object-fit: contain; border-radius: 8px; }
.topbar-title { flex: none; }
.topbar-name { font-family: var(--font-display); font-weight: var(--weight-extrabold); font-size: 1.35rem; line-height: var(--lh-tight); text-transform: uppercase; letter-spacing: var(--ls-heading); }
.topbar-sub { color: var(--dark-muted); font-family: var(--font-body); font-size: var(--text-label); font-weight: var(--weight-medium); }
.topbar-stats { display: flex; gap: 8px; margin-left: auto; flex-wrap: wrap; justify-content: flex-end; }
.stat-chip {
  background: var(--dark-2); border: 1px solid var(--dark-3);
  border-radius: 9px; padding: 5px 12px; text-align: center; min-width: 74px;
}
.stat-chip .k { display: block; font-family: var(--font-body); font-size: var(--text-label); font-weight: var(--weight-medium); text-transform: uppercase; letter-spacing: var(--ls-label); color: var(--dark-muted); }
.stat-chip .v { display: block; font-family: var(--font-interface); font-weight: var(--weight-extrabold); font-size: .95rem; }
.profile { position: relative; flex: none; }
.profile-btn {
  width: 44px; height: 44px; border-radius: 50%;
  background: var(--dark-2); color: #fff; border: 1px solid var(--dark-3);
  display: flex; align-items: center; justify-content: center;
}
.profile-btn:hover { background: var(--dark-3); }
.profile-menu {
  position: absolute; right: 0; top: 52px;
  background: #fff; background-color: #fff; color: #14181f !important;
  border-radius: 10px; box-shadow: var(--shadow-lg);
  min-width: 190px; padding: 6px; z-index: 50;
}
.profile-menu button {
  display: block; width: 100%; text-align: left;
  background: none; border: none; padding: 9px 12px;
  font-family: var(--font-interface); font-size: var(--text-navigation); font-weight: var(--weight-semibold); border-radius: 7px; color: #14181f !important;
}
.profile-menu button:hover { background: #f3f4f6; }

/* ---------------- Main content ---------------- */
.view { padding: 26px 28px 48px; max-width: 1080px; width: 100%; margin: 0 auto; }
/* Dashboard views (Overview / Schedule) carry a stats strip + wide tables:
   give them more room so long stat values and the 9-column schedule table fit. */
.view:has(> .ov-stats) { max-width: 1500px; }
.view h1 { font-family: var(--font-display); font-size: var(--text-page-title); font-weight: var(--weight-extrabold); text-transform: uppercase; letter-spacing: var(--ls-heading); }
.view h2 { font-family: var(--font-display); font-size: var(--text-section-title); font-weight: var(--weight-bold); text-transform: uppercase; letter-spacing: var(--ls-heading); margin-top: 1.6rem; }
.view h3 { font-family: var(--font-display); font-size: var(--text-panel-title); font-weight: var(--weight-bold); margin-top: 1.2rem; }
.page-head { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; margin-bottom: 4px; }
.page-head h1 { margin: 0; }
.page-sub { color: var(--muted); margin-bottom: 1.1rem; }

.card {
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 18px 20px; margin-bottom: 16px;
}
.card h2, .card h3 { margin-top: 0; }
.card-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.card-head h2, .card-head h3 { margin: 0; }

.btn {
  display: inline-flex; align-items: center; gap: .45rem;
  background: #fff; color: var(--ink);
  border: 1px solid #d1d5db; border-radius: 8px;
  padding: .45rem .8rem; font-family: var(--font-interface); font-size: .9rem; font-weight: var(--weight-semibold);
  text-decoration: none; line-height: 1.3;
}
.btn:hover { border-color: var(--brand); color: var(--brand); text-decoration: none; }
.btn-red { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn-red:hover { background: var(--brand-dark); color: #fff; }
.btn[aria-disabled="true"], .btn.disabled { opacity: .55; pointer-events: none; }
.btn .skip { color: var(--muted); font-family: var(--font-body); font-weight: var(--weight-medium); font-size: var(--text-label); }
.plat-icon { width: 20px; height: 20px; object-fit: contain; vertical-align: middle; }
.plat-icon.yt { width: 26px; height: 19px; }

.pill {
  display: inline-block; font-family: var(--font-body); font-size: var(--text-label); font-weight: var(--weight-medium); letter-spacing: var(--ls-label);
  padding: 2px 8px; border-radius: 999px; vertical-align: middle; white-space: nowrap;
}
.pill-conf { background: #ffedd5; color: #9a3412; border: 1px solid #fdba74; }
.pill-nonconf { background: #f3f4f6; color: #4b5563; border: 1px solid #d1d5db; }

.team-logo { width: 44px; height: 44px; object-fit: contain; flex: none; border-radius: 6px; }
.team-mono {
  width: 44px; height: 44px; flex: none; border-radius: 50%;
  background: #e5e7eb; color: #374151;
  display: inline-flex; align-items: center; justify-content: center;
  font-family: var(--font-interface); font-weight: var(--weight-extrabold); font-size: 14px;
}
.team-mono.red { background: var(--brand); color: #fff; }

/* Tables */
.tbl-wrap { overflow-x: auto; }
table.gc-table { width: 100%; border-collapse: collapse; font-family: var(--font-body); font-size: .95rem; background: #fff; }
.gc-table th, .gc-table td { padding: .6rem .7rem; text-align: left; border-bottom: 1px solid var(--line); vertical-align: middle; }
.gc-table th { font-family: var(--font-body); font-size: var(--text-label); font-weight: var(--weight-medium); text-transform: uppercase; letter-spacing: var(--ls-label); color: var(--muted); background: #f9fafb; }
.gc-table tbody tr:hover { background: #fafafa; }
.gc-table tr.next-game { background: #fff1f2; }
.gc-table tr.next-game:hover { background: #ffe4e6; }
.gc-table .num { font-variant-numeric: tabular-nums; }
.opp-cell { display: flex; align-items: center; gap: 10px; min-width: 170px; }
.opp-cell strong { font-size: .98rem; }
.result-win { color: var(--green); font-family: var(--font-interface); font-weight: var(--weight-extrabold); }
.result-loss { color: var(--brand); font-family: var(--font-interface); font-weight: var(--weight-extrabold); }
.badge-pend {
  display: inline-block; background: #f3f4f6; color: #6b7280;
  border-radius: 999px; padding: 2px 9px; font-family: var(--font-body); font-size: var(--text-label); font-weight: var(--weight-medium);
}
.badge-done { display: inline-block; background: #dcfce7; color: var(--green); border-radius: 999px; padding: 2px 9px; font-family: var(--font-body); font-size: var(--text-label); font-weight: var(--weight-bold); }

/* Filters */
.filters { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 14px; }
.filter-btn {
  background: #fff; border: 1px solid #d1d5db; border-radius: 999px;
  padding: .4rem .95rem; font-family: var(--font-interface); font-size: .9rem; font-weight: var(--weight-semibold); color: var(--ink-soft);
}
.filter-btn.active { background: var(--ink); border-color: var(--ink); color: #fff; }
.filter-input, .filter-select {
  border: 1px solid #d1d5db; border-radius: 8px; padding: .45rem .7rem;
  font-size: .92rem; font-family: var(--font-body); background: #fff; color: var(--ink);
}
.filter-input { min-width: 180px; }

/* Overview */
.next-game-card { border-left: 5px solid var(--brand); }
.next-game-card .opp-big { font-family: var(--font-display); font-size: 1.35rem; font-weight: var(--weight-extrabold); text-transform: uppercase; letter-spacing: var(--ls-heading); }
.next-game-meta { color: var(--muted); margin: .3rem 0 .9rem; }
.ov-links { display: flex; gap: 10px; flex-wrap: wrap; }
.stat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; margin: 12px 0; }
.stat-box { background: #f9fafb; border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; }
.stat-box .stat-label { display: block; font-family: var(--font-body); font-size: var(--text-label); font-weight: var(--weight-medium); text-transform: uppercase; letter-spacing: var(--ls-label); color: var(--muted); }
.stat-box .stat-value { display: block; font-family: var(--font-interface); font-size: var(--text-stat-sm); font-weight: var(--weight-extrabold); margin-top: 2px; }
.progress { height: 10px; background: #e5e7eb; border-radius: 999px; overflow: hidden; margin: 6px 0 4px; }
.progress > span { display: block; height: 100%; background: var(--brand); }

/* ---------------- Overview — screenshot-style dashboard ---------------- */
.ov-stats {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 1px;
  background: var(--line); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); margin-bottom: 16px; overflow: hidden;
}
.ov-stat { display: flex; align-items: center; gap: 14px; background: #fff; padding: 18px 20px; min-width: 0; }
.ov-stat-icon { color: var(--brand); flex: none; display: flex; }
.ov-stat-icon svg { width: 36px; height: 36px; }
.ov-stat-text { min-width: 0; }
.ov-stat-label { display: block; font-family: var(--font-body); font-size: var(--text-label); font-weight: var(--weight-medium); letter-spacing: var(--ls-label); color: var(--muted); text-transform: uppercase; }
.ov-stat-value { display: block; font-family: var(--font-interface); font-size: var(--text-stat); font-weight: var(--weight-extrabold); line-height: var(--lh-tight); white-space: normal; text-wrap: balance; overflow-wrap: break-word; }
.ov-layout { display: grid; grid-template-columns: minmax(0, 1fr) 272px; gap: 10px; align-items: start; }
.ov-main { min-width: 0; }
.ov-sched-head { display: flex; align-items: center; flex-wrap: wrap; gap: 12px; margin-bottom: 12px; }
.ov-sched-head h2 { margin: 0; font-family: var(--font-display); font-size: var(--text-section-title); font-weight: var(--weight-bold); text-transform: uppercase; letter-spacing: var(--ls-heading); }
.ov-sched-head .filters { margin: 0 0 0 auto; }
.ov-filters .filter-btn.active { background: var(--brand); border-color: var(--brand); color: #fff; }
.ov-table-card { padding: 0; overflow: hidden; }
.ov-table thead th { background: var(--dark); color: #fff; }
.ov-table tr.next-game { box-shadow: inset 4px 0 0 var(--brand); }
/* Schedule table, compact: all 9 columns must fit the card at desktop widths
   (1920 and 1280) with no horizontal scroll. Tighter cells, smaller pills
   (decorative icons hidden, text kept), smaller opponent logos, compact button.
   .tbl-wrap keeps overflow-x: auto as the small-screen fallback only. */
.gc-table.ov-table { font-size: .9rem; }
.ov-table th, .ov-table td { padding: .45rem .3rem; }
.ov-table .ov-pill { padding: 2px 6px; }
.ov-table .ov-pill svg { display: none; }
.ov-table .opp-cell { min-width: 0; gap: 8px; }
.ov-table .btn { padding: .35rem .5rem; font-size: .8rem; white-space: nowrap; }
.ov-pill { display: inline-flex; align-items: center; gap: 5px; border-radius: 999px; padding: 3px 10px; font-family: var(--font-body); font-size: var(--text-label); font-weight: var(--weight-medium); white-space: nowrap; }
.ov-pill svg { width: 14px; height: 14px; flex: none; }
.ov-pill-ready, .ov-pill-ai { background: #fee2e2; color: #b91c1c; }
.ov-pill-avail { background: #dcfce7; color: var(--green); }
.ov-pill-pend { background: #f3f4f6; color: #4b5563; }
/* Right rail cards: dark header with a red bar, white body. */
.rail-card { padding: 0; overflow: hidden; }
.rail-head { display: flex; align-items: center; gap: 10px; background: var(--dark); color: #fff; font-family: var(--font-display); font-weight: var(--weight-bold); font-size: 1.05rem; text-transform: uppercase; letter-spacing: var(--ls-heading); padding: 13px 16px; }
.rail-bar { flex: none; width: 5px; height: 20px; background: var(--brand); border-radius: 2px; }
.rail-body { padding: 16px; }
.rail-next-top { display: flex; gap: 14px; align-items: center; margin-bottom: 14px; }
.rail-opp { font-family: var(--font-display); font-size: 1.3rem; font-weight: var(--weight-extrabold); line-height: 1.2; text-transform: uppercase; letter-spacing: var(--ls-heading); }
.rail-meta { color: var(--ink-soft); font-family: var(--font-body); font-size: .95rem; line-height: 1.45; margin-top: 2px; }
.rail-link { display: flex; align-items: center; gap: 10px; background: #f3f4f6; border-radius: 9px; padding: 10px 12px; margin-top: 8px; color: var(--ink); font-family: var(--font-interface); font-weight: var(--weight-semibold); text-decoration: none; }
.rail-link:hover { background: #e5e7eb; color: var(--ink); text-decoration: none; }
.rail-link-ic { display: flex; color: var(--ink-soft); }
.rail-link-ic svg { width: 20px; height: 20px; }
.rail-chev { margin-left: auto; font-size: 1.3rem; line-height: 1; color: var(--muted); }
.glance-line { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; font-size: .98rem; }
.glance-pct { font-family: var(--font-interface); font-weight: var(--weight-extrabold); }
.rail-body .progress { margin-top: 10px; }
@media (max-width: 1020px) {
  .ov-layout { grid-template-columns: 1fr; }
  .ov-stats { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 560px) {
  .ov-stat { padding: 14px; gap: 10px; }
  .ov-stat-icon svg { width: 28px; height: 28px; }
  .ov-stat-value { font-size: 1.35rem; white-space: normal; }
  .ov-sched-head .filters { margin-left: 0; }
}

/* Game page */
.game-head { margin-bottom: 6px; }
.game-head .opp-big { font-family: var(--font-display); font-size: 1.9rem; font-weight: var(--weight-extrabold); text-transform: uppercase; letter-spacing: var(--ls-heading); }
.game-head .game-date { color: var(--muted); }
.outcome { font-family: var(--font-interface); font-weight: var(--weight-extrabold); font-size: 1.05rem; }
.outcome.win { color: var(--green); }
.outcome.loss { color: var(--brand); }
details.section {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); margin-bottom: 14px; overflow: hidden;
}
details.section summary {
  cursor: pointer; padding: 15px 18px; font-family: var(--font-display); font-weight: var(--weight-bold); font-size: var(--text-panel-title); text-transform: uppercase; letter-spacing: var(--ls-heading);
  list-style: none; display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
}
details.section summary::-webkit-details-marker { display: none; }
details.section summary::before { content: "\25B8"; color: var(--brand); font-size: 1.1rem; }
details.section[open ] summary::before { content: "\25BE"; }
details.section summary .summary-note { font-family: var(--font-body); font-weight: var(--weight-medium); font-size: .85rem; color: var(--muted); margin-left: auto; text-transform: none; letter-spacing: 0; }
details.section .section-body { padding: 0 18px 18px; border-top: 1px solid var(--line); }
.film-list { display: flex; flex-direction: column; gap: 10px; margin: 10px 0; }
.film-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.film-row .film-meta { color: var(--muted); font-family: var(--font-body); font-size: .88rem; }
.back-row { margin-bottom: 14px; }

/* Modal */
.modal-backdrop {
  position: fixed; inset: 0; background: rgba(0, 0, 0, .55);
  display: flex; align-items: center; justify-content: center;
  padding: 20px; z-index: 100;
}
.modal { background: #fff; border-radius: 14px; max-width: 480px; width: 100%; padding: 24px 26px; position: relative; box-shadow: var(--shadow-lg); }
.modal h2 { margin-top: 0; font-family: var(--font-display); font-weight: var(--weight-bold); font-size: var(--text-section-title); text-transform: uppercase; letter-spacing: var(--ls-heading); }
.modal-close { position: absolute; top: 10px; right: 14px; background: none; border: none; font-size: 1.6rem; color: var(--muted); }

.loading, .error-box { padding: 40px 20px; text-align: center; color: var(--muted); }

/* ---------------- Mobile ---------------- */
@media (max-width: 860px) {
  .topbar { padding: 10px 12px; gap: 10px; flex-wrap: wrap; }
  .topbar-stats { order: 3; width: 100%; margin-left: 0; justify-content: flex-start; }
  .stat-chip { min-width: 0; flex: 1; }
  .view { padding: 18px 14px 40px; }
  /* Mobile: the sidebar is always the narrow fixed icon rail — it never
     covers content. The bottom collapse button does nothing here, so it
     is hidden; collapsing only applies on desktop. */
  .side-collapse { display: none; }
  .sidebar {
    position: fixed; left: 0; top: 0; bottom: 0;
    width: var(--sidebar-w-collapsed);
    padding: 14px 8px;
  }
  .sidebar .nav-label { display: none; }
  .sidebar .side-nav a { justify-content: center; padding: .65rem 0; }
  .side-top { justify-content: center; }
  .main { margin-left: var(--sidebar-w-collapsed); }
}
@media (max-width: 520px) {
  .topbar-name { font-size: 1rem; }
  .stat-chip .v { font-size: .85rem; }
  .game-head .opp-big { font-size: 1.5rem; }
  .filter-input { min-width: 0; flex: 1; }
}

/* ---------------- Thin page hero — Rim banner on every page (Dec 4, 2026) ---------------- */
/* Shared banner used by pageHero() on every in-app page: the Rim photo
   behind the page title. Rim.png is a wide rim/net photo with the rim on
   the right, so the background is anchored right and the title sits left
   over a dark gradient. Deliberately thin (~104px on desktop) — the old
   Overview hero was much taller. Title is Barlow Condensed ExtraBold
   per the typography system. */
.page-hero {
  background-size: cover; background-position: center right;
  border-radius: var(--radius); box-shadow: var(--shadow);
  color: #fff; padding: 26px 28px; margin-bottom: 16px;
  min-height: 104px; display: flex; align-items: center; gap: 14px;
  box-sizing: border-box;
}
.page-hero h1 { font-family: var(--font-display); font-size: 2rem; font-weight: var(--weight-extrabold); text-transform: uppercase; letter-spacing: var(--ls-heading); margin: 0; line-height: 1.05; }
.page-hero h1 .ai-icon-img { width: 34px; height: 34px; }
.page-hero .pill { flex: none; }
/* Five-cell stats strip. */
.ov-stats-five { grid-template-columns: repeat(5, 1fr); }
/* Two-column overview layout: left = Next Game / Progress / Key Stats,
   right = Recent Games / AI Insights / Quick Actions. */
.ov2-layout { display: grid; grid-template-columns: minmax(0, 1.12fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.ov2-col { display: flex; flex-direction: column; min-width: 0; }
.ov2-col .card:last-child { margin-bottom: 0; }
/* Plain card headers (red bar + title), matching the rail-head look. */
.ov-card-head { display: flex; align-items: center; gap: 10px; font-family: var(--font-display); font-weight: var(--weight-bold); font-size: 1.08rem; text-transform: uppercase; letter-spacing: var(--ls-heading); margin-bottom: 12px; }
.ov-card-head .rail-bar { flex: none; }
.ov-card-head-right { margin-left: auto; font-family: var(--font-interface); font-size: 1rem; font-weight: var(--weight-semibold); text-transform: none; letter-spacing: 0; }
.ov-card-head-sub { font-family: var(--font-body); font-weight: var(--weight-medium); color: var(--muted); font-size: .95rem; text-transform: none; letter-spacing: 0; }
/* Season Progress boxes: one per game, completed most recent first. */
.prog-row { display: flex; flex-wrap: wrap; gap: 6px; }
.prog-box {
  width: 27px; height: 27px; border-radius: 6px;
  display: inline-flex; align-items: center; justify-content: center;
  font-family: var(--font-interface); font-size: .85rem; font-weight: var(--weight-extrabold); color: #fff;
  background: #e5e7eb;
}
.prog-win { background: var(--green); }
.prog-loss { background: var(--brand); }
/* Key Team Stats: value on top, label below, centred. */
.ov-key-stats { grid-template-columns: repeat(4, 1fr); }
.ov-key-stats .stat-box { text-align: center; }
.ov-key-stats .stat-value { font-size: var(--text-stat-sm); }
/* Recent Games rows. */
.rail-head-link { margin-left: auto; color: #fff; font-family: var(--font-interface); font-size: .9rem; font-weight: var(--weight-semibold); text-transform: none; letter-spacing: 0; }
.rail-head-link:hover { color: #fff; }
.recent-row { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.recent-row:last-child { border-bottom: none; padding-bottom: 2px; }
.recent-date { color: var(--ink-soft); font-family: var(--font-body); font-weight: var(--weight-semibold); min-width: 44px; }
.recent-opp { flex: 1; min-width: 0; }
.recent-ic { color: var(--ink-soft); display: flex; flex: none; }
.recent-ic:hover { color: var(--brand); }
.recent-ic svg { width: 20px; height: 20px; }
/* AI Insights: dark red/black card, verified claims only. */
.ai-card { background: linear-gradient(155deg, #2b060b 0%, #0d1117 55%, #7f0d1d 135%); color: #fff; border-color: #3a0d14; padding: 0; overflow: hidden; }
.ai-head { display: flex; align-items: center; gap: 10px; font-family: var(--font-display); font-weight: var(--weight-extrabold); font-size: 1.15rem; text-transform: uppercase; letter-spacing: var(--ls-heading); padding: 16px 18px 2px; }
/* AI icon (Casey's uploaded ai icon.jpeg, black AI on light grey): shown
   wherever the app marks something as AI-generated. White rounded backing
   so it reads as a small badge on dark headers too. */
.ai-icon-img { width: 18px; height: 18px; object-fit: contain; flex: none; vertical-align: middle; border-radius: 4px; background: #fff; }
.ai-head .ai-icon-img { width: 22px; height: 22px; }
.page-head h1 .ai-icon-img { width: 30px; height: 30px; }
.ov-pill .ai-icon-img { width: 14px; height: 14px; }
.ai-th { display: inline-flex; align-items: center; gap: 6px; }
.ai-th .ai-icon-img { width: 16px; height: 16px; }
details.section summary .ai-icon-img { width: 18px; height: 18px; }
.badge-done .ai-icon-img { width: 13px; height: 13px; margin-right: 4px; }
.ai-note { display: flex; gap: 8px; align-items: flex-start; }
.ai-note .ai-icon-img { margin-top: 2px; }
.ai-chip { color: var(--brand); display: flex; }
.ai-chip svg { width: 30px; height: 30px; }
.ai-body { padding: 6px 18px 16px; }
.ai-row { display: flex; gap: 12px; align-items: flex-start; padding: 10px 0; }
.ai-row p { margin: 0; color: #f3f4f6; font-family: var(--font-body); }
.ai-ic { color: #e5e7eb; flex: none; display: flex; margin-top: 2px; }
.ai-ic svg { width: 22px; height: 22px; }
/* Quick Actions: four icon buttons. */
.quick-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.quick-btn {
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  background: #f3f4f6; border-radius: 10px; padding: 14px 6px;
  color: var(--ink); font-family: var(--font-interface); font-weight: var(--weight-semibold); font-size: .9rem;
  text-decoration: none; text-align: center;
}
.quick-btn:hover { background: #e5e7eb; color: var(--ink); text-decoration: none; }
.quick-btn span { color: var(--brand); display: flex; }
.quick-btn svg { width: 26px; height: 26px; }
@media (max-width: 1020px) {
  .ov2-layout { grid-template-columns: 1fr; }
  .ov-stats-five { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 560px) {
  .page-hero { padding: 18px 18px; min-height: 76px; }
  .page-hero h1 { font-size: 1.5rem; }
  .quick-grid { grid-template-columns: repeat(2, 1fr); }
  .ov-key-stats { grid-template-columns: repeat(2, 1fr); }
}
