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

:root {
  --bg:        #0a0a0c;
  --bg2:       #111116;
  --bg3:       #18181f;
  --bg4:       #1e1e28;
  --border:    #25252f;
  --border2:   #2f2f3a;
  --text:      #e8e6f0;
  --text2:     #8a889a;
  --text3:     #5a586a;
  --accent:    #2dd4bf;
  --accent2:   #14b8a6;
  --strong:    #f0b429;
  --strong2:   #e07a5f;
  --green:     #4ade80;
  --red:       #f87171;
  --font:      'DM Sans', -apple-system, sans-serif;
  --mono:      'IBM Plex Mono', 'SF Mono', monospace;
  --radius:    12px;
  --radius-sm: 8px;
  --max-w:     1200px;
}

html {
  scroll-behavior: smooth;
  overflow-x: hidden;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  min-height: 100vh;
  max-width: 100%;
}

a { color: inherit; text-decoration: none; }

.container { max-width: var(--max-w); margin: 0 auto; padding: 0 24px; }

/* ═══════════════════════════════════════════════
   BUTTONS
═══════════════════════════════════════════════ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 12px 24px;
  border-radius: var(--radius-sm);
  font-family: var(--font);
  font-weight: 600;
  font-size: 15px;
  border: none;
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
}
.btn-primary  { background: var(--accent); color: var(--bg); }
.btn-primary:hover { background: var(--accent2); transform: translateY(-1px); }
.btn-outline  { background: transparent; color: var(--accent); border: 1px solid var(--border2); }
.btn-outline:hover { border-color: var(--accent); background: rgba(45,212,191,0.06); }
.btn-ghost    { background: var(--bg3); color: var(--text2); border: 1px solid var(--border); }
.btn-ghost:hover { color: var(--text); border-color: var(--border2); }
.btn-danger   { background: var(--red); color: var(--bg); }
.btn-danger:hover { opacity: 0.85; }
.btn-sm { padding: 8px 16px; font-size: 13px; }
.btn-lg { padding: 16px 32px; font-size: 17px; }

/* ═══════════════════════════════════════════════
   NAV
═══════════════════════════════════════════════ */
.nav {
  position: sticky;
  top: 0;
  z-index: 100;
  border-bottom: 1px solid var(--border);
  background: rgba(10, 10, 12, 0.92);
  backdrop-filter: blur(12px);
}
.nav-inner {
  display: flex;
  align-items: center;
  gap: 12px;
  height: 58px;
}
.nav-logo {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  font-size: 18px;
  color: var(--text);
  flex: 1;
}
.nav-logo .logo-icon { font-size: 22px; }
.nav-logo .logo-text { letter-spacing: -0.01em; }
.nav-logo .logo-accent { color: var(--accent); }
.nav-back { margin-left: auto; flex-shrink: 0; }

/* ═══════════════════════════════════════════════
   PAGE HEADER
═══════════════════════════════════════════════ */
.page-header {
  padding: 20px 0 12px;
}
.page-header h1 {
  font-size: 28px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 6px;
}
.page-header p {
  color: var(--text2);
  font-size: 16px;
}

/* ═══════════════════════════════════════════════
   DATE PICKER ROW (home page)
═══════════════════════════════════════════════ */
.date-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 32px;
  flex-wrap: wrap;
}
.date-btn {
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  background: var(--bg3);
  border: 1px solid var(--border);
  color: var(--text2);
  font-family: var(--font);
  font-size: 14px;
  cursor: pointer;
  transition: all 0.15s;
}
.date-btn:hover, .date-btn.active {
  color: var(--text);
  border-color: var(--accent);
  background: rgba(45,212,191,0.07);
}
input[type="date"] {
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  background: var(--bg3);
  border: 1px solid var(--border);
  color: var(--text);
  font-family: var(--font);
  font-size: 14px;
  cursor: pointer;
  outline: none;
  color-scheme: dark;
}
input[type="date"]:focus { border-color: var(--accent); }

/* Spoilers toggle */
.spoilers-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  font-size: 14px;
  color: var(--text2);
  user-select: none;
  margin-left: 4px;
}
.spoilers-label input[type="checkbox"] { display: none; }
.spoilers-track {
  position: relative;
  width: 36px;
  height: 20px;
  background: var(--bg4);
  border: 1px solid var(--border2);
  border-radius: 99px;
  transition: background 0.2s, border-color 0.2s;
  flex-shrink: 0;
}
.spoilers-thumb {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 12px;
  height: 12px;
  background: var(--text3);
  border-radius: 50%;
  transition: transform 0.2s, background 0.2s;
}
.spoilers-label input:checked + .spoilers-track {
  background: var(--accent);
  border-color: var(--accent);
}
.spoilers-label input:checked + .spoilers-track .spoilers-thumb {
  transform: translateX(16px);
  background: var(--bg);
}

