/* ---------- Page header ---------- */
.pagehead { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: var(--space-4); margin-bottom: var(--space-4); }
.pagehead__titles { display: grid; gap: var(--space-2); min-width: 0; }
.pagehead__sub { color: var(--ink-2); font-size: var(--step--1); display: flex; flex-wrap: wrap; align-items: center; gap: 4px 16px; }
.sub-lead { color: var(--ink); font-weight: 600; }
.pagehead__controls { display: flex; gap: var(--space-2); align-items: center; flex-wrap: wrap; }
.weekpick { display: inline-flex; align-items: center; border: 1px solid var(--line-strong); background: var(--surface); border-radius: var(--radius-s); }
.weekpick button { width: 40px; height: 40px; display: grid; place-items: center; color: var(--ink-2); }
.weekpick button:hover:not(:disabled) { background: var(--surface-2); }
.weekpick button:disabled { opacity: 0.35; cursor: default; }
.weekpick button svg { width: 18px; height: 18px; }
.weekpick select { border: 0; background: transparent; min-height: 40px; padding: 0 var(--space-2); font-weight: 700; font-size: var(--step-0); text-align: center; min-width: 96px; }

/* ---------- Banners ---------- */
.banners { display: grid; gap: var(--space-2); margin-bottom: var(--space-3); }
.banner { display: flex; align-items: flex-start; gap: var(--space-3); padding: var(--space-3) var(--space-4); border-radius: var(--radius-m); border: 1px solid; font-size: var(--step--1); }
.banner--info { background: var(--info-bg); color: var(--info-ink); border-color: var(--info-line); }
.banner--warn { background: var(--warn-bg); color: var(--warn-ink); border-color: var(--warn-line); }
.banner--bad { background: var(--bad-bg); color: var(--bad-ink); border-color: var(--bad-line); }
.banner__icon svg { width: 20px; height: 20px; margin-top: 1px; }
.banner__text { flex: 1; min-width: 0; display: grid; gap: 2px; }
.banner__text strong { font-size: var(--step-0); }
.banner__text p { color: inherit; opacity: 0.92; max-width: 70ch; }
.banner__actions { display: flex; gap: var(--space-2); flex-wrap: wrap; align-self: center; }
.banner .btn { background: transparent; border-color: currentColor; color: inherit; }
.banner .btn--primary { background: currentColor; }
.banner .btn--primary > * , .banner .btn--primary { --btn-fg: var(--bg); }
.banner--warn .btn--primary, .banner--info .btn--primary, .banner--bad .btn--primary { color: var(--surface); background: var(--ink); border-color: var(--ink); }
@media (max-width: 599px) { .banner { flex-wrap: wrap; } .banner__actions { width: 100%; padding-left: 32px; } }

/* ---------- Toolbar ---------- */
.toolbar {
  position: sticky; top: var(--header-h); z-index: 20; background: color-mix(in srgb, var(--bg) 94%, transparent); backdrop-filter: blur(8px);
  margin: 0 calc(var(--gutter) * -1) var(--space-3); padding: var(--space-2) var(--gutter); border-bottom: 1px solid var(--line);
  display: flex; flex-wrap: wrap; gap: var(--space-2); align-items: center;
}
.search { position: relative; flex: 1 1 200px; max-width: 320px; }
.search svg { position: absolute; left: 10px; top: 50%; translate: 0 -50%; width: 18px; height: 18px; color: var(--ink-3); pointer-events: none; }
.search input { width: 100%; padding-left: 34px; }
.toolbar .spacer { flex: 1; }
.toolbar__filters { display: contents; }
.toolbar select { padding-right: 8px; }
.count-line { color: var(--ink-3); font-size: var(--step--1); }
@media (max-width: 719px) {
  .toolbar { gap: 6px; }
  .search { flex-basis: 100%; max-width: none; }
  .toolbar .seg, .toolbar select { flex: 0 0 auto; }
}

