/* ── Reset & variables ───────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg:       #ffffff;
  --surface:  #f4f5f7;
  --border:   #d1d5db;
  --text:     #111827;
  --muted:    #6b7280;
  --red:      #c8102e;   /* NBA red */
  --blue:     #1d428a;   /* NBA blue */
  --green:    #16a34a;
  --yellow:   #ca8a04;
  --orange:   #c2570a;
  --radius:   10px;
}

/* ── Base ────────────────────────────────────────────────────────── */
body {
  background: var(--bg);
  color: var(--text);
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 15px;
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ── Header ──────────────────────────────────────────────────────── */
header {
  background: var(--surface);
  border-bottom: 3px solid var(--red);
  padding: 0.9rem 2rem;
}

.header-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

/* Push nav + clocks to the right */
.header-inner nav { margin-left: auto; }

/* ── Real-time clocks ─────────────────────────────────────────────── */
.clocks {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  margin-left: 1rem;
  font-size: 0.85rem;
  white-space: nowrap;
}

.clock-item {
  display: flex;
  align-items: center;
  gap: 0.3rem;
}

.clock-tz {
  font-weight: 700;
  color: var(--muted);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.clock-time {
  color: var(--text);
  font-size: 0.85rem;
  font-variant-numeric: tabular-nums;
}

.clock-sep {
  color: var(--border);
  font-size: 0.9rem;
}

.logo { font-size: 1.6rem; }

header h1 {
  font-size: 1.4rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

/* ── Main ────────────────────────────────────────────────────────── */
main {
  flex: 1;
  max-width: 1200px;
  width: 100%;
  margin: 0 auto;
  padding: 2rem 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 3rem;
}

/* ── Section headings ────────────────────────────────────────────── */
section h2 {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--muted);
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.date-label {
  font-weight: 400;
  color: var(--muted);
  font-size: 0.7rem;
  background: var(--border);
  padding: 0.1rem 0.5rem;
  border-radius: 999px;
}

.live-badge {
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--red);
  background: rgba(200,16,46,.12);
  border: 1px solid rgba(200,16,46,.3);
  padding: 0.1rem 0.5rem;
  border-radius: 999px;
  animation: pulse-opacity 1.5s ease-in-out infinite;
}

@keyframes pulse-opacity {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.5; }
}

/* ── Game cards ──────────────────────────────────────────────────── */
.games-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 1rem;
}

/* .game-card is the clickable card anchor — it is the visual card surface. */
.game-card {
  display: block;
  text-decoration: none;
  color: inherit;
  cursor: pointer;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.1rem 1.2rem;
  border-left: 3px solid var(--border);
  transition: border-color 0.15s, box-shadow 0.15s;
}

.game-card.final     { border-left-color: var(--green); }
.game-card.live      { border-left-color: var(--red); animation: pulse-border 2s ease-in-out infinite; }
.game-card.scheduled { border-left-color: var(--blue); }

.game-card:hover {
  border-color: var(--red);
  box-shadow: 0 0 0 1px var(--red);
}

@keyframes pulse-border {
  0%, 100% { border-left-color: var(--red); }
  50%       { border-left-color: rgba(200,16,46,.4); }
}

.status-live {
  color: var(--red);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.logo-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.5rem;
}

.team-logo {
  width: 48px;
  height: 48px;
  object-fit: contain;
}

.mini-stats {
  display: block;
  font-size: 0.7rem;
  color: var(--muted);
  margin-top: 0.1rem;
}

.matchup {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 0.6rem;
}

.team {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.team .abbr {
  font-size: 1.25rem;
  font-weight: 800;
  letter-spacing: -0.01em;
  color: var(--muted);
}

.team.winner .abbr { color: var(--text); }

.team .pts {
  font-size: 1.55rem;
  font-weight: 800;
  color: var(--muted);
  line-height: 1.1;
}

.team.winner .pts { color: var(--text); }

.team .team-name {
  font-size: 0.75rem;
  color: var(--muted);
  margin-top: 0.1rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.at {
  font-size: 0.75rem;
  color: var(--muted);
  font-weight: 600;
  flex-shrink: 0;
}

.card-footer .status {
  font-size: 0.78rem;
  color: var(--muted);
  font-weight: 500;
}

/* ── Card footer ─────────────────────────────────────────────────── */
.card-footer {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  margin-top: 0.4rem;
}

.box-link {
  font-size: 0.72rem;
  color: var(--red);
  font-weight: 600;
  margin-left: auto;  /* push box-link + history chip to the right */
}

/* ── Nav ─────────────────────────────────────────────────────────── */
nav {
  margin-left: auto;
  display: flex;
  gap: 0.25rem;
}

nav a {
  color: var(--muted);
  text-decoration: none;
  font-size: 0.85rem;
  font-weight: 500;
  padding: 0.3rem 0.75rem;
  border-radius: 6px;
  transition: background 0.12s, color 0.12s;
}

nav a:hover        { background: var(--border); color: var(--text); }
nav a.active       { background: var(--border); color: var(--text); font-weight: 700; }

/* ── Game detail page (gd-*) ─────────────────────────────────────── */
.gd {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 2rem;
}

/* Score header */
.gd-header {
  display: flex;
  align-items: center;
  padding: 1.4rem 1.6rem;
  border-bottom: 1px solid var(--border);
  gap: 1rem;
}

.gd-team {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.gd-team-right {
  align-items: flex-end;
  text-align: right;
}

.gd-abbr {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--muted);
  letter-spacing: -0.02em;
}

.gd-winner .gd-abbr  { color: var(--text); }

.gd-full {
  font-size: 0.78rem;
  color: var(--muted);
}

.gd-score {
  font-size: 2.4rem;
  font-weight: 900;
  color: var(--muted);
  line-height: 1;
}

.gd-winner .gd-score { color: var(--text); }

.gd-sep {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
  flex-shrink: 0;
}

.gd-status {
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--green);
}

.gd-live-label {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.05em;
}

.gd-at {
  font-size: 0.65rem;
  color: var(--muted);
  letter-spacing: 0.1em;
}

/* Team stat comparison */
.gd-teamstats {
  display: flex;
  padding: 1rem 1.6rem;
  border-bottom: 1px solid var(--border);
  font-size: 0.85rem;
}

.ts-label-col {
  flex: 1;
}

.ts-middle-col {
  flex: 0 0 5rem;
  text-align: center;
}

.ts-right-col {
  text-align: right;
}

.ts-team-hdr {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  padding-bottom: 0.4rem;
  margin-bottom: 0.2rem;
  border-bottom: 1px solid var(--border);
}

.ts-mid-hdr   { text-align: center; }
.ts-right-hdr { text-align: right; }

.ts-cell {
  padding: 0.22rem 0;
  color: var(--text);
}

.ts-mid {
  text-align: center;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
}

.ts-missing {
  padding: 0.75rem 1.6rem;
}

/* Player tables */
.gd-players {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
}

.player-section {
  padding: 1rem 1.2rem;
}

.player-section + .player-section {
  border-left: 1px solid var(--border);
}

.player-section-hdr {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--muted);
  margin-bottom: 0.6rem;
}

.box-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.78rem;
}

.box-table th {
  text-align: right;
  padding: 0.3rem 0.4rem;
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

.box-table th.col-name { text-align: left; }

.box-table td {
  text-align: right;
  padding: 0.3rem 0.4rem;
  border-bottom: 1px solid rgba(0,0,0,.08);
  vertical-align: middle;
}

.box-table tbody tr:last-child td { border-bottom: none; }
.box-table tbody tr.starter td    { }
.box-table tbody tr.bench td      { color: var(--muted); }
.box-table tbody tr:hover td      { background: rgba(0,0,0,.04); }

/* ── Starters / Bench divider rows ──────────────────────────────── */
.box-table tbody tr.rotation-divider td {
  background: var(--bg);
  color: var(--muted);
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-align: left !important;
  padding: 0.25rem 0.4rem;
  border-bottom: 1px solid var(--border);
  pointer-events: none;
}
.box-table tbody tr.bench-divider td {
  border-top: 2px solid var(--border);
}

.col-name { text-align: left !important; white-space: nowrap; position: relative; padding-right: 0.8rem !important; }
.col-pos, .col-min { font-size: 0.72rem; }
.col-num  { min-width: 2rem; }
.col-shoot { min-width: 3.2rem; font-size: 0.72rem; }
.col-pm   { min-width: 2.5rem; font-weight: 600; }

.bold  { font-weight: 700; color: var(--text); }
.muted { color: var(--muted); }

.pm-pos { color: var(--green); }
.pm-neg { color: var(--red);   }

.starter-dot {
  display: inline-block;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--blue);
  vertical-align: middle;
  margin-left: 4px;
  position: absolute;
  right: 0.3rem;
  top: 50%;
  transform: translateY(-50%);
}

@media (max-width: 860px) {
  .gd-players { grid-template-columns: 1fr; }
  .player-section + .player-section { border-left: none; border-top: 1px solid var(--border); }
}

/* ── Injury table ────────────────────────────────────────────────── */
.table-wrap { overflow-x: auto; }

.injury-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
}

.injury-table th {
  text-align: left;
  padding: 0.5rem 0.9rem;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--muted);
  border-bottom: 1px solid var(--border);
}

.injury-table td {
  padding: 0.55rem 0.9rem;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}

.injury-table tbody tr:last-child td { border-bottom: none; }
.injury-table tbody tr:hover td      { background: var(--surface); }

.abbr-sm {
  font-weight: 700;
  font-size: 0.85rem;
  color: var(--text);
}

.comment { color: var(--muted); }

/* Status badges */
.badge {
  display: inline-block;
  padding: 0.15rem 0.55rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.badge-out          { background: rgba(200,16,46,.15);  color: var(--red);    }
.badge-suspension   { background: rgba(200,16,46,.15);  color: var(--red);    }
.badge-doubtful     { background: rgba(249,115,22,.15); color: var(--orange); }
.badge-questionable { background: rgba(234,179,8,.15);  color: var(--yellow); }
.badge-day-to-day   { background: rgba(234,179,8,.15);  color: var(--yellow); }
.badge-probable     { background: rgba(34,197,94,.15);  color: var(--green);  }

/* ── Section link (inline in h2) ────────────────────────────────── */
.section-link {
  margin-left: auto;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--red);
  text-decoration: none;
  letter-spacing: 0;
  text-transform: none;
}
.section-link:hover { text-decoration: underline; }

