/* ── Variables ── */
:root {
  --orange: #FF6900;
  --black: #000000;
  --white: #FFFFFF;

  /* Dark theme surfaces */
  --bg: #14171C;           /* page background */
  --surface: #1B1F26;      /* cards, panels, table summary rows */
  --surface-2: #232830;    /* table even-row stripe, hover surfaces */
  --surface-hover: #2B313B;

  /* Legacy names kept for compatibility with existing rules. Semantically now
     these point at dark-theme colors rather than the original light-theme ones. */
  --gray-dark: #E8EAED;    /* primary text (was #333333) */
  --gray-mid: #9BA4B4;     /* labels / meta text (was #888888) */
  --gray-light: #232830;   /* was #F5F5F5 — now surface-2 for stripes/hovers */
  --gray-border: #2A2F38;  /* was #E0E0E0 — now dark border */

  --font: system-ui, -apple-system, "Segoe UI", Helvetica, Arial, sans-serif;
}

/* ── Reset ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
body {
  font-family: var(--font);
  font-size: 14px;
  color: var(--gray-dark);
  background: var(--bg);
  /* Suppress phantom horizontal scrollbar from the .team-banner-strip
     full-bleed math (calc(50% - 50vw) crosses the vertical-scrollbar gutter). */
  overflow-x: hidden;
}
a { color: inherit; text-decoration: none; }
a:hover { color: var(--orange); }

/* ── Nav ── */
.navbar {
  background: var(--black);
  color: var(--white);
  position: sticky;
  top: 0;
  z-index: 100;
  border-bottom: 2px solid var(--orange);
}
.nav-row {
  max-width: 1400px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  padding: 0 16px;
}
.nav-row-top {
  gap: 16px;
  height: 48px;
}
.nav-logo {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 16px;
  font-weight: 700;
  color: var(--white);
  white-space: nowrap;
  letter-spacing: 0.5px;
  flex-shrink: 0;
}
.nav-logo:hover { color: var(--white); }
.nav-logo-icon {
  width: 22px;
  height: 22px;
  color: var(--orange);
  flex-shrink: 0;
}
.nav-logo-text { white-space: nowrap; }
.nav-tabs {
  display: flex;
  gap: 4px;
  justify-content: center;
  min-width: 0;
  padding: 0 16px;
  border-top: 1px solid rgba(255,255,255,0.12);
  background: var(--black);
}
.nav-tabs[hidden] { display: none; }

/* Wide: render tabs inline in the top row, push update+search to the right,
   hide the hamburger + collapsible panel. */
@media (min-width: 901px) {
  .nav-tabs-inline {
    display: flex;
    gap: 4px;
    align-items: stretch;
    height: 100%;
  }
  .nav-refresh { margin-left: auto; }
  .nav-toggle,
  #navTabs { display: none !important; }
}
@media (max-width: 900px) {
  .nav-tabs-inline { display: none; }
  .nav-logo { margin-right: auto; }
}
.nav-refresh {
  display: inline-flex;
  flex-direction: column;
  align-items: flex-end;
  line-height: 1.1;
  padding: 4px 10px;
  border-left: 1px solid rgba(255,255,255,0.15);
  border-right: 1px solid rgba(255,255,255,0.15);
  color: rgba(255,255,255,0.7);
  flex-shrink: 0;
}
.nav-refresh-label {
  font-size: 9px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: rgba(255,255,255,0.55);
}
.nav-refresh-date {
  font-size: 12px;
  font-weight: 600;
  color: var(--white);
  white-space: nowrap;
}
.nav-tab {
  color: rgba(255,255,255,0.75);
  padding: 14px 16px;
  font-size: 13px;
  font-weight: 500;
  border-bottom: 3px solid transparent;
  transition: color 0.15s, border-color 0.15s;
  white-space: nowrap;
}
.nav-tab:hover { color: var(--white); }
.nav-tab.active { color: var(--white); border-bottom-color: var(--orange); }
.nav-search { position: relative; flex-shrink: 0; }
.nav-search input {
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.25);
  border-radius: 4px;
  color: var(--white);
  font-size: 13px;
  padding: 6px 10px;
  width: 240px;
  outline: none;
}
.nav-search input::placeholder { color: rgba(255,255,255,0.45); }
.nav-search input:focus { border-color: var(--orange); background: rgba(255,255,255,0.12); }

/* Hamburger toggle button */
.nav-toggle {
  display: inline-flex;
  flex-direction: column;
  justify-content: center;
  gap: 4px;
  width: 32px;
  height: 32px;
  padding: 6px;
  background: transparent;
  border: 1px solid rgba(255,255,255,0.25);
  border-radius: 4px;
  cursor: pointer;
  flex-shrink: 0;
}
.nav-toggle:hover { border-color: var(--orange); }
.nav-toggle-bar {
  display: block;
  height: 2px;
  background: var(--white);
  border-radius: 1px;
  transition: transform 0.2s, opacity 0.2s;
}
.nav-toggle.open .nav-toggle-bar:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.nav-toggle.open .nav-toggle-bar:nth-child(2) { opacity: 0; }
.nav-toggle.open .nav-toggle-bar:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }
.nav-search-suggest {
  position: absolute;
  top: calc(100% + 4px);
  right: 0;
  min-width: 340px;
  max-width: 420px;
  max-height: 480px;
  overflow-y: auto;
  background: var(--surface);
  border: 1px solid var(--gray-border);
  border-radius: 6px;
  box-shadow: 0 6px 18px rgba(0,0,0,0.5);
  z-index: 1000;
}
.nss-section-label {
  padding: 8px 12px 4px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--gray-mid);
}
.nss-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 10px 14px;
  text-decoration: none;
  color: var(--gray-dark);
  font-size: 15px;
}
.nss-item:hover { background: var(--surface-hover); }
.nss-item img { width: 40px; height: 40px; object-fit: contain; border-radius: 50%; background: var(--surface-2); }
.nss-thumb-blank { width: 40px; height: 40px; display: inline-block; }
.nss-name { flex: 1; font-weight: 600; }
.nss-meta { color: var(--gray-mid); font-size: 13px; }
.nss-empty { padding: 16px 14px; font-size: 14px; color: var(--gray-mid); }

/* ── Layout ── */
.page-content { max-width: 1400px; margin: 0 auto; padding: 24px 16px; }
.section-title {
  font-size: 15px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  margin-bottom: 12px;
  padding-bottom: 6px;
  border-bottom: 2px solid var(--orange);
  color: var(--gray-dark);
}

/* ── Season dropdown ── */
.season-select {
  border: 1px solid var(--gray-border);
  border-radius: 4px;
  background: var(--surface);
  font-size: 13px;
  padding: 6px 10px;
  cursor: pointer;
  color: var(--gray-dark);
  font-family: var(--font);
  outline: none;
}
.season-select:focus { border-color: var(--orange); }
.season-select-sm { font-size: 11.7px; padding: 4px 8px; }
.filter-row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }

/* Dark-theme defaults for bare form controls so inline `style="border:1px solid #E0E0E0"`
   in templates doesn't leave visible white bars on the dark background. */
select, input[type=text], input[type=date] {
  background: var(--surface) !important;
  color: var(--gray-dark) !important;
  border-color: var(--gray-border) !important;
}
select option { background: var(--surface); color: var(--gray-dark); }

/* Table header with tooltip available. Dotted underline signals hoverable. */
.th-hint {
  text-decoration: underline dotted rgba(255,255,255,0.35);
  text-underline-offset: 2px;
}
.section-title-row {
  display: flex;
  align-items: center;
  gap: 12px;
}
.section-title-row-bar {
  border-bottom: 2px solid var(--orange);
  padding-bottom: 6px;
}
.section-title-plain {
  border-bottom: none;
  padding-bottom: 0;
  margin-bottom: 0;
}

/* ── Filter button ── */
.filter-btn {
  padding: 6px 14px;
  border: 1px solid var(--orange);
  border-radius: 4px;
  background: var(--orange);
  font-size: 13px;
  cursor: pointer;
  color: var(--white);
  font-family: var(--font);
}
.filter-btn:hover { opacity: 0.85; }

