/* Black and red: the shell (side menu, filter row, phone bars) and the Next game page.
   Reads tokens.css. Other pages keep styles.css for their own cards until they move over.
   Write-up: docs/design/next-game/README.md */

/* ---------- ground ---------- */
body { background: var(--dc-grain), var(--dc-ground); }
:focus-visible { outline-color: var(--dc-red-text); }

/* ---------- side menu ---------- */
.side { background: var(--dc-panel); border-right: 1px solid var(--dc-line); padding-inline: 0; gap: var(--s-4); }
.side__logo { display: flex; align-items: center; gap: 10px; padding: var(--s-1) var(--s-5);
  font: 800 23px/1 var(--dc-display); letter-spacing: .02em; text-transform: uppercase; color: var(--dc-ink); }
/* the mark: the keyhole from the tab icon (favicon.svg) is the I of GRINDLOCK (docs/design/logo/README.md).
   The real letter stays in the page for copy-paste, hidden from sight; the drawing takes its place.
   Screen readers get the name from the link's aria-label (index.html). */
.side__word { white-space: nowrap; }
.lk { position: relative; display: inline-block; vertical-align: baseline; }
.lk__ch { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
/* exactly the cap height of Big Shoulders Display (0.80em, measured), standing on the baseline,
   a hair of room each side. Width keeps the drawing's 8:17 shape. */
.lk > svg { display: inline-block; vertical-align: baseline; width: .376em; height: .80em; margin: 0 .06em; }
.side__group { font: 700 13px/1 var(--dc-display); letter-spacing: .1em; text-transform: uppercase; color: var(--dc-muted);
  padding: 0 var(--s-5); margin: var(--s-5) 0 var(--s-1); }
.side__nav ul { gap: 0; }
.side__link { border-radius: 0; min-height: 34px; padding: 0 var(--s-5); color: var(--dc-read); font: 500 14px/1.2 var(--dc-text); }
.side__link:hover { background: var(--dc-panel-2); color: var(--dc-ink); }
.side__link[aria-current="page"] { color: var(--dc-ink); background: linear-gradient(90deg, var(--dc-red-tint), transparent 85%); box-shadow: inset 3px 0 0 var(--dc-red); }
.side .acct { border-top: 1px solid var(--dc-line); padding-inline: var(--s-5); }
.acct label { font: 700 13px/1 var(--dc-display); letter-spacing: .08em; text-transform: uppercase; color: var(--dc-muted); }
.acct input { border-radius: var(--dc-r); background: var(--dc-ground); border-color: var(--dc-line-strong); }
.acct input:focus { border-color: var(--dc-red); }
.side .btn--sm { border-radius: var(--dc-r); }

/* ---------- the filter row ---------- */
.scopebar { background: color-mix(in oklab, var(--dc-ground) 92%, transparent); backdrop-filter: blur(6px); border-bottom: 1px solid var(--dc-line); }
.scopebar label, .scopebar .lab { font: 700 13px/1 var(--dc-display); letter-spacing: .08em; text-transform: uppercase; color: var(--dc-muted); }
.scopebar select { border-radius: var(--dc-r); background-color: var(--dc-panel); border-color: var(--dc-line-strong); }
.seg { border-radius: var(--dc-r); background: var(--dc-panel); border-color: var(--dc-line); padding: 0; gap: 0; }
.seg .chip { border-radius: 0; height: 34px; padding: 0 var(--s-4); font: 700 14px/1 var(--dc-display); letter-spacing: .06em; text-transform: uppercase; color: var(--dc-muted); }
.seg .chip + .chip { border-left: 1px solid var(--dc-line); }
.seg .chip:hover { color: var(--dc-ink); background: var(--dc-panel-2); }
.seg .chip.on { background: var(--dc-panel-2); color: var(--dc-ink); box-shadow: inset 0 -2px 0 var(--dc-red); }

/* ---------- phone and tablet bars ---------- */
@media (max-width: 1023px) {
  .tabbar { background: var(--dc-panel); border-top: 1px solid var(--dc-line); }
  .tabbar a, .tabbar button { font: 700 12px/1 var(--dc-display); letter-spacing: .08em; text-transform: uppercase; }
  .tabbar [aria-current="page"]::before { left: 25%; right: 25%; border-radius: 0; background: var(--dc-red); }
  .subnav a { border-radius: var(--dc-r); border-color: var(--dc-line); background: var(--dc-panel); height: 34px;
    font: 500 14px/1 var(--dc-text); color: var(--dc-read); }
  .subnav a[aria-current="page"] { color: var(--dc-ink); border-color: var(--dc-red); background: var(--dc-red-tint); }
}

/* ---------- Next game ---------- */
.page--coach .banner { border-radius: var(--dc-r); }
.ng { display: grid; gap: var(--s-4); }
.ng :is(h1, h2, h3, p) { margin: 0; }

.ng-head { display: grid; gap: 6px; }
.ng-kick { display: flex; align-items: center; gap: 8px; font: 500 12px/1 var(--dc-mono); letter-spacing: .08em; text-transform: uppercase; color: var(--dc-red-text); }
.ng-kick::before { content: ""; width: 8px; height: 8px; background: var(--dc-red); }
.ng-head h1 { font: 800 var(--dc-t-h1)/.95 var(--dc-display); letter-spacing: .005em; text-transform: uppercase; color: var(--dc-ink); }
.ng-head h1:focus { outline: none; }
.ng-sub { color: var(--dc-read); font-size: var(--dc-t-body); }

/* hero picker: squared portrait tiles, the chosen one lit red */
.ng-heroes { display: flex; flex-wrap: wrap; gap: 4px; }
.ng-hero { --hero: var(--dc-panel-3); position: relative; width: 76px; padding: 0 0 6px; display: grid; gap: 6px; justify-items: center;
  background: var(--dc-panel); border: 1px solid var(--dc-line); border-radius: 0; color: var(--dc-read); cursor: pointer;
  transition: background-color var(--dur) var(--ease), border-color var(--dur) var(--ease), color var(--dur) var(--ease); }
.ng-hero:hover { background: var(--dc-panel-2); border-color: var(--dc-line-strong); color: var(--dc-ink); }
.ng-hero .face { position: relative; width: 100%; height: 54px; overflow: hidden; display: grid; place-items: center;
  background: linear-gradient(180deg, color-mix(in oklab, var(--hero) 55%, var(--dc-panel)), var(--dc-panel)); }
.ng-hero .face img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 50% 20%; }
.ng-hero .ini { font: 800 18px/1 var(--dc-display); text-transform: uppercase; color: var(--dc-ink); }
.ng-hero .nm { max-width: 100%; padding-inline: 4px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  font: 700 13px/1 var(--dc-display); letter-spacing: .04em; text-transform: uppercase; }
.ng-hero .ct { position: absolute; top: 0; right: 0; padding: 3px 4px; background: color-mix(in oklab, var(--dc-ground) 80%, transparent);
  font: 500 11px/1 var(--dc-mono); color: var(--dc-read); }