/* ---------- The slate: one DOM, table on desktop, cards on phones ---------- */
.slate { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-m); overflow: clip; }
.row { display: grid; align-items: center; column-gap: var(--space-4); }
.row--head, .game {
  grid-template-columns: 168px minmax(240px, 1.9fr) minmax(170px, 1.2fr) 52px minmax(104px, 0.7fr) minmax(190px, 1.3fr);
  padding-inline: var(--space-4);
}
@media (min-width: 960px) and (max-width: 1139px) {
  .row { column-gap: var(--space-3); }
  .row--head, .game { grid-template-columns: 150px minmax(180px, 1.6fr) minmax(130px, 1.1fr) 46px minmax(92px, 0.7fr) minmax(150px, 1.25fr); padding-inline: var(--space-3); }
}
.row--head { position: sticky; top: calc(var(--header-h) + 49px); z-index: 10; background: var(--surface-2); border-bottom: 1px solid var(--line); min-height: 38px; font-size: 0.75rem; font-weight: 700; color: var(--ink-2); }
.row--head .cell--total, .game .cell--total { text-align: right; }
.row--head .cell--win, .game .cell--win { padding-left: var(--space-3); }
.dayhead { display: flex; align-items: baseline; justify-content: space-between; padding: var(--space-3) var(--space-4) var(--space-2); background: var(--surface-sunk); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.dayhead:first-of-type { border-top: 0; }
.dayhead h2 { font: 700 var(--step-2)/1.1 var(--font-display); letter-spacing: 0.01em; }
.dayhead span { color: var(--ink-3); font-size: var(--step--1); }

.game { min-height: 64px; padding-block: 10px; border-bottom: 1px solid var(--line); cursor: pointer; position: relative; transition: background var(--t-fast); }
.game:last-child { border-bottom: 0; }
.game:hover { background: var(--surface-sunk); }
.game[aria-selected='true'] { background: var(--turf-soft); }
.game[aria-selected='true']::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--turf); }