/* ── Tables ── */
.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.data-table thead th {
  background: var(--black);
  color: var(--white);
  padding: 8px 10px;
  text-align: center;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.4px;
  white-space: nowrap;
}
.data-table thead th:first-child { text-align: left; }
.data-table tbody tr:nth-child(even) { background: var(--surface-2); }
.data-table tbody tr:hover { background: rgba(255,105,0,0.12); }
.data-table td {
  padding: 5px 10px;
  text-align: center;
  border-bottom: 1px solid var(--gray-border);
  white-space: nowrap;
  vertical-align: middle;
}
.data-table td:first-child { text-align: left; }
.teams-list-table { table-layout: fixed; width: 100%; font-size: 12px; }
.teams-list-table th, .teams-list-table td { padding: 5px 4px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.teams-list-table th:nth-child(1), .teams-list-table td:nth-child(1) { width: 32px; }
.teams-list-table th:nth-child(2), .teams-list-table td:nth-child(2) { width: 16%; }
.data-table .summary-row td {
  font-weight: 700;
  background: var(--surface);
  border-top: 2px solid var(--gray-mid);
}
.data-table .bench-gap td { border-top: 2px dashed var(--gray-border); }
.data-table th.sortable-th {
  cursor: pointer;
  user-select: none;
  position: relative;
}
.data-table th.sortable-th:hover { background: rgba(255,105,0,0.15); }
.data-table th.sortable-th::after {
  content: "";
  display: inline-block;
  width: 0; height: 0;
  margin-left: 4px;
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  border-top: 4px solid rgba(255,255,255,0.25);
  vertical-align: middle;
}
.data-table th.sortable-th[data-sort-dir="asc"]::after {
  border-top: none;
  border-bottom: 4px solid var(--orange);
}
.data-table th.sortable-th[data-sort-dir="desc"]::after {
  border-top: 4px solid var(--orange);
}
.data-table .bench-divider td { border-top: 2px dashed var(--gray-border); padding-top: 12px; }
.sorted-col { background: rgba(255,105,0,0.08) !important; }

/* Vertical column dividers — subtle separator between every column to make
   wide tables (especially the Empirical group-headers) easier to scan. */
.data-table thead th,
.data-table tbody td { border-right: 1px solid var(--gray-border); }
.data-table thead th:last-child,
.data-table tbody td:last-child { border-right: none; }
/* Suppress column dividers around identity cells (Player + Team) site-wide.
   Body cells: any <td> that wraps a player-cell, player-thumb, or
   team-logo-sm has its right border removed AND the cell immediately
   preceding it has its right border removed (so neither side of the
   identity block shows a divider). The :has() selector handles bodies
   without needing a class on every template.
   Header cells: paired with an explicit .identity-col class for headers
   the templates mark up. */
.data-table tbody td:has(.player-cell),
.data-table tbody td:has(.player-thumb),
.data-table tbody td:has(.team-logo-sm) { border-right: none !important; }
.data-table tbody td:has(+ td .player-cell),
.data-table tbody td:has(+ td .player-thumb),
.data-table tbody td:has(+ td .team-logo-sm) { border-right: none !important; }
.data-table thead th.identity-col,
.data-table thead th.identity-col + th { border-right: none !important; }
/* Stronger divider bracketing event groups. .group-start = orange left
   border on the first leaf of a group; .group-end = orange right
   border on the last leaf. Together they wall off each event group.
   !important + 3px to ensure these win over the universal 1px column
   divider rule under border-collapse priority (heaviest border wins,
   but adjacent cells can collide; explicit win avoids ambiguity). */
.data-table th.group-start,
.data-table td.group-start { border-left: 3px solid var(--orange) !important; }
.data-table th.group-end,
.data-table td.group-end { border-right: 3px solid var(--orange) !important; }

/* Spanning group-header rule: any <th colspan="N"> in the thead is treated
   as a group header — give it an orange bottom border so the divide between
   the group label row and the sub-column row reads clearly. The leaf cells
   in the row immediately below get the matching orange top border. */
.data-table thead th[colspan] { border-bottom: 2px solid var(--orange) !important; }
.data-table thead tr + tr th { border-top: 2px solid var(--orange); }

/* Frozen identity column(s): keep the Player or Team column visible while
   the rest of a wide table scrolls horizontally. Requires the table's
   wrapper to be the scroll container (overflow-x:auto). The frozen cell
   needs an opaque background so scrolled cells don't bleed through.
   Header z-index sits above the body so vertically-sticky thead (if any)
   wins over horizontally-sticky body cells. */
.data-table.freeze-first thead tr:first-child th:first-child,
.data-table.freeze-first tbody td:first-child {
  position: sticky;
  left: 0;
  z-index: 2;
}
.data-table.freeze-first thead tr:first-child th:first-child { background: var(--black); z-index: 3; }
.data-table.freeze-first tbody tr:nth-child(odd)  td:first-child { background: var(--surface); }
.data-table.freeze-first tbody tr:nth-child(even) td:first-child { background: var(--surface-2); }
.data-table.freeze-first tbody tr:hover td:first-child { background: rgba(40, 25, 10, 0.96); }
.data-table.freeze-first .summary-row td:first-child { background: var(--surface); }

/* Freeze first TWO columns (e.g. /teams: logo + team-name). Both stick to
   the left edge; the second column's `left` offset must equal the first
   column's rendered width. Width is set by .teams-list-table (32px col1,
   16% col2) so this rule pairs with that sizing. */
/* Sticky thead rules scope to the first thead row so 2-row headers
   (e.g. game_detail box score with FGA/2 FGA group spans) don't pick up
   the freeze on row-2 sub-headers like FGM/FGA. The row-1 cells already
   span both rows via rowspan="2" in those templates. */
.data-table.freeze-first-two thead tr:first-child th:nth-child(1),
.data-table.freeze-first-two thead tr:first-child th:nth-child(2),
.data-table.freeze-first-two tbody td:nth-child(1),
.data-table.freeze-first-two tbody td:nth-child(2) {
  position: sticky;
  z-index: 2;
}
.data-table.freeze-first-two thead tr:first-child th:nth-child(1),
.data-table.freeze-first-two tbody td:nth-child(1) { left: 0; }
.data-table.freeze-first-two thead tr:first-child th:nth-child(2),
.data-table.freeze-first-two tbody td:nth-child(2) { left: 32px; }
.data-table.freeze-first-two thead tr:first-child th:nth-child(1),
.data-table.freeze-first-two thead tr:first-child th:nth-child(2) { background: var(--black); z-index: 3; }
.data-table.freeze-first-two tbody tr:nth-child(odd)  td:nth-child(1),
.data-table.freeze-first-two tbody tr:nth-child(odd)  td:nth-child(2) { background: var(--surface); }
.data-table.freeze-first-two tbody tr:nth-child(even) td:nth-child(1),
.data-table.freeze-first-two tbody tr:nth-child(even) td:nth-child(2) { background: var(--surface-2); }
.data-table.freeze-first-two tbody tr:hover td:nth-child(1),
.data-table.freeze-first-two tbody tr:hover td:nth-child(2) { background: rgba(40, 25, 10, 0.96); }
/* Summary / TEAM totals row — keep frozen-cell background opaque so the
   scrolling cells behind don't bleed through. */
.data-table.freeze-first-two tbody tr.summary-row td:nth-child(1),
.data-table.freeze-first-two tbody tr.summary-row td:nth-child(2) { background: var(--surface); }

/* Freeze Date + Opponent for game-log style tables. This is separate from
   freeze-first-two because those tables use a 32px logo column offset. */
.data-table.freeze-log-cols {
  --log-date-col: 104px;
  --log-opp-col: 132px;
}
.data-table.freeze-log-cols thead tr:first-child th:nth-child(1),
.data-table.freeze-log-cols thead tr:first-child th:nth-child(2),
.data-table.freeze-log-cols tbody td:nth-child(1),
.data-table.freeze-log-cols tbody td:nth-child(2) {
  position: sticky;
  z-index: 2;
}
.data-table.freeze-log-cols thead tr:first-child th:nth-child(1),
.data-table.freeze-log-cols tbody td:nth-child(1) {
  left: 0;
  width: var(--log-date-col);
  min-width: var(--log-date-col);
  max-width: var(--log-date-col);
}
.data-table.freeze-log-cols thead tr:first-child th:nth-child(2),
.data-table.freeze-log-cols tbody td:nth-child(2) {
  left: var(--log-date-col);
  width: var(--log-opp-col);
  min-width: var(--log-opp-col);
  max-width: var(--log-opp-col);
}
.data-table.freeze-log-cols thead tr:first-child th:nth-child(1),
.data-table.freeze-log-cols thead tr:first-child th:nth-child(2) {
  background: var(--black);
  z-index: 3;
}
.data-table.freeze-log-cols tbody tr:nth-child(odd) td:nth-child(1),
.data-table.freeze-log-cols tbody tr:nth-child(odd) td:nth-child(2) { background: var(--surface); }
.data-table.freeze-log-cols tbody tr:nth-child(even) td:nth-child(1),
.data-table.freeze-log-cols tbody tr:nth-child(even) td:nth-child(2) { background: var(--surface-2); }
.data-table.freeze-log-cols tbody tr:hover td:nth-child(1),
.data-table.freeze-log-cols tbody tr:hover td:nth-child(2) { background: rgba(40, 25, 10, 0.96); }

/* ── Player / Team inline display ── */
.player-cell { display: flex; align-items: center; gap: 10px; }
.player-thumb {
  width: 48px;
  height: 48px;
  object-fit: contain;
  object-position: bottom center;
  background: transparent;
  flex-shrink: 0;
  transition: transform 0.15s ease;
}
a:hover .player-thumb,
tr:hover .player-thumb {
  transform: scale(1.08);
}
.team-logo-sm {
  width: 28px;
  height: 28px;
  object-fit: contain;
  /* Subtle light halo so dark logos (e.g. Toronto bordeaux) read on dark rows. */
  filter: drop-shadow(0 0 3px rgba(255,255,255,0.35));
}
.team-logo-lg {
  width: 74px;
  height: 74px;
  object-fit: contain;
  filter: drop-shadow(0 0 6px rgba(255,255,255,0.35));
}
.flag-yes { color: #22a84a; font-weight: 700; }
.flag-no { color: #e03030; }

/* ── Score bug ──
   Background gradient uses --away-c1 / --home-c1 set inline per-page.
   Away color sits on the left (where the away team is), home on the right. */
.score-bug {
  --away-c1: #1A1F2B;
  --home-c1: #1A1F2B;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  background:
    linear-gradient(90deg,
      color-mix(in srgb, var(--away-c1) 72%, #000) 0%,
      #0A0C11 50%,
      color-mix(in srgb, var(--home-c1) 72%, #000) 100%);
  color: var(--white);
  border-radius: 8px;
  padding: 18px 24px;
  margin-bottom: 24px;
  min-height: 80px;
  overflow: hidden;
}
.score-bug-meta {
  position: absolute;
  top: 10px;
  left: 16px;
}
.score-bug .game-meta { font-size: 10px; color: rgba(255,255,255,0.5); line-height: 1.4; }
/* desktop score bug layout */
.sbd-layout { display: flex; flex-direction: column; align-items: center; width: 100%; gap: 5px; padding-top: 16px; }
.sbd-teams-row { display: flex; align-items: center; width: 100%; gap: 16px; }
.sbd-away { display: flex; align-items: center; gap: 12px; flex: 1; justify-content: flex-end; }
.sbd-home { display: flex; align-items: center; gap: 12px; flex: 1; justify-content: flex-start; }
.sbd-scores { display: flex; align-items: center; gap: 16px; flex-shrink: 0; }
.score-bug-note { font-size: 11px; color: rgba(255,255,255,0.45); text-align: center; padding-top: 4px; }
.sbm-layout { display: none; width: 100%; }
.score-bug .team-name { font-size: 18px; font-weight: 700; }
.score-bug .score { font-size: 36px; font-weight: 800; min-width: 44px; text-align: center; }
.score-bug .vs { color: rgba(255,255,255,0.4); font-size: 20px; }
/* mobile: swap layouts */
@media (max-width: 600px) {
  .sbd-layout { display: none; }
  .sbm-layout { display: block; width: 100%; padding-top: 4px; }
  .score-bug { padding: 32px 14px 14px; min-height: unset; }
  .score-bug .gc-score { color: var(--white); font-size: 22px; min-width: unset; }
  .score-bug .gc-team-name { color: var(--white); font-size: 14px; flex: unset; }
  .sbm-layout { text-align: center; }
  .sbm-layout .gc-team-row { gap: 8px; justify-content: center; }
  .sbm-layout .team-logo-sm { width: 36px; height: 36px; }
}

/* ── First events grid ── */
.first-events-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 12px;
  margin-bottom: 24px;
}
.fe-card {
  border: 1px solid var(--gray-border);
  border-radius: 6px;
  padding: 12px 14px;
}
.fe-card .fe-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  color: var(--gray-mid);
  letter-spacing: 0.4px;
  margin-bottom: 4px;
}
.fe-card .fe-player { font-size: 14px; font-weight: 600; }
.fe-card .fe-type { font-size: 12px; color: var(--orange); font-weight: 700; margin-top: 2px; }

/* ── Leaderboards (home page) — card-grid style ── */

/*
  First Event grid order:
  Big (3-col):   [shot] [make] [3]  /  [2h-shot] [2h-make] [2h-3]
  Mid (2-col):   [shot] [2h-shot]  /  [make] [2h-make]  /  [3] [2h-3]
  Mobile (1-col): shot, 2h-shot, make, 2h-make, 3, 2h-3
*/
.lb-section-grid {
  display: grid;
  gap: 16px;
  margin-bottom: 32px;
  /* default: 3 columns, natural order = shot/make/3 top row, 2h row below */
  grid-template-columns: repeat(3, 1fr);
}

/* card order at 3-col: keep natural dict order (shot=1,make=2,3=3,2h-shot=4,2h-make=5,2h-3=6) */
.lb-card[data-order="1"] { order: 1; }
.lb-card[data-order="2"] { order: 2; }
.lb-card[data-order="3"] { order: 3; }
.lb-card[data-order="4"] { order: 4; }
.lb-card[data-order="5"] { order: 5; }
.lb-card[data-order="6"] { order: 6; }

/* 2-col: pair shot↔2h-shot, make↔2h-make, 3↔2h-3 */
@media (max-width: 900px) {
  .lb-section-grid { grid-template-columns: repeat(2, 1fr); }
  .lb-card[data-order="1"] { order: 1; }
  .lb-card[data-order="4"] { order: 2; }
  .lb-card[data-order="2"] { order: 3; }
  .lb-card[data-order="5"] { order: 4; }
  .lb-card[data-order="3"] { order: 5; }
  .lb-card[data-order="6"] { order: 6; }
}

/* mobile: single column, same paired order */
@media (max-width: 520px) {
  .lb-section-grid { grid-template-columns: 1fr; }
  .lb-card[data-order="1"] { order: 1; }
  .lb-card[data-order="4"] { order: 2; }
  .lb-card[data-order="2"] { order: 3; }
  .lb-card[data-order="5"] { order: 4; }
  .lb-card[data-order="3"] { order: 5; }
  .lb-card[data-order="6"] { order: 6; }
}

/* shooting grid: 3 → 2 → 1, natural order */
.lb-section-grid-shoot {
  display: grid;
  gap: 16px;
  margin-bottom: 32px;
  grid-template-columns: repeat(3, 1fr);
}
@media (max-width: 900px) {
  .lb-section-grid-shoot { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 520px) {
  .lb-section-grid-shoot { grid-template-columns: 1fr; }
}

.lb-card {
  background: var(--surface);
  border: 1px solid var(--gray-border);
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}
.lb-card-header {
  padding: 10px 14px 8px;
  border-bottom: 2px solid var(--gray-border);
  background: var(--surface-2);
}
.lb-card-header-title {
  font-size: 13px;
  font-weight: 800;
  color: var(--orange);
  text-transform: uppercase;
  letter-spacing: 0.4px;
}
.lb-card-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 14px;
  border-bottom: 1px solid var(--gray-border);
  text-decoration: none;
  color: inherit;
  transition: background 0.1s;
}
.lb-card-row:last-child { border-bottom: none; }
.lb-card-row:hover { background: rgba(255,105,0,0.12); }
.lb-rank {
  font-size: 12px;
  font-weight: 800;
  color: var(--gray-mid);
  min-width: 14px;
  text-align: center;
}
.lb-team-logo {
  width: 22px !important;
  height: 22px !important;
  max-width: 22px !important;
  max-height: 22px !important;
  object-fit: contain;
  flex-shrink: 0;
  display: inline-block;
}
.lb-player-name {
  flex: 1;
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.lb-stat {
  font-size: 13px;
  font-weight: 700;
  color: var(--gray-dark);
  white-space: nowrap;
}
.lb-card-row.lb-empty-row {
  opacity: 0.3;
  cursor: default;
  pointer-events: none;
}

/* ── Team header ── */
.team-header {
  display: flex;
  align-items: center;
  gap: 20px;
  margin-bottom: 24px;
}
.team-header .team-info h1 { font-size: 26px; font-weight: 800; }
.team-header .team-info .abbrev { color: var(--gray-mid); font-size: 14px; margin-top: 2px; }

/* ── Player banner (dark hero on player detail) ──
   Background gradient uses --team-c1 and --team-c2 set inline per-page.
   Falls back to neutral slate/rust if no team colors are populated. */
.player-banner {
  --team-c1: #1A1F2B;
  --team-c2: #2A1910;
  position: relative;
  display: flex;
  align-items: stretch;
  gap: 28px;
  min-height: 240px;
  padding-left: 28px;
  padding-right: 28px;
  padding-top: 28px;
  background:
    linear-gradient(135deg,
      #0B0E13 0%,
      color-mix(in srgb, var(--team-c1) 80%, #000) 40%,
      color-mix(in srgb, var(--team-c2) 65%, #000) 100%);
  border-radius: 10px;
  color: var(--white);
  overflow: hidden;
}
.player-banner-team {
  position: absolute;
  top: 18px;
  left: 18px;
  width: 56px;
  height: 56px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  z-index: 1;
}
.player-banner-team img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 0 6px rgba(255,255,255,0.3));
}
.player-banner-headshot {
  width: 264px;
  height: 264px;
  object-fit: contain;
  object-position: bottom center;
  flex-shrink: 0;
  align-self: flex-end;
  margin-left: 72px;
}
/* Team banner: Patriots-style horizontal layout.
   Logo · identity · stats, all on one row, vertically centered.
   Stats row stays nowrap so pills stay horizontal at all wide widths. */
/* Wide-view: Patriots-style "2026 Season Stats" (title case, larger).
   Mobile keeps the default uppercase style from .player-banner-stats-label. */
.player-banner-info {
  min-width: 0;
  flex: 1;
  padding-top: 14px;
  padding-bottom: 24px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.player-banner-name {
  font-size: 32px;
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: 0.3px;
}
.player-banner-meta {
  margin-top: 6px;
  font-size: 15px;
  font-weight: 600;
  color: rgba(255,255,255,0.85);
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
}
.player-banner-injury { font-size: 11px; }
.player-banner-bio {
  margin-top: 4px;
  font-size: 12px;
  color: rgba(255,255,255,0.55);
}
.player-banner-stats-label {
  margin-top: 16px;
  margin-bottom: 8px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.8px;
  color: rgba(255,255,255,0.7);
}
.player-banner-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(92px, 1fr));
  gap: 10px;
  width: min(100%, 360px);
}
.pb-stat {
  min-width: 0;
  padding: 10px 16px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.16);
  border-radius: 6px;
  text-align: center;
}
.pb-stat-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: rgba(255,255,255,0.55);
}
.pb-stat-value {
  margin-top: 4px;
  font-size: 22px;
  font-weight: 800;
  color: var(--white);
  line-height: 1.1;
}
@media (max-width: 720px) {
  .player-banner {
    display: block;
    text-align: center;
    padding: 16px 16px 18px;
    min-height: 0;
  }
  .player-banner-team {
    position: absolute;
    top: 12px;
    left: 12px;
    width: 48px;
    height: 48px;
  }
  .player-banner-headshot {
    display: block;
    width: 198px;
    height: 198px;
    margin: 0 auto;
  }
  .player-banner-info { padding: 12px 0 0; }
  .player-banner-name { font-size: 26px; }
  .player-banner-meta { justify-content: center; }
  .player-banner-bio { text-align: center; }
  .player-banner-stats-label { text-align: center; }
  .player-banner-stats {
    grid-template-columns: repeat(3, minmax(72px, 1fr));
    width: min(100%, 360px);
    margin-left: auto;
    margin-right: auto;
  }
}

/* ── Player header (legacy, other pages) ── */
.player-header {
  display: flex;
  align-items: flex-start;
  gap: 20px;
  margin-bottom: 24px;
}
.player-header img.headshot { width: 92px; height: 92px; border-radius: 50%; object-fit: cover; }
.player-header .player-info h1 { font-size: 22px; font-weight: 800; }
.player-header .player-info .meta { color: var(--gray-mid); font-size: 13px; margin-top: 4px; }

/* ── Chart container ── */

/* Shot Profile chart block: shared by player and team detail pages. */
.shot-chart-block {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 0.8fr);
  gap: 24px;
  align-items: center;
  padding: 8px 12px;
  margin-bottom: 28px;
}
.chart-wrap {
  position: relative;
  height: 300px;
  width: 100%;
}
.shot-chart-block .chart-wrap {
  max-width: 720px;
  margin: 0 auto;
  min-width: 0;
}
.shot-chart-block .data-table {
  width: 100%;
  max-width: 720px;
  margin: 0 auto;
  font-size: 13px;
  min-width: 0;
}
.shot-chart-block > * { min-width: 0; }
.shot-chart-block .data-table th,
.shot-chart-block .data-table td {
  padding: 10px 14px;
}
@media (max-width: 900px) {
  .shot-chart-block {
    display: block;
    padding-left: 0;
    padding-right: 0;
  }
  .shot-chart-block .chart-wrap,
  .shot-chart-block .data-table {
    max-width: 100%;
    width: 100%;
  }
  .shot-chart-block .data-table {
    table-layout: fixed;
  }
  .shot-chart-block .data-table th,
  .shot-chart-block .data-table td {
    overflow-wrap: anywhere;
    white-space: normal;
  }
}
.shot-profile-block[hidden] {
  display: none !important;
}
.chart-empty-state {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--gray-mid);
  font-size: 14px;
  text-align: center;
  border: 1px dashed var(--gray-border);
  border-radius: 6px;
}

/* ── Roster + Games two-column ── */
.roster-games-grid {
  display: grid;
  grid-template-columns: minmax(0, 3fr) minmax(0, 2fr);
  gap: 24px;
  align-items: start;
  margin-bottom: 24px;
}
.roster-col,
.games-col {
  min-width: 0;
}
.roster-col [style*="overflow-x:auto"] .data-table,
.roster-col [style*="overflow-x: auto"] .data-table {
  width: 100%;
  min-width: 0;
}
.games-col .data-table {
  height: 100%;
  table-layout: fixed;
  width: 100%;
}
.games-col .data-table td,
.games-col .data-table th {
  padding-top: 14px;
  padding-bottom: 14px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.games-col .data-table th:nth-child(1),
.games-col .data-table td:nth-child(1) { width: 22%; }
.games-col .data-table th:nth-child(2),
.games-col .data-table td:nth-child(2) { width: 14%; text-align: center; }
.games-col .data-table th:nth-child(3),
.games-col .data-table td:nth-child(3) { width: 48%; white-space: normal; }
.games-col .data-table th:nth-child(4),
.games-col .data-table td:nth-child(4) { width: 16%; text-align: center; }
.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-top: 12px;
  font-size: 13px;
}
.pagination a {
  color: var(--orange);
  text-decoration: none;
  font-weight: 600;
}
.pagination a:hover {
  text-decoration: underline;
}
.pagination .disabled {
  color: rgba(255,255,255,0.25);
  font-weight: 600;
}
.pagination .page-info {
  color: var(--gray-mid);
}
@media (max-width: 900px) {
  .roster-games-grid {
    grid-template-columns: 1fr;
  }
}

/* ── Stat counters ── */
.stat-counters {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}
.header-counters {
  display: inline-grid;
  grid-auto-flow: column;
  gap: 8px;
}
.header-counters .stat-counter {
  min-width: 64px;
  padding: 6px 10px;
}
.header-counters .stat-counter-label {
  font-size: 10px;
}
.header-counters .stat-counter-value {
  font-size: 16px;
}
@media (max-width: 700px) {
  .stat-counters { grid-template-columns: repeat(2, 1fr); }
}
.stat-counter {
  padding: 14px 18px;
  border: 1px solid var(--gray-border);
  border-radius: 6px;
  background: var(--surface);
}
.stat-counter-label {
  font-size: 12px;
  color: var(--gray-mid);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.stat-counter-value {
  font-size: 24px;
  font-weight: 700;
  color: var(--orange, #FF6900);
  margin-top: 4px;
}

/* ────────────────────────────────────────
   Responsive — fluid shrink then mobile
   ──────────────────────────────────────── */

/* Tables inside scroll wrappers get a min-width so they don't compress — the wrapper scrolls */
/* Table scroll wrappers: keep horizontal scrolling available, but make the
   scrollbar quieter than the browser default. */
.table-scroll,
[style*="overflow-x:auto"]:has(> .data-table),
[style*="overflow-x: auto"]:has(> .data-table) {
  overflow-x: auto;
  overflow-y: hidden;
  padding-bottom: 4px;
  scrollbar-width: thin;
  scrollbar-color: rgba(185, 194, 206, 0.34) transparent;
}

.table-scroll:hover,
[style*="overflow-x:auto"]:has(> .data-table):hover,
[style*="overflow-x: auto"]:has(> .data-table):hover {
  scrollbar-color: rgba(255, 105, 0, 0.58) transparent;
}

.table-scroll::-webkit-scrollbar,
[style*="overflow-x:auto"]:has(> .data-table)::-webkit-scrollbar,
[style*="overflow-x: auto"]:has(> .data-table)::-webkit-scrollbar {
  height: 8px;
}

.table-scroll::-webkit-scrollbar-track,
[style*="overflow-x:auto"]:has(> .data-table)::-webkit-scrollbar-track,
[style*="overflow-x: auto"]:has(> .data-table)::-webkit-scrollbar-track {
  background: transparent;
}

.table-scroll::-webkit-scrollbar-thumb,
[style*="overflow-x:auto"]:has(> .data-table)::-webkit-scrollbar-thumb,
[style*="overflow-x: auto"]:has(> .data-table)::-webkit-scrollbar-thumb {
  background: rgba(185, 194, 206, 0.28);
  border: 2px solid transparent;
  border-radius: 999px;
  background-clip: content-box;
}

.table-scroll:hover::-webkit-scrollbar-thumb,
[style*="overflow-x:auto"]:has(> .data-table):hover::-webkit-scrollbar-thumb,
[style*="overflow-x: auto"]:has(> .data-table):hover::-webkit-scrollbar-thumb {
  background: rgba(255, 105, 0, 0.62);
  border: 2px solid transparent;
  background-clip: content-box;
}

.table-scroll .data-table,
[style*="overflow-x:auto"] .data-table,
[style*="overflow-x: auto"] .data-table {
  min-width: 480px;
  width: max-content;
}
/* Full-width variant: table fills parent, doesn't shrink to content */
.table-scroll .data-table.data-table-full,
[style*="overflow-x:auto"] .data-table.data-table-full,
[style*="overflow-x: auto"] .data-table.data-table-full {
  width: 100%;
}


/* Nav: shrink tab padding at mid-width. Two steps so 6 tabs (Games,
   Lineups, Empirical, Players, Teams, Tip Takers) stay on one line
   between ~1000px and the 720px breakpoint. */
@media (max-width: 1080px) {
  .nav-tab { padding: 14px 12px; }
}
@media (max-width: 900px) {
  .nav-tab { padding: 14px 10px; }
  .nav-refresh { padding: 4px 8px; }
}

@media (max-width: 720px) {
  .nav-row { padding: 0 10px; }
  .nav-row-top {
    gap: 10px;
    flex-wrap: wrap;
    height: auto;
    padding-top: 8px;
    padding-bottom: 10px;
  }
  .nav-logo-icon { width: 24px; height: 24px; }
  .nav-tabs {
    overflow-x: auto;
    justify-content: flex-start;
    scrollbar-width: none;
  }
  .nav-tabs::-webkit-scrollbar { display: none; }
  .nav-tab { padding: 14px 8px; font-size: 12px; white-space: nowrap; flex-shrink: 0; }
  .nav-refresh { padding: 3px 8px; }
  .nav-refresh-label { font-size: 8px; }
  .nav-refresh-date { font-size: 11px; }
  /* Search wraps to its own full-width row below the top chrome */
  .nav-row-top .nav-search {
    order: 99;
    flex: 1 0 100%;
  }
  .nav-search input { width: 100%; padding: 8px 12px; }
  .nav-search-suggest { left: 0; right: 0; max-width: none; }
}

/* Mobile breakpoint (≤ 600px) */
@media (max-width: 600px) {
  /* Page padding */
  .page-content { padding: 16px 10px; }

  /* Section titles smaller */
  .section-title { font-size: 13px; }

  /* Score bug stacks vertically */
  .score-bug { flex-direction: column; gap: 12px; padding: 14px 16px; text-align: center; }
  .score-bug .team-block { justify-content: center; }

  /* Game cards */
  .matchup-team { min-width: 0; }
  .game-card-header { flex-wrap: wrap; gap: 8px; }

  /* Player / team headers stack */
  .player-header { flex-direction: column; align-items: flex-start; gap: 12px; }
  .team-header { flex-direction: column; align-items: flex-start; gap: 12px; }

  /* Charts stack */
  .shot-chart-block { grid-template-columns: 1fr; }
  .chart-wrap { height: 220px; }

  /* Roster grid: 2 columns on mobile */
  .roster-grid { grid-template-columns: repeat(2, 1fr); }

  /* Filters wrap */
  .filter-bar { flex-wrap: wrap; gap: 8px; }
  .filter-bar select,
  .filter-bar input { width: 100%; }

  /* Images slightly smaller on mobile to save space */
  .player-thumb { width: 40px; height: 40px; }
  .team-logo-sm { width: 22px; height: 22px; }
  .team-logo-lg { width: 58px; height: 58px; }
  .player-header img.headshot { width: 72px; height: 72px; }
}

/* ── Games grid ── */
.games-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  align-items: start;
}
@media (max-width: 700px) {
  .games-grid { grid-template-columns: 1fr; }
}

/* ── Game cards ── */
.game-card {
  border: 1px solid var(--gray-border);
  border-radius: 6px;
  margin-bottom: 10px;
  overflow: hidden;
  background: var(--surface);
}
.game-card-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  cursor: pointer;
  user-select: none;
}
.game-card-header:hover { background: var(--gray-light); }
.game-card-body { padding: 12px 16px; border-top: 1px solid var(--gray-border); display: none; }
.game-card-body.open { display: block; }

/* Scheduled (future) game card — no expand, no scores, no first events. */
.game-card-scheduled { opacity: 0.85; }
.game-card-scheduled .game-card-header:hover { background: var(--surface); }
.scheduled-badge {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--gray-mid);
  border: 1px solid var(--gray-border);
  border-radius: 4px;
  padding: 3px 8px;
  white-space: nowrap;
  align-self: flex-start;
}
.matchup-team { display: flex; align-items: center; gap: 8px; min-width: 160px; }
.matchup-score { font-size: 20px; font-weight: 800; min-width: 36px; text-align: center; }
.gc-team-row { display: flex; align-items: center; gap: 10px; }
.gc-team-name { font-size: 14px; font-weight: 600; flex: 1; }
.gc-score { font-size: 20px; font-weight: 800; min-width: 32px; text-align: right; }
.game-type-badge {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  color: var(--gray-mid);
  margin-left: auto;
}
.more-info-btn {
  font-size: 11px;
  font-weight: 600;
  color: var(--white);
  background: var(--orange);
  border-radius: 4px;
  padding: 3px 8px;
  white-space: nowrap;
}
.more-info-btn:hover { opacity: 0.85; color: var(--white); }

