/* ============================================================
   PETER'S STATS — Comic Book / 90s Art Style
   ============================================================ */

:root {
  --bg:         #F5EDD0;   /* newsprint cream */
  --bg2:        #EDE0BE;
  --bg3:        #E0D4B0;
  --panel:      #FFFDF5;   /* near-white panel */
  --border:     #111111;   /* comic ink black */
  --border2:    #444433;
  --amber:      #E8B400;   /* comic yellow */
  --amber2:     #C89A00;
  --green:      #00A550;   /* bright comic green */
  --red:        #CC1122;   /* comic red */
  --blue:       #1155AA;   /* comic blue */
  --text:       #111111;
  --text-dim:   #665544;
  --text-bright:#000000;
  --live-pulse: #CC1122;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

/* Halftone dot newsprint background */
body {
  background-color: var(--bg);
  background-image: radial-gradient(circle, rgba(0,0,0,0.10) 1px, transparent 1px);
  background-size: 8px 8px;
  color: var(--text);
  font-family: 'IBM Plex Sans', sans-serif;
  min-height: 100vh;
  overflow-x: hidden;
}

/* ── HEADER ─────────────────────────────────────────────────── */
header {
  background-color: var(--red);
  background-image: repeating-linear-gradient(
    45deg,
    transparent, transparent 10px,
    rgba(0,0,0,0.08) 10px, rgba(0,0,0,0.08) 20px
  );
  border-bottom: 4px solid var(--border);
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 4px 0 var(--border);
}

.logo {
  display: flex;
  align-items: center;
  gap: 12px;
}

.logo-icon {
  width: 46px;
  height: 46px;
  background: var(--amber);
  border: 3px solid var(--border);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  flex-shrink: 0;
  box-shadow: 3px 3px 0 var(--border);
}

.logo h1 {
  font-family: 'Bangers', cursive;
  font-size: 36px;
  letter-spacing: 4px;
  color: #FFFFFF;
  line-height: 1;
  text-shadow: 3px 3px 0 var(--border), -1px -1px 0 rgba(0,0,0,0.3);
}

.logo h1 span { color: var(--amber); }

.logo h1 a {
  color: #FFE566;
  font-size: 15px;
  letter-spacing: 1px;
  text-decoration: none;
  vertical-align: middle;
  font-family: 'IBM Plex Mono', monospace;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 16px;
}

.date-display {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 11px;
  color: rgba(255,255,255,0.7);
  letter-spacing: 1px;
}

.date-input-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
}

.date-input-wrap label {
  font-family: 'Bangers', cursive;
  font-size: 20px;
  color: #FFFFFF;
  letter-spacing: 2px;
  text-shadow: 2px 2px 0 var(--border);
}

input[type="date"] {
  background: var(--panel);
  border: 2px solid var(--border);
  color: var(--text);
  font-family: 'IBM Plex Mono', monospace;
  font-size: 12px;
  padding: 5px 10px;
  border-radius: 0;
  cursor: pointer;
  outline: none;
  box-shadow: 2px 2px 0 var(--border);
}

input[type="date"]:focus {
  border-color: var(--amber);
  box-shadow: 2px 2px 0 var(--amber2);
}

.refresh-btn {
  background: var(--amber);
  border: 2px solid var(--border);
  color: var(--border);
  font-family: 'Bangers', cursive;
  font-size: 20px;
  letter-spacing: 2px;
  padding: 5px 16px;
  border-radius: 0;
  cursor: pointer;
  box-shadow: 3px 3px 0 var(--border);
  transition: all .1s;
}

.refresh-btn:hover {
  background: #FFD700;
  transform: translate(-1px, -1px);
  box-shadow: 4px 4px 0 var(--border);
}

.refresh-btn:active {
  transform: translate(2px, 2px);
  box-shadow: 1px 1px 0 var(--border);
}

.live-badge {
  display: flex;
  align-items: center;
  gap: 6px;
  font-family: 'Bangers', cursive;
  font-size: 24px;
  letter-spacing: 2px;
  color: #FFFFFF;
  text-shadow: 2px 2px 0 var(--border);
}

.live-dot {
  width: 10px;
  height: 10px;
  background: #FFD700;
  border: 2px solid var(--border);
  border-radius: 50%;
  animation: pulse 1.4s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%       { opacity: 0.5; transform: scale(0.8); }
}

