/* Friday Night. Stadium-board navy, field-chalk pages, scoreboard-lamp amber
   used in one place only: the score digits on a game page. */

@font-face { font-family: "Barlow"; font-weight: 400; font-display: swap; src: url(/static/fonts/barlow-latin-400-normal.woff2) format("woff2"); }
@font-face { font-family: "Barlow"; font-weight: 500; font-display: swap; src: url(/static/fonts/barlow-latin-500-normal.woff2) format("woff2"); }
@font-face { font-family: "Barlow"; font-weight: 600; font-display: swap; src: url(/static/fonts/barlow-latin-600-normal.woff2) format("woff2"); }
@font-face { font-family: "Barlow Condensed"; font-weight: 600; font-display: swap; src: url(/static/fonts/barlow-condensed-latin-600-normal.woff2) format("woff2"); }
@font-face { font-family: "Barlow Condensed"; font-weight: 700; font-display: swap; src: url(/static/fonts/barlow-condensed-latin-700-normal.woff2) format("woff2"); }

:root {
  --field: #EEF1EC;
  --panel: #FFFFFF;
  --ink: #13233A;
  --ink-2: #56657A;
  --line: #DCE2DC;
  --turf: #1D6B3B;
  --turf-ink: #FFFFFF;
  --live: #C8102E;
  --lamp: #FFB81C;
  --board: #10203A;
  --board-ink: #FFFFFF;
  --board-ink-2: #A9B6C8;
  --chip-l: #8A96A6;
  --tabbar: 62px;
  --gutter: 16px;
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --field: #0A1322;
    --panel: #12203A;
    --ink: #EDF1F6;
    --ink-2: #9BAABB;
    --line: #22344F;
    --turf: #4CC07B;
    --turf-ink: #07121F;
    --live: #FF5468;
    --board: #060E1B;
    --chip-l: #4F5E73;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--field);
  color: var(--ink);
  font: 400 18px/1.4 "Barlow", system-ui, -apple-system, sans-serif;
  padding-bottom: calc(var(--tabbar) + env(safe-area-inset-bottom) + 24px);
  -webkit-tap-highlight-color: transparent;
}
a { color: inherit; }
img { display: block; }
:focus-visible { outline: 3px solid var(--lamp); outline-offset: 2px; border-radius: 6px; }

h1, h2, h3 { font-family: "Barlow Condensed", "Barlow", sans-serif; font-weight: 700; margin: 0; letter-spacing: .005em; }
.muted { color: var(--ink-2); }
.small { font-size: 15px; }
p { margin: 0 0 12px; }

/* ---------------------------------------------------------------- header band */

.top {
  background: var(--board);
  color: var(--board-ink);
  padding: calc(env(safe-area-inset-top) + 12px) var(--gutter) 14px;
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 56px;
}
.top { border-bottom-left-radius: 18px; border-bottom-right-radius: 18px; }
.top:has(+ .weeknav), .top:has(+ .scoreboard) { border-radius: 0; }
.top h1 { font-size: 26px; line-height: 1.1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.top-home h1 { font-size: 30px; }
.back {
  display: grid; place-items: center;
  width: 40px; height: 40px; margin-left: -10px;
  color: var(--board-ink); border-radius: 50%;
}
.back svg { width: 26px; height: 26px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }

.weeknav {
  background: var(--board);
  color: var(--board-ink);
  display: grid;
  grid-template-columns: 52px 1fr 52px;
  align-items: center;
  padding: 0 4px 12px;
  border-bottom-left-radius: 18px;
  border-bottom-right-radius: 18px;
}
.wk-arrow {
  display: grid; place-items: center; height: 48px;
  font: 600 34px/1 "Barlow Condensed", sans-serif; text-decoration: none; color: var(--board-ink-2);
}
.wk-label { text-align: center; }
.wk-label strong { display: block; font: 700 21px/1.1 "Barlow Condensed", sans-serif; }
.wk-label span { color: var(--board-ink-2); font-size: 15px; }

.subhead { margin: 10px var(--gutter) 0; color: var(--ink-2); }

/* ---------------------------------------------------------------- sections */

.block { margin: 20px var(--gutter) 0; }
.block-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin: 0 2px 8px; }
.block-head h2 { font-size: 22px; }
.block-head h2 a { text-decoration: none; }
.block-head h2 a::after { content: ""; display: inline-block; width: 8px; height: 8px; margin-left: 8px; border-right: 2.5px solid var(--ink-2); border-top: 2.5px solid var(--ink-2); transform: translateY(-3px) rotate(45deg); }
.block-note { color: var(--ink-2); font-size: 15px; }
.block-note a { color: var(--turf); }
h3.sub { font-size: 18px; margin: 14px 2px 6px; color: var(--ink-2); }

