/* ── tokens ────────────────────────────────────────────────────────────────
   Light defines every colour; dark redefines tokens only. Nothing below the
   token blocks declares a colour literal, so the two themes cannot drift. */

:root {
  /* Pittsburgh's own values, from ESPN's team feed: color 000000,
     alternateColor ffb612. Black is lifted to #101820 for a surface — a true
     black beside a dark card reads as a rendering fault, not a colour.

     ! Gold is a MARKER, never body text. #FFB612 on white is about 1.7:1 and
     fails contrast outright. It appears as a fill, a rule and a border, and the
     text on top of it is always --black. */
  --gold:      #FFB612;
  --gold-ink:  #7A5400;   /* gold, darkened until it is legible AS text */
  --black:     #101820;

  --paper:     #F5F6F4;
  --surface:   #FFFFFF;
  --surface-2: #EDEFEC;
  --ink:       #14181C;
  --ink-2:     #4C555E;
  --ink-3:     #79828A;
  --line:      #DDE1DE;
  --line-2:    #EAEDEA;
  --good:      #1B7A45;
  --bad:       #A8392A;
  --bad-bg:    #FBEAE7;
  --shadow:    0 1px 2px rgba(20,24,28,.05), 0 10px 26px -14px rgba(20,24,28,.22);

  /* One scale. Nothing in this file sets a spacing value that is not on it. */
  --s1: 4px; --s2: 8px; --s3: 12px; --s4: 16px; --s5: 24px; --s6: 40px;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --gold-ink:  #FFC63D;
    --paper:     #0D1013;
    --surface:   #161A1E;
    --surface-2: #1D2226;
    --ink:       #E9ECEF;
    --ink-2:     #A9B1B8;
    --ink-3:     #7C858D;
    --line:      #262C31;
    --line-2:    #1F2429;
    --good:      #4FB07C;
    --bad:       #E88C7D;
    --bad-bg:    #2C1A17;
    --shadow:    0 1px 2px rgba(0,0,0,.45), 0 10px 26px -14px rgba(0,0,0,.7);
  }
}
:root[data-theme="dark"] {
  --gold-ink:  #FFC63D;
  --paper:     #0D1013;
  --surface:   #161A1E;
  --surface-2: #1D2226;
  --ink:       #E9ECEF;
  --ink-2:     #A9B1B8;
  --ink-3:     #7C858D;
  --line:      #262C31;
  --line-2:    #1F2429;
  --good:      #4FB07C;
  --bad:       #E88C7D;
  --bad-bg:    #2C1A17;
  --shadow:    0 1px 2px rgba(0,0,0,.45), 0 10px 26px -14px rgba(0,0,0,.7);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 16px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
}

button { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--gold-ink); outline-offset: 2px; border-radius: 6px; }

/* ── header ──────────────────────────────────────────────────────────────── */

.top {
  display: flex; align-items: center; gap: var(--s4);
  max-width: 940px; margin: 0 auto; padding: var(--s4);
  flex-wrap: wrap;
}
.brand { display: flex; align-items: center; gap: var(--s3); margin-right: auto; }
.mark {
  width: 34px; height: 34px; border-radius: 8px; flex: none;
  background: var(--black); border-bottom: 4px solid var(--gold);
}
.brandtext { display: flex; flex-direction: column; line-height: 1.15; }
.brandtext b { font-size: 1.05rem; letter-spacing: -.01em; }
.weeklabel { font-size: .76rem; color: var(--ink-3); font-variant-numeric: tabular-nums; }

.views { display: flex; gap: var(--s1); background: var(--surface-2);
  border-radius: 9px; padding: 3px; }
.views button {
  min-height: 36px; padding: 0 var(--s4); border: 0; border-radius: 7px;
  background: transparent; font-size: .87rem; font-weight: 600; cursor: pointer;
}
.views button.on { background: var(--surface); box-shadow: var(--shadow); }

.weeknav { display: flex; gap: var(--s1); }
.weeknav button {
  width: 40px; height: 40px; border: 1px solid var(--line); border-radius: 9px;
  background: var(--surface); cursor: pointer; font-size: 1rem;
}
.weeknav button:disabled { opacity: .38; cursor: default; }

