/* Friday Night Lights — Central Texas
   Mobile first. The page is the dark stadium surround; every matchup is a lit
   panel, the way the field is the only bright thing for a mile at 7pm. */

:root {
  --night:    #0E1418;
  --stand:    #18222A;
  --stand-up: #26343E;
  --lit:      #F2F0E6;
  --lit-edge: #DBDDCE;
  --ink:      #121A14;
  --ink-soft: #5A655E;
  --dim:      #93A3AD;
  --dim-deep: #63727C;
  --halide:   #FFCF6B;
  --flag:     #E0654A;

  --pad: 16px;
  --radius: 5px;
}

* { box-sizing: border-box; }

/* Class rules like `.toolbar { display: grid }` outrank the UA sheet's
   `[hidden] { display: none }`, so state it explicitly. */
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--night);
  color: var(--dim);
  font-family: 'Instrument Sans', system-ui, -apple-system, sans-serif;
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

.wrap { max-width: 1180px; margin: 0 auto; padding: 0 var(--pad); }

.display {
  font-family: 'Big Shoulders Display', 'Instrument Sans', sans-serif;
  font-weight: 800; text-transform: uppercase;
  line-height: .86; letter-spacing: .005em; margin: 0;
}
.mono, .eyebrow { font-family: 'Martian Mono', ui-monospace, monospace; }
.eyebrow {
  font-size: 9.5px; letter-spacing: .16em; text-transform: uppercase;
  color: var(--dim-deep); margin: 0;
}

/* ------------------------------------------------------------ masthead */
.masthead { padding: 22px 0 16px; }
.masthead h1 { font-size: clamp(38px, 11.5vw, 116px); color: var(--lit); margin-top: 8px; }
.masthead h1 em { font-style: normal; color: var(--halide); }
.lede { max-width: 54ch; margin: 12px 0 0; font-size: 13.5px; line-height: 1.45; }