.ng-hero.on { border-color: var(--dc-red); color: var(--dc-ink); background: var(--dc-panel-2); box-shadow: inset 0 -3px 0 var(--dc-red); }
.ng-hero.few:not(.on) { opacity: .5; }

/* the board: hero panel on the left, the gaps on the right */
.ng-board { display: grid; grid-template-columns: 272px minmax(0, 1fr); gap: var(--dc-gap); align-items: stretch; }
/* figures inside condensed capitals (titles, labels, targets) */
.ng .dg { font: 700 .86em/1 var(--dc-mono); letter-spacing: -.02em; text-transform: none; }

/* the cut corner: the hero panel and the lead gap lose their top-right corner, and a red edge marks the cut */
.ng-id, .ng-gap--lead { position: relative; clip-path: polygon(0 0, calc(100% - var(--dc-cut)) 0, 100% var(--dc-cut), 100% 100%, 0 100%); }
.ng-id::after, .ng-gap--lead::after { content: ""; position: absolute; top: 0; right: 0; width: var(--dc-cut); height: var(--dc-cut); pointer-events: none;
  background: linear-gradient(to bottom left, transparent calc(50% - 1.5px), var(--dc-red) calc(50% - 1.5px), var(--dc-red) calc(50% + 1.5px), transparent calc(50% + 1.5px)); }

