/* D2 Scoreboard
   Chalk-and-turf palette; the linescore table is the one loud element and
   everything else stays quiet around it. */

:root {
  --chalk: #F3F4EF;
  --paper: #FFFFFF;
  --ink: #14211B;
  --ink-soft: #3C4A42;
  --muted: #66716B;
  --hair: #D5DAD3;
  --turf: #1E5A38;
  --turf-deep: #123C26;
  --turf-tint: #E4EDE6;
  --signal: #E4B400;
  --redzone: #B7351F;
  --display: "Barlow Semi Condensed", "Arial Narrow", "Roboto Condensed", sans-serif;
  --body: "Barlow", "Segoe UI", system-ui, sans-serif;
  --radius: 2px;
  --wrap: 1180px;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--chalk); color: var(--ink);
  font: 16px/1.45 var(--body);
  font-variant-numeric: tabular-nums;
}
a { color: var(--turf-deep); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 2px; }
:focus-visible { outline: 2px solid var(--signal); outline-offset: 2px; }
h1, h2, h3 { font-family: var(--display); font-weight: 600; line-height: 1.1; margin: 0; letter-spacing: 0; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 16px; }

/* Masthead */
.masthead { background: var(--turf); color: var(--chalk); border-bottom: 3px solid var(--turf-deep); }
.masthead-row { display: flex; align-items: center; gap: 20px; min-height: 56px; flex-wrap: wrap; padding-top: 6px; padding-bottom: 6px; }
.wordmark { font-family: var(--display); font-weight: 700; font-size: 26px; color: #fff; letter-spacing: .01em; line-height: 1; }
.wordmark span { font-weight: 500; opacity: .85; }
.wordmark:hover { text-decoration: none; }
.nav { display: flex; gap: 4px; }
.nav a { color: var(--chalk); padding: 6px 10px; border-radius: var(--radius); font-weight: 500; }
.nav a[aria-current] { background: var(--turf-deep); color: #fff; }
.nav a:hover { text-decoration: none; background: rgba(255,255,255,.12); }
.search { margin-left: auto; display: flex; }
.search input {
  font: inherit; padding: 6px 10px; border: 1px solid var(--turf-deep); border-right: 0;
  border-radius: var(--radius) 0 0 var(--radius); width: 200px; max-width: 50vw; background: #fff; color: var(--ink);
}
.search button {
  font: inherit; font-weight: 600; padding: 6px 12px; border: 1px solid var(--turf-deep);
  background: var(--turf-deep); color: #fff; border-radius: 0 var(--radius) var(--radius) 0; cursor: pointer;
}

main { padding-top: 18px; padding-bottom: 32px; }

/* Day picker */
.dayline { margin-bottom: 14px; }
.daynav { display: flex; align-items: baseline; gap: 16px; }
.daynav h1 { font-size: 30px; flex: 1; }
.daystep { font-weight: 500; color: var(--turf-deep); padding: 4px 0; }
.daystep.is-off { color: var(--muted); opacity: .5; }
.days { list-style: none; margin: 8px 0 0; padding: 0; display: flex; gap: 6px; overflow-x: auto; scrollbar-width: thin; }
.days a {
  display: block; padding: 6px 12px; border: 1px solid var(--hair); background: var(--paper);
  border-radius: var(--radius); white-space: nowrap; line-height: 1.2;
}
.days a:hover { text-decoration: none; border-color: var(--turf); }
.days a[aria-current] { background: var(--turf); border-color: var(--turf); color: #fff; }
.days-date { display: block; font-family: var(--display); font-weight: 600; font-size: 17px; }
.days-count { display: block; font-size: 12px; opacity: .8; }

/* Board header + filter */
.board-head { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; margin-bottom: 12px; }
.summary { margin: 0; color: var(--ink-soft); flex: 1; }
.filter { display: flex; align-items: center; gap: 8px; }
.filter label { color: var(--muted); font-size: 14px; }
.filter select { font: inherit; padding: 5px 8px; border: 1px solid var(--hair); background: var(--paper); border-radius: var(--radius); max-width: 60vw; }

/* The grid */
.board { display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(min(330px, 100%), 1fr)); }
.game { background: var(--paper); border: 1px solid var(--hair); border-radius: var(--radius); display: flex; flex-direction: column; min-width: 0; }
.game.is-live { border-color: var(--signal); box-shadow: inset 3px 0 0 var(--signal); }
.game-foot {
  display: flex; justify-content: space-between; gap: 10px; padding: 6px 12px 7px;
  border-top: 1px solid var(--hair); font-size: 13px; color: var(--muted); background: var(--chalk);
}
.game-foot:hover { text-decoration: none; background: var(--turf-tint); color: var(--turf-deep); }
.game-foot .state { font-weight: 600; color: var(--ink-soft); white-space: nowrap; }
.is-live .game-foot .state { color: #8a6d00; }
.game-foot .where { min-width: 0; text-align: right; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.game-foot .venue::before { content: ", "; }
.empty { color: var(--muted); padding: 32px 0; grid-column: 1 / -1; }

/* Linescore: the one loud element */
.linescore { width: 100%; border-collapse: collapse; table-layout: fixed; font-family: var(--display); }
.linescore th, .linescore td { padding: 5px 4px; text-align: right; white-space: nowrap; }
.linescore thead th { font-weight: 500; font-size: 12px; color: var(--muted); padding-top: 6px; padding-bottom: 0; border-bottom: 1px solid var(--hair); }
.linescore .team { text-align: left; font-weight: 500; font-size: 17px; padding-left: 12px; overflow: hidden; text-overflow: ellipsis; }
.linescore .team a { color: inherit; }
.linescore .q { width: 2.3em; font-size: 15px; font-weight: 500; color: var(--ink-soft); }
.linescore .total { width: 3.1em; font-size: 22px; font-weight: 700; padding-right: 12px; padding-left: 8px; border-left: 1px solid var(--hair); }
.linescore tbody tr + tr th, .linescore tbody tr + tr td { border-top: 1px dotted var(--hair); }
.linescore tr.won .team, .linescore tr.won .total { color: var(--ink); }
.linescore tr.lost .team, .linescore tr.lost .total, .linescore tr.lost .q { color: var(--muted); font-weight: 500; }
.linescore tr.won .total { font-weight: 700; }
.linescore.big .team { font-size: 20px; }
.linescore.big .total { font-size: 26px; }
.ball { display: inline-block; width: 9px; height: 9px; margin-left: 6px; background: var(--signal); border-radius: 50%; vertical-align: middle; }

.live-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--signal); margin-right: 6px; vertical-align: 1px; animation: pulse 1.6s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .3; } }
@media (prefers-reduced-motion: reduce) { .live-dot { animation: none; } }

/* Game page */
.crumb { margin: 0 0 10px; color: var(--muted); font-size: 14px; }
.crumb a + a::before { content: "/ "; color: var(--hair); margin: 0 4px 0 2px; }
.matchup { background: var(--paper); border: 1px solid var(--hair); border-radius: var(--radius); padding: 6px 0 0; margin-bottom: 14px; }
.matchup.is-live { border-color: var(--signal); }
.side { display: grid; grid-template-columns: auto 1fr auto; grid-template-rows: auto auto; align-items: center; padding: 10px 18px; column-gap: 14px; }
.side-logo { grid-row: 1 / span 2; width: 48px; height: 48px; object-fit: contain; }
.side-name, .side-rec { grid-column: 2; }
.side + .side { border-top: 1px dotted var(--hair); }
.side-name { font-family: var(--display); font-weight: 600; font-size: 28px; color: var(--ink); grid-row: 1; line-height: 1.05; }
.side-rec { grid-row: 2; font-size: 13px; color: var(--muted); }
.side-score { grid-column: 3; grid-row: 1 / span 2; font-family: var(--display); font-weight: 700; font-size: 56px; line-height: 1; min-width: 1.4em; text-align: right; }
.side.lost .side-name, .side.lost .side-score { color: var(--muted); }
.side.lost .side-score { font-weight: 600; }
.matchup-state { margin: 0; padding: 8px 18px 10px; border-top: 1px solid var(--hair); background: var(--chalk); font-weight: 600; color: var(--ink-soft); }

.panel { background: var(--paper); border: 1px solid var(--hair); border-radius: var(--radius); padding: 14px 18px 16px; margin-bottom: 14px; }
.panel h2 { font-size: 20px; margin-bottom: 10px; }
.facts dl { display: grid; grid-template-columns: max-content 1fr; gap: 6px 20px; margin: 0; }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; }
.aside { color: var(--muted); }
.plays { list-style: none; margin: 0; padding: 0; }
.plays li { display: grid; grid-template-columns: 5.5em 9em 1fr; gap: 12px; padding: 6px 0; border-top: 1px dotted var(--hair); }
.plays li:first-child { border-top: 0; }
.play-when { color: var(--muted); font-family: var(--display); font-weight: 500; }
.play-who { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Schools */
.page-title { font-size: 30px; margin-bottom: 8px; }
.lede { max-width: 66ch; color: var(--ink-soft); margin: 0 0 18px; }
.jump { display: flex; flex-wrap: wrap; gap: 4px 14px; margin-bottom: 20px; font-size: 14px; }
.conf { margin-bottom: 22px; }
.conf h2 { font-size: 22px; padding-bottom: 6px; border-bottom: 2px solid var(--turf); margin-bottom: 8px; display: flex; align-items: baseline; gap: 10px; }
.conf h2 .count, .school-list .count { font-family: var(--body); font-weight: 400; font-size: 14px; color: var(--muted); }
.conf .board { margin-top: 10px; }
.school-list { list-style: none; margin: 0; padding: 0; columns: 3; column-gap: 24px; }
.school-list.wide { columns: 2; }
.school-list li { break-inside: avoid; display: flex; justify-content: space-between; gap: 10px; padding: 4px 0; border-bottom: 1px dotted var(--hair); }
.chips { list-style: none; margin: 0 0 18px; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.chips a { display: inline-block; padding: 4px 10px; border: 1px solid var(--hair); background: var(--paper); border-radius: var(--radius); font-size: 14px; }
.chips a:hover { border-color: var(--turf); text-decoration: none; }

.school-head { margin-bottom: 14px; }
.school-head h1 { font-size: 34px; }
.record { margin: 4px 0 0; color: var(--ink-soft); }
.record strong { font-family: var(--display); font-size: 22px; font-weight: 700; color: var(--ink); }
.school-meta { margin: 4px 0 0; color: var(--muted); font-size: 14px; display: flex; gap: 16px; flex-wrap: wrap; }

.results { width: 100%; border-collapse: collapse; }
.results th, .results td { text-align: left; padding: 7px 8px; border-bottom: 1px solid var(--hair); }
.results th { font-weight: 500; color: var(--muted); font-size: 13px; }
.results .num { text-align: right; font-family: var(--display); font-size: 17px; white-space: nowrap; }
.results .num a { color: var(--ink); }
.outcome { display: inline-block; min-width: 1.4em; text-align: center; font-weight: 700; border-radius: var(--radius); padding: 0 4px; margin-right: 4px; }
.outcome.W { background: var(--turf-tint); color: var(--turf-deep); }
.outcome.L { background: #F3E4E1; color: var(--redzone); }
.outcome.T { background: var(--chalk); color: var(--muted); }

/* Footer */
.foot { color: var(--muted); font-size: 13px; padding-top: 18px; padding-bottom: 28px; border-top: 1px solid var(--hair); max-width: var(--wrap); }
.foot p { margin: 4px 0; max-width: 80ch; }

@media (max-width: 720px) {
  .masthead-row { gap: 10px; }
  .search { width: 100%; margin-left: 0; }
  .search input { width: 100%; max-width: none; }
  .daynav h1 { font-size: 24px; }
  .board { grid-template-columns: minmax(0, 1fr); }
  .school-list, .school-list.wide { columns: 1; }
  .side-name { font-size: 22px; }
  .side-score { font-size: 44px; }
  .facts dl { grid-template-columns: 1fr; gap: 2px; }
  .facts dt { margin-top: 8px; font-size: 13px; }
  .plays li { grid-template-columns: 4.5em 1fr; }
  .play-what { grid-column: 1 / -1; }
}

/* Logos and division tags */
.logo { display: inline-block; vertical-align: middle; object-fit: contain; border-radius: 2px; background: #fff; }
.linescore .team .logo { width: 22px; height: 22px; margin-right: 8px; }
.logo-blank { width: 22px; height: 22px; background: var(--chalk); border: 1px dashed var(--hair); }
.div-tag { font-family: var(--body); font-size: 11px; font-weight: 600; color: var(--muted); border: 1px solid var(--hair); border-radius: var(--radius); padding: 0 4px; margin-left: 6px; vertical-align: 2px; }
.tier { font-family: var(--body); font-weight: 500; font-size: 11px; color: var(--muted); border: 1px solid var(--hair); border-radius: var(--radius); padding: 0 4px; margin-left: 4px; }

.school-grid { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; grid-template-columns: repeat(auto-fill, minmax(min(250px, 100%), 1fr)); }
.school-tile { display: grid; grid-template-columns: 36px 1fr; grid-template-rows: auto auto; column-gap: 10px; align-items: center; padding: 6px 8px; background: var(--paper); border: 1px solid var(--hair); border-radius: var(--radius); color: var(--ink); min-width: 0; }
.school-tile:hover { text-decoration: none; border-color: var(--turf); }
.school-tile .logo, .school-tile .logo-blank { grid-row: 1 / span 2; width: 36px; height: 36px; }
.tile-name { font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tile-rec { font-family: var(--display); font-size: 14px; color: var(--muted); }
.others { margin-top: 32px; padding-top: 18px; border-top: 2px solid var(--hair); }
.others-title { font-size: 24px; margin-bottom: 6px; }
.others .conf h3 { font-size: 18px; padding-bottom: 4px; border-bottom: 1px solid var(--hair); margin-bottom: 8px; color: var(--ink-soft); }

.school-head.has-logo { display: grid; grid-template-columns: 72px 1fr; column-gap: 16px; align-items: start; }
.school-logo { width: 72px; height: 72px; object-fit: contain; background: #fff; border: 1px solid var(--hair); border-radius: var(--radius); padding: 4px; }
.div-pill { display: inline-block; padding: 1px 8px; border-radius: 10px; background: var(--chalk); border: 1px solid var(--hair); color: var(--ink-soft); }
.div-pill.is-d2 { background: var(--turf-tint); border-color: var(--turf-tint); color: var(--turf-deep); }
.where-cell { color: var(--muted); font-size: 14px; }
