/* 6t4 Live. The 6t4 brand kit v1 (~/chesswatch/brand/6t4-brand-kit), as the Arena venue app applies it:
   ink, paper, one signal. Ink is the primary (links, the running clock, the picked day), selection is a
   neutral tone, and three colours are meanings with one job each, never decoration: Signal red = live
   and check, Attention amber = needs checking (catching up, result being confirmed, an irregular move).
   No coloured buttons. Type: Inter for the interface, Space Grotesk 500 only for the product name beside
   the mark, Spline Sans Mono for moves, clocks and numbers. Fonts are served from fonts/ (SIL OFL). */
@font-face { font-family: 'Inter'; font-style: normal; font-weight: 400 700; font-display: swap; src: url(fonts/inter-latin-ext.woff2) format('woff2'); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: 'Inter'; font-style: normal; font-weight: 400 700; font-display: swap; src: url(fonts/inter-latin.woff2) format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Space Grotesk'; font-style: normal; font-weight: 500; font-display: swap; src: url(fonts/space-grotesk-latin-500-normal.woff2) format('woff2'); }
@font-face { font-family: 'Spline Sans Mono'; font-style: normal; font-weight: 400; font-display: swap; src: url(fonts/spline-sans-mono-latin-400-normal.woff2) format('woff2'); }
@font-face { font-family: 'Spline Sans Mono'; font-style: normal; font-weight: 500; font-display: swap; src: url(fonts/spline-sans-mono-latin-500-normal.woff2) format('woff2'); }
:root {
  --bg: #F4F3EF; --panel: #FAF9F6; --surface: #FFFFFF; --ink: #161614; --body: #33322E;
  --muted: #6B6962; --faint: #A3A098; --line: #E8E6E0; --line-soft: #EEECE7; --btn-line: #D6D3CB;
  --hover: #EEECE7; --press: #E2DFD7; --sel: #E2DFD7; --on-sel: #161614;
  --primary: #161614; --on-primary: #F4F3EF;
  --live: #E5484D; --live-text: #C7303A; --live-tint: #FBE3E4; --on-live-tint: #7A1E22;
  --warn: #8A6118; --warn-soft: #F6ECDA; --on-warn: #4A3000; --warn-line: #E8D4AD;
  --sq-l: #E8E4DA; --sq-d: #8F8A7E; --last-move: rgba(240, 200, 60, 0.85); --mark: #161614;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #141513; --panel: #1C1D1B; --surface: #202220; --ink: #E5E3DD; --body: #D6D3CB;
    --muted: #B9B5A8; --faint: #6B6962; --line: #33322E; --line-soft: #2B2C29; --btn-line: #6B6962;
    --hover: #2B2C29; --press: #363734; --sel: #363734; --on-sel: #E5E3DD;
    --primary: #E5E3DD; --on-primary: #161614;
    --live: #FF6B6E; --live-text: #FF6B6E; --live-tint: #4A1C1E; --on-live-tint: #FFD6D7;
    --warn: #E5C07B; --warn-soft: #5D4414; --on-warn: #FFDFA6; --warn-line: #7A5A1C;
    --sq-l: #C9C5B8; --sq-d: #6E6A60; --mark: #FFFFFF;
    color-scheme: dark;
  }
}
* { box-sizing: border-box; }
html, body { height: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font-family: 'Inter', 'Segoe UI', system-ui, -apple-system, sans-serif; -webkit-font-smoothing: antialiased; }
a { color: var(--ink); text-decoration: none; }
a:hover { color: var(--ink); }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; border-radius: 4px; }
button { font-family: inherit; cursor: pointer; }
.mono, .clock { font-family: 'Spline Sans Mono', ui-monospace, Consolas, monospace; font-variant-numeric: tabular-nums; }