/* ═══════════════════════════════════════════════
   GAME CARDS (home page)
═══════════════════════════════════════════════ */
.games-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 16px;
  margin-bottom: 48px;
}
.game-card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  transition: border-color 0.15s;
}
.game-card { cursor: pointer; }
.game-card:hover { border-color: var(--border2); transform: translateY(-1px); }

.game-matchup {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.team-block {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  flex: 1;
}
.team-logo {
  width: 52px;
  height: 52px;
  object-fit: contain;
}
.team-abbr {
  font-family: var(--mono);
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
}
.team-label {
  font-size: 11px;
  color: var(--text3);
}
.game-vs {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  font-size: 14px;
  color: var(--text3);
  font-weight: 600;
}
.game-score {
  font-family: var(--mono);
  font-size: 15px;
  font-weight: 700;
  color: var(--strong);
  white-space: nowrap;
}
.game-live-clock {
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 600;
  color: var(--accent);
  white-space: nowrap;
}
.game-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.status-badge {
  font-size: 12px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 99px;
  font-family: var(--mono);
}
.status-live      { background: rgba(74,222,128,0.15); color: var(--green); }
.status-final     { background: rgba(90,88,106,0.3);   color: var(--text3); }
.status-scheduled { background: rgba(45,212,191,0.1);  color: var(--accent); }

/* ═══════════════════════════════════════════════
   LOADING / EMPTY STATES
═══════════════════════════════════════════════ */
.state-box {
  text-align: center;
  padding: 60px 24px;
  color: var(--text2);
}
.state-box .icon { font-size: 40px; margin-bottom: 12px; }
.state-box p { font-size: 16px; }

.spinner {
  width: 32px;
  height: 32px;
  border: 3px solid var(--border2);
  border-top-color: var(--accent2);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  margin: 0 auto 12px;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ═══════════════════════════════════════════════
   GAME PAGE LAYOUT
═══════════════════════════════════════════════ */
.game-layout {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) minmax(320px, 2fr);
  gap: 24px;
  align-items: start;
  padding-bottom: 48px;
}

/* Sidebar: sticky on desktop */
.game-sidebar {
  position: sticky;
  top: 78px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* Main content */
.game-main {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

/* Content sections */
.content-section {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  min-width: 0; /* prevent grid blowout */
  max-width: 100%;
  /* Do NOT use overflow:hidden here — it blocks horizontal scroll on .table-wrap children.
     Border-radius corners are clipped via the border itself on modern browsers. */
}
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px 12px;
  border-bottom: 1px solid var(--border);
}
.section-title {
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--text3);
}

/* ═══════════════════════════════════════════════
   CONTROL PANEL
═══════════════════════════════════════════════ */
.control-panel {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  margin-bottom: 16px;
}

/* ═══════════════════════════════════════════════
   TIMELINE SCRUBBER
═══════════════════════════════════════════════ */
.scrubber-wrap {
  padding: 10px 16px 8px;
  border-bottom: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.scrubber-track-area {
  position: relative;
  width: 100%;
}
.scrubber-ticks {
  position: absolute;
  top: 50%;
  left: 0;
  right: 0;
  transform: translateY(-50%);
  pointer-events: none;
  height: 20px;
}
.scrubber-tick {
  position: absolute;
  width: 3px;
  height: 8px;
  border-radius: 2px;
  top: 50%;
  transform: translate(-50%, -50%);
  opacity: 0.7;
}
.scrubber-tick-score   { background: var(--accent); height: 10px; }
.scrubber-tick-three   { background: #a3e635; height: 10px; }
.scrubber-tick-ft      { background: var(--green); height: 6px; opacity: 0.5; }
.scrubber-tick-turnover { background: var(--red); height: 7px; opacity: 0.6; }
.scrubber-tick-default { background: var(--text3); height: 5px; opacity: 0.3; }

/* Range input styling */
.scrubber {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 4px;
  background: var(--bg4);
  border-radius: 99px;
  outline: none;
  cursor: pointer;
  position: relative;
  z-index: 1;
}
.scrubber::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--accent);
  cursor: pointer;
  border: 2px solid var(--bg);
  box-shadow: 0 0 0 1px var(--accent);
  transition: transform 0.1s;
}
.scrubber::-webkit-slider-thumb:hover {
  transform: scale(1.2);
}
.scrubber::-moz-range-thumb {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--accent);
  cursor: pointer;
  border: 2px solid var(--bg);
  box-shadow: 0 0 0 1px var(--accent);
}
.scrubber:disabled {
  opacity: 0.35;
  cursor: default;
}
.scrubber:disabled::-webkit-slider-thumb { cursor: default; }