/* ── Injury page: report metadata banner ─────────────────────────── */
.report-meta {
  font-size: 0.85rem;
  color: var(--muted);
  margin-bottom: 1.5rem;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-wrap: wrap;
}

.report-meta strong { color: var(--text); }

.report-meta code {
  background: var(--border);
  padding: 0.1rem 0.4rem;
  border-radius: 4px;
  font-size: 0.78rem;
}

.report-badge {
  display: inline-block;
  padding: 0.15rem 0.6rem;
  border-radius: 999px;
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  background: rgba(29,66,138,.12);
  color: #1d428a;
}

.report-badge-warn {
  background: rgba(234,179,8,.15);
  color: var(--yellow);
}

/* ── Injury filter bar (single-matchup view) ─────────────────────── */
.im-filter-bar { margin-bottom: 1rem; }
.im-back-link { font-size: .85rem; color: var(--accent); text-decoration: none; }
.im-back-link:hover { text-decoration: underline; }

/* ── Injury matchup cards (im-*) ─────────────────────────────────── */
.im-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 1.25rem;
}

.im-card-orphan { opacity: 0.75; }

/* ── im-hero: three-column layout matching game_detail hero ─────── */
.im-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.25rem 1.6rem;
  border-bottom: 1px solid var(--border);
  background: rgba(0,0,0,.02);
}

.im-hero-team {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
  min-width: 72px;
}

.im-hero-logo {
  width: 44px;
  height: 44px;
  object-fit: contain;
}

.im-hero-team-right { align-items: center; }

.im-hero-abbr {
  font-size: 1.35rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--text);
}

.im-hero-name {
  font-size: 0.68rem;
  color: var(--muted);
  font-weight: 500;
  text-align: center;
  max-width: 90px;
}

.im-hero-center {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  flex: 1;
  text-align: center;
  min-width: 220px;
}

/* Meta row below the odds widget: time · count · history */
.im-hero-meta {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-wrap: wrap;
  justify-content: center;
}

/* Card header (legacy orphan card still uses im-header) */
.im-header {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.6rem 1rem;
  padding: 0.85rem 1.4rem;
  border-bottom: 1px solid var(--border);
  background: rgba(0,0,0,.02);
}

.im-teams {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.im-abbr {
  font-size: 1.15rem;
  font-weight: 800;
  letter-spacing: -0.01em;
  color: var(--text);
}

.im-abbr-sm {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text);
}

.im-vs {
  font-size: 0.75rem;
  color: var(--muted);
  font-weight: 600;
}

.im-time {
  font-size: 0.8rem;
  color: var(--muted);
  font-weight: 500;
}

.im-count {
  margin-left: auto;
  font-size: 0.72rem;
  color: var(--muted);
  font-weight: 500;
}

/* Polymarket odds bar inside injury card header */
.im-odds {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.im-odds-labels {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.72rem;
  font-weight: 700;
}

.im-odds-vis  { color: var(--blue); }
.im-odds-home { color: var(--muted); }

.im-odds-src {
  font-size: 0.62rem;
  font-weight: 400;
  color: var(--muted);
  opacity: 0.65;
}
.im-odds-src a { color: inherit; text-decoration: none; }
.im-odds-src a:hover { text-decoration: underline; }

.im-odds-bar {
  display: flex;
  height: 5px;
  border-radius: 3px;
  overflow: hidden;
  background: var(--border);
}

.im-odds-bar-vis {
  height: 100%;
  background: var(--blue);
}

.im-odds-bar-home {
  height: 100%;
  background: var(--muted);
  opacity: 0.45;
}

/* Card body: two columns */
.im-body {
  display: grid;
  grid-template-columns: 1fr 1fr;
}

.im-body-single {
  grid-template-columns: 1fr;
}

.im-col {
  padding: 1rem 1.2rem;
}

.im-col + .im-col {
  border-left: 1px solid var(--border);
}

.im-team-hdr {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  color: var(--muted);
  margin-bottom: 0.65rem;
  padding-bottom: 0.4rem;
  border-bottom: 1px solid var(--border);
}

/* Individual injury row */
.ir-row {
  padding: 0.45rem 0;
  border-bottom: 1px solid rgba(0,0,0,.08);
}

.ir-row:last-child { border-bottom: none; }

.ir-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.ir-name {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text);
}

/* Dim probable players slightly */
.ir-probable .ir-name { color: var(--muted); }

.ir-comment {
  font-size: 0.75rem;
  color: var(--muted);
  margin-top: 0.1rem;
  padding-left: 0.05rem;
}

.im-clean {
  font-size: 0.8rem;
  color: var(--muted);
  font-style: italic;
  padding: 0.3rem 0;
}

@media (max-width: 640px) {
  .im-body { grid-template-columns: 1fr; }
  .im-col + .im-col { border-left: none; border-top: 1px solid var(--border); }
}

/* ══════════════════════════════════════════════════════════════════
   Game Detail Page
   ══════════════════════════════════════════════════════════════════ */

/* ── Hero score header ───────────────────────────────────────────── */
.gd-section { margin-bottom: 0; }

.gd-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  padding: 2rem 1.5rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 1.5rem;
}

.hero-team {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  min-width: 120px;
  opacity: 0.65;
}

.gd-winner { opacity: 1; }

.hero-logo {
  width: 72px;
  height: 72px;
  object-fit: contain;
}

.hero-abbr {
  font-size: 1.5rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--text);
}

.hero-name {
  font-size: 0.72rem;
  color: var(--muted);
  text-align: center;
  font-weight: 500;
}

.hero-score {
  font-size: 3.5rem;
  font-weight: 900;
  letter-spacing: -0.04em;
  color: var(--text);
  line-height: 1;
}

.hero-center {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.35rem;
  min-width: 220px;
  text-align: center;
}

.hero-final {
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  color: var(--muted);
  text-transform: uppercase;
}

.hero-date { font-size: 0.72rem; color: var(--muted); }
.hero-tip  { font-size: 0.9rem; font-weight: 700; color: var(--blue); }

/* ── Polymarket odds widget (hero block — full version) ──────────── */
.odds-widget {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0.42rem;
  width: 100%;
  min-width: 260px;
  max-width: 340px;
  padding: 0.3rem 0;
  margin: 0.1rem 0;
}

/* header row: pulse · POLYMARKET · vol pill */
.odds-header {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.odds-pulse {
  font-size: 0.6rem;
  color: var(--green);
  animation: odds-blink 1.8s ease-in-out infinite;
  line-height: 1;
}

@keyframes odds-blink {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.15; }
}

.odds-title { color: var(--muted); letter-spacing: 0.08em; }

.odds-vol-pill {
  margin-left: auto;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 0.05rem 0.45rem;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--muted);
  white-space: nowrap;
  letter-spacing: 0.02em;
}

/* probability row: vis%  ←space-between→  home% */
.odds-probs-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
}

.odds-prob-vis,
.odds-prob-home {
  font-size: 2.0rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  white-space: nowrap;
  min-width: 55px;
  line-height: 1.1;
}

.odds-prob-vis  { color: var(--blue);  text-align: left;  }
.odds-prob-home { color: var(--muted); text-align: right; }

.odds-bar-wrap {
  display: flex;
  width: 100%;
  height: 8px;
  border-radius: 4px;
  overflow: hidden;
  background: var(--border);
}

.odds-bar-vis {
  height: 100%;
  width: 0;
  background: var(--blue);
  transition: width 0.5s ease;
}

.odds-bar-home {
  height: 100%;
  width: 0;
  background: var(--muted);
  opacity: 0.45;
  transition: width 0.5s ease;
}

/* payout row: vis return | center label | home return */
.odds-payouts-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.3rem;
}

.odds-payout-vis,
.odds-payout-home {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--muted);
  white-space: nowrap;
}

.odds-payout-vis  { text-align: left;  }
.odds-payout-home { text-align: right; }

.odds-payout-label {
  font-size: 0.7rem;
  color: var(--border);
  text-align: center;
  flex: 1;
  white-space: nowrap;
}

.odds-source {
  font-size: 0.72rem;
  color: var(--muted);
  text-decoration: none;
  letter-spacing: 0.04em;
  text-align: center;
  opacity: 0.6;
  display: block;
  padding-top: 0.05rem;
}

.odds-source:hover { opacity: 1; text-decoration: underline; }

/* ── Compact card odds strip ─────────────────────────────────────── */
.card-odds {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.3rem 0 0.25rem;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  margin-bottom: 0.3rem;
}

.card-odds-pulse {
  font-size: 0.5rem;
  color: var(--green);
  animation: odds-blink 1.8s ease-in-out infinite;
  flex-shrink: 0;
}

.card-odds-prob {
  font-size: 1.2rem;
  font-weight: 700;
  white-space: nowrap;
  min-width: 36px;
  letter-spacing: -0.01em;
}

.card-odds-prob-vis  { color: var(--blue); text-align: left;  }
.card-odds-prob-home { color: var(--muted); text-align: right; }

.card-odds-bar-wrap {
  flex: 1;
  height: 5px;
  border-radius: 2px;
  overflow: hidden;
  background: var(--border);
  display: flex;
}

.card-odds-bar-vis {
  height: 100%;
  width: 0;
  background: var(--blue);
  transition: width 0.5s ease;
}

.card-odds-bar-home {
  height: 100%;
  width: 0;
  background: var(--muted);
  opacity: 0.4;
  transition: width 0.5s ease;
}

.card-odds-vol {
  font-size: 0.72rem;
  color: var(--muted);
  opacity: 0.75;
  white-space: nowrap;
  min-width: 28px;
  text-align: right;
  letter-spacing: 0.01em;
}

/* ── Quarter table ───────────────────────────────────────────────── */
.qtable-wrap { overflow-x: auto; }

.qtable {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
}

.qtable th,
.qtable td {
  padding: 0.55rem 0.85rem;
  text-align: center;
  border: 1px solid var(--border);
}

.qtable thead th {
  background: rgba(0,0,0,.04);
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--muted);
}

.qt-team {
  text-align: left !important;
  font-weight: 700;
  color: var(--text);
  white-space: nowrap;
}

.qt-total {
  font-weight: 800;
  color: var(--text);
  background: rgba(255,255,255,.03);
}

.qt-win {
  background: rgba(29,66,138,.12);
  color: #1d428a;
  font-weight: 700;
}

/* ── Stat bars ───────────────────────────────────────────────────── */
.sbar-header {
  display: flex;
  justify-content: space-between;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  color: var(--muted);
  margin-bottom: 0.5rem;
  padding: 0 0.25rem;
}

.sbar-container {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.sbar-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.sbar-val {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--muted);
  min-width: 52px;
  text-align: right;
}