/* ── Roster cards ── */
.roster-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 10px;
}
.roster-card {
  border: 1px solid var(--gray-border);
  border-radius: 6px;
  overflow: hidden;
  background: var(--surface);
}
.roster-card-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  cursor: pointer;
}
.roster-card-header:hover { background: var(--gray-light); }
.roster-card-body { padding: 10px 12px; border-top: 1px solid var(--gray-border); display: none; font-size: 12px; }
.roster-card-body.open { display: block; }
.roster-card-body .stat-row { display: flex; justify-content: space-between; padding: 3px 0; border-bottom: 1px solid var(--gray-border); }
.roster-card-body .stat-row:last-child { border-bottom: none; }
.roster-card-body .stat-label { color: var(--gray-mid); }
.roster-card-body .stat-val { font-weight: 600; }

/* ── Date picker ── */
.date-picker-wrap { margin-bottom: 20px; display: flex; align-items: center; gap: 10px; }
.date-picker-wrap input[type=date] {
  border: 1px solid var(--gray-border);
  border-radius: 4px;
  padding: 6px 10px;
  font-size: 13px;
  outline: none;
}
.date-picker-wrap input[type=date]:focus { border-color: var(--orange); }

/* ── Search results ── */
.search-section h2 { font-size: 14px; font-weight: 700; text-transform: uppercase; color: var(--gray-mid); margin: 16px 0 8px; }
.search-result-item { padding: 8px 0; border-bottom: 1px solid var(--gray-border); display: flex; align-items: center; gap: 10px; }

