:root {
  --bg: #131416;
  --panel: #1b1d21;
  --panel-alt: #24272c;
  --border: #353a42;
  --hair: rgba(53, 58, 66, 0.55);
  --text: #f2f1ee;
  --text-dim: #9da2ab;
  --mute: #6b717c;
  --accent: #f2f1ee;
  --accent-soft: #24272c;
  --good: #4ade80;
  --neg: #f87171;
  --good-bg: rgba(74, 222, 128, 0.16);
  --neg-bg: rgba(248, 113, 113, 0.16);
  --live: #dc2626;
  --track: #353a42;
  --radius: 8px;
  --font: "Archivo", "Helvetica Neue", Arial, sans-serif;
  /* a team's colors; each team's element sets its own (teamcolors.js) */
  --tc: #3a3f47;
  --tc-on: #f2f1ee;
  --tc-on2: #f2f1ee;
  --tc-on2s: #f2f1ee;
  --tc-ink: #f2f1ee;
  --tc-inkp: #111318;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: var(--font);
  font-size: 0.9375rem;
  line-height: 1.4;
  background: var(--bg);
  color: var(--text);
  font-variant-numeric: tabular-nums;
  -webkit-font-smoothing: antialiased;
}

button, input, select { font: inherit; }
[hidden] { display: none !important; }
a { color: inherit; }
:focus-visible { outline: 2px solid var(--text); outline-offset: 2px; }

/* ---------- Top bar ---------- */
.topbar {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  column-gap: 28px;
  align-items: center;
  padding: 0 28px;
  min-height: 64px;
  border-bottom: 1px solid var(--border);
}
.topbar h1 {
  margin: 0;
  font-size: 1.5rem;
  line-height: 1;
  font-stretch: 62%;
  font-weight: 800;
  white-space: nowrap;
}
.home-link { color: inherit; text-decoration: none; }
.topnav { display: flex; align-items: stretch; flex-wrap: wrap; gap: 0 24px; min-height: 64px; }
.topnav a {
  display: flex;
  align-items: center;
  color: var(--text-dim);
  text-decoration: none;
  font-size: 0.875rem;
  white-space: nowrap;
  border-top: 2px solid transparent;
  border-bottom: 2px solid transparent;
}
.topnav > a { min-height: 40px; }
.topnav a:hover { color: var(--text); }
.topnav a.active { color: var(--text); border-bottom-color: var(--accent); }
.topnav .nav-short { display: none; }

/* Week strip: one link per week, right-aligned so the last week sits beside the player
   search. It takes whatever room the top bar has left and scrolls sideways when short. */
.navtools {
  flex: 1 1 auto;      /* wraps to its own row, as one piece, when the first row is full */
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 0 14px;
  min-height: 44px;
}
.weeknav {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  align-items: center;
  overflow-x: auto;
  scrollbar-width: none;
}
.topnav.nav-tight .nav-full { display: none; }
.topnav.nav-tight .nav-short { display: inline; }
.weeknav::-webkit-scrollbar { display: none; }
.wk-label {
  flex: none;
  margin-left: auto;   /* pushes the weeks to the right; unlike justify-content it still scrolls */
  padding-right: 6px;
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--mute);
}
.topnav .weeknav a {
  position: relative;
  flex: none;
  justify-content: center;
  min-width: 24px;
  height: 26px;
  padding: 0 3px;
  border: 0;
  border-radius: 6px;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text);
}
.topnav .weeknav a.next { font-weight: 400; color: var(--text-dim); }
.topnav .weeknav a.now { box-shadow: inset 0 0 0 1px var(--text-dim); }
.topnav .weeknav a:hover { background: var(--panel-alt); color: var(--text); }
.topnav .weeknav a.sel { background: var(--accent); color: var(--bg); box-shadow: none; }
.wk-pre { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.navtools .psearch { flex: none; margin-left: 0; }

.league-link {
  display: inline-flex;
  align-items: center;
  height: 36px;
  padding: 0 14px;
  border: 1px solid var(--accent);
  border-radius: 6px;
  color: var(--text);
  text-decoration: none;
  font-size: 0.875rem;
  font-weight: 500;
  white-space: nowrap;
}
.league-link:hover { background: var(--panel-alt); }

main {
  max-width: 1180px;
  margin: 0 auto;
  padding: 32px 28px 56px;
}

/* ---------- Buttons and fields ---------- */
.print-btn {
  display: inline-flex;
  align-items: center;
  height: 36px;
  padding: 0 14px;
  background: transparent;
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 0.875rem;
  font-weight: 500;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
}
.print-btn:hover { background: var(--panel-alt); }
.print-btn:disabled { opacity: 0.5; cursor: default; }
a.pdf-btn[hidden] { display: none; }
.bar-actions { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.print-btn-single { height: 32px; }

.week-filters input[type="search"], .week-filters select, .picker select, .psearch input,
.prop-inputs select, .prop-inputs input {
  height: 36px;
  padding: 0 12px;
  background: var(--panel);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 0.875rem;
}
.week-filters input::placeholder, .psearch input::placeholder { color: var(--text-dim); }

/* ---------- Team block ---------- */
.slab {
  display: inline-grid;
  place-items: center;
  flex: none;
  width: 52px;
  height: 32px;
  border-radius: 5px;
  background: var(--tc);
  color: var(--tc-on2);
  font-size: 1.0625rem;
  line-height: 1;
  font-stretch: 62%;
  font-weight: 800;
  letter-spacing: 0.02em;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.18);
  -webkit-print-color-adjust: exact;
  print-color-adjust: exact;
}
.slab.long { font-size: 0.875rem; letter-spacing: 0; }
.tc { color: var(--tc-ink); }

/* ---------- AP rank tag ---------- */
.ap-rank {
  display: inline-block;
  margin-right: 5px;
  font-size: 0.68em;
  font-weight: 600;
  font-stretch: 100%;
  opacity: 0.75;
  vertical-align: 0.1em;
}

/* ---------- Week board ---------- */
.week-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 16px 24px;
  flex-wrap: wrap;
  margin-bottom: 28px;
}
.week-title { margin: 0; font-size: 4.5rem; line-height: 0.95; font-stretch: 62%; font-weight: 800; }
.week-sub { margin: 10px 0 0; color: var(--text-dim); }
.week-filters { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.week-filters input[type="search"] { width: 180px; }
.ranked-toggle { display: flex; gap: 8px; align-items: center; min-height: 36px; padding: 0 6px; font-size: 0.875rem; cursor: pointer; }
.ranked-toggle input { width: 18px; height: 18px; margin: 0; accent-color: var(--text); }
.live-note { margin: 6px 0 0; font-size: 0.8125rem; color: var(--text); }

.board-cols, .game-row {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) 22px minmax(0, 1.35fr) 124px 70px 148px minmax(0, 1.3fr);
  column-gap: 14px;
  align-items: center;
}
.board-cols { padding: 0 10px; font-size: 0.78rem; color: var(--text-dim); }
.day-label {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin: 0;
  padding: 28px 0 8px;
  font-size: 1.1875rem;
  font-stretch: 68%;
  font-weight: 700;
}
.day-count { margin-left: auto; font-size: 0.78rem; font-weight: 400; font-stretch: 100%; color: var(--text-dim); }
.game-row {
  padding: 11px 10px;
  border-top: 1px solid var(--border);
  color: var(--text);
  text-decoration: none;
}
.game-row:hover { background: var(--panel); }
.gr-team { display: flex; align-items: center; gap: 12px; min-width: 0; }
.gr-tx { min-width: 0; flex: 1; }
.gr-name { font-size: 1.25rem; line-height: 1.1; font-stretch: 68%; font-weight: 700; text-wrap: balance; }
.gr-sub { font-size: 0.78rem; color: var(--text-dim); }
.gr-score { margin-left: auto; font-size: 1.75rem; line-height: 1; font-stretch: 62%; font-weight: 800; }
.gr-team.lost .gr-score { color: var(--text-dim); }
.gr-at { text-align: center; font-size: 0.78rem; color: var(--text-dim); }
.gr-big { font-size: 1.25rem; line-height: 1.15; font-stretch: 68%; font-weight: 700; }
.gr-move { color: var(--accent); }
.game-row.done .gr-spread, .game-row.done .gr-total { color: var(--text-dim); }
/* a later week's games (week strip) are a plain list, not links */
.game-row.upcoming, .game-row.upcoming:hover { background: none; cursor: default; }
.gr-implied, .gr-where { min-width: 0; font-size: 0.875rem; }
.gr-note { color: var(--text); }
.ou-pre, .imp-pre { display: none; }
.game-sit { color: var(--text); }
.poss { margin-left: 6px; font-size: 0.6em; vertical-align: 0.2em; }
.hero-score .poss { margin-left: 8px; font-size: 0.875rem; vertical-align: middle; }
.bye-note { margin: 20px 0 0; padding-top: 14px; border-top: 1px solid var(--border); color: var(--text-dim); font-size: 0.875rem; }