/* ---------- shell: sidebar + main (portal layout) ---------- */
.shell { display: flex; min-height: 100%; }
.side { width: 212px; flex-shrink: 0; display: flex; flex-direction: column; gap: 2px; padding: 18px 12px 16px; background: var(--panel); border-right: 1px solid var(--line); position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.logo { display: flex; align-items: center; gap: 10px; padding: 6px 10px 18px; color: var(--ink); }
.logo:hover { color: var(--ink); }
/* The 6t4 mark (kit geometry, 36 px wide: above the 33 px minimum; strokes Ink on paper, white on ink, the accent cell
   always Signal red) and the product name after it in Space Grotesk 500 at -0.04em, as the kit's lockups do. */
.logo-mark { display: flex; flex-shrink: 0; color: var(--mark); }
.logo-mark svg { width: 36px; height: 33px; display: block; }
.wm { font-family: 'Space Grotesk', 'Inter', sans-serif; font-weight: 500; font-size: 18px; line-height: 20px; letter-spacing: -0.04em; white-space: nowrap; color: var(--ink); }
.nitem { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 8px; font-size: 13.5px; font-weight: 500; color: var(--body); }
.nitem:hover { background: var(--hover); color: var(--body); }
.nitem.active, .nitem.active:hover { background: var(--sel); color: var(--on-sel); font-weight: 600; }
.nitem .tag { margin-left: auto; font-size: 10px; font-weight: 600; letter-spacing: 0.06em; border-radius: 5px; padding: 1px 6px; color: var(--muted); border: 1px solid var(--btn-line); white-space: nowrap; }
.nitem .tag.live { color: var(--live-text); border-color: var(--live-tint); }
.nitem .tag.warn { color: var(--warn); border-color: var(--warn-line); }
/* A board that hosted several games (households, coaching centres) is ONE row that opens all
   of them (Maulik 2026-10-07). It replaces the 2026-10-06 group header plus a row per game:
   those rows were labelled by the time of the last move so a viewer could tell them apart, and
   they could not — eight games on Board 1 all read "4:41 pm".
   M3's navigation-drawer item: label-large, a trailing badge carrying the count, a state layer
   on hover / focus / press, and a 48px target. One deliberate departure — M3 shapes this item
   as a full pill, and a lone pill among eight 8px-radius siblings reads as a mistake, so the
   family's radius wins. The point of a shape token is consistency. */
.nitem.nboard { min-height: 48px; font-size: 14px; font-weight: 600; }
.nitem.nboard .nbname { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nitem.nboard .nbadge { margin-left: auto; min-width: 20px; height: 20px; padding: 0 6px;
  display: inline-flex; align-items: center; justify-content: center; border-radius: 999px;
  background: var(--sel); color: var(--on-sel); font-size: 11px; font-weight: 700;
  font-variant-numeric: tabular-nums; }
.nitem.nboard .tag + .nbadge { margin-left: 8px; }
.nitem.nboard:active { background: var(--press); }
.nitem.nboard:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
.nitem.nboard.active .nbadge { background: var(--surface); }
/* The day pill's game count, so "Oct 2 8" cannot be read as one value. */
.dchip .dn { margin-left: 7px; padding: 0 5px; border-radius: 999px; font-size: 10.5px;
  font-weight: 700; background: color-mix(in srgb, currentColor 12%, transparent); font-variant-numeric: tabular-nums; }
.dchip.on .dn { background: color-mix(in srgb, currentColor 22%, transparent); }
.lab { font-size: 11px; font-weight: 700; letter-spacing: 0.09em; color: var(--muted); text-transform: uppercase; }
.side .lab { padding: 16px 10px 6px; }
.side .foot { margin-top: auto; padding: 12px 10px 0; border-top: 1px solid var(--line); }
.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.top { height: 58px; flex-shrink: 0; display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 0 28px; border-bottom: 1px solid var(--line); background: var(--panel); position: sticky; top: 0; z-index: 5; }
.crumb { font-size: 14px; font-weight: 600; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.crumb .dim { color: var(--muted); font-weight: 500; }
.ptop { display: none; }
.mtitle { display: none; }

/* ---------- shared bits ---------- */
.chips { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.chip { font-size: 11px; font-weight: 600; padding: 2px 8px; border-radius: 6px; white-space: nowrap; }
/* live = Signal, with the dot: the one place red appears besides a king in check */
.chip.live { background: var(--live-tint); color: var(--on-live-tint); }
.chip.live::before { content: ""; display: inline-block; width: 6px; height: 6px; margin-right: 5px; border-radius: 50%; background: var(--live); vertical-align: 1px; }
.chip.warn { background: var(--warn-soft); color: var(--warn); }
.chip.mut { background: var(--line); color: var(--muted); }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 40px; padding: 0 16px; border-radius: 9px; font-size: 13px; font-weight: 600; border: 1px solid var(--btn-line); background: var(--surface); color: var(--ink); white-space: nowrap; }
.btn:hover { background: var(--hover); color: var(--ink); }
.foot { font-size: 11.5px; line-height: 1.5; color: var(--muted); }
.empty { padding: 40px 28px; font-size: 14px; color: var(--body); }

/* ---------- board ---------- */
.board { display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)); border-radius: 8px; overflow: hidden; user-select: none; container-type: inline-size; }
.sq { position: relative; aspect-ratio: 1; display: flex; align-items: center; justify-content: center; line-height: 1; }
.sq.l { background: var(--sq-l); } .sq.d { background: var(--sq-d); }
/* last move: the kit's ring, not a fill; it scales with the board (a card on All boards, the big board) */
.sq.last::before { content: ""; position: absolute; inset: 0; box-shadow: inset 0 0 0 max(2px, 0.6cqw) var(--last-move); }
.sq.check::before { content: ""; position: absolute; inset: 0; background: radial-gradient(circle, rgba(229,72,77,0.95) 0%, rgba(229,72,77,0.55) 38%, rgba(229,72,77,0) 72%); }
.pc { position: absolute; inset: 0; background: center / 100% 100% no-repeat; }
.pc.wK { background-image: url(pieces/wK.svg); } .pc.wQ { background-image: url(pieces/wQ.svg); }
.pc.wR { background-image: url(pieces/wR.svg); } .pc.wB { background-image: url(pieces/wB.svg); }
.pc.wN { background-image: url(pieces/wN.svg); } .pc.wP { background-image: url(pieces/wP.svg); }
.pc.bK { background-image: url(pieces/bK.svg); } .pc.bQ { background-image: url(pieces/bQ.svg); }
.pc.bR { background-image: url(pieces/bR.svg); } .pc.bB { background-image: url(pieces/bB.svg); }
.pc.bN { background-image: url(pieces/bN.svg); } .pc.bP { background-image: url(pieces/bP.svg); }
.cc { position: absolute; font-size: max(8px, 1.8cqw); font-weight: 600; color: rgba(0,0,0,0.45); z-index: 1; }
.sq.d .cc { color: rgba(255,255,255,0.8); }
.cc.r { left: 3px; top: 2px; } .cc.f { right: 3px; bottom: 1px; }

/* ---------- players ---------- */
.pblock { display: flex; flex-direction: column; gap: 2px; }
.player { display: flex; align-items: center; gap: 10px; min-height: 36px; }
.swatch { width: 14px; height: 14px; border-radius: 3px; border: 1px solid var(--muted); flex-shrink: 0; }
.swatch.b { background: #1C1B17; } .swatch.w { background: #FBFBF6; }
.pname { flex: 1; min-width: 0; font-size: 16px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.clock { font-size: 22px; font-weight: 500; padding: 4px 12px; border-radius: 8px; background: var(--bg); border: 1px solid var(--line); color: var(--body); }
.clock.run { background: var(--primary); border-color: var(--primary); color: var(--on-primary); }
.clock:empty { display: none; }
/* the result: no colour (green, red and amber have other jobs): the winner's point is ink, the rest a neutral tone */
.pts { font-family: 'Spline Sans Mono', ui-monospace, monospace; font-size: 15px; font-weight: 500; padding: 2px 10px; border-radius: 8px; background: var(--sel); color: var(--on-sel); }
.pts.win { background: var(--primary); color: var(--on-primary); }
.pts:empty { display: none; }
/* ---------- figurines (Maulik 10-01): a piece's silhouette in the text colour ----------
   figs/K.svg … P.svg = the cburnett black pieces with the viewBox cut to the piece itself
   (see figs/README.txt), drawn as a CSS mask, so each stands on the baseline at the height
   of a capital letter (--fh); the width follows the piece's own proportions (--ar). */
.fg { display: inline-block; height: var(--fh, 0.72em); width: calc(var(--fh, 0.72em) * var(--ar)); background: currentColor; -webkit-mask: var(--m) center / contain no-repeat; mask: var(--m) center / contain no-repeat; }
.fg.K { --m: url(figs/K.svg); --ar: 1.213; } .fg.Q { --m: url(figs/Q.svg); --ar: 1.343; }
.fg.R { --m: url(figs/R.svg); --ar: 0.970; } .fg.B { --m: url(figs/B.svg); --ar: 0.680; }
.fg.N { --m: url(figs/N.svg); --ar: 1.223; } .fg.P { --m: url(figs/P.svg); --ar: 0.894; }
/* material on its own line under each player's name row (Maulik 10-01: beside the name the
   strip got clipped — "+15" lost a digit — and a long name would have had no room; the same
   arrangement for both sides): the pieces that side has captured, pawns first, same-type pieces
   overlapping a little, each still countable, and the points difference on the side ahead.
   The line is always there (15px), so the board does not jump at the first capture. */
.mat { display: flex; align-items: center; height: 15px; padding-left: 24px; white-space: nowrap; color: var(--muted); --fh: 14px; }
.mat .grp { display: inline-flex; align-items: flex-end; margin-right: 5px; }
.mat .grp .fg + .fg { margin-left: calc(var(--fh) * -0.26); }
.mat .plus { font-family: 'Spline Sans Mono', ui-monospace, monospace; font-size: 12px; font-weight: 500; color: var(--body); margin-left: 2px; }

/* ---------- game page ---------- */
.game { flex: 1; padding: 22px 28px 28px; display: flex; gap: 18px; align-items: flex-start; }
/* the card never grows past what the window can show (Maulik 10-01: a bigger board, no
   vertical scroll): the card is the board + 148px tall and board + 26px wide, the window
   gives 100vh - 108px, so the width stops at 100vh - 230px; the moves column beside it is
   a fixed 300px (212 sidebar + 56 padding + 18 gap + 300 + 6 = 100vw - 592px). */
.gamecard { width: min(760px, 100vh - 230px, 100vw - 592px); min-width: 300px; flex-shrink: 0; padding: 12px; display: flex; flex-direction: column; gap: 8px; }
.strip { display: none; }
.rightcol { flex: 0 0 300px; width: 300px; min-width: 0; display: flex; flex-direction: column; gap: 18px; }
.moves { display: flex; flex-direction: column; overflow: hidden; }
.moves-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 14px 16px; border-bottom: 1px solid var(--line-soft); }
.moves-head b { font-size: 13px; font-weight: 600; text-align: right; }
/* the list stops where the game card stops: card 100vh - 114px, minus the moves head and the
   arrows (113px), the info card below it with its gap (102px) and a few px to spare */
.mlist { max-height: calc(100vh - 336px); overflow-y: auto; padding: 6px 0; }
.mrow { display: grid; grid-template-columns: 34px minmax(0, 1fr) minmax(0, 1fr); gap: 6px; padding: 2px 12px; align-items: center; font-size: 14px; }
.mrow .n { font-family: 'Spline Sans Mono', monospace; font-size: 12px; color: var(--muted); }
.mv { text-align: left; border: none; background: none; padding: 3px 6px; border-radius: 6px; font-size: 14px; font-weight: 500; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mv .fg { margin-right: 0.06em; }
.mv:hover { background: var(--hover); }
.mv.cur { background: var(--sel); color: var(--on-sel); font-weight: 600; }
.mv small { font-family: 'Spline Sans Mono', monospace; font-size: 11px; color: var(--muted); font-weight: 400; margin-left: 4px; }
.mnone { padding: 10px 16px; font-size: 13px; color: var(--muted); }
.nav { display: flex; align-items: center; justify-content: center; gap: 8px; padding: 12px 12px; border-top: 1px solid var(--line-soft); }
/* arrows: Material 3 tonal icon buttons (first_page, chevron_left, chevron_right, last_page) */
.nav button { width: 44px; height: 40px; display: inline-flex; align-items: center; justify-content: center; padding: 0; border: none; border-radius: 999px; background: var(--sel); color: var(--on-sel); flex-shrink: 0; }
.nav button:hover { background: color-mix(in srgb, var(--on-sel) 10%, var(--sel)); }
.nav button:active { background: color-mix(in srgb, var(--on-sel) 18%, var(--sel)); }
.nav #where { min-width: 56px; padding: 0 4px; font-size: 13px; font-weight: 600; color: var(--body); text-align: center; white-space: nowrap; }
.info { display: flex; align-items: center; gap: 16px; padding: 14px 16px; }
.info > div { flex: 1; display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.info .t { font-size: 13px; font-weight: 600; }
.info .s { font-size: 12.5px; color: var(--body); }

/* ---------- an irregular move that stood (2026-10-27, game 146: 10.Qd1-g5) ----------
   An illegal move nobody corrected before the reply stands (FIDE A.4) and is recorded as played,
   tagged [%cw irregular=d1g5 kind=…]. It is shown, never hidden behind a legal story: amber
   (the page's warning colour, not the loss red — nothing went wrong with the game record), the
   move dotted-underlined in the list, its squares amber on the board with the square it left
   striped, a chip in the top bar that counts them, and the Game info card says what happened. */
.chip.irr { background: var(--warn-soft); color: var(--warn); border: none; font: inherit; font-size: 11px; font-weight: 600; padding: 2px 8px; border-radius: 6px; cursor: pointer; }
.chip.irr:hover { background: color-mix(in srgb, var(--warn) 14%, var(--warn-soft)); }
.mv.irr { color: var(--warn); text-decoration: underline dotted; text-decoration-thickness: 1.5px; text-underline-offset: 3px; }
.mv.irr.cur { background: var(--warn-soft); color: var(--warn); }
.sq.irr::before { content: ""; position: absolute; inset: 0; background: rgba(138, 97, 24, 0.42); }
.sq.irr.from::before { background: repeating-linear-gradient(45deg, rgba(138,97,24,0.42) 0 6px, rgba(138,97,24,0.18) 6px 12px); }
.moves-head b.irr { color: var(--warn); }
.strip .irr { color: var(--warn); }
.info .irrbox:not([hidden]) { display: flex; flex-direction: column; gap: 8px; margin: 4px 0 2px; }
/* with a box to show, the info card stacks (the box needs the card's whole width to read) */
.info.has-irr { flex-direction: column; align-items: stretch; }
.info.has-irr .btn { align-self: flex-start; }
.irrbox-item { display: flex; flex-direction: column; gap: 4px; padding: 8px 10px; border-radius: 8px; background: var(--warn-soft); border: 1px solid var(--warn-line); }
.irrbox-item p { margin: 0; font-size: 12.5px; line-height: 1.45; color: var(--on-warn); }
.irrline { font-size: 12.5px; color: var(--body); display: flex; gap: 6px; align-items: baseline; flex-wrap: wrap; }
.irrline .tag { font-size: 10px; font-weight: 700; letter-spacing: 0.06em; padding: 1px 6px; border-radius: 5px; background: var(--warn-soft); color: var(--warn); text-transform: uppercase; border: 1px solid var(--warn-line); }
.irrline .mv { padding: 0 4px; font-weight: 600; }

/* ---------- all-boards page ---------- */
.boards { flex: 1; padding: 22px 28px 28px; display: flex; flex-direction: column; gap: 16px; }
.filters { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.fchip { font-size: 12px; font-weight: 600; padding: 5px 11px; border-radius: 8px; background: var(--surface); border: 1px solid var(--btn-line); color: var(--muted); }
.fchip:hover { background: var(--hover); }
.fchip.on, .fchip.on:hover { background: var(--sel); color: var(--on-sel); border-color: var(--sel); }
.filters .hint { margin-left: auto; font-size: 12.5px; color: var(--muted); }
.filters.dates { margin-bottom: 6px; }
.filters.dates .lbl { font-size: 12px; color: var(--muted); margin-right: 2px; }
.dchip { font-size: 12px; font-weight: 600; padding: 5px 11px; border-radius: 999px; background: var(--surface); border: 1px solid var(--btn-line); color: var(--muted); }
.dchip:hover { background: var(--hover); }
.dchip.on, .dchip.on:hover { background: var(--primary); color: var(--on-primary); border-color: var(--primary); }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px; }
.mini { padding: 12px; display: flex; flex-direction: column; gap: 6px; color: var(--ink); }
.mini:hover { border-color: var(--faint); color: var(--ink); }
.mini-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.mini-head b { font-size: 14px; }
.mini .player { min-height: 24px; gap: 8px; }
.mini .swatch { width: 10px; height: 10px; border-radius: 2px; }
.mini .pname { font-size: 13px; font-weight: 500; }
.mini .clock { font-size: 13px; padding: 1px 7px; border-radius: 6px; font-weight: 500; border: none; background: none; }
.mini .clock.run { background: var(--primary); }
.mini .pts { font-size: 12px; padding: 1px 7px; border-radius: 6px; }

/* ---------- tournaments page ---------- */
.elist { display: flex; flex-direction: column; gap: 10px; max-width: 760px; }
.ev { display: flex; align-items: center; gap: 16px; padding: 16px 18px; color: var(--ink); }
.ev:hover { border-color: var(--faint); color: var(--ink); }
.ev-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.ev-name { font-size: 16px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ev-sub { font-size: 12.5px; color: var(--muted); }
.ev .chips { flex-shrink: 0; justify-content: flex-end; }
.ev-go { color: var(--faint); flex-shrink: 0; }
.elab { padding: 14px 2px 2px; }

/* ---------- phone (a phone on its side can be wider than 900px: it is known by its height) ---------- */
@media (max-width: 900px), (max-height: 500px) {
  .side, .top { display: none; }
  .ptop { display: flex; height: 56px; align-items: center; gap: 10px; padding: 0 16px 0 4px; background: var(--panel); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 5; }
  .ptop .back { width: 44px; height: 44px; display: flex; align-items: center; justify-content: center; color: var(--body); }
  .ptop .nob { width: 12px; }
  .mtitle { display: flex; flex-direction: column; gap: 10px; padding: 16px 16px 0; }
  .mtitle h1 { margin: 0; font-size: 20px; font-weight: 700; }
  .mtitle .sub { font-size: 12.5px; color: var(--muted); margin-top: 3px; }
  .game { flex-direction: column; align-items: stretch; padding: 14px 16px 96px; gap: 14px; }   /* bottom: room for the floating arrows */
  .gamecard { width: 100%; min-width: 0; padding: 12px; gap: 8px; }
  .rightcol { flex: none; width: auto; }
  .gamecard .player { min-height: 32px; gap: 8px; }
  .gamecard .mat { --fh: 12px; height: 13px; padding-left: 20px; }
  .gamecard .swatch { width: 12px; height: 12px; }
  .gamecard .pname { font-size: 15px; }
  .gamecard .clock { font-size: 17px; padding: 3px 10px; border-radius: 7px; }
  .gamecard .mat .plus { font-size: 11px; }
  .strip { display: block; padding-top: 4px; }
  .strip b { display: block; font-size: 13px; font-weight: 600; }
  .strip div { font-size: 14px; color: var(--body); margin-top: 2px; }
  .strip .cur { color: var(--ink); font-weight: 600; }
  .mlist { max-height: none; }
  /* the arrows float at the bottom of the screen: always in reach, no scrolling down to them */
  .nav { position: fixed; left: 12px; right: 12px; max-width: 440px; margin: 0 auto; bottom: calc(10px + env(safe-area-inset-bottom, 0px)); z-index: 6; justify-content: space-between; gap: 6px; padding: 8px 10px; background: var(--surface); border: 1px solid var(--line); border-radius: 999px; box-shadow: 0 6px 20px rgba(35,34,30,0.16); }
  .nav button { flex: 1 1 0; width: auto; min-width: 40px; max-width: 64px; height: 48px; }   /* narrower on a small phone, the count always fits */
  .nav button svg { width: 28px; height: 28px; }
  .nav #where { flex: 0 0 auto; min-width: 0; padding: 0 4px; font-size: 14px; font-weight: 600; color: var(--body); white-space: nowrap; }
  .info { flex-direction: column; align-items: stretch; }
  .boards { padding: 14px 16px 24px; }
  .filters .hint { display: none; }
  .ev { padding: 14px; gap: 10px; }
  .ev .chips { flex-direction: column; align-items: flex-end; }
}
/* ---------- tablet held upright: the card stops growing once it fills the screen ---------- */
@media (min-width: 600px) and (max-width: 900px) and (orientation: portrait) {
  .gamecard { max-width: max(300px, 100vh - 352px); align-self: center; }
}

/* ---------- phone on its side: the board as tall as the screen, players and moves beside it ---------- */
@media (max-width: 900px) and (orientation: landscape), (max-height: 500px) and (orientation: landscape) {
  .ptop { height: 44px; }
  .ptop .logo-mark svg { width: 33px; height: 30px; }
  [data-page="game"] { --bsz: min(100vh - 64px, 58vw); }
  @supports (height: 100dvh) { [data-page="game"] { --bsz: min(100dvh - 64px, 58vw); } }
  /* board name and tournament move up into the top bar */
  [data-page="game"] .mtitle { position: fixed; top: 0; left: 180px; right: 150px; z-index: 6; height: 44px; padding: 0; flex-direction: row; align-items: center; pointer-events: none; }
  [data-page="game"] .mtitle > div { display: flex; align-items: baseline; gap: 8px; min-width: 0; white-space: nowrap; }
  [data-page="game"] .mtitle h1 { font-size: 15px; }
  [data-page="game"] .mtitle .sub { margin-top: 0; overflow: hidden; text-overflow: ellipsis; }
  .game { display: grid; grid-template-columns: var(--bsz) minmax(0, 1fr); align-items: start; gap: 8px 14px; padding: 10px 16px 16px; }
  .gamecard, .rightcol { display: contents; }
  .board { grid-column: 1; grid-row: 1 / span 3; width: var(--bsz); }
  .pblock { grid-column: 2; padding: 0 4px; }
  .gamecard .player { min-height: 32px; }
  .pblock:first-child { grid-row: 1; }
  .board ~ .pblock { grid-row: 3; }
  .strip { display: none; }
  .moves { grid-column: 2; grid-row: 2; height: calc(var(--bsz) - 114px); }
  .moves-head { padding: 8px 12px; }
  .mlist { flex: 1; min-height: 0; overflow-y: auto; padding: 2px 0; }
  /* the arrows sit in the moves card again: it is always on screen here */
  .nav { position: static; max-width: none; margin: 0; justify-content: center; gap: 8px; padding: 6px 10px; border: none; border-top: 1px solid var(--line-soft); border-radius: 0; box-shadow: none; }
  .nav button { max-width: 56px; height: 40px; }
  .info { grid-column: 1 / -1; grid-row: 4; flex-direction: row; align-items: center; }
  .grid { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }
}
@media (prefers-reduced-motion: no-preference) {
  .sq.last::before { transition: opacity .2s; }
}