.scrubber-labels {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-family: var(--mono);
  font-size: 10px;
  color: var(--text3);
  padding: 0 2px;
}
.scrubber-clock {
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
  font-family: var(--mono);
  letter-spacing: 0.04em;
}

/* ═══════════════════════════════════════════════
   FULL-WIDTH SCORE BAR
═══════════════════════════════════════════════ */
.score-bar {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 20px;
  margin-bottom: 16px;
  max-width: 800px;
  margin-left: auto;
  margin-right: auto;
}

/* Away: logo · name · score  (score at inner edge, logo at outer) */
.score-bar-team {
  display: flex;
  align-items: center;
  gap: 10px;
  justify-content: flex-end;
  min-width: 0;
}
/* Home: score · name · logo  (score at inner edge, logo at outer) */
.score-bar-team-home {
  justify-content: flex-start;
}

.score-bar-logo {
  width: 44px;
  height: 44px;
  object-fit: contain;
  flex-shrink: 0;
  display: block;
}
.score-bar-info {
  display: flex;
  flex-direction: column;
  gap: 3px;
  flex-shrink: 0;
}
.score-bar-info-home { align-items: flex-end; }
.score-bar-abbr {
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: 0.02em;
  text-transform: uppercase;
  line-height: 1;
}
.score-bar-label {
  font-size: 11px;
  color: var(--text3);
  line-height: 1;
}
.score-bar-val {
  font-size: 48px;
  font-weight: 700;
  font-family: var(--mono);
  color: var(--text);
  line-height: 1;
  flex-shrink: 0;
  min-width: 56px;
  text-align: center;
}
.score-bar-team-home .score-bar-val {
  /* inherits same style, position handled by flex-direction: row-reverse */
}
.score-bar-val.score-winning { color: var(--accent); }

/* Center divider: period label */
.score-bar-center {
  display: flex;
  flex-direction: column;
  align-items: center;
  flex-shrink: 0;
  gap: 4px;
  padding: 0 24px;
  border-left: 1px solid var(--border);
  border-right: 1px solid var(--border);
  margin: 0 20px;
}
.score-bar-period {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--text3);
  white-space: nowrap;
}
/* hidden clock input — kept for JS compatibility, not displayed */
#clock-input {
  display: none;
}

/* Period tabs */
.period-tabs {
  display: flex;
  gap: 0;
  border-bottom: 1px solid var(--border);
}
.period-tab {
  flex: 1;
  padding: 9px 4px;
  border-radius: 0;
  background: transparent;
  border: none;
  border-right: 1px solid var(--border);
  color: var(--text3);
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
  text-align: center;
}
.period-tab:last-child { border-right: none; }
.period-tab:hover { background: var(--bg3); color: var(--text); }
.period-tab.active { background: var(--accent); color: #fff; }
.period-tab-final { color: var(--text3); }
.period-tab-final.active { background: var(--strong); color: var(--bg); }

/* Scrubber row: ▶ [===scrubber===] speed */
.scrubber-row {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
}
.play-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--accent);
  border: none;
  color: #fff;
  font-size: 13px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s;
  flex-shrink: 0;
  padding: 0;
  line-height: 1;
}
.play-btn:hover { opacity: 0.85; }
.play-btn.playing { background: var(--text3); }
.play-btn:disabled { opacity: 0.35; cursor: default; }

.speed-select {
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text2);
  font-size: 11px;
  font-family: var(--mono);
  padding: 6px 4px;
  cursor: pointer;
  outline: none;
  flex-shrink: 0;
  height: 34px;
}
.speed-select:focus { border-color: var(--accent); }

