/* Scorigami Center design system.
   Chrome tokens harmonize with the normative viz palette (spec section 6). */

:root {
  --paper: #f9f9f7;
  --surface: #fcfcfb;
  --ink: #0b0b0b;
  --ink2: #52514e;
  --muted: #6b6a64;
  --hair: #e1e0d9;
  --base: #c3c2b7;
  --accent: #2a78d6;
  --accent-deep: #104281;
  --accent-ink: #ffffff;
  --imposs: #383835;
  --cat1: #2a78d6;
  --cat2: #eb6834;
  --cat3: #1baf7a;
  --bad: #c0392b;
  --ramp: #cde2fb,#b7d3f6,#9ec5f4,#86b6ef,#6da7ec,#5598e7,#3987e5,#2a78d6,#256abf,#1c5cab,#184f95,#104281,#0d366b;
  --shadow: 0 2px 14px rgba(11,11,11,.10);
  --disp: "Big Shoulders", "Arial Narrow", sans-serif;
  --body: "Atkinson Hyperlegible", "Segoe UI", sans-serif;
  --mono: "IBM Plex Mono", "Consolas", monospace;
}
:root[data-theme="dark"] {
  --paper: #0d0d0d;
  --surface: #1a1a19;
  --ink: #ffffff;
  --ink2: #c3c2b7;
  --muted: #898781;
  --hair: #2c2c2a;
  --base: #383835;
  --accent: #3987e5;
  --accent-deep: #9ec5f4;
  --accent-ink: #0b0b0b;
  --imposs: #52514e;
  --cat1: #3987e5;
  --cat2: #d95926;
  --cat3: #199e70;
  --bad: #e06651;
  --shadow: 0 2px 14px rgba(0,0,0,.5);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) {
    --paper: #0d0d0d; --surface: #1a1a19; --ink: #ffffff; --ink2: #c3c2b7;
    --muted: #898781;
    --hair: #2c2c2a; --base: #383835; --accent: #3987e5; --accent-deep: #9ec5f4;
    --accent-ink: #0b0b0b; --imposs: #52514e;
    --cat1: #3987e5; --cat2: #d95926; --cat3: #199e70;
    --bad: #e06651;
    --shadow: 0 2px 14px rgba(0,0,0,.5);
  }
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { height: 100%; }
body {
  font-family: var(--body);
  background: var(--paper);
  color: var(--ink);
  line-height: 1.55;
  min-height: 100%;
  display: flex;
  flex-direction: column;
  /* Never allow a stray element to scroll the page sideways on a phone. */
  overflow-x: hidden;
}
img { max-width: 100%; height: auto; }
a { color: inherit; }

::selection { background: var(--accent); color: var(--accent-ink); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ---------- header ---------- */
.hdr {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 0 20px;
  /* viewport-fit=cover is set site-wide: keep the wordmark and toggle out of
     the landscape notch / corner-radius zone (env() is 0 elsewhere). */
  padding: 0 max(20px, env(safe-area-inset-right)) 0 max(20px, env(safe-area-inset-left));
  height: 54px;
  border-bottom: 1px solid var(--hair);
  background: var(--paper);
  position: sticky;
  top: 0;
  z-index: 40;
}
.wordmark {
  font-family: var(--disp);
  font-weight: 800;
  font-size: 22px;
  letter-spacing: .04em;
  text-transform: uppercase;
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
}
.wordmark .cell {
  width: 11px; height: 11px;
  background: var(--accent);
  flex: none;
}
.mainnav { display: flex; gap: 2px; margin-left: auto; align-items: center; }
.mainnav .navlink {
  font-size: 13.5px;
  font-weight: 700;
  text-decoration: none;
  color: var(--ink2);
  padding: 6px 10px;
  border-bottom: 2px solid transparent;
  white-space: nowrap;
}
@media (hover: hover) { .mainnav .navlink:hover { color: var(--ink); border-bottom-color: var(--base); } }
.mainnav .navlink[aria-current="page"] { color: var(--ink); border-bottom-color: var(--accent); }

/* hamburger (drawer nav, phones through small laptops) */
.navtoggle {
  display: none;
  margin-left: auto;
  width: 44px; height: 44px;
  border: 1px solid var(--base);
  background: none;
  cursor: pointer;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 4px;
}
.navtoggle span {
  display: block; width: 18px; height: 2px; background: var(--ink);
  transition: transform .2s ease, opacity .15s ease;
}
/* Hamburger morphs to an X when the drawer is open. */
.hdr.navopen .navtoggle span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.hdr.navopen .navtoggle span:nth-child(2) { opacity: 0; }
.hdr.navopen .navtoggle span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

/* Touch fundamentals: 16px form text stops iOS focus-zoom (gate on coarse
   pointer AND narrow width so it fires on every phone); real press feedback
   replaces the (now hover-gated) desktop hover states; kill the blue tap flash.
   !important is load-bearing: every real field sets a smaller classed
   font-size (.numin, .lookup input, .dash-select, .h2h-input, .al-email...)
   that would otherwise beat these bare element selectors. */
@media (pointer: coarse), (max-width: 700px) {
  input, select, textarea { font-size: 16px !important; }
}
@media (pointer: coarse) {
  a, button, summary, label, .chip, .seg button, .tile { -webkit-tap-highlight-color: transparent; }
  .seg button:active, .chip:active, .themebtn:active, .lookup button:active,
  .zoomctl button:active, .stage-viewbtn:active, .expandbtn:active,
  .mainnav .navlink:active, .navcol a:active,
  .filt-toggle:active, .sheetgrab:active, .detail .share:active,
  .detail .allgames:active, .tl-close:active {
    background: color-mix(in srgb, var(--accent) 16%, var(--surface));
    border-color: var(--accent);
  }
  .tile:active { border-color: var(--accent); }
}

.mainnav .navlive { display: inline-flex; align-items: center; gap: 5px; }
.livedot {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--cat2);
  box-shadow: 0 0 0 0 color-mix(in srgb, var(--cat2) 60%, transparent);
  animation: livepulse 2s infinite;
}
@keyframes livepulse {
  0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--cat2) 55%, transparent); }
  70% { box-shadow: 0 0 0 6px transparent; }
  100% { box-shadow: 0 0 0 0 transparent; }
}
@media (prefers-reduced-motion: reduce) { .livedot { animation: none; } }