.ng-id { --hero: var(--dc-red-deep); display: flex; flex-direction: column; background: var(--dc-panel); border: 1px solid var(--dc-line); min-width: 0; }
.ng-art { position: relative; flex: 1 1 auto; min-height: 340px; overflow: hidden; display: grid; place-items: center;
  background: radial-gradient(120% 90% at 50% 0%, color-mix(in oklab, var(--hero) 70%, var(--dc-panel)), var(--dc-panel) 75%); }
.ng-art img.art { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 50% 12%; }
.ng-art::after { content: ""; position: absolute; inset: 45% 0 0; background: linear-gradient(180deg, transparent, var(--dc-panel) 92%); }
.ng-art .ini { font: 800 64px/1 var(--dc-display); color: var(--dc-ink); text-transform: uppercase; }
.ng-hname { position: absolute; left: var(--dc-pad); right: var(--dc-pad); bottom: 6px; z-index: 1;
  font: 800 40px/.9 var(--dc-display); letter-spacing: .005em; text-transform: uppercase; color: var(--dc-ink); text-shadow: 0 2px 12px rgba(0,0,0,.6); }
.ng-idbody { display: grid; gap: var(--s-4); padding: var(--s-3) var(--dc-pad) var(--dc-pad); }
.ng-facts { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s-3) var(--s-4); margin: 0; }
.ng-facts dt, .ng-key, .ng-what, .ng-cue__k, .ng-tgt__k { font: 700 var(--dc-t-label)/1.1 var(--dc-display); letter-spacing: .06em; text-transform: uppercase; color: var(--dc-muted); }
.ng-facts dd { margin: 4px 0 0; font: 800 26px/1 var(--dc-display); text-transform: uppercase; color: var(--dc-ink); }
.ng-rk { grid-column: 1 / -1; }
.ng-rk dd { display: flex; align-items: center; gap: 8px; }
.ng-rk .rk { width: 30px; height: 30px; }
.ng-key { list-style: none; margin: 0; padding: var(--s-4) 0 0; border-top: 1px solid var(--dc-line); display: grid; gap: 10px; }
.ng-key li { display: grid; grid-template-columns: 22px minmax(0, 1fr); gap: 8px; align-items: baseline; }
.ng-key li span { font: 400 var(--dc-t-small)/1.35 var(--dc-text); letter-spacing: 0; text-transform: none; color: var(--dc-read); }
.ng-key li b { font: 700 14px/1 var(--dc-display); letter-spacing: .06em; text-transform: uppercase; color: var(--dc-ink); }
.ng-key i { position: relative; top: -2px; display: block; height: 8px; }
.ng-key .k-me i { background: var(--dc-red); }
.ng-key .k-r1 i, .ng-key .k-r2 i { width: 3px; height: 14px; top: 1px; margin-left: 9px; background: var(--dc-rank); }
.ng-key .k-r2 i { background: var(--dc-above); }

/* the gaps: the biggest one wide on top, the next two side by side */
.ng-gaps { container-type: inline-size; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--dc-gap); align-content: start; }
.ng-gap { display: grid; gap: var(--s-4); grid-template-areas: "top" "fig" "ruler" "cue" "ev"; align-content: start; min-width: 0;
  padding: var(--dc-pad); background: linear-gradient(180deg, var(--dc-panel-2), var(--dc-panel) 60%); border: 1px solid var(--dc-line);
  transition: border-color var(--dur) var(--ease); }