.err {
  max-width: 940px; margin: 0 auto var(--s3); padding: var(--s3) var(--s4);
  background: var(--bad-bg); color: var(--bad); border-radius: 9px;
  font-size: .87rem;
}

main { max-width: 940px; margin: 0 auto; padding: 0 var(--s4) var(--s6); }
.muted { color: var(--ink-3); }
.eyebrow {
  font-size: .7rem; font-weight: 700; letter-spacing: .13em;
  text-transform: uppercase; color: var(--ink-3); margin-bottom: var(--s3);
}
.sec-h {
  font-size: .7rem; font-weight: 700; letter-spacing: .13em;
  text-transform: uppercase; color: var(--ink-3); margin: var(--s6) 0 var(--s3);
}
.empty { background: var(--surface); border: 1px solid var(--line);
  border-radius: 14px; padding: var(--s5); }
.empty h2 { margin: 0 0 var(--s2); font-size: 1.05rem; }
.empty p { margin: 0; color: var(--ink-2); font-size: .92rem; }

/* ── the game card ───────────────────────────────────────────────────────── */

.gcard {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: 14px; overflow: hidden; box-shadow: var(--shadow);
  margin-bottom: var(--s3);
}
/* The hero takes the team's own colour as a top rule. --team is applied by
   `paintTeamColors` through the CSSOM after render, NOT by an inline style —
   `style-src 'self'` would drop the attribute and the rule would fall back to
   black without any error a test could see. */
.gcard.hero { border-color: var(--line); border-top: 4px solid var(--team, var(--black)); }

.gc-head {
  display: flex; align-items: center; justify-content: space-between; gap: var(--s3);
  padding: var(--s3) var(--s4);
  background: var(--surface-2); border-bottom: 1px solid var(--line);
}
.gc-lab { font-size: .72rem; font-weight: 700; letter-spacing: .1em;
  text-transform: uppercase; color: var(--ink-3); }
.gc-head.live { background: var(--bad-bg); border-bottom-color: var(--bad); }
.gc-live, .row-live {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: .72rem; font-weight: 700; letter-spacing: .1em;
  text-transform: uppercase; color: var(--bad);
}
.pulse { width: 7px; height: 7px; border-radius: 50%; background: currentColor;
  animation: pulse 1.8s ease-in-out infinite; flex: none; }
@keyframes pulse { 0%,100% { opacity: 1 } 50% { opacity: .25 } }
@media (prefers-reduced-motion: reduce) { .pulse { animation: none } }

/* the matchup — crest, name and record each get real air */
.gc-teams {
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center;
  gap: var(--s3); padding: var(--s5) var(--s4) var(--s4);
}
.gc-team { display: flex; flex-direction: column; align-items: center;
  gap: var(--s2); text-align: center; min-width: 0; }
/* The loser dims rather than the winner shouting — otherwise every finished
   card competes for attention and nothing stands out. */
.gc-team.lost { opacity: .55; }
/* ! Sized by CONTEXT, not by an inline style. The CSP is `style-src 'self'`,
   which drops style attributes in parsed HTML — a --sz set inline never
   arrives, and the crests collapse. Three contexts, three sizes. */
.gc-logo, .gc-crest { width: 44px; height: 44px; flex: none; }
.gc-logo { object-fit: contain; }
.gc-crest {
  border-radius: 50%; display: grid; place-items: center; color: #fff;
  font-weight: 700; font-size: .8rem; background: var(--ink-3);
}
.gcard.hero .gc-logo, .gcard.hero .gc-crest { width: 56px; height: 56px; }
.gc-name { font-size: 1rem; font-weight: 600; line-height: 1.2; }
/* The gap that mattered in soccer's rebuild: this was .2rem and read as
   "almost touching". */
.gc-rec { font-size: .76rem; color: var(--ink-3); margin-top: var(--s1);
  font-variant-numeric: tabular-nums; }

