/* VB Fantasy — vanilla CSS, custom-property theming (dark default + light override). */

/* The `hidden` attribute must always hide, even on elements whose class sets a `display`
   (e.g. #auth-modal is `.modal-backdrop { display: flex }` + `hidden`). Author `display`
   rules otherwise beat the UA `[hidden] { display: none }`, leaving an invisible full-screen
   backdrop that swallows all clicks. This global rule restores the expected behavior. */
[hidden] { display: none !important; }

:root {
  --bg: #14161a;
  --bg-elev: #1c1f26;
  --bg-elev2: #242832;
  --border: #2e333e;
  --sep: #525a6b;   /* stronger than --border: vertical rule between stat-category groups */
  --text: #e7e9ee;
  --text-dim: #9aa2b1;
  --accent: #e8622c;
  --accent-dim: #b64a1f;
  --good: #4fb477;
  --bad: #d1596b;
  --row-hover: #262b35;
  --shadow: 0 8px 28px rgba(0,0,0,.45);
  --radius: 10px;
}
:root[data-theme="light"] {
  --bg: #f5f6f8;
  --bg-elev: #ffffff;
  --bg-elev2: #eef0f4;
  --border: #d9dde4;
  --sep: #aab0bd;   /* stronger than --border: vertical rule between stat-category groups */
  --text: #1a1d23;
  --text-dim: #63697a;
  --accent: #d9531e;
  --accent-dim: #b64a1f;
  --good: #2f8f56;
  --bad: #c23a51;
  --row-hover: #eef1f6;
  --shadow: 0 8px 28px rgba(20,30,50,.12);
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 14px/1.45 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  display: flex;
  flex-direction: column;
  /* Don't let the browser anchor the viewport to mid-page content as async sections (team header,
     schedule) fill in after a fresh navigation — that's what scrolled new pages to "Schedule". */
  overflow-anchor: none;
}

::-webkit-scrollbar { width: 11px; height: 11px; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 6px; }
::-webkit-scrollbar-track { background: transparent; }

/* ---- Topbar ---- */
.topbar {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 10px 18px;
  background: var(--bg-elev);
  border-bottom: 1px solid var(--border);
  flex: 0 0 auto;
  position: sticky;
  top: 0;
  z-index: 20;
}
.brand {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  font-size: 16px;
  letter-spacing: .3px;
  white-space: nowrap;
}
.brand img { display: block; }
.brand .wordmark { display: inline; }        /* keep "V" tight against "Ballr" — no flex gap */
.brand .wordmark .v { color: var(--accent); }

.search { position: relative; flex: 1 1 auto; max-width: 420px; }
.search input {
  width: 100%;
  padding: 8px 12px;
  background: var(--bg-elev2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-size: 14px;
}
.search input:focus { outline: none; border-color: var(--accent); }
.search-results {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  max-height: 60vh;
  overflow-y: auto;
  z-index: 30;
}
.search-results .group-label {
  padding: 6px 12px;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .6px;
  color: var(--text-dim);
  background: var(--bg-elev2);
  position: sticky;
  top: 0;
}
.search-results .item {
  padding: 8px 12px;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  gap: 10px;
}
.search-results .item:hover, .search-results .item.active { background: var(--row-hover); }
.search-results .item .sub { color: var(--text-dim); font-size: 12px; }
.search-results .empty { padding: 12px; color: var(--text-dim); }

.controls { display: flex; align-items: stretch; gap: 10px; margin-left: auto; }
.field { display: flex; flex-direction: column; gap: 2px; font-size: 11px; color: var(--text-dim); }
.field span { text-transform: uppercase; letter-spacing: .5px; }
/* Season select, theme toggle, and the auth/admin button share one row height so they line up. */
.controls > .field,
.controls > .field select,
.controls .icon-btn,
.controls .auth-area,
.controls .auth-area > .btn,
.controls .auth-area .user-btn { height: 34px; box-sizing: border-box; }
select, .field select {
  background: var(--bg-elev2);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 5px 8px;
  font-size: 13px;
}
select:focus { outline: none; border-color: var(--accent); }
.icon-btn {
  background: var(--bg-elev2);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 7px 10px;
  cursor: pointer;
  font-size: 13px;
  text-decoration: none;
  line-height: 1;
  display: inline-flex;
  align-items: center;
}
.icon-btn:hover { border-color: var(--accent); }

/* ---- Tabs ---- */
.tabs {
  display: flex;
  gap: 4px;
  padding: 0 18px;
  background: var(--bg-elev);
  border-bottom: 1px solid var(--border);
  flex: 0 0 auto;
  overflow-x: auto;
}
.tabs button {
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  color: var(--text-dim);
  padding: 11px 14px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
}
.tabs button:hover { color: var(--text); }
.tabs button.active { color: var(--text); border-bottom-color: var(--accent); }

/* ---- View ---- */
.view { flex: 1 1 auto; overflow-y: auto; padding: 18px; }
.view-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 12px;
  margin-bottom: 14px;
}
.view-head h1 { font-size: 20px; margin: 0; flex: 0 0 auto; }
.view-head .spacer { flex: 1 1 auto; }
/* Team detail heading: short name on top, full institution name beneath. */
.team-title { display: flex; flex-direction: column; gap: 2px; flex: 0 0 auto; }
.team-title h1 { font-size: 20px; margin: 0; }
.team-title .team-fullname { font-size: 13px; font-weight: 400; }
.filters { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; }