.ng-gap:hover { border-color: var(--dc-line-strong); }
.ng-gap--lead { grid-column: 1 / -1; border-top: 2px solid var(--dc-red);
  background: linear-gradient(180deg, color-mix(in oklab, var(--dc-red-deep) 55%, var(--dc-panel-2)), var(--dc-panel) 55%); }
.ng-gap__top { grid-area: top; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.ng-n { font: 500 12px/1 var(--dc-mono); color: var(--dc-muted); }
.ng-gap--lead .ng-n { color: var(--dc-red-text); }
.ng-start { padding: 3px 7px 2px; border: 1px solid var(--dc-red); background: var(--dc-red-tint); color: var(--dc-red-text);
  font: 700 12px/1 var(--dc-display); letter-spacing: .1em; text-transform: uppercase; }
.ng-gap__top h3 { flex: 1 1 auto; min-width: 0; font: 800 var(--dc-t-title)/1 var(--dc-display); letter-spacing: .01em; text-transform: uppercase; color: var(--dc-ink); }
.ng-delta { flex: none; padding: 4px 7px 3px; border: 1px solid color-mix(in oklab, var(--dc-behind) 45%, transparent); background: color-mix(in oklab, var(--dc-behind) 9%, transparent);
  font: 700 13px/1 var(--dc-display); letter-spacing: .06em; text-transform: uppercase; color: var(--dc-behind); }

.ng-fig { grid-area: fig; display: grid; gap: 6px; align-content: start; }
.ng-big { font: 800 var(--dc-t-big)/.85 var(--dc-display); letter-spacing: -.005em; color: var(--dc-red-text); font-variant-numeric: tabular-nums; }
.ng-gap:not(.ng-gap--lead) .ng-big { font-size: clamp(42px, 1.6vw + 26px, 52px); }
.ng-qual { font: 400 var(--dc-t-small)/1.35 var(--dc-text); color: var(--dc-muted); }

/* the ruler: your red bar, a grey tick for your rank, a white tick for the rank above, the gap hatched */
.ng-ruler { grid-area: ruler; display: grid; gap: 6px; padding-block: 2px; }
.ng-tls { position: relative; height: 18px; }
.ng-tl { position: absolute; top: 0; display: inline-flex; align-items: center; gap: 5px; white-space: nowrap;
  font: 700 13px/18px var(--dc-display); letter-spacing: .06em; text-transform: uppercase; }
.ng-tl b { font: 500 12px/1 var(--dc-mono); letter-spacing: 0; color: var(--dc-ink); }
.ng-tl .rk { width: 16px; height: 16px; }
.ng-tl.t1 { color: var(--dc-rank); }
.ng-tl.t2 { color: var(--dc-above); }
.ng-track { position: relative; height: 14px; background: var(--dc-panel-3); box-shadow: inset 0 0 0 1px var(--dc-line); }
.ng-you { position: absolute; inset: 0 auto 0 0; background: linear-gradient(90deg, var(--dc-red-deep), var(--dc-red)); }
.ng-zone { position: absolute; top: 0; bottom: 0; background: var(--dc-hatch); box-shadow: inset 0 0 0 1px color-mix(in oklab, var(--dc-red) 50%, transparent); }
.ng-tick { position: absolute; top: -5px; bottom: -5px; width: 3px; margin-left: -1.5px; background: var(--dc-rank); }
.ng-tick.t2 { background: var(--dc-above); }

/* the cue: the coach's order for this game, with its target */
.ng-cue { grid-area: cue; padding: 12px 14px; background: color-mix(in oklab, var(--dc-ground) 70%, transparent); border-left: 3px solid var(--dc-red); }
.ng-cue__k { color: var(--dc-red-text); margin-bottom: 6px; }
.ng-cue p:last-child { font: 400 var(--dc-t-body)/1.45 var(--dc-text); color: var(--dc-read); }
.ng-tgt { display: block; margin-top: 10px; font: 800 20px/1.05 var(--dc-display); letter-spacing: .02em; text-transform: uppercase; color: var(--dc-ink); }
.ng-tgt__k { display: block; margin-bottom: 3px; }
.ng-cue .muted { color: var(--dc-muted); font-size: var(--dc-t-small); }

.ng-ev { grid-area: ev; }
.ng .xlink { color: var(--dc-ink); font: 700 14px/1.3 var(--dc-display); letter-spacing: .06em; text-transform: uppercase;
  text-decoration: underline; text-decoration-color: var(--dc-red); text-decoration-thickness: 2px; text-underline-offset: 4px; }
.ng .xlink:hover { color: var(--dc-red-text); }
.ng-note { color: var(--dc-muted); font-size: var(--dc-t-small); }
.ng .state { border-radius: var(--dc-r); border-color: var(--dc-line-strong); }

/* the lead gap when it has room: big number and order side by side, the ruler across */
@container (min-width: 620px) {
  .ng-gap--lead { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); grid-template-areas: "top top" "fig cue" "ruler cue" "ev cue"; column-gap: var(--s-6); }
  .ng-gap--lead .ng-cue { align-self: start; }
  .ng-gap--lead .ng-gap__top h3 { font-size: 30px; }
}
@container (max-width: 619px) {
  .ng-gap:not(.ng-gap--lead) { grid-column: 1 / -1; }
}

