/* The Knicks card (js/knicks.js) and the league page it opens (/knicks).
   Tokens only (css/tokens.css), so the dark theme comes with them; the three
   colours of the canvas's visual language are set here, light and dark:
     Knicks blue  the Knicks, and only the Knicks: their wins, their lead
     league gray  everyone else, and the Knicks' losses
     coral        never data; only what you tap (the tokens' --coral-strong)
   Blue and gray were checked for colour blindness and contrast on both
   surfaces (light #006BB6/#8C8476 on white, dark #3B93EE/#6C7480 on #0F1C30). */

.nba {
  --nba-blue: #006bb6;
  --nba-on-blue: #ffffff;
  --nba-blue-wash: rgba(0, 107, 182, .14);
  --nba-gray: #8c8476;
  --nba-gray-wash: rgba(140, 132, 118, .18);
  --nba-ghost: #e6e1d8;
  --nba-quiet: #c9c2b5;
  --nba-togo: rgba(23, 21, 15, .025);
  color: var(--ink);
  font-family: var(--font-sans);
}
[data-theme="dark"] .nba {
  --nba-blue: #3b93ee;
  --nba-on-blue: #0a1628;
  --nba-blue-wash: rgba(59, 147, 238, .18);
  --nba-gray: #6c7480;
  --nba-gray-wash: rgba(108, 116, 128, .24);
  --nba-ghost: #22334d;
  --nba-quiet: #34496a;
  --nba-togo: rgba(232, 237, 245, .03);
}

/* ── The card ──────────────────────────────────────────────────────── */
.nba-card {
  margin: var(--space-4) 1rem; padding: var(--space-4);
  display: flex; flex-direction: column; gap: var(--space-3);
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg);
}
.nba-card.is-live { margin-top: var(--space-3); }

.nba-kicker {
  display: flex; align-items: center; flex-wrap: wrap; gap: 0 var(--space-2);
  font: 800 var(--text-xs)/1.3 var(--font-sans); letter-spacing: .06em; text-transform: uppercase;
}
.nba-kick-sub { font-weight: 500; letter-spacing: 0; text-transform: none; color: var(--ink-3); }
.nba-live { color: var(--coral-strong); }
.nba-live-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--coral); box-shadow: 0 0 0 4px var(--coral-wash); }

.nba-chip {
  display: inline-flex; align-items: center; justify-content: center; flex: none;
  min-width: 34px; height: 22px; padding: 0 4px; box-sizing: border-box; border-radius: 5px;
  border: 1.5px solid var(--line-strong); color: var(--ink-2);
  font: 800 10px/1 var(--font-sans); letter-spacing: .02em;
}
.nba-chip.is-nyk { background: var(--nba-blue); border-color: var(--nba-blue); color: var(--nba-on-blue); }
.nba-kicker .nba-chip { min-width: 32px; height: 20px; }

.nba-score { display: flex; flex-direction: column; gap: 4px; font-variant-numeric: tabular-nums; }
.nba-row { display: flex; align-items: center; gap: 10px; min-height: 36px; }
.nba-team { flex: 1; min-width: 0; font: 600 var(--text-lg)/1.2 var(--font-sans); color: var(--ink-2); }
.nba-row.is-us .nba-team { font-weight: 800; color: var(--ink); }
.nba-pts { font: 800 2.25rem/1.05 var(--font-sans); letter-spacing: -0.02em; }
.nba-row.is-lost .nba-pts { font-weight: 600; color: var(--ink-3); }
.nba-row.is-lost .nba-team { color: var(--ink-2); }

.nba-matchup { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: var(--space-3); }
.nba-tip { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; text-align: right; }
.nba-tip-time { font: 800 2.25rem/1 var(--font-sans); letter-spacing: -0.03em; }
.nba-tip-tv { color: var(--ink-2); font: 400 var(--text-sm)/1.2 var(--font-sans); }

.nba-note {
  display: flex; align-items: center; gap: 10px; margin: 0; padding: 10px 12px;
  border-radius: var(--r-md); background: var(--sunk); font: 600 var(--text-sm)/1.35 var(--font-sans);
}
.nba-note svg { flex: none; }