/* grouped disclosure menu */
.navmenu { position: relative; }
.navmenu summary {
  list-style: none;
  cursor: pointer;
  font-size: 13.5px;
  font-weight: 700;
  color: var(--ink2);
  padding: 6px 10px;
  border-bottom: 2px solid transparent;
  white-space: nowrap;
}
.navmenu summary::-webkit-details-marker { display: none; }
.navmenu summary::after { content: " \25BE"; color: var(--muted); }
@media (hover: hover) { .navmenu summary:hover { color: var(--ink); } }
.navmenu summary.active { color: var(--ink); border-bottom-color: var(--accent); }
.navmenu[open] summary { color: var(--ink); }
.navpanel {
  position: absolute;
  left: 0;
  top: calc(100% + 6px);
  background: var(--paper);
  border: 1px solid var(--base);
  box-shadow: var(--shadow);
  padding: 12px 16px;
  z-index: 50;
  min-width: 190px;
  max-height: 76vh;
  overflow-y: auto;
}
.sportmenu:last-of-type .navpanel { left: auto; right: 0; }
.navcol h3 {
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 400;
  text-transform: uppercase;
  letter-spacing: .1em;
  color: var(--muted);
  margin-bottom: 6px;
}
.navcol a {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  text-decoration: none;
  color: var(--ink2);
  font-size: 13.5px;
  font-weight: 600;
  padding: 4px 0;
}
@media (hover: hover) { .navcol a:hover { color: var(--accent-deep); } }
.navcol a[aria-current="page"] { color: var(--ink); }
.navcol a.navcombo {
  color: var(--ink);
  font-weight: 700;
  border-bottom: 1px solid var(--hair);
  padding-bottom: 6px;
  margin-bottom: 2px;
}
.navcol a.navcombo::before { content: "◫ "; color: var(--accent); }
.navcol a.navcombo:last-of-type { margin-bottom: 6px; }
/* "More" and "Alerts" are the supporter-tool entries: plain blue text so they
   stand out cleanly, and they stay blue whether or not you have unlocked. */
/* Alerts is a <button> (it opens the modal, not a page), so strip the native
   button chrome or it renders boxed next to the plain anchor nav links. */
.mainnav .navalerts {
  background: none;
  border: 0;
  border-bottom: 2px solid transparent;   /* hover parity with .navlink */
  font: inherit;
  font-size: 13.5px;
  font-weight: 700;
  cursor: pointer;
  text-align: left;
}
.navmore > summary, .mainnav .navalerts { color: var(--accent); }
.navmore > summary { font-weight: 700; }
@media (hover: hover) { .navmore > summary:hover, .mainnav .navalerts:hover { color: var(--accent-deep); border-bottom-color: var(--accent); } }
.navmore[open] > summary, .navmore > summary.active { color: var(--accent); border-bottom-color: var(--accent); }
.navmore > summary::after { color: var(--accent); }
/* Star on the flagship league of each sport. */
.primary-star { color: var(--accent); vertical-align: middle; flex: none; margin-left: 1px; }
.tname .primary-star { margin-left: 5px; }

/* Embedded explainer video (about page). */
.yt-embed {
  position: relative; width: 100%; max-width: 720px;
  aspect-ratio: 16 / 9; margin: 20px 0 6px;
  border: 1px solid var(--hair); border-radius: 6px; overflow: hidden;
  background: var(--surface); box-shadow: var(--shadow);
}
.yt-embed iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.yt-cap { font-size: 13px; color: var(--muted); margin: 0 0 18px; }

.badge {
  font-family: var(--mono);
  font-size: 8.5px;
  font-weight: 400;
  text-transform: uppercase;
  letter-spacing: .05em;
  padding: 1px 5px;
  border: 1px solid var(--base);
  color: var(--ink2);
  white-space: nowrap;
}
.badge.wom { border-color: var(--cat2); color: var(--cat2); }
.badge.col { border-color: var(--cat3); color: var(--cat3); }
.badge.intl { border-color: var(--accent); color: var(--accent-deep); }
.badge.combo { border-color: var(--accent); color: var(--accent-deep); background: color-mix(in srgb, var(--accent) 8%, transparent); }
.tile-combo { border-color: var(--base); }
.tile-combo .tname { color: var(--accent-deep); }
.themebtn {
  border: 1px solid var(--base);
  background: none;
  color: var(--ink2);
  font-family: var(--mono);
  font-size: 12px;
  padding: 5px 10px;
  cursor: pointer;
}
@media (hover: hover) { .themebtn:hover { color: var(--ink); border-color: var(--ink2); } }

/* ---------- league workspace ---------- */
.workspace {
  flex: 1;
  display: grid;
  grid-template-columns: 1fr 300px;
  grid-template-rows: auto 1fr;
  min-height: 0;
}
.leaguebar {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 18px;
  padding: 10px 20px;
  border-bottom: 1px solid var(--hair);
  background: var(--paper);
}
.leaguebar h1 {
  font-family: var(--disp);
  font-weight: 800;
  font-size: 26px;
  letter-spacing: .03em;
  text-transform: uppercase;
  margin-right: 4px;
}
.leaguebar .era { font-family: var(--mono); font-size: 12px; color: var(--muted); }

.ctl { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--ink2); }
.ctl label { font-weight: 700; font-size: 12px; }
/* Filter controls collapse behind a "Filters" toggle on phones (desktop shows
   them all: .ctlwrap is display:contents so its children flow into the bar). */