.sbar-val:last-child { text-align: left; }
.sbar-leader { color: var(--text); font-weight: 800; }

.sbar-track {
  flex: 1;
  display: flex;
  align-items: center;
  height: 24px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 4px;
  overflow: hidden;
  position: relative;
}

.sbar-label {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  font-size: 0.62rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  pointer-events: none;
  white-space: nowrap;
  z-index: 1;
}

.sbar-fill    { height: 100%; }
.sbar-vis     { background: rgba(29,66,138,.2); border-radius: 4px 0 0 4px; }
.sbar-home    { background: rgba(29,66,138,.2); border-radius: 0 4px 4px 0; margin-left: auto; }
.sbar-fill-lead { background: rgba(29,66,138,.5); }

/* ── Trailing period timeline ────────────────────────────────────── */
.trail-timeline {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-bottom: 1.5rem;
}

.trail-q {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.2rem;
  padding: 0.6rem 0.9rem;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--surface);
  min-width: 80px;
}

.trail-vis  { border-color: rgba(200,16,46,.35);  background: rgba(200,16,46,.07); }
.trail-home { border-color: rgba(29,66,138,.35);  background: rgba(29,66,138,.07); }

.trail-label {
  font-size: 0.62rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--muted);
}

.trail-score { font-size: 0.85rem; font-weight: 700; color: var(--text); }
.trail-cumul { font-size: 0.72rem; color: var(--muted); }

.trail-tag {
  font-size: 0.7rem;
  font-weight: 700;
  color: #c8102e;
  margin-top: 0.1rem;
}

.trail-home .trail-tag { color: #1d428a; }
.trail-tied-tag { color: var(--muted) !important; font-weight: 500; }

/* ── Analysis section ────────────────────────────────────────────── */
.analysis-team { margin-bottom: 1.5rem; }

.analysis-team-hdr {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--muted);
  margin-bottom: 0.75rem;
  padding-bottom: 0.4rem;
  border-bottom: 1px solid var(--border);
}

.analysis-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.analysis-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 1.2rem;
}

.analysis-card-hdr {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.75rem;
}

.rotation-tag {
  display: inline-block;
  padding: 0.2rem 0.65rem;
  border-radius: 999px;
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.tag-starter { background: rgba(29,66,138,.12); color: #1d428a; }
.tag-bench   { background: rgba(0,0,0,.07); color: var(--muted); }

.analysis-player-count { font-size: 0.72rem; color: var(--muted); }

.analysis-stats {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-bottom: 0.85rem;
}

.astat {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.15rem;
  min-width: 36px;
}

.astat-val {
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--text);
  line-height: 1;
}

.astat-lbl {
  font-size: 0.58rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
}

.analysis-contributors {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  border-top: 1px solid var(--border);
  padding-top: 0.65rem;
}

.contributor {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
}

.contributor-name {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
}

.contributor-line { font-size: 0.72rem; color: var(--muted); }

/* ── Player detail section ───────────────────────────────────────── */
.gd-players {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.player-section-hdr {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--muted);
  margin-bottom: 0.5rem;
  padding-bottom: 0.35rem;
  border-bottom: 1px solid var(--border);
}

@media (max-width: 640px) {
  .gd-hero { flex-direction: column; padding: 1.25rem 1rem; }
  .hero-score { font-size: 2.5rem; }
  .hero-logo  { width: 52px; height: 52px; }
  .analysis-grid { grid-template-columns: 1fr; }
  .trail-timeline { gap: 0.35rem; }
  .trail-q { min-width: 64px; padding: 0.5rem 0.65rem; }
}

/* ── Footer ──────────────────────────────────────────────────────── */
footer {
  max-width: 1200px;
  width: 100%;
  margin: 0 auto;
  padding: 1.25rem 1.5rem 2rem;
  font-size: 0.82rem;
  color: var(--muted);
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 1rem;
}

footer code {
  background: var(--border);
  padding: 0.1rem 0.4rem;
  border-radius: 4px;
  font-size: 0.78rem;
}

.refresh-link {
  margin-left: auto;
  color: var(--red);
  text-decoration: none;
  font-weight: 600;
}

.refresh-link:hover { text-decoration: underline; }

/* ── Empty state ─────────────────────────────────────────────────── */
.empty {
  color: var(--muted);
  font-style: italic;
  padding: 0.75rem 0;
}

/* ── Responsive ──────────────────────────────────────────────────── */
@media (max-width: 600px) {
  main { padding: 1.25rem 1rem; }
  .games-grid { grid-template-columns: 1fr 1fr; }
}

/* ══════════════════════════════════════════════════════════════════
   Player detail page  (pd-*)
   ══════════════════════════════════════════════════════════════════ */

/* ── Clickable player names in box score tables ───────────────────── */
a.player-link {
  color: var(--text);
  text-decoration: none;
  font-weight: inherit;
  transition: color 0.12s;
}
a.player-link:hover { color: var(--blue); text-decoration: underline; }

/* ── Hero header ─────────────────────────────────────────────────── */
.pd-hero {
  display: flex;
  align-items: flex-start;
  gap: 1.75rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.75rem 2rem;
  margin-bottom: 0;
}

.pd-headshot-wrap {
  flex-shrink: 0;
  width: 110px;
  height: 110px;
  border-radius: 50%;
  overflow: hidden;
  border: 3px solid var(--border);
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
}

.pd-headshot {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.pd-headshot-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--surface);
}

.pd-identity { flex: 1; min-width: 0; }

.pd-name {
  font-size: 1.9rem;
  font-weight: 900;
  letter-spacing: -0.03em;
  color: var(--text);
  line-height: 1.1;
  margin-bottom: 0.45rem;
}

.pd-meta-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
  font-size: 0.9rem;
  color: var(--muted);
}

.pd-jersey {
  font-size: 1rem;
  font-weight: 800;
  color: var(--blue);
}

.pd-pos {
  font-weight: 600;
  color: var(--text);
}

.pd-team {
  font-weight: 600;
  color: var(--text);
}

/* ── Bio pills ───────────────────────────────────────────────────── */
.pd-bio-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-bottom: 0.75rem;
}

.pd-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0.18rem 0.65rem;
  font-size: 0.75rem;
  color: var(--text);
}

.pd-pill-label {
  font-size: 0.62rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--muted);
}

/* ── External link ───────────────────────────────────────────────── */
.pd-links { margin-top: 0.35rem; }

.pd-ext-link {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--red);
  text-decoration: none;
}
.pd-ext-link:hover { text-decoration: underline; }

/* ── Key stats headline row ──────────────────────────────────────── */
.pd-key-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 0.5rem;
}

.pd-stat-box {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 80px;
  flex: 1 1 80px;
  max-width: 120px;
}

.pd-stat-val {
  font-size: 1.9rem;
  font-weight: 900;
  color: var(--text);
  letter-spacing: -0.03em;
  line-height: 1;
}

.pd-stat-lbl {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  color: var(--blue);
  margin-top: 0.25rem;
}

.pd-stat-full {
  font-size: 0.62rem;
  color: var(--muted);
  margin-top: 0.15rem;
  text-align: center;
}

/* ── All averages grid ───────────────────────────────────────────── */
.pd-averages-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(90px, 1fr));
  gap: 0.5rem;
}

.pd-avg-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.6rem 0.75rem;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.pd-avg-val {
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--text);
}

.pd-avg-lbl {
  font-size: 0.62rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--muted);
  margin-top: 0.1rem;
}

/* ── Career table tweaks ─────────────────────────────────────────── */
.pd-career-table td,
.pd-career-table th { text-align: right; white-space: nowrap; }

.pd-career-table th:first-child,
.pd-career-table td:first-child { text-align: left; }

.pd-career-table th:nth-child(2),
.pd-career-table td:nth-child(2) { text-align: left; min-width: 3.5rem; }

/* Career / Total summary row */
tr.pd-career-row td {
  font-weight: 700;
  border-top: 2px solid var(--border);
  background: rgba(0,0,0,.03);
}

/* ── Recent games win/loss row tint ─────────────────────────────── */
tr.pd-game-win  td { background: rgba(34,197,94,.04); }
tr.pd-game-loss td { background: transparent; }

