/* ==========================================================
   morning box scores — newspaper stylesheet
   classic newsprint: dense serif type, gray stock, thin rules

   typography system (tokens below in :root):

   size roles (apply via --fs-*):
     --fs-micro    8px  — kicker labels, pill tags, clinch markers
     --fs-meta    10px  — chrome / secondary info / table numbers in minor tables
     --fs-body    11px  — primary reading size (player names, primary table cells)
     --fs-btn     13px  — interactive buttons
     --fs-head    15px  — panel titles (league name, leaders panel, hero info)
     --fs-title   21px  — top-level section headers
     --fs-display 53px  — masthead title

   weight roles:
     --fw-body   400 — default body copy
     --fw-mid    600 — mono numbers on textured bg (contrast boost)
     --fw-bold   700 — labels, names, headers

   font family roles:
     --serif — reading text, player names, titles
     --sans  — uppercase kicker labels, chrome, nav
     --mono  — numeric tables, linescore, stat values

   italic policy — italic is used ONLY for:
     1. masthead date line (newspaper convention)
     2. leader slash-line support text (.leader-support)
     3. substitute batter rows in the batting table (.sub-row)
   nothing else gets italic.
   ========================================================== */

/* ---------- reset ---------- */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

:root {
  /* pale neutral newsprint — uniform, cool-leaning off-white */
  --bg: #E4E3DF;
  --bg-subtle: #DCDBD7;
  --ink: #0A0A0A;
  --muted: #1F1F1D;
  --light: #3A3A37;
  --rule: #A5A4A0;
  --rule-dark: #2A2A28;

  /* shared newsprint texture — same SVG used by .newspaper bg so sticky elements match */
  --bg-noise: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.95' numOctaves='2' seed='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0  0 0 0 0 0  0 0 0 0 0  0 0 0 0.18 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");

  /* font families */
  --serif: Georgia, 'Times New Roman', Times, serif;
  --mono: 'Courier New', Courier, monospace;
  --sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;

  /* type scale */
  --fs-micro: 8px;
  --fs-meta: 10px;
  --fs-body: 11px;
  --fs-btn: 13px;
  --fs-head: 15px;
  --fs-title: 21px;
  --fs-display: 53px;

  /* weight scale */
  --fw-body: 400;
  --fw-mid: 600;
  --fw-bold: 700;

  /* panel widths — drive all grid/column layouts so sizing is one place */
  --panel-box: 380px;
  --panel-leaders: 292px;
  --panel-standings: 360px;
  --panel-schedule: 300px;
}

html {
  /* neutral gutter gray outside the paper */
  background: #BEBDB9;
}

body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--serif);
  font-size: var(--fs-body);
  font-weight: var(--fw-body);
  line-height: 1.3;
  -webkit-font-smoothing: antialiased;
}

/* ---------- main container ---------- */
.newspaper {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 24px 48px;
  min-height: 100vh;
  position: relative;
  /* uniform pale newsprint — single layer of very fine neutral grain */
  background-color: var(--bg);
  background-image: var(--bg-noise);
  background-size: 200px 200px;
  background-blend-mode: multiply;
  /* crisp edge shadow only — no vignette */
  box-shadow:
    -1px 0 4px rgba(0,0,0,0.08),
    1px 0 4px rgba(0,0,0,0.08);
}

/* ---------- loading ---------- */
.loading {
  text-align: center;
  padding: 80px 20px;
  font-size: var(--fs-head);
  color: var(--muted);
}

/* ---------- masthead ---------- */
.masthead {
  text-align: center;
  padding: 20px 0 14px;
  border-top: 6px solid var(--ink);
  border-bottom: 2px solid var(--ink);
  margin-bottom: 16px;
  position: relative;
}

/* logo pinned to the upper right corner — sits between the top rules.
   wrapped in an anchor that links back to the publisher site. */
.masthead-logo-link {
  position: absolute;
  top: 14px;
  right: 12px;
  display: block;
  line-height: 0;
}

.masthead-logo {
  width: 88px;
  height: 88px;
  display: block;
}

.masthead::before {
  content: '';
  position: absolute;
  top: 8px;
  left: 0;
  right: 0;
  border-top: 1px solid var(--ink);
}

.masthead::after {
  content: '';
  position: absolute;
  bottom: 4px;
  left: 0;
  right: 0;
  border-top: 1px solid var(--rule);
}