/* ═══════════════════════════════════════════════
   PLAY FEED
═══════════════════════════════════════════════ */
.play-feed {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
.play-feed-header {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text3);
  padding: 8px 12px 6px;
  border-bottom: 1px solid var(--border);
}
.play-feed-list {
  display: flex;
  flex-direction: column;
}
.play-feed-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 8px 12px;
  border-bottom: 1px solid var(--border);
  transition: background 0.3s;
}
.play-feed-item:last-child { border-bottom: none; }
.play-feed-empty {
  padding: 12px;
  font-size: 13px;
  color: var(--text3);
  font-style: italic;
}
.feed-meta {
  display: flex;
  align-items: center;
  gap: 6px;
}
.feed-logo {
  width: 18px;
  height: 18px;
  object-fit: contain;
  flex-shrink: 0;
  border-radius: 2px;
}
.feed-logo-placeholder {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}
.feed-time {
  font-size: 10px;
  font-family: var(--mono);
  color: var(--text3);
  flex: 1;
}
.feed-score-badge {
  font-size: 10px;
  font-family: var(--mono);
  color: var(--text2);
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 1px 5px;
  white-space: nowrap;
}
.feed-text {
  font-size: 12px;
  color: var(--text);
  line-height: 1.4;
}
.feed-score    .feed-text { color: #4ade80; }
.feed-three    .feed-text { color: #a3e635; font-weight: 600; }
.feed-ft       .feed-text { color: #86efac; }
.feed-turnover .feed-text { color: #f87171; }
.feed-foul     .feed-text { color: var(--text2); }

@keyframes feedFlash {
  0%   { background: rgba(255,255,255,0.08); }
  100% { background: transparent; }
}
.feed-flash { animation: feedFlash 0.6s ease-out; }



/* ═══════════════════════════════════════════════
   TEAM TOGGLE (box score section)
═══════════════════════════════════════════════ */
.team-toggle {
  display: flex;
  gap: 4px;
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 3px;
}
.team-toggle-btn {
  padding: 5px 14px;
  border-radius: 5px;
  background: transparent;
  border: none;
  color: var(--text3);
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s;
}
.team-toggle-btn.active {
  background: var(--bg2);
  color: var(--text);
  box-shadow: 0 1px 3px rgba(0,0,0,0.3);
}
.team-toggle-btn:not(.active):hover { color: var(--text2); }

/* ═══════════════════════════════════════════════
   BOX SCORE TABLE
═══════════════════════════════════════════════ */
.table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  /* Show scrollbar on mobile so users know it's scrollable */
  scrollbar-width: thin;
  scrollbar-color: var(--border2) transparent;
}
.table-wrap::-webkit-scrollbar {
  height: 4px;
}
.table-wrap::-webkit-scrollbar-track {
  background: transparent;
}
.table-wrap::-webkit-scrollbar-thumb {
  background: var(--border2);
  border-radius: 99px;
}
table {
  width: 100%;
  border-collapse: collapse;
  font-family: var(--mono);
  font-size: 13px;
  white-space: nowrap;
}
thead th {
  background: var(--bg3);
  color: var(--text3);
  font-weight: 600;
  padding: 10px 12px;
  text-align: right;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  border-bottom: 1px solid var(--border);
}
thead th.col-name, thead th:first-child {
  text-align: left;
  min-width: 130px;
  position: sticky;
  left: 0;
  z-index: 2;
  background: var(--bg3);
}

tbody tr {
  border-bottom: 1px solid var(--border);
  transition: background 0.1s;
}
tbody tr:last-child { border-bottom: none; }
tbody tr:hover { background: var(--bg3); }
tbody td {
  padding: 10px 12px;
  text-align: right;
  color: var(--text2);
}
tbody td.col-name, tbody td:first-child {
  text-align: left;
  color: var(--text);
  font-family: var(--font);
  font-weight: 500;
  font-size: 14px;
  position: sticky;
  left: 0;
  z-index: 1;
  background: var(--bg2);
}
tbody tr:hover td.col-name, tbody tr:hover td:first-child {
  background: var(--bg3);
}
td.pts { color: var(--text); font-weight: 700; }
td.pm  { font-weight: 600; }

tfoot tr { border-top: 2px solid var(--border2); }
tfoot td {
  padding: 10px 12px;
  text-align: right;
  color: var(--text);
  font-weight: 700;
  background: var(--bg3);
}
tfoot td:first-child {
  text-align: left;
  position: sticky;
  left: 0;
  z-index: 1;
  background: var(--bg3);
}

tr.group-header-row {
  position: sticky;
  top: 0;
  z-index: 3;
}
tr.group-header-row td {
  padding: 6px 12px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text3);
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  position: sticky;
  left: 0;
}

/* ═══════════════════════════════════════════════
   GAME LEADERS SECTION
═══════════════════════════════════════════════ */
.leaders-grid {
  display: flex;
  gap: 1px;
  background: var(--border);
}
.leader-card {
  flex: 1;
  background: var(--bg2);
  padding: 16px 14px;
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}
.leader-card-stat {
  font-size: 26px;
  font-weight: 700;
  font-family: var(--mono);
  color: var(--accent);
  line-height: 1;
}
.leader-card-label {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--text3);
}
.leader-card-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  margin-top: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.leader-card-team {
  font-size: 11px;
  color: var(--text3);
  font-family: var(--mono);
}

/* ═══════════════════════════════════════════════
   TEAM STATS TABLE
═══════════════════════════════════════════════ */
.team-stats-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}
.team-stats-table thead th {
  padding: 10px 16px;
  text-align: center;
  font-size: 13px;
  font-weight: 700;
  font-family: var(--mono);
  color: var(--text2);
  background: var(--bg2);
  text-transform: none;
  letter-spacing: 0;
  border-bottom: 1px solid var(--border);
}
.team-stats-table thead th:first-child { text-align: center; }
.team-stats-table thead th:last-child  { text-align: center; }

