/* No Thanks! — a 1956 lunch counter (direction: games-nothanks surface brief, seed 0b1c1d59).
 *
 * Palette — sampled from the cover (assets/gen/cover.jpg, the Gemini greeting-card cartoon) and
 * the art brief in assets/gen/make_cards.sh: tomato #D9473A (the woman's dress, the 35, the
 * chips), deep teal #1F6B6B (the cardigan), mustard #C99A2E (the hoodie), cream paper #F6ECD6.
 * The room is the cardigan's teal taken into shadow; the counter is a pale formica of the same
 * teal; the guest checks are the mint of a diner order pad. Roles: tomato = paying a chip /
 * No thanks!; teal ink = Take; mustard = whose turn (the order-up lamp); cream = card stock.
 *
 * Type — Shrikhand (sign-painter display: the wordmark, the numerals, the two big buttons;
 * Google Fonts, OFL, self-hosted), Jost (UI text; from games/Hilt), Kalam (the handwritten tab
 * on every check; from games/Jass). All three ship in assets/fonts and load with swap.
 */

@font-face { font-family: 'Shrikhand'; src: url('assets/fonts/Shrikhand-latin.woff2') format('woff2'); font-weight: 400; font-display: swap; }
@font-face { font-family: 'Jost'; src: url('assets/fonts/Jost-latin.woff2') format('woff2'); font-weight: 300 700; font-display: swap; }
@font-face { font-family: 'Kalam'; src: url('assets/fonts/Kalam-700.woff2') format('woff2'); font-weight: 700; font-display: swap; }