.masthead-site {
  font-family: var(--sans);
  font-size: var(--fs-micro);
  font-weight: var(--fw-bold);
  letter-spacing: 3px;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 4px;
}

.masthead-title {
  font-family: var(--serif);
  font-size: var(--fs-display);
  font-weight: var(--fw-bold);
  letter-spacing: 1px;
  text-transform: uppercase;
  line-height: 1;
  margin-bottom: 4px;
}

.masthead-tagline {
  font-family: var(--serif);
  font-size: 20px;
  font-style: italic;
  color: var(--ink);
  margin: 2px 0 8px;
}

.masthead-phase {
  font-family: var(--sans);
  font-size: var(--fs-meta);
  font-weight: var(--fw-bold);
  text-transform: uppercase;
  letter-spacing: 2px;
  color: var(--muted);
  margin-bottom: 2px;
}

.masthead-date {
  font-size: var(--fs-head);
  font-style: italic; /* keep — newspaper dateline convention */
  color: var(--muted);
}

.masthead-date sup { font-size: var(--fs-meta); }

/* ---------- date navigation ---------- */
.date-nav {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  margin-top: 8px;
}

.date-nav button {
  background: none;
  border: 1px solid var(--rule);
  font-family: var(--serif);
  font-size: var(--fs-body);
  font-weight: var(--fw-body);
  padding: 3px 12px;
  cursor: pointer;
  color: var(--ink);
  transition: background 0.15s, color 0.15s;
}

.date-nav button:hover {
  background: var(--ink);
  color: var(--bg);
}

.date-nav button:disabled {
  opacity: 0.25;
  cursor: default;
  background: none;
  color: var(--ink);
}

/* ---------- section headers ---------- */
.section-header {
  font-family: var(--serif);
  font-size: var(--fs-title);
  font-weight: var(--fw-bold);
  text-transform: uppercase;
  letter-spacing: 1px;
  border-bottom: 3px solid var(--ink);
  padding-bottom: 3px;
  margin-bottom: 4px;
}

/* inline italic timestamp that sits on the SAME line as the section title,
   right after it, with a small gap and reset of the header's chrome styling */
.section-asof {
  font-family: var(--serif);
  font-size: var(--fs-meta);
  font-style: italic;
  font-weight: normal;
  text-transform: none;
  letter-spacing: normal;
  color: var(--muted);
  margin-left: 14px;
}

.section-rule {
  border: none;
  border-top: 3px solid var(--ink);
  margin: 24px 0 16px;
}

/* ---------- no games ---------- */
.no-games {
  text-align: center;
  padding: 30px;
  font-size: var(--fs-head);
  color: var(--muted);
}

/* ==========================================================
   box scores — grid of fixed-width cards that just reflow
   ========================================================== */
.boxscores-columns {
  display: grid;
  grid-template-columns: repeat(auto-fill, var(--panel-box));
  justify-content: start;
  gap: 18px 28px;
  /* stretch so every card in a row shares the same height — this keeps all
     sticky title bars in that row aligned, and they un-stick together when the
     tallest card finishes (instead of each title dropping at its own moment) */
  align-items: stretch;
}

.boxscore {
  padding-bottom: 14px;
  border-bottom: 1px solid var(--rule);
  /* lock intrinsic width to the grid track; overflow must stay visible so the
     sticky title inside this card isn't clipped by a scroll container */
  min-width: 0;
}

.boxscore-title {
  font-family: var(--serif);
  font-size: var(--fs-head);
  font-weight: var(--fw-bold);
  line-height: 1.2;
  margin-bottom: 2px;
  /* pin the score line to the viewport top as the user scrolls this card's tables.
     only box-score titles get this — standings/leaders/schedule section headers
     don't use this class, so those scroll normally. */
  position: sticky;
  top: 0;
  z-index: 2;
  /* match the page's textured newsprint so the sticky title blends with the bg */
  background-color: var(--bg);
  background-image: var(--bg-noise);
  background-size: 200px 200px;
  background-blend-mode: multiply;
  padding: 3px 0 2px;
  border-bottom: 1px solid var(--rule);
}

/* pulsing green dot shown next to the title of in-progress games —
   signals the box is live-updating. glows via a halo shadow that pulses 1.6s. */
.live-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  margin-right: 6px;
  vertical-align: 1px;
  border-radius: 50%;
  background: #3FA864;
  box-shadow: 0 0 0 0 rgba(63, 168, 100, 0.6);
  animation: live-pulse 1.6s ease-out infinite;
}