.card {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
.card + .card { margin-top: 16px; }
.card-title {
  padding: 12px 14px;
  font-weight: 700;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 10px;
}
.card-title .badge {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-dim);
  background: var(--bg-elev2);
  padding: 2px 8px;
  border-radius: 20px;
}
/* Small AVCA/RPI-style segmented toggle used in card titles (e.g. Quality wins). */
.seg-toggle { display: inline-flex; border: 1px solid var(--border); border-radius: 999px; overflow: hidden; }
.seg-btn {
  background: none; border: none; cursor: pointer; color: var(--text-dim);
  font: inherit; font-size: 12px; font-weight: 600; padding: 3px 12px; line-height: 1.4;
}
.seg-btn + .seg-btn { border-left: 1px solid var(--border); }
.seg-btn.active { background: var(--accent); color: #fff; }

/* Advanced-stats toggle pill in stat-table card titles (box score + team roster). Sits at the far
   right of the title; lights up in the accent color when advanced columns are shown. */
.adv-toggle {
  margin-left: auto;
  font-size: 11px; font-weight: 600;
  padding: 2px 10px; border-radius: 999px;
  border: 1px solid var(--border); background: transparent;
  color: var(--text-dim); cursor: pointer; white-space: nowrap;
}
.adv-toggle:hover { color: var(--text); border-color: var(--text-dim); }
.adv-toggle.on { color: var(--accent); border-color: var(--accent); }
/* When a hint already grabs the free space (team table), the toggle just trails it, not the middle. */
.table-hint + .adv-toggle { margin-left: 8px; }

/* ---- Tables ---- */
table { width: 100%; border-collapse: collapse; }
th, td { padding: 8px 12px; text-align: right; white-space: nowrap; }
th:first-child, td:first-child { text-align: center; width: 44px; color: var(--text-dim); }
th.l, td.l { text-align: left; }
thead th {
  position: sticky;
  top: 0;
  background: var(--bg-elev2);
  color: var(--text-dim);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .5px;
  z-index: 1;
  cursor: default;
}
thead th.sortable { cursor: pointer; }
thead th.sortable:hover { color: var(--text); }
/* Sort indicator: inline arrow text in the th + accent color on the whole header,
   matching the Teams tab's approach (no CSS pseudo-element). */
thead th.sorted, thead th.sort-active { color: var(--accent); }
tbody tr { border-top: 1px solid var(--border); }
tbody tr:hover { background: var(--row-hover); }
td.num { font-variant-numeric: tabular-nums; }
/* Compact per-category leaderboards: fixed layout so every category lines up column-for-column. */
/* Leaderboard cards flow into as many content-width columns as the screen allows, so a narrow
   leader table no longer leaves a full-width card mostly empty. */
.leader-grid { display: flex; flex-wrap: wrap; gap: 16px; align-items: flex-start; }
.leader-grid > .card { margin-top: 0; width: max-content; max-width: 100%; }
.clutch-hitting-card { flex: none; max-width: 100%; }

/* Fix every column so rank·player·team·value line up column-for-column across categories; the
   table's intrinsic width then sizes each card. */
.mini-leader { table-layout: fixed; width: 100%; max-width: 580px; }
.mini-leader .c-rank { width: 44px; }
.mini-leader .c-player { width: 246px; }
.mini-leader .c-team { width: 200px; }
.mini-leader .c-val { width: 90px; }
.mini-leader td.l { overflow: hidden; text-overflow: ellipsis; }
.link { color: var(--accent); cursor: pointer; text-decoration: none; }
.link:hover { text-decoration: underline; }
.pos-tag {
  font-size: 11px;
  color: var(--text-dim);
  background: var(--bg-elev2);
  border-radius: 4px;
  padding: 1px 6px;
  margin-left: 6px;
}
.pos { color: var(--good); }
.neg { color: var(--bad); }
/* Height chip next to a player name (roster tables); lighter than the .pos-tag pill. */
.ht-tag { font-size: 11px; color: var(--text-dim); margin-left: 6px; }
/* Secondary position line under a player name (box-score cells). */
.player-meta { font-size: 11px; color: var(--text-dim); margin-top: 1px; font-weight: 400; }

/* Box-score / roster player cell: "12 Jane Smith" — jersey number as a compact dim prefix. */
.box-player { display: flex; align-items: baseline; gap: 6px; }
.jersey {
  display: inline-block; flex: none; min-width: 1.4em; text-align: right;
  font-size: 12px; font-variant-numeric: tabular-nums;
  color: var(--text-dim); font-weight: 600;
}
.sticky-col .jersey { margin-right: 4px; }
/* Stat-heavy tables (box score, team roster) pack many columns, so give the frozen name column
   less width than the game-log tables and tighten the numeric cells to fit more on a phone. */
.dense-table th.sticky-col, .dense-table td.sticky-col { min-width: 128px; }
.dense-table th, .dense-table td { padding-left: 6px; padding-right: 6px; }

/* Box score: cap the frozen name column and let long names wrap to a second line, so the stat
   columns start sooner on a phone. (The table is min-width:max-content, so without a cap the
   column would just widen to the longest name instead of wrapping.) */
.box-table th.sticky-col, .box-table td.sticky-col { min-width: 72px; max-width: 92px; }
.box-table td.sticky-col .box-player { align-items: flex-start; gap: 6px; }
/* Left gutter: jersey number over position, both centered so the two tags line up vertically. */
.box-num { display: flex; flex-direction: column; align-items: center; flex: none; gap: 2px; }
/* Jersey number as a small accent chip — shared by the box score and the team roster so both
   stat tables read the same. */
.dense-table .jersey {
  min-width: 0; margin: 0; text-align: center;
  background: var(--bg-elev2); color: var(--accent);
  border-radius: 5px; padding: 1px 5px; line-height: 1.3;
}
.dense-table .sticky-col .jersey { margin-right: 4px; }
.box-pos { font-size: 10px; color: var(--text-dim); font-weight: 600; letter-spacing: .02em; }
.box-name { white-space: normal; overflow-wrap: anywhere; line-height: 1.2; padding-top: 1px; }
/* Team roster stat table reuses .box-table but also carries a favorite star, so give its frozen
   column a little more room and let the name wrap. Name + height stack vertically under the name. */
.team-box th.sticky-col, .team-box td.sticky-col { min-width: 84px; max-width: 112px; }
.team-box td.sticky-col .box-player { align-items: flex-start; gap: 4px; }
/* Desktop: the frozen name column sizes to its content so the WHOLE name sits on one line (no cap;
   .box-name below switches to nowrap). The compound selector outranks the .team-box / .wide-table
   single-class rules above so it wins regardless of source order; the mobile query below caps it. */
.wide-table.team-box th.sticky-col,
.wide-table.team-box td.sticky-col { min-width: 168px; max-width: none; }
.wide-table.team-box .box-name { white-space: nowrap; overflow-wrap: normal; }
.box-name-stack { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.box-name-stack .box-ht { margin-left: 0; line-height: 1.2; }
.box-player > .fav-star { flex: none; padding: 0; }

/* ---- Wide horizontally-scrolling table (team detail) ---- */
.table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.wide-table { min-width: max-content; }
.wide-table th.sticky-col, .wide-table td.sticky-col {
  position: sticky;
  left: 0;
  z-index: 2;
  text-align: left;
  min-width: 170px;
  width: auto;
  background: var(--bg-elev);
  box-shadow: 1px 0 0 var(--border);
}
.wide-table thead th.sticky-col { z-index: 3; background: var(--bg-elev2); }
tbody tr:hover td.sticky-col { background: var(--row-hover); }
.wide-table tbody tr.total-row td { font-weight: 700; border-top: 2px solid var(--border); }
.wide-table tbody tr.total-row td.sticky-col { background: var(--bg-elev2); }

/* ---- Grouped stat header (box score + team roster) ----
   A category-label row (Hitting / Setting / Serving / …) sits above the column-abbreviation row.
   Both rows are sticky; the column row stacks directly beneath the category row. The Player name is
   a rowspan-2 cell in the category row, so the column row's first cell is a real stat header. */
.grp-row th { top: 0; padding-top: 3px; padding-bottom: 3px; }
.grp-row th.grp {
  text-align: center;
  font-size: 10px;
  line-height: 1.1;
  border-bottom: 1px solid var(--border);
}
.col-row th { top: 20px; }
/* Undo the generic first-child centering / 44px width / dim treatment for the first stat column. */
.col-row th:first-child { text-align: right; width: auto; }
/* Category separators: a prominent vertical rule at the start of each group (marked .grp-start in
   JS), running down the whole table — both header rows and every body/total cell — so each column's
   category reads at a glance. */
.grp-row th.grp.grp-start,
.wide-table .col-row th.grp-start,
.wide-table tbody td.grp-start { border-left: 2px solid var(--sep); }

/* Center every stat column — headers and values — in the box score, PBP, and team roster tables
   (all carry .box-table); the frozen Player/name column stays left via .sticky-col. */
.box-table thead th,
.box-table .col-row th:first-child,
.box-table td.num { text-align: center; }

/* Same treatment for the Teams-page conference standings: center every stat column, keep the
   Team name column left-aligned (.l). */
.conf-group th,
.conf-group td.num { text-align: center; }
.conf-group th.l,
.conf-group td.l { text-align: left; }

/* ---- Generic frozen leading columns (standings: Team/GP/W/L). Sticky `left` offsets are
       measured and applied per column in JS (mountStickyColsTable). ---- */
.wide-table th.frozen-col, .wide-table td.frozen-col {
  position: sticky;
  z-index: 2;
  background: var(--bg-elev);
}
.wide-table th.frozen-col.frozen-last, .wide-table td.frozen-col.frozen-last {
  box-shadow: 1px 0 0 var(--border);
}
.wide-table thead th.frozen-col { z-index: 3; background: var(--bg-elev2); }
.wide-table tbody tr:hover td.frozen-col { background: var(--row-hover); }

/* Stat columns (and the Cl/Ht/Pos identity numbers) are centered in the leaders table — header and
   rows alike — overriding the global right-align. Player/Team (.l) stay left. */
.leader-table th.num, .leader-table td.num { text-align: center; }

/* ---- Stat/Fantasy leaders: freeze Rank + Player when the table scrolls horizontally ---- */
.leader-table th.c-rank, .leader-table td.c-rank,
.leader-table th.c-player, .leader-table td.c-player {
  position: sticky;
  z-index: 2;
  background: var(--bg-elev);
}
.leader-table th.c-rank, .leader-table td.c-rank { left: 0; }
.leader-table th.c-player, .leader-table td.c-player {
  left: 44px;  /* precise offset set in JS (mountLeaderTable) to match the rank column width */
  box-shadow: 1px 0 0 var(--border);
  will-change: left;  /* force compositing layer — fixes Firefox sticky repaint after scrollLeft changes */
}
.leader-table thead th.c-rank, .leader-table thead th.c-player {
  z-index: 3;
  background: var(--bg-elev2);
}
.leader-table tbody tr:hover td.c-rank,
.leader-table tbody tr:hover td.c-player { background: var(--row-hover); }

/* ---- Fit-to-window boards (Stat Leaders, Fantasy): the table scrolls vertically inside a
       window-sized box (sticky header + frozen rank/player columns stay put) instead of growing
       the page. ---- */
/* Extra bottom offset (vs. the ~290px chrome above) leaves room for the pager to clear the fixed
   Buy-Me-a-Coffee widget floating in the bottom-right corner. */
.fit-scroll { overflow: auto; max-height: calc(100vh - 346px); }
.clutch-desc { font-size: 12px; padding-bottom: 4px; }
/* Clutch table has extra description text above it — needs a taller offset */
.clutch-fit { overflow: auto; max-height: calc(100vh - 381px); }
.pager {
  display: flex; align-items: center; justify-content: center; gap: 14px; padding: 12px 0 2px;
}
.pager-info { font-size: 13px; color: var(--text-dim); min-width: 90px; text-align: center; }
.pager .btn[disabled] { opacity: .45; pointer-events: none; }
.table-search { min-width: 220px; }
input.table-search {
  background: var(--bg-elev2);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 5px 8px;
  font-size: 13px;
}
input.table-search:focus { outline: none; border-color: var(--accent); }

/* ---- Conference group ---- */
.conf-group { margin-bottom: 18px; }

/* Teams standings table: first column (team name) is sticky with a fixed width across all screen
   sizes so every conference group aligns identically. On desktop 200px fits most team names;
   on mobile 50vw keeps it readable while leaving room for stat columns. */
.conf-group .wide-table th.l:first-child,
.conf-group .wide-table td.l:first-child {
  position: sticky;
  left: 0;
  z-index: 2;
  background: var(--bg-elev);
  width: 300px;
  min-width: 300px;
  max-width: 300px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  box-shadow: 2px 0 4px rgba(0,0,0,.12);
}
.conf-group .wide-table thead th.l:first-child { z-index: 3; background: var(--bg-elev2); }

@media (max-width: 600px) {
  .conf-group .wide-table { font-size: 12px; }
  .conf-group .wide-table th.l:first-child,
  .conf-group .wide-table td.l:first-child {
    width: 50vw;
    min-width: 50vw;
    max-width: 50vw;
    white-space: normal;
    overflow: visible;
    text-overflow: clip;
    word-break: break-word;
  }
}

/* ---- Compare slots ---- */
/* Single scrolling row (not wrapping) so many players compare side-by-side without stacking. */
.compare-slots {
  display: flex; flex-wrap: nowrap; gap: 12px; margin-bottom: 16px;
  overflow-x: auto; padding-bottom: 6px;
}
.compare-card {
  position: relative;
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 14px;
  flex: 0 0 230px;   /* fixed width; the row scrolls instead of shrinking/wrapping cards */
}
.compare-card.add { border-style: dashed; }
.compare-card-name { font-weight: 700; margin-bottom: 2px; padding-right: 18px; }
.compare-card-sub { font-size: 12px; }
.compare-statlist { margin-top: 10px; display: flex; flex-direction: column; }
.compare-stat {
  display: flex; justify-content: space-between; gap: 10px;
  font-size: 13px; padding: 4px 0; border-top: 1px solid var(--border);
}
.compare-stat:first-child { border-top: none; }
.compare-stat .k { color: var(--text-dim); }
.compare-stat .v { font-weight: 600; font-variant-numeric: tabular-nums; }
.compare-remove {
  position: absolute; top: 6px; right: 9px;
  background: none; border: none; color: var(--text-dim);
  font-size: 18px; line-height: 1; cursor: pointer;
}
.compare-remove:hover { color: var(--bad); }
.compare-search {
  width: 100%; margin-top: 8px;
  background: var(--bg-elev2); border: 1px solid var(--border);
  border-radius: 8px; color: var(--text); padding: 6px 8px; font-size: 13px;
}
.compare-search:focus { outline: none; border-color: var(--accent); }
.compare-results { margin-top: 6px; display: flex; flex-direction: column; }
.compare-result {
  padding: 6px 8px; cursor: pointer; border-radius: 6px;
  display: flex; justify-content: space-between; gap: 8px;
}
.compare-result:hover { background: var(--row-hover); }
.compare-result .sub { color: var(--text-dim); font-size: 12px; }

/* Inline "Add a favorite" card (Favorites tab): pad the search + results off the card edges. */
.fav-add .card-title .seg-toggle { margin-left: auto; }
.fav-add > .compare-search { width: auto; margin: 10px 14px; }
.fav-add > .compare-results { margin: 0 14px 12px; }

/* ---- Fantasy weights panel ---- */
.weights {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 10px;
  padding: 14px;
}
.weights label { display: flex; flex-direction: column; gap: 3px; font-size: 12px; color: var(--text-dim); }
.weights input {
  background: var(--bg-elev2);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text);
  padding: 5px 7px;
  font-size: 13px;
}
.weights input:focus { outline: none; border-color: var(--accent); }
.weights-actions { padding: 0 14px 14px; display: flex; gap: 10px; }
.btn {
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 7px 14px;
  cursor: pointer;
  font-weight: 600;
  font-size: 13px;
}
.btn:hover { background: var(--accent-dim); }
.btn.ghost { background: var(--bg-elev2); color: var(--text); border: 1px solid var(--border); }

details.weights-wrap { margin-bottom: 16px; }
details.weights-wrap > summary {
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 11px 14px;
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-weight: 600;
  list-style: none;
}
details.weights-wrap[open] > summary { border-radius: var(--radius) var(--radius) 0 0; }
details.weights-wrap > summary::-webkit-details-marker { display: none; }
details.weights-wrap > summary::before { content: "⚙"; }
/* Right-side chevron signalling the panel is collapsible; rotates down when open. */
details.weights-wrap > summary::after {
  content: "▸"; margin-left: auto; font-size: 18px; line-height: 1;
  color: var(--text-dim); transition: transform .15s;
}
details.weights-wrap[open] > summary::after { transform: rotate(90deg); }
details.weights-wrap > summary:hover::after { color: var(--text); }
details.weights-wrap .panel {
  border: 1px solid var(--border);
  border-top: none;
  border-radius: 0 0 var(--radius) var(--radius);
  background: var(--bg-elev);
}

/* ---- Player detail ---- */
.player-head {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px 16px;
  margin-bottom: 6px;
}
.player-head h1 { margin: 0; font-size: 24px; }
.player-head .meta { color: var(--text-dim); font-size: 14px; }
.player-head-main {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}
.player-head-sub {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 4px 12px;
}
.player-head-transfer {
  font-size: 13px;
}
/* Detail-header headshot + missing-photo initials monogram (same footprint so layout is stable). */
.player-photo,
.player-monogram {
  width: 108px;
  height: 108px;
  border-radius: 50%;
  flex: 0 0 auto;
  object-fit: cover;
  /* Headshots are full portraits with a little headroom (see vb.scrape.photos). Bias the cover crop
     to near the top (10%) so the face sits in the circle: trims the empty headroom without eating the
     top of the head or showing too much neck. */
  object-position: center 10%;
  background: var(--bg-elev);
  border: 1px solid var(--border);
}
.player-monogram {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 39px;
  font-weight: 600;
  letter-spacing: 0.5px;
  color: hsl(var(--mono-h, 210), 55%, 82%);
  background: hsl(var(--mono-h, 210), 40%, 26%);
  border-color: hsl(var(--mono-h, 210), 35%, 38%);
}
/* Smaller headshot for the favorites player cards (fits the logo-sized card head row). */
.player-photo.fav-card-photo,
.player-monogram.fav-card-photo { width: 44px; height: 44px; flex: none; }
.player-monogram.fav-card-photo { font-size: 16px; }
/* Centered headshot atop each compare card. */
.player-photo.compare-card-photo,
.player-monogram.compare-card-photo { width: 64px; height: 64px; margin: 2px auto 10px; }
.player-monogram.compare-card-photo { font-size: 24px; }
.statline {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
  gap: 10px;
  margin: 16px 0;
}
.stat-box {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 14px;
}
.stat-box .k { font-size: 11px; text-transform: uppercase; letter-spacing: .5px; color: var(--text-dim); }
.stat-box .v { font-size: 22px; font-weight: 700; font-variant-numeric: tabular-nums; }
.stat-box .v.fp { color: var(--accent); }

.back-link { margin-bottom: 12px; }

/* ---- misc ---- */
.muted { color: var(--text-dim); }
.center { text-align: center; }
.empty-state { padding: 48px; text-align: center; color: var(--text-dim); }
.spinner { padding: 48px; text-align: center; color: var(--text-dim); }

/* Pull-to-refresh indicator (iOS standalone PWA only; created + positioned from JS). Parked just
   above the top edge and translated down as the user pulls. */
.ptr-indicator {
  position: fixed; top: -44px; left: 50%; transform: translateX(-50%);
  z-index: 1200; width: 32px; height: 32px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: var(--bg-elev2); border: 1px solid var(--border);
  box-shadow: 0 2px 8px rgba(0, 0, 0, .3);
  transition: transform .18s ease, opacity .18s ease;
}
.ptr-spinner {
  width: 16px; height: 16px; border-radius: 50%;
  border: 2px solid var(--border); border-top-color: var(--accent);
  transition: border-top-color .15s ease;
}
.ptr-indicator.ready .ptr-spinner { border-top-color: var(--good); }
.ptr-indicator.spinning .ptr-spinner { animation: ptr-spin .7s linear infinite; }
@keyframes ptr-spin { to { transform: rotate(360deg); } }
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--bg-elev2); border: 1px solid var(--border);
  border-radius: 20px; padding: 4px 10px; font-size: 13px;
}
.chip button { background: none; border: none; color: var(--text-dim); cursor: pointer; font-size: 15px; line-height: 1; }
.chip button:hover { color: var(--bad); }