.ctlwrap { display: contents; }
.ctlwrap-extra { display: contents; }
.filt-cb { position: absolute; width: 1px; height: 1px; opacity: 0; margin: -1px; overflow: hidden; }
.filt-toggle { display: none; }
.seg { display: flex; border: 1px solid var(--base); }
.seg button {
  border: 0;
  background: none;
  color: var(--ink2);
  font-family: var(--body);
  font-size: 12.5px;
  font-weight: 700;
  padding: 5px 10px;
  cursor: pointer;
  border-right: 1px solid var(--base);
}
.seg button:last-child { border-right: 0; }
@media (hover: hover) { .seg button:hover { color: var(--ink); background: var(--surface); } }
.seg button[aria-checked="true"] { background: var(--ink); color: var(--paper); }
.chk { display: inline-flex; align-items: center; gap: 5px; cursor: pointer; font-size: 12.5px; }
.chk input { accent-color: var(--accent); width: 14px; height: 14px; }
.numin {
  font-family: var(--mono);
  font-size: 12.5px;
  width: 64px;
  padding: 4px 6px;
  border: 1px solid var(--base);
  background: var(--surface);
  color: var(--ink);
}
.lookup { display: flex; }
.lookup input {
  font-family: var(--mono);
  font-size: 12.5px;
  width: 230px;   /* wide enough for the full "Jump to a score, e.g. 27-24" placeholder */
  padding: 4px 8px;
  border: 1px solid var(--base);
  border-right: 0;
  background: var(--surface);
  color: var(--ink);
}
.lookup input::placeholder { color: var(--muted); }
.lookup button {
  border: 1px solid var(--base);
  background: var(--ink);
  color: var(--paper);
  font-size: 12px;
  font-weight: 700;
  padding: 4px 10px;
  cursor: pointer;
}
@media (hover: hover) { .lookup button:hover { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); } }

/* ---------- grid stage ---------- */
.stage { position: relative; min-width: 0; min-height: 0; background: var(--surface); }
.stage canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; touch-action: pan-y; }
.stage:focus-visible { outline-offset: -2px; }
/* Prominent floating 2D/3D toggle, top-right over the grid canvas (the flat
   toolbar button was easy to miss). Reads its active state via aria-pressed. */
.stage-viewbtn {
  position: absolute;
  top: 42px; right: 14px;   /* below the top "WINNING SCORE" axis header/ruler */
  right: calc(14px + env(safe-area-inset-right));   /* clear the landscape notch */
  z-index: 20;
  padding: 8px 15px;
  font: 700 13px var(--mono);
  letter-spacing: .04em;
  color: var(--ink);
  background: var(--paper);
  border: 1px solid var(--base);
  box-shadow: var(--shadow);
  cursor: pointer;
  transition: background .12s, border-color .12s, color .12s;
}
.stage-viewbtn[aria-pressed="true"] {
  background: var(--accent); border-color: var(--accent); color: var(--accent-ink);
}
@media (hover: hover) {
  .stage-viewbtn:hover { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
}
@media (max-width: 700px) {
  .stage-viewbtn {
    top: 38px; right: 10px; padding: 7px 12px; font-size: 12px;
    right: calc(10px + env(safe-area-inset-right));
  }
}
.zoomctl {
  position: absolute;
  right: 14px;
  right: calc(14px + env(safe-area-inset-right));   /* clear the landscape notch */
  bottom: 14px;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow);
}
.zoomctl button {
  width: 34px; height: 34px;
  border: 1px solid var(--base);
  border-top-width: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--mono);
  font-size: 15px;
  cursor: pointer;
}
.zoomctl button:first-child { border-top-width: 1px; }
@media (hover: hover) { .zoomctl button:hover { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); } }

.legend {
  position: absolute;
  left: 58px;
  bottom: 14px;
  background: var(--paper);
  border: 1px solid var(--hair);
  padding: 8px 12px;
  font-family: var(--mono);
  font-size: 10.5px;
  color: var(--ink2);
  box-shadow: var(--shadow);
  max-width: min(430px, calc(100% - 130px));
}
.legend .ramp { display: flex; height: 10px; margin: 5px 0 2px; }
.legend .ramp i { flex: 1; }
.legend .lab { display: flex; justify-content: space-between; gap: 8px; }
.legend .keys { display: flex; gap: 12px; margin-top: 6px; flex-wrap: wrap; }
.legend .key { display: inline-flex; align-items: center; gap: 5px; }
.legend .sw { width: 10px; height: 10px; border: 1px solid var(--base); display: inline-block; }