@keyframes live-pulse {
  0%   { box-shadow: 0 0 0 0   rgba(63, 168, 100, 0.55); }
  70%  { box-shadow: 0 0 0 8px rgba(63, 168, 100, 0);   }
  100% { box-shadow: 0 0 0 0   rgba(63, 168, 100, 0);   }
}

/* respect users who've turned motion off in the OS — hold a soft glow instead */
@media (prefers-reduced-motion: reduce) {
  .live-dot {
    animation: none;
    box-shadow: 0 0 0 3px rgba(63, 168, 100, 0.25);
  }
}

/* ---------- live scoreboard (Fenway green-monster aesthetic) ---------- */
.live-scoreboard { margin-bottom: 16px; }

.scoreboard-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, 200px);
  justify-content: start;
  gap: 12px;
}

/* each card styled like an old hand-painted scoreboard panel */
.scorebug-card {
  /* deep scoreboard green */
  background: #0F3A22;
  color: #F1E6C3;
  font-family: 'Courier New', Courier, monospace;
  padding: 8px 10px;
  border: 2px solid #0B2919;
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.06),
    0 1px 0 rgba(0, 0, 0, 0.3);
  border-radius: 1px;
  position: relative;
}

/* subtle brushed-metal noise overlay so it doesn't look too flat */
.scorebug-card::after {
  content: '';
  position: absolute;
  inset: 0;
  background-image: var(--bg-noise);
  background-size: 160px 160px;
  mix-blend-mode: overlay;
  opacity: 0.25;
  pointer-events: none;
}

/* finished games fade back so the eye is drawn to the live cards first */
.scorebug-card-final {
  opacity: 0.7;
  filter: saturate(0.7);
}

/* compact card for completed games — divider sits above the mini linescore */
.scorebug-card-final .scorebug-rows {
  border-bottom: 1px solid rgba(241, 230, 195, 0.25);
  padding-bottom: 6px;
}

/* mini inning-by-inning linescore on final scorebug cards */
.sb-linescore {
  width: 100%;
  margin-top: 6px;
  border-collapse: collapse;
  font-family: 'Courier New', Courier, monospace;
  font-size: 10px;
  color: #D4C797;
  text-align: center;
}

.sb-linescore th {
  font-weight: normal;
  font-size: 8px;
  color: rgba(212, 199, 151, 0.6);
  padding: 0 1px 2px;
  border-bottom: 1px solid rgba(241, 230, 195, 0.15);
}

.sb-linescore td {
  padding: 1px;
  color: #F1E6C3;
}

/* small "FINAL" tag sits centered at the bottom of completed cards so it
   doesn't collide with the score in the top-right */
.sb-final-badge {
  margin-top: 8px;
  text-align: center;
  font-family: var(--sans);
  font-size: 9px;
  font-weight: bold;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: #D4C797;
}

.scorebug-state-final {
  font-family: var(--sans);
  font-size: 9px;
  color: #D4C797;
  letter-spacing: 1px;
  padding-top: 6px;
}

.scorebug-rows {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding-bottom: 6px;
  border-bottom: 1px solid rgba(241, 230, 195, 0.25);
}

.scorebug-team {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  font-size: 16px;
  font-weight: bold;
  letter-spacing: 1px;
}