@media (max-width: 1279px) { .ng-board { grid-template-columns: 236px minmax(0, 1fr); } .ng-hname { font-size: 34px; } }
@media (max-width: 1023px) {
  .ng-board { grid-template-columns: minmax(0, 1fr); }
  .ng-id { display: grid; grid-template-columns: 180px minmax(0, 1fr); }
  .ng-art { min-height: 220px; }
}
@media (max-width: 639px) {
  .ng { gap: var(--s-3); }
  .ng-head h1 { font-size: 34px; }
  .ng-sub { font-size: var(--dc-t-small); }
  .ng-heroes { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin-inline: calc(-1 * var(--gut)); padding-inline: var(--gut); }
  .ng-hero { flex: none; width: 68px; }
  .ng-id { grid-template-columns: 112px minmax(0, 1fr); }
  .ng-art { min-height: 0; }
  .ng-hname { font-size: 26px; left: 10px; right: 6px; }
  .ng-idbody { padding: var(--s-3); gap: var(--s-3); }
  .ng-facts { gap: var(--s-2) var(--s-3); }
  .ng-facts dd { font-size: 20px; }
  .ng-rk .rk { width: 22px; height: 22px; }
  .ng-key { padding-top: var(--s-3); gap: 6px; }
  .ng-gap { padding: 14px; gap: var(--s-3); }
  .ng-gap__top h3 { font-size: 20px; }
}

/* ---------- compact: the whole page on one desktop screen (no scrolling at 1440 x 800) ----------
   Title and window switch share one row, the question sits beside the hero picker, the lead gap is one strip
   (number, ruler, order), and gaps 2 and 3 put the number beside the ruler. Backup of the roomier version:
   branch backup/next-game-before-compact. */