.list {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 14px;
  overflow: hidden;
}
.list > * + * { border-top: 1px solid var(--line); }

.footnote { margin: 24px var(--gutter) 0; color: var(--ink-2); font-size: 15px; }
.footnote a { color: var(--turf); }
.more { display: block; padding: 14px 4px; color: var(--turf); font-weight: 600; text-decoration: none; }

/* ---------------------------------------------------------------- game rows */

.game {
  display: grid;
  grid-template-columns: 1fr 86px;
  align-items: center;
  gap: 10px;
  padding: 10px 12px 10px 14px;
  text-decoration: none;
  min-height: 84px;
}
.game.is-live { box-shadow: inset 4px 0 0 var(--live); }
.lines { display: grid; gap: 6px; min-width: 0; }
.line {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr) auto 2.4ch;
  align-items: center;
  gap: 10px;
}
.line .name {
  font: 600 20px/1.15 "Barlow Condensed", "Barlow", sans-serif;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.line .rec { color: var(--ink-2); font-size: 14px; font-variant-numeric: tabular-nums; }
.line .score { font: 700 26px/1 "Barlow Condensed", sans-serif; text-align: right; font-variant-numeric: tabular-nums; }
.line.loser .name, .line.loser .score { color: var(--ink-2); font-weight: 600; }
.line.winner .score { color: var(--ink); }

.rank {
  display: inline-block; min-width: 1.4em; margin-right: 5px;
  font: 600 14px/1 "Barlow Condensed", sans-serif; color: var(--ink-2);
  font-variant-numeric: tabular-nums; vertical-align: 2px;
}
.fav-mark { display: inline-block; width: 14px; height: 14px; margin-left: 5px; vertical-align: 1px; }
.fav-mark svg { width: 14px; height: 14px; fill: var(--turf); }

.side { display: grid; justify-items: end; gap: 4px; text-align: right; border-left: 1px solid var(--line); padding-left: 10px; min-height: 58px; align-content: center; }
.status { display: grid; justify-items: end; line-height: 1.15; }
.status-main { font: 700 18px/1.1 "Barlow Condensed", sans-serif; display: inline-flex; align-items: center; gap: 6px; }
.status-sub { font-size: 15px; color: var(--ink-2); }
.status.live .status-main { color: var(--live); }
.status.live .status-sub { color: var(--ink); font-weight: 600; }
.status.pending .status-main { color: var(--live); font-weight: 600; }
.status.sched .status-main { color: var(--ink-2); font-weight: 600; }
.status.sched .status-sub { color: var(--ink); font-weight: 600; font-size: 16px; }
.status.canceled .status-main { color: var(--ink-2); text-decoration: line-through; }
.dot { width: 9px; height: 9px; border-radius: 50%; background: var(--live); animation: pulse 1.6s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .25; } }

.watch-chip svg { width: 18px; height: 18px; fill: var(--turf); }
.dist { font-size: 13px; color: var(--ink-2); }

.game.flash { animation: flash 1.4s ease-out; }
@keyframes flash { from { background: color-mix(in srgb, var(--lamp) 28%, var(--panel)); } to { background: var(--panel); } }

/* ---------------------------------------------------------------- logos */

.logo {
  --team: #56657A;
  position: relative;
  flex: none;
  display: grid; place-items: center;
  border-radius: 50%;
  background: var(--team);
  color: #fff;
  overflow: hidden;
}
.logo .initials { font: 700 11px/1 "Barlow Condensed", sans-serif; letter-spacing: .02em; }
.logo img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; background: #fff; }
.logo.sm { width: 28px; height: 28px; }
.logo.md { width: 40px; height: 40px; }
.logo.md .initials { font-size: 14px; }
.logo.lg { width: 56px; height: 56px; box-shadow: 0 0 0 3px rgba(255,255,255,.12); }
.logo.lg .initials { font-size: 19px; }
.logo.xl { width: 76px; height: 76px; }
.logo.xl .initials { font-size: 24px; }

/* ---------------------------------------------------------------- scoreboard (the one bold thing) */