.sb-team-abbr { color: #F1E6C3; }

.sb-team-runs {
  font-size: 20px;
  color: #FFFFFF;
  min-width: 24px;
  text-align: right;
}

.scorebug-state {
  display: flex;
  justify-content: space-between;
  gap: 6px;
  font-size: 10px;
  letter-spacing: 1px;
  padding-top: 6px;
  color: #D4C797;
  flex-wrap: wrap;
}

.sb-inning,
.sb-count,
.sb-outs { white-space: nowrap; }

/* miniature baseball diamond — 3 tilted squares for 1B, 2B, 3B */
.sb-diamond {
  position: relative;
  display: inline-block;
  width: 26px;
  height: 20px;
  flex: 0 0 26px;
}

.sb-base {
  position: absolute;
  width: 7px;
  height: 7px;
  border: 1px solid #F1E6C3;
  background: transparent;
  transform: rotate(45deg);
  transition: background 0.2s ease;
}

.sb-base.on { background: #F1E6C3; }

.sb-base-2 { top: 0;   left: 9px; }   /* 2nd base — top */
.sb-base-3 { top: 8px; left: 0;  }    /* 3rd base — left */
.sb-base-1 { top: 8px; right: 0; left: auto; }  /* 1st base — right */

.scorebug-matchup {
  margin-top: 6px;
  padding-top: 6px;
  border-top: 1px solid rgba(241, 230, 195, 0.25);
  font-family: var(--serif);
  font-size: 10px;
  color: #D4C797;
  line-height: 1.4;
}

.sb-mini-label {
  font-family: var(--sans);
  font-weight: bold;
  font-size: 8px;
  letter-spacing: 0.5px;
  color: #8FAB86;
  margin-right: 3px;
}

.game-type-label {
  font-family: var(--sans);
  font-size: var(--fs-micro);
  font-weight: var(--fw-bold);
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--muted);
  margin-bottom: 2px;
}

.hero-info {
  font-family: var(--serif);
  font-size: var(--fs-meta);
  color: var(--muted);
  line-height: 1.4;
  margin-bottom: 2px;
}

.series-line {
  font-family: var(--serif);
  font-size: var(--fs-meta);
  color: var(--muted);
  margin-bottom: 4px;
}


/* ---------- top performers ---------- */
.top-performers {
  font-family: var(--serif);
  font-size: var(--fs-meta);
  line-height: 1.4;
  margin-bottom: 6px;
  padding: 3px 0;
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
}

.tp-label {
  font-family: var(--sans);
  font-size: var(--fs-micro);
  font-weight: var(--fw-bold);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--muted);
  margin-bottom: 2px;
}

.tp-entry {
  font-family: var(--serif);
  font-size: var(--fs-meta);
  line-height: 1.35;
}

.tp-name { font-weight: var(--fw-bold); }

.tp-team {
  font-family: var(--sans);
  font-size: var(--fs-micro);
  font-weight: var(--fw-bold);
  text-transform: uppercase;
  letter-spacing: 0.4px;
  color: var(--muted);
  margin: 0 2px 0 1px;
}

.tp-summary { color: var(--ink); }

/* ---------- stat tables (batting / pitching) ---------- */
.stat-table {
  /* shrink-to-content so stats hug the name column — no dead gap between them
     (especially visible on the pitching table which has only a few stat cols) */
  width: auto;
  border-collapse: collapse;
  margin-bottom: 4px;
  table-layout: auto;
}

/* cap + ellipsis the name column so it doesn't stretch absurdly wide */
.stat-table td.name-cell,
.stat-table th.name-col {
  max-width: 170px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.stat-table th {
  font-family: var(--sans);
  font-size: var(--fs-micro);
  font-weight: var(--fw-bold);
  text-transform: uppercase;
  letter-spacing: 0.4px;
  text-align: right;
  padding: 1px 2px;
  border-bottom: 1px solid var(--rule-dark);
  white-space: nowrap;
  color: var(--muted);
}

.stat-table th.name-col {
  font-family: var(--serif);
  font-size: var(--fs-body);
  font-weight: var(--fw-bold);
  text-transform: none;
  letter-spacing: normal;
  text-align: left;
  color: var(--ink);
  width: auto;
}

.stat-table td {
  font-family: var(--mono);
  font-size: var(--fs-meta);
  font-weight: var(--fw-mid);
  text-align: right;
  padding: 0px 2px;
  line-height: 1.5;
  white-space: nowrap;
  overflow: hidden;
  color: var(--ink);
}

.stat-table td.name-cell {
  font-family: var(--serif);
  font-size: var(--fs-body);
  font-weight: var(--fw-body);
  text-align: left;
  text-overflow: ellipsis;
}

/* fixed numeric column widths */
.stat-table .col-pos  { width: 34px; text-align: center; }
.stat-table .col-hab  { width: 32px; }
.stat-table .col-stat { width: 22px; }
.stat-table .col-avg  { width: 34px; }
.stat-table .col-ip   { width: 28px; }
.stat-table .col-era  { width: 34px; }

/* position text centered, muted, sans */
.stat-table td.col-pos {
  font-family: var(--sans);
  font-size: var(--fs-micro);
  font-weight: var(--fw-bold);
  text-align: center;
  color: var(--muted);
}

/* substitute batter — indent + italic (one of 3 italic uses in the system) */
.stat-table tr.sub-row td.name-cell {
  padding-left: 8px;
  font-style: italic;
}

/* ==========================================================
   linescore — bold mono grid, the punctuation of each box
   ========================================================== */
.linescore {
  margin: 6px 0;
  border-top: 1px solid var(--rule-dark);
  border-bottom: 1px solid var(--rule-dark);
  padding: 2px 0;
}

.linescore table {
  border-collapse: collapse;
  width: auto;
}

.linescore th,
.linescore td {
  font-family: var(--mono);
  font-size: var(--fs-body);
  text-align: center;
  padding: 0 4px;
  line-height: 1.6;
  white-space: nowrap;
  color: var(--ink);
}

.linescore th {
  font-size: var(--fs-meta);
  font-weight: var(--fw-bold);
  border-bottom: 1px solid var(--rule);
}

.linescore td {
  font-weight: var(--fw-bold);
}

.linescore .ls-team-cell {
  text-align: left;
  padding-right: 6px;
  min-width: 28px;
}

.linescore .ls-sep-col {
  width: 6px;
  border-left: 1px solid var(--rule);
}

/* R/H/E totals already bold via td rule; kept for clarity */
.linescore .ls-total { font-weight: var(--fw-bold); }

/* ---------- game notes ---------- */
.game-notes {
  font-family: var(--serif);
  font-size: var(--fs-meta);
  line-height: 1.4;
  margin-bottom: 4px;
}

.game-notes p { margin-bottom: 0; }

.note-label {
  font-family: var(--sans);
  font-size: var(--fs-micro);
  font-weight: var(--fw-bold);
  text-transform: uppercase;
  letter-spacing: 0.4px;
  color: var(--muted);
}

/* ---------- substitution notes ---------- */
.sub-notes {
  font-family: var(--serif);
  font-size: var(--fs-meta);
  color: var(--muted);
  line-height: 1.35;
  margin-bottom: 4px;
}

/* ---------- game info (umpires + ABS) ---------- */
.game-info {
  font-family: var(--serif);
  font-size: var(--fs-meta);
  color: var(--ink);
  line-height: 1.5;
  margin-top: 4px;
  border-top: 1px solid var(--rule);
  padding-top: 2px;
}

/* umpire crew header — shared label style */
.umpires-header {
  font-family: var(--sans);
  font-size: var(--fs-micro);
  font-weight: var(--fw-bold);
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--muted);
  margin-bottom: 2px;
}