/* ── W/L badge inside matchup cell ──────────────────────────────── */
.pd-wl-badge {
  display: inline-block;
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  padding: 1px 5px;
  border-radius: 3px;
  margin-left: 4px;
  vertical-align: middle;
}
.pd-wl-w { background: rgba(34,197,94,.15); color: #16a34a; }
.pd-wl-l { background: rgba(200,16,46,.10); color: var(--red); }

/* ── Fewer-than-10-games note ────────────────────────────────────── */
.pd-games-note {
  font-size: 0.82rem;
  color: var(--muted);
  background: rgba(0,0,0,.03);
  border-left: 3px solid var(--border);
  padding: 0.45rem 0.75rem;
  margin-bottom: 0.75rem;
  border-radius: 0 var(--radius) var(--radius) 0;
}

/* ── ESPN unavailable notice ─────────────────────────────────────── */
.pd-espn-error {
  background: rgba(200,16,46,.06);
  border: 1px solid rgba(200,16,46,.2);
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
  font-size: 0.88rem;
  color: var(--text);
}

.pd-error-details {
  font-size: 0.82rem;
  color: var(--muted);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.6rem 1rem;
}

.pd-error-details summary { cursor: pointer; font-weight: 600; color: var(--muted); }
.pd-error-details ul      { margin-top: 0.5rem; padding-left: 1.25rem; }
.pd-error-details li      { margin-bottom: 0.25rem; }

/* ── Trailing Period Analysis ────────────────────────────────────── */
.trailing-team {
  margin-bottom: 1.75rem;
}

.trailing-team-hdr {
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: .03em;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: .6rem;
  margin-bottom: .75rem;
}

.trailing-periods-tag {
  background: rgba(200, 16, 46, .1);
  color: var(--red);
  border: 1px solid rgba(200, 16, 46, .25);
  border-radius: 20px;
  font-size: .7rem;
  font-weight: 600;
  letter-spacing: .04em;
  text-transform: uppercase;
  padding: .2rem .65rem;
}

.trailing-never-tag {
  background: rgba(22, 163, 74, .1);
  color: var(--green);
  border: 1px solid rgba(22, 163, 74, .25);
  border-radius: 20px;
  font-size: .7rem;
  font-weight: 600;
  letter-spacing: .04em;
  text-transform: uppercase;
  padding: .2rem .65rem;
}

.trailing-grid {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

.trailing-card {
  flex: 1 1 260px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 1.2rem;
}

.trailing-card-hdr {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: .6rem;
}

.trailing-card-sub {
  font-size: .75rem;
  color: var(--muted);
}

/* ── Rotation Analysis ───────────────────────────────────────────── */
.ra-team {
  margin-bottom: 2rem;
}

.ra-team-hdr {
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: .75rem;
  padding-bottom: .35rem;
  border-bottom: 1px solid var(--border);
}

.ra-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  align-items: start;
}

/* ── Situation card ─────────────────────────────────────────── */
.ra-situation {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  gap: .6rem;
  padding: 0 0 .75rem;
}

.ra-leading  { border-top: 3px solid var(--green); }
.ra-close    { border-top: 3px solid var(--blue); }
.ra-trailing { border-top: 3px solid var(--red); }

.ra-sit-hdr {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .5rem;
  flex-wrap: wrap;
  padding: .6rem .75rem .3rem;
}

.ra-sit-label {
  font-size: .7rem;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  padding: .15rem .55rem;
  border-radius: 20px;
}

.ra-label-leading  { background: rgba(22, 163, 74, .12);  color: var(--green); border: 1px solid rgba(22, 163, 74, .3); }
.ra-label-close    { background: rgba(29, 66, 138, .1);   color: var(--blue);  border: 1px solid rgba(29, 66, 138, .25); }
.ra-label-trailing { background: rgba(200, 16, 46, .1);   color: var(--red);   border: 1px solid rgba(200, 16, 46, .25); }

.ra-sit-periods {
  font-size: .72rem;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.ra-sit-none {
  font-size: .72rem;
  color: var(--muted);
}

.ra-absent, .ra-loading {
  color: var(--muted);
  font-size: .82rem;
  font-style: italic;
  padding: .5rem .75rem;
}

/* ── Group (Starters / Bench) ───────────────────────────────── */
.ra-group {
  background: var(--bg);
  border-top: 1px solid var(--border);
  margin: 0 .5rem;
  border-radius: calc(var(--radius) - 2px);
  overflow: hidden;
}

.ra-group-hdr {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: .45rem .65rem .3rem;
}

.ra-group-count {
  font-size: .68rem;
  color: var(--muted);
}

/* ── Aggregate summary bar ──────────────────────────────────── */
.ra-agg-bar {
  display: flex;
  align-items: baseline;
  gap: .6rem;
  padding: .1rem .65rem .45rem;
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
}

.ra-agg-pts {
  font-size: 1.25rem;
  font-weight: 700;
  line-height: 1;
  font-variant-numeric: tabular-nums;
  margin-right: .1rem;
}

.ra-agg-pts small, .ra-agg-stat small {
  font-size: .62rem;
  font-weight: 400;
  color: var(--muted);
  margin-left: .15rem;
  text-transform: uppercase;
  letter-spacing: .03em;
}

.ra-agg-stat {
  font-size: .82rem;
  font-weight: 600;
  color: var(--text);
  font-variant-numeric: tabular-nums;
}

/* ── Per-player table ───────────────────────────────────────── */
.ra-table {
  width: 100%;
  border-collapse: collapse;
  font-size: .76rem;
}

.ra-table thead tr {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}

.ra-th-name,
.ra-th-num {
  padding: .3rem .5rem;
  font-weight: 600;
  color: var(--muted);
  font-size: .68rem;
  letter-spacing: .04em;
  text-transform: uppercase;
  white-space: nowrap;
}

.ra-th-name { text-align: left; min-width: 90px; }
.ra-th-num  { text-align: right; width: 38px; }

.ra-tr {
  border-bottom: 1px solid var(--border);
}

.ra-tr:last-child { border-bottom: none; }

.ra-tr:hover { background: var(--surface); }

.ra-td-name,
.ra-td-num {
  padding: .32rem .5rem;
  white-space: nowrap;
}

.ra-td-name {
  text-align: left;
  max-width: 110px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ra-td-name a { text-decoration: none; color: var(--text); }
.ra-td-name a:hover { text-decoration: underline; color: var(--blue); }

.ra-td-num  { text-align: right; font-variant-numeric: tabular-nums; }

.ra-pts     { font-weight: 700; }
.ra-shoot   { color: var(--muted); font-size: .72rem; }

.ra-to-warn { color: var(--red); font-weight: 600; }

/* ── Team playoff / play-in badges ──────────────────────────────── */
.ra-team-hdr {
  display: flex;
  align-items: center;
  gap: .5rem;
}

.ra-badge {
  font-size: .65rem;
  font-weight: 700;
  letter-spacing: .05em;
  text-transform: uppercase;
  padding: .15rem .5rem;
  border-radius: 20px;
  white-space: nowrap;
  vertical-align: middle;
}

.ra-badge-playoff {
  background: rgba(22, 163, 74, .12);
  color: var(--green);
  border: 1px solid rgba(22, 163, 74, .3);
}

.ra-badge-playin {
  background: rgba(29, 66, 138, .1);
  color: var(--blue);
  border: 1px solid rgba(29, 66, 138, .25);
}

.ra-badge-eliminated {
  background: rgba(107, 114, 128, .1);
  color: var(--muted);
  border: 1px solid rgba(107, 114, 128, .25);
}

/* ── Rotation Timeline (stint tables) ───────────────────────────── */
.stint-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.5rem;
  align-items: start;
}

.stint-team {}

.stint-team-hdr {
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: .05em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: .6rem;
  padding-bottom: .3rem;
  border-bottom: 1px solid var(--border);
}

.stint-table {
  width: 100%;
  border-collapse: collapse;
  font-size: .76rem;
}

.stint-table thead tr {
  background: var(--surface);
  border-bottom: 2px solid var(--border);
}

.st-th-name { text-align: left; padding: .3rem .5rem; font-size: .68rem; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; min-width: 100px; }
.st-th-q    { text-align: center; padding: .3rem .4rem; font-size: .68rem; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.st-th-clk  { text-align: right; padding: .3rem .5rem; font-size: .68rem; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.st-th-num  { text-align: right; padding: .3rem .4rem; width: 36px; font-size: .68rem; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }

/* Group header rows */
.stint-grp-hdr td {
  font-size: .66rem;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--muted);
  background: var(--surface);
  padding: .25rem .5rem;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.stint-bench-hdr td {
  border-top: 2px solid var(--border);
}

/* Player rows */
.stint-row { border-bottom: 1px solid var(--border); }
.stint-row:last-child { border-bottom: none; }
.stint-row:hover { background: var(--surface); }

/* Visual separator between players — top border on first stint of each new player */
.stint-first .st-td-name {
  border-top: 2px solid var(--border);
}

/* Suppress the top border for the very first player row after a group header */
.stint-grp-hdr + .stint-row .st-td-name,
.stint-grp-hdr + .stint-row + .stint-row:not(.stint-cont) .st-td-name {
  border-top: none;
}

.st-td-name {
  padding: .3rem .5rem;
  min-width: 100px;
  max-width: 130px;
}

.st-name-wrap {
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.st-td-name a { color: var(--text); text-decoration: none; }
.st-td-name a:hover { text-decoration: underline; color: var(--blue); }

.st-pos-tag {
  display: inline-block;
  width: fit-content;
  font-size: .6rem;
  font-weight: 700;
  padding: .05rem .3rem;
  border-radius: 2px;
  background: rgba(29,66,138,.1);
  color: var(--blue);
  text-transform: uppercase;
  letter-spacing: .04em;
  margin-top: 2px;
  line-height: 1.4;
}

.st-td-q   { text-align: center; padding: .3rem .4rem; font-size: .72rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.st-td-clk { text-align: right;  padding: .3rem .5rem; font-size: .72rem; font-variant-numeric: tabular-nums; }
.st-td-num { text-align: right;  padding: .3rem .4rem; font-variant-numeric: tabular-nums; }

.st-pts      { font-weight: 700; }
.st-shoot    { color: var(--muted); font-size: .71rem; }
.st-to-warn  { color: var(--red);  font-weight: 600; }
.st-foul-warn { color: #f97316; font-weight: 600; } /* foul trouble: 3+ fouls in a stint */

/* Sub context — small label below the enter/exit clock time */
.sub-ctx {
  display: block;
  font-size: .72rem;
  color: var(--muted);
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 7rem;
}

.stint-totals-row {
  background: var(--surface);
  border-top: 1px dashed var(--border);
  border-bottom: 2px solid var(--border);
}
.stint-totals-row td { font-size: .7rem; color: var(--muted); }
.stint-totals-row .st-pts,
.stint-totals-row .st-td-num { color: var(--text); font-weight: 600; }
.st-totals-label { font-style: italic; }

/* ── Stints section controls ──────────────────────────────────────────── */
.btn-refresh-stints {
  display: inline-block;
  margin-left: .6rem;
  padding: .15rem .55rem;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: var(--surface);
  color: var(--muted);
  font-size: .68rem;
  cursor: pointer;
  vertical-align: middle;
  transition: background .15s, color .15s;
}
.btn-refresh-stints:hover:not(:disabled) { background: var(--accent); color: #fff; }
.btn-refresh-stints:disabled { opacity: .55; cursor: default; }

.stints-error-bar {
  margin: .4rem 0;
  padding: .35rem .7rem;
  border-radius: 4px;
  background: #450a0a;
  color: #fca5a5;
  font-size: .75rem;
}

.st-active-badge {
  display: inline-block;
  padding: .1rem .35rem;
  border-radius: 4px;
  font-size: .65rem;
  font-weight: 700;
  letter-spacing: .04em;
  background: #166534;
  color: #bbf7d0;
  animation: pulse-active 1.4s ease-in-out infinite;
}
@keyframes pulse-active {
  0%, 100% { opacity: 1; }
  50%       { opacity: .55; }
}

.st-total-min {
  display: inline-block;
  margin-left: .35rem;
  font-size: .64rem;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

/* ══════════════════════════════════════════════════════════════════
   Debug Inspector Panel
   ══════════════════════════════════════════════════════════════════ */

#debug-panel {
  margin-top: 2.5rem;
  border: 2px solid #7c3aed;
  border-radius: 8px;
  background: #0a0a14;
  padding: 1rem 1.2rem 1.4rem;
  font-family: var(--font-mono, 'JetBrains Mono', 'Fira Code', monospace);
}

.debug-hdr {
  display: flex;
  align-items: center;
  gap: .6rem;
  color: #a78bfa;
  margin: 0 0 .8rem;
  font-size: 1rem;
}
.debug-hdr .date-label {
  color: #6d28d9;
  font-size: .65rem;
  flex: 1;
}
.debug-close-btn {
  background: transparent;
  border: 1px solid #4c1d95;
  border-radius: 4px;
  color: #a78bfa;
  cursor: pointer;
  padding: .1rem .4rem;
  font-size: .8rem;
}
.debug-close-btn:hover { background: #4c1d95; }

/* Tabs */
.debug-tabs {
  display: flex;
  gap: .3rem;
  margin-bottom: .8rem;
  border-bottom: 1px solid #4c1d95;
  padding-bottom: .4rem;
}
.debug-tab {
  background: transparent;
  border: 1px solid #4c1d95;
  border-radius: 4px 4px 0 0;
  color: #7c3aed;
  cursor: pointer;
  font-size: .72rem;
  padding: .2rem .7rem;
}
.debug-tab-active,
.debug-tab:hover { background: #4c1d95; color: #e9d5ff; }

/* Meta line */
.debug-meta {
  font-size: .68rem;
  color: #9ca3af;
  margin-bottom: .4rem;
  word-break: break-all;
}
.debug-url        { color: #34d399; }
.debug-status-ok  { color: #4ade80; font-weight: 700; }
.debug-status-err { color: #f87171; font-weight: 700; }

/* Flag badges */
.debug-flags { margin-bottom: .5rem; }
.flag {
  display: inline-block;
  margin: .15rem .2rem .15rem 0;
  padding: .15rem .5rem;
  border-radius: 4px;
  font-size: .67rem;
  line-height: 1.4;
}
.flag-ok    { background: #14532d; color: #86efac; }
.flag-info  { background: #1e3a5f; color: #93c5fd; }
.flag-warn  { background: #713f12; color: #fde68a; }
.flag-error { background: #7f1d1d; color: #fca5a5; font-weight: 700; }

/* JSON pre */
.debug-json {
  background: #111827;
  border: 1px solid #374151;
  border-radius: 4px;
  color: #d1fae5;
  font-size: .65rem;
  line-height: 1.55;
  max-height: 500px;
  overflow: auto;
  padding: .7rem;
  white-space: pre;
}

/* Diagnostics tab */
.debug-diag { margin-top: .4rem; }
.debug-diag-hint { color: #6b7280; font-size: .72rem; }
.diag-meta {
  font-size: .68rem;
  color: #9ca3af;
  margin-bottom: .6rem;
}
.diag-meta b { color: #c4b5fd; }
.diag-team-hdr {
  color: #a78bfa;
  font-size: .8rem;
  margin: .8rem 0 .3rem;
  border-bottom: 1px solid #4c1d95;
  padding-bottom: .2rem;
}
.diag-table {
  width: 100%;
  border-collapse: collapse;
  font-size: .64rem;
}
.diag-table th {
  text-align: left;
  padding: .2rem .4rem;
  color: #7c3aed;
  border-bottom: 1px solid #4c1d95;
  white-space: nowrap;
}
.diag-table td   { padding: .2rem .4rem; border-bottom: 1px solid #1f2937; }
.diag-name       { color: #e9d5ff; font-weight: 600; min-width: 130px; }
.diag-clk        { color: #34d399; font-weight: 600; }
.diag-secs       { color: #6b7280; }
.diag-active     { color: #4ade80 !important; }
.diag-tip        { color: #93c5fd !important; }    /* entered at 0:00 = tip-off, expected */
.diag-row-warn td { background: rgba(127,29,29,.25); }

/* ── Responsive ──────────────────────────────────────────────────── */
@media (max-width: 1100px) {
  .ra-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 700px) {
  .ra-grid { grid-template-columns: 1fr; }
  .stint-grid { grid-template-columns: 1fr; }
}

@media (max-width: 600px) {
  .pd-hero          { flex-direction: column; align-items: center; text-align: center; padding: 1.25rem 1rem; }
  .pd-meta-row      { justify-content: center; }
  .pd-bio-pills     { justify-content: center; }
  .pd-links         { text-align: center; }
  .pd-key-stats     { justify-content: center; }
  .pd-averages-grid { grid-template-columns: repeat(auto-fill, minmax(72px, 1fr)); }
}


/* ── History chip (game card footer & injuries page) ─────────────── */
.history-chip {
  cursor: pointer;
  font-size: 0.6rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--muted);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0.18rem 0.55rem;
  line-height: 1.4;
  white-space: nowrap;
  flex-shrink: 0;
  transition: color 0.12s, border-color 0.12s, background 0.12s;
}

.history-chip:hover {
  color: var(--blue);
  border-color: rgba(29, 66, 138, 0.4);
  background: rgba(29, 66, 138, 0.05);
}

/* Inline variant inside .im-header flex row on the injuries page */
.history-chip-inline {
  position: static;
  margin-left: auto;
  flex-shrink: 0;
}

/* ── History page (hist-*) ────────────────────────────────────────── */

/* Back link + subtitle row */
.hist-nav {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}

.back-link {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--muted);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 0.25rem;
  transition: color 0.12s;
}

.back-link:hover { color: var(--text); }

/* History page hero reuses .gd-hero from game_detail — no extra styles needed.
   The .hist-nav back-link row sits above it. */

/* Loading state */
.hist-loading {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 3rem 0;
  color: var(--muted);
  font-size: 0.9rem;
  justify-content: center;
}

.hist-spinner {
  display: inline-block;
  width: 18px;
  height: 18px;
  border: 2px solid var(--border);
  border-top-color: var(--blue);
  border-radius: 50%;
  animation: hist-spin 0.7s linear infinite;
  flex-shrink: 0;
}

@keyframes hist-spin { to { transform: rotate(360deg); } }

/* Error / empty states on history page */
.hist-error {
  padding: 2rem 0;
  color: var(--red);
  font-size: 0.9rem;
  text-align: center;
}

/* Summary stats grid */
.hist-summary {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.2rem 1.4rem;
  margin-bottom: 2rem;
}

.hist-sum-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 1rem 1.5rem;
}

.hist-sum-item {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.hist-sum-val {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text);
  line-height: 1.2;
}

.hist-record {
  font-size: 1.1rem;
}

.hist-sum-lbl {
  font-size: 0.65rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--muted);
}

/* Game history table */
.hist-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
}

.hist-table th {
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  padding: 0.5rem 0.75rem;
  border-bottom: 2px solid var(--border);
  text-align: left;
  white-space: nowrap;
}

.hist-table th.th-center { text-align: center; }

.hist-table td {
  padding: 0.6rem 0.75rem;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
  color: var(--muted);
}

.hist-table tbody tr:last-child td { border-bottom: none; }

.hist-table tbody tr:hover td { background: var(--surface); }
.hist-table tbody tr.hist-clickable { cursor: pointer; }
.hist-table tbody tr.hist-clickable:hover td { background: rgba(29,66,138,.06); }

.hist-date {
  font-variant-numeric: tabular-nums;
  font-size: 0.8rem;
  color: var(--text);
  white-space: nowrap;
}

.hist-team-cell {
  font-weight: 700;
  font-size: 0.88rem;
  color: var(--muted);
}

.hist-team-cell.hist-winner { color: var(--text); }

.hist-score-cell {
  text-align: center;
  font-variant-numeric: tabular-nums;
  font-size: 0.88rem;
  white-space: nowrap;
  letter-spacing: 0.02em;
}

.hist-winner { color: var(--text); font-weight: 700; }
.hist-loser  { color: var(--muted); }
.hist-dash   { color: var(--border); margin: 0 0.2rem; }

.hist-season {
  font-size: 0.78rem;
  color: var(--muted);
  white-space: nowrap;
}

/* Game-type badges (reused on history page) */
.hist-badge {
  font-size: 0.6rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 0.18rem 0.5rem;
  border-radius: 999px;
  white-space: nowrap;
}

.badge-regular  { background: rgba(29,66,138,.1);   color: var(--blue);   }
.badge-playoffs { background: rgba(200,16,46,.1);   color: var(--red);    }
.badge-playin   { background: rgba(202,138,4,.15);  color: var(--yellow); }
.badge-unknown  { background: var(--border);        color: var(--muted);  }

/* Detail button in game history table */
.hist-detail-cell { text-align: right; white-space: nowrap; }

.hist-detail-btn {
  display: inline-block;
  font-size: 0.65rem;
  font-weight: 700;
  color: var(--blue);
  text-decoration: none;
  padding: 0.2rem 0.55rem;
  border: 1px solid rgba(29,66,138,.25);
  border-radius: 4px;
  transition: background 0.12s, border-color 0.12s;
}

.hist-detail-btn:hover {
  background: rgba(29,66,138,.08);
  border-color: rgba(29,66,138,.45);
}

@media (max-width: 640px) {
  .hist-sum-grid  { grid-template-columns: 1fr 1fr; }
  .hist-table th,
  .hist-table td  { padding: 0.45rem 0.4rem; font-size: 0.78rem; }
}


/* ═══════════════════════════════════════════════════════════════════
   LINEUP MONITOR — game card chips + status page
   ═══════════════════════════════════════════════════════════════════ */

/* ── Lineup chip on game cards ────────────────────────────────────── */
.lineup-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  padding: 0.15rem 0.45rem;
  border-radius: 4px;
  white-space: nowrap;
  text-transform: uppercase;
}
.lineup-chip-official {
  background: #d1fae5;
  color: #065f46;
  border: 1px solid #6ee7b7;
}
.lineup-chip-sent {
  background: #dbeafe;
  color: #1e3a5f;
  border: 1px solid #93c5fd;
}
.lineup-chip-wait {
  background: var(--surface);
  color: var(--muted);
  border: 1px solid var(--border);
}

/* ── Generic reusable badges ──────────────────────────────────────── */
.badge-ok  { background: #d1fae5; color: #065f46; border-color: #6ee7b7; }
.badge-err { background: #fee2e2; color: #991b1b; border-color: #fca5a5; }
.badge-muted { background: var(--surface); color: var(--muted); border-color: var(--border); }

/* ── Lineup status page ───────────────────────────────────────────── */
.lm-status-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.9rem 1.2rem;
  margin-bottom: 1.2rem;
  align-items: center;
}
.lm-status-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.lm-label {
  font-size: 0.78rem;
  color: var(--muted);
  font-weight: 500;
}
.lm-val {
  font-weight: 700;
  font-size: 1rem;
}

/* ── Manual test panel ────────────────────────────────────────────── */
.lm-test-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 1.2rem;
  margin-bottom: 1.4rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1rem;
}
.lm-test-header { flex: 1; min-width: 200px; }
.lm-test-title  { font-weight: 700; font-size: 0.9rem; display: block; margin-bottom: 0.2rem; }
.lm-test-desc   { font-size: 0.8rem; color: var(--muted); }

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.5rem 1.1rem;
  border-radius: 6px;
  border: none;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.15s;
  white-space: nowrap;
  text-decoration: none;
}
.btn:disabled { opacity: 0.55; cursor: not-allowed; }
.btn-primary {
  background: var(--blue);
  color: #fff;
}
.btn-primary:hover:not(:disabled) { opacity: 0.88; }

.lm-trigger-result {
  width: 100%;
  margin-top: 0.6rem;
  padding: 0.7rem 1rem;
  border-radius: 6px;
  font-size: 0.82rem;
  line-height: 1.6;
}
.lm-result-ok  { background: #d1fae5; color: #065f46; border: 1px solid #6ee7b7; }
.lm-result-err { background: #fee2e2; color: #991b1b; border: 1px solid #fca5a5; }

/* ── Lineup state table ───────────────────────────────────────────── */
.lm-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.82rem;
}
.lm-table th {
  background: var(--surface);
  padding: 0.5rem 0.75rem;
  text-align: left;
  font-weight: 600;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
  border-bottom: 2px solid var(--border);
  white-space: nowrap;
}
.lm-table td {
  padding: 0.55rem 0.75rem;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}
.lm-table tr:last-child td { border-bottom: none; }
.lm-table tr:hover td { background: #fafafa; }

.lm-matchup { font-weight: 600; white-space: nowrap; }
.lm-time    { color: var(--muted); font-size: 0.75rem; white-space: nowrap; }
.lm-starters {
  max-width: 220px;
  font-size: 0.78rem;
  color: var(--text);
  line-height: 1.4;
}


/* ═══════════════════════════════════════════════════════════════════
   TEAM LOGO — global clickable behaviour + hover animation
   Pure CSS — no JS wrapper needed.
   filter: brightness() simulates a white semi-transparent overlay;
   drop-shadow() adds depth; scale + translateY pops the logo up.
   ═══════════════════════════════════════════════════════════════════ */

img[data-team-abbr] {
  cursor: pointer;
  transition:
    transform 0.22s cubic-bezier(0.34, 1.56, 0.64, 1),
    filter    0.22s ease;
  transform-origin: center center;
  /* Ensure scale animation is never clipped by parent overflow */
  position: relative;
  z-index: 2;
}

img[data-team-abbr]:hover {
  /* translateY(-4px): pops up; scale(1.14): enlarges slightly */
  transform: scale(1.14) translateY(-4px);
  /* brightness(1.35): white tint (semi-transparent overlay effect)
     drop-shadow: depth shadow beneath the lifted logo              */
  filter: brightness(1.35)
          drop-shadow(0 8px 16px rgba(0, 0, 0, 0.30));
}


/* ═══════════════════════════════════════════════════════════════════
   TEAM HISTORY PAGE  (th-*)
   Extends the existing hist-* vocabulary for the single-team view.
   ═══════════════════════════════════════════════════════════════════ */

/* Hero: single team centred left, title on the right */
.th-hero {
  justify-content: flex-start;
  gap: 2rem;
}

/* Win-row highlight (team won this game) */
.th-row-win td:first-child::before {
  content: '✓';
  color: var(--green, #22c55e);
  font-size: 0.7rem;
  margin-right: 0.3rem;
}

/* ── Pagination controls ─────────────────────────────────────────── */
.th-pagination {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.35rem;
  padding: 1rem 0 0.5rem;
  justify-content: center;
}

.th-page-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2rem;
  height: 2rem;
  padding: 0 0.6rem;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: var(--surface);
  color: var(--text);
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.12s, border-color 0.12s;
}
.th-page-btn:hover:not(:disabled) {
  background: rgba(29,66,138,.07);
  border-color: rgba(29,66,138,.45);
}
.th-page-btn:disabled {
  opacity: 0.38;
  cursor: default;
}
.th-page-btn.th-page-active {
  background: var(--blue, #1d428a);
  color: #fff;
  border-color: var(--blue, #1d428a);
}

.th-page-ellipsis {
  color: var(--muted);
  font-size: 0.8rem;
  padding: 0 0.1rem;
}

.th-page-info {
  font-size: 0.72rem;
  color: var(--muted);
  margin-left: 0.5rem;
  white-space: nowrap;
}

@media (max-width: 640px) {
  .th-pagination { gap: 0.25rem; }
  .th-page-btn   { min-width: 1.75rem; height: 1.75rem; font-size: 0.72rem; }
  .th-page-info  { width: 100%; text-align: center; margin-left: 0; }
}


/* ════════════════════════════════════════════════════════════════════
   PLAYOFF RACE PAGE
   ════════════════════════════════════════════════════════════════════ */

/* ── Conference section wrapper ─────────────────────────────────── */
.pr-conf-section {
  margin-bottom: 2.5rem;
}

.pr-conf-title {
  font-size: 1.25rem;
  font-weight: 800;
  letter-spacing: -.02em;
  margin: 0 0 1rem;
  padding-bottom: .5rem;
  border-bottom: 2px solid var(--border);
}

/* ── Zone headers ───────────────────────────────────────────────── */
.pr-zone-header {
  display: flex;
  align-items: center;
  gap: .5rem;
  font-size: .78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .07em;
  padding: .45rem .75rem;
  border-radius: 6px 6px 0 0;
  margin-top: 1.25rem;
  margin-bottom: 0;
}

.pr-zone-sub {
  font-weight: 400;
  letter-spacing: .03em;
  text-transform: none;
  opacity: .75;
  margin-left: .25rem;
}

.pr-zone-icon { font-size: .9rem; }

.pr-zone-playoff-hdr {
  background: rgba(22,163,74,.08);
  color: #15803d;
  border: 1px solid rgba(22,163,74,.2);
}

.pr-zone-playin-hdr {
  background: rgba(29,66,138,.07);
  color: var(--blue);
  border: 1px solid rgba(29,66,138,.18);
}

.pr-zone-out-hdr {
  background: rgba(107,114,128,.07);
  color: var(--muted);
  border: 1px solid rgba(107,114,128,.18);
}

/* ── Table wrapper ──────────────────────────────────────────────── */
.pr-table-wrap {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-top: none;
  border-radius: 0 0 8px 8px;
  margin-bottom: 0;
}

.pr-table {
  width: 100%;
  border-collapse: collapse;
  font-size: .82rem;
}

/* ── Column widths ──────────────────────────────────────────────── */
.pr-th-seed   { width: 32px;  text-align: center; }
.pr-th-team   { min-width: 200px; text-align: left; }
.pr-th-num    { width: 44px;  text-align: center; }
.pr-th-pct    { width: 52px;  text-align: center; }
.pr-th-gb     { width: 52px;  text-align: center; }
.pr-th-rec    { width: 56px;  text-align: center; }
.pr-th-str    { width: 56px;  text-align: center; }
.pr-th-status { min-width: 140px; text-align: left; padding-left: .5rem; }

.pr-table thead th {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: .4rem .5rem;
  font-size: .72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--muted);
  white-space: nowrap;
}

/* ── Row styles ─────────────────────────────────────────────────── */
.pr-row td {
  padding: .45rem .5rem;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
.pr-row:last-child td { border-bottom: none; }

.pr-row-playoff { background: rgba(22,163,74,.03); }
.pr-row-playoff:hover { background: rgba(22,163,74,.08); }

.pr-row-clinched { background: rgba(22,163,74,.07); }
.pr-row-clinched:hover { background: rgba(22,163,74,.12); }

.pr-row-playin { background: rgba(29,66,138,.03); }
.pr-row-playin:hover { background: rgba(29,66,138,.07); }

.pr-row-out { }
.pr-row-out:hover { background: var(--surface); }

.pr-row-elim { opacity: .55; }

/* ── Separator row between 7/8 and 9/10 ────────────────────────── */
.pr-separator-row td {
  background: rgba(29,66,138,.06);
  border-top: 1px dashed rgba(29,66,138,.3);
  border-bottom: 1px dashed rgba(29,66,138,.3);
  text-align: center;
  padding: .25rem .5rem;
}

.pr-separator-label {
  font-size: .68rem;
  font-weight: 600;
  color: var(--blue);
  letter-spacing: .04em;
  text-transform: uppercase;
  opacity: .8;
}

/* ── Seed cell ──────────────────────────────────────────────────── */
.pr-seed {
  text-align: center;
  font-weight: 800;
  font-size: .9rem;
  color: var(--text);
  width: 32px;
}
.pr-seed-out { color: var(--muted); font-weight: 600; }

/* ── Team cell ──────────────────────────────────────────────────── */
.pr-team-cell {
  display: flex;
  align-items: center;
  gap: .6rem;
  white-space: nowrap;
}

.pr-logo {
  width: 28px;
  height: 28px;
  object-fit: contain;
  flex-shrink: 0;
}

.pr-team-names {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.pr-team-name {
  font-weight: 600;
  font-size: .82rem;
  color: var(--text);
  line-height: 1.2;
}

.pr-team-abbr {
  font-size: .68rem;
  color: var(--muted);
  font-weight: 500;
  letter-spacing: .04em;
}

.pr-clinch-flag {
  font-size: .65rem;
  font-weight: 800;
  color: #15803d;
  background: rgba(22,163,74,.12);
  border: 1px solid rgba(22,163,74,.25);
  border-radius: 4px;
  padding: .1rem .3rem;
  margin-left: .2rem;
  text-transform: uppercase;
  letter-spacing: .04em;
}

/* ── Numeric cells ──────────────────────────────────────────────── */
.pr-num { text-align: center; font-variant-numeric: tabular-nums; }
.pr-wins    { font-weight: 700; }
.pr-losses  { color: var(--muted); }
.pr-gb      { color: var(--muted); font-size: .78rem; }
.pr-rec     { text-align: center; font-size: .75rem; color: var(--muted); white-space: nowrap; }

/* ── Streak ─────────────────────────────────────────────────────── */
.pr-streak  { text-align: center; font-size: .75rem; font-weight: 600; }
.pr-streak-w { color: var(--green); }
.pr-streak-l { color: var(--red); }

/* ── Status badges ──────────────────────────────────────────────── */
.pr-status {
  display: inline-block;
  font-size: .65rem;
  font-weight: 700;
  letter-spacing: .05em;
  text-transform: uppercase;
  padding: .2rem .55rem;
  border-radius: 20px;
  white-space: nowrap;
  border: 1px solid transparent;
}

.pr-status-clinched-playoffs {
  background: rgba(22,163,74,.15);
  color: #15803d;
  border-color: rgba(22,163,74,.3);
}
.pr-status-clinched-playin {
  background: rgba(34,197,94,.1);
  color: #166534;
  border-color: rgba(34,197,94,.25);
}
.pr-status-playoff-pos {
  background: rgba(22,163,74,.08);
  color: #15803d;
  border-color: rgba(22,163,74,.2);
}
.pr-status-playin-pos {
  background: rgba(29,66,138,.1);
  color: var(--blue);
  border-color: rgba(29,66,138,.22);
}
.pr-status-bubble {
  background: rgba(202,138,4,.12);
  color: #92400e;
  border-color: rgba(202,138,4,.3);
}
.pr-status-alive {
  background: rgba(249,115,22,.1);
  color: var(--orange);
  border-color: rgba(249,115,22,.25);
}
.pr-status-outside {
  background: rgba(107,114,128,.08);
  color: var(--muted);
  border-color: rgba(107,114,128,.2);
}
.pr-status-eliminated {
  background: rgba(200,16,46,.08);
  color: var(--red);
  border-color: rgba(200,16,46,.2);
}

/* ── Legend ─────────────────────────────────────────────────────── */
.pr-legend {
  display: flex;
  flex-wrap: wrap;
  gap: .4rem;
  padding: .5rem 0;
}

/* ── Toggle buttons ─────────────────────────────────────────────── */
.pr-toggle {
  display: inline-flex;
  gap: 0;
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
}

.pr-toggle-btn {
  background: var(--bg);
  border: none;
  border-right: 1px solid var(--border);
  padding: .35rem .9rem;
  font-size: .8rem;
  font-weight: 600;
  cursor: pointer;
  color: var(--muted);
  transition: background .12s, color .12s;
}
.pr-toggle-btn:last-child { border-right: none; }
.pr-toggle-btn:hover { background: var(--surface); color: var(--text); }

.pr-toggle-active {
  background: var(--text) !important;
  color: var(--bg) !important;
}

/* ── Responsive ─────────────────────────────────────────────────── */
@media (max-width: 768px) {
  .pr-th-rec, .pr-rec { display: none; }
  .pr-th-gb,  .pr-gb  { display: none; }
  .pr-team-name { font-size: .78rem; }
}

@media (max-width: 480px) {
  .pr-th-str, .pr-streak { display: none; }
  .pr-logo { width: 22px; height: 22px; }
}

/* ═══════════════════════════════════════════════════════════════════
   POLYMARKET ORDER BOOK PANEL
   ═══════════════════════════════════════════════════════════════════ */

.ob-section {
  padding: 1rem 1.5rem 1.4rem;
}

/* ── Header ──────────────────────────────────────────────────────── */
.ob-header { margin-bottom: 0.85rem; }

.ob-title-row {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-wrap: wrap;
  margin-bottom: 0.45rem;
}

.ob-title {
  font-size: 0.82rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text);
}

.ob-msg-count {
  font-size: 0.72rem;
  color: var(--muted);
  margin-left: auto;
}

.ob-collapse-btn {
  background: none;
  border: none;
  padding: 0 0.2rem;
  font-size: 0.7rem;
  color: var(--muted);
  cursor: pointer;
  line-height: 1;
  transition: color 0.1s;
}
.ob-collapse-btn:hover { color: var(--text); }

.ob-stale-badge {
  font-size: 0.68rem;
  font-weight: 700;
  padding: 0.1rem 0.45rem;
  border-radius: 3px;
  background: var(--yellow);
  color: #fff;
  letter-spacing: 0.05em;
}

/* Connection badge */
.ob-badge {
  font-size: 0.65rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  padding: 0.15rem 0.5rem;
  border-radius: 3px;
  white-space: nowrap;
}
.ob-badge-live         { background: var(--green); color: #fff; }
.ob-badge-connecting   { background: var(--yellow); color: #fff; }
.ob-badge-reconnecting { background: var(--orange); color: #fff; }
.ob-badge-disconnected { background: var(--muted);  color: #fff; }

/* Token selector row */
.ob-token-row {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  flex-wrap: wrap;
}

.ob-token-btns {
  display: flex;
  border: 1px solid var(--border);
  border-radius: 5px;
  overflow: hidden;
}

.ob-token-btn {
  background: var(--bg);
  border: none;
  border-right: 1px solid var(--border);
  padding: 0.28rem 0.8rem;
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  color: var(--muted);
  transition: background 0.1s, color 0.1s;
}
.ob-token-btn:last-child { border-right: none; }
.ob-token-btn:hover { background: var(--surface); color: var(--text); }
.ob-token-active {
  background: var(--text) !important;
  color: var(--bg) !important;
}

.ob-token-label {
  font-size: 0.68rem;
  font-family: monospace;
  color: var(--muted);
  word-break: break-all;
}

.ob-last-update {
  font-size: 0.68rem;
  color: var(--muted);
  margin-left: auto;
}

/* ── Loading / error ──────────────────────────────────────────────── */
.ob-loading {
  font-size: 0.8rem;
  color: var(--muted);
  padding: 0.6rem 0;
}

.ob-error {
  font-size: 0.8rem;
  color: var(--red);
  padding: 0.6rem 0;
}

/* ── Spread summary ───────────────────────────────────────────────── */
.ob-spread-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.7rem;
  background: var(--surface);
  border-radius: 6px;
  margin-bottom: 0.8rem;
  font-size: 0.78rem;
  flex-wrap: wrap;
}

.ob-spread-label { color: var(--muted); }

.ob-spread-val {
  font-weight: 700;
  color: var(--text);
  min-width: 3rem;
  text-align: center;
}

.ob-best-bid {
  font-weight: 700;
  color: var(--green);
  font-variant-numeric: tabular-nums;
}

.ob-best-ask {
  font-weight: 700;
  color: var(--red);
  font-variant-numeric: tabular-nums;
}

/* ── Order book table ─────────────────────────────────────────────── */
.ob-book-wrap {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.6rem;
  margin-bottom: 1rem;
}

@media (max-width: 600px) {
  .ob-book-wrap { grid-template-columns: 1fr; }
}

.ob-side {
  border: 1px solid var(--border);
  border-radius: 6px;
  overflow: hidden;
}

/* Side title bar (ASK / BID label above the column headers) */
.ob-side-title {
  padding: 0.2rem 0.55rem;
  font-size: 0.65rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  border-bottom: 1px solid var(--border);
}
.ob-asks-side .ob-side-title { color: var(--red);   background: rgba(200,16,46,0.06); }
.ob-bids-side .ob-side-title { color: var(--green); background: rgba(22,163,74,0.06); }

.ob-side-hdr {
  display: grid;
  grid-template-columns: 3fr 2fr 2.5fr 2.5fr;
  column-gap: 0.4rem;
  padding: 0.3rem 0.55rem;
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}

/* Side label lives in the section title, not in the grid */
.ob-asks-side .ob-side-hdr { color: var(--red); }
.ob-bids-side .ob-side-hdr { color: var(--green); }

.ob-side-body { font-size: 0.78rem; }

.ob-row {
  position: relative;
  display: grid;
  grid-template-columns: 3fr 2fr 2.5fr 2.5fr;
  column-gap: 0.4rem;
  padding: 0.2rem 0.55rem;
  border-bottom: 1px solid var(--border);
  font-variant-numeric: tabular-nums;
  overflow: hidden;
}
.ob-row:last-child { border-bottom: none; }

/* Depth bar fills row background */
.ob-bar-bg {
  position: absolute;
  top: 0;
  bottom: 0;
  z-index: 0;
  opacity: 0.13;
  transition: width 0.15s ease;
}
.ob-ask-bar { background: var(--red);   left: 0; }
.ob-bid-bar { background: var(--green); left: 0; }

/* Text columns must sit above the bar */
.ob-col {
  position: relative;
  z-index: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ob-col-price  { font-weight: 600; }
.ob-col-size   { color: var(--text); }
.ob-col-cumul  { color: var(--muted); font-size: 0.72rem; }
.ob-col-amount { color: var(--muted); font-size: 0.72rem; }

.ob-ask-price { color: var(--red); }
.ob-bid-price { color: var(--green); }

/* Best bid / ask highlight */
.ob-best-ask-row { background: rgba(200, 16, 46, 0.07); }
.ob-best-bid-row { background: rgba(22, 163, 74, 0.07); }
.ob-best-ask-row .ob-ask-price { font-weight: 800; }
.ob-best-bid-row .ob-bid-price { font-weight: 800; }

.ob-empty {
  padding: 0.5rem 0.55rem;
  font-size: 0.75rem;
  color: var(--muted);
}

/* ── Impact Simulator ─────────────────────────────────────────────── */
.ob-simulator {
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0.8rem 1rem;
  margin-bottom: 0.8rem;
}

.ob-sim-title {
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text);
  margin-bottom: 0.65rem;
}

.ob-sim-inputs {
  display: flex;
  gap: 0.7rem;
  align-items: flex-end;
  flex-wrap: wrap;
  margin-bottom: 0.7rem;
}

.ob-sim-field {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.ob-sim-label {
  font-size: 0.68rem;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.ob-sim-select,
.ob-sim-input {
  font-size: 0.8rem;
  padding: 0.32rem 0.6rem;
  border: 1px solid var(--border);
  border-radius: 5px;
  background: var(--bg);
  color: var(--text);
  font-family: inherit;
  min-width: 7rem;
}

.ob-sim-btn {
  font-size: 0.8rem;
  font-weight: 700;
  padding: 0.35rem 1rem;
  border: none;
  border-radius: 5px;
  background: var(--blue);
  color: #fff;
  cursor: pointer;
  transition: opacity 0.1s;
  align-self: flex-end;
}
.ob-sim-btn:hover { opacity: 0.85; }

.ob-sim-result { font-size: 0.8rem; }

.ob-sim-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.78rem;
}
.ob-sim-table th,
.ob-sim-table td {
  padding: 0.25rem 0.5rem;
  text-align: left;
  border-bottom: 1px solid var(--border);
}
.ob-sim-table th {
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
  background: var(--surface);
}
.ob-sim-table tr:last-child td { border-bottom: none; }

.ob-sim-warn-box {
  margin-top: 0.5rem;
  padding: 0.4rem 0.6rem;
  background: rgba(202, 138, 4, 0.1);
  border-left: 3px solid var(--yellow);
  border-radius: 3px;
  font-size: 0.75rem;
  color: var(--text);
}

.ob-sim-note {
  margin-top: 0.4rem;
  font-size: 0.68rem;
  color: var(--muted);
}

/* ── Order Book / Graph view tab switcher ─────────────────────────── */
.ob-view-tabs {
  display: flex;
  gap: 0;
  border-bottom: 1px solid var(--border);
  margin-bottom: 0.75rem;
}
.ob-tab {
  padding: 0.35rem 1rem;
  font-size: 0.8rem;
  font-weight: 600;
  border: none;
  background: none;
  color: var(--muted);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  transition: color 0.1s;
}
.ob-tab:hover { color: var(--text); }
.ob-tab-active { color: #1d428a; border-bottom-color: #1d428a; }

/* ── Graph panel ──────────────────────────────────────────────────── */
.ob-graph-panel { padding-bottom: 0.5rem; }

.ob-graph-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.5rem;
}
.ob-graph-ranges { display: flex; gap: 0.2rem; }
.ob-range-btn {
  padding: 0.18rem 0.5rem;
  font-size: 0.72rem;
  font-weight: 600;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  transition: color 0.1s, border-color 0.1s;
}
.ob-range-btn:hover { color: var(--text); border-color: var(--text); }
.ob-range-active   { background: #1d428a; color: #fff !important; border-color: #1d428a !important; }

.ob-graph-status {
  font-size: 0.68rem;
  color: var(--muted);
}

.ob-graph-wrap {
  position: relative;
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 4px;
  overflow: hidden;
}
.ob-graph-canvas {
  display: block;
  width: 100%;
  height: 220px;
  cursor: crosshair;
}
.ob-graph-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  color: var(--muted);
  background: var(--surface);
  pointer-events: none;
}
.ob-graph-overlay.ob-graph-error-msg { color: var(--red); }
.ob-graph-tooltip {
  position: absolute;
  pointer-events: none;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 0.3rem 0.55rem;
  font-size: 0.72rem;
  white-space: nowrap;
  z-index: 10;
  box-shadow: 0 2px 6px rgba(0,0,0,0.12);
}
.ob-graph-legend {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.72rem;
  margin-top: 0.45rem;
  flex-wrap: wrap;
}
.ob-legend-dot {
  display: inline-block;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  flex-shrink: 0;
}
.ob-legend-lbl { color: var(--text); }
.ob-legend-val { font-weight: 700; font-variant-numeric: tabular-nums; }
.ob-legend-sep { color: var(--border); margin: 0 0.1rem; }
.ob-graph-updated { margin-left: auto; color: var(--muted); font-size: 0.68rem; }
.ob-graph-live-badge {
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--green);
  margin-right: 0.2rem;
  vertical-align: middle;
}

/* ── Cost summary card (above simulator detail table) ─────────────── */
.ob-cost-summary {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 0.4rem;
  margin-bottom: 0.75rem;
  padding: 0.7rem 0.8rem;
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: 6px;
}
.ob-cost-cell { text-align: center; }
.ob-cost-label {
  font-size: 0.62rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
  margin-bottom: 0.15rem;
}
.ob-cost-val {
  font-size: 1.0rem;
  font-weight: 700;
  color: var(--text);
  line-height: 1.2;
}
.ob-cost-val.ob-cost-warn  { color: var(--red); }
.ob-cost-val.ob-cost-ok    { color: var(--green); }
.ob-cost-val.ob-cost-muted { color: var(--muted); font-size: 0.82rem; }
.ob-cost-sub {
  font-size: 0.65rem;
  color: var(--muted);
  margin-top: 0.1rem;
}

.ob-sim-warn {
  color: var(--yellow);
  font-size: 0.78rem;
}

.ob-sim-mode-row {
  display: flex;
  gap: 0.3rem;
  flex-wrap: wrap;
}

.ob-sim-mode-btn {
  font-size: 0.72rem;
  font-weight: 600;
  padding: 0.2rem 0.65rem;
  border: 1.5px solid var(--border);
  border-radius: 4px;
  background: var(--surface);
  color: var(--muted);
  cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.ob-sim-mode-btn:hover { background: #dde3ec; color: var(--text); border-color: #b0b8c8; }
.ob-mode-active {
  background: var(--blue);
  color: #ffffff;
  border-color: var(--blue);
  font-weight: 700;
}

/* ── Debug panel ──────────────────────────────────────────────────── */
.ob-debug {
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 0.75rem;
  margin-top: 0.4rem;
}

.ob-debug-summary {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.45rem 0.75rem;
  cursor: pointer;
  font-weight: 700;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  user-select: none;
  list-style: none;
}
.ob-debug-summary::-webkit-details-marker { display: none; }
.ob-debug-summary::before {
  content: '▶';
  font-size: 0.6rem;
  transition: transform 0.15s;
}
details[open] > .ob-debug-summary::before { transform: rotate(90deg); }

.ob-copy-btn {
  font-size: 0.68rem;
  font-weight: 600;
  padding: 0.15rem 0.55rem;
  border: 1px solid var(--border);
  border-radius: 3px;
  background: var(--bg);
  color: var(--text);
  cursor: pointer;
  margin-left: auto;
}
.ob-copy-btn:hover { background: var(--surface); }

.ob-debug-body {
  padding: 0.7rem 0.9rem 0.9rem;
  border-top: 1px solid var(--border);
}

.ob-debug-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 0.7rem;
}

.ob-debug-item-wide {
  grid-column: 1 / -1;
}

.ob-debug-label {
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
  margin-bottom: 0.2rem;
}

.ob-debug-val {
  font-size: 0.75rem;
  color: var(--text);
  word-break: break-all;
}

.ob-debug-mono {
  font-family: monospace;
  font-size: 0.72rem;
}

.ob-debug-pre {
  font-family: monospace;
  font-size: 0.7rem;
  white-space: pre-wrap;
  word-break: break-all;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 0.35rem 0.5rem;
  max-height: 180px;
  overflow-y: auto;
  margin: 0;
}

.ob-debug-truncate { max-height: 140px; }

/* ── Injury page: consolidated Polymarket / order book panel ─────── */
.im-ob-panel {
  border-top: 2px solid var(--border);
  padding: 0.8rem 1rem 1rem;
  background: var(--surface);
}


/* ══════════════════════════════════════════════════════════════════════
   PLAYER STATUS BADGES — roster & injury cross-check
   (applied to player boxscore rows in game_detail.html)
   ══════════════════════════════════════════════════════════════════════ */

/* Base player-status badge — compact inline badge next to player name */
.psb {
  display: inline-block;
  font-size: .58rem;
  font-weight: 700;
  padding: .1rem .35rem;
  border-radius: 3px;
  vertical-align: middle;
  white-space: nowrap;
  margin-left: 5px;
  line-height: 1.6;
  letter-spacing: .02em;
}

/* 已离队 — player no longer on current roster (gray, muted) */
.psb-leftteam {
  background: var(--surface);
  color: var(--muted);
  border: 1px solid var(--border);
}

/* Injury statuses — mirror the severity colors from the injury table */
.psb-out,
.psb-suspension { background: rgba(200,16,46,.15);  color: var(--red);    }
.psb-doubtful   { background: rgba(249,115,22,.15); color: var(--orange); }
.psb-questionable,
.psb-day-to-day { background: rgba(234,179,8,.15);  color: var(--yellow); }
.psb-probable   { background: rgba(34,197,94,.15);  color: var(--green);  }

/* Player row visual treatment for left-team players */
.player-left-team td { opacity: .65; }
.player-left-team .col-name { opacity: 1; }  /* keep name readable */

/* Replacement hint — shown below badge when a possible replacement is inferred */
.psb-replacement-hint {
  display: block;
  margin-top: 3px;
}
.psb-replacement {
  display: block;
  font-size: .6rem;
  color: var(--muted);
  line-height: 1.5;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 220px;
}
.psb-repl-pos   { color: var(--blue); font-weight: 600; }
.psb-repl-label {
  font-size: .55rem;
  font-weight: 700;
  color: var(--muted);
  letter-spacing: .03em;
  text-transform: uppercase;
  margin-left: 3px;
}


/* ══════════════════════════════════════════════════════════════════════
   BENCH AVAILABLE — rotation timeline rows for not-yet-played players
   ══════════════════════════════════════════════════════════════════════ */

/* Group header for the bench-available section */
.stint-bench-avail-hdr td {
  border-top: 2px dashed var(--border);
  font-style: italic;
}

/* "roster" source label inside the group header */
.bench-avail-src {
  margin-left: .4rem;
  font-size: .58rem;
  font-weight: 600;
  padding: .05rem .3rem;
  border-radius: 2px;
  background: rgba(29,66,138,.08);
  color: var(--blue);
  text-transform: uppercase;
  letter-spacing: .04em;
  font-style: normal;
  vertical-align: middle;
}

/* Bench-available player rows — dimmer than active rows */
.bench-avail-row { opacity: .7; }
.bench-avail-row:hover { opacity: 1; background: var(--surface); }
.bench-avail-row .st-avail-dash { color: var(--border); }

/* Status badges inside bench-available rows */
.bench-avail-badge {
  display: inline-block;
  font-size: .58rem;
  font-weight: 700;
  padding: .07rem .3rem;
  border-radius: 3px;
  margin-left: 4px;
  vertical-align: middle;
  letter-spacing: .02em;
  line-height: 1.5;
}
.ba-available { background: rgba(34,197,94,.12);  color: var(--green);  }
.ba-dnp       { background: var(--surface);       color: var(--muted);  border: 1px solid var(--border); }
.ba-played    { background: rgba(29,66,138,.1);   color: var(--blue);   }


/* ══════════════════════════════════════════════════════════════════════
   ROSTER CHECK DEBUG TAB
   ══════════════════════════════════════════════════════════════════════ */

.rc-section {
  margin-bottom: 1rem;
  padding: .5rem .6rem;
  border: 1px solid var(--border);
  border-radius: 4px;
}
.rc-hdr {
  font-size: .72rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: .4rem;
}
.rc-group {
  margin-top: .35rem;
}
.rc-group-lbl {
  font-size: .65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .05em;
  margin-bottom: .2rem;
}
.rc-lbl-current  { color: var(--green); }
.rc-lbl-left     { color: var(--muted); }
.rc-lbl-injured  { color: var(--red);   }

.rc-names {
  font-size: .7rem;
  color: var(--muted);
  line-height: 1.7;
  word-break: break-word;
}
.rc-all-ok { color: var(--green); font-style: italic; }