/* tooltip */
.tip {
  position: absolute;
  pointer-events: none;
  background: var(--paper);
  border: 1px solid var(--base);
  box-shadow: var(--shadow);
  padding: 10px 12px;
  font-size: 12.5px;
  min-width: 200px;
  max-width: 280px;
  z-index: 30;
  display: none;
}
.tip.on { display: block; }
.tip .score {
  font-family: var(--disp);
  font-weight: 800;
  font-size: 24px;
  letter-spacing: .02em;
  line-height: 1.1;
}
.tip .state { font-family: var(--mono); font-size: 11px; color: var(--ink2); margin-bottom: 6px; }
.tip .state.never { color: var(--muted); }
/* A score's share of all games: a quiet aside, never the headline. */
.tshare { color: var(--muted); }
.cshare { font-family: var(--mono); font-size: 11.5px; color: var(--muted); margin: -2px 0 8px; }
.tip .row { margin-top: 4px; }
.tip .row b { font-size: 12px; }
.tip .lab { font-family: var(--mono); font-size: 10px; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
.tip .ff { color: var(--cat2); font-size: 11.5px; margin-top: 5px; }
.tip-live {
  background: var(--cat2);
  color: #fff;
  margin: -10px -12px 8px;
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 700;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 6px;
}
.tip-live .livedot { background: #fff; }
.tip-live .lab { color: rgba(255,255,255,.85); flex-basis: 100%; font-weight: 400; }
.livetoggle { display: inline-flex; align-items: center; gap: 5px; }
.livetoggle[aria-pressed="true"] { border-color: var(--cat2); color: var(--cat2); }
.livetoggle.off .livedot { background: var(--muted); animation: none; }

/* ---------- sidebar ---------- */
.side {
  border-left: 1px solid var(--hair);
  background: var(--paper);
  overflow-y: auto;
  min-height: 0;
}
.side section { padding: 16px 18px; border-bottom: 1px solid var(--hair); }
.side h2 {
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 400;
  text-transform: uppercase;
  letter-spacing: .1em;
  color: var(--muted);
  margin-bottom: 10px;
}
.stat { display: flex; justify-content: space-between; align-items: baseline; padding: 3px 0; font-size: 13px; color: var(--ink2); }
.stat b { font-family: var(--mono); font-size: 14px; color: var(--ink); font-weight: 600; }
.stat.big { display: block; }
.stat.big b { font-family: var(--disp); font-size: 34px; font-weight: 800; display: block; line-height: 1; }
.spark { width: 100%; height: 44px; display: block; margin-top: 6px; cursor: pointer; }
.expandbtn {
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 400;
  text-transform: none;
  letter-spacing: 0;
  color: var(--ink2);
  background: none;
  border: 1px solid var(--base);
  padding: 2px 6px;
  margin-left: 6px;
  cursor: pointer;
  vertical-align: middle;
}
@media (hover: hover) { .expandbtn:hover { color: var(--accent-deep); border-color: var(--accent); } }

/* timeline modal */
.tl-overlay {
  position: fixed;
  inset: 0;
  background: color-mix(in srgb, var(--ink) 45%, transparent);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 90;
  padding: 20px;
}
.tl-overlay.on { display: flex; }
.tl-modal {
  background: var(--paper);
  border: 1px solid var(--base);
  box-shadow: var(--shadow);
  width: min(920px, 96vw);
  max-height: 90vh;         /* fallback for pre-dvh browsers */
  max-height: 90dvh;        /* the VISIBLE viewport, not the toolbar-collapsed one */
  padding: 18px 20px 16px;
  display: flex;
  flex-direction: column;
}
.tl-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.tl-head h2 {
  font-family: var(--disp); font-weight: 800; font-size: 24px;
  letter-spacing: .03em; text-transform: uppercase;
}
.tl-close {
  border: 1px solid var(--base); background: none; color: var(--ink2);
  font-family: var(--mono); font-size: 12px; padding: 5px 12px; cursor: pointer;
}
@media (hover: hover) { .tl-close:hover { border-color: var(--accent); color: var(--accent-deep); } }
.tl-readout { font-size: 14px; color: var(--ink2); margin: 8px 0 4px; min-height: 20px; }
.tl-readout b { font-family: var(--disp); font-size: 20px; }
.tl-canvaswrap { flex: 1; min-height: 260px; position: relative; }
#tl-canvas { width: 100%; height: 46vh; min-height: 240px; display: block; }
.tl-note { font-family: var(--mono); font-size: 10.5px; color: var(--muted); margin-top: 8px; }
/* Scores-that-were-new panel, pinned to the chart's top-right (the tall
   early-season bars live on the left). HOVER = a translucent preview of the
   score chips (pointer-events pass through to the bars). CLICK = an expanded,
   scrollable panel (.pinned) with each score's matchup + date, interactive. */
.tl-tip {
  position: absolute; top: 8px; right: 8px;
  width: min(300px, 48%);
  max-height: calc(100% - 16px);
  overflow: auto;
  overscroll-behavior: contain;   /* pinned-panel flicks must not scroll the page */
  background: var(--paper); border: 1px solid var(--hair);
  box-shadow: var(--shadow); padding: 8px 10px;
  opacity: 0; visibility: hidden; transition: opacity .1s;
  pointer-events: none;
}
.tl-tip.on { opacity: 1; visibility: visible; }
.tl-tip.pinned { width: min(360px, 64%); pointer-events: auto; border-color: var(--base); }
.tl-tip-h {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  font: 700 11px var(--mono); color: var(--ink);
  text-transform: uppercase; letter-spacing: .05em; margin-bottom: 7px;
}
.tl-tip.pinned .tl-tip-h {
  position: sticky; top: -8px; background: var(--paper);
  margin: -8px -10px 6px; padding: 8px 10px 6px; border-bottom: 1px solid var(--hair);
}
.tl-tip-x {
  flex: none; background: none; border: 0; cursor: pointer;
  color: var(--muted); font: 400 15px/1 var(--body); padding: 0 2px;
}
@media (hover: hover) { .tl-tip-x:hover { color: var(--ink); } }
.tl-tip-scores { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; }
.tl-tip-scores span {
  font: 500 11px var(--mono); color: var(--ink2);
  background: var(--surface); border: 1px solid var(--hair); padding: 1px 5px;
}
.tl-tip-scores em { font: 500 11px var(--body); color: var(--muted); font-style: normal; }
/* expanded rows: score · winner over loser · date */
.tl-tip-list { list-style: none; margin: 0; padding: 0; }
.tl-tip-list li {
  display: flex; align-items: baseline; gap: 8px;
  padding: 5px 0; border-top: 1px solid var(--hair);
}
.tl-tip-list li:first-child { border-top: 0; }
.tl-r-s { flex: none; min-width: 44px; font: 700 12px var(--mono); color: var(--ink); }
.tl-r-m { flex: 1; min-width: 0; font: 400 12px/1.35 var(--body); color: var(--ink2);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tl-r-m i { color: var(--muted); font-style: normal; }
.tl-r-d { flex: none; font: 400 10.5px var(--mono); color: var(--muted); }
.tl-tip-empty { margin: 0; font: 400 12px var(--body); color: var(--muted); }
.tl-cue { font: 600 9.5px var(--mono); color: var(--accent); text-transform: uppercase; letter-spacing: .06em; margin-left: 8px; }

/* detail panel */
.detail .score {
  font-family: var(--disp);
  font-weight: 800;
  font-size: 44px;
  line-height: 1;
}
.detail .state { font-family: var(--mono); font-size: 11.5px; color: var(--ink2); margin: 2px 0 12px; }
.detail .occ { padding: 8px 0; border-top: 1px solid var(--hair); font-size: 13px; }
.detail .occ .lab { font-family: var(--mono); font-size: 10px; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
.detail .share {
  margin-top: 12px;
  width: 100%;
  border: 1px solid var(--base);
  background: none;
  color: var(--ink2);
  font-family: var(--mono);
  font-size: 12px;
  padding: 7px 0;
  cursor: pointer;
}
@media (hover: hover) { .detail .share:hover { border-color: var(--accent); color: var(--accent-deep); } }
.detail .empty { color: var(--muted); font-size: 13px; }
/* Supporter "see every game at this score" expander */
.detail .allgames {
  margin-top: 12px; width: 100%;
  border: 1px solid var(--base); background: none; color: var(--accent-deep);
  font-family: var(--mono); font-size: 12px; padding: 7px 0; cursor: pointer;
}
@media (hover: hover) { .detail .allgames:hover { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 8%, transparent); } }
.detail .allgames-list { margin-top: 8px; max-height: 320px; overflow: auto; border-top: 1px solid var(--hair); }
.detail .ag-head { font-family: var(--mono); font-size: 10px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); padding: 8px 0 4px; }
.detail .ag-row { display: flex; justify-content: space-between; gap: 10px; padding: 5px 0; border-top: 1px solid var(--hair); font-size: 12.5px; }
.detail .ag-row:first-of-type { border-top: 0; }
.detail .ag-m { color: var(--ink2); min-width: 0; }
.detail .ag-m i { color: var(--muted); font-style: normal; }
.detail .ag-d { flex: none; color: var(--muted); font-size: 10.5px; white-space: nowrap; }
.detail .ag-more { color: var(--muted); font-size: 11.5px; padding: 6px 0 0; }

/* ---------- table view ---------- */
.tablewrap { display: none; overflow: auto; background: var(--surface); }
.workspace.tableview .stage { display: none; }
.workspace.tableview .tablewrap { display: block; }
.scoretable { border-collapse: collapse; width: 100%; font-size: 13px; }
.scoretable caption { text-align: left; padding: 10px 16px; color: var(--ink2); font-size: 12.5px; }
.scoretable th, .scoretable td { padding: 6px 14px; text-align: left; border-bottom: 1px solid var(--hair); }
.scoretable th {
  font-family: var(--mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .07em;
  color: var(--ink2);
  font-weight: 400;
  position: sticky;
  top: 0;
  background: var(--paper);
  cursor: pointer;
  white-space: nowrap;
}
@media (hover: hover) { .scoretable th:hover { color: var(--ink); } }
.scoretable th[aria-sort]:not([aria-sort="none"]) { color: var(--accent-deep); }
.scoretable th button {
  font: inherit;
  color: inherit;
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
  text-transform: inherit;
  letter-spacing: inherit;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.scoretable th button::after { content: ""; }
.scoretable th[aria-sort="ascending"] button::after { content: "\2191"; }
.scoretable th[aria-sort="descending"] button::after { content: "\2193"; }
.scoretable td.num { font-family: var(--mono); font-size: 12.5px; }
@media (hover: hover) { .scoretable tbody tr:hover { background: color-mix(in srgb, var(--accent) 8%, transparent); } }

/* ---------- generic page (home/about/recent) ---------- */
.page { max-width: 1100px; margin: 0 auto; padding: 40px 20px 80px; width: 100%; }
.page h1 {
  font-family: var(--disp);
  font-weight: 800;
  font-size: clamp(34px, 6vw, 58px);
  line-height: 1.02;
  letter-spacing: .015em;
  text-transform: uppercase;
}
.page .lede { font-size: 17px; color: var(--ink2); max-width: 640px; margin-top: 14px; }
.page h2 {
  font-family: var(--disp);
  font-weight: 700;
  font-size: 24px;
  letter-spacing: .03em;
  text-transform: uppercase;
  margin: 44px 0 14px;
}
.page p { max-width: 680px; margin-bottom: 12px; }
.page a { text-decoration-color: var(--base); text-underline-offset: 3px; }
@media (hover: hover) { .page a:hover { text-decoration-color: var(--accent); color: var(--accent-deep); } }

/* ---------- home ---------- */
.home .hero {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
  gap: 40px;
  align-items: center;
  padding: 30px 0 10px;
}
.qscore { color: var(--accent); font-variant-numeric: tabular-nums; }
.herostat { margin-top: 26px; font-size: 14px; }
.herostat .lab {
  display: block;
  font-family: var(--mono);
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--muted);
  margin-bottom: 3px;
}
.herostat b { font-family: var(--disp); font-size: 22px; font-weight: 800; margin-right: 4px; }
.herostat a { text-decoration: none; }
@media (hover: hover) { .herostat a:hover b { color: var(--accent); } }
.herogridwrap { position: relative; width: 100%; margin: 0; }
#herogrid {
  display: block;
  border: 1px solid var(--hair);
  background: var(--surface);
  image-rendering: pixelated;
}
.herocap {
  margin-top: 8px;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--muted);
}
.herocap span { color: var(--ink2); }
.heroyear {
  position: absolute;
  right: 10px;
  bottom: 6px;
  font-family: var(--disp);
  font-weight: 800;
  font-size: 34px;
  color: var(--base);
  letter-spacing: .03em;
}
.tiles {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 14px;
  margin-bottom: 8px;
}
.tile {
  display: flex;
  flex-direction: column;
  gap: 3px;
  border: 1px solid var(--hair);
  background: var(--surface);
  padding: 14px 14px 12px;
  text-decoration: none;
}
@media (hover: hover) { .tile:hover { border-color: var(--accent); } }
@media (hover: hover) { .tile:hover .tname { color: var(--accent); } }
.tile img {
  width: 100%;
  max-height: 130px;
  object-fit: contain;
  object-position: left top;
  image-rendering: pixelated;
  margin-bottom: 8px;
}
.tile .tname {
  font-family: var(--disp);
  font-weight: 800;
  font-size: 20px;
  letter-spacing: .03em;
  text-transform: uppercase;
}
.tile .tmeta { font-family: var(--mono); font-size: 11px; color: var(--muted); }
.tile .tbadges { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; margin: 2px 0 3px; }
.tile .tregion { font-family: var(--mono); font-size: 10px; color: var(--muted); }
.tile[hidden] { display: none; }

/* directory + filters */
.directory { margin-top: 26px; }
.filters {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 22px;
  padding: 14px 0 12px;
  border-top: 1px solid var(--hair);
  border-bottom: 1px solid var(--hair);
  position: sticky;
  top: 54px;
  background: var(--paper);
  z-index: 10;
}
.filterrow { display: flex; align-items: center; gap: 8px; }
.flabel {
  font-family: var(--mono);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: .09em;
  color: var(--muted);
}
.chips { display: flex; flex-wrap: wrap; gap: 4px; }
.chip {
  font-family: var(--body);
  font-size: 12.5px;
  font-weight: 700;
  color: var(--ink2);
  background: none;
  border: 1px solid var(--base);
  padding: 4px 10px;
  cursor: pointer;
}
@media (hover: hover) { .chip:hover { color: var(--ink); border-color: var(--ink2); } }
.chip.on { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.lookupwrap { margin-left: auto; }
#leaguesearch {
  font-family: var(--mono);
  font-size: 12.5px;
  padding: 5px 10px;
  border: 1px solid var(--base);
  background: var(--surface);
  color: var(--ink);
  width: 160px;
}
#leaguesearch::placeholder { color: var(--muted); }
.filtercount { font-family: var(--mono); font-size: 11px; color: var(--muted); margin: 10px 0 4px; }
.sportgroup[hidden] { display: none; }
.sportgroup h2 { margin: 26px 0 12px; }
.grouphint { color: var(--muted); font-size: 13px; margin: -6px 0 12px; max-width: 640px; }
.combogroup h2 { color: var(--accent-deep); }
.howhead { margin-top: 46px; }
.visually-hidden {
  position: absolute; width: 1px; height: 1px;
  overflow: hidden; clip-path: inset(50%); white-space: nowrap;
}

/* about + recent */
.abouttable th { position: static; cursor: default; }
.abouttable td { vertical-align: top; font-size: 12.5px; }
.liclist { max-width: 680px; padding-left: 20px; }
.liclist li { margin-bottom: 8px; font-size: 13.5px; color: var(--ink2); }
.feed { list-style: none; max-width: 680px; }
.feed li {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  gap: 4px 14px;
  align-items: baseline;
  padding: 12px 0;
  border-bottom: 1px solid var(--hair);
}
/* The whole feed row is one tap target (was only the small score link). */
.feed .fscorelink::after { content: ""; position: absolute; inset: 0; }
.feed .fteams, .feed .fmeta { position: relative; }
.feed .fscore { font-family: var(--disp); font-weight: 800; font-size: 24px; }
.feed a { text-decoration: none; }
@media (hover: hover) { .feed a:hover .fscore { color: var(--accent); } }
.feed .fmeta { font-family: var(--mono); font-size: 11.5px; color: var(--muted); }
.feed .empty { color: var(--muted); border-bottom: 0; }
.feed .fresh .fscore { color: var(--accent-deep); }
.feed .newtag {
  color: var(--cat2);
  font-family: var(--mono);
  text-transform: uppercase;
  letter-spacing: .08em;
}
.feed .fteams { display: inline-flex; align-items: center; gap: 7px; }
.feed .fcrest {
  width: 20px; height: 20px; object-fit: contain; flex: none;
  vertical-align: middle; border-radius: 3px;
}
/* Skeleton rows while the feed loads. */
.feed .fskel { justify-content: flex-start; gap: 14px; }
.feed .fskel .pf-skel { height: 20px; display: inline-block; }
.feed .fskel-a { width: 54px; }
.feed .fskel-b { width: min(46vw, 260px); }
.feed .fskel-c { width: 90px; }

/* ---------- skeleton loaders ---------- */
.skel {
  position: relative;
  overflow: hidden;
  background: color-mix(in srgb, var(--ink) 8%, var(--surface));
  border-radius: 4px;
}
.skel::after {
  content: "";
  position: absolute;
  inset: 0;
  transform: translateX(-100%);
  background: linear-gradient(90deg, transparent,
    color-mix(in srgb, var(--ink) 10%, transparent), transparent);
  animation: skelsheen 1.25s infinite;
}
@keyframes skelsheen { to { transform: translateX(100%); } }
@media (prefers-reduced-motion: reduce) { .skel::after { animation: none; } }
/* full-stage grid placeholder while the artifact loads */
.stage-skel { position: absolute; inset: 0; z-index: 3; background: var(--surface); }
/* Hint the actual grid: a winner-across / loser-down triangle, a legend strip
   bottom-left, and the zoom buttons bottom-right, so the placeholder matches
   what renders in. */
.stage-skel-canvas {
  position: absolute; left: 4%; top: 6%; width: 72%; height: 72%;
  clip-path: polygon(0 0, 100% 0, 100% 100%);
}
.stage-skel-legend { position: absolute; left: 4%; bottom: 6%; display: flex; align-items: center; gap: 8px; }
.stage-skel-legend .skel { width: 56px; height: 12px; }
.stage-skel-legend .skel:first-child { width: 88px; }
.stage-skel-zoom { position: absolute; right: 16px; bottom: 16px; display: flex; flex-direction: column; gap: 6px; }
.stage-skel-zoom .skel { width: 30px; height: 30px; }

@media (max-width: 800px) {
  .home .hero { grid-template-columns: 1fr; gap: 26px; }
  .herogridwrap { justify-self: start; max-width: 100%; overflow: hidden; }
}

footer {
  border-top: 1px solid var(--hair);
  padding: 18px 20px;
  /* Keep footer links clear of the home indicator and landscape corners. */
  padding: 18px max(20px, env(safe-area-inset-right)) calc(18px + env(safe-area-inset-bottom)) max(20px, env(safe-area-inset-left));
  font-size: 12.5px;
  color: var(--muted);
  display: flex;
  flex-wrap: wrap;
  gap: 6px 22px;
}
footer a { color: var(--ink2); }

/* ---------- mobile ---------- */
.sheetgrab { display: none; }
@media (max-width: 900px) {
  .workspace { grid-template-columns: 1fr; grid-template-rows: auto 1fr auto; }
  .stage { min-height: 58vh; }
  .side {
    border-left: 0;
    border-top: 1px solid var(--base);
    max-height: 34vh;
    transition: max-height .25s ease;
  }
  /* the grab handle expands the stats sheet (previously a no-op: nothing
     listened for .side.open) */
  .side.open { max-height: 82vh; }
  .sheetgrab {
    display: block;
    width: 100%;
    background: var(--paper);
    border: 0;
    padding: 10px 0 8px;
    cursor: pointer;
  }
  /* comfortable touch targets for the leaguebar / filter controls */
  .seg, .seg button, .themebtn, .chip, .numin, .lookup input, .lookup button, #leaguesearch,
  .navtoggle, .zoomctl button, .stage-viewbtn, .sheetgrab {
    min-height: 44px;
  }
  .zoomctl button, .stage-viewbtn { min-width: 44px; }
  .chip { padding: 0 14px; }
  .chk { min-height: 44px; display: inline-flex; align-items: center; padding: 6px 4px; }
  .sheetgrab::before {
    content: "";
    display: block;
    width: 44px; height: 4px;
    background: var(--base);
    margin: 0 auto;
  }
  /* Table view is ONE scroller: the page. The table takes its natural height
     (the old 1fr row left it a ~250px inner scroll window) and the grid-only
     stats sheet stays out of the way. Sort headers re-stick below the 54px
     site header, which stays sticky above them. */
  .workspace.tableview { grid-template-rows: auto auto; }
  .workspace.tableview .tablewrap { overflow: visible; }
  .workspace.tableview .side { display: none; }
  .workspace.tableview .scoretable th { top: 54px; }
  /* Keep the floating grid controls clear of the iPhone home-indicator bar. */
  .zoomctl { bottom: calc(14px + env(safe-area-inset-bottom)); }
  .livetoast { bottom: calc(16px + env(safe-area-inset-bottom)); }
  /* The legend floats over a tiny grid; shrink it, make it translucent, and
     let taps fall through to the cells beneath. */
  .legend {
    left: 10px; bottom: calc(10px + env(safe-area-inset-bottom));
    padding: 6px 9px;
    background: color-mix(in srgb, var(--paper) 82%, transparent);
    backdrop-filter: blur(2px);
    pointer-events: none;
    max-width: 60%;
  }
  .leaguebar {
    padding: 10px 14px; gap: 8px 12px;
    padding-left: max(14px, env(safe-area-inset-left));
    padding-right: max(14px, env(safe-area-inset-right));
  }
  .leaguebar h1 { font-size: 22px; }
  /* Jump-to-score stays out of the Filters collapse but now SHARES its row
     with the Live / Table view buttons (those two alone wasted a whole row).
     The input flexes down; long league titles may still wrap, which is fine. */
  /* Basis 128px: small enough that lookup + Live + Table pack one 375px row
     (wrapping is decided on basis, before grow); lookup then grows to fill. */
  .lookup { flex: 1 1 128px; min-width: 0; }
  .lookup input { flex: 1; min-width: 72px; }
  .hdr { padding: 0 max(14px, env(safe-area-inset-right)) 0 max(14px, env(safe-area-inset-left)); gap: 12px; }
  /* Collapse the filter controls behind a Filters toggle to cut the clutter. */
  .filt-toggle {
    display: inline-flex; align-items: center; gap: 6px;
    border: 1px solid var(--base); background: none; color: var(--ink2);
    font: 12px var(--mono); padding: 0 14px; min-height: 44px; cursor: pointer;
  }
  .filt-toggle::after { content: "\25BE"; font-size: 9px; }
  .filt-cb:checked ~ .filt-toggle::after { content: "\25B4"; }
  .filt-cb:focus-visible ~ .filt-toggle { outline: 2px solid var(--accent); outline-offset: 2px; }
  .ctlwrap { display: none; }
  .filt-cb:checked ~ .ctlwrap {
    display: flex; flex-wrap: wrap; align-items: flex-start; gap: 12px; width: 100%;
    margin-top: 4px;
    max-height: 52vh; overflow-y: auto;
    overscroll-behavior: contain;   /* flicks past the sheet end must not move the page */
    padding: 4px 2px 8px;
  }
  /* Leagues with no sub-toggles render an empty #subctls; hide it so the open
     sheet does not carry a phantom 12px gap row. */
  #subctls:empty { display: none; }
  /* Inside the open Filters sheet the mode/type segments and the PRO buttons
     each take a full row so they stack cleanly instead of cramming. */
  .filt-cb:checked ~ .ctlwrap .ctl,
  .filt-cb:checked ~ .ctlwrap .seg { flex: 1 1 100%; }
  /* The three PRO rows must read as one set: Teams is an <a>, Alerts/Export
     are <button>s, and the UA centers only the buttons. Center all three. */
  .ctlwrap-extra .themebtn {
    flex: 1 1 100%;
    display: inline-flex; align-items: center; justify-content: center;
  }
  .filt-cb:checked ~ .ctlwrap .seg { display: flex; }
  .filt-cb:checked ~ .ctlwrap .seg button { flex: 1; }
}

/* Touch target sizing for the small side-panel / timeline / table-sort
   controls: a 44px effective hit area on coarse pointers. Padding plus
   negative margin grows the target, not the layout; mouse layouts keep the
   compact boxes. Placed after the base rules so it wins the cascade. */
@media (pointer: coarse) {
  .expandbtn { min-height: 44px; padding: 8px 14px; font-size: 12px; }
  /* Most-common / latest-scorigami cell shortcuts (class set by JS). */
  .stat .clickcell, .stat.big.clickcell {
    display: inline-block;
    padding: 12px 0;
    margin: -8px 0;
  }
  .detail .share, .detail .allgames { padding: 12px 0; }
  .tl-close { min-height: 44px; padding: 10px 16px; }
  .tl-tip-x {
    min-width: 44px; min-height: 44px;
    display: inline-flex; align-items: center; justify-content: center;
    margin: -12px -10px -12px 0;
  }
  .scoretable th button { min-height: 44px; }
}

/* One-line legend on phones: the stacked card ran ~86px tall over a ~390px
   grid. The mode title yields to the ramp, the stop labels collapse to
   min-max, and the never / impossible keys sit inline. */
@media (max-width: 700px) {
  .legend {
    display: flex; align-items: center; gap: 8px;
    padding: 5px 9px;
    max-width: calc(100% - 76px);   /* still clear of the zoom stack */
  }
  .legend #leg-title { display: none; }
  .legend .ramp { flex: none; width: 56px; height: 8px; margin: 0; }
  .legend .lab { flex: none; gap: 3px; font-size: 9.5px; }
  .legend .lab span:not(:first-child):not(:last-child) { display: none; }
  .legend .lab span:first-child:not(:last-child)::after { content: "-"; margin-left: 3px; color: var(--muted); }
  .legend .keys { margin-top: 0; gap: 8px; flex: none; flex-wrap: nowrap; white-space: nowrap; }
}

/* Drawer nav up to 1300px: the full desktop nav needs ~1285px, and with
   body overflow-x:hidden anything past the right edge is unreachable. */
@media (max-width: 1300px) {
  .navtoggle { display: flex; }
  .mainnav {
    display: none;
    position: fixed;
    top: 54px;
    left: 0; right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    background: var(--paper);
    border-bottom: 1px solid var(--base);
    box-shadow: var(--shadow);
    /* Safe-area padding: the last drawer row must clear the home indicator
       and the landscape notch (viewport-fit=cover is set site-wide). */
    padding: 4px max(14px, env(safe-area-inset-right)) calc(14px + env(safe-area-inset-bottom)) max(14px, env(safe-area-inset-left));
    /* 102px = 54px header + a 48px scrim strip that stays tappable below a
       full drawer, so tap-outside-to-close always works. dvh tracks the
       VISIBLE viewport (mobile URL bar shown); the vh line is the fallback. */
    max-height: calc(100vh - 102px);
    max-height: calc(100dvh - 102px);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    z-index: 60;
    overscroll-behavior: contain;
  }
  .hdr.navopen .mainnav { display: flex; }
  /* Dim + tap-to-close scrim behind the open drawer; page scroll is locked. */
  .hdr.navopen::after {
    content: ""; position: fixed; inset: 54px 0 0; z-index: 55;
    background: color-mix(in srgb, var(--ink) 45%, transparent);
  }
  body.nav-locked { overflow: hidden; }
}

/* body{overflow:hidden} alone does not stop the ROOT scroller on phones (iOS
   especially): with the drawer or an overlay open, swipes kept scrolling the
   page underneath and the reader lost their place. Lock the root itself for
   every overlay lock class (drawer, paywall/alerts/export modals, game
   centre). */
html:has(body.nav-locked), html:has(body.pw-open), html:has(body.gc-open) {
  overflow: hidden;
}

@media (max-width: 1300px) {
  .mainnav .navlink, .navmenu summary {
    min-height: 48px;
    display: flex; align-items: center;
    padding: 12px 4px;
    border-bottom: 1px solid var(--hair);
    font-size: 16px;
  }
  .navmenu summary { justify-content: space-between; }
  .navmenu { position: static; }
  .navpanel {
    position: static;
    border: 0;
    box-shadow: none;
    padding: 2px 0 6px 10px;
    min-width: 0;
    /* The drawer (.mainnav) is the ONE scroller: the desktop 76vh cap would
       nest a second scroll region inside it and stall swipes mid-list. */
    max-height: none;
    overflow: visible;
  }
  /* The league links inside a sport menu are the whole reason to open it:
     make each a real 44px row, not a cramped desktop text list. */
  .navpanel .navcol a {
    min-height: 44px;
    display: flex; align-items: center;
    padding: 10px 6px;
    font-size: 15px;
    border-bottom: 1px solid var(--hair);
    margin: 0;
  }
  .navcol h3 { padding: 8px 6px 2px; font-size: 11.5px; }
}

@media (max-width: 640px) {
  .filters { position: static; }
  .lookupwrap { margin-left: 0; flex: 1 1 100%; }
  #leaguesearch { width: 100%; }
  /* Phone table: Score, Count and Most recent (only First is cut, so the
     recency sort stays available). Narrow numeric columns leave the width to
     the matchup text; tight rows roughly double the visible density, and the
     sort buttons keep their 44px hit area via the coarse-pointer block. */
  .scoretable th:nth-child(3), .scoretable td:nth-child(3) { display: none; }
  .scoretable th, .scoretable td { padding: 3px 10px; }
  .scoretable { font-size: 13px; line-height: 1.35; }
  .scoretable td.num { white-space: nowrap; }
  .scoretable th:first-child, .scoretable td:first-child { width: 62px; }
  .scoretable th:nth-child(2), .scoretable td:nth-child(2) { width: 48px; }
}

@media (max-width: 560px) {
  /* Directory tiles: two compact tiles per row instead of one tall
     half-empty column, so browsing 45 grids is a short, dense scroll. */
  .tiles { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .tile { padding: 10px 10px 11px; gap: 2px; }
  .tile img { max-height: 78px; margin-bottom: 6px; object-position: center; }
  .tile .tname { font-size: 15.5px; }
  /* The "All grids by sport" combos read better full width. */
  .combogrid .tile-combo, .tiles .tile-combo { grid-column: 1 / -1; }
  .combogrid .tile-combo img, .tiles .tile-combo img { max-height: 120px; }
}

/* live scorigami toast */
.livetoast {
  position: fixed;
  right: 16px;
  bottom: 16px;
  z-index: 80;
  max-width: 340px;
  background: var(--ink);
  color: var(--paper);
  padding: 12px 14px;
  font-size: 13px;
  box-shadow: var(--shadow);
  transform: translateY(140%);
  transition: transform .3s ease;
}
.livetoast.on { transform: translateY(0); }
.livetoast b { color: var(--cat2); font-family: var(--mono); text-transform: uppercase; font-size: 11px; letter-spacing: .06em; margin-right: 6px; }
.livetoast button {
  margin-left: 8px;
  border: 1px solid var(--paper);
  background: none;
  color: var(--paper);
  font-family: var(--mono);
  font-size: 11px;
  padding: 3px 8px;
  cursor: pointer;
}
@media (hover: hover) { .livetoast button:hover { background: var(--paper); color: var(--ink); } }

/* ---------- micro-interactions ---------- */
/* Interactive controls ease their state changes instead of snapping. Kept
   short and subtle; disabled entirely for reduced-motion users below. */
.seg button, .chip, .tile, .themebtn, .navlink, .navcol a, .fscore,
.lookup button, .lookup input, .expandbtn, .zoomctl button, .stage-viewbtn,
.dash-refresh, .lg-gridlink, .filt-toggle, #leaguesearch {
  transition: color .14s ease, background-color .14s ease, border-color .14s ease;
}
@media (hover: hover) {
  /* A quiet lift on the directory tiles and clickable feed/landed rows that
     previously gave no hover feedback at all. */
  .tile { transition: color .14s ease, border-color .14s ease, transform .16s ease, box-shadow .16s ease; }
  .tile:hover { transform: translateY(-2px); box-shadow: 0 6px 18px -10px color-mix(in srgb, var(--ink) 40%, transparent); }
  .feed li:hover { background: color-mix(in srgb, var(--ink) 3%, transparent); }
  .lg-gridlink { text-underline-offset: 2px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .livetoast { transition: none; }
}

/* Crawlable per-league facts: quiet prose below the workspace, same numbers
   the canvas shows, for readers and crawlers alike. */
.gridfacts {
  max-width: 760px;
  margin: 0 auto;
  padding: 26px 20px 34px;
}
.gridfacts h2 {
  font: 700 13px var(--body);
  letter-spacing: .05em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 10px;
}
.gridfacts p {
  font: 400 14px/1.6 var(--body);
  color: var(--ink2);
  margin: 0 0 10px;
}