/* ── Two-column responsive grid ── */
.two-col-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 32px;
}
@media (max-width: 600px) {
  .two-col-grid { grid-template-columns: 1fr; gap: 20px; }
}

/* ── Game card first events (games list inline) ── */
.gc-fe-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}
/* small/mobile: 2 cols, paired Game↔2H per row */
@media (max-width: 600px) {
  .gc-fe-grid { grid-template-columns: repeat(2, 1fr); }
  .gc-fe-grid .gc-fe-item[data-order="1"] { order: 1; }
  .gc-fe-grid .gc-fe-item[data-order="4"] { order: 2; }
  .gc-fe-grid .gc-fe-item[data-order="2"] { order: 3; }
  .gc-fe-grid .gc-fe-item[data-order="5"] { order: 4; }
  .gc-fe-grid .gc-fe-item[data-order="3"] { order: 5; }
  .gc-fe-grid .gc-fe-item[data-order="6"] { order: 6; }
}
.gc-fe-item {
  border: 1px solid var(--gray-border);
  border-radius: 6px;
  padding: 8px 10px;
  background: var(--surface-2);
}
.gc-fe-label {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--orange);
  letter-spacing: 0.3px;
  margin-bottom: 3px;
}
.gc-fe-player { font-size: 12px; font-weight: 600; }
.gc-fe-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 4px 0;
  border-bottom: 1px solid var(--gray-border);
  font-size: 12px;
}
.gc-fe-row:last-of-type { border-bottom: none; }
.gc-fe-row-label { color: var(--gray-mid); font-weight: 600; font-size: 11px; }
.gc-fe-row-val { font-weight: 600; }