.scoreboard {
  background: var(--board);
  color: var(--board-ink);
  display: grid;
  grid-template-columns: 1fr 92px 1fr;
  align-items: start;
  padding: 4px 10px 22px;
  border-bottom-left-radius: 20px;
  border-bottom-right-radius: 20px;
}
.sb-team { display: grid; justify-items: center; text-align: center; gap: 4px; min-width: 0; }
.sb-name { font: 700 21px/1.1 "Barlow Condensed", sans-serif; max-width: 100%; overflow-wrap: anywhere; margin-top: 6px; }
.sb-rec { color: var(--board-ink-2); font-size: 15px; min-height: 1.2em; }
.sb-score {
  font: 700 68px/1 "Barlow Condensed", sans-serif;
  color: var(--lamp);
  text-shadow: 0 0 22px rgba(255, 184, 28, .45);
  font-variant-numeric: tabular-nums;
  min-height: 68px;
  margin-top: 6px;
}
.sb-team.dim .sb-score { color: rgba(255, 184, 28, .55); text-shadow: none; }
.sb-team.dim .sb-name { color: var(--board-ink-2); }
.sb-mid { display: grid; justify-items: center; align-content: center; min-height: 160px; }
.sb-mid .status { justify-items: center; text-align: center; }
.sb-mid .status-main { font-size: 22px; color: var(--board-ink); }
.sb-mid .status.live .status-main { color: #FF6B7D; }
.sb-mid .status.pending .status-main { color: #FF6B7D; }
.sb-mid .status-sub { color: var(--board-ink-2); font-size: 17px; }
.sb-mid .status.live .status-sub { color: var(--board-ink); }
.sb-mid .status.sched .status-sub { color: var(--board-ink); font-size: 19px; }

.facts { margin: 16px var(--gutter) 0; display: grid; gap: 6px; }
.facts div { display: grid; grid-template-columns: 7.5em 1fr; gap: 10px; }
.facts dt { color: var(--ink-2); }
.facts dd { margin: 0; }
.block .facts { margin: 0 0 14px; }

.watch-link {
  display: grid; grid-template-columns: 36px 1fr auto; align-items: center; gap: 12px;
  padding: 12px 14px; text-decoration: none; min-height: 60px;
}
.watch-icon { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; background: var(--turf); }
.watch-icon svg { width: 18px; height: 18px; fill: var(--turf-ink); stroke: var(--turf-ink); stroke-width: 0; }
.watch-link:has(svg circle) .watch-icon svg { fill: none; stroke-width: 2; stroke-linecap: round; }
.watch-label { font-weight: 600; }
.watch-detail { color: var(--ink-2); font-size: 15px; }

.matchup { width: 100%; table-layout: fixed; border-collapse: collapse; background: var(--panel); border: 1px solid var(--line); border-radius: 14px; overflow: hidden; }
.matchup th, .matchup td { padding: 10px 10px; border-top: 1px solid var(--line); overflow-wrap: anywhere; }
.matchup thead th { border-top: 0; font: 700 18px/1.1 "Barlow Condensed", sans-serif; width: 29%; }
.matchup thead th:nth-child(2) { width: 42%; }
.matchup thead th:first-child { text-align: left; }
.matchup thead th:last-child { text-align: right; }
.matchup tbody th { font-weight: 500; color: var(--ink-2); font-size: 14px; text-align: center; overflow-wrap: normal; }
.matchup td.num { font: 600 20px/1.1 "Barlow Condensed", sans-serif; font-variant-numeric: tabular-nums; }
.matchup td.num:first-child { text-align: left; }
.matchup td.num:last-child { text-align: right; }
.chips { display: inline-flex; gap: 3px; }
.chip { display: inline-grid; place-items: center; width: 20px; height: 22px; border-radius: 4px; font: 700 13px/1 "Barlow Condensed", sans-serif; color: #fff; }
.chip.w { background: var(--turf); color: var(--turf-ink); }
.chip.l { background: var(--chip-l); }
.chip.t { background: var(--lamp); color: #13233A; }

.leaders .leader { display: grid; grid-template-columns: 8em 1fr auto; gap: 10px; padding: 10px 14px; align-items: baseline; }
.leader-stat { color: var(--ink-2); font-size: 15px; }
.leader-name { font-weight: 600; }
.leader-val { font: 700 20px/1 "Barlow Condensed", sans-serif; }

/* ---------------------------------------------------------------- teams */

.team-hero { display: grid; grid-template-columns: auto 1fr; gap: 14px; align-items: center; margin: 18px var(--gutter) 12px; }
.team-hero h1 { font-size: 30px; line-height: 1.05; }
.team-hero-meta { margin: 2px 0 0; color: var(--ink-2); }
.team-hero-meta a { color: var(--turf); font-weight: 600; text-decoration: none; }
.team-hero-record { margin: 6px 0 0; display: flex; gap: 16px; flex-wrap: wrap; }
.team-hero-record strong { font: 700 22px/1 "Barlow Condensed", sans-serif; }

.team-row { display: flex; align-items: center; gap: 10px; padding: 8px 10px 8px 14px; min-height: 64px; }
.team-link { flex: 1; min-width: 0; display: flex; align-items: center; gap: 12px; text-decoration: none; }
.team-text { display: grid; min-width: 0; }
.team-title { font: 600 20px/1.15 "Barlow Condensed", sans-serif; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mascot { color: var(--ink-2); font-weight: 600; }
.team-meta { color: var(--ink-2); font-size: 15px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.star-form { margin: 0; }
.team-hero + .star-form { margin: 0 var(--gutter); }
.star {
  display: inline-flex; align-items: center; gap: 6px;
  min-height: 44px; padding: 0 14px;
  border: 1.5px solid var(--turf); border-radius: 22px;
  background: transparent; color: var(--turf);
  font: 600 16px/1 "Barlow", sans-serif; cursor: pointer;
}
.star svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linejoin: round; }
.star[aria-pressed="true"] { background: var(--turf); color: var(--turf-ink); }
.star[aria-pressed="true"] svg { fill: currentColor; }
.team-row .star { padding: 0 12px; }
.team-row .star span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.team-row .star { width: 46px; justify-content: center; padding: 0; }

.byes { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; overflow: hidden; margin-top: 8px; }
.list + .byes { margin-top: 8px; }
.bye { display: flex; gap: 12px; align-items: center; padding: 12px 14px; text-decoration: none; color: var(--ink-2); }
.bye + .bye { border-top: 1px solid var(--line); }
.bye strong { color: var(--ink); }

.standings { width: 100%; border-collapse: collapse; background: var(--panel); border: 1px solid var(--line); border-radius: 14px; overflow: hidden; }
.standings th, .standings td { padding: 10px 12px; border-top: 1px solid var(--line); text-align: left; }
.standings thead th { border-top: 0; color: var(--ink-2); font-weight: 500; font-size: 15px; }
.standings td a { display: flex; align-items: center; gap: 10px; text-decoration: none; font: 600 19px/1.1 "Barlow Condensed", sans-serif; }
.standings .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.standings td.num { font: 600 19px/1 "Barlow Condensed", sans-serif; }

/* ---------------------------------------------------------------- rankings */

.chips-nav { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 14px; }
.chip-link {
  display: inline-flex; align-items: center; min-height: 40px; padding: 0 14px;
  border: 1.5px solid var(--line); border-radius: 20px; background: var(--panel);
  font: 600 16px/1 "Barlow Condensed", sans-serif; text-decoration: none; color: var(--ink);
}
.chip-link[aria-current="page"] { background: var(--board); border-color: var(--board); color: var(--board-ink); }
.rank-row { display: grid; grid-template-columns: 2.2em 40px minmax(0, 1fr) auto; align-items: center; gap: 10px; padding: 10px 14px; text-decoration: none; min-height: 62px; }
.rank-num { font: 700 24px/1 "Barlow Condensed", sans-serif; text-align: right; font-variant-numeric: tabular-nums; }
.rank-rec { font: 600 18px/1 "Barlow Condensed", sans-serif; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.facts .conflict dd { color: var(--live); }
.credits { font-size: 14px; }

/* ---------------------------------------------------------------- browse */

.nav-item { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 14px 16px; min-height: 58px; text-decoration: none; }
.nav-title { font: 700 21px/1.1 "Barlow Condensed", sans-serif; }
.nav-meta { color: var(--ink-2); font-size: 15px; display: inline-flex; align-items: center; gap: 10px; }
.nav-meta::after { content: ""; width: 8px; height: 8px; border-right: 2.5px solid var(--ink-2); border-top: 2.5px solid var(--ink-2); transform: rotate(45deg); }

/* ---------------------------------------------------------------- forms & buttons */

.button {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 48px; padding: 0 20px; margin-top: 12px;
  background: var(--turf); color: var(--turf-ink);
  border: 0; border-radius: 12px;
  font: 600 17px/1 "Barlow", sans-serif; text-decoration: none; cursor: pointer;
}
.button.secondary { background: transparent; color: var(--turf); box-shadow: inset 0 0 0 1.5px var(--turf); }
.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: end; }
.row > label { flex: 1; min-width: 120px; }
.stack { display: grid; gap: 12px; margin-top: 8px; }
.stack .button { margin-top: 0; justify-self: start; }
label { display: grid; gap: 6px; font-weight: 600; font-size: 16px; }
label.check { display: flex; align-items: center; gap: 10px; font-weight: 500; }
input[type="text"], input[type="search"], input[type="number"], input[type="url"], select {
  width: 100%; min-height: 48px; padding: 10px 12px;
  font: 400 18px/1.2 "Barlow", sans-serif; color: var(--ink);
  background: var(--panel); border: 1.5px solid var(--line); border-radius: 10px;
}
input[type="checkbox"] { width: 24px; height: 24px; accent-color: var(--turf); }
.searchbar { margin: 14px var(--gutter) 0; }
#results { margin: 0 var(--gutter); }
#results .list { margin-top: 14px; }
#results > p { margin-top: 14px; }
.lookup { margin-top: 4px; }
.icon-btn {
  display: grid; place-items: center; width: 44px; height: 44px;
  border: 1px solid var(--line); border-radius: 10px; background: var(--panel); color: var(--ink);
  font-size: 18px; cursor: pointer;
}
.icon-btn:disabled { opacity: .35; }
.reorder { display: flex; gap: 6px; }
.reorder form { margin: 0; }
.copy-row { display: flex; gap: 8px; align-items: center; }
.copy-row .button { margin-top: 0; }
input.copy { font-size: 15px; color: var(--ink-2); }
.steps { margin: 0 0 8px; padding-left: 1.3em; display: grid; gap: 4px; }
.notice { margin: 14px var(--gutter) 0; padding: 12px 14px; border-radius: 12px; background: color-mix(in srgb, var(--turf) 14%, var(--panel)); }
.notice.error { background: color-mix(in srgb, var(--live) 14%, var(--panel)); }
.onboard { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 18px; }
.onboard h2 { font-size: 23px; margin-bottom: 4px; }
.onboard h2 + p { color: var(--ink-2); }
.onboard .button + h2 { margin-top: 22px; }

.admin-profile { display: flex; gap: 12px; padding: 12px 14px; align-items: start; justify-content: space-between; }
.admin-profile > div { display: grid; gap: 4px; min-width: 0; flex: 1; }
.errors { margin-top: 12px; }
.errors code { font-size: 13px; overflow-wrap: anywhere; }

/* ---------------------------------------------------------------- tab bar */

.tabs {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 10;
  display: grid; grid-template-columns: repeat(4, 1fr);
  background: var(--panel);
  border-top: 1px solid var(--line);
  padding-bottom: env(safe-area-inset-bottom);
}
.tab {
  display: grid; justify-items: center; align-content: center; gap: 3px;
  min-height: var(--tabbar); text-decoration: none; color: var(--ink-2);
  font-size: 13px; font-weight: 600;
}
.tab svg { width: 26px; height: 26px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.tab[aria-current="page"] { color: var(--turf); }
.tab[aria-current="page"] svg { stroke-width: 2.3; }

.demo-banner {
  position: fixed; left: 50%; transform: translateX(-50%);
  bottom: calc(var(--tabbar) + env(safe-area-inset-bottom) + 10px);
  z-index: 11; pointer-events: none;
  background: var(--lamp); color: #13233A;
  padding: 6px 14px; border-radius: 16px; font-size: 14px; font-weight: 600;
  box-shadow: 0 2px 10px rgba(0,0,0,.18);
  white-space: nowrap;
}

@media (min-width: 720px) {
  .page { max-width: 680px; margin: 0 auto; }
  .tabs { max-width: 680px; margin: 0 auto; border-left: 1px solid var(--line); border-right: 1px solid var(--line); }
}

@media (prefers-reduced-motion: reduce) {
  .dot, .game.flash { animation: none; }
}

/* ------------------------------------------------------- full stat sheet */

.table-wrap { overflow-x: auto; margin: 0 var(--gutter) 18px; }
.stat-sheet { border-collapse: collapse; width: 100%; font-size: 14px; white-space: nowrap; }
.stat-sheet th, .stat-sheet td { padding: 6px 10px; text-align: right; border-bottom: 1px solid var(--line); }
.stat-sheet th:nth-child(-n+2), .stat-sheet td:nth-child(-n+2) { text-align: left; }
.stat-sheet thead th { position: sticky; top: 0; background: var(--panel); color: var(--ink-2); font-weight: 600; }

/* ----------------------------------------------------------- inline player */

.player { margin: 0 0 14px; }
.player iframe { display: block; width: 100%; aspect-ratio: 16 / 9; border: 0; background: #000; }
.player figcaption { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 10px; padding: 8px 14px; }
.player figcaption .watch-detail { color: var(--ink-2); }
.player figcaption a { margin-left: auto; color: var(--turf); font-weight: 600; text-decoration: none; }