.umpires-table {
  border-collapse: collapse;
  margin-bottom: 2px;
}

.umpires-table .ump-pos {
  font-family: var(--sans);
  font-size: var(--fs-micro);
  font-weight: var(--fw-bold);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--muted);
  padding: 0 8px 0 0;
  width: 24px;
  /* top-align so the position label sits next to the first line of the name cell,
     which may have per-challenge lines below it on the HP row */
  vertical-align: top;
  /* match the serif line height so both first-lines sit at the same y */
  line-height: calc(var(--fs-body) * 1.4);
}

.umpires-table .ump-name {
  font-family: var(--serif);
  font-size: var(--fs-body);
  font-weight: var(--fw-body);
  color: var(--ink);
  padding: 0;
  vertical-align: top;
  line-height: calc(var(--fs-body) * 1.4);
}

/* per-challenge ABS lines — one indented row per challenge under HP */
.umpires-table .abs-challenges {
  margin: 2px 0 2px 8px;
  padding-left: 8px;
  border-left: 1px solid var(--rule);
}

.umpires-table .abs-line {
  font-family: var(--serif);
  font-size: var(--fs-meta);
  color: var(--ink);
  line-height: 1.55;
  white-space: nowrap;
}

.umpires-table .abs-player {
  font-weight: var(--fw-bold);
}

/* team abbrev chip sits right after the challenger name */
.umpires-table .abs-team {
  font-family: var(--sans);
  font-size: var(--fs-micro);
  font-weight: var(--fw-bold);
  text-transform: uppercase;
  letter-spacing: 0.4px;
  color: var(--muted);
  margin-left: 2px;
}

.umpires-table .abs-sep {
  color: var(--muted);
  margin: 0 2px;
}

/* inline manager-challenge description — indented second line under the review tag */
.umpires-table .abs-mgr-desc {
  color: var(--muted);
  white-space: normal;
  padding-left: 0;
}

/* pill tag used by ABS challenges AND manager challenges — shared style */
.abs-tag {
  font-family: var(--sans);
  font-size: var(--fs-micro);
  font-weight: var(--fw-bold);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 0 4px;
  margin-left: 4px;
  border: 1px solid var(--rule);
  border-radius: 2px;
  color: var(--muted);
  white-space: nowrap;
}