/* ---------- Matchup page: scorebug ---------- */
.matchup-bar { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.back-link { color: var(--text-dim); text-decoration: none; font-size: 0.875rem; }
.back-link:hover { color: var(--text); }
.mh-week { margin-bottom: 8px; font-size: 0.875rem; color: var(--text-dim); }
.game-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 280px minmax(0, 1fr);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
.hero-team {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-areas: "side side" "name score" "rec rec";
  align-content: center;
  align-items: center;
  gap: 6px 16px;
  padding: 26px 30px;
  min-width: 0;
  background: var(--tc);
  color: var(--tc-on2);
  -webkit-print-color-adjust: exact;
  print-color-adjust: exact;
}
.hero-team[data-side="home"] {
  grid-template-columns: auto minmax(0, 1fr);
  grid-template-areas: "side side" "score name" "rec rec";
  text-align: right;
}
.hero-side { grid-area: side; font-size: 0.8125rem; font-weight: 600; color: var(--tc-on2s); }
.hero-name { grid-area: name; min-width: 0; font-size: 2.875rem; line-height: 0.95; font-stretch: 62%; font-weight: 800; text-wrap: balance; overflow-wrap: break-word; }
.hero-rec { grid-area: rec; font-size: 0.875rem; font-weight: 500; color: var(--tc-on2s); }
.hero-score { grid-area: score; font-size: 3.75rem; line-height: 0.9; font-stretch: 62%; font-weight: 800; }
.hero-score[hidden] { display: none; }
.hero-score.lost { opacity: 0.6; }
.hero-mid {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  padding: 22px 16px;
  background: var(--panel);
  text-align: center;
}
.hero-live { margin-bottom: 8px; font-size: 0.875rem; font-weight: 600; }
.hero-line { font-size: 2.75rem; line-height: 1; font-stretch: 62%; font-weight: 800; }
.hero-total { margin-top: 4px; font-size: 1.375rem; font-stretch: 68%; font-weight: 700; }
.hero-info { font-size: 0.78rem; color: var(--text-dim); }
.hero-implied { margin-top: 8px; }
.hero-move { color: var(--accent); }
.hero-facts {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 6px 24px;
  padding: 12px 4px;
  border-bottom: 1px solid var(--border);
  font-size: 0.875rem;
  color: var(--text-dim);
}
.hero-ref { padding: 8px 4px 0; font-size: 0.78rem; color: var(--text-dim); }

/* ---------- Sections, head to head, betting ---------- */
.section-title { margin: 40px 0 12px; font-size: 1.625rem; line-height: 1.1; font-stretch: 62%; font-weight: 800; }
.edge-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.edge-panel {
  min-width: 0;
  padding: 18px 20px 12px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow-x: auto;
}
.edge-panel h4 { margin: 0 0 14px; font-size: 1.0625rem; font-weight: 600; }
.tape {
  display: grid;
  grid-template-columns: 104px 92px minmax(0, 1fr) minmax(0, 1fr) 92px 44px;
  column-gap: 10px;
  align-items: center;
  padding: 7px 0;
  border-top: 1px solid var(--hair);
  font-size: 0.875rem;
}
.tape-h { padding-top: 0; border-top: 0; font-size: 0.78rem; color: var(--text-dim); }
.tape .lbl { color: var(--text-dim); }
.tape .num { text-align: right; }
.tape .edge b { font-size: 0.9375rem; font-stretch: 68%; font-weight: 700; }
.tape .edge .even { color: var(--text-dim); }
.rk { color: var(--text-dim); font-size: 0.78rem; }
.tl { display: flex; justify-content: flex-end; padding-right: 3px; border-right: 1px solid var(--text); }
.tr { display: flex; }
.tb { display: block; height: 10px; border-radius: 2px; background: var(--mute); -webkit-print-color-adjust: exact; print-color-adjust: exact; }
.tb.on { background: var(--tc-ink); }
.edge-key { max-width: 78ch; margin: 10px 0 0; font-size: 0.78rem; color: var(--text-dim); }
.tape-group {
  padding: 14px 0 4px;
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-dim);
}