.cell { min-width: 0; }
.cell--kickoff { display: grid; gap: 4px; justify-items: start; }
.kick__time { font-size: var(--step--1); color: var(--ink-2); font-weight: 600; }
.is-struck { text-decoration: line-through; }
.cell--matchup { display: grid; gap: 2px; }
.game__open { text-align: left; display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 8px; font-size: var(--step-1); min-width: 0; }
.game__open:hover .team__name { text-decoration: underline; text-decoration-color: var(--line-strong); text-underline-offset: 3px; }
.team { display: inline-flex; align-items: baseline; gap: 6px; min-width: 0; }
.team--away .team__name { font-weight: 500; }
.team--home .team__name { font-weight: 800; }                       /* home team reads heavier, so the venue is visible at a glance */
.team__rec { font-size: 0.75rem; color: var(--ink-3); white-space: nowrap; }
.team__pts { display: none; }
.sep { color: var(--ink-3); font-weight: 600; }
.game__note { font-size: 0.75rem; color: var(--ink-3); }
.game__note--warn { color: var(--warn-ink, var(--ink-2)); font-weight: 600; }
.seg--view { margin-inline-start: auto; }
.cell--spread { font-weight: 700; }
.game .cell--total, .game .cell--score { font-size: var(--step-0); }
.cell--score .is-lead { font-weight: 700; }
.cell--win { display: grid; gap: 6px; }
.spread { display: flex; gap: 6px; align-items: baseline; min-width: 0; }
.spread__team { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.spread__pts { white-space: nowrap; }
.win__text { display: flex; gap: 6px; align-items: baseline; font-size: var(--step-0); min-width: 0; }
.win__team { color: var(--ink-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.win__pct { font-weight: 700; white-space: nowrap; }
.is-missing { color: var(--ink-3); font-weight: 400; }
.game.is-dead { background: repeating-linear-gradient(135deg, transparent 0 10px, color-mix(in srgb, var(--line) 45%, transparent) 10px 11px); }
.game.is-dead .team__name { color: var(--ink-3); }
.game.is-noforecast .cell--spread::after { content: none; }

.probbar { display: flex; gap: 2px; height: 8px; width: 100%; max-width: 150px; }
.probbar__seg { flex-basis: 0; min-width: 4px; background: var(--neutral-bar); border-radius: 4px; }
.probbar__seg.is-fav { background: var(--turf); }
.probbar--missing { height: 8px; }
.probbar-wrap { display: grid; gap: 6px; }
.probbar-wrap .probbar { max-width: none; height: 10px; }
.probbar__labels { display: flex; justify-content: space-between; gap: var(--space-3); font-size: var(--step--1); color: var(--ink-2); }
.probbar__labels b { color: var(--ink); }
.probbar__labels .is-fav b { color: var(--turf); }

/* ---------- Phone cards ---------- */
@media (max-width: 959px) {
  .row--head { display: none; }
  .slate { border: 0; background: transparent; border-radius: 0; overflow: visible; }
  .dayhead { position: sticky; top: calc(var(--header-h) + 100px); z-index: 5; border: 0; background: var(--bg); padding-inline: 2px; }
  .game, .game:last-child {
    grid-template-columns: 1fr 1fr 1fr; grid-template-areas: 'kick kick kick' 'match match match' 'spread total win';
    gap: var(--space-2) var(--space-3); padding: var(--space-3) var(--space-4) var(--space-4);
    border: 1px solid var(--line); border-radius: var(--radius-m); background: var(--surface); margin-bottom: var(--space-3);
  }
  .game:hover { background: var(--surface); }
  .cell--kickoff { grid-area: kick; display: flex; justify-content: space-between; align-items: center; width: 100%; }
  .cell--matchup { grid-area: match; }
  .cell--spread { grid-area: spread; } .cell--total { grid-area: total; text-align: left !important; } .cell--win { grid-area: win; padding-left: 0 !important; }
  .cell--score { display: none; }
  .cell--spread, .cell--total, .cell--win { padding-top: var(--space-2); border-top: 1px solid var(--line); }
  .cell[data-label]::before { content: attr(data-label); display: block; font-size: 0.6875rem; font-weight: 600; color: var(--ink-3); margin-bottom: 2px; }
  .game__open { display: grid; gap: 4px; width: 100%; font-size: var(--step-2); line-height: 1.15; }
  .game__open .team { display: grid; grid-template-columns: 1fr auto auto; gap: var(--space-2); align-items: baseline; }
  .team__pts { display: inline; font: 700 var(--step-2)/1 var(--font-display); }
  .team__rec { order: 2; }
  .team__pts { order: 3; min-width: 3.4ch; text-align: right; }
  .team--away .sep, .sep { display: none; }
  .team--home::before { content: none; }
  .game__open::before { content: none; }
  .cell--matchup .game__note { margin-top: 2px; }
  .team--away .team__name::after { content: ''; }
  .game.is-dead { background-image: none; opacity: 0.85; }
  .win__text { font-size: var(--step--1); }
  .cell--win .probbar { max-width: none; }
}
@media (max-width: 959px) and (min-width: 600px) {
  .slate { display: grid; grid-template-columns: 1fr 1fr; column-gap: var(--space-3); }
  .slate .dayhead { grid-column: 1 / -1; }
}

/* ---------- Placeholders and states ---------- */
.skeleton-slate { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-m); overflow: clip; }
.skeleton-row { display: grid; grid-template-columns: 150px 1fr 140px 120px; gap: var(--space-4); align-items: center; padding: 16px var(--space-4); border-bottom: 1px solid var(--line); }
.sk { height: 14px; border-radius: 4px; background: linear-gradient(90deg, var(--surface-2) 0 40%, var(--line) 50%, var(--surface-2) 60% 100%); background-size: 250% 100%; animation: shimmer 1.4s linear infinite; }
.sk--match { height: 20px; } .sk--time { width: 110px; }
@keyframes shimmer { from { background-position: 100% 0; } to { background-position: -100% 0; } }
@media (prefers-reduced-motion: reduce) { .sk { animation: none; } }
@media (max-width: 719px) { .skeleton-row { grid-template-columns: 1fr 90px; } .sk--cell:last-child { display: none; } }

.state-card { display: grid; justify-items: center; text-align: center; gap: var(--space-3); padding: var(--space-8) var(--space-5); background: var(--surface); border: 1px dashed var(--line-strong); border-radius: var(--radius-m); }
.state-card__icon { width: 52px; height: 52px; display: grid; place-items: center; border-radius: 50%; background: var(--surface-2); color: var(--ink-2); }
.state-card__icon svg { width: 26px; height: 26px; }
.state-card--bad .state-card__icon { background: var(--bad-bg); color: var(--bad-ink); }
.state-card__title { font: 700 var(--step-3)/1.1 var(--font-display); }
.state-card__body { color: var(--ink-2); max-width: 52ch; }
.state-card__actions { display: flex; gap: var(--space-2); flex-wrap: wrap; justify-content: center; margin-top: var(--space-2); }

@media (max-width: 959px) {
  .toolbar { position: static; margin-inline: 0; padding: 0 0 var(--space-3); border: 0; background: none; backdrop-filter: none; display: grid; gap: var(--space-2); }
  .search { max-width: none; flex-basis: auto; }
  .toolbar__filters { display: flex; gap: 6px; overflow-x: auto; margin-inline: calc(var(--gutter) * -1); padding-inline: var(--gutter); scrollbar-width: none; }
  .toolbar__filters > * { flex: none; }
  .toolbar .spacer, .count-line { display: none; }
  .dayhead { top: var(--header-h) !important; }
  .team__rec { order: 0; }
  .team__name { order: 0; }
  .game__open .team { grid-template-columns: 1.6em auto 1fr auto; justify-content: start; }
  .team--away::before { content: ''; }
  .team__pts { justify-self: end; }
  .team--home::before { content: attr(data-sep); font-weight: 600; color: var(--ink-3); font-size: var(--step-0); align-self: baseline; }
  .spread { flex-wrap: wrap; row-gap: 0; }
  .spread__team { white-space: normal; overflow: visible; }
  .win__team { white-space: normal; overflow: visible; }
  .game, .game:last-child { grid-template-columns: 1.6fr 0.55fr 1.25fr; }
  .hide-sm { display: none; }
}

/* ---------- Density (Wad 2026-11-12: tighter rows, more games on screen) ---------- */
.row--head { min-height: 32px; }
.game { min-height: 44px; padding-block: 5px; }
.game__open { font-size: var(--step-0); gap: 0 6px; }
.cell--kickoff { gap: 2px; }
.cell--matchup { gap: 0; }
.cell--win { gap: 3px; }
.win__text { font-size: var(--step--1); }
.probbar { height: 6px; }
.dayhead { padding: 6px var(--space-4) 4px; }
.dayhead h2 { font-size: var(--step-0); }
.game.is-nolink { cursor: default; }
.game.is-nolink:hover { background: transparent; }
.game.is-nolink .team__name.is-lead { font-weight: 700; }
.game__open--static { cursor: default; }
/* Phones: one compact line per game (no boxes). Kickoff on top; matchup, spread and win % side by side. */
@media (max-width: 959px) {
  .slate { display: block; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-m); overflow: hidden; }
  .game, .game:last-child {
    grid-template-columns: minmax(0, 1fr) auto 76px; grid-template-areas: 'kick kick kick' 'match spread win';
    gap: 0 var(--space-3); padding: 6px var(--space-3); margin: 0; border: 0; border-bottom: 1px solid var(--line); border-radius: 0; background: transparent;
  }
  .game:last-child { border-bottom: 0; }
  .cell--total, .cell--score, .cell--market, .cell--edge { display: none; }
  .cell--spread, .cell--total, .cell--win { padding-top: 0; border-top: 0; }
  .cell[data-label]::before { content: none; }
  .cell--kickoff { gap: 6px; justify-content: flex-start; }
  .kick__time { font-size: 0.75rem; }
  .cell--kickoff .chip { min-height: 20px; padding: 0 6px; font-size: 0.6875rem; }
  .game__open { display: grid; gap: 0; font-size: var(--step-0); line-height: 1.25; }
  .game__open .team { display: flex; gap: 6px; }
  .team__pts, .team__rec { display: none; }
  .cell--spread { text-align: right; }
  .spread { justify-content: flex-end; font-size: var(--step--1); }
  .win__text { font-size: 0.75rem; justify-content: flex-end; }
  .win__team { display: none; }
  .cell--win .probbar { max-width: none; height: 4px; }
  .dayhead { position: static; padding: 6px var(--space-3) 4px; background: var(--surface-sunk); border-bottom: 1px solid var(--line); }
  .dayhead h2 { font-size: var(--step--1); }
}
@media (max-width: 959px) and (min-width: 600px) {
  .slate { display: block; }
}
/* Desktop: kickoff time and status chip share one line. */
@media (min-width: 960px) {
  .game .cell--kickoff { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 6px; }
  .game .cell--kickoff .chip { min-height: 22px; padding: 0 7px; font-size: 0.75rem; }
}
