/* ═══════════════════════════════════════════════════════════════
   nba/assets/css/game.css — Game page only (loaded by game.php)
   Same layout as the NFL game page. Colours come from tokens.css;
   tables use the site's normal .dt styles from base.css.
   ═══════════════════════════════════════════════════════════════ */

/* ─── Game header card ─── */
.gm-head {
  border: 1px solid var(--rule);
  background: var(--paper);
  box-shadow: var(--shadow-card);
  margin-bottom: 20px;
}
.gm-head-top {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 14px 20px;
  border-bottom: 1px solid var(--rule);
  background: var(--paper-2);
}
.gm-picker { display: flex; align-items: center; gap: 10px; }
.gm-picker label,
.gm-side-label,
.gm-stat span {
  font-family: var(--font-display);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--muted);
}
.gm-select { position: relative; }
.gm-select::after {
  content: '▾';
  position: absolute;
  right: 12px; top: 50%;
  transform: translateY(-50%);
  color: var(--muted);
  pointer-events: none;
  font-size: 12px;
}
.gm-select select {
  appearance: none;
  -webkit-appearance: none;
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 800;
  letter-spacing: .3px;
  color: var(--ink);
  background: var(--paper);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  padding: 8px 36px 8px 14px;
  min-width: 170px;
  cursor: pointer;
}
.gm-select select:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
.gm-kick { font-size: 13px; color: var(--ink-2); font-weight: 500; }
.gm-btn {
  margin-left: auto;
  font-family: var(--font-display);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 1px;
  text-transform: uppercase;
  padding: 8px 14px;
  border: 1px solid var(--accent);
  border-radius: var(--radius);
  background: transparent;
  color: var(--accent);
  cursor: pointer;
}
.gm-btn:hover { background: var(--accent); color: var(--on-accent); }

.gm-board {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 24px;
  padding: 22px 28px;
}
.gm-side { display: flex; flex-direction: column; gap: 6px; }
.gm-side-home { align-items: flex-end; text-align: right; }
.gm-side-team { display: flex; align-items: center; gap: 10px; }
.gm-side-home .gm-side-team { flex-direction: row-reverse; }
.gm-team-name { font-family: var(--font-display); font-size: 15px; font-weight: 800; color: var(--ink); }
.gm-pts {
  font-family: var(--font-display);
  font-size: 46px;
  font-weight: 800;
  letter-spacing: -1.5px;
  line-height: 1;
  color: var(--ink);
  font-feature-settings: 'tnum';
}
.gm-jumper { font-family: var(--font-display); font-size: 13px; font-weight: 800; color: var(--muted); }
.gm-jumper .player-link { margin-left: 0; }

.gm-mid {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 0 24px;
  border-left: 1px solid var(--rule);
  border-right: 1px solid var(--rule);
}
.gm-stat { display: flex; justify-content: space-between; align-items: baseline; gap: 18px; min-width: 190px; }
.gm-stat strong { font-family: var(--font-mono); font-size: 15px; font-weight: 700; color: var(--ink); }

/* ─── Tabs + team filter ─── */
.gm-bar {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 2px solid var(--chrome);
  margin-bottom: 18px;
  flex-wrap: wrap;
}
.gm-tabs { display: flex; gap: 2px; flex-wrap: wrap; }
.gm-tab {
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 1px;
  text-transform: uppercase;
  padding: 10px 16px;
  border: none;
  border-radius: var(--radius-tab) var(--radius-tab) 0 0;
  background: var(--paper-2);
  color: var(--muted);
  cursor: pointer;
}
.gm-tab:hover { color: var(--ink); }
.gm-tab.active { background: var(--chrome); color: var(--chrome-ink); }
.gm-filter { display: flex; margin-bottom: 6px; border: 1px solid var(--rule); border-radius: var(--radius); overflow: hidden; }
.gm-seg {
  font-family: var(--font-display);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 1px;
  text-transform: uppercase;
  padding: 6px 14px;
  border: none;
  border-right: 1px solid var(--rule);
  background: var(--paper);
  color: var(--muted);
  cursor: pointer;
}
.gm-seg:last-child { border-right: none; }
.gm-seg.active { background: var(--accent); color: var(--on-accent); }

/* ─── Lineups: teams side by side; stacked on narrow screens; one team fills the width when filtered ─── */
.gm-box { display: grid; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); gap: 20px; margin-top: 8px; margin-bottom: 28px; }
.gm-box-team { min-width: 0; }
.gm-box-head { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; font-family: var(--font-display); font-size: 13px; font-weight: 800; color: var(--ink); }
.gm-note { font-size: 12.5px; color: var(--muted); margin-bottom: 8px; }