/* ---------- How to Read Matchups ---------- */
.learn-lede b { color: var(--text); }
.learn-controls { align-items: center; }
.learn-lbl { font-size: 0.8125rem; color: var(--text-dim); }
.learn-controls select { height: 36px; padding: 0 12px; background: var(--panel); color: var(--text); border: 1px solid var(--border); border-radius: 6px; font-size: 0.875rem; }
.learn-btn { display: inline-flex; align-items: center; height: 36px; padding: 0 14px; background: var(--text); color: var(--bg); border-radius: 6px; font-size: 0.875rem; font-weight: 600; text-decoration: none; white-space: nowrap; }
.learn-btn:hover { filter: brightness(0.92); }
.learn-jump { display: flex; flex-wrap: wrap; gap: 8px; margin: -8px 0 36px; }
.learn-jump a { display: inline-flex; align-items: center; gap: 8px; min-height: 36px; padding: 0 12px; border: 1px solid var(--border); border-radius: 6px; color: var(--text-dim); font-size: 0.8125rem; text-decoration: none; }
.learn-jump a:hover { color: var(--text); background: var(--panel-alt); }
.learn-jump .lm { background: var(--panel-alt); color: var(--text); }
.lm { display: inline-grid; place-items: center; flex: none; width: 22px; height: 22px; border-radius: 11px; background: var(--text); color: var(--bg); font-size: 0.6875rem; font-weight: 800; font-stretch: 100%; line-height: 1; letter-spacing: 0; text-transform: none; vertical-align: middle; }
.lm-in { width: 18px; height: 18px; border-radius: 9px; font-size: 0.625rem; margin-left: 4px; }
.learn-sec { margin-bottom: 48px; scroll-margin-top: 16px; }
.learn-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; margin-bottom: 14px; }
.learn-num { font-size: 0.8125rem; font-weight: 700; color: var(--mute); }
.learn-head h3 { margin: 0; font-size: 1.9rem; line-height: 1; font-stretch: 68%; font-weight: 800; }
.learn-sub { font-size: 0.875rem; color: var(--text-dim); }
.learn-row { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 24px; }
.learn-ex { flex: 999 1 600px; min-width: 0; }
.learn-notes { flex: 1 1 320px; margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 14px; }
.learn-notes li { display: grid; grid-template-columns: 26px minmax(0, 1fr); gap: 10px; }
.learn-notes b { display: block; font-size: 0.9375rem; }
.learn-row.wide { flex-direction: column; align-items: stretch; }
.learn-row.wide .learn-ex { flex: none; width: 100%; }
.learn-row.wide .learn-notes { flex: none; display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 16px 24px; }
.learn-notes p { margin: 2px 0 0; font-size: 0.875rem; color: var(--text-dim); line-height: 1.5; }
.learn-gloss { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 10px; margin-top: 18px; }
.learn-gloss div { padding: 12px 14px; background: var(--panel); border: 1px solid var(--hair); border-radius: var(--radius); }
.learn-gloss b { display: block; font-size: 0.875rem; }
.learn-gloss span { font-size: 0.8125rem; color: var(--text-dim); }
.learn-card { margin: 0; }
.learn-card .usage-block { margin-bottom: 0; }
.learn-split { display: flex; flex-wrap: wrap; gap: 14px; align-items: flex-start; }
.learn-split > .learn-card { flex: 1 1 340px; min-width: 0; }
.learn-tip { flex: 1 1 300px; min-width: 0; padding: 12px 12px 10px; background: var(--panel-alt); border: 1px solid var(--border); border-radius: var(--radius); overflow-x: auto; }
.learn-tip table { width: auto; min-width: 100%; font-size: 0.8125rem; }
.learn-tip th, .learn-tip td { padding: 3px 7px; }
.learn-tip .ptip-foot { display: none; }
.learn-prop { margin: 10px 0 0; font-size: 0.875rem; }
.learn-sum { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 24px; padding: 18px 20px; background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); }
.learn-sum > div { flex: 1 1 520px; }
.learn-sum b { font-size: 1.0625rem; }
.learn-sum p { margin: 4px 0 0; color: var(--text-dim); line-height: 1.5; }

/* Pace and tendency (matchup page, under Head to Head) */
.pace-panel {
  margin-top: 16px;
  padding: 16px 20px 12px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.pace-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 4px 16px; margin-bottom: 6px; }
.pace-head h4 { margin: 0; font-size: 1.0625rem; font-weight: 600; }
.pace-sum { font-size: 0.8125rem; color: var(--text-dim); }
.pace-sum b { color: var(--text); }
.pace-scroll { overflow-x: auto; }
.pace-panel table { min-width: 520px; }
.pace-team { display: inline-flex; align-items: center; gap: 10px; }
.pace-team .slab { width: 44px; height: 26px; font-size: 0.9375rem; }

/* Usage (team card) */
.usage-block { margin: 0 0 20px; }
.usage-block > h4 { margin: 0 0 4px 8px; font-size: 0.9375rem; font-weight: 600; }
.usage-block th, .usage-block td { padding: 7px 6px; }
.usage-block .pos-cell { font-size: 0.78rem; color: var(--text-dim); }
.share { display: inline-block; width: 64px; height: 8px; margin-right: 8px; vertical-align: 1px; border-radius: 2px; background: var(--track); }
.share i { display: block; height: 8px; border-radius: 2px; background: var(--tc-ink); -webkit-print-color-adjust: exact; print-color-adjust: exact; }
.trend { color: var(--text-dim); white-space: nowrap; }
.trend.up { color: #7cb6ff; }
.trend.down { color: #ff9a5c; }
.usage-carries { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 10px 0 0 8px; }
.usage-carries .lbl { font-size: 0.8125rem; color: var(--text-dim); }
.usage-chip { display: inline-flex; align-items: center; gap: 8px; min-height: 32px; padding: 0 12px; border: 1px solid var(--border); border-radius: 6px; font-size: 0.8125rem; }
.usage-block .bet-note { margin-left: 8px; }
.edge-table td { padding: 7px 6px; }
.edge-table td.lbl { color: var(--text-dim); }

.bet-panel { padding-bottom: 10px; }
.bet-panel h4 { margin: 0; font-size: 1.375rem; line-height: 1.1; font-stretch: 68%; font-weight: 700; color: var(--tc-ink); }
.bet-chips {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 12px;
  margin: 12px 0 14px;
  padding: 12px 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}
.bet-chip { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.bet-chip .lbl { font-size: 0.78rem; color: var(--text-dim); }
.bet-chip b { font-size: 1.1875rem; font-stretch: 68%; font-weight: 700; }
.bet-chip .rk { min-height: 1.1em; }
.tag {
  display: inline-block;
  min-width: 22px;
  padding: 1px 6px;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 700;
  text-align: center;
}
.tag.W { background: var(--good-bg); color: var(--good); }
.tag.L { background: var(--neg-bg); color: var(--neg); }
.tag.P { background: var(--track); color: var(--text-dim); }

/* ---------- Tables ---------- */
table { width: 100%; border-collapse: collapse; font-size: 0.875rem; }
th, td { padding: 7px 8px; text-align: left; white-space: nowrap; }
th { color: var(--text-dim); font-size: 0.78rem; font-weight: 500; border-bottom: 1px solid var(--border); }
td { border-bottom: 1px solid var(--hair); }
tbody tr:last-child td { border-bottom: 0; }
td.num, th.num { text-align: right; }

/* ---------- Team card ---------- */
#teamCards, .m-cards { display: flex; flex-direction: column; gap: 20px; }
.team-card {
  padding: 22px 24px 24px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.team-card-header { display: flex; align-items: center; gap: 16px 28px; flex-wrap: wrap; margin-bottom: 18px; }
.team-name-block { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; min-width: 0; margin-right: auto; }
.team-name-block h2 { margin: 0; font-size: 2rem; line-height: 1; font-stretch: 62%; font-weight: 800; color: var(--tc-ink); }
.record { font-size: 1.375rem; line-height: 1; font-stretch: 68%; font-weight: 700; }
.record b { font-weight: inherit; }
.record .conf { margin-left: 8px; font-size: 0.875rem; font-stretch: 100%; font-weight: 400; color: var(--text-dim); }
.rating-badges { display: flex; gap: 28px; }
.badge { display: flex; flex-direction: column; gap: 1px; }
.badge .label { font-size: 0.78rem; color: var(--text-dim); }
.badge .value { font-size: 1.1875rem; font-stretch: 68%; font-weight: 700; }
.pos, .badge .value.pos { color: var(--good); }
.neg, .badge .value.neg { color: var(--neg); }

.stat-columns { display: grid; grid-template-columns: minmax(0, 1fr) 200px minmax(0, 1fr); gap: 14px; margin-bottom: 22px; }
.stat-col { padding: 16px; background: var(--panel-alt); border-radius: 6px; }
.stat-col h3 { margin: 0 0 10px; font-size: 0.9375rem; font-weight: 600; text-align: center; }
.gauges { display: flex; gap: 10px 40px; justify-content: center; flex-wrap: wrap; }
.gauge-block { width: 120px; text-align: center; }
.g-track { stroke: var(--track); }
.g-arc { stroke: var(--tc-ink); }
.g-needle { stroke: var(--text); }
.g-hub { fill: var(--text); }
.gauge-value { font-size: 1.625rem; line-height: 1.1; font-stretch: 62%; font-weight: 800; }
.gauge-label, .gauge-rank { font-size: 0.78rem; color: var(--text-dim); }
.mini-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
  text-align: center;
}
.mini-stat .val { font-size: 1.1875rem; font-stretch: 68%; font-weight: 700; }
.mini-stat .lbl, .mini-stat .avg { font-size: 0.78rem; color: var(--text-dim); }
.center-col { display: flex; flex-direction: column; justify-content: center; gap: 14px; text-align: center; }
.rank-line .lbl { font-size: 0.78rem; color: var(--text-dim); }
.rank-line .val { font-size: 1.375rem; font-stretch: 68%; font-weight: 700; }
.rank-line .val span { font-size: 0.875rem; font-stretch: 100%; font-weight: 500; color: var(--text-dim); }

.tables-row { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; margin-bottom: 20px; }
.table-block { min-width: 0; overflow-x: auto; }
.table-block h4 { margin: 0 0 4px 8px; font-size: 0.9375rem; font-weight: 600; }
.tables-row th, .tables-row td { padding: 7px 6px; }
.tables-row td:first-child { white-space: normal; }
.defpos-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.defpos-block {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 3fr);
  gap: 8px;
  align-items: baseline;
  padding: 10px 14px;
  background: var(--panel-alt);
  border-radius: 6px;
}
.defpos-block h4 { margin: 0; font-size: 0.875rem; font-weight: 600; }
.defpos-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.defpos-stats .item { display: flex; align-items: baseline; gap: 5px; }
.defpos-stats .item .val { font-size: 1.125rem; font-stretch: 68%; font-weight: 700; }
.defpos-stats .item .lbl { font-size: 0.78rem; color: var(--text-dim); }

/* ---------- Team vs Team picker ---------- */
.matchup-picker { display: flex; align-items: flex-end; gap: 16px; flex-wrap: wrap; margin-bottom: 28px; }
.picker { display: flex; flex-direction: column; gap: 6px; }
.picker label { font-size: 0.78rem; color: var(--text-dim); }
.picker select { min-width: 240px; cursor: pointer; }
.vs { padding-bottom: 8px; font-size: 0.875rem; color: var(--text-dim); }
.matchup-picker .print-btn { margin-left: auto; }

footer { padding: 20px 28px 28px; text-align: center; font-size: 0.78rem; color: var(--text-dim); }
.empty-note { padding: 20px; text-align: center; font-size: 0.875rem; color: var(--text-dim); }
.empty-note a { color: var(--text); }
.print-hide { display: none !important; }

/* ---------- Live scores and box score ---------- */
.live-badge, .final-badge {
  display: inline-block;
  padding: 1px 6px;
  border-radius: 4px;
  font-size: 0.72rem;
  font-weight: 700;
  font-stretch: 100%;
  line-height: 1.4;
  vertical-align: 0.15em;
}
.live-badge { background: var(--live); color: #fff; }
.final-badge { background: var(--panel-alt); color: var(--text-dim); border: 1px solid var(--border); }
.live-dot {
  display: inline-block;
  align-self: center;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #ef4444;
  animation: live-pulse 1.6s ease-in-out infinite;
}
@keyframes live-pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.35; } }
@media (prefers-reduced-motion: reduce) { .live-dot { animation: none; } }

.boxscore { margin-top: 4px; }
.boxscore .section-title .live-badge, .boxscore .section-title .final-badge { margin-left: 8px; }
.box-status { margin-left: 4px; font-size: 0.875rem; font-stretch: 100%; font-weight: 500; }
.box-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; margin-bottom: 16px; }
.box-table { width: 100%; }
.box-table td.tot { border-left: 1px solid var(--border); }
.box-sub + .box-sub { margin-top: 12px; }
.box-sub-title { margin: 2px 0 2px 6px; font-size: 0.8125rem; font-weight: 600; color: var(--text-dim); }
.box-players-table td:first-child { white-space: normal; }
.box-lastplay { margin-top: 10px; font-size: 0.8125rem; color: var(--text-dim); }
.box-lastplay span { color: var(--text); font-weight: 600; }
.box-scoring { margin-bottom: 4px; }
.box-scoring td.play-text { white-space: normal; }