:root {
    --tomato: #d9473a;
    --tomato-ink: #b23628;          /* tomato that carries cream text at 4.5:1 */
    --tomato-deep: #8f2a20;
    --teal: #1f6b6b;
    --teal-ink: #17595a;
    --teal-light: #4f9a92;
    --mustard: #c99a2e;
    --mustard-lit: #e8b93f;
    --burgundy: #7e2433;
    --cream: #f6ecd6;
    --paper: #fbf5e6;
    --ink: #1e2a2a;
    --ink-soft: #3d4f4e;
    --room: #123f40;
    --room-deep: #0b2c2d;
    --formica: #a9d2c8;
    --formica-deep: #8fc2b6;
    --check: #e6f1df;
    --check-edge: #c8dcc0;
    --rule: rgba(217, 71, 58, .55);
    --f-sign: 'Shrikhand', 'Jost', cursive;
    --f-ui: 'Jost', system-ui, sans-serif;
    --f-hand: 'Kalam', 'Jost', cursive;
    --ease: cubic-bezier(.2, .75, .25, 1);
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
    background: var(--room);
    background-image:
        radial-gradient(ellipse at 50% 30%, rgba(79, 154, 146, .22), transparent 65%),
        linear-gradient(var(--room), var(--room-deep));
    color: var(--ink);
    font-family: var(--f-ui);
    overflow: hidden;
    -webkit-tap-highlight-color: transparent;
    -webkit-font-smoothing: antialiased;
}
button { font-family: var(--f-ui); color: inherit; touch-action: manipulation; }
::selection { background: var(--mustard-lit); color: var(--ink); }
:focus-visible { outline: 3px solid var(--mustard-lit); outline-offset: 2px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* ── The crawlable intro, below the fold ─────────────────────────────────────── */
#intro { margin-top: 100vh; padding: 32px; color: var(--cream); max-width: 70ch; }
#intro a { color: var(--mustard-lit); }

/* ── The table ──────────────────────────────────────────────────────────────── */
#game { position: fixed; inset: 0; touch-action: none; user-select: none; -webkit-user-select: none; }
body:not(.in-game) #game, body:not(.in-game) #header-bar { display: none; }

/* the counter: pale teal formica, boomerang flecks, a ribbed chrome rim */
.counter {
    position: absolute;
    border-radius: 26px;
    background-color: var(--formica);
    background-image:
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='150' viewBox='0 0 180 150'%3E%3Cg fill='none' stroke-linecap='round' stroke-width='3.2'%3E%3Cpath d='M14 30q16-14 30 2' stroke='%231f6b6b' stroke-opacity='.18'/%3E%3Cpath d='M112 22q14 12 2 28' stroke='%23d9473a' stroke-opacity='.16'/%3E%3Cpath d='M60 96q18-6 26 12' stroke='%23c99a2e' stroke-opacity='.24'/%3E%3Cpath d='M140 104q-14 16-30 6' stroke='%23fbf5e6' stroke-opacity='.5'/%3E%3Cpath d='M28 128q10 8 22-2' stroke='%23fbf5e6' stroke-opacity='.45'/%3E%3C/g%3E%3Cg%3E%3Ccircle cx='86' cy='40' r='2' fill='%231f6b6b' fill-opacity='.22'/%3E%3Ccircle cx='160' cy='60' r='1.6' fill='%23d9473a' fill-opacity='.22'/%3E%3Ccircle cx='40' cy='70' r='1.6' fill='%23fbf5e6' fill-opacity='.6'/%3E%3Ccircle cx='120' cy='138' r='2' fill='%23c99a2e' fill-opacity='.3'/%3E%3Ccircle cx='8' cy='100' r='1.4' fill='%231f6b6b' fill-opacity='.2'/%3E%3C/g%3E%3C/svg%3E"),
        radial-gradient(ellipse at 50% 40%, rgba(255, 255, 255, .22), transparent 70%),
        linear-gradient(var(--formica), var(--formica-deep));
    background-clip: padding-box, padding-box, padding-box;
    border: 9px solid transparent;
    box-shadow: 0 18px 40px -10px rgba(0, 0, 0, .55);
}
/* the rim: a ribbed chrome band (highlight, groove, lowlight repeated) with one bright edge */
.counter::before {
    content: ''; position: absolute; inset: -9px; border-radius: inherit; pointer-events: none;
    padding: 9px;
    background:
        linear-gradient(rgba(255, 255, 255, .55), transparent 35%, transparent 65%, rgba(0, 0, 0, .25)),
        repeating-linear-gradient(90deg, #f3f7f7 0 2px, #b6c1c0 2px 3px, #8a9796 3px 4px, #dbe3e2 4px 6px);
    -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
    -webkit-mask-composite: xor;
    mask: linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0);
    box-shadow: inset 0 0 0 1px rgba(30, 42, 42, .45);
}
body.phone .counter { border-radius: 12px; border-width: 4px; }
body.phone .counter::before { inset: -4px; padding: 4px; }

/* ── Cards ──────────────────────────────────────────────────────────────────── */
.nt-card, .nt-back {
    position: absolute;
    width: var(--cw);
    height: calc(var(--cw) * 1.5);
    border-radius: calc(var(--cw) * .075);
    background: #f8efd9;
    box-shadow: 0 1px 1.5px rgba(30, 42, 42, .3), 0 calc(var(--cw) * .05) calc(var(--cw) * .14) calc(var(--cw) * -.04) rgba(10, 30, 30, .45);
    transform-origin: 0 0;
}
.nc-face {
    position: absolute;
    inset: calc(var(--cw) * .07);
    border-radius: calc(var(--cw) * .045);
    overflow: hidden;
    display: grid;
    place-items: center;
    --c: var(--teal-light);
    background:
        radial-gradient(ellipse 60% 40% at 30% 22%, rgba(255, 250, 235, .28), transparent 70%),
        radial-gradient(ellipse 70% 50% at 75% 85%, rgba(0, 0, 0, .14), transparent 70%),
        radial-gradient(circle at 12% 70%, rgba(255, 250, 235, .12) 0 18%, transparent 19%),
        var(--c);
    box-shadow: inset 0 0 0 max(1px, calc(var(--cw) * .012)) rgba(30, 42, 42, .55);
}
.nt-card[data-band="1"] .nc-face { --c: #4f9a92; }
.nt-card[data-band="2"] .nc-face { --c: #1f6b6b; }
.nt-card[data-band="3"] .nc-face { --c: #c99a2e; }
.nt-card[data-band="4"] .nc-face { --c: #d9473a; }
.nt-card[data-band="5"] .nc-face { --c: #7e2433; }
.nc-num {
    font-family: var(--f-sign);
    font-size: calc(var(--cw) * .5);
    line-height: 1;
    color: var(--cream);
    text-shadow: 0 calc(var(--cw) * .025) 0 rgba(30, 42, 42, .55);
    letter-spacing: -.02em;
    position: relative;
}
.nc-art { position: absolute; inset: 0; background-size: cover; background-position: center; }
body.art-cards .nc-num { display: none; }
.nc-idx {
    position: absolute;
    top: calc(var(--cw) * .1);
    left: calc(var(--cw) * .11);
    font-family: var(--f-ui);
    font-weight: 700;
    font-size: max(9px, calc(var(--cw) * .16));
    line-height: 1;
    color: var(--cream);
    text-shadow: 0 1px 0 rgba(30, 42, 42, .5);
    font-variant-numeric: tabular-nums;
}
.nc-idx.r { left: auto; right: calc(var(--cw) * .11); }
body.art-cards .nc-idx { background: rgba(30, 42, 42, .55); padding: 1px 3px; border-radius: 3px; }
.nt-card.small .nc-num { display: none; }
.nt-card.small .nc-idx { font-size: max(10px, calc(var(--cw) * .3)); top: calc(var(--cw) * .09); }
.nt-card.small .nc-idx:not(.r) { left: 50%; transform: translateX(-50%); font-size: max(12px, calc(var(--cw) * .42)); top: 26%; font-family: var(--f-sign); font-weight: 400; }
.nt-card.free { filter: saturate(.5) brightness(.95); }
.nt-card.free .nc-num { visibility: hidden; }
.nt-card.free .nc-idx:not(.r) { visibility: hidden; }
.nt-card.counts .nc-idx.r { visibility: hidden; }
.nt-card.in-row:not(.small) .nc-num { font-size: calc(var(--cw) * .44); }

.nt-back .nb-face {
    position: absolute;
    inset: calc(var(--cw) * .07);
    border-radius: calc(var(--cw) * .045);
    background:
        repeating-linear-gradient(45deg, rgba(201, 154, 46, .32) 0 2px, transparent 2px 9px),
        var(--teal);
    background-size: cover;
    display: grid;
    place-items: center;
    box-shadow: inset 0 0 0 max(1px, calc(var(--cw) * .02)) var(--cream), inset 0 0 0 max(2px, calc(var(--cw) * .05)) var(--teal);
    overflow: hidden;
}
.nb-word {
    font-family: var(--f-sign);
    font-size: calc(var(--cw) * .2);
    line-height: .95;
    text-align: center;
    color: var(--tomato);
    background: var(--cream);
    padding: calc(var(--cw) * .1) calc(var(--cw) * .06);
    border-radius: 50%;
    transform: rotate(-8deg);
}
.nt-back.mini .nb-word, .nt-back.deck-card:not(:last-of-type) .nb-word { display: none; }
body.art-back .nb-word { display: none; }

/* chips: tomato with cream edge stripes, like the cover's */
.nt-chip {
    position: absolute;
    width: var(--cd);
    height: var(--cd);
    border-radius: 50%;
    background:
        radial-gradient(circle, #e2584a 0 46%, var(--cream) 47% 52%, transparent 53%),
        repeating-conic-gradient(var(--tomato) 0 30deg, var(--cream) 30deg 45deg);
    background-size: cover;
    box-shadow: inset 0 0 0 1px rgba(143, 42, 32, .6), 0 1px 0 rgba(143, 42, 32, .9), 0 2px 3px rgba(0, 0, 0, .3);
    transform-origin: 0 0;
}
.nt-chip.mini { position: relative; display: inline-block; vertical-align: middle; }

.ghost { z-index: 900; pointer-events: none; will-change: transform; }

/* ── The middle: deck, served card, pot, ticket ─────────────────────────────── */
.deck { position: absolute; }
.deck .nt-back { position: absolute; }
.deck-count {
    position: absolute; left: 50%; top: calc(100% + 6px); transform: translateX(-50%);
    font: 600 13px/1 var(--f-ui); color: var(--teal-ink); white-space: nowrap;
    background: rgba(251, 245, 230, .75); padding: 3px 8px; border-radius: 999px;
}
.served-slot {
    position: absolute;
    border-radius: 10px;
    border: 2px dashed rgba(31, 107, 107, .35);
}
.nt-card.served { z-index: 5; }
.pot { position: absolute; }
.pot-chip { z-index: 6; }
.pot-count {
    position: absolute; z-index: 7; text-align: center;
    display: flex; align-items: baseline; justify-content: center; gap: 4px;
    color: var(--tomato-deep);
    pointer-events: none;
}
.pot-count b { font: 400 28px/1 var(--f-sign); font-variant-numeric: tabular-nums; }
.pot-count span { font: 600 13px/1 var(--f-ui); color: var(--ink-soft); }
.pot-count.empty b { color: var(--ink-soft); opacity: .7; }
body.phone .pot-count b { font-size: 20px; }
body.phone .pot-count span { font-size: 11px; }

.turn-ticket {
    position: absolute; z-index: 8;
    display: flex; align-items: center; justify-content: center; gap: 8px;
    font: 600 14px/1 var(--f-ui);
    color: var(--ink);
    pointer-events: none;
}
.tt-plate {
    display: inline-flex; align-items: center; gap: 8px; max-width: 100%;
    background: var(--paper); padding: 4px 10px 4px 4px; border-radius: 5px;
    box-shadow: 0 1px 0 rgba(30, 42, 42, .25), 0 3px 8px -3px rgba(0, 0, 0, .3);
}
.turn-ticket .tt-name {
    padding: 3px 8px; border-radius: 3px; background: rgba(31, 107, 107, .12);
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0;
}
.turn-ticket .tt-word { color: var(--teal-ink); font-weight: 600; white-space: nowrap; }
.turn-ticket.mine .tt-name { background: var(--mustard-lit); }
.turn-ticket.again .tt-word {
    font: 400 15px/1 var(--f-sign); color: var(--cream); background: var(--tomato-ink);
    padding: 4px 9px 5px; margin-right: -6px; border-radius: 4px; transform: rotate(-3deg);
    animation: nt-stamp .4s var(--ease) both;
}
@keyframes nt-stamp { from { transform: rotate(-12deg) scale(1.5); opacity: 0; } to { transform: rotate(-3deg) scale(1); opacity: 1; } }
body.phone .turn-ticket { font-size: 12px; }

/* ── The guest checks ───────────────────────────────────────────────────────── */
.check {
    position: absolute;
    border-radius: 6px;
    background:
        repeating-linear-gradient(transparent 0 21px, rgba(31, 107, 107, .1) 21px 22px),
        var(--check);
    box-shadow: inset 0 0 0 1px var(--check-edge), 0 2px 0 rgba(30, 42, 42, .12), 0 10px 18px -10px rgba(10, 30, 30, .55);
    transition: transform .25s var(--ease), box-shadow .25s var(--ease);
}
.check::before {           /* the tomato double rule under the head */
    content: ''; position: absolute; left: 8px; right: 8px; top: 28px; height: 4px;
    border-top: 1.5px solid var(--rule); border-bottom: 1px solid var(--rule);
}
.check.strip::before { display: none; }
.check.strip.me::before { display: block; top: 25px; height: 3px; }
.check.turn {
    box-shadow: inset 0 0 0 1px var(--check-edge), 0 0 0 3px var(--mustard-lit), 0 12px 22px -10px rgba(10, 30, 30, .6);
    transform: translateY(-2px);
}
@media (prefers-reduced-motion: reduce) { .check { transition: none; } .check.turn { transform: none; } }
.ck-head {
    position: absolute; left: 10px; right: 10px; top: 0; height: 28px;
    display: flex; align-items: center; gap: 8px;
    white-space: nowrap;
}
.ck-name {
    font: 600 15px/1 var(--f-ui); color: var(--ink);
    overflow: hidden; text-overflow: ellipsis; min-width: 0; flex: 0 1 auto;
}
.check.turn .ck-name::before {
    content: ''; display: inline-block; width: 9px; height: 9px; border-radius: 50%;
    background: var(--mustard-lit); box-shadow: inset 0 0 0 1.5px var(--tomato-deep); margin-right: 6px; vertical-align: 1px;
}
.check.thinking .ck-name::after { content: ' …'; color: var(--ink-soft); }
.ck-chips { display: inline-flex; align-items: center; gap: 4px; flex: none; }
.ck-chips b { font: 700 15px/1 var(--f-ui); color: var(--tomato-deep); font-variant-numeric: tabular-nums; }
.ck-chipstack { display: inline-flex; }
.ck-pile { position: relative; display: inline-block; width: 22px; height: 18px; }
.ck-pile .nt-chip { position: absolute; left: 0; }
.ck-pile .nt-chip:nth-child(1) { top: 6px; left: 0; }
.ck-pile .nt-chip:nth-child(2) { top: 3px; left: 5px; }
.ck-pile .nt-chip:nth-child(3) { top: 0; left: 2px; }
.ck-tiger { display: inline-block; position: relative; width: 14px; height: 21px; flex: none; }
.ck-tiger .nt-back { position: absolute; left: 0; top: 0; }
.ck-no { font: 700 12px/1 var(--f-hand); color: var(--tomato-ink); flex: none; opacity: .85; }
.ck-tab { margin-left: auto; display: inline-flex; align-items: baseline; gap: 5px; flex: none; }
.ck-tab small { font: 500 11px/1 var(--f-ui); color: var(--ink-soft); text-transform: uppercase; letter-spacing: .06em; }
.ck-tab b { font: 700 22px/1 var(--f-hand); color: var(--tomato-ink); min-width: 1.6em; text-align: right; font-variant-numeric: tabular-nums; }
.ck-row { position: absolute; }
.run-bracket {
    position: absolute; height: 6px;
    border: 1.5px solid rgba(30, 42, 42, .45); border-top: none; border-radius: 0 0 5px 5px;
}
.check.me .ck-name { font-size: 17px; }
.check.me .ck-chips b { font-size: 19px; }
.check.me .ck-tab b { font-size: 26px; }

/* phone strips: the name column on the left, the row to the right */
.check.strip:not(.me) .ck-head {
    right: auto; left: 6px; top: 0; bottom: 0; height: auto;
    display: grid; grid-template-columns: 1fr auto; grid-template-rows: 1fr 1fr; align-items: center; column-gap: 4px; row-gap: 0;
}
.check.strip:not(.me) .ck-name { font-size: 12px; grid-column: 1 / 3; align-self: end; }
.check.strip:not(.me) .ck-chips { grid-row: 2; }
.check.strip:not(.me) .ck-tiger { grid-row: 2; width: 11px; height: 17px; }
.check.strip:not(.me) .ck-tab { grid-row: 2; grid-column: 2; margin-left: 0; }
.check.strip:not(.me) .ck-tab small { display: none; }
.check.strip:not(.me) .ck-tab b { font-size: 16px; }
.check.strip .ck-pile { width: 18px; height: 15px; }
.check.strip .ck-pile .nt-chip:nth-child(1) { top: 4px; }
.check.strip .ck-pile .nt-chip:nth-child(2) { top: 2px; left: 4px; }
.check.strip.me .ck-head { height: 25px; left: 8px; right: 8px; }
.check.strip.me .ck-name { font-size: 14px; }
.check.strip.me .ck-tab b { font-size: 20px; }
.check.strip.me .ck-chips b { font-size: 16px; }
.check.strip:not(.me) .ck-name { font-size: 12px; }

/* run tiles (rows too small for a card to read) */
.ck-row.pills { display: flex; align-items: center; gap: 3px; overflow: hidden; }
.run-pill {
    display: inline-flex; align-items: baseline; gap: 1px; flex: none;
    padding: 0 5px; border-radius: 4px;
    align-items: center;
    color: var(--cream);
    background: var(--teal-light);
    box-shadow: inset 0 0 0 1px rgba(30, 42, 42, .4), 0 1px 0 rgba(30, 42, 42, .25);
    font-variant-numeric: tabular-nums;
}
.run-pill b { font: 400 14px/1 var(--f-sign); }
.run-pill small { font: 600 11px/1 var(--f-ui); opacity: .9; }
.run-pill[data-band="2"] { background: #1f6b6b; }
.run-pill[data-band="3"] { background: #b1861f; }
.run-pill[data-band="4"] { background: var(--tomato-ink); }
.run-pill[data-band="5"] { background: var(--burgundy); }

/* your tiger */
.ck-tigerslot { position: absolute; }
.ck-tigerslot .nt-card { position: absolute; }
.tg-side { position: absolute; top: 0; display: flex; flex-direction: column; gap: 6px; align-items: flex-start; }
.tg-label { font: 600 12px/1.1 var(--f-ui); color: var(--ink-soft); text-transform: uppercase; letter-spacing: .05em; }
.tg-play {
    min-height: 44px; min-width: 64px; padding: 0 12px; border: none; border-radius: 22px;
    background: var(--burgundy); color: var(--cream); font: 600 14px/1 var(--f-ui); cursor: pointer;
    box-shadow: 0 2px 0 #4f1520, 0 4px 10px -4px rgba(0, 0, 0, .4);
}
.tg-play:disabled { background: #b8c7c2; color: #4a5a58; box-shadow: none; cursor: default; }
body.phone .tg-play { min-width: 56px; font-size: 13px; padding: 0 8px; }
body.phone .tg-label { display: none; }
body.phone .tg-side { top: 50% !important; transform: translateY(-50%); }
.nowrap { white-space: nowrap; }

/* ── The two big buttons ────────────────────────────────────────────────────── */
.actions { position: absolute; display: flex; gap: 12px; z-index: 20; }
.actions.idle { visibility: hidden; }
.act {
    flex: 1 1 0; min-height: 44px; border: none; cursor: pointer;
    border-radius: 16px;
    display: flex; align-items: center; justify-content: center; gap: 10px;
    padding: 6px 14px;
    color: var(--cream);
    transition: transform .12s var(--ease), filter .12s;
}
.act-text { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; min-width: 0; }
.act b { font: 400 22px/1.05 var(--f-sign); white-space: nowrap; }
.act small { font: 500 12px/1.1 var(--f-ui); opacity: .92; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.act-pass { background: var(--tomato-ink); box-shadow: 0 3px 0 var(--tomato-deep), 0 8px 16px -8px rgba(0, 0, 0, .5); }
.act-take { background: var(--teal); box-shadow: 0 3px 0 #0f4243, 0 8px 16px -8px rgba(0, 0, 0, .5); }
.act:not(:disabled):hover { filter: brightness(1.08); }
.act:not(:disabled):active { transform: translateY(2px); }
.act:disabled { cursor: default; }
.actions:not(.live) .act { filter: saturate(.35); opacity: .8; }
.act-pass.empty:disabled { background: #c9b9ad; color: #5b3a33; box-shadow: 0 3px 0 #a89587; filter: none; opacity: 1; }
.act-pass.empty .act-chip { opacity: .35; }
.act-take.forced { animation: nt-nudge 1.6s ease-in-out infinite; box-shadow: 0 3px 0 #0f4243, 0 0 0 3px var(--mustard-lit), 0 8px 16px -8px rgba(0, 0, 0, .5); }
@keyframes nt-nudge { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-3px); } }
@media (prefers-reduced-motion: reduce) { .act-take.forced { animation: none; } }
.actions.shake { animation: nt-shake .3s; }
@keyframes nt-shake { 25% { transform: translateX(-5px); } 75% { transform: translateX(5px); } }
body.phone .actions { gap: 8px; }
body.phone .act { border-radius: 12px; padding: 4px 8px; gap: 6px; }
body.phone .act b { font-size: 17px; }
body.phone .act small { font-size: 10.5px; }

/* ── Status plate, speech bubbles ───────────────────────────────────────────── */
#status-line {
    position: fixed; z-index: 30; pointer-events: none;
    padding: 6px 14px 7px;
    border-radius: 8px 8px 0 0;
    background: var(--paper);
    color: var(--ink);
    font: 500 14px/1.25 var(--f-ui);
    box-shadow: 0 -2px 10px -4px rgba(0, 0, 0, .3);
    opacity: 0; transition: opacity .2s;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
#status-line.show { opacity: 1; }
#status-line.turn { background: var(--mustard-lit); }
#status-line.alert { background: var(--tomato-ink); color: var(--cream); }
body:not(.in-game) #status-line, body.phone #status-line { display: none; }

.say {
    position: fixed; z-index: 950; pointer-events: none;
    padding: 6px 12px 7px; border-radius: 14px;
    font: 400 16px/1 var(--f-sign);
    background: var(--paper); color: var(--ink);
    box-shadow: 0 2px 0 rgba(30, 42, 42, .25), 0 8px 16px -6px rgba(0, 0, 0, .4);
    opacity: 0; transform: translateY(6px) scale(.92);
    transition: opacity .18s, transform .22s var(--ease);
    white-space: nowrap;
}
.say.show { opacity: 1; transform: none; }
.say.pass { color: var(--tomato-ink); }
.say.take { color: var(--teal-ink); }
.say.tiger { color: var(--burgundy); }
body.phone .say { font-size: 13px; padding: 4px 9px 5px; }

/* ── Header (desk/tablet bar; phone dock) ───────────────────────────────────── */
#header-bar {
    position: fixed; left: 0; right: 0; top: 0; height: 54px; z-index: 40;
    display: flex; align-items: center; gap: 6px;
    padding: 0 10px;
    padding-left: max(10px, env(safe-area-inset-left));
    padding-right: max(10px, env(safe-area-inset-right));
    background: linear-gradient(#174a4b, var(--room));
    color: var(--cream);
    box-shadow: 0 1px 0 #eef3f2, 0 3px 0 #7f8d8c, 0 6px 14px rgba(0, 0, 0, .35);
}
.hdr-btn {
    width: 44px; height: 44px; flex: none; border: none; border-radius: 10px;
    background: transparent; color: var(--cream); cursor: pointer;
    display: grid; place-items: center;
}
.hdr-btn svg { pointer-events: none; }
.hdr-btn:hover, .hdr-btn.active { background: rgba(246, 236, 214, .12); }
.hdr-btn.off { color: rgba(246, 236, 214, .55); }
.hdr-title {
    margin-left: 4px;
    font-family: var(--f-sign); font-size: 26px; line-height: 1; white-space: nowrap;
    color: var(--cream); text-shadow: 0 2px 0 var(--tomato-ink);
    pointer-events: none;
}
.hdr-title .wm-no { color: var(--mustard-lit); margin-right: .22em; text-shadow: 0 2px 0 var(--tomato-deep); }
.hdr-tools { margin-left: auto; display: flex; align-items: center; gap: 2px; }
#more-btn { display: none; }
@media (max-width: 860px) {
    .hdr-btn.tool { display: none; }
    #more-btn { display: grid; }
}
@media (max-width: 640px) { .hdr-title { font-size: 21px; } }

/* the AI lamp: a lit or dark lamp AND a word */
#ai-indicator {
    position: relative; height: 44px; padding: 0 10px; border: none; border-radius: 22px; cursor: pointer;
    display: inline-flex; align-items: center; gap: 7px;
    background: rgba(246, 236, 214, .1); color: var(--cream);
    font: 600 13px/1 var(--f-ui); white-space: nowrap;
}
.ai-lamp { width: 10px; height: 10px; border-radius: 50%; background: #5d7271; box-shadow: inset 0 0 0 1.5px rgba(0, 0, 0, .35); }
#ai-indicator.ai-onnx .ai-lamp, #ai-indicator.ai-search .ai-lamp { background: var(--mustard-lit); }
#ai-indicator.ai-heuristic .ai-lamp { background: var(--cream); }
#ai-indicator.ai-pending .ai-lamp { background: transparent; box-shadow: inset 0 0 0 1.5px var(--cream); }
#ai-indicator-detail {
    display: none; position: absolute; right: 0; top: calc(100% + 8px); width: 270px; z-index: 60;
    background: var(--paper); color: var(--ink); border-radius: 10px; padding: 12px 14px; text-align: left;
    box-shadow: 0 12px 28px -8px rgba(0, 0, 0, .5); white-space: normal; font-weight: 400;
}
#ai-indicator.tip-open #ai-indicator-detail { display: block; }
.ai-detail-head { font: 400 16px/1.1 var(--f-sign); color: var(--teal-ink); margin-bottom: 8px; }
.ai-detail-row { display: flex; justify-content: space-between; gap: 10px; padding: 3px 0; font-size: 13px; border-bottom: 1px dashed rgba(30, 42, 42, .2); }
.ai-detail-row b { font-weight: 600; text-align: right; }
.ai-detail-why { margin-top: 8px; font-size: 12.5px; line-height: 1.35; color: var(--ink-soft); }

/* the dock on a phone: a ribbon over the served card */
#header-bar.dock {
    right: auto; padding: 0 2px; gap: 0; border-radius: 10px;
    background: var(--room);
    box-shadow: 0 2px 0 #7f8d8c, 0 6px 12px -4px rgba(0, 0, 0, .4);
}
#header-bar.dock .hdr-title { position: static; transform: none; font-size: 15px; letter-spacing: -.01em; margin: 0 4px; flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; text-align: center; }
#header-bar.dock .hdr-tools { margin-left: 0; gap: 0; }
#header-bar.dock .hdr-btn.tool { display: none; }
#header-bar.dock #more-btn { display: grid; }
#header-bar.dock #ai-indicator { padding: 0; width: 44px; justify-content: center; background: transparent; }
#header-bar.dock #ai-indicator .ai-text { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
#header-bar.dock #ai-indicator .ai-lamp { width: 12px; height: 12px; }
#header-bar.dock #ai-indicator::after { content: 'AI'; font: 700 10px/1 var(--f-ui); margin-left: 3px; }
#header-bar.dock #ai-indicator-detail { left: 0; right: auto; }

/* menus and panels */
.hdr-menu {
    position: fixed; z-index: 1300; min-width: 200px; padding: 6px;
    background: var(--paper); color: var(--ink); border-radius: 12px;
    box-shadow: 0 14px 30px -8px rgba(0, 0, 0, .5);
}
.hdr-menu-item {
    display: flex; align-items: center; gap: 10px; width: 100%; min-height: 44px; padding: 0 10px;
    border: none; background: none; border-radius: 8px; cursor: pointer; font: 500 15px/1 var(--f-ui); text-align: left;
}
.hdr-menu-item:hover, .hdr-menu-item:focus-visible { background: rgba(31, 107, 107, .1); }
.hdr-menu-item.on { background: rgba(201, 154, 46, .22); }
.mi-icon { display: inline-grid; place-items: center; width: 24px; color: var(--teal-ink); }
.flag svg, .mi-icon .flag { display: block; width: 24px; height: 16px; border-radius: 2px; box-shadow: 0 0 0 1px rgba(0, 0, 0, .15); }
.flag { display: inline-block; width: 24px; height: 16px; }

.side-panel {
    position: fixed; right: 10px; width: min(360px, calc(100vw - 20px)); max-height: calc(100vh - 80px); z-index: 1100;
    display: flex; flex-direction: column;
    background: var(--check); color: var(--ink); border-radius: 10px;
    box-shadow: inset 0 0 0 1px var(--check-edge), 0 18px 36px -10px rgba(0, 0, 0, .6);
    overflow: hidden;
}
body.phone .side-panel { top: 6px !important; right: 6px; max-height: calc(100vh - 12px); width: min(340px, calc(100vw - 12px)); }
.panel-head { display: flex; align-items: center; justify-content: space-between; padding: 6px 6px 6px 14px; border-bottom: 2px solid var(--rule); }
.panel-head h3 { margin: 0; font: 400 19px/1.1 var(--f-sign); color: var(--teal-ink); }
.panel-close { width: 44px; height: 44px; border: none; background: none; border-radius: 10px; cursor: pointer; display: grid; place-items: center; color: var(--ink); }
.panel-body { overflow-y: auto; -webkit-overflow-scrolling: touch; padding: 8px 14px 12px; font-size: 14px; line-height: 1.35; }
.panel-foot { padding: 8px 14px 10px; font-size: 12px; line-height: 1.35; color: var(--ink-soft); border-top: 1px dashed rgba(30, 42, 42, .25); }
.panel-empty { color: var(--ink-soft); font-style: italic; }
.log-round { font: 400 15px/1 var(--f-sign); color: var(--tomato-ink); margin: 10px 0 4px; padding-bottom: 3px; border-bottom: 1px solid var(--rule); }
.log-line { padding: 2px 0; }
.log-out { color: var(--ink-soft); font-size: 13px; }
.log-card, .bl-card {
    display: inline-block; min-width: 22px; padding: 1px 4px; border-radius: 3px; text-align: center;
    font: 700 12px/1.3 var(--f-ui); color: var(--cream); background: var(--teal-light); font-variant-numeric: tabular-nums;
}
.log-card[data-band="2"], .bl-card[data-band="2"] { background: #1f6b6b; }
.log-card[data-band="3"], .bl-card[data-band="3"] { background: #a67d1c; }
.log-card[data-band="4"], .bl-card[data-band="4"] { background: var(--tomato-ink); }
.log-card[data-band="5"], .bl-card[data-band="5"] { background: var(--burgundy); }
.ae-entry { padding: 8px 0; border-bottom: 1px dashed rgba(30, 42, 42, .2); }
.ae-head { display: flex; justify-content: space-between; gap: 8px; }
.ae-head span { color: var(--ink-soft); font-size: 12.5px; }
.ae-ctx { font-size: 12.5px; color: var(--ink-soft); margin: 2px 0 4px; }
.ae-bar { position: relative; display: flex; justify-content: space-between; align-items: center; height: 24px; margin: 3px 0; padding: 0 8px; border-radius: 5px; background: rgba(30, 42, 42, .07); overflow: hidden; font-size: 13px; font-variant-numeric: tabular-nums; }
.ae-fill { position: absolute; left: 0; top: 0; bottom: 0; background: rgba(31, 107, 107, .25); }
.ae-bar.pass .ae-fill { background: rgba(217, 71, 58, .22); }
.ae-bar.chosen { font-weight: 700; box-shadow: inset 0 0 0 1.5px var(--ink); }
.ae-bar.chosen .ae-l::before { content: ''; display: inline-block; width: 7px; height: 9px; margin-right: 6px; background: currentColor; clip-path: polygon(0 0, 100% 50%, 0 100%); }
.ae-l, .ae-p { position: relative; }
.ae-rule { font-size: 12.5px; font-style: italic; color: var(--ink-soft); margin-top: 3px; }

#rules-popup {
    position: fixed; z-index: 1500; left: 50%; top: 50%; transform: translate(-50%, -50%);
    width: min(560px, calc(100vw - 24px)); max-height: calc(100vh - 24px); overflow-y: auto;
    background: var(--paper); color: var(--ink); border-radius: 12px; padding: 18px 22px 16px;
    box-shadow: inset 0 0 0 1px rgba(30, 42, 42, .15), 0 24px 60px -10px rgba(0, 0, 0, .6);
}
#rules-popup h3 { margin: 0 44px 10px 0; font: 400 26px/1.1 var(--f-sign); color: var(--tomato-ink); }
#rules-popup p { margin: 0 0 8px; font-size: 15px; line-height: 1.45; }
#rules-popup b { color: var(--teal-ink); }
#rules-popup-close { position: absolute; right: 8px; top: 8px; width: 44px; height: 44px; border: none; background: none; border-radius: 10px; cursor: pointer; display: grid; place-items: center; }
@media (max-height: 420px) { #rules-popup p { font-size: 13.5px; margin-bottom: 5px; } #rules-popup h3 { font-size: 21px; } }

/* ── Welcome plate ──────────────────────────────────────────────────────────── */
#nt-welcome { position: fixed; inset: 0; z-index: 1190; display: grid; place-items: center; pointer-events: auto; }
.nt-welcome-plate {
    background: var(--paper); border-radius: 14px; padding: 20px 30px 18px; text-align: center; max-width: calc(100vw - 32px);
    box-shadow: inset 0 0 0 1px rgba(30, 42, 42, .12), 0 24px 48px -12px rgba(0, 0, 0, .6);
    opacity: 0; transform: translateY(10px); transition: opacity .3s, transform .3s var(--ease);
}
#nt-welcome.show .nt-welcome-plate { opacity: 1; transform: none; }
.nt-welcome-title { font: 400 30px/1.1 var(--f-sign); color: var(--tomato-ink); }
.nt-welcome-line { margin-top: 8px; font: 500 16px/1.3 var(--f-ui); color: var(--teal-ink); }
body.phone .nt-welcome-title { font-size: 22px; }

/* ── The bill and the final scores ──────────────────────────────────────────── */
.nt-layer {
    position: fixed; inset: 0; z-index: 1200; display: grid; place-items: center; padding: 10px;
    background: rgba(11, 44, 45, .55);
    opacity: 0; transition: opacity .2s;
}
.nt-layer.show { opacity: 1; }
.bill {
    width: min(760px, 100%); max-height: 100%;
    display: flex; flex-direction: column;
    background:
        repeating-linear-gradient(transparent 0 25px, rgba(31, 107, 107, .1) 25px 26px),
        var(--check);
    border-radius: 6px;
    box-shadow: inset 0 0 0 1px var(--check-edge), 0 24px 60px -12px rgba(0, 0, 0, .7);
    overflow: hidden;
}
.bill-head { padding: 14px 20px 8px; border-bottom: 2px solid var(--rule); flex: none; }
.bill-head h2 { margin: 0; font: 400 26px/1.1 var(--f-sign); color: var(--tomato-ink); }
.bill-head p { margin: 4px 0 0; font-size: 13.5px; color: var(--ink-soft); }
.bill-body { overflow: auto; -webkit-overflow-scrolling: touch; padding: 6px 14px; flex: 1 1 auto; min-height: 0; }
.bill-foot { display: flex; justify-content: flex-end; gap: 10px; padding: 10px 16px 12px; flex: none; flex-wrap: wrap; border-top: 1px dashed rgba(30, 42, 42, .25); }
.bill-table { width: 100%; border-collapse: collapse; font-size: 14px; font-variant-numeric: tabular-nums; }
.bill-table th { font: 600 11.5px/1.2 var(--f-ui); text-transform: uppercase; letter-spacing: .05em; color: var(--ink-soft); text-align: left; padding: 6px 6px; white-space: nowrap; }
.bill-table td { padding: 6px 6px; border-top: 1px solid rgba(30, 42, 42, .12); vertical-align: middle; }
.bill-table .num { text-align: right; white-space: nowrap; }
.bill-table td.neg { color: var(--teal-ink); }
.bill-table .b-round, .bill-table .b-total { font-family: var(--f-hand); font-weight: 700; font-size: 19px; color: var(--tomato-ink); }
.bill-table th.b-round, .bill-table th.b-total { font-family: var(--f-ui); font-size: 11.5px; color: var(--ink-soft); }
.bill-table td.b-r { color: var(--ink-soft); }
.bill-table tr.me td { background: rgba(232, 185, 63, .2); }
.bill-table .b-name { font-weight: 600; white-space: nowrap; max-width: 110px; overflow: hidden; text-overflow: ellipsis; }
.b-cards { line-height: 1.9; }
.bl-run { display: inline-flex; margin-right: 6px; }
.bl-run .bl-card { min-width: 20px; padding: 1px 3px; font-size: 11.5px; }
.bl-run .bl-card + .bl-card { margin-left: 1px; }
.bl-card.free { opacity: .5; }
.bl-tiger { display: inline-block; font-size: 11.5px; color: var(--burgundy); font-style: italic; margin-left: 4px; }
.nt-btn {
    min-height: 46px; padding: 0 20px; border-radius: 23px; border: none; cursor: pointer;
    font: 600 16px/1 var(--f-ui); background: transparent; color: var(--teal-ink);
    box-shadow: inset 0 0 0 2px var(--teal-ink);
}
.nt-btn.primary { background: var(--tomato-ink); color: var(--cream); box-shadow: 0 3px 0 var(--tomato-deep); font: 400 19px/1 var(--f-sign); padding: 0 26px; }
.nt-btn:hover { filter: brightness(1.06); }
.bill.final { width: min(560px, 100%); }
.standings { list-style: none; margin: 4px 0; padding: 0; }
.standings li { display: grid; grid-template-columns: 34px 1fr auto auto; align-items: center; gap: 10px; padding: 8px 6px; border-top: 1px solid rgba(30, 42, 42, .12); }
.standings li.me { background: rgba(232, 185, 63, .2); }
.sd-rank { font: 400 20px/1 var(--f-sign); color: var(--ink-soft); text-align: center; }
.standings li.win .sd-rank { color: var(--cream); background: var(--tomato-ink); border-radius: 50%; width: 32px; height: 32px; display: grid; place-items: center; font-size: 17px; }
.sd-name { font-weight: 600; font-size: 16px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sd-rounds { font-size: 12.5px; color: var(--ink-soft); font-variant-numeric: tabular-nums; white-space: nowrap; }
.sd-total { font: 700 24px/1 var(--f-hand); color: var(--tomato-ink); font-variant-numeric: tabular-nums; min-width: 2.2em; text-align: right; }
.bill.final .dk-more { margin-top: 10px; }
@media (max-height: 420px) {
    .nt-layer { padding: 4px; }
    .bill-head { padding: 5px 14px 4px; }
    .bill-table thead th { padding-top: 2px; padding-bottom: 2px; }
    .bill-table td { padding-top: 1px !important; padding-bottom: 1px !important; }
    .bl-run .bl-card { font-size: 10.5px; line-height: 1.2; }
    .bill-table td, .bill-table .b-round, .bill-table .b-total { line-height: 1.1; }
    .bl-tiger { font-size: 10.5px; }
    .bill-head h2 { font-size: 20px; }
    .bill-head p { display: none; }
    .bill-table { font-size: 12.5px; }
    .bill-table td, .bill-table th { padding: 3px 4px; }
    .bill-table .b-round, .bill-table .b-total { font-size: 16px; }
    .b-cards { line-height: 1.25; }
    .bill-foot { padding: 4px 12px 4px; }
    .nt-btn { min-height: 44px; }
    .standings li { padding: 4px 6px; }
}
@media (max-width: 640px) { .bill-table th.b-r, .bill-table td.b-r { display: none; } }

/* ── Start screen: the cover, and a guest check on the counter ─────────────── */
#start-screen {
    position: fixed; inset: 0; z-index: 1000;
    display: flex; align-items: center; justify-content: flex-end;
    padding: 16px max(16px, 4vw);
    background: var(--cream);
}
.st-cover {
    position: absolute; inset: 0;
    background: url('assets/cover.webp') left 30% center / cover no-repeat, var(--cream);
}
.st-cover::after {        /* lets the check sit on the paper without fighting the drawing */
    content: ''; position: absolute; inset: 0;
    background: linear-gradient(90deg, transparent 45%, rgba(246, 236, 214, .55) 70%, rgba(246, 236, 214, .8));
}
.start-card {
    position: relative; z-index: 1;
    width: 430px; flex: none;
    transform-origin: right center;
    background:
        repeating-linear-gradient(transparent 0 25px, rgba(31, 107, 107, .1) 25px 26px),
        var(--check);
    border-radius: 6px;
    padding: 18px 24px 16px;
    box-shadow: inset 0 0 0 1px var(--check-edge), 0 2px 0 rgba(30, 42, 42, .15), 0 30px 60px -18px rgba(10, 30, 30, .6);
    display: grid;
    grid-template-areas: 'head' 'set' 'go' 'foot';
    row-gap: 12px;
}
.st-head { grid-area: head; position: relative; padding-bottom: 10px; border-bottom: 2px solid var(--rule); }
.st-stub { position: absolute; right: 0; top: 0; display: flex; gap: 4px; align-items: baseline; font: 600 12px/1 var(--f-ui); color: var(--tomato-ink); }
.st-stub-n { font: 700 20px/1 var(--f-hand); }
.st-wordmark {
    margin: 0; font-family: var(--f-sign); font-weight: 400; font-size: 54px; line-height: .95;
    color: var(--tomato); letter-spacing: -.01em;
    text-shadow: 2px 3px 0 var(--teal);
}
.st-wordmark .wm-no { color: var(--teal); text-shadow: 2px 3px 0 var(--mustard); }
.st-tag { margin: 8px 0 0; font: italic 500 15px/1.3 var(--f-ui); color: var(--ink-soft); text-wrap: balance; }
.st-settings { grid-area: set; display: grid; grid-template-columns: auto 1fr; gap: 10px 18px; align-items: start; }
.st-field { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.st-level, .st-variants { grid-column: 1 / 3; }
.st-label { font: 600 11.5px/1 var(--f-ui); text-transform: uppercase; letter-spacing: .07em; color: var(--ink-soft); white-space: nowrap; }
.st-step { display: inline-flex; align-items: center; gap: 2px; background: var(--paper); border-radius: 22px; box-shadow: inset 0 0 0 1.5px rgba(30, 42, 42, .2); }
.st-stepbtn { width: 44px; height: 44px; border: none; background: none; border-radius: 50%; cursor: pointer; display: grid; place-items: center; color: var(--teal-ink); }
.st-stepbtn svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; }
.st-stepbtn:disabled { color: #9fb0ab; cursor: default; }
.st-stepval { min-width: 26px; text-align: center; font: 400 24px/1 var(--f-sign); color: var(--tomato-ink); font-variant-numeric: tabular-nums; }
.st-seg { display: flex; gap: 0; background: var(--paper); border-radius: 22px; padding: 0; box-shadow: inset 0 0 0 1.5px rgba(30, 42, 42, .2); width: 100%; }
.st-opt {
    flex: 1 1 0; min-height: 44px; border: none; background: none; border-radius: 22px; cursor: pointer;
    font: 600 14.5px/1 var(--f-ui); color: var(--ink-soft); padding: 0 10px; white-space: nowrap;
}
.st-opt.on { background: var(--teal); color: var(--cream); box-shadow: 0 2px 0 #0f4243; }
.st-note { margin: 0; font-size: 13px; line-height: 1.3; color: var(--ink-soft); min-height: 2.6em; }
.st-variants { gap: 4px; }
.st-tick {
    display: flex; align-items: center; gap: 10px; min-height: 44px; padding: 2px 4px; border: none; background: none; cursor: pointer; text-align: left; border-radius: 8px;
}
.st-tick:disabled { cursor: default; }
.st-box { width: 24px; height: 24px; flex: none; border-radius: 4px; background: var(--paper); box-shadow: inset 0 0 0 1.5px rgba(30, 42, 42, .45); display: grid; place-items: center; }
.st-box svg { width: 18px; height: 18px; fill: none; stroke: var(--tomato-ink); stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; opacity: 0; }
.st-tick.on .st-box svg { opacity: 1; }
.st-tick-text { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.st-tick-text b { font: 600 14.5px/1.15 var(--f-ui); color: var(--ink); }
.st-tick-text small { font-size: 12.5px; color: var(--ink-soft); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.st-tick:disabled .st-tick-text b { color: #6f7e7b; }
.st-tick:disabled .st-box { background: #dfe7e2; }
.st-go { grid-area: go; display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.st-play {
    min-height: 54px; min-width: 170px; padding: 6px 30px; border: none; border-radius: 27px; cursor: pointer;
    background: var(--tomato-ink); color: var(--cream);
    box-shadow: 0 4px 0 var(--tomato-deep), 0 12px 20px -10px rgba(0, 0, 0, .5);
    display: inline-flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
    transition: transform .12s var(--ease), filter .12s;
}
.st-play span { font: 400 25px/1 var(--f-sign); }
.st-play small { font: 500 12px/1 var(--f-ui); opacity: .9; }
.st-play:hover { filter: brightness(1.07); }
.st-play:active { transform: translateY(2px); }
.st-link {
    min-height: 44px; padding: 0 6px; border: none; background: none; cursor: pointer;
    display: inline-flex; align-items: center;
    font: 600 15px/1 var(--f-ui); color: var(--teal-ink); text-decoration: underline; text-underline-offset: 4px; text-decoration-thickness: 1.5px;
}
.st-credits { grid-area: foot; margin: 0; font-size: 12px; color: var(--ink-soft); }
.st-credits b { font-weight: 600; color: var(--ink); }
.st-support {
    display: block; width: fit-content; margin-top: 4px;
    font: 600 12px/1.3 var(--f-ui); color: var(--tomato-ink);
    text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px;
}
.st-support:hover { text-decoration-thickness: 2px; }
.st-support:focus-visible { outline: 3px solid var(--teal); outline-offset: 2px; border-radius: 2px; }
@media (pointer: coarse) { .st-support { display: flex; align-items: center; min-height: 44px; margin: -6px 0 -10px; } }
.st-lang { position: relative; margin-left: auto; }
.st-lang-btn { width: 44px; height: 44px; border: none; background: none; cursor: pointer; display: grid; place-items: center; border-radius: 8px; }
.st-lang-btn svg { width: 28px; height: 19px; border-radius: 2px; box-shadow: 0 0 0 1px rgba(0, 0, 0, .2); }
.st-lang-pick { position: absolute; right: 0; bottom: 48px; z-index: 5; background: var(--paper); border-radius: 10px; padding: 5px; box-shadow: 0 12px 26px -8px rgba(0, 0, 0, .45); }
.st-lang-opt { display: flex; align-items: center; gap: 10px; min-height: 44px; width: 150px; padding: 0 10px; border: none; background: none; border-radius: 7px; cursor: pointer; font: 500 14.5px/1 var(--f-ui); }
.st-lang-opt svg { width: 24px; height: 16px; border-radius: 2px; box-shadow: 0 0 0 1px rgba(0, 0, 0, .15); flex: none; }
.st-lang-opt.on, .st-lang-opt:hover { background: rgba(31, 107, 107, .1); }

/* short landscape (phones): the check turns sideways — name and Play left, settings right */
@media (max-height: 560px) and (min-width: 540px) {
    #start-screen { padding: 8px 10px; }
    .start-card {
        width: 610px; padding: 12px 16px 10px;
        grid-template-areas: 'head set' 'go set' 'foot set';
        grid-template-columns: 210px 1fr; grid-template-rows: auto 1fr auto;
        column-gap: 18px; row-gap: 8px;
    }
    .st-wordmark { font-size: 40px; }
    .st-tag { font-size: 13px; }
    .st-stub { display: none; }
    .st-go { flex-direction: row; flex-wrap: wrap; align-items: center; gap: 2px 6px; align-self: start; }
    .st-go .st-play { flex: 1 0 100%; }
    .st-lang-pick { left: 0; right: auto; }
    .st-play { min-width: 0; min-height: 50px; }
    .st-settings { gap: 6px 14px; }
    .st-note { min-height: 0; font-size: 12px; }
    .st-credits { font-size: 11px; }
    .st-cover::after { background: linear-gradient(90deg, transparent 20%, rgba(246, 236, 214, .7) 55%); }
}
/* portrait: the check sits on the lower half, the drawing above it */
@media (orientation: portrait) {
    #start-screen { justify-content: center; align-items: flex-end; }
    .st-cover { background-position: center top; background-size: auto 46vh; background-color: var(--cream); }
    .start-card { transform-origin: center bottom; }
    .st-cover::after { background: linear-gradient(transparent 38vh, rgba(246, 236, 214, .9) 48vh); }
}

/* ── Rotate cover for phones held upright ───────────────────────────────────── */
#nt-rotate { display: none; }
@media (orientation: portrait) and (pointer: coarse) and (max-width: 559px) {
    body.in-game #nt-rotate {
        display: grid; place-items: center; position: fixed; inset: 0; z-index: 2000;
        background: var(--room); color: var(--cream);
    }
}