/* ── Game detail first events ── */
.gd-fe-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}
/* regular: shot/make/3 top row, 2h shot/make/3 bottom row — natural order 1-6 */
.gd-fe-grid .fe-card-lg[data-order="1"] { order: 1; }
.gd-fe-grid .fe-card-lg[data-order="2"] { order: 2; }
.gd-fe-grid .fe-card-lg[data-order="3"] { order: 3; }
.gd-fe-grid .fe-card-lg[data-order="4"] { order: 4; }
.gd-fe-grid .fe-card-lg[data-order="5"] { order: 5; }
.gd-fe-grid .fe-card-lg[data-order="6"] { order: 6; }
/* small/mobile: 2-col, paired shot↔2h shot, make↔2h make, 3↔2h 3 */
@media (max-width: 600px) {
  .gd-fe-grid { grid-template-columns: repeat(2, 1fr); }
  .gd-fe-grid .fe-card-lg[data-order="1"] { order: 1; }
  .gd-fe-grid .fe-card-lg[data-order="4"] { order: 2; }
  .gd-fe-grid .fe-card-lg[data-order="2"] { order: 3; }
  .gd-fe-grid .fe-card-lg[data-order="5"] { order: 4; }
  .gd-fe-grid .fe-card-lg[data-order="3"] { order: 5; }
  .gd-fe-grid .fe-card-lg[data-order="6"] { order: 6; }
}
.fe-card-lg {
  border: 1px solid var(--gray-border);
  border-radius: 8px;
  padding: 12px 14px;
  background: var(--surface-2);
  box-shadow: 0 1px 4px rgba(0,0,0,0.25);
}
.fe-card-lg-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--orange);
  letter-spacing: 0.4px;
  margin-bottom: 6px;
}
.fe-card-lg-outcome {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 4px;
}
.fe-card-lg-player {
  font-size: 14px;
  font-weight: 700;
  color: var(--gray-dark);
  display: block;
}
a.fe-card-lg-player:hover { color: var(--orange); }
.fe-card-lg-empty { color: var(--gray-mid); font-weight: 400; }
.gd-team-fe-header {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--gray-mid);
  letter-spacing: 0.4px;
  margin-bottom: 8px;
}
.gd-fe-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 0;
  border-bottom: 1px solid var(--gray-border);
  font-size: 13px;
}
.gd-fe-row:last-of-type { border-bottom: none; }
.gd-fe-row-label { color: var(--gray-mid); font-weight: 600; font-size: 11px; text-transform: uppercase; }
.gd-fe-row-val { font-weight: 600; }
a.gd-fe-row-val:hover { color: var(--orange); }
.gd-fe-row-empty { color: var(--gray-mid); font-weight: 400; }

/* ── Misc ── */
.mb-16 { margin-bottom: 16px; }
.mb-24 { margin-bottom: 24px; }
.placeholder-msg { padding: 60px 0; text-align: center; color: var(--gray-mid); font-size: 16px; }
.tag-orange { color: var(--orange); font-weight: 700; }

/* ── Tabs (team detail) ──
   Underline-only active style: text white when active with a 3px orange bar
   underneath; muted text when inactive. No filled chip, no top corners. */
.tabs {
  display: flex;
  gap: 24px;
  border-bottom: 1px solid var(--gray-border);
  margin-bottom: 20px;
  flex-wrap: nowrap;
  overflow-x: auto;
  scrollbar-width: none;
}
.tabs::-webkit-scrollbar { display: none; }
.tab-btn {
  background: transparent;
  border: none;
  padding: 10px 4px;
  margin-bottom: -1px; /* sit on top of the .tabs border so the active bar overlaps */
  font-size: 14px;
  font-weight: 600;
  color: var(--gray-mid);
  letter-spacing: 0.2px;
  cursor: pointer;
  font-family: var(--font);
  border-bottom: 3px solid transparent;
  white-space: nowrap;
  flex-shrink: 0;
}
a.tab-btn { text-decoration: none; display: inline-block; }
.tab-btn:hover { color: var(--white); }
.tab-btn.active {
  color: var(--white);
  border-bottom-color: var(--orange);
}
.tab-panel { display: none; }
.tab-panel.active { display: block; }

/* Player detail: Empirical + Box Score 2-col grid; stack on mobile. */
@media (max-width: 900px) {
  .empirical-detail-grid { grid-template-columns: 1fr !important; }
}

/* ── Team detail 8-chart grid ── */
.charts-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}
@media (max-width: 900px) {
  .charts-grid { grid-template-columns: 1fr; }
}
.chart-card {
  border: 1px solid var(--gray-border);
  border-radius: 6px;
  background: var(--surface);
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.chart-card-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--gray-dark);
  text-align: center;
  border-bottom: 1px solid var(--gray-border);
  padding-bottom: 6px;
}
.chart-card .chart-wrap {
  position: relative;
  height: 340px;
}

/* ── Shot Profile stacked chart+table (chart beside table on wide, stacked on mobile) ── */

/* ── Shot Profile side-by-side chart pairs ── */
.shot-profile-pair {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  align-items: start;
}
@media (max-width: 900px) {
  .shot-profile-pair { grid-template-columns: 1fr; }
}
.shot-profile-col {
  min-width: 0;
  display: flex;
  flex-direction: column;
}
.shot-profile-col .chart-card-title {
  font-size: 13px;
  font-weight: 700;
  text-align: center;
  border-bottom: 1px solid var(--gray-border);
  padding-bottom: 6px;
  margin-bottom: 8px;
}
.shot-profile-col .chart-wrap {
  position: relative;
  height: 320px;
}
.shot-profile-col-wide {
  grid-column: 1 / -1;
}
.mt-12 { margin-top: 12px; }

/* ── Team detail: full-bleed Cowboys-style banner ──
   .team-banner-strip wraps the banner so it can break out of .page-content's
   max-width and stretch edge-to-edge. Inner .team-banner-strip-inner re-applies
   the 1400px constraint for content alignment with the body below. */