/* ---------- Print all page ---------- */
.print-status { color: var(--text-dim); font-size: 0.875rem; }
.print-matchup { margin-bottom: 40px; padding-bottom: 28px; border-bottom: 1px dashed var(--border); }
.print-matchup:last-child { border-bottom: none; }

/* ---------- Player game logs and team games ---------- */
.plink, .tlink {
  margin: 0;
  padding: 0;
  background: none;
  border: 0;
  font: inherit;
  color: inherit;
  cursor: pointer;
  text-align: inherit;
  text-decoration: underline dotted;
  text-decoration-thickness: 1px;
  text-decoration-color: var(--mute);
  text-underline-offset: 3px;
}
.tlink { text-decoration-color: currentColor; text-underline-offset: 0.12em; }
.plink:hover, .tlink:hover { text-decoration-style: solid; text-decoration-color: currentColor; }

.ptip {
  position: fixed;
  z-index: 60;
  max-width: calc(100vw - 16px);
  padding: 12px 12px 8px;
  background: var(--panel-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.5);
  pointer-events: none;
}
.ptip table { width: auto; min-width: 100%; font-size: 0.8125rem; }
.ptip th, .ptip td { padding: 3px 7px; }
.ptip-head { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; margin-bottom: 6px; }
.ptip-head b { font-size: 1.125rem; font-stretch: 68%; font-weight: 700; }
.ptip-head span { font-size: 0.78rem; color: var(--text-dim); }
.ptip-foot { margin-top: 6px; font-size: 0.75rem; color: var(--text-dim); }
td.fp { font-weight: 700; }
.ttip td { white-space: nowrap; }

/* ---------- Defense dial popups (dpPassHtml / dpRushHtml in the page script) ---------- */
.gauge-block.dpop { cursor: pointer; border-radius: var(--radius); outline-offset: 2px; }
.gauge-block.dpop .gauge-label { text-decoration: underline dotted; text-underline-offset: 3px; text-decoration-color: var(--text-dim); }
.gauge-block.dpop:hover .gauge-label, .gauge-block.dpop[aria-expanded="true"] .gauge-label { text-decoration-color: currentColor; }
.ptip.dtip { pointer-events: auto; max-width: min(600px, calc(100vw - 16px)); max-height: calc(100vh - 16px); overflow-y: auto; }
.ptip.dtip-backs { pointer-events: none; z-index: 61; min-width: 220px; }
.dtip td { white-space: nowrap; vertical-align: top; }
.dtip tr.dp-g > td { border-top: 1px solid var(--border); }
.dtip tbody tr:first-child > td { border-top: 0; }
.dtip tr.dp-more > td { border-top: 0; padding-top: 0; }
.dtip tfoot td { border-top: 1px solid var(--border); color: var(--text-dim); }
.dtip tfoot td b { color: var(--text); }
.dtip .dp-dim { color: var(--text-dim); }
.dtip .dp-pos { font-size: 0.72rem; color: var(--text-dim); }
.dtip tr.dp-row { cursor: pointer; }
.dtip tr.dp-row:hover > td, .dtip tr.dp-row.on > td, .dtip tr.dp-row:focus-visible > td { background: var(--panel); }
.dtip tr.dp-row:focus-visible { outline: 2px solid var(--text-dim); outline-offset: -2px; }
.dtip tr.dp-sub > td { padding-top: 8px; font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.04em; color: var(--text-dim); }