/* ── TABS ────────────────────────────────────────────────────── */
.tabs {
  display: flex;
  gap: 0;
  border-bottom: 4px solid var(--border);
  padding: 0 16px;
  background-color: var(--amber);
  background-image: repeating-linear-gradient(
    90deg,
    transparent, transparent 4px,
    rgba(0,0,0,0.05) 4px, rgba(0,0,0,0.05) 8px
  );
}

.tab-btn {
  background: none;
  border: none;
  border-right: 2px solid rgba(0,0,0,0.15);
  color: rgba(0,0,0,0.55);
  font-family: 'Bangers', cursive;
  font-size: 24px;
  letter-spacing: 2px;
  padding: 10px 24px;
  cursor: pointer;
  border-bottom: 4px solid transparent;
  margin-bottom: -4px;
  transition: all .15s;
}

.tab-btn:hover { color: var(--border); }

.tab-btn.active {
  color: var(--border);
  background: var(--panel);
  border-bottom-color: var(--panel);
  border-left: 2px solid rgba(0,0,0,0.15);
}

/* ── MAIN LAYOUT ──────────────────────────────────────────────── */
.main {
  display: grid;
  grid-template-columns: 1fr 380px;
  gap: 0;
  height: calc(100vh - 104px);
}

.tab-view { display: none; }
.tab-view.active { display: flex; flex-direction: column; }

/* ── GAMES PANEL ─────────────────────────────────────────────── */
#tab-scores {
  flex-direction: row;
  height: 100%;
  overflow: hidden;
}

.games-list {
  width: 300px;
  flex-shrink: 0;
  border-right: 3px solid var(--border);
  overflow-y: auto;
  background: var(--bg2);
}

.games-list::-webkit-scrollbar { width: 6px; }
.games-list::-webkit-scrollbar-track { background: var(--bg3); }
.games-list::-webkit-scrollbar-thumb {
  background: var(--border2);
  border: 1px solid var(--border);
}

.section-header {
  padding: 10px 14px;
  font-family: 'Bangers', cursive;
  font-size: 18px;
  letter-spacing: 2px;
  color: var(--border);
  text-transform: uppercase;
  border-bottom: 3px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  background: var(--amber);
  z-index: 10;
  box-shadow: 0 3px 0 var(--border);
}

.game-card {
  border-bottom: 2px solid var(--border2);
  padding: 12px 14px;
  cursor: pointer;
  transition: background .12s;
  position: relative;
  background: var(--panel);
}

.game-card:hover { background: #FFF5CC; }

.game-card.selected {
  background: #FFF0A0;
  border-left: 5px solid var(--amber);
}

.game-card.selected .away-name,
.game-card.selected .home-name { color: var(--text-bright); }

.game-status-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.game-status {
  font-family: 'Bangers', cursive;
  font-size: 15px;
  letter-spacing: 1px;
  color: var(--text-dim);
  text-transform: uppercase;
}

.game-status.live {
  color: var(--red);
  font-size: 17px;
  display: flex;
  align-items: center;
  gap: 5px;
}

.game-status.live::before {
  content: '';
  display: inline-block;
  width: 8px;
  height: 8px;
  background: var(--red);
  border: 1.5px solid var(--border);
  border-radius: 50%;
  animation: pulse 1.4s ease-in-out infinite;
}

.game-status.final { color: var(--text-dim); }

.game-time {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 10px;
  color: var(--text-dim);
}

.matchup-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 2px 0;
}

.team-name-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
}

.team-abbr {
  font-family: 'Bangers', cursive;
  font-size: 22px;
  color: var(--text-bright);
  letter-spacing: 1px;
  width: 38px;
}

.team-record {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 10px;
  color: var(--text-dim);
}

.team-score {
  font-family: 'Bangers', cursive;
  font-size: 28px;
  color: var(--text-bright);
  min-width: 32px;
  text-align: right;
  letter-spacing: 1px;
}

.team-score.winner { color: var(--red); }

/* ── GAME DETAIL ─────────────────────────────────────────────── */
.game-detail {
  flex: 1;
  overflow-y: auto;
  padding: 16px 20px;
  background-color: var(--bg);
  background-image: radial-gradient(circle, rgba(0,0,0,0.07) 1px, transparent 1px);
  background-size: 8px 8px;
}