/* all outcome tags share the default .abs-tag muted style — no color coding */
.abs-pitcher,
.abs-batter,
.abs-stand { color: var(--muted); }

/* overturned calls get a muted green highlight so the reader can spot them fast */
.abs-tag.abs-overturned {
  color: #2F5A3D;
  border-color: #A3C6B0;
}

/* ---------- manager challenges (on-field replay reviews) ---------- */
.mgr-challenges {
  margin-top: 6px;
  padding-top: 4px;
  border-top: 1px solid var(--rule);
}

.mgr-header {
  font-family: var(--sans);
  font-size: var(--fs-micro);
  font-weight: var(--fw-bold);
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--muted);
  margin-bottom: 3px;
}

.mgr-line {
  font-family: var(--serif);
  font-size: var(--fs-meta);
  color: var(--ink);
  line-height: 1.45;
  margin-bottom: 3px;
}

.mgr-team {
  font-family: var(--sans);
  font-size: var(--fs-micro);
  font-weight: var(--fw-bold);
  text-transform: uppercase;
  letter-spacing: 0.4px;
  color: var(--muted);
}

.mgr-cat {
  font-weight: var(--fw-bold);
  text-transform: capitalize;
}

/* reuse .abs-tag styling for the outcome pills — applied via shared class in JS */
.mgr-line .abs-tag { margin-left: 4px; }

.mgr-desc-line {
  color: var(--muted);
  padding-left: 8px;
  border-left: 1px solid var(--rule);
  margin-top: 1px;
}

/* ==========================================================
   standings — grid of fixed-width panels (one per division)
   ========================================================== */
.standings-section { margin-bottom: 16px; }

.standings-columns {
  display: grid;
  grid-template-columns: repeat(auto-fill, var(--panel-standings));
  justify-content: start;
  gap: 14px 28px;
  align-items: start;
}

.standings-league {
  margin-bottom: 0;
  min-width: 0;
}

.league-name {
  font-family: var(--serif);
  font-size: var(--fs-head);
  font-weight: var(--fw-bold);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-bottom: 2px solid var(--ink);
  margin-bottom: 3px;
  padding-bottom: 2px;
}

.division-block {
  margin-bottom: 0;
}

.division-name {
  font-family: var(--sans);
  font-size: var(--fs-meta);
  font-weight: var(--fw-bold);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--muted);
  margin-bottom: 1px;
  margin-top: 8px;
}

.division-block:first-of-type .division-name { margin-top: 2px; }

.standings-table {
  border-collapse: collapse;
  table-layout: fixed;
  width: auto;
}

.standings-table th:first-child,
.standings-table td:first-child { width: 92px; }

.standings-table th {
  font-family: var(--sans);
  font-size: var(--fs-micro);
  font-weight: var(--fw-bold);
  text-transform: uppercase;
  letter-spacing: 0.4px;
  text-align: right;
  padding: 1px 3px;
  border-bottom: 1px solid var(--rule-dark);
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
}

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

.standings-table td {
  font-family: var(--mono);
  font-size: var(--fs-meta);
  font-weight: var(--fw-mid);
  text-align: right;
  padding: 0 3px;
  /* fixed row height so single-digit and double-digit rows share identical
     vertical rhythm across divisions — prevents subtle row-by-row drift */
  line-height: 13px;
  vertical-align: baseline;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--ink);
}

.standings-table td:first-child {
  font-family: var(--serif);
  font-size: var(--fs-body);
  font-weight: var(--fw-body);
  text-align: left;
  /* match the baseline so the serif team name sits in the same vertical grid
     as the mono numeric cells to its right */
  line-height: 13px;
  vertical-align: baseline;
}

/* fixed numeric column widths */
.standings-table th:nth-child(2), .standings-table td:nth-child(2) { width: 26px; } /* W */
.standings-table th:nth-child(3), .standings-table td:nth-child(3) { width: 26px; } /* L */
.standings-table th:nth-child(4), .standings-table td:nth-child(4) { width: 38px; } /* PCT */
.standings-table th:nth-child(5), .standings-table td:nth-child(5) { width: 32px; } /* GB */
.standings-table th:nth-child(6), .standings-table td:nth-child(6) { width: 30px; } /* L10 */
.standings-table th:nth-child(7), .standings-table td:nth-child(7) { width: 32px; } /* STR */

.clinch {
  font-family: var(--sans);
  font-size: var(--fs-micro);
  font-weight: var(--fw-bold);
  vertical-align: super;
  color: var(--muted);
}