.plog {
  position: fixed;
  inset: 0;
  z-index: 70;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: rgba(8, 9, 10, 0.72);
}
.plog[hidden], .ptip[hidden] { display: none; }
body.plog-open { overflow: hidden; }
.plog-card {
  display: flex;
  flex-direction: column;
  width: min(880px, 100%);
  max-height: calc(100vh - 32px);
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.55);
}
.plog-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; padding: 18px 20px 12px; }
.plog-top h3 { margin: 0; font-size: 1.625rem; line-height: 1.1; font-stretch: 62%; font-weight: 800; }
.plog-sub { margin-top: 4px; font-size: 0.875rem; color: var(--text-dim); }
.plog-close {
  flex: none;
  width: 36px;
  height: 36px;
  background: transparent;
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 6px;
  cursor: pointer;
}
.plog-close:hover { background: var(--panel-alt); }
.plog-scroll { overflow: auto; padding: 0 20px; -webkit-overflow-scrolling: touch; }
.plog-scroll th.grp { text-align: center; color: var(--text); }
.plog-scroll .gstart { border-left: 1px solid var(--border); }
.res.pos { color: var(--good); }
.res.neg { color: var(--neg); }
.plog-note { padding: 10px 20px 16px; font-size: 0.78rem; color: var(--text-dim); }
.plog-note a, .tg-card .empty-note a { color: var(--text); }

.tg-card .plog-scroll { padding-bottom: 4px; }
.tg-table td { vertical-align: top; }
.tg-table td:nth-child(-n+3) { white-space: nowrap; }
.tg-row { cursor: pointer; }
.tg-row:hover td, .tg-row:focus-within td { background: var(--panel-alt); }
.tg-name { font-weight: 600; }
.tg-line { font-size: 0.8125rem; color: var(--text-dim); white-space: nowrap; }
.tg-line b { color: var(--text); }
.tg-open, .tg-back {
  padding: 0;
  background: none;
  border: 0;
  font: inherit;
  font-size: 0.8125rem;
  color: var(--text);
  text-decoration: underline;
  text-underline-offset: 3px;
  white-space: nowrap;
  cursor: pointer;
}
.tg-back { display: block; margin-bottom: 8px; color: var(--text-dim); }
.tg-fallback { margin: 10px 0 4px; padding-left: 18px; font-size: 0.875rem; color: var(--text-dim); }
.tg-fallback b { color: var(--text); }
.tg-wait { padding: 24px 0; }

/* ---------- Prop tool ---------- */
.prop-tool { margin: 12px 20px 0; padding: 12px 14px; background: var(--panel-alt); border-radius: 6px; }
.prop-inputs { display: flex; flex-wrap: wrap; gap: 14px; align-items: center; }
.prop-inputs label { display: flex; align-items: center; gap: 8px; font-size: 0.8125rem; color: var(--text-dim); }
.prop-inputs input { width: 90px; }
.prop-result { margin-top: 10px; font-size: 0.875rem; line-height: 1.6; }
.prop-ctx { margin-top: 6px; font-size: 0.8125rem; color: var(--text-dim); }
.plog-scroll tr.prop-over td.prop-cell { color: var(--good); }
.plog-scroll tr.prop-under td.prop-cell { color: var(--text-dim); }