.game-detail::-webkit-scrollbar { width: 6px; }
.game-detail::-webkit-scrollbar-track { background: var(--bg); }
.game-detail::-webkit-scrollbar-thumb { background: var(--border2); border: 1px solid var(--border); }

.no-game-selected {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  gap: 16px;
  color: var(--text-dim);
}

.no-game-selected .icon { font-size: 64px; }

.no-game-selected p {
  font-family: 'Bangers', cursive;
  font-size: 24px;
  letter-spacing: 3px;
  color: var(--border);
  background: var(--amber);
  padding: 10px 24px;
  border: 3px solid var(--border);
  box-shadow: 5px 5px 0 var(--border);
}

/* ── LINESCORE ───────────────────────────────────────────────── */
.linescore-wrap {
  background: var(--panel);
  border: 3px solid var(--border);
  overflow: hidden;
  margin-bottom: 16px;
  box-shadow: 5px 5px 0 var(--border);
}

.linescore-title {
  padding: 8px 16px;
  font-family: 'Bangers', cursive;
  font-size: 20px;
  letter-spacing: 2px;
  color: #FFFFFF;
  text-transform: uppercase;
  border-bottom: 3px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--blue);
  text-shadow: 2px 2px 0 rgba(0,0,0,0.35);
}

.linescore-table {
  width: 100%;
  border-collapse: collapse;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 12px;
}

.linescore-table th {
  padding: 6px 8px;
  color: var(--text-dim);
  font-size: 10px;
  font-weight: 700;
  text-align: center;
  background: var(--bg2);
  border-right: 1px solid var(--border2);
  border-bottom: 2px solid var(--border);
}

.linescore-table th:first-child { text-align: left; padding-left: 14px; }
.linescore-table th:last-child  { border-right: none; }

.linescore-table td {
  padding: 8px;
  text-align: center;
  color: var(--text);
  border-right: 1px solid var(--border2);
  border-top: 1px solid var(--border2);
}