.team-stats-table tbody tr {
  border-bottom: 1px solid var(--border);
  transition: background 0.1s;
}
.team-stats-table tbody tr:last-child { border-bottom: none; }
.team-stats-table tbody tr:hover { background: var(--bg3); }

.ts-val {
  padding: 9px 12px;
  font-family: var(--mono);
  font-size: 14px;
  font-weight: 600;
  color: var(--text2) !important;  /* override tbody td:first-child which catches the away col */
  text-align: center !important;
  width: 28%;
}
.ts-label {
  padding: 9px 8px;
  text-align: center;
  font-size: 12px;
  color: var(--text3);
  width: 44%;
}
.ts-leader {
  color: var(--accent) !important;
  font-weight: 700;
}

/* ═══════════════════════════════════════════════
   REVEAL BAR
═══════════════════════════════════════════════ */
.reveal-bar {
  text-align: center;
}

/* ═══════════════════════════════════════════════
   MODAL
═══════════════════════════════════════════════ */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.7);
  backdrop-filter: blur(4px);
  z-index: 200;
  align-items: center;
  justify-content: center;
}
.modal-overlay.show { display: flex; }
.modal {
  background: var(--bg2);
  border: 1px solid var(--border2);
  border-radius: var(--radius);
  padding: 32px;
  max-width: 400px;
  width: 90%;
  text-align: center;
}
.modal h2 { font-size: 20px; margin-bottom: 8px; }
.modal p  { color: var(--text2); margin-bottom: 24px; font-size: 15px; }
.modal-actions { display: flex; gap: 12px; justify-content: center; }

/* ═══════════════════════════════════════════════
   RESPONSIVE
═══════════════════════════════════════════════ */
@media (max-width: 768px) {
  /* Single-column on mobile: controls → recent plays → box score */
  .game-layout {
    grid-template-columns: 1fr;
    display: flex;
    flex-direction: column;
    gap: 16px;
    padding-bottom: 32px;
  }
  .game-sidebar {
    position: static;
    order: 1; /* recent plays right after controls */
    width: 100%; /* ensure full width */
  }
  .game-sidebar .play-feed {
    width: 100%;
  }
  .game-main {
    order: 2;
    width: 100%;
    min-width: 0;
  }

  /* Tighter score bar on mobile */
  .score-bar {
    padding: 10px 12px;
  }
  .score-bar-logo {
    width: 36px;
    height: 36px;
  }
  .score-bar-val {
    font-size: 34px;
    min-width: 40px;
  }
  .score-bar-team {
    gap: 8px;
  }
  .score-bar-center {
    padding: 0 12px;
    margin: 0 8px;
  }
  .score-bar-abbr {
    font-size: 13px;
  }
  .score-bar-label {
    font-size: 10px;
  }

  /* Tighter nav on mobile */
  .nav-inner {
    height: 48px;
  }
  .nav-logo {
    font-size: 15px;
  }
  .nav-logo .logo-icon {
    font-size: 18px;
  }

  /* Less padding on mobile */
  .container {
    padding: 0 12px;
  }
}

@media (max-width: 600px) {
  .games-grid { grid-template-columns: 1fr; }
  .period-tabs { gap: 4px; }
  .period-tab  { padding: 6px 10px; font-size: 12px; }
  .leaders-grid { flex-wrap: wrap; }
  .leader-card { min-width: calc(33% - 1px); }

  /* Tighter box score table on mobile */
  table {
    font-size: 11px;
  }
  thead th, tbody td, tfoot td {
    padding: 8px 7px;
  }
  thead th.col-name, tbody td.col-name, tbody td:first-child, tfoot td:first-child {
    min-width: 90px;
  }

  /* Team stats tighter on mobile */
  .team-stats-table {
    font-size: 13px;
  }
  .team-stats-table thead th {
    padding: 8px 6px;
    font-size: 12px;
  }
  .ts-val {
    padding: 8px 6px;
    font-size: 13px;
  }
  .ts-label {
    padding: 8px 4px;
    font-size: 11px;
  }
}