.gc-mid { display: flex; flex-direction: column; align-items: center; gap: 2px; }
.gc-vs { font-size: .72rem; font-weight: 700; letter-spacing: .1em; color: var(--ink-3); }
.gc-kick { font-size: .82rem; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.gc-score { font-size: 2rem; font-weight: 700; line-height: 1;
  font-variant-numeric: tabular-nums; letter-spacing: -.01em; }
.gc-score .sep { color: var(--ink-3); margin: 0 4px; font-weight: 400; }
.gc-clock { font-size: .78rem; color: var(--ink-2); font-variant-numeric: tabular-nums; }

/* the live situation — the part with no soccer analogue */
.gc-sit {
  display: flex; align-items: center; gap: var(--s2); flex-wrap: wrap;
  padding: var(--s3) var(--s4);
  border-top: 1px solid var(--line-2); border-bottom: 1px solid var(--line-2);
  background: color-mix(in srgb, var(--gold) 13%, var(--surface));
  font-size: .84rem;
}
.gc-sit .poss { display: inline-flex; align-items: center; gap: 6px; font-weight: 700; }
/* ! --ink, not --black. The strip is a gold tint over the surface, which is
   dark in dark mode — a near-black ball on it is invisible. --ink flips with
   the theme, so the marker reads on both grounds. */
.gc-sit .ball { width: 14px; height: 9px; border-radius: 50% / 60%;
  background: var(--ink); display: inline-block; flex: none; }
.gc-dd { font-weight: 700; font-variant-numeric: tabular-nums; }
.gc-at { color: var(--ink-2); }
.gc-rz {
  font-size: .66rem; font-weight: 700; letter-spacing: .09em; text-transform: uppercase;
  color: var(--bad); border: 1px solid var(--bad); padding: 1px 6px; border-radius: 4px;
}
.gc-rz.sm { font-size: .62rem; }

/* labelled units: key left, value right, a hairline between rows */
.gc-units { padding: var(--s2) var(--s4) var(--s4); }
.gc-unit {
  display: grid; grid-template-columns: 6.2rem 1fr; gap: var(--s1) var(--s3);
  align-items: baseline; padding: var(--s3) 0; border-top: 1px solid var(--line-2);
}
.gc-unit:first-child { border-top: 0; }
.gc-k {
  display: flex; align-items: center; gap: 6px;
  font-size: .68rem; font-weight: 700; letter-spacing: .09em;
  text-transform: uppercase; color: var(--ink-3);
}
.gc-v { font-size: .89rem; line-height: 1.42; min-width: 0; }
.gc-v b { font-weight: 600; }
.gc-v .sub { color: var(--ink-3); }
/* The key drops above its value rather than squeezing a venue name into half a
   narrow screen. */
@media (max-width: 400px) { .gc-unit { grid-template-columns: 1fr; } }

/* icons take their colour from the text, so they follow the theme without a
   second palette to keep in step */
.gc-ic { width: 14px; height: 14px; flex: none; stroke: currentColor; fill: none;
  stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; opacity: .8; }

.gc-actions { display: flex; flex-wrap: wrap; gap: var(--s2); padding: 0 var(--s4) var(--s4); }
.gc-act {
  min-height: 44px; display: inline-flex; align-items: center; gap: var(--s2);
  padding: 0 var(--s3); border: 1px solid var(--line); border-radius: 10px;
  background: var(--surface); font-size: .8rem; font-weight: 600; cursor: pointer;
}
.gc-act .gc-ic { width: 15px; height: 15px; opacity: 1; }

/* ── the compact row ─────────────────────────────────────────────────────── */

.rows { display: flex; flex-direction: column; gap: var(--s2); }
.grow {
  display: flex; align-items: center; justify-content: space-between; gap: var(--s4);
  background: var(--surface); border: 1px solid var(--line);
  border-radius: 11px; padding: var(--s3) var(--s4);
}
.grow.is-live { border-color: var(--bad); }
.row-teams { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.row-side { display: flex; align-items: center; gap: var(--s2);
  font-variant-numeric: tabular-nums; }
.row-side.lost { opacity: .5; }
.row-side .gc-logo, .row-side .gc-crest { width: 22px; height: 22px; font-size: .58rem; }
.row-ab { font-weight: 700; font-size: .84rem; min-width: 2.6rem; }
.row-pts { font-size: 1rem; font-weight: 700; }
.row-meta { display: flex; align-items: center; gap: var(--s2);
  text-align: right; flex-wrap: wrap; justify-content: flex-end; }
.row-st { font-size: .78rem; color: var(--ink-3); font-variant-numeric: tabular-nums; }

.foot {
  max-width: 940px; margin: 0 auto; padding: var(--s5) var(--s4) var(--s6);
  border-top: 1px solid var(--line); color: var(--ink-3); font-size: .78rem;
}

@media (max-width: 560px) {
  .top { gap: var(--s3); }
  .views { order: 3; width: 100%; }
  .views button { flex: 1; }
}

/* ── the live board ────────────────────────────────────────────────────────
   Nine games at once. A tile is scanned, not read: possession is a pip,
   winning is contrast, and "worth switching to" is a tint. */

.board {
  border: 1px solid var(--line); border-radius: 14px; overflow: hidden;
  background: var(--surface); box-shadow: var(--shadow);
}
.board-bar {
  display: flex; align-items: center; justify-content: space-between; gap: var(--s3);
  padding: var(--s3) var(--s4); background: var(--surface-2);
  border-bottom: 1px solid var(--line); flex-wrap: wrap;
}
.board-live {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: .72rem; font-weight: 700; letter-spacing: .1em;
  text-transform: uppercase; color: var(--bad);
}
.board-meta { display: flex; align-items: center; gap: var(--s3); flex-wrap: wrap; }
.board-close {
  font-size: .68rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase;
  color: var(--bad); border: 1px solid var(--bad); border-radius: 4px; padding: 1px 6px;
}

/* 1px gaps on a tinted ground draw the grid lines, so no tile needs its own
   border and the whole thing reads as one surface. */
.board-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 1px; background: var(--line-2);
}
.tile {
  background: var(--surface); padding: var(--s3);
  display: flex; flex-direction: column; gap: 6px; min-width: 0;
  border: 0; border-radius: 0; text-align: left; cursor: pointer;
  font: inherit; color: inherit; width: 100%;
}
.tile:hover { background: var(--surface-2); }
.tile.done { opacity: .72; }
.tile.hot { background: var(--bad-bg); }
/* ! Identity must survive the tint. A Steelers game that is ALSO close and late
   would otherwise lose its gold to the red exactly when you most want to pick it
   out of sixteen tiles — the two signals answer different questions ("mine" vs
   "worth switching to") and both need to survive. The tint carries urgency; this
   inset rule carries identity, and they compose. */
.tile.is-fav { background: color-mix(in srgb, var(--gold) 15%, var(--surface)); }
.tile.is-fav { box-shadow: inset 3px 0 0 var(--gold); }
.tile.is-fav.hot { background: var(--bad-bg); }

.tile-row {
  display: grid; grid-template-columns: 12px 1fr auto; align-items: center;
  gap: var(--s2); font-variant-numeric: tabular-nums;
}
/* The possession pip. Always present so the rows never shift when the ball
   changes hands — an empty slot, not an absent one. */
.tile-row .pip { width: 7px; height: 7px; border-radius: 50%;
  background: transparent; justify-self: center; }
.tile-row.has .pip { background: var(--ink); }
.tile-row .ab { font-weight: 700; font-size: .84rem; letter-spacing: .01em; }
.tile-row .pts { font-size: 1.05rem; font-weight: 700; }
/* Contrast carries who is winning. The trailer dims; nothing else changes. */
.tile-row:not(.lead) .ab, .tile-row:not(.lead) .pts { color: var(--ink-3); }

.tile-foot {
  display: flex; align-items: baseline; justify-content: space-between; gap: var(--s2);
  border-top: 1px solid var(--line-2); padding-top: 5px;
  font-size: .68rem; color: var(--ink-3); font-variant-numeric: tabular-nums;
}
.tile-foot .st { font-weight: 700; letter-spacing: .05em; text-transform: uppercase;
  white-space: nowrap; }
.tile.hot .tile-foot .st { color: var(--bad); }
.tile-foot .dd { white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  min-width: 0; }

/* the live count on the Board tab */
.views button { position: relative; }
/* ! `[hidden]` LOSES TO AN AUTHOR `display`. The UA stylesheet implements the
   hidden attribute as `display: none`, and any author rule setting display —
   inline-grid, here — beats it on the cascade. The result was an empty red dot
   permanently parked on the Board tab whenever nothing was live, while
   `el.hidden` read true and every DOM assertion passed. Caught by looking at a
   screenshot; nothing else would have. This rule is load-bearing. */
.badge[hidden] { display: none; }
.badge {
  display: inline-grid; place-items: center; min-width: 18px; height: 18px;
  margin-left: 6px; padding: 0 5px; border-radius: 9px;
  background: var(--bad); color: #fff;
  font-size: .68rem; font-weight: 700; font-variant-numeric: tabular-nums;
}

.backlink {
  border: 0; background: none; padding: var(--s2) 0; margin-bottom: var(--s2);
  font-size: .85rem; font-weight: 600; color: var(--ink-2); cursor: pointer;
}

/* ── standings ─────────────────────────────────────────────────────────────
   Two questions in order: who is in, and who leads each division. Numbers are
   tabular everywhere, because a standings table is read down a column. */

.conf-picker {
  display: flex; gap: var(--s1); background: var(--surface-2);
  border-radius: 9px; padding: 3px; margin-bottom: var(--s4); width: fit-content;
}
.conf-picker button {
  min-height: 36px; padding: 0 var(--s5); border: 0; border-radius: 7px;
  background: transparent; font-size: .87rem; font-weight: 700; cursor: pointer;
  letter-spacing: .04em;
}
.conf-picker button.on { background: var(--surface); box-shadow: var(--shadow); }

.st-block { margin-bottom: var(--s6); }
.st-block .sec-h { margin-top: 0; }

.st-table { width: 100%; border-collapse: collapse; font-size: .88rem; }
.st-table th, .st-table td {
  padding: var(--s2) var(--s3); text-align: left;
  border-top: 1px solid var(--line-2); white-space: nowrap;
}
.st-table thead th {
  border-top: 0; background: var(--surface-2); color: var(--ink-3);
  font-size: .66rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase;
}
.st-num { text-align: right; font-variant-numeric: tabular-nums; }
.st-seed { text-align: center; width: 2.2rem; color: var(--ink-3);
  font-variant-numeric: tabular-nums; font-weight: 700; }
.st-mark { text-align: right; width: 1px; }

.st-team { display: inline-flex; align-items: center; gap: var(--s2); }
.st-logo { width: 20px; height: 20px; object-fit: contain; flex: none; display: inline-block; }
.st-ab { font-weight: 700; letter-spacing: .01em; }
/* Pittsburgh, everywhere they appear. The gold rule rather than a fill, so a
   row still reads as a row. */
.st-table tr.is-fav { background: color-mix(in srgb, var(--gold) 13%, var(--surface)); }
.st-table tr.is-fav td:first-child { box-shadow: inset 3px 0 0 var(--gold); }
/* Eliminated teams dim. They are still worth showing — that is the answer to
   "are we out?" — but they are no longer part of the live question. */
.st-table tr.out { color: var(--ink-3); }
.st-table tr.out .st-ab { font-weight: 600; }

/* The playoff cut line. A labelled rule, not a coloured row: it separates two
   groups rather than describing a team. */
.st-cut td {
  background: var(--surface-2); color: var(--ink-3);
  font-size: .64rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase;
  padding: var(--s1) var(--s3);
}

.clinch {
  display: inline-block; padding: 1px 6px; border-radius: 4px;
  font-size: .62rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase;
}
.clinch.top { background: var(--gold); color: var(--black); }
.clinch.in  { background: color-mix(in srgb, var(--good) 16%, var(--surface)); color: var(--good); }
.clinch.out { background: var(--surface-2); color: var(--ink-3); }

.st-note { margin: var(--s2) 0 0; font-size: .76rem; color: var(--ink-3); }

.st-divs { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: var(--s4); }
.st-div {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: 12px; overflow: hidden;
}
.st-divname {
  margin: 0; padding: var(--s3) var(--s4);
  background: var(--surface-2); border-bottom: 1px solid var(--line);
  font-size: .74rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase;
  color: var(--ink-2);
}
.st-div .tablewrap { border: 0; }
.tablewrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 12px;
  background: var(--surface); }

/* A phone has room for the record and the result, not for six splits. */
@media (max-width: 560px) {
  .hide-sm { display: none; }
  .st-table th, .st-table td { padding: var(--s2); }
}

.notify-msg {
  margin: var(--s3) 0 0; padding: var(--s3) var(--s4);
  background: var(--bad-bg); color: var(--bad);
  border-radius: 9px; font-size: .87rem;
}
/* Five tabs is the most this nav will take; below 560px they wrap to their own
   row and share the width equally. */
@media (max-width: 700px) { .views button { padding: 0 var(--s3); font-size: .82rem; } }