/* ─── Snapshot: blocks side by side on wide screens, one per row on phones ─── */
.gm-cmp-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 340px), 1fr));
  column-gap: 24px;
  align-items: start;
}
.gm-cmp-block { min-width: 0; }

/* ─── Snapshot: comparison list (away | stat | home) ───
   Sizes follow the list's own width (cqi units), so text shrinks with the space it has. */
.gm-cmp { container-type: inline-size; border: 1px solid var(--rule); background: var(--paper); margin-bottom: 24px; }
.gm-cmp-head,
.gm-cmp-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) clamp(76px, 30cqi, 120px) minmax(0, 1fr);
}
.gm-cmp-head { align-items: center; background: var(--paper-2); border-bottom: 1px solid var(--rule); }
.gm-cmp-row { align-items: stretch; border-bottom: 1px solid var(--rule); }
.gm-cmp-row:last-child { border-bottom: none; }
.gm-cmp-side {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  padding: 8px 12px;
  font-family: var(--font-display);
  font-size: clamp(8px, 3cqi, 10px);
  font-weight: 800;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--muted);
}
.gm-cmp-side-home { justify-content: flex-end; }
.gm .gm-cmp-side .pill { font-size: clamp(9px, 3.6cqi, 12px); min-width: 0; padding: 2px clamp(4px, 1.8cqi, 8px); }
.gm-cmp-k {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 6px 4px;
  text-align: center;
  font-family: var(--font-display);
  font-size: clamp(8px, 2.8cqi, 10px);
  font-weight: 800;
  letter-spacing: .5px;
  line-height: 1.2;
  text-transform: uppercase;
  color: var(--muted);
}
.gm-cmp-v {
  display: flex;
  align-items: center;
  min-width: 0;
  padding: 9px 12px;
  font-family: var(--font-mono);
  font-size: clamp(10px, 4cqi, 14px);
  font-weight: 700;
  font-feature-settings: 'tnum';
}
.gm-cmp-v:not(.heat) { color: var(--ink); }
.gm-cmp-row > .gm-cmp-v:last-child { justify-content: flex-end; text-align: right; }

/* Names stay on one line; game.js lowers --fit-fs until the name fits */
.gm-fit { display: block; flex: 1 1 auto; min-width: 0; overflow: hidden; white-space: nowrap; font-size: var(--fit-fs, inherit); }
.gm-fit * { font-size: inherit; }

/* ─── Snapshot: last 10 (pill + win % on top, ten equal slots below) ─── */
.gm-l10 { container-type: inline-size; border: 1px solid var(--rule); background: var(--paper); margin-bottom: 24px; }
.gm-l10-row { padding: 8px 12px 10px; border-bottom: 1px solid var(--rule); }
.gm-l10-row:last-child { border-bottom: none; }
.gm-l10-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 8px; }
.gm-l10-top .gm-cmp-side { padding: 0; }
.gm-l10-win .gm-cmp-v { justify-content: center; width: clamp(64px, 22cqi, 84px); padding: 4px 6px; }
.gm-l10-games { display: grid; grid-template-columns: repeat(10, minmax(0, 1fr)); gap: clamp(2px, .8cqi, 4px); }
.gm-l10-slot {
  display: flex;
  align-items: center;
  justify-content: center;
  height: clamp(20px, 6cqi, 26px);
  overflow: hidden;
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  background: var(--paper-2);
  font-family: var(--font-body);
  font-size: clamp(7px, 2.6cqi, 11px);
  font-weight: 800;
  letter-spacing: .2px;
}
.gm-l10-slot.gm-l10-w { background: var(--win);  color: var(--l10-ink); border-color: transparent; }
.gm-l10-slot.gm-l10-l { background: var(--loss); color: var(--l10-ink); border-color: transparent; }