.nba-countdown { display: flex; align-items: center; gap: 14px; }
.nba-countdown > div { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.nba-big { font: 800 4rem/.9 var(--font-head); letter-spacing: -0.04em; }
.nba-big-rec { font-size: 2.75rem; line-height: 1; letter-spacing: -0.03em; }
.nba-big-sub { font: 800 var(--text-lg)/1.2 var(--font-head); }
.nba-line { color: var(--ink-2); font: 400 var(--text-sm)/1.35 var(--font-sans); }

.nba-block { display: flex; flex-direction: column; gap: 6px; }
.nba-rule { border-top: 1px solid var(--line); padding-top: var(--space-3); }
.nba-block-head { display: flex; justify-content: space-between; align-items: baseline; gap: var(--space-2); font: 800 var(--text-xs)/1.3 var(--font-sans); }
.nba-rec { font-size: var(--text-base); }
.nba-trophy { display: inline-flex; align-items: center; gap: 4px; }
.nba-label { font: 800 11px/1.3 var(--font-sans); letter-spacing: .06em; text-transform: uppercase; color: var(--ink-3); }
.nba-faint { font: 400 11px/1.3 var(--font-sans); color: var(--ink-3); }
.nba-split, .nba-axis { display: flex; justify-content: space-between; font: 400 12px/1.3 var(--font-sans); color: var(--ink-2); font-variant-numeric: tabular-nums; }
.nba-axis { font-size: 11px; color: var(--ink-3); }
.nba-split strong { color: var(--ink); }

.nba-svg { display: block; width: 100%; height: auto; overflow: visible; }
.nba-svg path { fill: none; }
.nba-base { stroke: var(--line-strong); stroke-width: 1px; }
.nba-qline { stroke: var(--line); stroke-width: 1px; }
.nba-w { stroke: var(--nba-blue); stroke-linecap: round; }
.nba-l { stroke: var(--nba-gray); stroke-linecap: round; }
.nba-ghost { stroke: var(--nba-ghost); stroke-linecap: round; }
.nba-svg .nba-wash-w { fill: var(--nba-blue-wash); }
.nba-svg .nba-wash-l { fill: var(--nba-gray-wash); }
.nba-svg .nba-togo { fill: var(--nba-togo); }
.nba-line-w, .nba-line-l { stroke-width: 2px; stroke-linecap: round; stroke-linejoin: round; }
.nba-line-w { stroke: var(--nba-blue); }
.nba-line-l { stroke: var(--nba-gray); }
.nba-pace-ghost, .nba-pace-now { stroke-width: 2px; stroke-linecap: round; stroke-linejoin: round; }
.nba-pace-ghost { stroke: var(--nba-quiet); }
.nba-pace-now { stroke: var(--nba-blue); }
.nba-dot { fill: var(--nba-blue); stroke: var(--surface); stroke-width: 2px; }
.nba-dot-ghost { fill: var(--nba-quiet); stroke: var(--surface); stroke-width: 2px; }

.nba-flow { margin: 0; display: flex; flex-direction: column; gap: 4px; }
.nba-flow-head { display: flex; justify-content: space-between; gap: var(--space-2); font: 800 11px/1.3 var(--font-sans); letter-spacing: .06em; text-transform: uppercase; color: var(--ink-3); }
.nba-flow-box { position: relative; }
.nba-flow-lab, .nba-flow-end, .nba-flow-togo { position: absolute; font: 800 11px/1.2 var(--font-sans); white-space: nowrap; }
.nba-flow-lab { transform: translateX(-50%); }
.nba-flow-lab.is-up { top: -2px; }
.nba-flow-lab.is-down { bottom: 2px; color: var(--ink-2); font-weight: 700; }
.nba-flow-end { font-size: 13px; }
.nba-flow-togo { right: 6px; top: 4px; font-weight: 400; color: var(--ink-3); }
.nba-quarters-axis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); width: 98%; text-align: center; font: 400 11px/1.3 var(--font-sans); color: var(--ink-3); }
.nba-quarters-axis .is-now { color: var(--ink); font-weight: 800; }

.nba-legend { display: flex; flex-wrap: wrap; gap: 4px 12px; font: 600 12px/1.3 var(--font-sans); letter-spacing: 0; text-transform: none; color: var(--ink-2); }
.nba-legend > span { display: inline-flex; align-items: center; gap: 6px; }
.nba-legend strong { color: var(--ink); }
.nba-key { display: block; width: 14px; height: 3px; border-radius: 2px; }
.nba-key.is-w { background: var(--nba-blue); }
.nba-key.is-l { background: var(--nba-gray); }
.nba-key.is-ghost { background: var(--nba-quiet); }
.nba-tick { display: block; width: 6px; height: 14px; }
.nba-tick.is-w { background: var(--nba-blue); border-radius: 3px 3px 0 0; }
.nba-tick.is-l { background: var(--nba-gray); border-radius: 0 0 3px 3px; }
.nba-tick.is-ghost { background: var(--nba-ghost); border-radius: 3px; }

