:root {
  --bg: #0d1420;
  --bg-raised: #151f2f;
  --bg-cell: #1a2638;
  --line: #26344a;
  --text: #e8edf4;
  --muted: #8d9bb0;
  --accent: #f2b632;
  --win: #4ccf8b;
  --loss: #ef6b6b;

  /* Text on accent-colored chips and pills. On a team page, app.js swaps --accent for the
     team's color and sets --accent-ink to dark or light to match. */
  --accent-ink: #1b1405;

  /* Team-page banner colors and the top stripe. app.js sets these from league.json. */
  --brand: #1d2b42;
  --brand-2: var(--accent);
  --stripe: linear-gradient(90deg, var(--AFC), var(--NFC));

  /* Conference colors, lightened to read on the dark background. */
  --NFC: #3d7fd9;
  --AFC: #d8343b;

  --nav-h: 58px;
  --radius: 10px;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.4;
  -webkit-font-smoothing: antialiased;
}

.wrap {
  max-width: 1240px;
  margin: 0 auto;
  padding: 0 20px;
}

a { color: inherit; }

/* ---------- Top nav (sticky, on every view) ---------- */

.topnav {
  position: sticky;
  top: 0;
  z-index: 20;
  height: var(--nav-h);
  background: rgba(13, 20, 32, .9);
  backdrop-filter: saturate(140%) blur(10px);
  -webkit-backdrop-filter: saturate(140%) blur(10px);
  border-bottom: 1px solid var(--line);
}

/* Color stripe across the top: the four teams, one team's colors, or AFC/NFC. */
.topnav::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 3px;
  background: var(--stripe);
}

.topnav-inner {
  display: flex;
  align-items: center;
  gap: 20px;
  height: 100%;
}

.brand {
  flex: none;
  font-weight: 900;
  font-size: 15px;
  letter-spacing: .02em;
  text-decoration: none;
  white-space: nowrap;
}

.brand span { color: var(--accent); }

.tabs {
  display: flex;
  gap: 4px;
  min-width: 0;
  overflow-x: auto;
  scrollbar-width: none;
}

.tabs::-webkit-scrollbar { display: none; }

.tab {
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 11px;
  border: 1px solid transparent;
  border-radius: 999px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
}

.tab:hover { color: var(--text); background: rgba(255, 255, 255, .06); }

.tab[aria-current="page"] {
  color: var(--text);
  background: rgba(255, 255, 255, .08);
  border-color: rgba(255, 255, 255, .2);
}

.logo-tab { width: 22px; height: 22px; }

/* "League › Division ▾ › teams": the division tab and its menu button read as one control. */
.tabs { align-items: center; }

.tab-sep { flex: none; color: #4a5a72; font-size: 16px; padding: 0 2px; }

.tab-split {
  flex: none;
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
}

.tab-split .tab-division { padding-right: 6px; border-top-right-radius: 0; border-bottom-right-radius: 0; }
.tab-split .tab-menu { padding-left: 6px; border-top-left-radius: 0; border-bottom-left-radius: 0; }
.tab-split .tab-division[aria-current="page"] + .tab-menu {
  background: rgba(255, 255, 255, .08);
  border-color: rgba(255, 255, 255, .2);
  border-left-color: transparent;
}

.tab-menu {
  appearance: none;
  font: inherit;
  font-size: 14px;
  font-weight: 700;
  background: transparent;
  cursor: pointer;
}

.tab-menu[aria-expanded="true"] { color: var(--text); background: rgba(255, 255, 255, .1); }
.caret { font-size: 11px; line-height: 1; }

/* Division menu: drops down below the bar, full width. */
.div-menu {
  position: absolute;
  inset: 100% 0 auto 0;
  background: rgba(13, 20, 32, .97);
  border-bottom: 1px solid var(--line);
  box-shadow: 0 18px 40px rgba(0, 0, 0, .45);
}

.div-menu[hidden] { display: none; }

.div-menu-inner {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px 32px;
  padding-top: 16px;
  padding-bottom: 18px;
}

.div-menu-title {
  margin: 0 0 6px;
  padding-bottom: 6px;
  border-bottom: 2px solid var(--conf);
  color: var(--conf);
  font-weight: 900;
  letter-spacing: .04em;
}

.div-menu-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 5px 8px;
  margin: 0 -8px;
  border-radius: 8px;
}

.div-menu-row:hover { background: rgba(255, 255, 255, .05); }
.div-menu-row.is-current { background: rgba(255, 255, 255, .08); box-shadow: inset 3px 0 0 var(--conf); }