.team-banner-strip {
  /* Escape the .page-content max-width container */
  margin-left: calc(50% - 50vw);
  margin-right: calc(50% - 50vw);
  margin-top: -24px;       /* swallow .page-content's top padding */
  margin-bottom: 24px;
  background:
    linear-gradient(135deg,
      #0B0E13 0%,
      color-mix(in srgb, var(--team-c1, #1A1F2B) 80%, #000) 40%,
      color-mix(in srgb, var(--team-c2, #2A1910) 65%, #000) 100%);
  color: var(--white);
}
.team-banner-strip-inner {
  max-width: 1400px;
  margin: 0 auto;
  padding: 28px 24px;
  display: flex;
  align-items: center;
  gap: 24px;
}
/* Left cluster: logo + identity */
.tbs-identity-row {
  display: flex;
  align-items: center;
  gap: 24px;
  flex: 1 1 auto;
  min-width: 0;
}
.tbs-logo {
  width: 130px;
  height: 130px;
  object-fit: contain;
  flex-shrink: 0;
  filter: drop-shadow(0 0 10px rgba(255,255,255,0.35));
}
.tbs-identity { min-width: 0; }
.tbs-team-name {
  font-size: 32px;
  font-weight: 800;
  line-height: 1.05;
  letter-spacing: 0.3px;
}
.tbs-team-meta {
  margin-top: 6px;
  font-size: 14px;
  font-weight: 500;
  color: rgba(255,255,255,0.75);
}
/* Right cluster: stats label + tile row */
.tbs-statbox {
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 10px;
  min-width: 0;
}
.tbs-stats-label {
  font-size: 14px;
  font-weight: 700;
  color: var(--white);
}
.tbs-stat-tiles {
  display: flex;
  gap: 12px;
  flex-wrap: nowrap;
}
.tbs-tile {
  min-width: 92px;
  padding: 10px 16px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.16);
  border-radius: 6px;
  text-align: center;
}
.tbs-tile-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  color: rgba(255,255,255,0.55);
}
.tbs-tile-value {
  margin-top: 4px;
  font-size: 22px;
  font-weight: 800;
  color: var(--white);
  line-height: 1.1;
}

/* Mobile: stack logo above identity (centered), stats below */
@media (max-width: 900px) {
  .team-banner-strip-inner {
    flex-direction: column;
    align-items: stretch;
    padding: 24px 16px;
    gap: 18px;
  }
  .tbs-identity-row {
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 12px;
  }
  .tbs-logo { width: 110px; height: 110px; }
  .tbs-team-name { font-size: 26px; }
  .tbs-statbox {
    align-items: center;
    width: 100%;
  }
  .tbs-stats-label { font-size: 13px; }
  .tbs-stat-tiles {
    width: 100%;
    justify-content: center;
    flex-wrap: wrap;
    gap: 8px;
  }
  .tbs-tile {
    flex: 1 1 calc(50% - 8px);
    min-width: 0;
    text-align: center;
  }
}

/* ── Team overview grid: Schedule (left, primary) + Roster rail (right) ── */
.team-overview-grid {
  display: grid;
  grid-template-columns: minmax(0, 7fr) minmax(0, 3fr);
  gap: 24px;
  align-items: start;
  margin-bottom: 24px;
}
@media (max-width: 900px) {
  .team-overview-grid { grid-template-columns: 1fr; }
}

/* Schedule list — flat row design like the Cowboys schedule */
.schedule-list {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--gray-border);
  border-radius: 6px;
  overflow: hidden;
  background: var(--surface);
}
.schedule-row {
  display: grid;
  grid-template-columns: 70px 60px 28px 1fr auto auto;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--gray-border);
  text-decoration: none;
  color: var(--gray-dark);
  font-size: 13px;
  transition: background 0.1s;
}
.schedule-row:last-child { border-bottom: none; }
.schedule-row:hover { background: rgba(255,105,0,0.08); color: var(--gray-dark); }
.sched-game-num {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  color: var(--gray-mid);
}
.sched-date {
  font-size: 12px;
  font-weight: 600;
  color: var(--gray-mid);
}
.sched-venue {
  font-size: 11px;
  font-weight: 700;
  color: var(--gray-mid);
  text-transform: uppercase;
}
.sched-opp {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}
.sched-opp-logo {
  width: 28px;
  height: 28px;
  object-fit: contain;
  flex-shrink: 0;
  filter: drop-shadow(0 0 3px rgba(255,255,255,0.35));
}
.sched-opp-name {
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sched-result {
  font-weight: 800;
  font-size: 13px;
  width: 16px;
  text-align: center;
}
.sched-result-w { color: #22A84A; }
.sched-result-l { color: #E03030; }
.sched-result-t { color: var(--gray-mid); }
.sched-score {
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  color: var(--gray-mid);
  white-space: nowrap;
}

/* Upcoming-games block on team page schedule. Sits above the played-games
   list, only renders on page 1. Muted look + wider result column so the
   "Scheduled" pill fits in place of W/L. */
.schedule-upcoming { margin-bottom: 12px; opacity: 0.92; }
.schedule-row-upcoming { cursor: default; }
.schedule-row-upcoming:hover { background: var(--surface); }
.schedule-row-upcoming .sched-result {
  width: auto;
  font-weight: 700;
  font-size: 10px;
}
@media (max-width: 600px) {
  .schedule-row {
    grid-template-columns: 56px 28px 1fr auto auto;
    gap: 8px;
    padding: 10px 12px;
    font-size: 12px;
  }
  .sched-date { display: none; }
  .sched-opp-logo { width: 24px; height: 24px; }
}

/* Roster rail — compact card list on the right */
.roster-rail {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--gray-border);
  border-radius: 6px;
  overflow: hidden;
  background: var(--surface);
}
.roster-rail-row {
  display: grid;
  grid-template-columns: 36px 1fr auto auto;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border-bottom: 1px solid var(--gray-border);
  font-size: 12px;
  text-decoration: none;
  color: var(--gray-dark);
}
.roster-rail-row:last-child { border-bottom: none; }
.roster-rail-row:hover { background: rgba(255,105,0,0.08); color: var(--gray-dark); }
.roster-rail-thumb {
  width: 36px;
  height: 36px;
  object-fit: contain;
  object-position: bottom center;
  flex-shrink: 0;
}
.roster-rail-name {
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.roster-rail-pos {
  font-size: 11px;
  color: var(--gray-mid);
  font-weight: 600;
  letter-spacing: 0.3px;
}
.roster-rail-pts {
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--gray-dark);
}

/* ── Injuries tab ────────────────────────────────────────────────────────── */
.injuries-heading {
  font-size: 28px;
  font-weight: 800;
  letter-spacing: 0.2px;
  line-height: 1.1;
}
.injuries-heading-team { /* color set inline from team primary */ }
.injuries-heading-suffix {
  color: var(--white);
  margin-left: 8px;
}
.injuries-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 24px;
  align-items: start;
}
.injuries-table-wrap {
  border: 1px solid var(--gray-border);
  border-radius: 6px;
  overflow: hidden;
  background: var(--surface);
}
.injuries-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  color: var(--gray-dark);
}
.injuries-table thead th {
  background: rgba(255,255,255,0.03);
  color: var(--gray-mid);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  text-align: center;
  padding: 12px 14px;
  border-bottom: 1px solid var(--gray-border);
  white-space: nowrap;
}
.injuries-table thead th.ij-col-player { text-align: left; }
.injuries-table tbody td {
  padding: 10px 14px;
  border-bottom: 1px solid var(--gray-border);
  text-align: center;
  vertical-align: middle;
}
.injuries-table tbody tr:last-child td { border-bottom: none; }
.injuries-table tbody tr:hover { background: rgba(255,105,0,0.05); }
.ij-player { text-align: left !important; }
.ij-player-link {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--gray-dark);
  text-decoration: none;
}
.ij-player-link:hover .ij-name { color: var(--orange); }
.ij-thumb {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  object-fit: cover;
  object-position: top center;
  background: rgba(255,255,255,0.06);
  flex-shrink: 0;
}
.ij-thumb-fallback { display: inline-block; }
.ij-name-block {
  display: inline-flex;
  flex-direction: column;
  align-items: flex-start;
  line-height: 1.25;
}
.ij-name { font-weight: 700; }
.ij-updated {
  margin-top: 1px;
  font-size: 10px;
  font-weight: 600;
  color: var(--gray-mid);
  letter-spacing: 0.2px;
}
.ij-pos {
  color: var(--gray-mid);
  font-weight: 600;
}
.ij-injury { color: var(--gray-dark); }
.ij-notes {
  color: var(--gray-mid);
  font-size: 12px;
  max-width: 280px;
  text-align: left !important;
  white-space: normal;
  line-height: 1.4;
  word-break: break-word;
}

.ij-return {
  color: var(--gray-mid);
  font-size: 12px;
  white-space: nowrap;
}

/* Recent-injury badge — fires when injury_date is within the last 3 days. */
.ij-recent-badge {
  display: inline-block;
  margin-left: 6px;
  padding: 2px 6px;
  border-radius: 4px;
  background: var(--orange);
  color: #000;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.4px;
  text-transform: uppercase;
  vertical-align: middle;
}