.page--coach { margin-top: var(--s-3); }
.ng { gap: 12px; }
.ng-head { display: flex; align-items: flex-end; justify-content: space-between; gap: var(--s-3) var(--s-6); flex-wrap: wrap; }
.ng-title { display: grid; gap: 6px; }
.ng-head h1 { font-size: clamp(28px, 1vw + 18px, 36px); }
.ng-head .f { display: flex; align-items: center; gap: var(--s-3); }
.ng-head .lab { font: 700 13px/1 var(--dc-display); letter-spacing: .08em; text-transform: uppercase; color: var(--dc-muted); }
.ng-pick { display: flex; align-items: center; gap: var(--s-4); }
.ng-sub { flex: 0 1 220px; font-size: var(--dc-t-small); line-height: 1.4; }
.ng-pick .ng-heroes { flex: 1 1 auto; min-width: 0; flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
.ng-hero { flex: none; width: 64px; padding-bottom: 5px; gap: 4px; }
.ng-hero .face { height: 38px; }
.ng-hero .nm { font-size: 12px; }

.ng-board { grid-template-columns: 236px minmax(0, 1fr); }
.ng-art { min-height: 150px; }
.ng-hname { font-size: 32px; }
.ng-idbody { gap: var(--s-3); padding: var(--s-2) 14px 14px; }
.ng-facts { gap: var(--s-2) var(--s-3); }
.ng-facts dd { font-size: 20px; margin-top: 2px; }
.ng-rk .rk { width: 24px; height: 24px; }
.ng-key { padding-top: var(--s-3); gap: 6px; }

.ng-gap { padding: 14px 16px; gap: 12px; }
.ng-gap__top h3 { font-size: 20px; }
.ng-fig { gap: 4px; }
.ng-gap:not(.ng-gap--lead) .ng-big { font-size: 44px; }
.ng-fig .ng-ev { grid-area: auto; margin-top: 6px; }
.ng-cue { padding: 10px 12px; }
.ng-cue p:last-child { font-size: 14px; line-height: 1.4; }
.ng-cue__k { display: inline; margin: 0 6px 0 0; }
.ng-tgt { margin-top: 6px; font-size: 17px; }
.ng-tgt__k { display: inline; margin: 0 6px 0 0; }

@container (min-width: 620px) {
  .ng-gap--lead { grid-template-columns: minmax(140px, .7fr) minmax(0, 1fr) minmax(0, 1.3fr); grid-template-areas: "top top top" "fig ruler cue"; column-gap: var(--s-5); }
  .ng-gap--lead .ng-gap__top h3 { font-size: 26px; }
  .ng-gap:not(.ng-gap--lead) { grid-template-columns: auto minmax(0, 1fr); grid-template-areas: "top top" "fig ruler" "cue cue"; column-gap: var(--s-4); }
  .ng-gap .ng-ruler { align-self: center; }
}
@media (max-width: 639px) {
  .ng-head h1 { font-size: 30px; }
  .ng-pick { flex-direction: column; align-items: stretch; gap: 8px; }
  .ng-sub { flex: none; }
  .ng-hname { font-size: 26px; }
}
/* the footer line follows the board closely on Next game, so it stays on the same screen */
.main:has(.page--coach) { padding-bottom: var(--s-5); }
.main:has(.page--coach) .foot { margin-top: var(--s-4); padding: var(--s-3) 0 0; font-size: var(--dc-t-small); color: var(--dc-muted); }
.ng-hero .face .ini { margin-top: 8px; }
@media (max-width: 639px) {
  .ng-head .f { flex-wrap: wrap; gap: 6px; width: 100%; }
  .ng-head .seg { display: flex; width: 100%; }
  .ng-head .seg .chip { flex: 1 1 auto; padding-inline: 6px; }
}
@media (max-width: 1023px) { .main:has(.page--coach) { padding-bottom: calc(var(--tabbar) + env(safe-area-inset-bottom) + var(--s-4)); } }
.ng { grid-template-columns: minmax(0, 1fr); }
.ng-head > * { min-width: 0; }
/* tablet and phone: the board stacks again (the compact two-column board above is for desktops) */
@media (max-width: 1023px) {
  .ng-board { grid-template-columns: minmax(0, 1fr); }
  .ng-id { grid-template-columns: 180px minmax(0, 1fr); }
}
@media (max-width: 639px) {
  .ng-id { grid-template-columns: 112px minmax(0, 1fr); }
  .ng-art { min-height: 0; }
}
/* too few games on the chosen hero: the warning sits in the sentence beside the picker, in amber */
.ng-fall { color: var(--dc-behind); }
.ng-pick .ng-sub:has(.ng-fall) { flex-basis: 280px; }
@media (min-width: 1024px) {
  .main:has(.page--coach) { padding-bottom: var(--s-3); }
  .main:has(.page--coach) .foot { margin-top: var(--s-2); padding-top: var(--s-2); }
}
/* tall desktop screens: the page sits in the middle, top to bottom, instead of leaving a band of black at the
   foot. When the screen is no taller than the page (1366 x 768, 1440 x 800), this changes nothing. */
@media (min-width: 1024px) {
  .main:has(.page--coach) { padding-bottom: 0; }
  .main:has(.page--coach) > .wrap { box-sizing: border-box; min-height: 100svh; display: flex; flex-direction: column; justify-content: center;
    padding-top: var(--s-2); padding-bottom: var(--s-3); }
}
/* big screens: the page content, not the side menu, is drawn up to 1.25x larger, as large as fits the visible area,
   so it fills a 1080p screen instead of floating in black. app.js (fitCoach) measures the room and sets --ng-zoom;
   the column widens by the same amount, so every proportion stays the same. */
@media (min-width: 1024px) {
  .main:has(.page--coach) > .wrap { width: min(100% - 2 * var(--gut), calc(1180px * var(--ng-zoom, 1))); }
  .main:has(.page--coach) #app, .main:has(.page--coach) .foot { zoom: var(--ng-zoom, 1); }
}
/* the version beside the wordmark: small, mono, muted, sitting on the wordmark's baseline */
.side__logo .side__ver { align-self: flex-end; margin: 0 0 3px -2px; font: 500 11px/1 var(--dc-mono); letter-spacing: 0; text-transform: none; color: var(--dc-muted); }

/* ---------- the three Coach pages share one head position ----------
   Next game no longer centres top to bottom: all three start at the same place, at the same size (app.js fitCoach
   sets one --ng-zoom per screen for the Coach group, marked .is-coach), and the window switch sits at the right
   end of the hero row, so a long title never pushes it down. */
.page--coach, .page--history, .page--review { margin-top: var(--s-3); }
@media (min-width: 1024px) {
  .main:has(.page--coach) > .wrap { min-height: 0; display: block; }
  .main.is-coach > .wrap { width: min(100% - 2 * var(--gut), calc(1180px * var(--ng-zoom, 1))); }
  .main.is-coach #app, .main.is-coach .foot { zoom: var(--ng-zoom, 1); }
}
.ng-pick .f { flex: none; margin-left: auto; display: flex; align-items: center; gap: var(--s-3); }
.ng-pick .lab { font: 700 13px/1 var(--dc-display); letter-spacing: .08em; text-transform: uppercase; color: var(--dc-muted); }
@media (max-width: 639px) {
  .ng-pick .f { flex-wrap: wrap; gap: 6px; width: 100%; margin-left: 0; }
  .ng-pick .seg { display: flex; width: 100%; }
  .ng-pick .seg .chip { flex: 1 1 auto; padding-inline: 6px; }
}
/* the scrollbar's room is always kept, so a page that scrolls (History) does not sit 15 px left of one that does not */
html { scrollbar-gutter: stable; }
/* the hero row: the sentence has a fixed width and the picker and window switch hang from the top, so a longer
   sentence on one page never moves the heroes */
.ng-pick { align-items: flex-start; }
.ng-pick > .ng-sub, .ng-pick .ng-sub:has(.ng-fall) { flex: 0 0 240px; width: 240px; }
.ng-pick .ng-heroes { flex: 0 1 auto; }
.ng-pick .f { margin-top: 12px; }
@media (max-width: 639px) { .ng-pick > .ng-sub, .ng-pick .ng-sub:has(.ng-fall) { flex: none; width: auto; } .ng-pick .f { margin-top: 0; } }
@media (max-width: 639px) { .ng-pick { align-items: stretch; } .ng-pick .ng-heroes { flex: none; } }
/* a tighter hero row, so every hero in the picker shows beside the sentence and the window switch: smaller portrait
   tiles, a narrower sentence, and a slimmer switch */
@media (min-width: 640px) {
  .ng-pick { gap: var(--s-3); }
  .ng-pick > .ng-sub, .ng-pick .ng-sub:has(.ng-fall) { flex-basis: 210px; width: 210px; }
  .ng-pick .ng-heroes { gap: 3px; }
  .ng-hero { width: 54px; padding-bottom: 4px; gap: 3px; }
  .ng-hero .face { height: 34px; }
  .ng-hero .nm { font-size: 10.5px; letter-spacing: 0; padding-inline: 2px; }
  .ng-hero .ct { padding: 2px 3px; font-size: 10px; }
  .ng-hero .ini { font-size: 15px; }
  .ng-pick .f { gap: var(--s-2); margin-top: 9px; }
  .ng-pick .seg .chip { height: 32px; padding: 0 var(--s-3); font-size: 13px; }
}
/* laptops: the "Window" label goes (its three buttons say what they are), the sentence narrows and the tiles slim
   down a little more, so the whole picker fits */
@media (min-width: 640px) and (max-width: 1599px) {
  .ng-pick .f .lab { display: none; }
  .ng-pick > .ng-sub, .ng-pick .ng-sub:has(.ng-fall) { flex-basis: 190px; width: 190px; }
  .ng-hero { width: 50px; }
  .ng-hero .nm { font-size: 10px; padding-inline: 1px; }
}
@media (min-width: 640px) and (max-width: 1599px) { .ng-hero { width: 47px; } .ng-pick .ng-heroes { gap: 2px; } }

/* Other: the heroes past the portraits, as the same tiles in a panel under the row */
.ng-other .face { background: var(--dc-panel-2); }
.ng-other .ini { font-size: 16px; color: var(--dc-muted); }
.ng-other:hover .ini, .ng-other.open .ini { color: var(--dc-ink); }
.ng-other.open { border-color: var(--dc-red); color: var(--dc-ink); background: var(--dc-panel-2); }
.ng-more { border: 1px solid var(--dc-line-strong); border-radius: var(--dc-r); background: var(--dc-panel); padding: 12px; display: grid; gap: 10px;
  animation: ng-more-in .14s ease-out; }
.ng-more__h { font: 700 13px/1 var(--dc-display); letter-spacing: .08em; text-transform: uppercase; color: var(--dc-muted); }
.ng-more__h span { margin-left: 6px; font-family: var(--dc-mono); color: var(--dc-ink); }
.ng-more__grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(64px, 1fr)); gap: 4px; }
.ng-more__grid .ng-hero { width: auto; }
@keyframes ng-more-in { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .ng-more { animation: none; } }