.div-menu-name {
  width: 64px;
  font-size: 14px;
  font-weight: 800;
  text-decoration: none;
}

.div-menu-name:hover { text-decoration: underline; text-underline-offset: 3px; }

.div-menu-teams { display: flex; gap: 6px; }
.div-menu-team { display: inline-flex; padding: 3px; border-radius: 6px; }
.div-menu-team:hover { background: rgba(255, 255, 255, .1); }
.logo-menu { width: 26px; height: 26px; }

kbd {
  display: inline-block;
  min-width: 1.5em;
  padding: 0 4px;
  border: 1px solid #34445e;
  border-bottom-width: 2px;
  border-radius: 4px;
  background: #182335;
  color: var(--muted);
  font: 700 10px/1.5 var(--font);
  text-align: center;
}

.tab-key { opacity: 0; transition: opacity .15s ease; }
.tab:hover .tab-key, .tab:focus-visible .tab-key { opacity: 1; }

.kbd-hint {
  flex: none;
  margin: 0 0 0 auto;
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
}

/* ---------- Header ---------- */

.site-header {
  padding: 28px 0;
  overflow: hidden;
  background: radial-gradient(1200px 300px at 50% -100px, #1d2b42, transparent);
  border-bottom: 1px solid var(--line);
}

body[data-theme="team"] .site-header {
  background: linear-gradient(115deg, var(--brand) 0%, color-mix(in srgb, var(--brand) 45%, var(--bg)) 55%, var(--bg) 100%);
}

body[data-theme="league"] .site-header {
  background:
    radial-gradient(700px 260px at 0% 0%, color-mix(in srgb, var(--AFC) 26%, transparent), transparent),
    radial-gradient(700px 260px at 100% 0%, color-mix(in srgb, var(--NFC) 30%, transparent), transparent);
}

.eyebrow {
  margin: 0;
  color: var(--accent);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
}

h1 {
  margin: 4px 0 6px;
  font-size: clamp(30px, 5vw, 46px);
  line-height: 1.05;
  letter-spacing: -.02em;
}

.lede {
  margin: 0 0 24px;
  color: var(--muted);
  max-width: 60ch;
}

.standings {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}

.standing {
  text-decoration: none;
  transition: border-color .15s ease, transform .15s ease;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  background: var(--bg-raised);
  border: 1px solid var(--line);
  border-left: 4px solid var(--team);
  border-radius: var(--radius);
}

.standing:hover { border-color: #3a4c68; border-left-color: var(--team); transform: translateY(-1px); }

.standing .rank {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  width: 1.2em;
}

.standing .who { flex: 1; min-width: 0; }
.standing .city { color: var(--muted); font-size: 12px; }
.standing .name { font-weight: 700; font-size: 17px; }
.standing .rec { text-align: right; }
.standing .wl { font-size: 20px; font-weight: 800; font-variant-numeric: tabular-nums; }
.standing .div { color: var(--muted); font-size: 12px; }

/* ---------- Logos ---------- */

.logo {
  flex: none;
  object-fit: contain;
}

.logo-standing { width: 44px; height: 44px; }
.logo-head { width: 40px; height: 40px; }
.logo-opp { width: 26px; height: 26px; align-self: center; }
.logo-tag { width: 16px; height: 16px; }

.logo-bye {
  width: 40px;
  height: 40px;
  opacity: .35;
  filter: grayscale(.6);
  margin-bottom: 2px;
}

/* ---------- Toolbar ---------- */

.toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 20px;
  padding: 20px 0;
}

.segmented {
  display: inline-flex;
  background: var(--bg-raised);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 3px;
}

.segmented button {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  padding: 6px 14px;
  border-radius: 999px;
  cursor: pointer;
}

.segmented button[aria-checked="true"] {
  background: var(--accent);
  color: var(--accent-ink);
}

.control {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.control-label {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--muted);
}

.jump {
  display: inline-block;
  text-decoration: none;
  appearance: none;
  border: 1px solid var(--accent);
  background: transparent;
  color: var(--accent);
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  padding: 6px 14px;
  border-radius: 999px;
  cursor: pointer;
}

.jump:hover { background: color-mix(in srgb, var(--accent) 12%, transparent); }

.toolbar-extra { margin-left: auto; }
.toolbar-extra:empty { display: none; }

.legend {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  margin: 0;
  padding: 0;
  list-style: none;
  font-size: 12px;
  color: var(--muted);
}

.legend li { display: inline-flex; align-items: center; gap: 6px; }

.swatch {
  display: inline-block;
  width: 14px;
  height: 14px;
  border-radius: 4px;
}

.swatch-bye {
  background: repeating-linear-gradient(135deg, #223047 0 4px, #182234 4px 8px);
  border: 1px solid var(--line);
}

/* ---------- Schedule grid ---------- */

.schedule {
  display: grid;
  grid-template-columns: 112px repeat(4, minmax(0, 1fr));
  gap: 8px;
  padding-bottom: 40px;
}

.loading {
  grid-column: 1 / -1;
  color: var(--muted);
  padding: 40px 0;
  text-align: center;
}

.col-head {
  position: sticky;
  top: var(--nav-h);
  z-index: 2;
  padding: 10px 12px;
  background: var(--bg);
  border-bottom: 3px solid var(--team, var(--line));
  font-weight: 800;
  font-size: 16px;
  letter-spacing: .01em;
}

.col-head:not(.corner) {
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 10px;
}

.col-head .city {
  display: block;
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .08em;
}

.col-head.corner { border-bottom-color: transparent; }
a.col-head:hover .head-text { text-decoration: underline; text-decoration-color: var(--team); text-underline-offset: 3px; }

.week-row { display: contents; }

.week-label {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 10px 12px;
  border-radius: var(--radius);
  background: var(--bg-raised);
  border: 1px solid var(--line);
  scroll-margin-top: calc(var(--nav-h) + 70px);
}

.week-label .num { font-weight: 800; font-size: 16px; }
.week-label .range { color: var(--muted); font-size: 12px; }

.week-label .now {
  align-self: flex-start;
  margin-top: 6px;
  padding: 2px 7px;
  border-radius: 999px;
  background: var(--accent);
  color: var(--accent-ink);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .06em;
  text-transform: uppercase;
}

.week-row.is-current .week-label { border-color: var(--accent); }
.week-row.is-current .game { border-color: #3a4c68; }

.game {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-height: 112px;
  padding: 10px 12px 10px 14px;
  background: var(--bg-cell);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}

.game::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 4px;
  background: var(--team);
  opacity: .85;
}

.game .team-tag {
  display: none;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--muted);
}

.matchup {
  display: flex;
  align-items: center;
  gap: 7px;
  font-weight: 700;
  font-size: 16px;
}

.matchup .at {
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  min-width: 1.4em;
}

.matchup .opp {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.when { font-size: 13px; color: var(--muted); }
.when strong { color: var(--text); font-weight: 600; }

.meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin-top: auto;
  padding-top: 4px;
}

.tv {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 6px;
  background: #2a3a52;
  color: var(--text);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .02em;
  white-space: nowrap;
}

.tv-stream { background: #3b2a5c; color: #e4d8ff; }
.tv-tbd { background: transparent; border: 1px dashed #42536d; color: var(--muted); }

.tag {
  font-size: 11px;
  font-weight: 600;
  color: var(--accent);
}

.tag-div {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 6px;
  background: var(--accent);
  color: var(--accent-ink);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .06em;
  text-transform: uppercase;
  white-space: nowrap;
}

.result {
  margin-left: auto;
  font-size: 13px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

.result.win { color: var(--win); }
.result.loss { color: var(--loss); }
.result.tie { color: var(--muted); }
.result.live { color: var(--accent); }

.tbd { color: var(--muted); }

/* Team rows include the time zone in the time ("8:20 PM ET"). */
.t-time strong { white-space: nowrap; }

.game.is-bye {
  align-items: center;
  justify-content: center;
  background: repeating-linear-gradient(135deg, #1c283b 0 10px, #172131 10px 20px);
}

.game.is-bye .bye-word {
  font-size: 20px;
  font-weight: 900;
  letter-spacing: .2em;
  color: #9fb0c8;
}

.game.is-bye .bye-sub { font-size: 12px; color: var(--muted); }

.hide-played .week-row.is-played,
.hide-played .trow.is-played { display: none; }

/* ---------- Team view: hero ---------- */

.team-hero {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 360px);
  align-items: center;
  gap: 28px;
  padding: 8px 0 4px;
}

.hero-watermark {
  position: absolute;
  right: 330px;
  top: 50%;
  width: 360px;
  height: 360px;
  transform: translateY(-50%);
  opacity: .07;
  pointer-events: none;
}

.hero-id {
  position: relative;
  display: flex;
  align-items: center;
  gap: 24px;
  min-width: 0;
}

.logo-hero {
  width: 112px;
  height: 112px;
  filter: drop-shadow(0 6px 18px rgba(0, 0, 0, .45));
}

.hero-text { min-width: 0; }
.team-hero h1 { margin-bottom: 14px; }

.hero-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 28px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.hero-stats li { display: flex; flex-direction: column; }

.hero-stats strong {
  font-size: 26px;
  font-weight: 900;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.hero-stats span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.next-card {
  position: relative;
  padding: 16px 18px;
  background: rgba(8, 12, 20, .55);
  border: 1px solid rgba(255, 255, 255, .12);
  border-top: 3px solid var(--accent);
  border-radius: var(--radius);
  backdrop-filter: blur(6px);
}

.next-card p { margin: 0; }

.next-label {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  color: var(--accent);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.next-countdown { color: var(--text); letter-spacing: .04em; }

.next-matchup {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 12px 0 8px;
}

.logo-next { width: 56px; height: 56px; }
.next-at { color: var(--muted); font-weight: 700; }

.next-opp { font-size: 20px; font-weight: 800; }
.next-when { color: var(--muted); font-size: 14px; margin-top: 2px !important; }
.next-card .meta { margin-top: 10px; padding-top: 0; }

/* ---------- Team view: layout ---------- */

.team-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 24px;
  align-items: start;
  padding-bottom: 40px;
}

/* ---------- Team view: schedule rows ---------- */

.tlist {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.trow {
  display: grid;
  grid-template-columns: 52px 64px minmax(0, 1fr) 96px 110px 92px;
  align-items: center;
  gap: 14px;
  padding: 12px 16px;
  background: var(--bg-cell);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  scroll-margin-top: calc(var(--nav-h) + 16px);
}

.trow.is-next {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent), 0 8px 24px rgba(0, 0, 0, .25);
}

.t-week {
  display: flex;
  flex-direction: column;
  align-items: center;
  line-height: 1;
}

.t-week-label {
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
}

.t-week-num { font-size: 22px; font-weight: 900; margin-top: 3px; }

.t-date {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 6px 0;
  border-radius: 8px;
  background: var(--bg-raised);
  border: 1px solid var(--line);
  line-height: 1.1;
}

.t-dow {
  color: var(--accent);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.t-md { font-size: 14px; font-weight: 700; white-space: nowrap; }

.t-opp {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.logo-row { width: 44px; height: 44px; }

.t-who { min-width: 0; }

.t-name {
  display: flex;
  align-items: baseline;
  gap: 6px;
  font-size: 18px;
  font-weight: 800;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.t-name .at { color: var(--muted); font-size: 13px; font-weight: 600; }

.t-sub {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 8px;
  margin-top: 3px;
}

.t-where {
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}

.t-time { display: flex; flex-direction: column; line-height: 1.15; }
.t-time strong { font-size: 15px; font-weight: 700; white-space: nowrap; }
.t-time span { color: var(--muted); font-size: 11px; font-weight: 700; letter-spacing: .06em; }

.t-tv .tv { font-size: 12px; padding: 3px 9px; }

.t-status { text-align: right; }
.t-status .result { margin-left: 0; font-size: 15px; }

.next-pill {
  display: inline-block;
  padding: 3px 9px;
  border-radius: 999px;
  background: var(--accent);
  color: var(--accent-ink);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .06em;
  text-transform: uppercase;
  white-space: nowrap;
}

.trow.is-bye {
  grid-template-columns: 52px minmax(0, 1fr);
  padding-top: 10px;
  padding-bottom: 10px;
  background: repeating-linear-gradient(135deg, #1c283b 0 10px, #172131 10px 20px);
}

.t-bye { display: flex; align-items: baseline; gap: 12px; }
.t-bye strong { font-size: 16px; letter-spacing: .04em; text-transform: uppercase; color: #9fb0c8; }
.t-bye span { color: var(--muted); font-size: 13px; }

/* ---------- Team view: sidebar ---------- */

.team-side {
  display: flex;
  flex-direction: column;
  gap: 14px;
  position: sticky;
  top: calc(var(--nav-h) + 16px);
}

.panel {
  padding: 14px 16px;
  background: var(--bg-raised);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.panel-title a { color: inherit; text-decoration: none; }
.panel-title a:hover { color: var(--text); text-decoration: underline; text-underline-offset: 3px; }

.panel-title {
  margin: 0 0 10px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .1em;
  text-transform: uppercase;
}

.panel-note { margin: 10px 0 0; color: var(--muted); font-size: 12px; }

.mini-standings { margin: 0; padding: 0; list-style: none; }

.mini-standing {
  display: grid;
  grid-template-columns: 14px 24px 1fr auto 40px;
  align-items: center;
  gap: 10px;
  padding: 7px 8px;
  margin: 0 -8px;
  border-radius: 8px;
  text-decoration: none;
  font-size: 14px;
}

.mini-standing:hover { background: rgba(255, 255, 255, .05); }
.mini-standing.is-self { background: rgba(255, 255, 255, .08); box-shadow: inset 3px 0 0 var(--team); }
.mini-standing .rank { color: var(--muted); font-size: 12px; font-weight: 700; }
.logo-mini { width: 24px; height: 24px; }
.mini-name { font-weight: 700; }
.mini-wl { font-weight: 800; font-variant-numeric: tabular-nums; }
.mini-div { color: var(--muted); font-size: 12px; text-align: right; font-variant-numeric: tabular-nums; }

.splits {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 7px 12px;
  margin: 0;
  font-size: 14px;
}

.splits dt { color: var(--muted); }
.splits dd { margin: 0; font-weight: 700; text-align: right; font-variant-numeric: tabular-nums; }
.splits dd.pos { color: var(--win); }
.splits dd.neg { color: var(--loss); }

.watch { display: flex; flex-direction: column; gap: 8px; margin: 0; padding: 0; list-style: none; }

.watch li {
  display: grid;
  grid-template-columns: 96px 1fr 22px;
  align-items: center;
  gap: 10px;
}

.watch .tv { justify-self: start; }

.watch-bar {
  height: 6px;
  border-radius: 999px;
  background: #223047;
  overflow: hidden;
}

.watch-fill {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--accent);
}

.watch-count { text-align: right; font-weight: 700; font-variant-numeric: tabular-nums; font-size: 13px; }

/* ---------- Links between views ---------- */

.matchup a.opp,
.opp-link {
  color: inherit;
  text-decoration: none;
}

.matchup a.opp:hover,
.opp-link:hover {
  text-decoration: underline;
  text-decoration-color: var(--accent);
  text-underline-offset: 3px;
}

/* The row or team a link pointed at gets a brief highlight. */
@keyframes focus-flash {
  0%, 30% { box-shadow: 0 0 0 3px var(--accent), 0 0 32px color-mix(in srgb, var(--accent) 45%, transparent); }
  100% { box-shadow: 0 0 0 2px var(--accent); }
}

.trow:target,
.week-label:target,
.ltile:target {
  border-color: var(--accent);
  animation: focus-flash 1.8s ease-out both;
}

/* ---------- League view ---------- */

.league-stats { margin-top: 4px; }

.conf { padding-bottom: 28px; scroll-margin-top: calc(var(--nav-h) + 12px); }

.conf-title {
  display: flex;
  align-items: baseline;
  gap: 12px;
  margin: 8px 0 14px;
  padding-bottom: 8px;
  border-bottom: 3px solid var(--conf);
}

.conf-NFC { --conf: var(--NFC); }
.conf-AFC { --conf: var(--AFC); }

.conf-abbr {
  font-size: 28px;
  font-weight: 900;
  letter-spacing: .02em;
  color: var(--conf);
}

.conf-name {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.div-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  align-items: start;
}

.div-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 12px;
  background: var(--bg-raised);
  border: 1px solid var(--line);
  border-top: 3px solid var(--conf);
  border-radius: var(--radius);
}

.div-head {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 2px 4px 4px;
  margin: -2px -4px 0;
  border-radius: 6px;
  text-decoration: none;
}

.div-head:hover { background: rgba(255, 255, 255, .05); }
.div-head h3 { flex: 1; }
.div-go { color: var(--muted); font-size: 18px; line-height: 1; }
.div-head:hover .div-go { color: var(--text); }

.div-head h3 {
  margin: 0;
  font-size: 14px;
  font-weight: 800;
  letter-spacing: .06em;
  text-transform: uppercase;
}

.ltile {
  display: flex;
  flex-direction: column;
  gap: 6px;
  text-decoration: none;
  transition: border-color .15s ease, transform .15s ease;
  padding: 10px;
  background: var(--bg-cell);
  border: 1px solid var(--line);
  border-radius: 8px;
  scroll-margin-top: calc(var(--nav-h) + 16px);
}

.ltile:hover { border-color: #4a5f80; transform: translateY(-1px); }

.ltile-head { display: flex; align-items: center; gap: 10px; }
.logo-ltile { width: 40px; height: 40px; }

.ltile-name { display: flex; flex-direction: column; min-width: 0; flex: 1; line-height: 1.2; }
.ltile-name .city { color: var(--muted); font-size: 11px; font-weight: 600; }
.ltile-name strong { font-size: 16px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.ltile-rec { font-size: 20px; font-weight: 900; font-variant-numeric: tabular-nums; }

.ltile-foot {
  display: flex;
  align-items: center;
  height: 24px;
  font-size: 12px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
}

.muted { color: var(--muted); }

/* ---------- Footer ---------- */

.site-footer {
  border-top: 1px solid var(--line);
  padding: 24px 0 40px;
  color: var(--muted);
  font-size: 13px;
}

.site-footer ul { margin: 0 0 8px; padding-left: 18px; }
.site-footer li { margin-bottom: 4px; }

/* ---------- Responsive ---------- */

@media (max-width: 1180px) {
  .div-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .kbd-hint { display: none; }
}

@media (hover: none) {
  .tab-key, .kbd-hint { display: none; }
}

@media (max-width: 900px) {
  .standings { grid-template-columns: repeat(2, 1fr); }
  .toolbar-extra { margin-left: 0; }

  .schedule {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  .col-head { display: none; }

  .week-label {
    grid-column: 1 / -1;
    flex-direction: row;
    align-items: baseline;
    gap: 10px;
    margin-top: 14px;
    background: transparent;
    border: 0;
    border-bottom: 1px solid var(--line);
    border-radius: 0;
    padding: 6px 2px;
  }

  .week-row.is-current .week-label { border-color: var(--accent); }
  .week-label .now { margin: 0 0 0 auto; align-self: center; }

  .game { min-height: 0; }

  .team-hero { grid-template-columns: minmax(0, 1fr); gap: 20px; }
  .hero-watermark { right: -40px; width: 280px; height: 280px; }
  .team-layout { grid-template-columns: minmax(0, 1fr); }
  .team-side {
    position: static;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  }

  .trow { grid-template-columns: 44px 60px minmax(0, 1fr) 88px 100px; }
  .trow .t-status { grid-column: 3 / -1; text-align: left; }
  .trow .t-status:empty { display: none; }
  .game .team-tag { display: flex; align-items: center; gap: 6px; }
  .game.is-bye .team-tag { align-self: flex-start; }
}

@media (max-width: 520px) {
  .wrap { padding: 0 14px; }
  .site-header { padding-top: 28px; }
  .standing { padding: 10px; gap: 8px; }
  .standing .wl { font-size: 17px; }
  .schedule { grid-template-columns: minmax(0, 1fr); }
  .div-grid { grid-template-columns: minmax(0, 1fr); }
  .div-menu-inner { grid-template-columns: minmax(0, 1fr); }
  .tab-key { display: none; }

  .topnav-inner { gap: 10px; }
  .brand { display: none; }
  .tab { padding: 5px 9px; font-size: 13px; }
  .hero-id { gap: 16px; }
  .logo-hero { width: 72px; height: 72px; }
  .hero-stats { gap: 10px 20px; }
  .hero-stats strong { font-size: 21px; }

  /* Rows become: week + date on the left, everything else stacked on the right. */
  .trow {
    grid-template-columns: 40px 56px minmax(0, 1fr) auto auto;
    row-gap: 8px;
    column-gap: 10px;
    padding: 12px;
  }
  .t-week { grid-column: 1; grid-row: 1 / span 2; }
  .t-date { grid-column: 2; grid-row: 1 / span 2; }
  .t-opp { grid-column: 3 / -1; grid-row: 1; }
  .t-time { grid-column: 3; grid-row: 2; flex-direction: row; gap: 4px; align-items: baseline; }
  .t-tv { grid-column: 4; grid-row: 2; }
  .trow .t-status { grid-column: 5; grid-row: 2; text-align: right; }
  .trow .t-status:empty { display: block; }
  .logo-row { width: 34px; height: 34px; }
  .t-name { font-size: 16px; }
  .trow.is-bye { grid-template-columns: 40px minmax(0, 1fr); }
  .trow.is-bye .t-week { grid-row: auto; }
  .t-bye { flex-direction: column; gap: 2px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}