.linescore-table td:first-child  { text-align: left; padding-left: 14px; color: var(--text-bright); font-weight: 700; }
.linescore-table td:last-child   { border-right: none; }
.linescore-table .totals         { font-weight: 700; background: #FFF5CC; }
.linescore-table .totals td      { color: var(--text-bright); font-weight: 900; }
.linescore-table .current-inn   { background: #FFE566 !important; color: var(--red) !important; font-weight: 900; }

/* ── BOXSCORE ────────────────────────────────────────────────── */
.boxscore-section { margin-bottom: 16px; }

.boxscore-label {
  font-family: 'Bangers', cursive;
  font-size: 18px;
  letter-spacing: 2px;
  color: #FFFFFF;
  background: var(--border);
  padding: 6px 14px;
  border: 3px solid var(--border);
  border-bottom: none;
}

.stat-table {
  width: 100%;
  border-collapse: collapse;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 11px;
  background: var(--panel);
  border: 3px solid var(--border);
  box-shadow: 4px 4px 0 var(--border);
}

.stat-table th {
  padding: 7px 10px;
  color: #FFFFFF;
  font-size: 10px;
  letter-spacing: 1px;
  text-align: center;
  background: var(--border2);
  border-bottom: 2px solid var(--border);
}

.stat-table th:first-child { text-align: left; padding-left: 14px; }

.stat-table td {
  padding: 7px 10px;
  text-align: center;
  color: var(--text);
  border-bottom: 1px solid var(--border2);
}

.stat-table td:first-child { text-align: left; padding-left: 14px; color: var(--text-bright); font-weight: 600; }
.stat-table tr:last-child td { border-bottom: none; }
.stat-table tr:hover td     { background: #FFF5CC; }
.stat-table .highlight td   { background: #FFF0A0; font-weight: 900; }
.stat-table .highlight td:first-child { color: var(--red); }

/* ── STANDINGS ───────────────────────────────────────────────── */
#tab-standings {
  overflow-y: auto;
  padding: 16px 20px;
  background-color: var(--bg);
  background-image: radial-gradient(circle, rgba(0,0,0,0.07) 1px, transparent 1px);
  background-size: 8px 8px;
}

#tab-standings::-webkit-scrollbar { width: 6px; }
#tab-standings::-webkit-scrollbar-thumb { background: var(--border2); }

.standings-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 20px;
  max-width: 1200px;
}

.standings-division {
  background: var(--panel);
  border: 3px solid var(--border);
  box-shadow: 5px 5px 0 var(--border);
  overflow: hidden;
}

.division-header {
  padding: 10px 14px;
  font-family: 'Bangers', cursive;
  font-size: 22px;
  letter-spacing: 3px;
  color: #FFFFFF;
  background: var(--blue);
  border-bottom: 3px solid var(--border);
  text-shadow: 2px 2px 0 rgba(0,0,0,0.35);
}

.standings-table {
  width: 100%;
  border-collapse: collapse;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 11px;
}

.standings-table th {
  padding: 6px 8px;
  color: var(--text-dim);
  font-size: 10px;
  font-weight: 700;
  text-align: center;
  border-bottom: 2px solid var(--border);
  background: var(--bg2);
}

.standings-table th:first-child { text-align: left; padding-left: 12px; }

.standings-table td {
  padding: 7px 8px;
  text-align: center;
  color: var(--text);
  border-bottom: 1px solid var(--border2);
}

.standings-table td:first-child { text-align: left; padding-left: 12px; color: var(--text-bright); font-weight: 600; }
.standings-table tr:last-child td { border-bottom: none; }
.standings-table tr:hover td { background: #FFF5CC; }
.standings-table .first-place td:first-child { color: var(--red); font-weight: 900; }
.standings-table .magic-num { color: var(--green); font-weight: 700; }
.standings-table .elim-num  { color: var(--red); }
.wildcard-line td { border-top: 2px dashed var(--blue) !important; }

/* ── LOADING / ERROR ─────────────────────────────────────────── */
.loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 200px;
  gap: 12px;
  color: var(--text-dim);
  font-family: 'Bangers', cursive;
  font-size: 20px;
  letter-spacing: 3px;
}

.spinner {
  width: 32px;
  height: 32px;
  border: 3px solid var(--border2);
  border-top-color: var(--red);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

.error-msg {
  padding: 20px;
  text-align: center;
  color: var(--red);
  font-family: 'Bangers', cursive;
  font-size: 22px;
  letter-spacing: 2px;
}

/* ── BATTERIES BOX — Live At-Bat Comic Panel ─────────────────── */
.batteries-box {
  background: var(--panel);
  border: 4px solid var(--border);
  margin-bottom: 16px;
  overflow: hidden;
  box-shadow: 6px 6px 0 var(--border);
  position: relative;
}

/* Comic caption strip at the top */
.batteries-box::before {
  content: '⚾  NOW AT BAT  ⚾';
  display: block;
  font-family: 'Bangers', cursive;
  font-size: 22px;
  letter-spacing: 5px;
  color: #FFFFFF;
  background: var(--red);
  background-image: repeating-linear-gradient(
    45deg,
    transparent, transparent 8px,
    rgba(255,255,255,0.08) 8px, rgba(255,255,255,0.08) 16px
  );
  padding: 8px 16px;
  border-bottom: 3px solid var(--border);
  text-shadow: 2px 2px 0 rgba(0,0,0,0.35);
  text-align: center;
}

.batteries-top-bar {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 12px 16px;
  background: #FFF8E0;
  border-bottom: 2px solid var(--border);
  flex-wrap: wrap;
}

.inning-big {
  font-family: 'Bangers', cursive;
  font-size: 30px;
  letter-spacing: 3px;
  color: var(--red);
  line-height: 1;
  min-width: 110px;
  text-shadow: 2px 2px 0 rgba(0,0,0,0.12);
}

.bases-count-wrap {
  display: flex;
  align-items: center;
  gap: 24px;
  flex: 1;
}

/* Base diamond diagram */
.base-diagram {
  display: grid;
  grid-template-columns: repeat(3, 20px);
  grid-template-rows: repeat(2, 20px);
  gap: 3px;
  transform: rotate(45deg);
  margin: 8px 10px;
  flex-shrink: 0;
}

.base {
  width: 20px;
  height: 20px;
  border: 2.5px solid var(--border2);
  background: var(--bg2);
  transition: background .2s, border-color .2s;
}

.base.occupied {
  background: var(--amber);
  border-color: var(--border);
  box-shadow: 2px 2px 0 var(--border);
}

.base-2b { grid-column: 2; grid-row: 1; }
.base-3b { grid-column: 1; grid-row: 2; }
.base-1b { grid-column: 3; grid-row: 2; }

/* Count pips */
.count-panel {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.count-row {
  display: flex;
  align-items: center;
  gap: 7px;
}

.count-label {
  font-family: 'Bangers', cursive;
  font-size: 18px;
  letter-spacing: 1px;
  color: var(--text-dim);
  width: 16px;
  text-align: right;
}

.count-pips { display: flex; gap: 5px; }

.pip {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 2px solid var(--border2);
  background: var(--bg2);
  transition: background .15s, border-color .15s, transform .15s;
}

.pip.ball-on {
  background: var(--green);
  border-color: var(--border);
  box-shadow: 1px 1px 0 var(--border);
  animation: pip-pop .25s ease-out;
}

.pip.strike-on {
  background: var(--red);
  border-color: var(--border);
  box-shadow: 1px 1px 0 var(--border);
  animation: pip-pop .25s ease-out;
}

.pip.out-on {
  background: #E86820;
  border-color: var(--border);
  box-shadow: 1px 1px 0 var(--border);
  animation: pip-pop .25s ease-out;
}

@keyframes pip-pop {
  0%   { transform: scale(0.4); opacity: 0.4; }
  60%  { transform: scale(1.4); }
  100% { transform: scale(1);   opacity: 1; }
}

/* Last play bar */
.last-play-bar {
  padding: 8px 16px;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 11px;
  color: var(--text-dim);
  border-bottom: 2px solid var(--border);
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 36px;
  background: #F8F0D0;
}

.last-play-bar .lp-label {
  font-family: 'Bangers', cursive;
  font-size: 15px;
  letter-spacing: 2px;
  color: var(--text-dim);
  flex-shrink: 0;
}

.last-play-bar .lp-text         { color: var(--text); font-size: 11px; }
.last-play-bar .lp-text.hr      { color: var(--red); font-weight: 700; font-family: 'Bangers', cursive; font-size: 16px; letter-spacing: 1px; }
.last-play-bar .lp-text.foul    { color: var(--blue); font-weight: 600; }
.last-play-bar .lp-text.k       { color: var(--red); font-weight: 700; }
.last-play-bar .lp-text.walk    { color: var(--green); font-weight: 700; }

/* Player cards */
.batteries-players {
  display: grid;
  grid-template-columns: 1fr 3px 1fr;
}

.batt-divider { background: var(--border); }

.batt-side {
  padding: 12px 14px;
  background: var(--panel);
}

.batt-side:last-child { background: #F0F8FF; }

.batt-role {
  font-family: 'Bangers', cursive;
  font-size: 16px;
  letter-spacing: 2px;
  color: var(--text-dim);
  margin-bottom: 4px;
}

.batt-name {
  font-family: 'Bangers', cursive;
  font-size: 24px;
  letter-spacing: 1px;
  color: var(--text-bright);
  margin-bottom: 8px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-shadow: 1px 1px 0 rgba(0,0,0,0.1);
}

.batt-stats-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.batt-stat {
  display: flex;
  flex-direction: column;
  gap: 2px;
  background: var(--bg2);
  padding: 4px 8px;
  border: 2px solid var(--border2);
  box-shadow: 2px 2px 0 var(--border2);
}

.batt-stat-val {
  font-family: 'Bangers', cursive;
  font-size: 24px;
  color: var(--text-bright);
  line-height: 1;
  letter-spacing: 1px;
}

.batt-stat-lbl {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 8px;
  letter-spacing: 1px;
  color: var(--text-dim);
  text-transform: uppercase;
}

.batt-today {
  margin-top: 8px;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 10px;
  color: var(--text-dim);
  padding-top: 6px;
  border-top: 2px solid var(--border2);
}

.batt-today span { color: var(--text); font-weight: 600; }

/* Pitch zone */
.pitch-zone-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  margin-top: 6px;
}

.pitch-zone-label {
  font-family: 'Bangers', cursive;
  font-size: 12px;
  letter-spacing: 1px;
  color: var(--text-dim);
}

.pitch-zone {
  display: grid;
  grid-template-columns: repeat(3, 20px);
  grid-template-rows: repeat(3, 20px);
  gap: 2px;
  border: 2px solid var(--border);
  padding: 3px;
  background: var(--bg2);
}

.pz-cell {
  width: 20px;
  height: 20px;
  background: var(--bg3);
  border: 1px solid var(--border2);
  transition: background .2s;
}

.pz-cell.strike-loc { background: rgba(204,17,34,0.40); border-color: var(--red); }
.pz-cell.ball-loc   { background: rgba(0,165,80,0.20);  border-color: var(--green); }

/* ── FIREWORKS ───────────────────────────────────────────────── */
#fireworks-canvas {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 9999;
  display: none;
}

/* ── FOUL SHAKE ──────────────────────────────────────────────── */
@keyframes foul-shake {
  0%   { transform: translate(0,0) rotate(0deg); }
  10%  { transform: translate(-6px,-3px) rotate(-0.5deg); }
  20%  { transform: translate(6px,3px) rotate(0.5deg); }
  30%  { transform: translate(-5px,2px) rotate(-0.3deg); }
  40%  { transform: translate(5px,-2px) rotate(0.3deg); }
  50%  { transform: translate(-3px,3px) rotate(-0.2deg); }
  60%  { transform: translate(3px,-1px) rotate(0.2deg); }
  70%  { transform: translate(-2px,2px) rotate(0deg); }
  85%  { transform: translate(2px,-1px); }
  100% { transform: translate(0,0); }
}

body.foul-shake { animation: foul-shake 0.55s ease-out; }

/* ── HR BANNER ───────────────────────────────────────────────── */
#hr-banner {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0) rotate(-4deg);
  background-color: var(--amber);
  background-image: repeating-linear-gradient(
    45deg,
    transparent, transparent 14px,
    rgba(255,255,255,0.15) 14px, rgba(255,255,255,0.15) 28px
  );
  border: 6px solid var(--border);
  padding: 28px 56px;
  text-align: center;
  z-index: 9998;
  pointer-events: none;
  /* Stacked shadow — comic panel effect */
  box-shadow:
    8px 8px 0 var(--border),
    0 0 0 8px var(--red),
    14px 14px 0 var(--border);
  transition: transform .35s cubic-bezier(.175,.885,.32,1.275), opacity .35s;
  opacity: 0;
}

#hr-banner.show {
  transform: translate(-50%, -50%) scale(1) rotate(-2deg);
  opacity: 1;
}

#hr-banner .hr-emoji  { font-size: 56px; line-height: 1; margin-bottom: 6px; }

#hr-banner .hr-title {
  font-family: 'Bangers', cursive;
  font-size: 72px;
  letter-spacing: 6px;
  color: var(--red);
  line-height: 1;
  text-shadow: 4px 4px 0 var(--border), -1px -1px 0 var(--border);
}