/* Status pills */
.ij-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.12);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.5px;
  line-height: 1;
  color: var(--white);
  white-space: nowrap;
}
.ij-pill-dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--gray-mid);
  flex-shrink: 0;
}
.ij-status-out         .ij-pill-dot { background: #E03030; box-shadow: 0 0 6px rgba(224,48,48,0.6); }
.ij-status-doubtful    .ij-pill-dot { background: #FF6900; box-shadow: 0 0 6px rgba(255,105,0,0.6); }
.ij-status-questionable .ij-pill-dot { background: #FF9500; box-shadow: 0 0 6px rgba(255,149,0,0.6); }
.ij-status-probable    .ij-pill-dot { background: #F2C744; box-shadow: 0 0 6px rgba(242,199,68,0.55); }
.ij-status-day-to-day  .ij-pill-dot { background: #6BAEEA; }
.ij-status-unspecified .ij-pill-dot { background: #6E7785; }

/* Legend rail */
.injuries-legend {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.ij-legend-card {
  background: var(--surface);
  border: 1px solid var(--gray-border);
  border-radius: 6px;
  padding: 14px 16px;
}
.ij-legend-card .ij-pill { margin-bottom: 8px; }
.ij-legend-card p {
  margin: 0;
  font-size: 13px;
  color: var(--gray-mid);
  line-height: 1.4;
}

/* Mobile: stack legend below the table */
@media (max-width: 900px) {
  .injuries-layout { grid-template-columns: 1fr; }
  .injuries-heading { font-size: 22px; }
  .ij-notes { max-width: 180px; }
}
@media (max-width: 600px) {
  .injuries-table thead th,
  .injuries-table tbody td { padding: 8px 10px; }
  .ij-notes { display: none; }
}

/* ── Lineups page ───────────────────────────────────────────────────────── */
.lineups-page { display: flex; flex-direction: column; gap: 20px; }
.lineups-header h1 { font-size: 28px; font-weight: 700; }
.lineups-sub { color: var(--gray-mid); margin-top: 6px; max-width: 720px; }

/* Filter row uses .filter-row + .season-select from the shared toolkit
   (see /games for reference). Lineups-specific tweaks below. */
.lineups-filter-row { gap: 10px 12px; }
.lineups-filter-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--gray-mid);
}
.lineups-filter-row #lineupTeam { min-width: 200px; }
.lineups-filter-btn {
  margin-left: 4px;
}
.btn-primary {
  background: var(--orange);
  color: var(--black);
  border: 0;
  border-radius: 4px;
  padding: 7px 14px;
  font-weight: 600;
  font-size: 13px;
  cursor: pointer;
  line-height: 1;
}
.btn-primary:hover { filter: brightness(1.08); }

.lineups-status {
  background: var(--surface);
  border: 1px solid var(--gray-border);
  border-left: 3px solid var(--gray-mid);
  border-radius: 4px;
  padding: 10px 14px;
  font-size: 13px;
  color: var(--gray-mid);
  display: flex;
  align-items: center;
  gap: 10px;
}
/* The HTML `hidden` attribute sets display:none in user-agent CSS, but
   author rules above with explicit `display: flex / inline-block` win
   without the !important guard. */
.lineups-status[hidden],
.lineups-stats-meta[hidden] { display: none !important; }
.lineups-status-loading { border-left-color: var(--orange); }
.lineups-status-warn    { border-left-color: #F2C744; color: #F2C744; }
.lineups-status-error   { border-left-color: #E03030; color: #E03030; }
.lineups-spinner {
  width: 14px;
  height: 14px;
  border: 2px solid rgba(255, 105, 0, 0.25);
  border-top-color: var(--orange);
  border-radius: 50%;
  animation: lineups-spin 0.8s linear infinite;
  flex-shrink: 0;
}
@keyframes lineups-spin { to { transform: rotate(360deg); } }

.lineups-zones {
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-areas: "starters stats" "bench    locker";
  gap: 16px;
}
#zoneStarters   { grid-area: starters; }
#zoneStats      { grid-area: stats; }
#zoneBench      { grid-area: bench; }
#zoneLockerroom { grid-area: locker; }

.lineups-zone {
  /* Borderless container — the section is identified by its heading,
     player cards stand on their own. The dragover highlight still
     outlines the zone temporarily so drop targets are obvious. */
  padding: 4px 0 14px;
  min-height: 180px;
  border-radius: 6px;
}
.lineups-zone-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}
.lineups-zone-head h2 { margin-bottom: 0; }
.lineups-zone-action {
  background: none;
  border: 1px solid var(--gray-border);
  border-radius: 4px;
  padding: 4px 10px;
  font-size: 11px;
  color: var(--gray-mid);
  cursor: pointer;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}
.lineups-zone-action:hover {
  color: var(--white);
  border-color: var(--gray-mid);
}
.lineups-zone h2 {
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--gray-mid);
  margin-bottom: 10px;
}
.lineups-zone-body {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-content: flex-start;
  justify-content: center;
}
.lineups-empty,
.lineups-empty-small {
  color: var(--gray-mid);
  font-size: 13px;
  padding: 8px 0;
  width: 100%;
}
.lineups-empty-small { font-size: 12px; padding: 4px 0; }

.lineups-card {
  background: var(--surface-2);
  border: 1px solid var(--gray-border);
  border-radius: 6px;
  padding: 8px;
  width: 112px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  position: relative;
}

/* Tip-taker badge — basketball SVG glyph in the top-left of the
   tip-taker's player card. No background pill so the orange ball
   reads as a basketball against the dark card; thin white ring
   around it gives shape definition. Same SVG mark as the favicon /
   nav logo. */
.lineups-card-tipoff-badge {
  position: absolute;
  top: -6px;
  left: -6px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  box-shadow: 0 0 0 1.5px #fff,
              0 1px 3px rgba(0, 0, 0, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2;
  pointer-events: none; /* don't block drag handle on the card */
}
.lineups-card-tipoff-badge svg {
  width: 22px;
  height: 22px;
  display: block;
  border-radius: 50%;
}
.lineups-card-tip-taker {
  border-color: var(--orange);
  border-width: 2px;
  /* The base card has padding:8px and border:1px. +1px border here
     would shift inner content; subtract 1px of padding so the card's
     outer dimensions stay identical to non-tip-taker cards. */
  padding: 7px;
}


/* Live Games button — sits at the end of a filter row or header strip,
   opens a Streamlit live tracker in a new tab. Reused on /games (list)
   and /games/<id> (upcoming preview). The pulsing red dot is the
   standard "live" affordance. */
.live-games-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  border: 1px solid var(--gray-border);
  border-radius: 4px;
  background: var(--surface);
  color: var(--gray-dark);
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
}
.live-games-btn:hover {
  color: var(--white);
  border-color: #E03030;
  background: var(--surface-hover);
}
.live-games-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #E03030;
  box-shadow: 0 0 0 0 rgba(224, 48, 48, 0.6);
  animation: live-games-pulse 1.6s ease-out infinite;
}
@keyframes live-games-pulse {
  0%   { box-shadow: 0 0 0 0   rgba(224, 48, 48, 0.55); }
  70%  { box-shadow: 0 0 0 8px rgba(224, 48, 48, 0); }
  100% { box-shadow: 0 0 0 0   rgba(224, 48, 48, 0); }
}

/* Forced 3-on-top, 2-below layout used on game / upcoming-game pages.
   `flex-wrap` alone would let 4 fit on one row when the parent column is
   borderline wide — splitting into two explicit rows keeps it predictable. */
.lineup-rows {
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: center;
}
.lineup-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
}
.lineups-card img,
.lineups-card-blank {
  width: 96px;
  height: 96px;
  object-fit: cover;
  border-radius: 4px;
  /* WNBA headshots ship at 1040x760; downscaling to a small box on a
     high-DPI screen can look fuzzy. Hint the browser to use a sharper
     resampler (Chrome / Edge respect this; Safari/Firefox fall back to
     defaults gracefully). */
  image-rendering: -webkit-optimize-contrast;
}
/* Headshot fallback: the grey block only applies when there is no
   image at all (the "blank" element). Keeping it on .lineups-card img
   left a visible grey box behind every transparent-PNG headshot. */
.lineups-card-blank {
  background: var(--surface-hover);
}
.lineups-card-name {
  font-size: 12px;
  font-weight: 600;
  line-height: 1.2;
}
.lineups-card-meta {
  font-size: 10px;
  color: var(--gray-mid);
}
.lineups-card[draggable="true"] { cursor: grab; }
.lineups-card[draggable="true"]:active { cursor: grabbing; }
.lineups-card-dragging { opacity: 0.4; }
.lineups-card-empty {
  border-style: dashed;
  border-color: var(--gray-mid);
  opacity: 0.6;
}
.lineups-card-empty .lineups-card-name { color: var(--gray-mid); }
.lineups-card-slot-target {
  border-color: var(--orange);
  box-shadow: 0 0 0 2px rgba(255, 105, 0, 0.35);
  opacity: 1;
}
.lineups-zone-dragover {
  background: var(--surface-2);
  outline: 2px dashed var(--orange);
  outline-offset: -4px;
}
.lineups-card-tap-selected {
  outline: 2px solid var(--orange);
  outline-offset: 2px;
  box-shadow: 0 0 0 4px rgba(255, 105, 0, 0.25);
}
/* On touch devices, the "grab" cursor isn't meaningful and drag
   doesn't fire — make cards look tappable instead. */
.lineups-touch .lineups-card[draggable="true"] { cursor: pointer; }

.lineups-stats-meta {
  display: inline-block;
  background: var(--surface-2);
  border: 1px solid var(--gray-border);
  border-radius: 999px;
  padding: 3px 10px;
  font-size: 11px;
  color: var(--gray-mid);
  margin-bottom: 8px;
}
.lineups-small-sample {
  display: inline-block;
  background: rgba(242, 199, 68, 0.15);
  color: #F2C744;
  border-radius: 999px;
  padding: 1px 8px;
  margin-left: 6px;
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}
.lineups-tied-pill {
  display: inline-block;
  background: rgba(255, 105, 0, 0.15);
  color: var(--orange);
  border: 1px solid rgba(255, 105, 0, 0.4);
  border-radius: 999px;
  padding: 1px 8px;
  margin-left: 6px;
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  cursor: pointer;
}
.lineups-tied-pill:hover {
  background: rgba(255, 105, 0, 0.3);
}

/* Started-together pill: now a button that toggles the games drawer.
   Mirrors the visual weight of .lineups-stats-meta so the user reads it
   as the same affordance, just clickable. is-active = drawer open. */
.lineups-together-pill {
  display: inline-block;
  background: var(--surface-2);
  border: 1px solid var(--gray-border);
  border-radius: 999px;
  padding: 3px 10px;
  font-size: 11px;
  color: var(--gray-mid);
  font-family: inherit;
  cursor: pointer;
}
.lineups-together-pill:hover:not(:disabled) {
  background: rgba(255, 105, 0, 0.10);
  border-color: rgba(255, 105, 0, 0.4);
  color: var(--orange);
}
.lineups-together-pill.is-active {
  background: rgba(255, 105, 0, 0.18);
  border-color: rgba(255, 105, 0, 0.55);
  color: var(--orange);
}
.lineups-together-pill.is-disabled,
.lineups-together-pill:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* Pill row: Started-together pill on the left, more-lineups pill on
   the right, both inline. Wraps on narrow widths.
   The games drawer is a child of this wrapper too — it's forced to a
   full-width line via flex-basis:100% and lives at order:1 so it always
   sits BETWEEN the started-together pill (order:0) and the more-lineups
   pill (order:2). That way, when the row is too narrow and the alt-pill
   wraps under the started-together pill, the open drawer still slides
   in directly below the started-together pill rather than below the
   wrapped alt-pill. */
.lineups-stats-pills {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin-bottom: 8px;
}
.lineups-stats-pills .lineups-stats-meta    { order: 0; margin-bottom: 0; }
.lineups-stats-pills .lineups-games-drawer  { order: 1; flex-basis: 100%; }
.lineups-stats-pills .lineups-stats-altpill { order: 2; }
.lineups-stats-altpill[hidden] { display: none !important; }
.lineups-stats-altpill .lineups-tied-pill {
  margin-left: 0;
}

/* Games drawer: list of games the displayed 5 played together.
   Toggled by the started-together pill. */
.lineups-games-drawer {
  background: var(--surface-2);
  border: 1px solid var(--gray-border);
  border-radius: 6px;
  padding: 6px 8px;
  margin-bottom: 10px;
  max-height: 260px;
  overflow-y: auto;
}
.lineups-games-drawer[hidden] { display: none !important; }
/* Mini schedule inside the games drawer — visual twin of .schedule-list
   on the team page, sized down so it fits inside the lineups stats
   panel. Columns: Date · Venue (vs/@) · Opponent (logo + name) ·
   Result · Score. */
.lineups-schedule-list {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--gray-border);
  border-radius: 6px;
  overflow: hidden;
  background: var(--surface);
}
.sched-mini-row {
  display: grid;
  grid-template-columns: 44px 28px 1fr auto auto;
  align-items: center;
  gap: 10px;
  padding: 6px 10px;
  border-bottom: 1px solid var(--gray-border);
  text-decoration: none;
  color: var(--gray-dark);
  font-size: 12px;
  transition: background 0.1s;
}
.sched-mini-row:last-child { border-bottom: none; }
.sched-mini-row:hover {
  background: rgba(255, 105, 0, 0.08);
  color: var(--gray-dark);
}
.sched-mini-date {
  font-size: 11px;
  font-weight: 600;
  color: var(--gray-mid);
  font-variant-numeric: tabular-nums;
}
.sched-mini-venue {
  font-size: 10px;
  font-weight: 700;
  color: var(--gray-mid);
  text-transform: uppercase;
}
.sched-mini-opp {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}
.sched-mini-opp-logo {
  width: 20px;
  height: 20px;
  object-fit: contain;
  flex-shrink: 0;
  filter: drop-shadow(0 0 3px rgba(255, 255, 255, 0.35));
}
.sched-mini-opp-name {
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sched-mini-result {
  font-weight: 800;
  font-size: 12px;
  width: 14px;
  text-align: center;
}
.sched-mini-result-w { color: #22A84A; }
.sched-mini-result-l { color: #E03030; }
.sched-mini-score {
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  color: var(--gray-mid);
  white-space: nowrap;
}
@media (max-width: 600px) {
  .sched-mini-row {
    grid-template-columns: 38px 24px 1fr auto auto;
    gap: 6px;
    padding: 6px 8px;
    font-size: 11px;
  }
  .sched-mini-opp-logo { width: 18px; height: 18px; }
}

/* Per-event drill-down: stat-block heading is a button so it's clearly
   clickable. Inherits color from the surrounding section. */
.lineups-event-heading {
  background: none;
  border: 0;
  padding: 0;
  font: inherit;
  color: inherit;
  cursor: pointer;
  text-transform: inherit;
  letter-spacing: inherit;
}
.lineups-event-heading:hover { color: var(--orange); }
.lineups-event-heading-hint {
  display: inline-block;
  margin-left: 4px;
  font-size: 10px;
  color: var(--gray-mid);
  transition: transform 0.15s ease;
}
.lineups-event-heading:hover .lineups-event-heading-hint {
  transform: translateX(2px);
  color: var(--orange);
}

/* ── Modal ──────────────────────────────────────────────────────────── */
.lineups-modal {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}
.lineups-modal[hidden] { display: none !important; }
.lineups-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.65);
}
.lineups-modal-card {
  position: relative;
  z-index: 1;
  background: var(--surface);
  border: 1px solid var(--gray-border);
  border-radius: 8px;
  width: 100%;
  max-width: 720px;
  max-height: 86vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.5);
}
.lineups-modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  border-bottom: 1px solid var(--gray-border);
}
.lineups-modal-head h3 { font-size: 16px; font-weight: 600; }
.lineups-modal-close {
  background: none;
  border: 0;
  color: var(--gray-mid);
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
  padding: 0 6px;
}
.lineups-modal-close:hover { color: var(--white); }
.lineups-modal-body {
  padding: 14px 16px;
  overflow-y: auto;
}
body.lineups-modal-open { overflow: hidden; }

/* Tied-lineups list inside the modal */
.lineups-tied-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.lineups-tied-item {
  background: var(--surface-2);
  border: 1px solid var(--gray-border);
  border-radius: 6px;
  padding: 10px 12px;
}
.lineups-tied-item-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 8px;
  font-size: 12px;
  color: var(--gray-mid);
}
.lineups-tied-item-num { color: var(--orange); font-weight: 700; }
.lineups-tied-load {
  margin-left: auto;
  background: var(--orange);
  color: var(--black);
  border: 0;
  border-radius: 4px;
  padding: 5px 10px;
  font-weight: 600;
  font-size: 12px;
  cursor: pointer;
}
.lineups-tied-load:hover { filter: brightness(1.08); }
.lineups-tied-item-cards {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
/* Cards inside the modal don't need to be draggable visually */
.lineups-tied-item-cards .lineups-card { cursor: default; }

/* Per-event outcome rows inside the modal */
.lineups-outcome-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.lineups-outcome {
  display: flex;
  gap: 12px;
  background: var(--surface-2);
  border: 1px solid var(--gray-border);
  border-left: 3px solid var(--gray-mid);
  border-radius: 6px;
  padding: 10px 12px;
}
.lineups-outcome.is-make  { border-left-color: var(--orange); }
.lineups-outcome.is-miss  { border-left-color: #6E7785; }
.lineups-outcome-headshot {
  width: 44px;
  height: 44px;
  object-fit: cover;
  border-radius: 4px;
  background: var(--surface-hover);
  flex-shrink: 0;
}
.lineups-outcome-main { flex: 1; min-width: 0; }
.lineups-outcome-line1 {
  font-size: 14px;
  margin-bottom: 2px;
}
.lineups-outcome-result {
  font-size: 11px;
  text-transform: uppercase;
  color: var(--gray-mid);
  margin-left: 4px;
}
.lineups-outcome.is-make .lineups-outcome-result { color: var(--orange); }
.lineups-outcome-tag {
  display: inline-block;
  background: var(--surface);
  border: 1px solid var(--gray-border);
  border-radius: 4px;
  padding: 1px 6px;
  font-size: 10px;
  color: var(--gray-mid);
  margin-left: 2px;
}
.lineups-outcome-line2 {
  font-size: 12px;
  color: var(--gray-mid);
}
.lineups-outcome-play {
  margin-top: 4px;
  font-size: 12px;
  color: var(--gray-dark);
}
.lineups-stats-action { margin-top: 8px; }
/* Stats body becomes a 2-column grid so the 8 events fit cleanly on
   desktop without long vertical scrolling. Each card is one cell. */
#statsBody {
  display: grid !important;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px 12px;
  align-items: start;
}
#statsBody > p,
#statsBody > .lineups-stats-action {
  grid-column: 1 / -1;
}