/* ─── Lineups: one row per starter, tap to open the rest ─── */
.gm-ln { container-type: inline-size; border: 1px solid var(--rule); background: var(--paper); }
.gm-ln-head,
.gm-ln-row > summary {
  display: grid;
  grid-template-columns: minmax(0, 1fr) repeat(3, clamp(44px, 17cqi, 64px));
  align-items: center;
  gap: 4px;
  padding: 8px clamp(6px, 3cqi, 12px);
}
.gm-ln-head {
  background: var(--paper-2);
  border-bottom: 1px solid var(--rule);
  font-family: var(--font-display);
  font-size: clamp(8px, 2.8cqi, 10px);
  font-weight: 800;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--muted);
}
.gm-ln-head span:not(:first-child) { text-align: right; }
.gm-ln-row { border-bottom: 1px solid var(--rule); }
.gm-ln-row:last-child { border-bottom: none; }
.gm-ln-row > summary { list-style: none; cursor: pointer; }
.gm-ln-row > summary::-webkit-details-marker { display: none; }
.gm-ln-row[open] > summary { background: var(--paper-2); }
.gm-ln-name { display: flex; align-items: center; gap: 6px; min-width: 0; font-size: clamp(10px, 3.8cqi, 13px); }
.gm .gm-ln-name .pos-badge { flex: 0 0 auto; font-size: clamp(7px, 2.6cqi, 10px); padding: 1px 4px; }
.gm-ln-v {
  text-align: right;
  font-family: var(--font-mono);
  font-size: clamp(9px, 3.6cqi, 13px);
  font-weight: 700;
  padding: 4px clamp(3px, 1.5cqi, 6px);
}
.gm-ln-more {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(clamp(64px, 22cqi, 90px), 1fr));
  gap: 8px;
  padding: 10px clamp(6px, 3cqi, 12px) 14px;
  background: var(--paper-2);
}
.gm-ln-stat { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.gm-ln-stat > span:first-child {
  font-family: var(--font-display);
  font-size: clamp(8px, 2.6cqi, 10px);
  font-weight: 800;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--muted);
}
.gm-ln-stat strong { font-family: var(--font-mono); font-size: clamp(11px, 3.8cqi, 14px); color: var(--ink); }
.gm-ln-stat .gm-ln-v { text-align: left; align-self: flex-start; }


/* ─── Phone ─── */
@media (max-width: 720px) {
  .gm-head-top { flex-wrap: wrap; padding: 12px 14px; gap: 8px; }
  .gm-picker { gap: 8px; min-width: 0; flex: 1; }
  .gm-select { flex: 1; }
  .gm-select select { width: 100%; min-width: 0; font-size: 16px; padding: 7px 28px 7px 10px; }
  .gm-select::after { right: 10px; }
  .gm-kick { order: 3; flex-basis: 100%; }
  .gm-board { grid-template-columns: 1fr 1fr; padding: 16px; gap: 16px; }
  .gm-mid { grid-column: 1 / -1; order: 3; border: none; border-top: 1px solid var(--rule); padding: 14px 0 0; }
  .gm-stat { min-width: 0; }
  .gm-pts { font-size: 36px; }
  .gm-team-name { display: none; }
  .gm-bar { flex-direction: column; align-items: stretch; gap: 10px; }
  .gm-tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 2px; }
  .gm-tab { text-align: center; padding: 10px 8px; }
  .gm-filter { margin-bottom: 8px; }
  .gm-seg { flex: 1; text-align: center; }
  .gm-box { grid-template-columns: 1fr; }
}

/* ─── Snapshot on desktop: jumpers; possession | shot + basket stats; pairs; last 10 ─── */
@media (min-width: 721px) {
  .gm-cmp-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .gm-cmp-wide { grid-column: 1 / -1; }
  .gm-cmp-tall { grid-row: span 2; }
}

/* ─── History: wide tables on desktop, stacked blocks on phones ─── */
.gm-phone { display: none; }
@media (max-width: 720px) {
  .gm .gm-desk { display: none; }
  .gm-phone { display: block; margin-bottom: 24px; }
}
.gm-phone > .gm-cmp { margin-bottom: 0; border-bottom: none; }
.gm-hist { container-type: inline-size; border: 1px solid var(--rule); background: var(--paper); }
.gm-hist + .gm-hist { margin-top: 12px; }
.gm-hist-group { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); border-bottom: 1px solid var(--rule); }
.gm-hist-group:last-child { border-bottom: none; }
.gm-hist-line { display: flex; flex-direction: column; gap: 4px; min-width: 0; padding: 8px 12px; }
.gm-hist-line > span:first-child {
  font-family: var(--font-display);
  font-size: clamp(8px, 2.8cqi, 10px);
  font-weight: 800;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--muted);
}
.gm-hist-line > :not(:first-child) { align-self: flex-start; }
.gm-hist-line > .gm-fit { align-self: stretch; font-size: var(--fit-fs, clamp(11px, 3.8cqi, 13px)); }
.gm-hist-v { font-family: var(--font-mono); font-size: clamp(11px, 3.8cqi, 13px); font-weight: 700; }
.gm-hist-v:not(.h2h-val) { color: var(--ink); }