#hr-banner .hr-sub {
  font-family: 'Bangers', cursive;
  font-size: 24px;
  color: var(--border);
  letter-spacing: 3px;
  margin-top: 6px;
}

/* ── FOUL FLASH ──────────────────────────────────────────────── */
#foul-flash {
  position: fixed;
  inset: 0;
  background: rgba(17,85,170,0.12);
  pointer-events: none;
  z-index: 9990;
  opacity: 0;
  transition: opacity .05s;
}

#foul-flash.show { opacity: 1; }

/* ── SIDE PANEL ──────────────────────────────────────────────── */
.side-panel {
  border-left: 3px solid var(--border);
  background: var(--bg2);
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  display: none;
}

.side-panel::-webkit-scrollbar { width: 6px; }
.side-panel::-webkit-scrollbar-thumb { background: var(--border2); }

#tab-scores .side-panel { display: flex; }

/* ── CHIPS ───────────────────────────────────────────────────── */
.chips {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  padding: 10px 12px;
  border-bottom: 2px solid var(--border);
  background: var(--bg3);
}

.chip {
  font-family: 'Bangers', cursive;
  font-size: 17px;
  letter-spacing: 1px;
  color: var(--border);
  background: var(--panel);
  border: 2px solid var(--border);
  border-radius: 0;
  padding: 3px 10px;
  cursor: pointer;
  transition: all .1s;
  box-shadow: 2px 2px 0 var(--border);
}