.toast {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--bg-elev2);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 10px 16px;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  z-index: 50;
}
.toast.err { border-color: var(--bad); }

@media (max-width: 720px) {
  .controls .field span { display: none; }

  /* The topbar was too crowded to see the search box (brand + search + season + theme + auth all on
     one line). Wrap it: row 1 keeps the compact brand + controls, and the search drops to its own
     full-width row 2 so it's always usable. */
  .topbar { gap: 10px; padding: 8px 12px; flex-wrap: wrap; }
  .search { order: 3; flex: 1 1 100%; max-width: none; }
  .controls { gap: 8px; }
  .tabs { padding: 0 6px; }
  .tabs button { padding: 11px 10px; font-size: 13px; }
  .view { padding: 12px; }
  .view-head h1 { font-size: 18px; }

  /* The floating Buy-Me-a-Coffee widget lives in the bottom-right corner. On phones the taller
     chrome pushes the centered pager down into that corner, so the "Next ›" button ends up under
     the widget. Reserve bottom clearance (widget is ~60px tall at scale .65 + 18px margin) so the
     pager always scrolls clear of it. Desktop reserves this via the .fit-scroll height calc instead. */
  .pager { padding-bottom: 72px; }

  /* Card titles can hold a title + a segmented toggle + a hint; on a phone that overflows and the
     toggle (overflow:hidden) clipped "AVCA/RPI" down to "AV". Let the title wrap and keep the
     toggle at its natural width so the labels stay intact; the long hint drops to its own line. */
  .card-title { flex-wrap: wrap; }
  .card-title .seg-toggle { flex: none; }

  /* Wide data tables scroll sideways within their card instead of clipping (card keeps its
     rounded corners; only the x-axis becomes scrollable, so the sticky header still works). */
  .card { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  th, td { padding: 7px 9px; }
  th:first-child, td:first-child { width: 32px; }

  /* Leaderboard (mini-leader) on a phone: fit all three columns in the viewport (no sideways
     scroll). Fixed narrow rank + value; the school column takes a fixed share and the player column
     absorbs the rest, so the widths sum to exactly 100%. Long player/school names ellipsize
     (.mini-leader td.l). Tight cell padding trims the dead space between columns. */
  .mini-leader { font-size: 12px; }
  .mini-leader .c-rank { width: 28px; }
  .mini-leader .c-player { width: auto; }
  .mini-leader .c-team { width: 40%; }
  .mini-leader .c-val { width: 44px; }
  .mini-leader th, .mini-leader td { padding-left: 5px; padding-right: 5px; }
  .mini-leader th:first-child, .mini-leader td:first-child { width: 28px; }

  /* NOTE: the Stat Leaders (leader-table) portrait-phone rules live in their own
     (orientation: portrait) block after this one — landscape keeps the full desktop column set. */

  /* Phone: let the name grow to at most ~2/3 of the viewport before wrapping to a second line, so a
     long name stays readable without pushing the stat columns fully off-screen (overrides the
     desktop .wide-table.team-box rules above). */
  .wide-table.team-box th.sticky-col,
  .wide-table.team-box td.sticky-col { min-width: 92px; max-width: 66vw; }
  .wide-table.team-box .box-name { white-space: normal; overflow-wrap: anywhere; }

  /* Play-by-play set dividers ("Set 1 · 2 lead changes …") were oversized on a phone. */
  .pbp-set-head td { font-size: 11px; padding-top: 4px; padding-bottom: 4px; }

  /* Chat uses nearly the full width on a phone. */
  .ask-turn { max-width: 94%; }
  .ask-card { padding: 12px; }

  /* Team-page Schedule & Results: the nowrap set-score line (base .sched-sets is flex:none) was
     eating the row width, squeezing the opponent name into a narrow wrapping column. Wrap the row
     and drop the set scores to their own full-width line below the opponent. Needs .sched-list
     specificity to beat the later base `.sched-sets { flex:none; white-space:nowrap }`. */
  .sched-row { flex-wrap: wrap; row-gap: 2px; }
  .sched-list .sched-sets { order: 5; flex: 0 0 100%; white-space: normal;
    text-align: left; padding-left: 2px; }

  /* iOS auto-zooms when a focused form control's font-size is < 16px, and the zoomed layout
     then overflows the viewport. Bump text-entry controls to 16px on small screens to stop it
     (these selectors match/override the smaller per-control sizes set above). */
  .search input, select, .field select, .ask-input, .compare-search,
  .weights input, .secret-input, input[type="number"],
  .rankings-search, .setting-select, input[type="date"],
  input[type="text"], input[type="search"], input[type="email"] {
    font-size: 16px;
  }
}

/* Stat Leaders (leader-table) on a PORTRAIT phone only: carry over the compact leaderboard styling —
   smaller type, tight cells, a narrow rank (labelled "RK"), and capped Player/Team columns
   (ellipsized) so as many stat columns as possible show. The JS (isNarrow) drops the SP/GP/Class/Ht
   columns to match. In landscape the full desktop column set + frozen Rank+Player return, so these
   rules are gated on (orientation: portrait) rather than living in the width-only block above. */
@media (max-width: 720px) and (orientation: portrait) {
  .leader-table { font-size: 12px; }
  .leader-table th, .leader-table td { padding-left: 4px; padding-right: 4px; }
  .leader-table th.c-rank, .leader-table td.c-rank { width: 22px; }
  .leader-table th.c-player, .leader-table td.c-player {
    max-width: 130px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  }
  .leader-table td.team-cell {
    max-width: 124px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  }
  /* Drop the horizontal freeze on Rank+Player so the extra width goes to the stats and the row
     scrolls as a unit. Scoped to .stat-leaders so Fantasy keeps its freeze. The data cells go fully
     static, but the HEADER cells stay TOP-sticky (just unfrozen horizontally, left:auto) so every
     column header — Rank/Player included — stays pinned while the body scrolls vertically. */
  .leader-table.stat-leaders td.c-rank,
  .leader-table.stat-leaders td.c-player {
    position: static;
    box-shadow: none;
  }
  .leader-table.stat-leaders thead th.c-rank,
  .leader-table.stat-leaders thead th.c-player {
    position: sticky;
    top: 0;
    left: auto;
    box-shadow: none;
  }
}

/* ==================== Accounts / favorites / admin / ask ==================== */

/* --- header auth area + user menu --- */
.auth-area { display: flex; align-items: center; }
.user-menu { position: relative; }
.user-btn { display: inline-flex; align-items: center; gap: 6px; }
.admin-chip {
  font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .5px;
  background: var(--accent); color: #fff; border-radius: 6px; padding: 1px 5px;
}
.experimental-tag {
  font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .5px;
  background: #7c3aed; color: #fff; border-radius: 6px; padding: 1px 6px;
  margin-left: 8px; vertical-align: middle;
}
.user-dropdown {
  position: absolute; right: 0; top: calc(100% + 6px); min-width: 180px;
  background: var(--bg-elev); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 6px; z-index: 40;
}
.menu-item {
  display: block; width: 100%; text-align: left; background: none; border: none; color: var(--text);
  padding: 8px 10px; border-radius: 6px; cursor: pointer; font-size: 13px;
}
.menu-item:hover { background: var(--row-hover); }

/* --- email verification banner --- */
.verify-banner {
  background: var(--bg-elev2); border-bottom: 1px solid var(--accent);
  color: var(--text); padding: 8px 18px; text-align: center; font-size: 13px;
}
.link-btn {
  background: none; border: none; color: var(--accent); cursor: pointer;
  font-weight: 600; text-decoration: underline; font-size: inherit; padding: 0;
}
.link-btn.danger { color: var(--bad); }

/* --- favorite stars --- */
.fav-star {
  background: none; border: none; cursor: pointer; color: var(--text-dim);
  font-size: 15px; line-height: 1; padding: 0 6px 0 0; vertical-align: middle;
}
.fav-star:hover { color: var(--accent); }
.fav-star.on { color: #f2b705; }
td.is-fav .link { font-weight: 600; }
.fav-btn.on { border-color: #f2b705; color: #f2b705; }

/* --- favorites tab --- */
/* Favorites: glanceable cards with an adaptive stat headline + last/next game. */
.fav-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 12px; padding: 12px; }
.fav-card {
  position: relative;
  display: flex; flex-direction: column; gap: 10px; padding: 12px 14px;
  background: var(--bg-elev); border: 1px solid var(--border); border-radius: var(--radius);
}
.fav-card .fav-star { position: absolute; top: 8px; right: 10px; font-size: 20px; padding: 0; }
.fav-card-head { display: flex; align-items: center; gap: 10px; padding-right: 26px; }
.fav-card-logo { width: 34px; height: 34px; object-fit: contain; flex: none; }
.fav-card-title { display: flex; flex-direction: column; min-width: 0; }
.fav-card-title .name-row { display: flex; align-items: center; gap: 6px; }
.fav-card-title .name { font-weight: 700; font-size: 15px; }
.fav-card-title .name-row .pos-tag { margin-left: 0; }
.fav-card-title .sub { font-size: 12px; }
.fav-mini { display: grid; grid-template-columns: repeat(auto-fit, minmax(78px, 1fr)); gap: 8px; }
.fav-mini .box { background: var(--bg-elev2); border-radius: 8px; padding: 8px 10px; }
.fav-mini .box .v { font-size: 18px; font-weight: 700; font-variant-numeric: tabular-nums; }
.fav-mini .box .v.accent { color: var(--accent); }
.fav-mini .box .k { font-size: 10px; text-transform: uppercase; letter-spacing: .4px; color: var(--text-dim); }
.fav-last { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; margin-top: 10px; font-size: 12.5px; color: var(--text-dim); }
.fav-last b { color: var(--text); font-weight: 600; }
.fav-last .result { font-weight: 700; }
.fav-last.clickable { cursor: pointer; }
.fav-last.clickable:hover b { color: var(--accent); }

/* --- favorite conference cards --- */
/* Twice as wide as team/player cards — a conference holds far more (standings top+bottom), so it
   spans two grid tracks. Grid clamps the span to the available columns, so it degrades to full
   width on narrow screens. */
.fav-conf { grid-column: span 2; }
.conf-stands { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 24px; margin-top: 10px; }
.conf-stand { min-width: 0; }
.conf-stand-h { font-size: 10px; text-transform: uppercase; letter-spacing: .4px; margin-bottom: 4px; }
.conf-stand-row { display: flex; align-items: center; gap: 6px; font-size: 12.5px; padding: 2px 0; }
.conf-stand-logo { width: 18px; height: 18px; object-fit: contain; flex: none; }
.conf-stand-name { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; flex: 1; min-width: 0; }
.conf-stand-rec { margin-left: auto; flex: none; white-space: nowrap; font-variant-numeric: tabular-nums; }
.conf-stand-recs { margin-left: auto; flex: none; display: flex; gap: 8px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.conf-stand-conf { font-weight: 600; }
.conf-stand-ov { font-weight: 400; }

/* Conference logo chip: the marks are dark, full-color brand logos, so a fixed light backdrop keeps
   them legible on either theme (white in both). Some are wide wordmarks, so height-constrain + let
   width follow, capped by max-width. */
.conf-logo-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 3px 5px;
  flex: none;
}
/* Conference marks vary wildly in aspect ratio (wide wordmarks like Big East ~4.9:1 down to
   taller-than-wide seals like the MAC ~0.9:1). Bounding height alone lets the wide ones sprawl and
   leaves the compact ones tiny, so bound BOTH axes and let object-fit:contain scale each to fit the
   same box — that keeps their visual footprint consistent. */
.conf-logo { max-height: 20px; max-width: 48px; width: auto; height: auto;
  object-fit: contain; display: block; }
.conf-logo-head .conf-logo { max-height: 26px; max-width: 60px; }

/* --- Ask box --- */
.ask-card { padding: 16px; }
.ask-input {
  width: 100%; box-sizing: border-box;
  background: var(--bg-elev2); border: 1px solid var(--border); border-radius: var(--radius);
  /* Explicit 16px (not `font: inherit`) so iOS never auto-zooms on focus — the shorthand would
     reset font-size back to the sub-16px inherited value and defeat the anti-zoom media query. */
  color: var(--text); padding: 10px 12px; font-family: inherit; font-size: 16px; line-height: 1.4;
  resize: none; overflow-y: hidden;
}
.ask-actions { display: flex; align-items: center; gap: 10px; margin-top: 10px; flex-wrap: wrap; }
.ask-examples { display: flex; gap: 6px; flex-wrap: wrap; }
.ask-examples .chip { cursor: pointer; border: 1px solid var(--border); }
/* "More" popover of grouped example questions, anchored to its chip and opening upward. */
.ask-more { position: relative; display: inline-flex; }
.chip-more { font-weight: 600; }
.ask-more-panel {
  position: absolute; bottom: calc(100% + 8px); left: 0; z-index: 40;
  width: min(92vw, 440px); max-height: 60vh; overflow-y: auto;
  display: flex; flex-direction: column; gap: 12px;
  background: var(--bg-elev2); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 12px; box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
}
.ask-more-group { display: flex; flex-direction: column; gap: 6px; }
.ask-more-label { font-size: 11px; text-transform: uppercase; letter-spacing: 0.5px; color: var(--text-dim); }
.ask-more-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.ask-answer { margin-top: 14px; }
.ask-text { white-space: pre-wrap; line-height: 1.55; }
.ask-tools { margin-top: 6px; font-size: 12px; }
/* Full-height chat layout: the Ask view fills the window, the transcript grows to fill,
   and the input row stays pinned at the bottom (chat-app style). */
.view.view-ask { display: flex; flex-direction: column; overflow: hidden; }
.view.view-ask .view-head { flex: 0 0 auto; }
.view.view-ask .ask-card { flex: 1 1 auto; display: flex; flex-direction: column; min-height: 0; }
.view.view-ask .ask-transcript { flex: 1 1 auto; max-height: none; }
/* Only the transcript flexes; keep the textarea + actions at their natural size so a long
   conversation can't squash the input row (flex items default to flex-shrink:1). */
.view.view-ask .ask-input, .view.view-ask .ask-actions { flex: 0 0 auto; }

/* chat transcript (single ongoing thread) */
.ask-transcript {
  display: flex; flex-direction: column; gap: 12px;
  max-height: 52vh; overflow-y: auto; margin-bottom: 12px; min-height: 0;
}
.ask-hint { padding: 8px 2px; }
.ask-turn { display: flex; flex-direction: column; max-width: 88%; }
.ask-turn.user { align-self: flex-end; align-items: flex-end; }
.ask-turn.assistant { align-self: flex-start; align-items: flex-start; }
.ask-bubble {
  padding: 9px 13px; border-radius: 14px; line-height: 1.5; white-space: pre-wrap;
  border: 1px solid var(--border);
}
.ask-turn.user .ask-bubble { background: var(--accent); color: #fff; border-color: transparent; border-bottom-right-radius: 4px; }
.ask-turn.assistant .ask-bubble { background: var(--bg-elev2); color: var(--text); border-bottom-left-radius: 4px; }
.chip {
  background: var(--bg-elev2); border-radius: 999px; padding: 4px 12px; font-size: 12px;
  color: var(--text); border: 1px solid var(--border); cursor: default;
}

/* --- admin --- */
.admin-settings { padding: 12px; display: flex; flex-direction: column; gap: 16px; }
.secret-row { display: flex; flex-direction: column; gap: 6px; }
.secret-label { font-weight: 600; }
.secret-hint { display: block; font-weight: 400; font-size: 12px; margin-top: 2px; }
.secret-controls { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.secret-input {
  flex: 1 1 240px; background: var(--bg-elev2); border: 1px solid var(--border);
  border-radius: var(--radius); color: var(--text); padding: 7px 10px; font: inherit;
}
.secret-status { font-size: 12px; font-weight: 600; }
.secret-status.on { color: var(--good); }
.secret-status.off { color: var(--text-dim); }
.btn.danger { color: var(--bad); border-color: var(--bad); }

/* --- admin signups chart --- */
.stat-row { display: flex; flex-wrap: wrap; gap: 28px; padding: 12px 12px 4px; }
.stat-val { font-size: 24px; font-weight: 700; line-height: 1.1; }
.stat-label { font-size: 12px; color: var(--text-dim); margin-top: 2px; }
.signup-chart-wrap { padding: 8px 12px 12px; }
.signup-chart { width: 100%; max-width: 720px; height: auto; display: block; }
.sc-bar { fill: var(--accent); }
.sc-bar:hover { fill: var(--accent-dim); }
.sc-axis { stroke: var(--border); stroke-width: 1; }
.sc-tick { fill: var(--text-dim); font-size: 10px; }

/* --- play-by-play: per-set aggregates + reconstructed rally log --- */
.pbp-set-head td { background: var(--surface-2, rgba(127,127,127,.08)); font-weight: 600; color: var(--text-dim); }
/* Points column carries the set score, so highlight it. */
.pbp-pts { color: var(--accent); font-weight: 700; }
/* Play-by-play tab: match header + per-set switcher + centered rally timeline (see pbpCard). */
.pbp2 { padding-bottom: 12px; }
.pbp2-header {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  padding: 10px 14px; border-bottom: 1px solid var(--border);
}
.pbp2-hside { display: inline-flex; align-items: center; gap: 6px; }
.pbp2-hlogo { height: 26px; width: 26px; object-fit: contain; }
.pbp2-hscore { font-size: 20px; font-weight: 800; font-variant-numeric: tabular-nums; }
.pbp2-hstatus { font-size: 12px; font-weight: 700; color: var(--text-dim);
  text-transform: uppercase; letter-spacing: .4px; margin: 0 4px; }
.pbp2-hname { flex: 1 1 0; min-width: 0; font-weight: 700; font-size: 13px; color: var(--text-dim);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pbp2-hname.away { text-align: right; }
.pbp2-hname.home { text-align: left; }

.pbp2-set-tabs { margin: 12px 14px 4px; }
.pbp2-set-tabs--bot { margin: 4px 14px 12px; }

.pbp2-timeline { position: relative; padding: 8px 0 2px; }
.pbp2-empty { padding: 16px; text-align: center; }

.pbp2-row { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center;
  gap: 10px; padding: 4px 12px; }
.pbp2-desc { min-width: 0; font-size: 12px; color: var(--text); }
.pbp2-desc.left { text-align: right; }
.pbp2-desc.right { text-align: left; }
.pbp2-server { color: var(--text-dim); font-weight: 600; }

.pbp2-pt { display: inline-flex; align-items: center; gap: 8px;
  background: var(--bg-elev2); border: 1px solid var(--border); border-radius: 999px; padding: 4px 12px; }
.pbp2-pscore { min-width: 18px; text-align: center; font-size: 14px; font-weight: 800;
  font-variant-numeric: tabular-nums; }
.pbp2-plogo { height: 20px; width: 20px; object-fit: contain; }
/* Fixed-width serve column keeps the whole center pill a constant width regardless of the serving
   team; the abbreviated name (pbpTeamAbbr) fits, and anything longer truncates with an ellipsis. */
.pbp2-serve { display: inline-flex; flex-direction: column; align-items: center; line-height: 1.05;
  width: 60px; flex: 0 0 60px; }
.pbp2-serve-lbl { font-size: 9px; text-transform: uppercase; letter-spacing: .3px; color: var(--text-dim); }
.pbp2-serve-team { font-size: 11px; font-weight: 700; max-width: 100%; overflow: hidden;
  text-overflow: ellipsis; white-space: nowrap; }
/* Fixed width so the empty (losing-side) arrow slot still reserves space and both flanks balance. */
.pbp2-arrow { font-size: 13px; font-weight: 800; color: var(--accent); min-width: 13px; text-align: center; }

.pbp2-sub { display: flex; align-items: center; justify-content: center;
  gap: 6px; padding: 5px 12px; font-size: 11px; color: var(--text-dim); }
.pbp2-sub-tri { color: var(--good); font-size: 9px; }
.pbp2-sub-text { font-weight: 600; }

@media (max-width: 720px) {
  .pbp2-header { gap: 8px; }
  .pbp2-hname { display: none; }
  .pbp2-row { grid-template-columns: 1fr; justify-items: center; gap: 2px; }
  .pbp2-row .pbp2-pt { order: 0; }
  .pbp2-desc { order: 1; text-align: center; }
  .pbp2-desc.left, .pbp2-desc.right { text-align: center; }
  .pbp2-desc:empty { display: none; }
}

/* --- Lineups tab: per-set starters/subs + set-to-set change summary --- */
.lineups-card { padding-bottom: 10px; }
/* Card body blocks are inset to 14px to line up with the card title; .lineup-set keeps its full-width
   border-top (padding, not margin, indents its content). */
.lineup-changes { display: flex; flex-direction: column; gap: 4px; margin: 6px 14px 4px;
  padding: 8px 10px; background: var(--bg-elev2); border-radius: 8px; }
.lineup-change-row { display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: baseline;
  font-size: 13px; }
.lineup-change-set { font-weight: 700; min-width: 42px; }
.lineup-in { color: var(--accent); font-weight: 600; }
.lineup-out { color: var(--text-dim); font-weight: 600; }
.lineup-nochange { font-size: 13px; margin: 4px 0; padding: 0 14px; }
.lineup-set { border-top: 1px solid var(--border); padding: 8px 14px 2px; }
.lineup-set-title { font-weight: 700; font-size: 13px; margin-bottom: 4px; }
.lineup-group { margin-bottom: 6px; }
.lineup-group-label { display: block; font-size: 11px; font-weight: 700; text-transform: uppercase;
  letter-spacing: .3px; margin-bottom: 3px; }
.lineup-players { display: flex; flex-wrap: wrap; gap: 4px 10px; }
.lineup-player { font-size: 13px; white-space: nowrap; }
.lineup-note { font-size: 11px; margin-top: 8px; padding: 0 14px; }

/* --- Rotations tab: per-rotation (R1-R6) point +/-, sideout/hold %, attack line --- */
.rot-scope { margin-bottom: 10px; }
/* One card per team: stacked (full width) on mobile, side by side on wider screens. minmax(0,1fr)
   keeps each track from blowing out to its table's intrinsic width. Shared by rotations + lineups. */
.rot-cards, .team-card-grid, .ov-cards { display: grid; grid-template-columns: 1fr; gap: 12px; align-items: start; }
.rot-cards > .card, .team-card-grid > .card, .ov-cards > .card { margin: 0; min-width: 0; }
@media (min-width: 760px) {
  .rot-cards, .team-card-grid, .ov-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
/* Leaders tab: one card per category, top-3 rows of rank · name · total. */
.leader-card .card-title { margin-bottom: 6px; }
.leader-empty { font-size: 13px; padding: 2px 0 4px; }
/* 14px left/right matches the card title's horizontal inset so rows aren't flush to the edges. */
.tl-row { display: flex; align-items: center; gap: 8px; padding: 6px 14px; border-top: 1px solid var(--border); }
.tl-row:first-of-type { border-top: none; }
.tl-rank { width: 16px; text-align: center; font-weight: 700; color: var(--text-dim); font-variant-numeric: tabular-nums; }
.tl-name { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tl-pos { font-size: 11px; color: var(--text-dim); flex: 0 0 auto; }
.tl-num { font-size: 11px; color: var(--text-dim); flex: 0 0 auto; font-variant-numeric: tabular-nums; }
.tl-val { flex: 0 0 auto; font-weight: 700; font-variant-numeric: tabular-nums; }
.rotations-card { padding-bottom: 10px; }
.rot-set-title { font-weight: 700; font-size: 13px; margin: 10px 0 2px; padding: 0 14px; }
.rot-table { min-width: 0; width: 100%; }
.rot-table th, .rot-table td { padding: 6px 8px; }
.rot-table th:first-child, .rot-table td:first-child { padding-left: 14px; }
.rot-table th:last-child, .rot-table td:last-child { padding-right: 14px; }
/* Center every column but the first (the Rot label stays left-aligned), header and body alike. */
.rot-table th:not(:first-child), .rot-table td:not(:first-child) { text-align: center; }
.rot-table td.rot-label { text-align: left; font-weight: 700; color: var(--text); }
.rot-table td.rot-pos { color: var(--good); font-weight: 600; }
.rot-table td.rot-neg { color: var(--bad); font-weight: 600; }
.rot-note { font-size: 11px; margin-top: 8px; }

/* --- modal (auth / account) --- */
.modal-backdrop {
  position: fixed; inset: 0; background: rgba(0,0,0,.55); z-index: 60;
  display: flex; align-items: center; justify-content: center; padding: 20px;
}
.modal {
  background: var(--bg-elev); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow); width: 100%; max-width: 400px; padding: 20px;
  max-height: 90vh; overflow-y: auto;
}
/* Wider modal for settings-style screens (e.g. the fantasy weights grid needs room). */
.modal.modal-lg { max-width: 720px; }
/* Extra-wide modal for the box score (two wide, horizontally-scrolling stat tables). */
.modal.modal-xl { max-width: 1100px; }
/* Individual/player stats in the modal: on desktop, give the overlay the wide screen's room (96vw)
   so the wide box-score tables mostly fit, and let EACH table scroll horizontally inside its own
   card — with the player-name column pinned (the tables' sticky-col resolves against .table-scroll,
   its own overflow-x: auto scroller) — rather than one body-level scrollbar panning both tables and
   the group headers together. The body scrolls vertically only. Below 900px it falls back to the
   fixed 1100px shell (unchanged mobile behavior); the per-table inner scroll is the same on both. */
@media (min-width: 900px) {
  .modal.modal-xl.modal-fit { width: 96vw; max-width: 96vw; }
}
.modal.modal-xl .card { margin: 0 0 12px; }
.modal.modal-xl .card:last-child { margin-bottom: 0; }
.modal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; }
/* Stat glossary: a small "?" help button by the table title + the modal's definition list. */
.glossary-btn { width: 20px; height: 20px; min-width: 20px; padding: 0; border-radius: 50%;
  font-size: 12px; font-weight: 700; line-height: 1; flex: none;
  justify-content: center; background: transparent; color: var(--text-dim); }
.glossary-btn:hover { background: var(--bg-elev2); color: var(--accent); border-color: var(--accent); }
/* Glossary modal: fixed head (title + ×), independently-scrolling body so you can reach the bottom. */
.modal.modal-glossary { display: flex; flex-direction: column; overflow: hidden; }
.modal.modal-glossary .modal-head { flex: none; margin-bottom: 0; padding-bottom: 10px;
  border-bottom: 1px solid var(--border); }
.glossary-scroll { flex: 1 1 auto; min-height: 0; overflow-y: auto; padding-top: 10px; }
.glossary-note { font-size: 12px; margin-bottom: 10px; }
.glossary-body { display: flex; flex-direction: column; gap: 2px; }
.glossary-group { font-weight: 700; font-size: 12px; text-transform: uppercase; letter-spacing: .04em;
  color: var(--text-dim); margin: 12px 0 4px; border-bottom: 1px solid var(--border); padding-bottom: 3px; }
.glossary-row { display: grid; grid-template-columns: 84px 1fr; gap: 10px; align-items: baseline;
  padding: 3px 0; }
.glossary-label { font-weight: 700; font-variant-numeric: tabular-nums; }
.glossary-desc { font-size: 13px; color: var(--text); }
.glossary-adv { color: var(--text-dim); font-style: italic; }
/* Box-score (xl) modal: fixed header + independently-scrolling body so the × / back link never
   scroll away and content can't slide above them. The panel itself stops scrolling; .modal-xl-body
   owns the overflow. */
.modal.modal-xl { display: flex; flex-direction: column; overflow: hidden; }
.modal.modal-xl .modal-head { flex: none; }
.modal-xl-body { flex: 1; min-height: 0; overflow-y: auto; -webkit-overflow-scrolling: touch; }
.modal-head h2 { margin: 0; font-size: 18px; }
.modal-head .modal-back { font-size: 15px; font-weight: 600; }
/* While a modal is open, lock the page behind it so a mobile scroll gesture moves the modal body,
   not the background. The modal body owns scrolling and contains its own overscroll. */
body.modal-open { overflow: hidden; }
.modal { overscroll-behavior: contain; }
.modal-xl-body { overscroll-behavior: contain; }
.modal-foot { margin-top: 16px; text-align: center; font-size: 13px; }
.modal-actions { display: flex; gap: 10px; margin-top: 4px; }
.toggle-row { display: flex; align-items: center; gap: 10px; font-size: 13px; color: var(--text); }
.toggle-row input { width: 16px; height: 16px; flex: 0 0 auto; accent-color: var(--accent); }
.auth-form { display: flex; flex-direction: column; gap: 12px; margin-top: 16px; }
.auth-form h3 { margin: 8px 0 0; font-size: 14px; }
.setting-row { display: flex; align-items: center; gap: 8px; font-size: 13px; }
.setting-select { font-size: 13px; padding: 3px 6px; border: 1px solid var(--border); border-radius: 4px; background: var(--bg); color: var(--text); }
.form-field { display: flex; flex-direction: column; gap: 4px; }
.form-field span { font-size: 12px; color: var(--text-dim); }
.form-field input {
  background: var(--bg-elev2); border: 1px solid var(--border); border-radius: var(--radius);
  color: var(--text); padding: 9px 11px; font: inherit;
}
.btn.primary { background: var(--accent); }
.btn.wide { width: 100%; padding: 10px; }
.form-err { color: var(--bad); font-size: 13px; }
.forgot-link { align-self: flex-end; font-size: 12px; margin-top: -6px; }
.or-sep { text-align: center; color: var(--text-dim); font-size: 12px; margin: 14px 0 10px; }
.pk-list { display: flex; flex-direction: column; gap: 6px; margin-top: 8px; }
.pk-row {
  display: flex; align-items: center; gap: 10px; padding: 8px 10px;
  background: var(--bg-elev2); border: 1px solid var(--border); border-radius: var(--radius); font-size: 13px;
}
.pk-row .muted { margin-left: auto; }
.verify-ok { color: var(--good); font-size: 16px; font-weight: 600; margin-bottom: 14px; }

/* ---------- Team detail: info + coach card ---------- */
/* Lives in a table's card-title bar, pushed to the right so it sits with the table header. */
.table-hint { margin-left: auto; font-size: 12px; font-weight: 400; white-space: nowrap; }
.team-info { position: relative; margin-bottom: 16px; padding: 14px; }   /* relative: anchors the corner favorite star; content inset (no card-title here) + breathing room before the tab nav */
.filters.team-filters { margin: 0; }   /* now nested inside .filter-collapse-body, which owns the inset */
.filter-note { font-size: 12px; margin: 0 14px 10px; }   /* play-by-play coverage caveat under the bar */

/* Collapsible hitting-filter section (collapsed by default). Shared by the box score + team table. */
.filter-collapse { margin: 10px 14px 8px; }
.filter-collapse-head {
  display: inline-flex; align-items: center; gap: 6px;
  background: none; border: none; cursor: pointer; padding: 4px 0;
  color: var(--text-dim); font: inherit; font-size: 11px; font-weight: 600;
  text-transform: uppercase; letter-spacing: .5px;
}
.filter-collapse-head:hover { color: var(--text); }
.filter-collapse-head.has-active { color: var(--text); }
.filter-collapse-head .chev { font-size: 15px; width: 14px; line-height: 1; }
.filter-collapse-head .filter-count {
  background: var(--accent); color: #fff; border-radius: 999px;
  font-size: 10px; font-weight: 700; line-height: 1; padding: 2px 6px; letter-spacing: 0;
}
.filter-collapse-body { margin-top: 8px; }
/* A whole card whose title row toggles the card body (Schedule & Results, Quality wins). */
.card-title.collapse-head { cursor: pointer; user-select: none; }
.card-title.collapse-head .chev { font-size: 16px; width: 16px; line-height: 1; color: var(--text-dim); }
.card-title.collapse-head:hover .chev { color: var(--text); }
.collapse-body[hidden] { display: none; }
.btn-reset {
  background: none; border: 1px solid var(--border); border-radius: 6px; cursor: pointer;
  color: var(--text-dim); font: inherit; font-size: 12px; font-weight: 600; padding: 5px 12px;
}
.btn-reset:hover { color: var(--text); border-color: var(--text-dim); }
.team-title { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; }
.team-title h1 { font-size: 22px; margin: 0; }
.team-info-grid { display: flex; gap: 18px; align-items: flex-start; }
.team-info-side { display: flex; flex-direction: column; align-items: center; gap: 8px; flex: 0 0 auto; }
.team-logo-lg { height: 104px; width: 104px; object-fit: contain; flex: 0 0 auto; }
.team-info-main { flex: 1 1 auto; min-width: 0; }
.team-facts { display: flex; flex-wrap: wrap; gap: 8px 22px; }
.fact { display: flex; flex-direction: column; gap: 2px; }
.fact-label { font-size: 11px; text-transform: uppercase; letter-spacing: .04em; color: var(--text-dim); }
.fact-value { font-size: 15px; font-weight: 600; color: var(--text); }
.team-links { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.team-link { font-size: 13px; text-decoration: none; color: var(--accent); }
.team-link:hover { text-decoration: underline; }
/* Head coach sits under the logo in the left side column: a compact centered stack. */
.team-coach {
  display: flex; flex-direction: column; align-items: center; gap: 1px;
  text-align: center; margin-top: 4px; max-width: 140px;
}
.coach-name { font-size: 14px; font-weight: 600; }
.coach-meta { font-size: 12px; }

/* ==================== Games: scoreboard, box score, team schedule ==================== */

/* Date picker inherits the select look so the Games controls line up with the week dropdown. */
input[type="date"] {
  background: var(--bg-elev2); border: 1px solid var(--border);
  border-radius: 8px; color: var(--text); padding: 6px 8px; font-size: 13px;
}

/* --- scoreboard (Games tab) --- */
.games-filters { margin-bottom: 14px; }   /* breathing room under the week picker */

/* Games are cards in a responsive grid (2-up on desktop, 1-up on a phone — same idiom as
   .fav-cards), so more games fit per screen than the old one-per-row list. */
.game-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 10px; padding: 10px 4px; }
.game-card { display: flex; flex-direction: column; gap: 6px; padding: 10px 12px;
  border: 1px solid var(--border); border-radius: 8px; background: var(--bg-elev2);
  position: relative; }   /* anchors the absolute network tags + peek button */
.game-card.clickable { cursor: pointer; }
/* The set-scoreboard block (two team rows); relative so the peek icon floats over just the scores. */
.gc-scores { display: flex; flex-direction: column; gap: 6px; position: relative; }
/* Peek: a bare eye icon floating over the blurred score region (no button chrome). Reveals this one
   card for 2s. Spans the right portion of the rows (where all the scores live) and centers the icon,
   so it sits ON the blurred numbers rather than off to the edge. currentColor = --text keeps it a
   simple black/white eye that reads in both themes; the drop-shadow halos it against the blur. */
.gc-peek { position: absolute; left: 55%; right: 0; top: 50%; transform: translateY(-50%);
  z-index: 3; pointer-events: auto; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  color: var(--text); opacity: 0.9;
  filter: drop-shadow(0 0 3px var(--bg-elev2)) drop-shadow(0 0 2px var(--bg-elev2)); }
.gc-peek:hover { opacity: 1; }
.gc-peek svg { display: block; }
.game-card.clickable:hover { border-color: var(--accent); background: var(--row-hover); }
/* Win/loss (viewed team's perspective) on its own schedule cards: a colored left edge + a W/L pill. */
.game-card.result-win { border-left: 3px solid var(--good); }
.game-card.result-loss { border-left: 3px solid var(--bad); }
.wl-badge { display: inline-flex; align-items: center; justify-content: center;
  width: 18px; height: 18px; border-radius: 4px; font-size: 12px; font-weight: 800;
  color: #fff; line-height: 1; }
.wl-badge.win { background: var(--good); }
.wl-badge.loss { background: var(--bad); }
.gc-badge-datetime { font-size: 12px; align-self: center; }
/* Quality-win pill on a result card: a win over a team ranked top-25 as of game day. Gold with dark
   text so it reads on either theme and stands apart from the accent Top-25 / W-L badges. */
.qw-badge {
  flex: none; display: inline-flex; align-items: center; height: 18px;
  font-size: 10px; font-weight: 800; letter-spacing: .3px; line-height: 1;
  padding: 0 6px; border-radius: 5px; white-space: nowrap;
  color: #1a1a1a; background: #f2b705;
}
/* Always reserve the badge line's height (even when empty) so team rows sit at the same y across
   every card in the grid — a card without a badge lines up with the ranked-matchup card beside it. */
.game-card .game-badges { margin-bottom: 2px; min-height: 18px; }
.gc-team { display: flex; align-items: center; gap: 8px; min-width: 0; }
.gc-team-name { display: flex; align-items: center; gap: 6px; min-width: 0; flex: 1; overflow: hidden; }
.gc-team .game-team-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gc-team.is-fav .game-team-name, .gc-team.win .game-team-name { font-weight: 700; }
/* Per-set score columns: fixed-width cells so the away/home rows align vertically. */
.gc-sets-line { display: flex; flex: none; }
.gc-set { width: 22px; text-align: center; font-size: 13px; color: var(--text-dim);
  font-variant-numeric: tabular-nums; }
.gc-team.win .gc-set { color: var(--text); }
/* The in-progress set of a live game: tinted + bold so it reads as "still being played", not a
   settled set score. */
.gc-set--live { color: var(--bad); font-weight: 700; }
.gc-sets { flex: none; min-width: 18px; margin-left: 6px; text-align: right; font-weight: 700;
  font-size: 18px; font-variant-numeric: tabular-nums; color: var(--text-dim); }
.gc-sets.win { color: var(--text); }
.gc-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px;
  flex-wrap: wrap; margin-top: 2px; padding-top: 6px; border-top: 1px solid var(--border); font-size: 12px; }
/* Spoiler blur: applied to score elements when hide-scores is toggled. */
.gc-spoil { filter: blur(5px); user-select: none; pointer-events: none; transition: filter 0.2s; }
.gc-spoil:hover { filter: blur(2px); }
/* Projected win-probability line sits on its own row at the bottom of an upcoming card. */
.win-prob { flex-basis: 100%; font-size: 11px; }
.proj-result { flex-basis: 100%; font-size: 11px; font-weight: 600; }
.proj-result.proj-correct { color: var(--good); }
.proj-result.proj-wrong   { color: var(--bad); }

/* Live / just-finished state (Games tab live board). A red inset edge marks a game in progress; a
   muted edge marks a completed game, so a final score can't be mistaken for one still being played.
   Both use box-shadow (not border) so they never fight the W/L border-left tint on team schedules. */
.game-card--live { border-color: var(--bad); box-shadow: inset 3px 0 0 var(--bad); }
.game-card--final { box-shadow: inset 3px 0 0 var(--text-dim); }
/* A completed (clickable) card hovers to a neutral near-black edge — not the accent red — so a
   finished game reads as "done" rather than actionable on hover. (var(--text) is near-black in the
   light theme and stays visible in the dark theme, where a literal black would disappear.) */
.game-card--final.clickable:hover { border-color: var(--text); }
/* Status chip in the badge row: red "LIVE · <set>" for in-progress, muted "FINAL" for a provisional
   (ncaa.com) final whose box score hasn't been scraped yet. */
.status-chip { flex: none; display: inline-flex; align-items: center; height: 18px;
  padding: 0 7px; border-radius: 5px; font-size: 10px; font-weight: 800; letter-spacing: .3px;
  line-height: 1; white-space: nowrap; text-transform: uppercase; }
.status-chip.live { color: #fff; background: var(--bad); }
.status-chip.live::before { content: ""; width: 6px; height: 6px; margin-right: 5px;
  border-radius: 50%; background: #fff; animation: live-pulse 1.4s ease-in-out infinite; }
.status-chip.final { color: var(--text-dim); background: transparent; border: 1px solid var(--border); }
@keyframes live-pulse { 0%, 100% { opacity: 1; } 50% { opacity: .25; } }
@media (prefers-reduced-motion: reduce) { .status-chip.live::before { animation: none; } }

/* --- Games week strip: a horizontal row of day pills (ESPN/NCAA scoreboard pattern). Tap a day to
   show just that day's cards below; "All" keeps the stacked full-week view. --- */
.day-strip-wrap { display: flex; align-items: stretch; gap: 6px; justify-content: flex-start; }
.day-strip-wrap .day-strip { flex: 0 1 auto; min-width: 0; }
.day-nav { flex: 0 0 auto; align-self: stretch; margin: 4px 0 8px; width: 30px;
  background: var(--bg-elev); border: 1px solid var(--border); border-radius: 8px;
  color: var(--text); font-size: 18px; font-weight: 700; cursor: pointer; }
.day-nav:hover:not(:disabled) { border-color: var(--accent); color: var(--accent); }
.day-nav:disabled { opacity: 0.3; cursor: default; }
.day-strip { display: flex; gap: 6px; overflow-x: auto; padding: 4px 0 8px;
  -webkit-overflow-scrolling: touch; }
.day-pill { flex: 0 0 auto; display: flex; flex-direction: column; align-items: center; gap: 1px;
  min-width: 56px; padding: 6px 10px; cursor: pointer; color: var(--text);
  background: var(--bg-elev2); border: 1px solid var(--border); border-radius: 10px;
  font: inherit; line-height: 1.15; }
.day-pill:hover:not(.empty):not(.active) { border-color: var(--accent); }
.day-pill .day-pill-top { font-size: 11px; font-weight: 600; color: var(--text-dim);
  text-transform: uppercase; letter-spacing: 0.03em; }
.day-pill .day-pill-dom { font-size: 17px; font-weight: 700; font-variant-numeric: tabular-nums; }
.day-pill .day-pill-count { font-size: 10px; font-weight: 600; color: var(--text-dim); }
.day-pill.today { border-color: var(--accent); }
.day-pill.active { background: var(--accent); border-color: var(--accent); }
.day-pill.active .day-pill-top, .day-pill.active .day-pill-dom, .day-pill.active .day-pill-count {
  color: #fff; }
.day-pill.empty { opacity: 0.45; cursor: default; }
/* The selected single day's date heading above its card grid. */
.day-board-head { font-weight: 700; font-size: 15px; margin: 4px 2px 8px; }

/* --- tabbed game view (Overview / Team / Individual / Lineups / Rotations / Play by Play) --- */
/* Underline horizontal-scroll nav, styled like the top-level app nav (.tabs). */
.game-tabs {
  display: flex;
  gap: 4px;
  margin: 4px 0 14px;
  border-bottom: 1px solid var(--border);
  overflow-x: auto;
}
.game-tabs button {
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  color: var(--text-dim);
  padding: 10px 12px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
}
.game-tabs button:hover { color: var(--text); }
.game-tabs button.active { color: var(--text); border-bottom-color: var(--accent); }
.game-tab-body > .card:first-child,
.team-tab-body > .card:first-child { margin-top: 0; }
/* Team detail tabs (Results / Roster & Stats / Upcoming) reuse the .game-tabs underline nav above. */
/* Player Stats tab: full-width toggle between the two teams' box scores (one shown at a time). */
.box-team-pills { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 12px; }
.box-team-pill {
  display: inline-flex; align-items: center; gap: 7px; cursor: pointer;
  background: none; color: var(--text-dim); font: inherit; font-size: 13px; font-weight: 600;
  padding: 5px 14px; line-height: 1.3; border: 1px solid var(--border); border-radius: 999px;
  white-space: nowrap;
}
.box-team-pill-logo { height: 20px; width: 20px; object-fit: contain; flex: none; }
.box-team-pill.active { background: var(--accent); color: #fff; border-color: var(--accent); }
.box-team-panel > .card { margin-top: 0; }
/* Phone overrides for the game grid + tabs. These MUST sit AFTER the base rules above: the file's
   main @media block (top of file) predates this section, so its equal-specificity overrides there
   would lose the cascade to the base rules below it — which previously hid BOTH tab labels, leaving
   the switcher as blank pills. Keeping them here lets source order do the swap correctly. */
@media (max-width: 720px) {
  /* Player game log opponent column only: narrower on mobile, allow name to wrap. */
  .player-game-log td.sticky-col,
  .player-game-log th.sticky-col {
    min-width: 80px;
    max-width: 110px;
    white-space: normal;
    word-break: break-word;
    overflow-wrap: break-word;
  }
  /* Scoreboard cards go full-width (1-up) on a phone. */
  .game-grid { grid-template-columns: 1fr; padding: 8px 0; }
  /* Day strip stays a scrollable single row; slightly tighter pills so more days peek in. */
  .day-pill { min-width: 48px; padding: 5px 8px; }
  .day-pill .day-pill-dom { font-size: 16px; }
  /* Game tabs: same underline nav on mobile — it scrolls horizontally rather than shrinking. */
  .game-tabs { margin: 2px 0 12px; }
  .game-tabs button { padding: 9px 10px; }
}
/* Overview: game-leaders + team-stats comparison grids (label | away | home). */
.ov-grid { display: grid; grid-template-columns: 1.3fr 1fr 1fr; }
.ov-cell { padding: 7px 10px; border-top: 1px solid var(--border); display: flex; align-items: center; }
.ov-cell.ov-head { border-top: none; font-weight: 700; justify-content: center; gap: 6px; }
.ov-cell.ov-label { color: var(--text-dim); }
.ov-cell.num { justify-content: center; font-variant-numeric: tabular-nums; font-weight: 600; }
.ov-team { display: flex; align-items: center; gap: 6px; }
.ov-team .game-logo { width: 20px; height: 20px; }
.ov-team-name { font-weight: 700; }
/* Team Stats + Game leaders cards: value | category | value — category label centered between the
   two teams (leaders reuses this layout so both game-detail comparison tables match). */
.ov-teamstats .ov-grid, .ov-leaders .ov-grid { grid-template-columns: 1fr 1.6fr 1fr; }
.ov-teamstats .ov-mid, .ov-leaders .ov-mid { justify-content: center; text-align: center; }
.ov-teamstats .ov-label, .ov-leaders .ov-label { color: var(--text-dim); font-weight: 500; }
.ov-teamstats .ov-cell.num { font-weight: 700; }
/* Winner of a category: the side with the edge (more kills, fewer errors, etc.). Green text on a
   faint green pill so it's obvious at a glance which team "won" each row; ties get no highlight. */
.ov-win { color: var(--good); background: color-mix(in srgb, var(--good) 14%, transparent); }
.lead-cell { flex-direction: column; align-items: center; gap: 1px; }
.lead-name { font-weight: 600; text-align: center; }
.lead-val { color: var(--accent); font-weight: 700; font-variant-numeric: tabular-nums; }
/* Per-set score-progression charts (Overview tab) */
.set-chart-meta { font-size: 12px; font-weight: 400; margin-left: 8px; }
/* Stack the chart over the set-stats table so the card fits a half-width overview column. */
.set-chart-row { display: flex; flex-direction: column; gap: 12px; align-items: stretch; }
.set-chart-plot { min-width: 0; }
.set-chart-svg { width: 100%; height: auto; display: block; }
.sc-grid { stroke: var(--border); stroke-width: 1; }
.sc-axis { fill: var(--text-dim); font-size: 10px; }
.sc-line { fill: none; stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.sc-line.sc-away { stroke: var(--accent); }
.sc-line.sc-home { stroke: var(--text); }
.sc-legend { display: flex; gap: 16px; justify-content: center; margin-top: 4px; font-size: 12px; color: var(--text-dim); }
.sc-key { display: inline-flex; align-items: center; gap: 6px; }
.sc-swatch { width: 14px; height: 3px; border-radius: 2px; display: inline-block; }
.sc-swatch.sc-away { background: var(--accent); }
.sc-swatch.sc-home { background: var(--text); }
.set-chart-summary { width: 100%; border-collapse: collapse; font-size: 13px; }
.set-chart-summary th, .set-chart-summary td { padding: 4px 8px; border-bottom: 1px solid var(--border); }
.set-chart-summary th.num, .set-chart-summary td.num { text-align: center; font-variant-numeric: tabular-nums; }
.set-chart-summary td.sc-pts { font-weight: 700; }
/* Collapsible day cards on the Games scoreboard (each toggles independently). */
.day-card > summary { cursor: pointer; list-style: none; }
.day-card > summary::-webkit-details-marker { display: none; }
.day-summary::after {
  content: "▸"; margin-left: auto; font-size: 18px; line-height: 1; color: var(--text-dim);
  padding-left: 6px; transition: transform .15s;
}
.day-summary:hover::after { color: var(--text); }
.day-card[open] > .day-summary::after { transform: rotate(90deg); }
.day-card:not([open]) > .day-summary { border-bottom: none; }

/* Badge line above the teams: holds the Top-25 pill and/or one pill per favorite conference. */
.game-badges { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-bottom: 6px; }
/* Team name may shrink and ellipsize so a long name + rank chip never overflows into the
   adjacent team / score (the logo and chips stay fixed via flex:none). */
.game-team-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.game-logo { width: 22px; height: 22px; object-fit: contain; flex: none; }
/* Stat-leaders team cell: logo + short name inline (mirrors the NCAA stat pages). */
.team-cell .leader-logo { width: 20px; height: 20px; object-fit: contain; flex: none;
  vertical-align: middle; margin-right: 6px; }
.game-score { font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
/* Finished game whose box score stats.ncaa.org hasn't posted yet — muted, not a bold score. */
.game-score.pending { font-weight: 600; color: var(--text-dim); text-decoration: none; }
a.game-score.pending:hover { text-decoration: underline; }
.game-sets { font-size: 12px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.game-time { font-size: 13px; white-space: nowrap; }
.game-date { white-space: nowrap; font-weight: 600; }
/* An upcoming game's time doubles as a link to its NCAA.com game page (live score until we scrape
   the final). Keep it looking like the plain time — the ↗ signals it's a link. */
a.game-time.ncaa-link { color: inherit; text-decoration: none; }
a.game-time.ncaa-link:hover { color: var(--accent); text-decoration: underline; }
/* Played games get a small NCAA.com jump under the set scores. */
a.game-ncaa.ncaa-link { font-size: 11px; text-decoration: none; }
a.game-ncaa.ncaa-link:hover { color: var(--accent); text-decoration: underline; }
.gh-ncaa { text-align: center; margin-top: 10px; font-size: 13px; }
.gh-venue { text-align: center; margin-top: 8px; font-size: 12px; }
.sched-opp .fav-star { flex: none; }

/* --- top-25 vs top-25 "ranked matchup" pill (scoreboard) --- */
.matchup-badge {
  flex: none; font-size: 10px; font-weight: 800; text-transform: uppercase; letter-spacing: .3px;
  line-height: 1; padding: 3px 6px; border-radius: 5px; white-space: nowrap;
  color: #fff; background: var(--accent);
}
/* Favorite-conference pill — only shown under the "Favorite conferences" filter. A distinct color
   from the accent Top-25 badge; both can appear together on the badge line. */
.conf-badge {
  flex: none; font-size: 10px; font-weight: 800; text-transform: uppercase; letter-spacing: .3px;
  line-height: 1; padding: 3px 6px; border-radius: 5px; white-space: nowrap;
  color: #fff; background: #6d4bd8;
}
/* Count of the user's favorite players in a game — only under the "Favorite players" filter. */
.player-badge {
  flex: none; font-size: 10px; font-weight: 800; text-transform: uppercase; letter-spacing: .3px;
  line-height: 1; padding: 3px 6px; border-radius: 5px; white-space: nowrap;
  color: #fff; background: #1f9d55;
}
/* Static (non-clickable) favorite marker on the scoreboard — gold ★, distinct from the Top 25 badge. */
.fav-mark { flex: none; color: #f2b705; font-size: 13px; line-height: 1; }

/* Broadcaster tags, upper-right of a game card — in the reserved .game-badges band, opposite the
   left-aligned Top-25 / favorite badges. Logos ride a white chip so full-color/dark broadcaster
   wordmarks read on either theme; unknown nets degrade to a bordered text pill. */
.game-card { position: relative; }
.gc-networks { position: absolute; top: 7px; right: 10px; display: flex; align-items: center;
  gap: 5px; flex-wrap: wrap; justify-content: flex-end; max-width: 58%; pointer-events: none; }
.gc-networks > * { pointer-events: auto; }
.net-logo { height: 16px; width: auto; max-width: 62px; object-fit: contain; display: block;
  border-radius: 3px; box-shadow: 0 0 0 1px rgba(0,0,0,.08); }
.net-tag { flex: none; font-size: 10px; font-weight: 800; letter-spacing: .2px; line-height: 1;
  padding: 3px 6px; border-radius: 5px; white-space: nowrap; color: var(--text);
  background: var(--bg-elev2); border: 1px solid var(--border); }
.net-tag.net-more { font-weight: 700; color: var(--text-dim); }
@media (max-width: 720px) {
  .gc-networks { gap: 4px; max-width: 52%; }
  .net-logo { height: 13px; max-width: 44px; }
  .net-tag { font-size: 9px; padding: 2px 5px; }
}

/* --- AVCA Coaches Poll rank chip --- */
.rank-chip {
  flex: none; font-size: 11px; font-weight: 700; font-variant-numeric: tabular-nums;
  line-height: 1; padding: 2px 5px; border-radius: 5px; white-space: nowrap; margin-left: 5px;
  color: var(--accent); background: color-mix(in srgb, var(--accent) 15%, transparent);
}
.gh-name .rank-chip { margin-left: 5px; vertical-align: middle; }

/* Informational tag for opponents with no D1 team record (D2/D3/NAIA) — muted, not celebratory. */
.nd1-tag {
  flex: none; font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .3px;
  line-height: 1; padding: 2px 5px; border-radius: 5px; white-space: nowrap; margin-left: 5px;
  color: var(--text-dim); background: color-mix(in srgb, var(--text-dim) 14%, transparent);
}

/* --- box-score header: compact single row (name/record · logo · score · Final · score · logo · name/record) --- */
.gh-date { text-align: center; font-size: 12px; margin-bottom: 6px; }
.game-header .gh-grid {
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 18px; margin: 2px 0;
}
.gh-side { display: flex; align-items: center; gap: 12px; min-width: 0; }
.gh-side.away { justify-content: flex-end; }
.gh-side.home { justify-content: flex-start; }
.gh-info { min-width: 0; }
.gh-side.away .gh-info { text-align: right; }
.gh-side.home .gh-info { text-align: left; }
.gh-name { font-size: 16px; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gh-record { font-size: 12px; font-style: italic; color: var(--muted); font-variant-numeric: tabular-nums; }
.gh-logo-wrap { flex: 0 0 auto; display: flex; align-items: center; justify-content: center; }
.gh-logo { height: 60px; width: 60px; object-fit: contain; }
.gh-scores { display: flex; align-items: center; gap: 12px; }
.gh-score { font-size: 30px; font-weight: 800; line-height: 1; font-variant-numeric: tabular-nums; color: var(--text-dim); }
.gh-score.win { color: var(--text); }
.gh-final { background: var(--accent); color: #fff; font-size: 12px; font-weight: 800;
  padding: 4px 12px; border-radius: 999px; letter-spacing: .2px; }
.gh-vs { font-size: 16px; }
@media (max-width: 720px) {
  .game-header .gh-grid { gap: 8px; align-items: start; }
  .gh-side { flex-direction: column; gap: 6px; text-align: center; }
  .gh-side.away { flex-direction: column-reverse; }
  .gh-side .gh-info { text-align: center; }
  .gh-name { white-space: normal; }
  .gh-scores { padding-top: 14px; }        /* pull the scores up toward the logos' center */
  .gh-logo { height: 54px; width: 54px; }
}
.line-score { min-width: max-content; margin-top: 8px; }
.line-score th, .line-score td { text-align: center; padding: 4px 10px; }
.line-score td.l, .line-score th.l { text-align: left; }

/* --- team schedule & results (collapsible sections) --- */
.sched-subhead {
  font-size: 11px; text-transform: uppercase; letter-spacing: .5px; color: var(--text-dim);
  margin: 12px 0 4px;
}
.sched-section > summary {
  cursor: pointer; list-style: none; display: flex; align-items: center; gap: 6px;
  padding: 6px 14px; background: var(--bg-elev2); border-radius: 6px;
}
.sched-section > summary:hover { color: var(--text); }
.sched-section > summary::-webkit-details-marker { display: none; }
.sched-section > summary::before {
  content: "▸"; font-size: 20px; line-height: 1; color: var(--text-dim); transition: transform .15s;
}
.sched-section[open] > summary::before { transform: rotate(90deg); }
.sched-count { text-transform: none; letter-spacing: 0; font-weight: 400; }
.sched-list { display: flex; flex-direction: column; }
.sched-row {
  display: flex; align-items: center; gap: 10px;
  padding: 7px 14px; border-top: 1px solid var(--border);
}
.sched-list .sched-row:first-child { border-top: none; }
.sched-row.clickable { cursor: pointer; border-radius: 6px; }
.sched-row.clickable:hover { background: var(--row-hover); }
.sched-date { font-size: 13px; min-width: 92px; flex: none; }
.sched-opp { flex: 1; min-width: 0; }
.sched-logo { width: 20px; height: 20px; object-fit: contain; flex: none; vertical-align: middle; margin: 0 6px 0 2px; }
.sched-time { font-size: 13px; }
.sched-sets { font-size: 12px; font-variant-numeric: tabular-nums; white-space: nowrap; flex: none; }
.sched-score { font-variant-numeric: tabular-nums; font-weight: 600; min-width: 34px; text-align: right; }
.result { font-weight: 800; width: 18px; text-align: center; flex: none; }
.result.win { color: var(--good); }
.result.loss { color: var(--bad); }

/* Scouting tab — headline percentile callout chips + prose sections. */
.scout-chips {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
  gap: 8px;
  margin-bottom: 12px;
}
.scout-chip {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-left: 3px solid var(--sep);
  border-radius: var(--radius);
  padding: 8px 10px;
}
.scout-chip.good { border-left-color: var(--good); }
.scout-chip.bad { border-left-color: var(--bad); }
.scout-chip.mid { border-left-color: var(--accent); }
.scout-chip-val { font-size: 18px; font-weight: 700; font-variant-numeric: tabular-nums; }
.scout-chip-label { font-size: 11px; color: var(--text-dim); margin-top: 1px; }
.scout-chip-pct { font-size: 11px; color: var(--text-dim); font-variant-numeric: tabular-nums; }
.scout-body { padding: 12px 14px; }
.sr-section-label { font-size: 11px; font-weight: 600; text-transform: uppercase;
  letter-spacing: 0.05em; margin: 12px 0 6px; }
.sr-chips { margin-bottom: 4px; }
.scout-chip-card { padding-bottom: 4px; padding-top: 4px; }
.scout-chip-row { display: flex; flex-wrap: wrap; gap: 0; align-items: flex-start; }
.scout-chip-col { flex: 0 0 auto; padding: 0 28px 8px 24px; }
.scout-chip-col--sep { border-left: 1px solid var(--sep); }
.scout-col-label { font-size: 10px; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.07em; margin-bottom: 8px; }
/* Compact chips flow horizontally and wrap, with smaller value text */
.scout-chips--compact { display: flex; flex-wrap: wrap; gap: 8px; }
.scout-chips--compact .scout-chip { min-width: 90px; }
.scout-chips--compact .scout-chip-val { font-size: 15px; }
.sr-table { width: 100%; border-collapse: collapse; font-size: 13px; margin-top: 8px; }
.sr-th-label { width: 38%; }
.sr-th { text-align: center; font-size: 11px; font-weight: 600; text-transform: uppercase;
  letter-spacing: 0.04em; color: var(--text-dim); padding: 4px 8px 8px; width: 31%; }
.sr-tbl-label { color: var(--text-dim); font-size: 12px; padding: 7px 8px; cursor: default;
  border-bottom: 1px solid var(--sep); }
.sr-tbl-val, .sr-tbl-empty { text-align: center; padding: 7px 8px;
  border-bottom: 1px solid var(--sep); border-left: 1px solid var(--sep); }
.sr-tbl-num { font-weight: 600; font-variant-numeric: tabular-nums; }
.sr-tbl-pct { display: block; font-size: 10px; color: var(--text-dim); margin-top: 1px; }
.sr-tbl-val.good .sr-tbl-num { color: var(--good); }
.sr-tbl-val.bad  .sr-tbl-num { color: var(--bad); }
.sr-tbl-empty { color: var(--text-dim); }
.scout-para { margin: 0 0 10px; line-height: 1.5; }
.scout-para:last-child { margin-bottom: 0; }

/* --- scouting: projected-result scoreline bar --- */
.scout-proj-sub { padding: 0 14px; font-size: 12px; color: var(--text-dim); margin-top: -4px; }
.scout-scoreline-bar {
  display: flex; height: 26px; margin: 10px 14px 14px; border-radius: 6px; overflow: hidden;
  background: var(--surface-2, #222); font-variant-numeric: tabular-nums;
}
.scout-seg {
  display: flex; align-items: center; justify-content: center; min-width: 0;
  font-size: 11px; font-weight: 700; color: #fff; white-space: nowrap; overflow: hidden;
}
.scout-seg.win { background: var(--good); }
.scout-seg.loss { background: var(--bad); }
.scout-seg.win:nth-child(2) { opacity: 0.82; }
.scout-seg.win:nth-child(3) { opacity: 0.64; }
.scout-seg.loss:nth-child(4) { opacity: 0.64; }
.scout-seg.loss:nth-child(5) { opacity: 0.82; }

/* --- scouting: per-rotation table --- */
.scout-rot-table { width: calc(100% - 28px); margin: 8px 14px 14px; border-collapse: collapse; }
.scout-rot-table th, .scout-rot-table td {
  padding: 5px 8px; text-align: right; font-variant-numeric: tabular-nums; font-size: 13px;
  border-bottom: 1px solid var(--border, #333);
}
.scout-rot-table th { color: var(--text-dim); font-weight: 600; }
.scout-rot-table td:first-child, .scout-rot-table th:first-child { text-align: left; }
.scout-rot-table tr.best td { background: color-mix(in srgb, var(--good) 16%, transparent); }
.scout-rot-table tr.worst td { background: color-mix(in srgb, var(--bad) 16%, transparent); }

/* --- multi-model rankings: team rank cards + Rankings-tab attribution --- */
/* Equal-width cards: every grid track is 1fr, so all rank cards render identically sized. */
.rank-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(64px, 1fr)); gap: 8px; margin-top: 12px; }
.rank-card {
  display: flex; flex-direction: column; align-items: center; gap: 1px;
  padding: 6px 10px; border: 1px solid var(--border); border-radius: 8px;
  background: var(--bg-elev2); text-decoration: none; color: var(--text); cursor: pointer;
}
.rank-card:hover { border-color: var(--accent); }
.rank-card-model { font-size: 10px; text-transform: uppercase; letter-spacing: .4px; color: var(--text-dim); }
.rank-card-rank { font-size: 18px; font-weight: 700; }
.rank-card-rating { font-size: 11px; color: var(--text-dim); }
/* Compact team-header meta line (Conference · Record (conf) · Streak) replacing stacked facts. */
.team-meta { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px; font-size: 14px; margin-top: 4px; }
.team-meta .meta-bit { font-weight: 600; color: var(--text); }
.team-meta .meta-sep { color: var(--text-dim); }
/* Collapsible rankings section: a lightweight toggle row that expands to the rank cards.
   Toggle gets a comfortable tap height + a clearly-sized chevron (small glyphs are easy to miss). */
.rank-collapse { margin-top: 10px; }
.rank-toggle { display: flex; align-items: center; gap: 8px; width: 100%; min-height: 36px;
  background: none; border: none; padding: 4px 0; cursor: pointer; color: var(--text); font: inherit; text-align: left; }
.rank-toggle .chev { width: 18px; font-size: 17px; line-height: 1; color: var(--text-dim); }
.rank-toggle:hover .chev { color: var(--text); }
.rank-toggle-label { font-weight: 700; }
.rank-teaser { font-size: 13px; }
.rank-collapse .rank-cards { margin-top: 8px; }
/* Favorite is a star in the team card's upper-right corner. */
.team-fav-corner { position: absolute; top: 10px; right: 12px; z-index: 1; }
.team-fav-corner .fav-star { font-size: 24px; line-height: 1; padding: 0; }
.rankings-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.rankings-header .card-title { margin: 0; }
.rankings-controls { display: flex; align-items: center; gap: 8px; }
.rankings-controls select { font-size: 13px; padding: 5px 8px; height: 32px; box-sizing: border-box; }
.rankings-search { font-size: 13px; padding: 5px 10px; height: 32px; box-sizing: border-box; border: 1px solid var(--border); border-radius: 6px;
  background: var(--bg); color: var(--text); width: 180px; }
.rankings-search:focus { outline: none; border-color: var(--accent); }
.rankings-attribution { margin: 8px 0 12px; font-size: 12px; padding-left: 12px; }
.rankings-updated { font-size: 11px; }
.rankings-models { margin-top: 4px; flex-wrap: wrap; }

/* Rankings table scroll: slightly larger offset than generic fit-scroll (260px) because the
   rankings card has a model-toggle row + attribution text inside the card. */
.rankings-fit { overflow: auto; max-height: calc(100vh - 300px); }

/* --- Rankings tab table: compact, unfrozen, fits mobile width --- */
.rankings-table .conf-col {
  max-width: 90px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
@media (max-width: 720px) {
  .rankings-table .conf-col { max-width: 58px; }
  .rankings-table th, .rankings-table td { padding-left: 6px; padding-right: 6px; }
}

/* --- Live game view: StatBroadcast-style header + play-by-play feed --- */
.live-header .lh-grid { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 12px; padding: 14px; }
.lh-side { display: flex; flex-direction: column; align-items: center; gap: 4px; text-align: center; min-width: 0; }
.lh-logo { height: 56px; width: 56px; object-fit: contain; }
.lh-name { font-weight: 700; font-size: 15px; max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
.lh-sets { font-size: 12px; }
.lh-serving { font-size: 11px; font-weight: 700; color: var(--good); letter-spacing: .03em; }
.lh-mid { display: flex; flex-direction: column; align-items: center; gap: 2px; }
.lh-scores { display: flex; align-items: baseline; gap: 8px; }
.lh-score { font-size: 40px; font-weight: 800; font-variant-numeric: tabular-nums; line-height: 1; }
.lh-vs { color: var(--text-dim); font-size: 20px; }
.lh-setlabel { font-size: 12px; font-weight: 700; color: var(--text-dim); letter-spacing: .05em; text-transform: uppercase; }

.pbp-feed { display: flex; flex-direction: column; }
.pbp-row { display: grid; grid-template-columns: 26px 50px 1fr; align-items: center; gap: 10px; padding: 7px 14px; border-top: 1px solid var(--border); }
.pbp-row:first-child { border-top: none; }
.pbp-nonscore { opacity: .65; }
.pbp-pt { display: flex; justify-content: center; }
.pbp-logo { height: 20px; width: 20px; object-fit: contain; }
.pbp-score { font-weight: 700; font-variant-numeric: tabular-nums; font-size: 13px; color: var(--text-dim); }
.pbp-text { display: flex; align-items: center; gap: 8px; min-width: 0; }
.pbp-sentence { font-size: 13px; }
.pbp-badge { flex: 0 0 auto; font-size: 10px; font-weight: 700; letter-spacing: .04em; padding: 1px 6px; border-radius: 4px; background: var(--bg-elev2); color: var(--text-dim); }
.pbp-kill, .pbp-ace { background: rgba(79, 180, 119, .18); color: var(--good); }
.pbp-block { background: rgba(88, 166, 255, .18); color: #58a6ff; }
.pbp-badge[class*="error"] { background: rgba(248, 81, 73, .16); color: #f85149; }

@media (max-width: 640px) {
  .live-header .lh-grid { gap: 6px; padding: 12px 8px; }
  .lh-logo { height: 44px; width: 44px; }
  .lh-name { font-size: 13px; }
  .lh-score { font-size: 32px; }
}

/* Hidden stat glossary (#glossary) — reference screen, not in the nav. */
.glossary { max-width: 900px; margin: 0 auto; padding: 4px 2px 40px; }
.glossary h1 { margin: 8px 0 4px; }
.glossary h2 {
  margin: 26px 0 6px; padding-bottom: 4px; font-size: 1.05rem;
  color: var(--accent); border-bottom: 1px solid var(--border);
}
.glossary .glossary-note { font-size: .86rem; margin: 4px 0 10px; }
.glossary-table { width: 100%; border-collapse: collapse; table-layout: fixed; }
.glossary-table th, .glossary-table td {
  text-align: left; vertical-align: top; padding: 7px 10px;
  border-bottom: 1px solid var(--border); font-size: .9rem;
  white-space: normal; overflow-wrap: anywhere;
}
.glossary-table th { width: 170px; color: var(--text); font-weight: 600; }
.glossary-table td { color: var(--text-dim); }
@media (max-width: 560px) {
  .glossary-table, .glossary-table tbody, .glossary-table tr,
  .glossary-table th, .glossary-table td { display: block; width: auto; }
  .glossary-table th { border-bottom: none; padding-bottom: 0; }
  .glossary-table td { padding-top: 2px; border-bottom: 1px solid var(--border); }
}

/* Sortable table headers — all tables (Teams, Rankings, roster, clutch, RAPM). */
thead th.sort-th { cursor: pointer; user-select: none; white-space: nowrap; }
thead th.sort-th:hover { color: var(--accent); }
thead th.sort-active { color: var(--accent); }
/* Legacy wide-table aliases kept for any existing HTML that still uses them. */
.wide-table th.sorted { color: var(--accent); }

/* --- Advanced stats eye-test screen (#advanced) --- */
.adv-sticky-bar { margin-bottom: 8px; }
.adv-controls { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.adv-label { display: flex; align-items: center; gap: 5px; font-size: 13px; color: var(--text-dim); }
.adv-sel, .adv-input { background: var(--bg-elev2); border: 1px solid var(--border); color: var(--text);
  border-radius: 4px; padding: 4px 8px; font-size: 13px; }
.adv-input-sm { width: 60px; }
.adv-wrap { overflow-x: auto; }   /* horizontal scroll only — page scrolls vertically (no double bar) */
.adv-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.adv-table th, .adv-table td { padding: 4px 8px; border-bottom: 1px solid var(--border); white-space: nowrap; }
.adv-table th { background: var(--bg-elev2); font-weight: 600; color: var(--text-dim); }
.adv-table td.left { text-align: left; }
.adv-table td.adv { font-variant-numeric: tabular-nums; font-weight: 600; }
.adv-table td.comp { font-variant-numeric: tabular-nums; color: var(--text-dim); }
.adv-table td.good { color: var(--good); }
.adv-table td.bad { color: var(--bad); }
.adv-table th.adv, .adv-table th.comp { border-left: 2px solid var(--border); }
.adv-table td.adv, .adv-table td.comp { border-left: 1px solid var(--border-light, #2a2a2a); }
.page-title { font-size: 20px; font-weight: 700; margin: 0 0 6px; }

/* --- Player Stats page (#player-stats) --- */
.ps-card { margin-bottom: 12px; }
/* Traditional stats */
.ps-trad-body { padding: 10px 14px; }
.ps-view-toggle { display: flex; gap: 6px; margin-bottom: 10px; }
.ps-view-btn { background: var(--bg-elev2); border: 1px solid var(--border); color: var(--text-dim);
  border-radius: 4px; padding: 3px 10px; font-size: 12px; cursor: pointer; }
.ps-view-btn.active { background: var(--accent); color: #fff; border-color: var(--accent); }
.ps-stat-table { border-collapse: collapse; font-size: 12px; font-variant-numeric: tabular-nums; }
.ps-stat-table th, .ps-stat-table td { padding: 5px 10px; border-bottom: 1px solid var(--border);
  text-align: right; white-space: nowrap; }
.ps-stat-table th { background: var(--bg-elev2); color: var(--text-dim); font-weight: 600; }
.ps-stat-table td:first-child, .ps-stat-table th:first-child { text-align: left; }
/* Advanced */
.ps-adv-body { padding: 10px 14px; }
.ps-adv-summary { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }
.ps-adv-pill { background: var(--bg-elev2); border-radius: 6px; padding: 8px 12px; min-width: 100px; }
.ps-adv-pill-val { font-size: 18px; font-weight: 700; }
.ps-adv-pill-label { font-size: 11px; color: var(--text-dim); margin: 2px 0; }
.ps-badge { font-size: 10px; font-weight: 700; border-radius: 4px; padding: 1px 5px;
  text-transform: uppercase; letter-spacing: .04em; }
.ps-badge.good { background: color-mix(in srgb, var(--good) 18%, transparent); color: var(--good); }
.ps-badge.bad  { background: color-mix(in srgb, var(--bad)  18%, transparent); color: var(--bad);  }
.ps-badge.mid  { background: color-mix(in srgb, var(--accent) 18%, transparent); color: var(--accent); }
/* Four factors */
.ps-ff-body, .ps-split-body { padding: 10px 14px; overflow-x: auto; }

/* --- Player IMPACT card (player detail page) --- */
.player-adv-card { margin-bottom: 12px; }
.card-body { padding: 10px 14px 14px; }
.card-title-sub { font-size: 13px; font-weight: 400; }
.clutch-delta { font-size: 11px; margin-top: 3px; font-weight: 600; }
.clutch-delta.clutch-good { color: var(--good); }
.clutch-delta.clutch-bad { color: var(--bad); }
.clutch-footer { font-size: 11px; margin-top: 8px; }
.lb-page-nav { display: flex; align-items: center; justify-content: space-between;
  padding: 10px 0 2px; }
.lb-page-btn { font-size: 12px; padding: 4px 10px; }
.lb-page-info { font-size: 12px; }
.player-adv-body { padding: 12px 14px; }
.player-adv-summary { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 18px; }
.player-adv-pill { padding: 10px 16px; border-radius: 8px; min-width: 130px;
  border-left: 4px solid transparent; background: var(--bg-elev2); }
.player-adv-pill.good { border-left-color: var(--good); }
.player-adv-pill.bad  { border-left-color: var(--bad); }
.player-adv-pill.mid  { border-left-color: var(--accent); }
.player-adv-pill-val  { font-size: 22px; font-weight: 700; font-variant-numeric: tabular-nums; }
.player-adv-pill-label { font-size: 11px; color: var(--text-dim); margin-top: 2px; text-transform: uppercase; letter-spacing: .04em; }
.player-adv-pill-sub   { font-size: 11px; color: var(--text-dim); margin-top: 1px; }
.player-adv-comps { display: grid; grid-template-columns: 80px 1fr 2px 1fr 52px; gap: 6px 0; align-items: center; }
.player-adv-comp-label { font-size: 12px; font-weight: 600; white-space: nowrap; padding-right: 10px; }
/* Diverging bar: negative half right-aligns its bar, positive half left-aligns */
/* Half-wrap: flex row containing the bar-track + optional overflow dot beside it. */
.player-adv-half-wrap { display: flex; align-items: center; min-width: 0; }
.player-adv-half { height: 10px; flex: 1; display: flex; overflow: hidden; background: var(--bg-elev2); }
.player-adv-half.neg { border-radius: 4px 0 0 4px; justify-content: flex-end; }
.player-adv-half.pos { border-radius: 0 4px 4px 0; justify-content: flex-start; }
.player-adv-zero { width: 2px; background: var(--text-dim); opacity: 0.35; height: 14px; align-self: center; flex-shrink: 0; }
.player-adv-bar { height: 100%; min-width: 2px; transition: width .25s ease; }
.player-adv-bar.good { background: var(--good); }
.player-adv-bar.bad  { background: var(--bad); }
/* Scale label: inline beside the component name. */
.player-adv-scale-label { font-size: 9px; opacity: 0.55; font-weight: 400; margin-left: 4px; }
/* Pulsing overflow dot: appears beside the bar track when a player exceeds the scale. */
.adv-overflow-dot {
  width: 9px; height: 9px; border-radius: 50%; flex-shrink: 0;
}
.adv-overflow-dot.pos-dot { margin-left: 4px; }
.adv-overflow-dot.neg-dot { margin-right: 4px; }
.adv-overflow-dot.good { background: var(--good); animation: adv-pulse-good 1.4s ease-out infinite; }
.adv-overflow-dot.bad  { background: var(--bad);  animation: adv-pulse-bad  1.4s ease-out infinite; }
@keyframes adv-pulse-good { 0%{box-shadow:0 0 0 0 color-mix(in srgb,var(--good) 60%,transparent)} 70%{box-shadow:0 0 0 6px transparent} 100%{box-shadow:0 0 0 0 transparent} }
@keyframes adv-pulse-bad  { 0%{box-shadow:0 0 0 0 color-mix(in srgb,var(--bad)  60%,transparent)} 70%{box-shadow:0 0 0 6px transparent} 100%{box-shadow:0 0 0 0 transparent} }
.player-adv-comp-val { font-size: 12px; font-variant-numeric: tabular-nums; text-align: right; font-weight: 600; padding-left: 8px; }
.player-adv-row { display: contents; cursor: default; }
.player-adv-note { font-size: 11px; margin-top: 12px; }