/* ─── History on phones: each record as short lines, label before value ─── */
.gm-hist-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 14px;
  padding: 8px 12px;
  border-bottom: 1px solid var(--rule);
}
.gm-hist-row:last-child { border-bottom: none; }
.gm-hist-pair { display: inline-flex; align-items: center; gap: 6px; min-width: 0; font-size: clamp(11px, 3.8cqi, 13px); }
.gm-hist-k {
  font-family: var(--font-display);
  font-size: clamp(8px, 2.6cqi, 10px);
  font-weight: 800;
  letter-spacing: .5px;
  text-transform: uppercase;
  color: var(--muted);
}
.gm .gm-hist-pair .pill { font-size: clamp(9px, 3.2cqi, 12px); min-width: 0; padding: 1px 5px; }

/* Likely Jumpers tip row: each side's own label (A TIP W / H TIP W) next to its number */
.gm-cmp-k-split { justify-content: space-between; gap: 4px; }

/* ─── Tabs: clear buttons ─── */
.gm-tabs { gap: 6px; padding-bottom: 6px; }
.gm-tab {
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  background: var(--paper);
  color: var(--ink);
  box-shadow: var(--shadow-card);
  padding: 10px 18px;
}
.gm-tab:hover { border-color: var(--accent); color: var(--accent); }
.gm-tab.active { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }

/* ─── Away / Home / Both only on Lineups and Model ─── */
.gm:has(.gm-panel[data-panel="snapshot"]:not([hidden])) .gm-filter,
.gm:has(.gm-panel[data-panel="history"]:not([hidden])) .gm-filter { display: none; }

/* ─── Game header: (away pill) @ (home pill) ─── */
.gm-title { grid-column: 1 / -1; display: flex; justify-content: center; align-items: center; gap: 8px; }

/* ─── History on phones: one block per meeting ─── */
.gm-meet {
  container-type: inline-size;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 10px 12px;
  border: 1px solid var(--rule);
  background: var(--paper);
}
.gm-meet + .gm-meet { margin-top: 12px; }
.gm-meet-line {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  font-size: clamp(11px, 3.8cqi, 14px);
  font-weight: 600;
  color: var(--ink);
}
.gm-meet-center { justify-content: center; }
.gm-meet-date { font-family: var(--font-mono); font-weight: 700; }
.gm .gm-meet .pill { font-size: clamp(9px, 3.2cqi, 12px); min-width: 0; padding: 2px 6px; }

/* ─── History on phones: meeting block (date line; Tip Off / Wins / First Basket / Shot Type) ─── */
.gm-meet { gap: 14px; font-size: clamp(11px, 3.8cqi, 14px); color: var(--ink); }
.gm-meet-line { font-size: inherit; }
.gm-meet-sec { display: flex; flex-direction: column; gap: 6px; }
.gm-meet-k { font-weight: 700; }
.gm-meet-tip { display: grid; grid-template-columns: auto auto auto; justify-content: start; align-items: end; column-gap: 18px; }
.gm-meet-j { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; font-weight: 600; }
.gm-meet-v { font-weight: 600; }

/* ─── History on phones: matchup left / date right, sections centered ─── */
.gm-meet-top { justify-content: space-between; }
.gm-meet-sec { align-items: center; text-align: center; }
.gm-meet-sec .gm-meet-line { justify-content: center; }
.gm-meet-tip { justify-content: center; }
.gm-meet-j { align-items: center; }

/* ─── History on phones: centered lines under the matchup/date line ─── */
.gm-meet-c { justify-content: center; text-align: center; }

/* ─── History on phones: meeting lines left-aligned ─── */
.gm-meet-c { justify-content: flex-start; text-align: left; }

/* ─── History on phones: meeting card (header + 2x2 grid, label over value) ─── */
.gm-mc {
  container-type: inline-size;
  background: var(--paper);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  font-size: clamp(11px, 3.8cqi, 14px);
  color: var(--ink);
}
.gm-mc + .gm-mc { margin-top: 16px; }
.gm-mc-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 10px 12px; border-bottom: 1px solid var(--rule); }
.gm-mc-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.gm-mc-cell { min-width: 0; padding: 10px 12px; }
.gm-mc-cell:nth-child(odd) { border-right: 1px solid var(--rule); }
.gm-mc-cell:nth-child(-n+2) { border-bottom: 1px solid var(--rule); }
.gm-mc-k { font-size: clamp(10px, 3.2cqi, 12px); color: var(--muted); }
.gm-mc-v { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 6px; margin-top: 4px; font-weight: 600; }
.gm .gm-mc .pill { font-size: clamp(9px, 3.2cqi, 12px); min-width: 0; padding: 2px 7px; }