.chip:hover {
  background: var(--amber);
  transform: translate(-1px, -1px);
  box-shadow: 3px 3px 0 var(--border);
}

.chip.active {
  background: var(--amber);
  box-shadow: 3px 3px 0 var(--border);
  transform: translate(-1px, -1px);
}

.leaders-section { padding: 12px 14px; }

.leaders-title {
  font-family: 'Bangers', cursive;
  font-size: 18px;
  letter-spacing: 2px;
  color: var(--border);
  margin-bottom: 10px;
}

.leader-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 5px 0;
  border-bottom: 1px solid var(--border2);
}

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

.leader-rank {
  font-family: 'Bangers', cursive;
  font-size: 18px;
  color: var(--text-dim);
  width: 22px;
}

.leader-name {
  flex: 1;
  font-size: 12px;
  color: var(--text-bright);
  padding: 0 8px;
  font-weight: 600;
}

.leader-team {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 10px;
  color: var(--text-dim);
  width: 32px;
}

.leader-value {
  font-family: 'Bangers', cursive;
  font-size: 22px;
  color: var(--red);
  min-width: 44px;
  text-align: right;
}

/* ── SCHEDULE ────────────────────────────────────────────────── */
.schedule-controls {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 20px;
  padding-bottom: 14px;
  border-bottom: 3px solid var(--border);
}