/* ------------------------------------------------------------ week bar */
.weekbar {
  position: sticky; top: 0; z-index: 20;
  background: rgba(14, 20, 24, .94);
  backdrop-filter: blur(10px);
  border-block: 1px solid var(--stand-up);
}
.rail {
  display: flex; gap: 6px; overflow-x: auto;
  padding: 10px 0; scrollbar-width: none;
}
.rail::-webkit-scrollbar { display: none; }
.wk {
  flex: 0 0 auto; cursor: pointer; text-align: left;
  background: transparent; color: var(--dim);
  border: 1px solid var(--stand-up); border-radius: var(--radius);
  padding: 8px 12px;
  font-family: 'Martian Mono', monospace; font-size: 9px; letter-spacing: .04em;
}
.wk b { display: block; font-size: 11.5px; font-weight: 600; color: var(--lit); letter-spacing: 0; }
.wk[aria-pressed="true"] { background: var(--halide); border-color: var(--halide); color: #4A3308; }
.wk[aria-pressed="true"] b { color: #221802; }

/* ------------------------------------------------------------- toolbar */
/* One field per row on phones: stadium names like "Kelly Reeves Athletic
   Complex — 2 games" have no chance in a half-width select. */
.toolbar {
  display: grid; grid-template-columns: 1fr; gap: 10px;
  margin: 20px 0 0;
}
.field-label { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.field-label > span {
  font-family: 'Martian Mono', monospace; font-size: 9px;
  letter-spacing: .14em; text-transform: uppercase; color: var(--dim-deep);
}
.picker {
  width: 100%; padding: 11px 12px;
  text-overflow: ellipsis;
  background: var(--stand); color: var(--lit);
  border: 1px solid var(--stand-up); border-radius: var(--radius);
  font-family: 'Instrument Sans', sans-serif; font-size: 14px;
  appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, var(--dim) 50%),
                    linear-gradient(135deg, var(--dim) 50%, transparent 50%);
  padding-right: 34px;
  background-position: right 15px center, right 10px center;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
}
.toolbar-actions { grid-column: 1 / -1; display: flex; gap: 8px; }

.btn {
  flex: 1; text-align: center; text-decoration: none;
  font-family: 'Martian Mono', monospace;
  font-size: 9.5px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase;
  padding: 12px 10px; border-radius: var(--radius); cursor: pointer;
  border: 1px solid var(--stand-up); background: var(--stand); color: var(--lit);
}
.btn:hover { border-color: var(--halide); color: var(--halide); }
.btn[aria-pressed="true"] { background: var(--halide); border-color: var(--halide); color: #221802; }

.linkish {
  background: none; border: 0; padding: 0; cursor: pointer;
  color: var(--halide); font: inherit; font-size: 13px;
  border-bottom: 1px solid rgba(255, 207, 107, .35);
}

.summary {
  margin: 18px 0 0; font-family: 'Martian Mono', monospace;
  font-size: 10px; letter-spacing: .1em; text-transform: uppercase; color: var(--dim-deep);
}

:focus-visible { outline: 2px solid var(--halide); outline-offset: 2px; }

/* ---------------------------------------------------------- scoreboard */
.slate { display: grid; gap: 12px; margin: 14px 0 0; }

.stadium-head {
  display: flex; justify-content: space-between; align-items: baseline;
  gap: 12px; flex-wrap: wrap; margin: 26px 0 -2px; padding-bottom: 8px;
  border-bottom: 1px solid var(--stand-up);
}
.stadium-head h2 {
  font-family: 'Big Shoulders Display', sans-serif; font-weight: 800;
  text-transform: uppercase; font-size: 24px; letter-spacing: .01em;
  color: var(--lit); margin: 0; line-height: 1;
}
.stadium-head .where { font-size: 12.5px; color: var(--dim-deep); margin: 5px 0 0; }
.stadium-head .go {
  font-family: 'Martian Mono', monospace; font-size: 9px; letter-spacing: .1em;
  text-transform: uppercase; text-decoration: none; white-space: nowrap;
  color: var(--halide); border: 1px solid var(--stand-up); border-radius: var(--radius);
  padding: 7px 10px;
}
.stadium-head .go:hover { border-color: var(--halide); }

/* --- the matchup card ------------------------------------------------ */
.game {
  display: flex; flex-direction: column;
  background: var(--lit); color: var(--ink);
  border-radius: var(--radius); overflow: hidden;
  box-shadow: 0 0 0 1px var(--lit-edge), 0 14px 34px -24px rgba(255, 207, 107, .4);
  animation: rise .34s ease both;
}
@keyframes rise { from { opacity: 0; transform: translateY(8px); } }

.game-top {
  display: flex; justify-content: space-between; align-items: center; gap: 10px;
  padding: 9px 14px; background: #E7E5D9; border-bottom: 1px solid var(--lit-edge);
  font-family: 'Martian Mono', monospace; font-size: 9.5px;
  letter-spacing: .1em; text-transform: uppercase; color: var(--ink-soft);
}
.game-top .badges { display: flex; gap: 5px; flex-wrap: wrap; justify-content: flex-end; }
.badge { white-space: nowrap; }
.badge.live { color: #B3401F; font-weight: 600; }
.badge.warn { color: #A8451F; }
.badge.ok { color: #2F6B45; }

.teams { padding: 4px 0; }
.team {
  display: grid; grid-template-columns: 1fr auto; align-items: center;
  gap: 12px; padding: 10px 14px;
}
.team + .team { border-top: 1px solid rgba(0, 0, 0, .06); }
.team .name { font-size: 17px; font-weight: 500; color: var(--ink); line-height: 1.2; }
.team .name .mascot {
  display: block; font-size: 11px; color: var(--ink-soft); font-weight: 400;
  letter-spacing: .04em; margin-top: 1px;
}
.team .score {
  font-family: 'Martian Mono', monospace; font-size: 21px; font-weight: 600;
  color: var(--ink-soft); min-width: 2.2ch; text-align: right;
}
.team.won .name { font-weight: 700; }
.team.won .score { color: var(--ink); }
.team.won .score::after {
  content: '◂'; margin-left: 7px; color: var(--flag); font-size: 15px;
}
.team.lost .name, .team.lost .score { opacity: .62; }

/* pre-game: the kickoff time takes the place of the score column */
.kickoff {
  font-family: 'Martian Mono', monospace; text-align: right; white-space: nowrap;
}
.kickoff b { display: block; font-size: 16px; font-weight: 600; color: var(--ink); }
.kickoff span { font-size: 9px; letter-spacing: .12em; text-transform: uppercase; color: var(--ink-soft); }
.teams.pre {
  display: grid; grid-template-columns: 1fr auto;
  align-items: center; column-gap: 14px; padding: 8px 14px 12px;
}
.teams.pre .team { grid-column: 1; padding: 7px 0; border: 0; }
.teams.pre .team:nth-of-type(1) { grid-row: 1; }
.teams.pre .team:nth-of-type(2) { grid-row: 2; border-top: 1px solid rgba(0, 0, 0, .06); }
.teams.pre .kickoff { grid-column: 2; grid-row: 1 / 3; }

.game-foot {
  margin-top: auto;
  display: flex; justify-content: space-between; align-items: center; gap: 10px;
  padding: 10px 14px; border-top: 1px solid var(--lit-edge); background: #EDEBDF;
}
.game-foot .site { font-size: 12.5px; color: var(--ink-soft); min-width: 0; }
.game-foot .site b { color: var(--ink); font-weight: 600; }
.game-foot a {
  font-family: 'Martian Mono', monospace; font-size: 9px; letter-spacing: .1em;
  text-transform: uppercase; text-decoration: none; white-space: nowrap;
  color: var(--ink); border: 1px solid var(--ink); border-radius: 4px; padding: 6px 9px;
}
.game-foot a:hover { background: var(--ink); color: var(--lit); }

.caution {
  margin: 0; padding: 9px 14px; background: #F6E2D6;
  border-top: 1px solid #E5C6B4; color: #8A3F22; font-size: 12.5px; line-height: 1.4;
}

/* ------------------------------------------------------------- notices */
.notice {
  margin-top: 20px; padding: 16px 18px;
  border: 1px solid var(--stand-up); border-left: 3px solid var(--halide);
  border-radius: var(--radius); background: var(--stand); font-size: 14px;
}
.notice strong { color: var(--lit); display: block; margin-bottom: 3px; }
.notice.quiet { border-left-color: var(--dim-deep); }

/* ----------------------------------------------------------- directory */
/* A reference table, not part of the nightly question -- closed by default so
   the page ends at the games. */
.dir { margin-top: 48px; padding-top: 24px; border-top: 1px solid var(--stand-up); }
.dir > summary {
  display: flex; align-items: baseline; justify-content: space-between;
  gap: 12px; flex-wrap: wrap; cursor: pointer; list-style: none;
  padding: 4px 0;
}
.dir > summary::-webkit-details-marker { display: none; }
.dir-title {
  font-family: 'Big Shoulders Display', sans-serif; font-weight: 800;
  text-transform: uppercase; font-size: clamp(22px, 6vw, 32px);
  color: var(--lit); line-height: 1;
}
.dir-hint {
  font-family: 'Martian Mono', monospace; font-size: 9.5px;
  letter-spacing: .1em; text-transform: uppercase; color: var(--dim-deep);
}
/* The chevron sits with the title rather than at the far edge, so the whole
   thing reads as one control instead of a heading with a stray hint. */
.dir-head { display: flex; align-items: center; gap: 12px; min-width: 0; }
.chev {
  flex: 0 0 auto; width: 9px; height: 9px;
  border-right: 2px solid var(--halide);
  border-bottom: 2px solid var(--halide);
  transform: rotate(45deg) translate(-2px, -2px);
  transition: transform .2s ease;
}
.dir[open] .chev { transform: rotate(-135deg) translate(-2px, -2px); }
.dir > summary:hover .dir-title,
.dir > summary:focus-visible .dir-title { color: var(--halide); }
.dir > summary:hover .chev { border-color: var(--lit); }
.dir[open] > summary { margin-bottom: 14px; }
.dir p.note { max-width: 64ch; margin: 8px 0 18px; font-size: 14px; }
.search {
  width: 100%; padding: 12px 14px;
  background: var(--stand); color: var(--lit);
  border: 1px solid var(--stand-up); border-radius: var(--radius);
  font-family: 'Instrument Sans', sans-serif; font-size: 14px;
}
.search::placeholder { color: var(--dim-deep); }
.dirgrid { margin-top: 18px; border-top: 1px solid var(--stand-up); }
.drow {
  display: grid; grid-template-columns: 1fr auto; gap: 4px 14px;
  padding: 12px 2px; border-bottom: 1px solid var(--stand-up); font-size: 14px;
}
.drow .school { color: var(--lit); font-weight: 600; }
.drow .venue { grid-column: 1 / -1; color: var(--dim); font-size: 13px; }
.drow .venue a { color: var(--halide); text-decoration: none; border-bottom: 1px solid rgba(255,207,107,.3); }
.drow .grp {
  font-family: 'Martian Mono', monospace; font-size: 9px;
  color: var(--dim-deep); text-align: right; letter-spacing: .04em;
}

footer {
  margin: 56px 0 0; padding: 24px 0 60px; border-top: 1px solid var(--stand-up);
  font-size: 12.5px; color: var(--dim-deep); max-width: 72ch;
}

/* ------------------------------------------------------------ >= 600px */
@media (min-width: 600px) {
  :root { --pad: 28px; }
  .masthead { padding: 52px 0 30px; }
  .lede { font-size: 16px; margin-top: 16px; }
  .lede { font-size: 16px; }
  .toolbar { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr) auto; align-items: end; }
  .toolbar-actions { grid-column: auto; }
  .btn { flex: 0 0 auto; }
  .slate { grid-template-columns: repeat(2, 1fr); }
  .stadium-head { margin-top: 34px; }
  .drow { grid-template-columns: 1.1fr 1.5fr auto; align-items: baseline; }
  .drow .venue { grid-column: auto; }
}

/* ------------------------------------------------------------ >= 980px */
@media (min-width: 980px) {
  .slate { grid-template-columns: repeat(3, 1fr); }
  .masthead h1 { font-size: 116px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  html { scroll-behavior: auto; }
}

/* ------------------------------------------------------- team schedule */
.teamlink {
  background: none; border: 0; padding: 0; margin: 0;
  font: inherit; color: inherit; cursor: pointer; text-align: left;
  border-bottom: 1px solid rgba(0, 0, 0, .18);
}
.teamlink:hover { border-bottom-color: currentColor; }
.drow .teamlink { color: var(--lit); border-bottom-color: rgba(147, 163, 173, .35); }

.back {
  background: none; border: 1px solid var(--stand-up); border-radius: var(--radius);
  color: var(--dim); cursor: pointer; margin: 18px 0 0; padding: 9px 13px;
  font-family: 'Martian Mono', monospace; font-size: 9.5px;
  letter-spacing: .1em; text-transform: uppercase;
}
.back:hover { border-color: var(--halide); color: var(--halide); }

.teamhead { margin: 20px 0 6px; }
.teamhead h2 { font-size: clamp(40px, 12vw, 76px); color: var(--lit); margin: 6px 0 0; }
.teammeta {
  display: flex; flex-wrap: wrap; gap: 8px 14px; margin: 12px 0 0;
  font-family: 'Martian Mono', monospace; font-size: 10px;
  letter-spacing: .1em; text-transform: uppercase; color: var(--dim-deep);
}
.teammeta .rec { color: var(--halide); }
.teamhome { margin: 12px 0 0; font-size: 14px; color: var(--dim); }
.teamhome .go { color: var(--halide); text-decoration: none; border-bottom: 1px solid rgba(255,207,107,.35); }
.teamhome .unsure { color: var(--flag); }
.teamhead .caution {
  margin: 12px 0 0; padding: 10px 12px; background: rgba(224,101,74,.1);
  border-left: 2px solid var(--flag); color: #E8A38F; font-size: 13px; border-radius: 0 3px 3px 0;
}

.season { list-style: none; margin: 26px 0 0; padding: 0; }
.srow {
  display: grid; grid-template-columns: 1fr auto; gap: 4px 14px;
  padding: 14px 0; border-top: 1px solid var(--stand-up); align-items: baseline;
}
.srow:last-child { border-bottom: 1px solid var(--stand-up); }
.sdate {
  grid-column: 1; font-family: 'Martian Mono', monospace; font-size: 9.5px;
  letter-spacing: .1em; color: var(--dim-deep);
}
.sopp { grid-column: 1; grid-row: 2; font-size: 18px; color: var(--lit); }
.sopp em { font-style: normal; color: var(--dim-deep); font-size: 13px; margin-right: 5px; }
.sopp .teamlink { color: var(--lit); border-bottom-color: rgba(147,163,173,.35); }
.smarks {
  display: block; font-family: 'Martian Mono', monospace; font-size: 9px;
  letter-spacing: .08em; text-transform: uppercase; color: var(--dim-deep); margin-top: 4px;
}
.sres {
  grid-column: 2; grid-row: 1 / 3; align-self: center; text-align: right;
  font-family: 'Martian Mono', monospace; white-space: nowrap;
}
.sres .out { font-weight: 600; margin-right: 7px; }
.sres .out.w { color: #6FBF8B; }
.sres .out.l { color: var(--flag); }
.sres .out.t { color: var(--dim); }
.sres .line { font-size: 16px; color: var(--lit); }
.ssite { grid-column: 1 / -1; grid-row: 3; margin-top: 4px; font-size: 12.5px; }
.ssite a { color: var(--dim); text-decoration: none; border-bottom: 1px solid var(--stand-up); }
.ssite a:hover { color: var(--halide); border-bottom-color: var(--halide); }

@media (min-width: 600px) {
  .srow { grid-template-columns: 130px 1fr auto; }
  .sdate { grid-column: 1; grid-row: 1; align-self: center; }
  .sopp { grid-column: 2; grid-row: 1; }
  .sres { grid-column: 3; grid-row: 1; }
  .ssite { grid-column: 2 / -1; grid-row: 2; margin-top: 2px; }
}

.build {
  font-family: 'Martian Mono', monospace; font-size: 9.5px;
  letter-spacing: .1em; color: var(--dim-deep); margin-top: 10px;
}