/* every other page wears Next game's head above its cards */
.ng--top { padding-top: var(--s-6); margin-bottom: var(--s-5); }

/* the page's takeaways, first thing under the head */
.takeaways { margin-bottom: var(--s-5); }
.takeaways .insights { margin: 0; }

/* the hero picker stays pinned to the top of the screen while the page scrolls (not on phones, where it is tall) */
@media (min-width: 720px) {
  .ng-pick { position: sticky; top: 0; z-index: 30; background: var(--dc-ground); padding-block: 8px;
    border-bottom: 1px solid var(--dc-line); box-shadow: 0 8px 16px -12px rgba(0, 0, 0, .6); }
  .ng--top + .ng-pick { margin-bottom: var(--s-5); }
  .ng--top { margin-bottom: 0; }
}
/* phones: the whole picker is too tall to pin, so only the hero row is: the picker box steps aside (display:
   contents) and the row sticks to the top of the page, a single line that scrolls sideways */
@media (max-width: 719px) {
  .ng-pick { display: contents; }
  .ng-pick .ng-heroes { position: sticky; top: 0; z-index: 30; background: var(--dc-ground); padding-block: 6px;
    border-bottom: 1px solid var(--dc-line); box-shadow: 0 8px 16px -12px rgba(0, 0, 0, .6); }
  /* on the pages other than Next game the parts sit in plain page flow, so they get their own spacing */
  #app > .ng-pick > .ng-sub { margin: 0 0 8px; }
  #app > .ng-pick > .f { margin: 8px 0 var(--s-5); }
  .ng-hero { width: 60px; }
  .ng-hero .face { height: 34px; }
}