.schedule-range-label {
  font-family: 'Bangers', cursive;
  font-size: 30px;
  letter-spacing: 3px;
  color: var(--red);
  flex: 1;
}

.schedule-day-group { margin-bottom: 28px; }

.schedule-day-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 10px;
}

.schedule-day-label {
  font-family: 'Bangers', cursive;
  font-size: 24px;
  letter-spacing: 2px;
  color: var(--text-bright);
}

.schedule-day-label.today-label { color: var(--red); }

.schedule-day-count {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 10px;
  color: var(--text-dim);
  letter-spacing: 1px;
}

.schedule-day-line {
  flex: 1;
  height: 3px;
  background: var(--border);
}

.schedule-games-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 14px;
}

.schedule-game-card {
  background: var(--panel);
  border: 3px solid var(--border);
  padding: 14px;
  transition: transform .1s, box-shadow .1s;
  position: relative;
  overflow: hidden;
  box-shadow: 4px 4px 0 var(--border);
}

.schedule-game-card:hover {
  transform: translate(-2px, -2px);
  box-shadow: 6px 6px 0 var(--border);
}

.schedule-game-card.today-game {
  border-color: var(--red);
  box-shadow: 4px 4px 0 var(--red);
}

.schedule-game-card.today-game::before {
  content: 'TODAY';
  position: absolute;
  top: 0; right: 0;
  background: var(--red);
  color: #FFFFFF;
  font-family: 'Bangers', cursive;
  font-size: 14px;
  letter-spacing: 2px;
  padding: 3px 10px;
}

.sched-time {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 11px;
  color: var(--blue);
  letter-spacing: 1px;
  margin-bottom: 10px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-weight: 700;
}

.sched-venue {
  font-size: 10px;
  color: var(--text-dim);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 160px;
}

.sched-matchup {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 12px;
}

.sched-team {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  flex: 1;
}

.sched-team-abbr {
  font-family: 'Bangers', cursive;
  font-size: 32px;
  color: var(--text-bright);
  letter-spacing: 1px;
  line-height: 1;
}

.sched-team-record {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 10px;
  color: var(--text-dim);
}

.sched-at {
  font-family: 'Bangers', cursive;
  font-size: 20px;
  color: var(--text-dim);
  flex-shrink: 0;
}

.sched-pitchers {
  border-top: 2px solid var(--border);
  padding-top: 10px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
}

.sched-pitcher { display: flex; flex-direction: column; gap: 2px; }

.sched-pitcher-role {
  font-family: 'Bangers', cursive;
  font-size: 14px;
  color: var(--text-dim);
  letter-spacing: 1px;
}

.sched-pitcher-name {
  font-size: 12px;
  color: var(--text);
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sched-pitcher-stats {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 10px;
  color: var(--text-dim);
}

.sched-tbd {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 10px;
  color: var(--text-dim);
  font-style: italic;
}

.sched-series-badge {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 9px;
  letter-spacing: 1px;
  color: var(--text-bright);
  background: var(--bg2);
  border: 1px solid var(--border2);
  padding: 2px 6px;
  white-space: nowrap;
}

/* ── RESPONSIVE ──────────────────────────────────────────────── */
@media (max-width: 900px) {
  .main { grid-template-columns: 1fr; }
  #tab-scores { flex-direction: column; }
  .games-list { width: 100%; max-height: 260px; border-right: none; border-bottom: 3px solid var(--border); }
  .side-panel { display: none !important; }
  .at-bat-wrap { grid-template-columns: 1fr; }
}