/* ==========================================================
   league leaders — grid of fixed-width category panels
   ========================================================== */
.leaders-section { margin-bottom: 16px; }

.leaders-panel { margin-bottom: 14px; }

.leaders-panel-title {
  font-family: var(--serif);
  font-size: var(--fs-head);
  font-weight: var(--fw-bold);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-bottom: 2px solid var(--ink);
  padding-bottom: 2px;
  margin-bottom: 6px;
}

.leaders-columns {
  display: grid;
  grid-template-columns: repeat(auto-fill, var(--panel-leaders));
  justify-content: start;
  gap: 8px 28px;
  align-items: start;
}

.leader-category {
  margin-bottom: 8px;
  min-width: 0;
  overflow: hidden;
}

.category-name {
  font-family: var(--serif);
  font-size: var(--fs-body);
  font-weight: var(--fw-bold);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-bottom: 1px solid var(--rule-dark);
  margin-bottom: 2px;
  padding-bottom: 1px;
}

/* simple 3-col leaders table — team | player (rank + name) | stat
   fills the panel width so team col and stat col align across every category
   within a panel (all tables share the same parent width). */
.leaders-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
}

.leaders-table th {
  font-family: var(--sans);
  font-size: var(--fs-micro);
  font-weight: var(--fw-bold);
  text-transform: uppercase;
  letter-spacing: 0.4px;
  color: var(--muted);
  padding: 0 2px 1px;
  border-bottom: 1px solid var(--rule-dark);
  white-space: nowrap;
  text-align: right;
}

.leaders-table th.leader-name { text-align: left; }

.leaders-table td {
  font-family: var(--serif);
  font-size: var(--fs-body);
  padding: 0 2px;
  line-height: 1.2;
  white-space: nowrap;
  color: var(--ink);
}

.leaders-table .leader-rank {
  font-family: var(--mono);
  font-size: var(--fs-meta);
  font-weight: var(--fw-mid);
  color: var(--muted);
  /* leftmost column — wide enough to fit "T-10." (summary rows) with room after */
  width: 38px;
  text-align: right;
  padding: 0 6px 0 0;
  white-space: nowrap;
}

.leaders-table .leader-name {
  text-align: left;
  /* name col absorbs remaining panel width via fixed table-layout (no explicit
     width needed). content that overflows the row ellipsizes. */
  overflow: hidden;
  text-overflow: ellipsis;
}

.leaders-table .leader-support {
  font-family: var(--serif);
  font-size: var(--fs-meta);
  font-weight: var(--fw-body);
  font-style: italic;
  color: var(--muted);
}

.leaders-table .leader-team {
  font-family: var(--sans);
  font-size: var(--fs-micro);
  font-weight: var(--fw-bold);
  text-transform: uppercase;
  letter-spacing: 0.4px;
  color: var(--muted);
  white-space: nowrap;
  width: 42px;
  /* right-align so team content hugs its own right edge; stat is left-aligned
     next to it so the gap between team and stat is constant across every row */
  text-align: right;
  padding: 0 0 0 4px;
}

.leaders-table .leader-stat {
  font-family: var(--mono);
  font-size: var(--fs-meta);
  font-weight: var(--fw-bold);
  /* center the stat value directly under its column header */
  text-align: center;
  /* fit 5-char values like 1.234 (OPS) and 117.5 (exit velo) */
  width: 48px;
  padding: 0 2px;
  color: var(--ink);
}

.leaders-table th.leader-stat {
  text-align: center;
}

/* secondary stat column (e.g. "5/7" for ABS) — muted, clear gap from team col */
.leaders-table .leader-stat-2nd {
  width: 62px;
  color: var(--muted);
  font-weight: var(--fw-mid);
  padding: 0 6px 0 14px;
}

/* blank spacer column between secondary + primary stat — visually separates them */
.leaders-table .leader-stat-gap {
  width: 14px;
  padding: 0;
}

/* position column (P / C badge in the ABS defense board) — sits between name
   and team, right-aligned with small padding so it reads as a prefix to team */
.leaders-table .leader-pos {
  font-family: var(--sans);
  font-size: var(--fs-micro);
  font-weight: var(--fw-bold);
  text-transform: uppercase;
  letter-spacing: 0.4px;
  color: var(--muted);
  width: 22px;
  text-align: right;
  padding: 0 6px 0 2px;
}