.nba-quarters {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(0, 1fr)); gap: var(--space-2);
  padding: 10px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line);
  font-variant-numeric: tabular-nums;
}
.nba-q { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.nba-q-name { font: 400 11px/1.3 var(--font-sans); color: var(--ink-3); }
.nba-q-bar { position: relative; display: block; width: 100%; height: 32px; }
.nba-q-bar::before { content: ""; position: absolute; left: 8px; right: 8px; top: 16px; height: 1px; background: var(--line-strong); }
.nba-q-bar i { position: absolute; left: 50%; margin-left: -4px; width: 8px; }
.nba-q-bar i.is-w { background: var(--nba-blue); border-radius: 3px 3px 0 0; }
.nba-q-bar i.is-l { background: var(--nba-gray); border-radius: 0 0 3px 3px; }
.nba-q-score { font: 800 var(--text-sm)/1.2 var(--font-sans); }
.nba-q-score.is-lost { font-weight: 600; color: var(--ink-2); }

.nba-pair { display: grid; grid-template-columns: minmax(0, auto) minmax(0, 1fr); gap: var(--space-4); align-items: center; }
.nba-meet { display: flex; flex-direction: column; gap: 4px; }
.nba-meet-svg { width: auto; height: 64px; }
.nba-meet-labels { display: flex; gap: 16px; font: 400 11px/1.3 var(--font-sans); color: var(--ink-2); text-align: center; }
.nba-meet-labels strong { color: var(--ink); }
.nba-then { display: flex; flex-direction: column; gap: 4px; padding-left: var(--space-3); border-left: 1px solid var(--line); font: 700 var(--text-base)/1.3 var(--font-sans); }

.nba-slate { list-style: none; margin: 4px 0 0; padding: 0; font-variant-numeric: tabular-nums; }
.nba-slate li { display: flex; align-items: center; gap: var(--space-2); min-height: 32px; color: var(--ink-2); font: 400 var(--text-sm)/1.2 var(--font-sans); }
.nba-slate li.is-us { color: var(--ink); font-weight: 700; }
.nba-slate .nba-more { color: var(--ink-3); }
.nba-time { width: 44px; color: var(--ink-3); }
.nba-slate li.is-us .nba-time { color: var(--ink); }
.nba-at { color: var(--ink-3); font-weight: 400; }
.nba-slate-score { margin-left: auto; font-weight: 800; color: var(--ink); }
.nba-slate-state { min-width: 4.5rem; text-align: right; font-size: var(--text-xs); color: var(--ink-3); }

.nba-week { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
.nba-week-day { display: flex; flex-direction: column; align-items: center; gap: 3px; padding: var(--space-2) 0; border-radius: var(--r-md); background: var(--sunk); }
.nba-week-day span { font: 700 11px/1.2 var(--font-sans); color: var(--ink-3); }
.nba-week-day strong { font: 800 var(--text-sm)/1.2 var(--font-sans); }

.nba-ladder { display: flex; gap: 10px; flex-wrap: wrap; }
.nba-sq-group { display: flex; flex-direction: column; gap: 4px; font: 400 11px/1.2 var(--font-sans); color: var(--ink-3); }
.nba-sq-row { display: flex; gap: 2px; }
.nba-sq {
  display: flex; align-items: center; justify-content: center; width: 18px; height: 24px; box-sizing: border-box;
  border-radius: 4px; background: var(--line-strong); color: var(--nba-on-blue); font: 800 10px/1 var(--font-sans);
}
.nba-sq.is-mid { background: var(--line); }
.nba-sq.is-out { background: transparent; border: 1px solid var(--line); }
.nba-sq.is-nyk { background: var(--nba-blue); }

.nba-meta { display: flex; justify-content: space-between; gap: var(--space-2); margin: 0; color: var(--ink-2); font: 400 var(--text-sm)/1.3 var(--font-sans); }
.nba-meta span:last-child { color: var(--ink-3); }
.nba-next { margin: 0; color: var(--ink-2); font: 400 var(--text-sm)/1.35 var(--font-sans); }
.nba-next strong { color: var(--ink); }
.nba-link {
  display: inline-flex; align-items: center; align-self: flex-start; min-height: var(--hit); margin: -8px 0 -10px;
  color: var(--coral-strong); font: 700 var(--text-sm)/1 var(--font-sans); text-decoration: none;
}
.nba-link:hover { text-decoration: underline; text-underline-offset: 3px; }
.nba-link:focus-visible, .nba-coverage:focus-visible { outline: var(--focus-ring); outline-offset: 2px; }
.nba-coverage { margin-top: 0; }

/* ── The league page ───────────────────────────────────────────────── */
.nba-page { max-width: 1180px; margin: 0 auto; box-sizing: border-box; padding: var(--space-6) 1.25rem var(--space-7); display: flex; flex-direction: column; gap: var(--space-5); }
.nba-page-head { display: flex; flex-direction: column; gap: var(--space-2); }
.nba-page-head h1 { margin: 0; font: 800 var(--text-2xl)/1.1 var(--font-head); letter-spacing: var(--track-tight); }   /* a page title, as the feed's */
.nba-lede { margin: var(--space-1) 0 0; max-width: 46rem; color: var(--ink-2); font: 400 var(--text-lg)/1.45 var(--font-sans); }
.nba-grid { display: flex; flex-wrap: wrap; gap: var(--space-5); align-items: flex-start; }
.nba-panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: var(--space-5); display: flex; flex-direction: column; gap: var(--space-4); min-width: 0; box-sizing: border-box; }
.nba-panel h2 { display: flex; align-items: center; gap: var(--space-3); margin: 0; font: 800 var(--text-xl)/1.15 var(--font-head); letter-spacing: -0.015em; }
.nba-panel h3 { margin: 0; font: 800 var(--text-lg)/1.2 var(--font-head); }
.nba-panel-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: var(--space-3); }
.nba-season { flex: 999 1 560px; }
.nba-tonight { flex: 1 1 300px; }
.nba-tiles { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: var(--space-3); }
.nba-tile { display: flex; flex-direction: column; gap: 6px; padding: var(--space-3); border: 1px solid var(--line); border-radius: var(--r-md); }
.nba-tile-opp { display: flex; align-items: center; gap: 6px; color: var(--ink-3); font: 700 var(--text-sm)/1.2 var(--font-sans); }
.nba-tile-meta { color: var(--ink-2); font: 400 13px/1.3 var(--font-sans); font-variant-numeric: tabular-nums; }
.nba-tile-note { color: var(--ink-3); font: 700 11px/1.3 var(--font-sans); }
.nba-slate-wide li { border-top: 1px solid var(--line); min-height: 40px; }
.nba-tables { display: flex; flex-wrap: wrap; gap: var(--space-5); align-items: flex-start; }
.nba-table-panel { flex: 1 1 420px; gap: var(--space-3); }
.nba-table-scroll { overflow-x: auto; }
.nba-table { width: 100%; min-width: 360px; border-collapse: collapse; font: 400 var(--text-sm)/1.2 var(--font-sans); font-variant-numeric: tabular-nums; }
.nba-table th { padding: 0 8px 6px; text-align: left; color: var(--ink-3); font: 800 11px/1.3 var(--font-sans); letter-spacing: .06em; text-transform: uppercase; }
.nba-table td { height: 40px; padding: 0 8px; }
.nba-table .nba-num { text-align: right; }
.nba-table tr.is-us td { background: var(--nba-blue-wash); font-weight: 800; }
.nba-table tr.is-us td:first-child { border-radius: 8px 0 0 8px; }
.nba-table tr.is-us td:last-child { border-radius: 0 8px 8px 0; }
.nba-rank { width: 24px; color: var(--ink-3); font-size: 12px; }
.nba-teamcell { display: flex; align-items: center; gap: var(--space-2); min-width: 0; }
.nba-tag { color: var(--ink-3); font: 600 11px/1 var(--font-sans); }
.nba-cut td { height: auto; padding: 8px 8px 2px; }
.nba-cut span { display: flex; align-items: center; gap: var(--space-2); color: var(--ink-3); font: 700 11px/1 var(--font-sans); letter-spacing: .06em; text-transform: uppercase; }
.nba-cut span::after { content: ""; flex: 1; height: 1px; background: var(--line-strong); }
.nba-last10 { display: block; }
.nba-last10 .nba-l10-w, .nba-last10 .nba-l10-l { stroke-width: 4px; stroke-linecap: round; }
.nba-last10 .nba-l10-w { stroke: var(--nba-gray); }
.nba-last10 .nba-l10-l { stroke: var(--line-strong); }
.nba-last10.is-us .nba-l10-w { stroke: var(--nba-blue); }
.nba-last10.is-us .nba-l10-l { stroke: var(--nba-gray); }
.nba-wait { margin: 0; color: var(--ink-2); font: 400 var(--text-base)/1.45 var(--font-sans); }
.nba-foot { margin: 0; color: var(--ink-3); font: 400 13px/1.45 var(--font-sans); }

/* From 1000px the page sits on the New York feed's shell, as National does
   (the user, 11 Oct): the feed's 1180px grid of 190px rail / column / 296px,
   2rem gaps, 1.25rem at the sides (styles.css #home-layout), with the rail
   in the first (partials/site_rail.html, fixed; site-header.css). Its left
   edge is the feed column's; the page takes the column and the feed's right
   column together, since the season's chart and the standings need the
   width, so its right edge is the feed's too. */
@media (min-width: 1000px) {
  .nba-page { display: grid; grid-template-columns: 190px minmax(0, 1fr) 296px; column-gap: 2rem; row-gap: var(--space-5); align-items: start; }
  .nba-page > * { grid-column: 2 / 4; min-width: 0; }
}
/* At the shell's full width the season and Tonight always fit side by side:
   the season takes the feed's column and Tonight its right column, edge for
   edge (590px and 296px, 2rem apart). */
@media (min-width: 1180px) {
  .nba-grid { column-gap: 2rem; }
  .nba-tonight { flex: 0 0 296px; }
}