/* Single card per first-event market — entire card is a button that
   opens the per-game drill-down modal. */
.lineups-event-card {
  display: block;
  width: 100%;
  text-align: left;
  background: var(--surface);
  border: 1px solid var(--gray-border);
  border-left: 3px solid var(--gray-border);
  border-radius: 6px;
  padding: 10px 12px;
  cursor: pointer;
  font-family: inherit;
  color: inherit;
  transition: border-color 0.12s ease, background 0.12s ease;
}
.lineups-event-card:hover {
  border-color: var(--gray-mid);
  border-left-color: var(--orange);
  background: var(--surface-2);
}
.lineups-event-card-label {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--gray-mid);
  margin-bottom: 4px;
}
.lineups-event-card-arrow {
  color: var(--gray-mid);
  font-size: 14px;
  line-height: 1;
}
.lineups-event-card:hover .lineups-event-card-arrow { color: var(--orange); }
.lineups-event-card-leader {
  font-size: 15px;
  font-weight: 600;
  color: var(--gray-dark);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.lineups-event-card-sub {
  margin-top: 2px;
  font-size: 12px;
  color: var(--gray-mid);
}
.lineups-event-card-others {
  display: inline-block;
  margin-left: 6px;
  padding: 1px 7px;
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  color: var(--gray-mid);
  border: 1px solid var(--gray-border);
  border-radius: 999px;
}
@media (max-width: 900px) {
  .lineups-zones {
    grid-template-columns: 1fr;
    grid-template-areas: "starters" "stats" "bench" "locker";
    gap: 12px;
  }
  /* Drop the 2-column stats grid on mobile — single column reads
     cleaner on a narrow viewport. */
  #statsBody {
    grid-template-columns: 1fr !important;
  }
  .lineups-zone { min-height: 0; padding-bottom: 6px; }
  .lineups-zone-head { margin-bottom: 8px; }
  /* Slightly smaller player cards so 5 starters can fit 3-2 on phones
     without wrapping a single card to its own row awkwardly. */
  .lineups-card {
    width: 96px;
    padding: 6px;
  }
  .lineups-card img,
  .lineups-card-blank { width: 80px; height: 80px; }
  .lineups-card-name { font-size: 11px; }
  .lineups-card-meta { font-size: 9px; }
  /* Filter row already wraps via .filter-row; keep the team picker
     full-width on a narrow screen so the dropdown is reachable. */
  .lineups-filter-row #lineupTeam { width: 100%; min-width: 0; }
  .lineups-filter-btn { width: 100%; }
  .lineups-modal-card { max-height: 92vh; }
}
@media (max-width: 600px) {
  .lineups-stats-meta { font-size: 10.5px; }
  .lineups-event-card { padding: 8px 10px; }
  .lineups-event-card-leader { font-size: 14px; }
}