/* small eligibility note under the category title — tells reader the qualifier */
.leader-eligibility {
  font-family: var(--serif);
  font-size: var(--fs-micro);
  font-style: italic;
  color: var(--muted);
  margin: -1px 0 2px;
}

/* summary row shown when the 10th position is tied — "T-10. (N players tied)" */
.leaders-table .leader-summary-row .leader-name {
  font-style: italic;
  color: var(--muted);
}

/* ==========================================================
   today's schedule — grid of fixed-width game blocks
   ========================================================== */
.schedule-section { margin-bottom: 16px; }

/* small note under the section header indicating the browser's timezone */
.schedule-tz-note {
  font-family: var(--sans);
  font-size: var(--fs-micro);
  font-weight: var(--fw-bold);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--muted);
  /* no negative margin — that was pulling the text under the section header's
     bottom border and clipping half of it */
  margin: 2px 0 10px;
}

.schedule-columns {
  display: grid;
  grid-template-columns: repeat(auto-fill, var(--panel-schedule));
  justify-content: start;
  gap: 8px 28px;
  align-items: start;
}

.schedule-game {
  margin-bottom: 0;
  padding-bottom: 5px;
  border-bottom: 1px dotted var(--rule);
  font-family: var(--serif);
  font-size: var(--fs-body);
  font-weight: var(--fw-body);
  line-height: 1.5;
  min-width: 0;
}

.schedule-matchup {
  font-family: var(--serif);
  font-size: var(--fs-body);
  font-weight: var(--fw-bold);
}

.schedule-detail {
  font-family: var(--serif);
  font-size: var(--fs-meta);
  color: var(--muted);
}

.schedule-pitchers {
  font-family: var(--serif);
  font-size: var(--fs-meta);
  color: var(--muted);
}

/* inline W-L, ERA next to a starter name */
.pitcher-stats {
  font-family: var(--mono);
  font-size: var(--fs-micro);
  font-weight: var(--fw-mid);
  color: var(--muted);
  margin-left: 2px;
}

.schedule-tv {
  font-family: var(--sans);
  font-size: var(--fs-micro);
  font-weight: var(--fw-bold);
  text-transform: uppercase;
  letter-spacing: 0.4px;
  color: var(--muted);
}

.schedule-records {
  font-family: var(--mono);
  font-size: var(--fs-micro);
  font-weight: var(--fw-mid);
  color: var(--muted);
}

.schedule-series {
  font-family: var(--serif);
  font-size: var(--fs-meta);
  color: var(--muted);
}

/* ---------- footer (colophon) ---------- */
.newspaper-footer {
  text-align: center;
  font-family: var(--serif);
  font-size: var(--fs-meta);
  color: var(--light);
  border-top: 2px solid var(--ink);
  padding-top: 8px;
  margin-top: 32px;
  letter-spacing: 0.5px;
  line-height: 1.6;
}

.newspaper-footer a {
  color: var(--ink);
  font-weight: var(--fw-bold);
  text-decoration: none;
  border-bottom: 1px solid var(--rule);
}

.newspaper-footer a:hover {
  border-bottom-color: var(--ink);
}

.footer-meta {
  font-size: var(--fs-micro);
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 1px;
}

/* ==========================================================
   responsive — panels don't resize, they just wrap/drop
   ========================================================== */
@media (max-width: 600px) {
  .newspaper {
    padding: 0 10px 32px;
    box-shadow: none;
  }

  .masthead-title {
    font-size: 33px;
    letter-spacing: 0;
  }

  .masthead::before,
  .masthead::after { display: none; }

  .masthead-logo { width: 56px; height: 56px; top: 10px; right: 6px; }

  /* on phones all panels collapse to full-width single column */
  .boxscores-columns,
  .leaders-columns,
  .standings-columns,
  .schedule-columns {
    grid-template-columns: 1fr;
  }

  .section-header { font-size: 17px; }

  .boxscores-columns { gap: 14px; }

  .date-nav button { padding: 6px 14px; font-size: var(--fs-btn); }

  .standings-table th:first-child,
  .standings-table td:first-child { width: 92px; }
}

/* ---------- print ---------- */
@media print {
  html, body { background: white; font-size: 9px; }

  .newspaper {
    max-width: none;
    padding: 0;
    box-shadow: none;
  }

  .date-nav { display: none; }
  .boxscores-columns { grid-template-columns: repeat(3, 1fr); }
  .section-rule { margin: 12px 0 8px; }
}