/* ---------- Injury tags ---------- */
.inj {
  display: inline-block;
  margin-left: 5px;
  padding: 0 4px;
  border-radius: 4px;
  font-size: 0.6875rem;
  font-weight: 700;
  line-height: 1.5;
  vertical-align: 1px;
  cursor: help;
}
.inj-O, .inj-D, .inj-IR, .inj-PUP, .inj-SUSP { background: var(--neg-bg); color: #fca5a5; }
.inj-Q { background: rgba(234, 179, 8, 0.2); color: #fde047; }
.inj-DNP, .inj-LP { background: var(--track); color: var(--text-dim); }
.ptip-inj, .plog-inj { margin: -2px 0 6px; font-size: 0.78rem; color: #fde047; }
.plog-inj { margin: 4px 0 0; }

/* ---------- Player search ---------- */
.psearch { position: relative; align-self: center; width: 200px; margin-left: auto; }
.psearch input { width: 100%; }
.psearch-list {
  position: absolute;
  right: 0;
  top: calc(100% + 4px);
  z-index: 55;
  width: max(100%, 260px);
  margin: 0;
  padding: 4px;
  list-style: none;
  background: var(--panel-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.5);
  text-align: left;
}
.psearch-list li { display: flex; justify-content: space-between; gap: 10px; padding: 8px; border-radius: 5px; font-size: 0.875rem; cursor: pointer; }
.psearch-list li.active, .psearch-list li:hover { background: var(--border); }
.psearch-list .ps-meta { font-size: 0.78rem; color: var(--text-dim); white-space: nowrap; }
.psearch-list .ps-empty { color: var(--text-dim); cursor: default; }

/* ---------- Weekly Edges ---------- */
.board-block, .prop-boards .table-block {
  padding: 14px 16px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.board-link { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; text-decoration: none; }
.board-at { font-size: 0.78rem; font-weight: 400; color: var(--text-dim); }
.board-block .slab { width: 44px; height: 26px; font-size: 0.9375rem; }
.board-block td.move { white-space: normal; min-width: 120px; max-width: 190px; }
.board-block td.proe-cell { white-space: nowrap; line-height: 1.35; }
.share-cell b { display: block; }
.prop-boards td:first-child { white-space: normal; min-width: 96px; }
.prop-boards th, .prop-boards td { padding-left: 4px; padding-right: 4px; }
.prop-boards td:first-child { min-width: 88px; }
.prop-boards .rk { font-size: 0.72rem; }
.share-cell .trend { display: block; font-size: 0.78rem; }
.board-block .slab.long { font-size: 0.75rem; }
.board-block .ap-rank { margin-right: 0; }
.board-link:hover { text-decoration: underline; text-underline-offset: 3px; }
.board-block td.move { font-size: 0.8125rem; color: var(--text-dim); }
.board-count { font-size: 0.875rem; color: var(--text-dim); }
.edge-intro { margin: -4px 0 12px; }
.edge-intro b { color: var(--text); }
.prop-boards { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(460px, 100%), 1fr)); gap: 16px; }
.bet-note { margin: 8px 0 0; font-size: 0.78rem; color: var(--text-dim); }

/* ---------- Smaller screens ---------- */
/* The scorebug three across on a narrower window: names and scores scale with the window,
   so a long name and a live score both fit inside the team's block. */
@media screen and (min-width: 901px) and (max-width: 1240px) {
  .hero-team { gap: 6px 12px; padding: 24px 22px; }
  .hero-name { font-size: clamp(1.75rem, 3.4vw, 2.875rem); }
  .hero-score { font-size: clamp(2.5rem, 4.6vw, 3.75rem); }
}

@media (max-width: 900px) {
  .edge-grid, .box-grid { grid-template-columns: minmax(0, 1fr); }
  .stat-columns, .tables-row { grid-template-columns: minmax(0, 1fr); }
  .center-col { flex-direction: row; justify-content: space-around; }
}

/* Below this the blocks are too narrow for a name beside a score: stack the scorebug.
   Screen only, so the printed page keeps its three-across header. */
@media screen and (max-width: 900px) {
  .game-hero { grid-template-columns: minmax(0, 1fr); }
  .hero-team, .hero-team[data-side="home"] {
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas: "side side" "name score" "rec rec";
    padding: 18px 22px;
    text-align: left;
  }
  .hero-mid { padding: 18px 16px; }
}

@media (max-width: 820px) {
  .topbar { grid-template-columns: minmax(0, 1fr) auto; row-gap: 2px; padding: 10px 16px 0; min-height: 0; }
  .topbar h1 { grid-column: 1; grid-row: 1; }
  .league-link { grid-column: 2; grid-row: 1; height: 44px; }
  .topnav { grid-column: 1 / -1; grid-row: 2; gap: 0 22px; min-height: 0; }
  .topnav a { height: 44px; }
  .navtools { flex: 1 0 100%; flex-wrap: wrap; }
  .weeknav { flex: 1 0 100%; padding: 2px 0; }
  .wk-label { margin-left: 0; }
  .topnav .weeknav a { min-width: 36px; height: 36px; }
  .psearch, .navtools .psearch { flex: 1 0 100%; width: 100%; margin: 4px 0 12px; }
  .psearch input { height: 44px; }
  .psearch-list { left: 0; right: auto; width: 100%; }
  main { padding: 22px 16px 40px; }
  .week-title { font-size: 3.75rem; }
  .week-filters { width: 100%; }
  .week-filters input[type="search"], .week-filters select { flex: 1 1 140px; width: auto; height: 44px; min-width: 0; }
  .ranked-toggle { min-height: 44px; }
  .print-btn { height: 44px; }
  .print-btn-single { height: 36px; }
  .picker { flex: 1 1 200px; }
  .picker select { width: 100%; min-width: 0; height: 44px; }
  .vs { display: none; }
  .defpos-row { grid-template-columns: minmax(0, 1fr); }
  .rating-badges { gap: 22px; }
}

@media (max-width: 760px) {
  .board-cols { display: none; }
  .game-row {
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas: "away spread" "home total" "impl impl" "where where";
    gap: 6px 12px;
    padding: 12px 0;
  }
  .game-row:hover { background: none; }
  .gr-team.away { grid-area: away; }
  .gr-team.home { grid-area: home; }
  .gr-at { display: none; }
  .gr-spread { grid-area: spread; text-align: right; }
  .gr-total { grid-area: total; text-align: right; }
  .gr-total .gr-big { font-size: 1rem; color: var(--text-dim); }
  .gr-implied { grid-area: impl; margin-top: 2px; font-size: 0.78rem; color: var(--text-dim); }
  .gr-implied .gr-big { color: var(--text); }
  .gr-where { grid-area: where; font-size: 0.78rem; color: var(--text-dim); }
  .gr-where > div { display: inline; }
  .gr-where > div + div::before { content: ", "; }
  .ou-pre, .imp-pre { display: inline; }
  .gr-team { gap: 10px; }
  .gr-name { font-size: 1.1875rem; }
  .slab { width: 44px; height: 28px; font-size: 0.9375rem; }
  .slab.long { font-size: 0.75rem; }
  .day-label { padding-top: 26px; }
}

@media (max-width: 700px) {
  .hero-team, .hero-team[data-side="home"] { padding: 18px 18px; }
  .hero-name { font-size: 2.125rem; }
  .hero-score { font-size: 2.75rem; }
  .hero-facts { flex-direction: column; gap: 2px; }
  .section-title { margin-top: 32px; }
  .team-card { padding: 18px 16px 20px; }
  .team-name-block h2 { font-size: 1.75rem; }
  .edge-panel { padding: 16px 14px 10px; }
}

@media (max-width: 560px) {
  .bet-chips { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .tape { grid-template-columns: 78px 58px minmax(0, 1fr) minmax(0, 1fr) 58px 34px; column-gap: 6px; font-size: 0.8125rem; }
  .tape .rk { display: block; }
  .share { display: none; }
  .gauges { gap: 10px 16px; }
  .plog { padding: 8px; }
  .plog-card { max-height: calc(100vh - 16px); }
  .plog-top { padding: 14px 12px 8px; }
  .plog-scroll { padding: 0 12px; }
  .plog-note { padding: 8px 12px 12px; }
  .prop-tool { margin: 10px 12px 0; }
  .box-scoring td.lbl:nth-child(3) { display: none; }
}

@media (max-width: 480px) {
  .topnav .nav-full { display: none; }
  .topnav .nav-short { display: inline; }
}

/* phones: one block per game in the team games list instead of a wide table */
@media (max-width: 640px) {
  .tg-table thead { display: none; }
  .tg-table, .tg-table tbody { display: block; }
  .tg-row { display: grid; grid-template-columns: auto 1fr auto; gap: 4px 10px; padding: 10px 0; border-top: 1px solid var(--border); }
  .tg-row:first-child { border-top: 0; padding-top: 2px; }
  .tg-row td { display: block; padding: 0; border: 0 !important; background: none !important; }
  .tg-row td:first-child::before { content: "Wk "; color: var(--text-dim); }
  .tg-row td:nth-child(2) { font-weight: 600; }
  .tg-row td.tg-lead { grid-column: 1 / -1; display: grid; grid-template-columns: 6.6em 1fr; column-gap: 8px; }
  .tg-row td.tg-lead::before { content: attr(data-label); grid-row: 1 / span 2; padding-top: 2px; font-size: 0.78rem; color: var(--text-dim); }
  .tg-row td.tg-go { grid-column: 1 / -1; }
}

/* ---------------- Print ---------------- */
@media print {
  /* Default print (Print matchup / Ctrl+P): both teams side by side on one
     landscape page. Single-team print uses the "single" named page below. */
  @page { size: letter landscape; margin: 0.35in; }
  @page single { size: letter portrait; margin: 0.4in; }

  :root {
    --bg: #ffffff;
    --panel: #ffffff;
    --panel-alt: #ffffff;
    --border: #b8bfcc;
    --hair: #d9dde5;
    --text: #111318;
    --text-dim: #5b6472;
    --mute: #9aa1ad;
    --accent: #111318;
    --good: #15803d;
    --neg: #b91c1c;
    --good-bg: #dcfce7;
    --neg-bg: #fee2e2;
    --track: #d9dde5;
  }
  html, body { background: #ffffff; color: #111318; }

  .no-print, .matchup-picker, footer, .print-btn, .topnav, .league-link, .psearch,
  .ptip, .plog, .boxscore, #boxscore, .live-note, .print-all-bar { display: none !important; }
  /* Two landscape pages per matchup: header, Head to Head, pace and betting trends on the
     first; both team cards (with usage) on the second */
  body:not(.print-single) .m-cards { break-before: page; page-break-before: always; }
  .pace-panel, .usage-block { break-inside: avoid; page-break-inside: avoid; }

  .topbar { display: block; min-height: 0; padding: 0 0 10px; margin-bottom: 12px; border-bottom: 2px solid #111318; }
  main { max-width: 100%; padding: 0; }

  .tc, .bet-panel h4, .team-name-block h2 { color: var(--tc-inkp); }
  .tb.on, .g-arc { background: var(--tc-inkp); stroke: var(--tc-inkp); }
  .plink, .tlink { text-decoration: none; }
  .stat-col, .defpos-block { border: 1px solid var(--border); }
  .slab { box-shadow: none; }
  .tag, .inj { -webkit-print-color-adjust: exact; print-color-adjust: exact; }

  #teamCards { gap: 0; }
  .team-card { padding: 0; border: none; break-before: page; page-break-before: always; }
  .team-card:first-child { break-before: avoid; page-break-before: avoid; }

  /* keep the screen's multi-column layouts even though the page is narrow */
  .edge-grid { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
  .stat-columns { grid-template-columns: minmax(0, 1fr) 170px minmax(0, 1fr) !important; gap: 10px !important; }
  .center-col { flex-direction: column !important; }
  .tables-row { grid-template-columns: repeat(3, minmax(0, 1fr)) !important; gap: 12px !important; }
  .defpos-row { grid-template-columns: repeat(4, minmax(0, 1fr)) !important; gap: 8px !important; }
  .defpos-block { grid-template-columns: minmax(0, 1fr); gap: 2px; padding: 6px 10px; }
  .defpos-stats { gap: 4px; }
  .defpos-stats .item { gap: 3px; }
  .defpos-stats .item .val { font-size: 1rem; }
  .game-hero { grid-template-columns: minmax(0, 1fr) 280px minmax(0, 1fr) !important; }
  .hero-facts { flex-direction: row !important; }

  /* One-page matchup: lay the two cards out side by side at a fixed width, then
     scale the block down to the landscape page (10.3in is about 989px wide). */
  body:not(.print-single) .topbar { padding: 0 0 4px; margin-bottom: 6px; }
  body:not(.print-single) #teamCards,
  body:not(.print-single) .m-cards {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 28px !important;
    width: 1720px;
    zoom: 0.55;
  }
  body:not(.print-single) .table-block { overflow: visible; }
  body:not(.print-single) .team-card th,
  body:not(.print-single) .team-card td { padding: 3px 3px; }
  body:not(.print-single) .team-card td:first-child { white-space: normal; overflow-wrap: anywhere; }
  body:not(.print-single) .team-card,
  body:not(.print-single) .team-card:first-child {
    break-before: avoid;
    page-break-before: avoid;
    break-inside: avoid;
    page-break-inside: avoid;
  }

  /* Print all: one matchup per landscape page */
  .print-matchup { margin: 0; padding: 0; border: none; break-after: page; page-break-after: always; }
  .print-matchup:last-child { break-after: auto; page-break-after: auto; }

  /* Single-team print: one portrait page per card */
  body.print-single, body.print-single main { page: single; }
  body.print-single .m-head, body.print-single .m-edges { display: none !important; }
  body.print-single .team-card { break-before: avoid; page-break-before: avoid; }
  /* laid out at the screen's width, then scaled to the portrait page (7.7in is about 739px) */
  body.print-single #teamCards, body.print-single .m-cards { width: 1080px; zoom: 0.68; }

  .team-card-header, .rating-badges, .badge, .stat-col, .center-col, .table-block,
  .defpos-row, .defpos-block, .game-hero, .edge-panel, table, tr {
    break-inside: avoid;
    page-break-inside: avoid;
  }

  #teamCards .section-title, .m-cards .section-title { display: none; }

  /* Matchup page: header + head to head + both cards on one landscape page */
  body.mprint:not(.print-single) .topbar { display: none; }
  body.mprint:not(.print-single) .m-head,
  body.mprint:not(.print-single) .m-edges { zoom: 0.64; }
  body.mprint:not(.print-single) #teamCards,
  body.mprint:not(.print-single) .m-cards { width: 1960px; zoom: 0.48; }
  body.mprint:not(.print-single) .mh-week { margin-bottom: 4px; }
  body.mprint:not(.print-single) .hero-team { padding: 10px 22px; gap: 3px 16px; }
  body.mprint:not(.print-single) .hero-name { font-size: 2rem; }
  body.mprint:not(.print-single) .hero-score { font-size: 2.4rem; }
  body.mprint:not(.print-single) .hero-mid { padding: 8px 16px; }
  body.mprint:not(.print-single) .hero-line { font-size: 1.9rem; }
  body.mprint:not(.print-single) .hero-total { margin-top: 0; font-size: 1.1rem; }
  body.mprint:not(.print-single) .hero-implied { margin-top: 2px; }
  body.mprint:not(.print-single) .hero-facts { padding: 5px 4px; }
  body.mprint:not(.print-single) .hero-ref { padding-top: 4px; }
  body.mprint:not(.print-single) .section-title { margin: 10px 0 6px; font-size: 1.25rem; }
  body.mprint:not(.print-single) .edge-panel { padding: 8px 14px 4px; }
  body.mprint:not(.print-single) .edge-panel h4 { margin-bottom: 4px; }
  body.mprint:not(.print-single) .tape { padding: 2px 0; }
  body.mprint:not(.print-single) .tape-group { padding: 6px 0 2px; }
  body.mprint:not(.print-single) .pace-panel { margin-top: 8px; padding: 8px 14px 4px; }
  body.mprint:not(.print-single) .pace-panel th, body.mprint:not(.print-single) .pace-panel td { padding-top: 3px; padding-bottom: 3px; }
  body.mprint:not(.print-single) .pace-panel .bet-note { margin-top: 2px; }
  body.mprint:not(.print-single) .edge-key { max-width: none; margin-top: 4px; }
  body.mprint:not(.print-single) .m-edges { margin-bottom: 10px; }
}

/* ---------------- EPA page (epa.html) ---------------- */
.ep-intro { display: grid; gap: 10px; margin-top: 8px; }
.ep-intro h2 { margin: 0; font-size: 2.5rem; line-height: 1.02; font-stretch: 62%; font-weight: 800; }
.ep-intro p { margin: 0; max-width: 72ch; color: var(--text-dim); }
.ep-facts { display: flex; flex-wrap: wrap; gap: 6px 22px; font-size: 0.875rem; color: var(--text-dim); }
.ep-facts b { color: var(--text); font-weight: 600; }
.ep-lede { margin: -4px 0 14px; max-width: 78ch; color: var(--text-dim); font-size: 0.875rem; }
.ep-dim { color: var(--text-dim); font-weight: 400; }
.ep-small { margin: 10px 0 0; font-size: 0.875rem; color: var(--text-dim); max-width: 70ch; }

.ep-pick { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-bottom: 16px; }
.ep-pick button { display: inline-flex; align-items: center; height: 36px; padding: 0 10px; border: 1px solid var(--border);
  border-radius: 6px; background: var(--panel); color: var(--text-dim); cursor: pointer; font-size: 0.8125rem; font-weight: 600; }
.ep-pick button:hover { color: var(--text); background: var(--panel-alt); }
.ep-pick button[aria-pressed="true"] { color: var(--text); border-color: var(--text); background: var(--panel-alt); }
.ep-pick label { font-size: 0.875rem; color: var(--text-dim); }
.ep-pick select { height: 38px; max-width: 100%; padding: 0 10px; border: 1px solid var(--border); border-radius: 6px;
  background: var(--panel); color: var(--text); }

.ep-head { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); gap: 16px; align-items: center;
  padding: 18px 20px; background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); }
.ep-team { display: flex; align-items: center; gap: 12px; min-width: 0; }
.ep-team.home { justify-content: flex-end; text-align: right; }
.ep-team .nm { font-size: 1.375rem; line-height: 1.05; font-stretch: 68%; font-weight: 700; }
.ep-team .sub { font-size: 0.78rem; color: var(--text-dim); }
.ep-mid { display: grid; gap: 6px; text-align: center; font-size: 0.875rem; }
.ep-lines { display: grid; grid-template-columns: repeat(2, auto); gap: 2px 18px; justify-content: center; }
.ep-lines .k { font-size: 0.72rem; letter-spacing: 0.06em; text-transform: uppercase; color: var(--text-dim); }
.ep-lines .v { font-size: 1.25rem; font-stretch: 68%; font-weight: 700; margin-bottom: 4px; }
.ep-gaps { font-size: 0.78rem; color: var(--text-dim); }
.ep-gap { display: inline-block; padding: 1px 7px; border-radius: 4px; background: var(--panel-alt); color: var(--text-dim);
  font-size: 0.78rem; font-weight: 700; }
.ep-gap.big { background: rgba(251, 191, 36, 0.16); color: #fbbf24; }
.ep-edges { margin-top: 16px; }

.ep-cards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; margin-top: 16px; }
.ep-card { min-width: 0; padding: 16px 20px; background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); }
.ep-card h4 { margin: 0 0 10px; font-size: 1.0625rem; font-weight: 600; }
.ep-kv { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 0 12px; }
.ep-kv > * { padding: 6px 0; border-top: 1px solid var(--hair); font-size: 0.875rem; }
.ep-kv > :nth-child(-n+2) { border-top: 0; }
.ep-kv > :nth-child(odd) { color: var(--text-dim); }
.ep-kv > :nth-child(even) { text-align: right; }
.ep-shift { font-size: 0.78rem; font-weight: 600; color: var(--text-dim); }
.ep-shift.up { color: var(--good); }
.ep-shift.down { color: var(--neg); }
.ep-flags { display: grid; gap: 6px; margin: 12px 0 0; padding: 0; list-style: none; }
.ep-flags li { padding: 7px 10px; border-radius: 6px; background: rgba(251, 191, 36, 0.12); font-size: 0.8125rem; }
.ep-flags li.none { background: var(--panel-alt); color: var(--text-dim); }

.ep-tbl { overflow-x: auto; background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); }
.ep-table { width: 100%; border-collapse: collapse; font-size: 0.875rem; }
.ep-table th { padding: 10px 10px 8px; text-align: right; font-size: 0.72rem; font-weight: 600; letter-spacing: 0.04em;
  text-transform: uppercase; color: var(--text-dim); border-bottom: 1px solid var(--border); white-space: nowrap; }
.ep-table td { padding: 8px 10px; text-align: right; border-top: 1px solid var(--hair); white-space: nowrap; }
.ep-table tr:first-child td { border-top: 0; }
.ep-table th.l, .ep-table td.l { text-align: left; }
.ep-table th button { all: unset; cursor: pointer; }
.ep-table th button:focus-visible { outline: 2px solid var(--text); outline-offset: 2px; }
.ep-table th[aria-sort] button { color: var(--text); }
.ep-table .slab { width: 44px; height: 26px; font-size: 0.9375rem; }
.ep-table .slab.long { font-size: 0.75rem; }
.ep-table td.ep-flagtxt { min-width: 220px; max-width: 340px; white-space: normal; text-align: left; font-size: 0.78rem; color: var(--text-dim); }
.ep-game { display: inline-flex; align-items: center; gap: 6px; text-decoration: none; }
.ep-game .at { color: var(--text-dim); font-size: 0.78rem; }
.ep-tm { display: inline-flex; align-items: center; gap: 8px; }
.ep-tm .nm { font-size: 0.8125rem; color: var(--text-dim); }
.ep-table .pos { color: var(--good); }
.ep-table .neg { color: var(--neg); }
.ep-bar { display: inline-block; position: relative; vertical-align: middle; width: 54px; height: 8px; margin-left: 8px;
  border-radius: 2px; background: var(--track); overflow: hidden; }
.ep-bar i { position: absolute; top: 0; bottom: 0; }
.ep-bar i.p { background: var(--good); }
.ep-bar i.n { background: var(--neg); }

.ep-method { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 16px; }
.ep-method ol { margin: 0; padding-left: 1.2em; display: grid; gap: 8px; font-size: 0.875rem; }
.ep-errs { display: grid; gap: 10px; margin-top: 8px; }
.ep-err { display: grid; grid-template-columns: 130px minmax(0, 1fr) 46px; gap: 10px; align-items: center; font-size: 0.8125rem; }
.ep-err .t { height: 12px; border-radius: 2px; background: var(--track); overflow: hidden; }
.ep-err .t i { display: block; height: 100%; background: var(--text-dim); }
.ep-err.mkt .t i { background: var(--text); }
.ep-err .n { text-align: right; font-weight: 600; }
.ep-errcap { margin-top: 12px; font-size: 0.72rem; letter-spacing: 0.06em; text-transform: uppercase; color: var(--text-dim); }

.ep-print-only { display: none; }

@media (max-width: 760px) {
  .ep-intro h2 { font-size: 2rem; }
  .ep-head { grid-template-columns: minmax(0, 1fr); }
  .ep-team.home { justify-content: flex-start; text-align: left; flex-direction: row-reverse; }
  .ep-mid { text-align: left; }
  .ep-lines { justify-content: start; }
  .ep-cards, .ep-method { grid-template-columns: minmax(0, 1fr); }
  .ep-err { grid-template-columns: 104px minmax(0, 1fr) 40px; }
}

@media print {
  body[data-page="epa"] .topbar { display: none; }
  .ep-print-only { display: block; }
  .ep-print-game { break-after: page; page-break-after: always; zoom: 0.72; }
  .ep-print-game .mh-week { margin-bottom: 6px; }
  .ep-print-game .ep-head { padding: 10px 16px; }
  .ep-print-game .edge-panel { padding: 8px 14px 4px; }
  .ep-print-game .tape { padding: 3px 0; }
  .ep-print-game .ep-card { padding: 10px 16px; }
  .ep-print-game .ep-edges, .ep-print-game .ep-cards { margin-top: 10px; }
  .ep-print-page { break-before: page; page-break-before: always; }
  .ep-print-page .section-title { margin-top: 0; }
  .ep-print-only + .ep-print-page { break-before: auto; page-break-before: auto; }
  .ep-intro { gap: 4px; margin: 0 0 8px; }
  .ep-intro h2 { font-size: 1.6rem; }
  .ep-intro p { display: none; }
  .ep-cards { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
  .ep-head { grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr) !important; }
  .ep-team.home { justify-content: flex-end !important; text-align: right !important; flex-direction: row !important; }
  .ep-method { grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr) !important; }
  .ep-tbl { overflow: visible; border: none; }
  .ep-table { font-size: 0.75rem; }
  .ep-table th, .ep-table td { padding: 4px 6px; }
  .ep-table th button { color: inherit; }
  .ep-gap.big { background: #fef3c7; color: #92400e; }
  .ep-flags li { background: #fef3c7; }
  .ep-flags li.none { background: #f1f3f6; }
  .ep-gap, .ep-flags li, .ep-bar, .ep-bar i, .ep-err .t, .ep-err .t i { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .ep-card, .ep-head { break-inside: avoid; page-break-inside: avoid; }
  .ep-table { break-inside: auto !important; page-break-inside: auto !important; }
  .ep-table tr { break-inside: avoid; page-break-inside: avoid; }
  .ep-print-page .ep-tbl { zoom: 0.82; }
  .ep-print-page .ep-lede { margin-bottom: 6px; }
}

/* Game packets (packets.js): Print/Save packet buttons */
.packet-actions { display: inline-flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.packet-actions[hidden] { display: none; }
.packet-status { font-size: 0.8125rem; color: var(--text-dim); }
.packet-status:empty { display: none; }
@media print { .packet-actions { display: none !important; } }
