/* Rise — the yard of a waking industrial town, told on enamel signs.
 *
 * Where each choice came from:
 *   --enamel  #34495a   the cover's RISE lettering (sampled #5c6c77 over the paper, deepened to
 *                       the solid letter core) — vitreous enamel sign ground for every sign
 *   --ink     #f4efe4   the white of enamel lettering, warmed toward the cover's paper
 *   --ochre   #e6b363   the cover's sunrise behind the chimneys (sampled #f2d2a4, saturated so it
 *                       reads at 12px on enamel) — reserved for the ONE thing to do now
 *   --rust    #a4492a   the earth bank under the locomotive (#5d3824, lifted for a dark panel) — loss
 *   --soot    #1c1a20   the chimney smoke at the cover's foot (#18181f) — the brick and the floor
 *   --brass   #c7a35e   reserved (the coin art carries its own gold)
 *   player colours      the wooden pieces (pieces/*.webp), lifted for chips on soot
 *   fonts               Marcellus — the cover's flared capitals; Libre Franklin — a 1902 American
 *                       gothic for the working text (both self-hosted, latin subset, OFL)
 */
* { box-sizing: border-box; margin: 0; padding: 0; }

@font-face { font-family: 'Marcellus'; src: url('assets/fonts/Marcellus-latin.woff2') format('woff2'); font-display: swap; }
@font-face { font-family: 'Libre Franklin'; src: url('assets/fonts/LibreFranklin-latin.woff2') format('woff2'); font-weight: 100 900; font-display: swap; }
/* "Rise Today!", the round's newspaper (Latin faces; other scripts fall back to the game's own) */
@font-face { font-family: 'Unifraktur'; src: url('assets/fonts/UnifrakturMaguntia.woff2') format('woff2'); font-display: swap; }
@font-face { font-family: 'Playfair Display'; font-weight: 400 900; src: url('assets/fonts/PlayfairDisplay-normal-latin.woff2') format('woff2'); unicode-range: U+0000-00FF, U+2000-206F, U+20AC; font-display: swap; }
@font-face { font-family: 'Crimson Pro'; font-weight: 200 900; src: url('assets/fonts/CrimsonPro-normal-latin.woff2') format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+2000-206F, U+20AC, U+2122, U+2212; font-display: swap; }
@font-face { font-family: 'Crimson Pro'; font-style: italic; font-weight: 200 900; src: url('assets/fonts/CrimsonPro-italic-latin.woff2') format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+2000-206F, U+20AC, U+2122, U+2212; font-display: swap; }

:root {
    --enamel: #34495a;
    --enamel-deep: #22323f;
    --enamel-hi: #4b6479;
    --ink: #f4efe4;
    --ink-dim: #c9cfd3;
    --ochre: #e6b363;
    --ochre-deep: #b9822f;
    --ochre-ink: #2a2117;
    --rust: #a4492a;
    --soot: #1c1a20;
    --soot-2: #26232a;
    --brick: #3a2a26;
    --brass: #c7a35e;
    --font-display: 'Marcellus', 'Georgia', serif;
    --font-ui: 'Libre Franklin', system-ui, sans-serif;
    --ease: cubic-bezier(.22, .8, .3, 1);
}

/* The two faces are Latin subsets. Japanese, Korean and Ukrainian get glyphs from the reader's own
   system fonts, named here so the display face stays a serif and the working face a gothic (and
   the page's lang, set by i18n.js, picks the right CJK forms). Ukrainian sets its working text
   wholly in the system face: Cyrillic letters beside Libre Franklin digits read as two fonts. */
:root:lang(ja) {
    --font-display: 'Marcellus', 'Hiragino Mincho ProN', 'Yu Mincho', 'Noto Serif CJK JP', 'Noto Serif JP', serif;
    --font-ui: 'Libre Franklin', 'Hiragino Sans', 'Hiragino Kaku Gothic ProN', 'Yu Gothic UI', 'Meiryo', 'Noto Sans CJK JP', 'Noto Sans JP', system-ui, sans-serif;
}
:root:lang(ko) {
    --font-display: 'Marcellus', 'AppleMyungjo', 'Nanum Myeongjo', 'Batang', 'Noto Serif CJK KR', 'Noto Serif KR', serif;
    --font-ui: 'Libre Franklin', 'Apple SD Gothic Neo', 'Malgun Gothic', 'Noto Sans CJK KR', 'Noto Sans KR', system-ui, sans-serif;
}
:root:lang(uk) {
    --font-display: 'Marcellus', 'Georgia', 'Noto Serif', 'Times New Roman', serif;
    --font-ui: system-ui, 'Segoe UI', 'Roboto', 'Noto Sans', sans-serif;
}
:root:lang(ko) body { word-break: keep-all; overflow-wrap: break-word; }
:root:lang(ja) body { line-break: strict; }

html, body { width: 100%; height: 100%; overflow: hidden; background: var(--soot); }
body {
    font-family: var(--font-ui);
    color: var(--ink);
    -webkit-font-smoothing: antialiased;
    -webkit-tap-highlight-color: transparent;
    user-select: none; -webkit-user-select: none;
}
::selection { background: var(--ochre); color: var(--ochre-ink); }
button { font: inherit; color: inherit; touch-action: manipulation; cursor: pointer; border: 0; background: none; }
button svg { pointer-events: none; }
button:focus-visible, [role="button"]:focus-visible { outline: 2px solid var(--ochre); outline-offset: 2px; }
#intro { display: none; }

/* ── the yard (its look: see "review round 1" below) ─────────────────────────────────── */
#game {
    position: fixed; inset: 0;
    touch-action: none;
    background: var(--soot);
}
body:not(.in-game) #game, body:not(.in-game) #header-bar, body:not(.in-game) #newsstand { visibility: hidden; }
#table { position: absolute; overflow: hidden; }
#world { position: absolute; inset: 0; }

/* boards, frame, cards and pieces: placed in px by game.js (no transforms on the table) */
#world > *, .lens-stage > * { position: absolute; }
.board { border-radius: 1.2% / 2.6%; filter: drop-shadow(0 3px 6px rgba(0, 0, 0, .55)); cursor: zoom-in; }
.board img { width: 100%; height: 100%; display: block; pointer-events: none; }
.board.lit { cursor: pointer; filter: drop-shadow(0 0 0 var(--ochre)) drop-shadow(0 0 10px rgba(230, 179, 99, .75)); animation: lit-board 1.3s ease-in-out infinite alternate; z-index: 5; }
@keyframes lit-board { from { filter: drop-shadow(0 0 4px rgba(230, 179, 99, .5)); } to { filter: drop-shadow(0 0 14px rgba(230, 179, 99, .95)); } }
.lens-stage .board { cursor: default; filter: none; }
.frame { filter: drop-shadow(0 3px 5px rgba(0, 0, 0, .5)); pointer-events: none; }

.card { border-radius: 4.5% / 3%; overflow: hidden; box-shadow: 0 3px 8px rgba(0, 0, 0, .55); cursor: zoom-in; transition: filter .3s, box-shadow .3s; }
.card img { width: 100%; height: 100%; display: block; pointer-events: none; }
/* a resolved card turns over to its printed back */
.card { overflow: visible; background: none; perspective: 900px; }
.card-in { position: relative; width: 100%; height: 100%; transform-style: preserve-3d; transition: transform .7s var(--ease); border-radius: inherit; }
.card-in img { position: absolute; inset: 0; border-radius: inherit; backface-visibility: hidden; -webkit-backface-visibility: hidden; }
.card-in .card-back { transform: rotateY(180deg); }
.card.spent .card-in { transform: rotateY(180deg); transition-delay: .9s; }   /* a beat after the card is done */
.card.spent { filter: brightness(.82) saturate(.8); }
.card.current { box-shadow: 0 0 0 3px var(--ochre), 0 6px 14px rgba(0, 0, 0, .6); }
.card.lit { cursor: pointer; box-shadow: 0 0 0 3px var(--ochre), 0 0 18px rgba(230, 179, 99, .7); animation: lit-card 1.2s ease-in-out infinite alternate; }
.card.halves { cursor: pointer; }
@keyframes lit-card { from { box-shadow: 0 0 0 2px var(--ochre), 0 0 6px rgba(230, 179, 99, .4); } to { box-shadow: 0 0 0 3px var(--ochre), 0 0 20px rgba(230, 179, 99, .85); } }
.card.deal { animation: deal-flip .62s var(--ease) both; }
@keyframes deal-flip { from { transform: perspective(600px) rotateY(88deg) translateY(-6%); opacity: .2; } to { transform: none; opacity: 1; } }
.cost-tag {
    display: grid; place-items: center; border-radius: 50%;
    background: var(--ink); box-shadow: inset 0 0 0 1.5px var(--enamel), 0 1px 3px rgba(0, 0, 0, .6);
    color: var(--ochre-ink); font: 800 clamp(9px, 1.4vmin, 15px) var(--font-ui);
    box-shadow: 0 1px 3px rgba(0, 0, 0, .6); pointer-events: none; z-index: 30;
}
/* under each Action card in the frameless market: the price a coin, the lit one glows */
.cost-tag.under {
    background: radial-gradient(circle at 35% 30%, #f6c66a, #d9871f 60%, #9c5410);
    color: #3a1d05; font-size: clamp(9px, 1.25vmin, 14px);
    box-shadow: inset 0 0 0 1.5px rgba(255, 236, 190, .55), 0 1px 3px rgba(0, 0, 0, .6);
    opacity: .82; transition: opacity .2s, box-shadow .2s;
}
.cost-tag.under.lit { opacity: 1; box-shadow: inset 0 0 0 1.5px rgba(255, 236, 190, .7), 0 0 0 2px #fff1c8, 0 1px 4px rgba(0, 0, 0, .7); }
.cost-tag.under.discount { background: radial-gradient(circle at 35% 30%, #d8f0c8, #79b45a 60%, #3f7a2a); color: #12300a; }

.piece { pointer-events: none; filter: drop-shadow(0 2px 2px rgba(0, 0, 0, .45)); }
.tile { pointer-events: none; filter: drop-shadow(0 1px 2px rgba(0, 0, 0, .5)); border-radius: 6%; }
.culture-tile { pointer-events: auto; cursor: zoom-in; }
.culture-tile.upright { transform: rotate(90deg); }
.offview { visibility: hidden; pointer-events: none; }
.leaving { opacity: 0 !important; transition: opacity .34s ease !important; }

.target {
    border-radius: 50%; z-index: 90;
    border: 3px solid var(--ochre);
    background: radial-gradient(circle, rgba(230, 179, 99, .28), rgba(230, 179, 99, .05) 62%);
    box-shadow: 0 0 0 2px rgba(28, 26, 32, .7), 0 0 14px rgba(230, 179, 99, .8);
    animation: target 1s ease-in-out infinite alternate;
}
.target:hover { background: radial-gradient(circle, rgba(230, 179, 99, .55), rgba(230, 179, 99, .12) 62%); }
@keyframes target { from { box-shadow: 0 0 0 2px rgba(28, 26, 32, .7), 0 0 4px rgba(230, 179, 99, .5); } to { box-shadow: 0 0 0 2px rgba(28, 26, 32, .7), 0 0 18px rgba(230, 179, 99, 1); } }

/* feeders: the spaces that pay a step on the board under the pointer. Quiet and still, in the
   enamel white — the pulsing ochre ring stays the sign for "you may step here". */
.feed {
    position: absolute; border-radius: 50%; z-index: 55; pointer-events: none;
    border: 2px solid rgba(244, 239, 228, .85);
    background: radial-gradient(circle, rgba(244, 239, 228, .22), rgba(244, 239, 228, 0) 68%);
    box-shadow: 0 0 0 1px rgba(28, 26, 32, .55), 0 0 10px rgba(244, 239, 228, .45);
    animation: feed-in .16s ease-out;
}
@keyframes feed-in { from { opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .feed { animation: none; } }

#game.snap *, #game.snap .card { transition: none !important; }
.ghost { position: fixed; z-index: 1300; pointer-events: none; transform-origin: center; filter: drop-shadow(0 4px 8px rgba(0, 0, 0, .6)); }

/* ── the enamel sign: one recipe, every plate ─────────────────────────────────────────── */
.sign, .enamel-sheet, .lens-sign, .banner-sign, .end-sign {
    background:
        linear-gradient(170deg, rgba(255, 255, 255, .10), transparent 38%),
        radial-gradient(140% 90% at 80% 120%, rgba(0, 0, 0, .28), transparent 60%),
        var(--enamel);
    border-radius: 10px;
    box-shadow: inset 0 0 0 3px var(--enamel), inset 0 0 0 4.5px rgba(244, 239, 228, .82), 0 6px 18px rgba(0, 0, 0, .55);
}

/* ── header: an enamel strip bolted down the left edge of the yard ─────────────────── */
#header-bar {
    position: fixed; left: 0; top: 0; bottom: 0; width: var(--strip-w, 58px); z-index: 300;
    display: flex; flex-direction: column; align-items: center; justify-content: space-between;
    padding: 8px 0 8px env(safe-area-inset-left);
    background: linear-gradient(90deg, var(--enamel-deep), var(--enamel) 40%, var(--enamel-hi));
    box-shadow: inset -1.5px 0 0 rgba(244, 239, 228, .7), 3px 0 10px rgba(0, 0, 0, .5);
}
.hb-top, .hb-bottom { display: flex; flex-direction: column; align-items: center; gap: 4px; z-index: 1; }
.hb-btn {
    width: 44px; height: 44px; display: grid; place-items: center; border-radius: 8px;
    color: var(--ink); opacity: .88; transition: background .15s, opacity .15s;
}
.hb-btn:hover { background: rgba(244, 239, 228, .10); opacity: 1; }
.hb-btn.active { background: rgba(230, 179, 99, .2); color: var(--ochre); opacity: 1; }
.hb-phone { display: none; }
.flag { display: block; width: 26px; height: 17px; border-radius: 2px; overflow: hidden; box-shadow: 0 0 0 1px rgba(244, 239, 228, .6); }
.flag svg { width: 100%; height: 100%; display: block; }

#ai-indicator {
    position: relative; width: 46px; height: 46px; padding: 0; margin-bottom: 6px; border-radius: 10px;
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 5px;
    background: rgba(18, 26, 34, .45); box-shadow: inset 0 0 0 1px rgba(244, 239, 228, .35);
    font: 700 10.5px/1 var(--font-ui); letter-spacing: .04em; color: var(--ink);
}
#ai-indicator .ai-text { display: none; }
#ai-indicator .ai-short { display: inline; }
#ai-indicator::before { content: ''; position: absolute; inset: -5px 0; }
.ai-lamp { width: 10px; height: 10px; border-radius: 50%; background: #5a5f63; box-shadow: inset 0 0 0 1.5px rgba(244, 239, 228, .5); }
#ai-indicator.ai-onnx .ai-lamp { background: var(--ink); box-shadow: 0 0 8px var(--ink); }
#ai-indicator.ai-ready .ai-lamp { background: transparent; box-shadow: inset 0 0 0 2px var(--ink); }
#ai-indicator.ai-pending .ai-lamp { animation: lamp 1s infinite alternate; }
@keyframes lamp { to { opacity: .3; } }
.ai-short { display: none; }
.ai-detail {
    display: none; position: absolute; left: calc(100% + 12px); bottom: 0; width: 270px; padding: 12px 14px; z-index: 400; text-align: left;
    background: var(--enamel-deep); border-radius: 8px; box-shadow: inset 0 0 0 1.5px rgba(244, 239, 228, .6), 0 8px 20px rgba(0, 0, 0, .6);
    font: 500 12px/1.45 var(--font-ui); white-space: normal;
}
#ai-indicator:hover .ai-detail, #ai-indicator.tip-open .ai-detail { display: block; }
.ai-detail-head { font: 400 15px var(--font-display); letter-spacing: .08em; margin-bottom: 6px; }
.ai-detail-row { display: flex; justify-content: space-between; gap: 10px; color: var(--ink-dim); }
.ai-detail-row span:last-child { color: var(--ink); text-align: right; }
.ai-detail-why { margin-top: 8px; color: var(--ink-dim); }

#tools-menu {
    position: fixed; z-index: 450; left: calc(var(--strip-w, 52px) + 6px); top: 6px; min-width: 210px; padding: 6px;
    background: var(--enamel-deep); border-radius: 10px; box-shadow: inset 0 0 0 1.5px rgba(244, 239, 228, .6), 0 8px 22px rgba(0, 0, 0, .6);
}
.tools-item { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 44px; padding: 0 12px; border-radius: 6px; font: 600 14px var(--font-ui); }
.tools-item:hover { background: rgba(244, 239, 228, .08); }
.tools-item .flag { width: 20px; height: 14px; flex: none; }   /* as wide as the icons: the labels line up */

/* ── the rail: the decision sign at its head, the player plates below ───────────────── */
#rail { position: absolute; display: flex; flex-direction: column; gap: 10px; padding: 10px 10px 10px 4px; }
body[data-rail="bottom"] #rail { padding: 8px 10px 10px; flex-direction: column; }
#plate { position: relative; flex: 0 0 auto; padding: 14px 16px 14px; min-height: 64px; }   /* grows to its text: a hint never scrolls (the plates below give way) */
#plate.idle { opacity: .94; }
#plate.live { box-shadow: inset 0 0 0 3px var(--enamel), inset 0 0 0 4.5px var(--ochre), 0 0 0 2px rgba(230, 179, 99, .35), 0 6px 18px rgba(0, 0, 0, .55); }
.pl-q { font: 650 16px/1.3 var(--font-ui); color: var(--ink); text-wrap: balance; }
.pl-sub { margin-top: 4px; font: 500 12.5px/1.35 var(--font-ui); color: var(--ink-dim); }
.pl-note { font: 500 13.5px/1.35 var(--font-ui); color: var(--ink); padding-left: 14px; position: relative; }
.pl-note::before, .pl-wait::before { content: ''; position: absolute; left: 0; top: .42em; width: 8px; height: 8px; border-radius: 2px; background: var(--pc); box-shadow: 0 0 0 1px rgba(244, 239, 228, .6); }
.pl-wait { margin-top: 6px; position: relative; padding-left: 14px; font: 600 12px var(--font-ui); color: var(--ink-dim); }
.pl-tabs { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.pl-free { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; margin-top: 12px; padding-top: 10px; border-top: 1px solid rgba(244, 239, 228, .22); }
.pl-free-label { font: 700 10.5px var(--font-ui); letter-spacing: .12em; text-transform: uppercase; color: var(--ink-dim); margin-right: 2px; }

.tab {
    min-height: 44px; padding: 8px 14px; border-radius: 6px; text-align: left;
    display: inline-flex; flex-direction: column; justify-content: center; gap: 1px; max-width: 100%;
    background: var(--ink); color: var(--enamel-deep);
    box-shadow: inset 0 0 0 1.5px rgba(34, 50, 63, .25), 0 2px 0 rgba(0, 0, 0, .35);
    transition: transform .1s, filter .15s;
}
.tab:hover { filter: brightness(1.06); }
.tab:active { transform: translateY(1px); box-shadow: inset 0 0 0 1.5px rgba(34, 50, 63, .25); }
.tab.primary { background: var(--ochre); color: var(--ochre-ink); }
.tab.quiet { background: transparent; color: var(--ink); box-shadow: inset 0 0 0 1.5px rgba(244, 239, 228, .6); }
.tab.free { min-height: 44px; padding: 6px 11px; background: rgba(244, 239, 228, .1); color: var(--ink); box-shadow: inset 0 0 0 1px rgba(244, 239, 228, .4); }
.tab.big { padding: 10px 26px; }
.tab-main { font: 700 13.5px/1.2 var(--font-ui); }
.tab-sub { font: 500 11.5px/1.25 var(--font-ui); opacity: .82; }
.tile-tab { padding: 4px 12px 4px 4px; background: var(--ochre); display: inline-flex; align-items: center; gap: 8px; }
.tile-tab img { width: 40px; height: 35px; display: block; flex: none; border-radius: 3px; }
body.phone .tile-tab { padding: 4px; }

#panels { flex: 0 1 auto; min-height: 0; display: flex; flex-direction: column; gap: 8px; overflow-y: auto; -webkit-overflow-scrolling: touch; }
body[data-rail="bottom"] #panels { flex-direction: row; }
body[data-rail="bottom"] .pp { flex: 1 1 0; min-width: 0; }
.pp {
    position: relative; padding: 9px 11px 9px; border-radius: 8px;
    background: linear-gradient(170deg, rgba(255, 255, 255, .05), transparent 40%), var(--soot-2);
    box-shadow: inset 0 0 0 1px rgba(244, 239, 228, .16), 0 3px 8px rgba(0, 0, 0, .4);
    transition: box-shadow .25s;
}
.pp.deciding { box-shadow: inset 0 0 0 1.5px var(--ochre), 0 0 14px rgba(230, 179, 99, .3); }
.pp-head { display: flex; align-items: center; gap: 8px; min-width: 0; }
.pp-cube { width: 22px; height: 22px; flex: 0 0 auto; }
.pp-nm {
    font: 700 13.5px var(--font-ui); padding: 2px 8px; border-radius: 4px; min-width: 0;
    background: var(--pc); color: #fff; text-shadow: 0 1px 1px rgba(0, 0, 0, .4);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .45); white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.pp-order { margin-left: auto; font: 400 15px var(--font-display); color: var(--ink-dim); }
.pp-stats { display: flex; align-items: center; gap: 12px; margin-top: 7px; flex-wrap: wrap; }
.pp-vp b, .pp-coins b { font: 800 19px/1 var(--font-ui); font-variant-numeric: tabular-nums; }
.pp-vp small, .pp-coins small { font: 600 10.5px var(--font-ui); color: var(--ink-dim); margin-left: 3px; letter-spacing: .04em; }
.pp-coins small.warn { color: #f08a64; }
.pp-coins { display: inline-flex; align-items: center; gap: 4px; }
.pp-coin { width: 18px; height: 18px; }
.pp-box { width: 15px; height: 24px; }
.pp-income { font: 600 11.5px var(--font-ui); color: var(--ink-dim); }
.num.up { color: #f3d48c; } .num.down { color: #f08a64; }
/* payoffs travel (game.js gainFlights): a small enamel tag in the player's colour leaves the space
   that paid and lands on the count; the count takes the knock */
.gain {
    position: fixed; z-index: 600; pointer-events: none; display: inline-flex; align-items: center; gap: 3px;
    padding: 3px 8px 3px 7px; border-radius: 999px; white-space: nowrap;
    background: linear-gradient(170deg, rgba(255, 255, 255, .14), transparent 55%), var(--enamel-deep, #1f2f3b);
    color: var(--ink); box-shadow: inset 0 0 0 1.5px var(--pc, var(--ochre)), 0 3px 8px rgba(0, 0, 0, .55);
    will-change: transform, opacity;
}
.gain b { font: 800 15px/1 var(--font-ui); font-variant-numeric: tabular-nums; }
.gain small { font: 700 10px/1 var(--font-ui); letter-spacing: .05em; color: var(--ink-dim); }
.gain-coin { width: 15px; height: 15px; display: block; }
.gain.gain-vp b { color: #f3d48c; }
.gain.loss b { color: #f08a64; }
.num.landed { animation: num-land .32s cubic-bezier(.16, 1, .3, 1); display: inline-block; }
@keyframes num-land { 0% { transform: scale(1.28); } 100% { transform: none; } }
@media (prefers-reduced-motion: reduce) { .gain { display: none; } .num.landed { animation: none; } }
.num { transition: color 1.2s; }
.pp-tiles { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 8px; align-items: center; }
.pp-tile { width: 30px; height: 26px; border-radius: 3px; box-shadow: 0 1px 2px rgba(0, 0, 0, .5); }
.pp-tile.used { filter: brightness(.85); }
.pp-tile.lit { cursor: pointer; box-shadow: 0 0 0 2.5px var(--ochre), 0 0 10px rgba(230, 179, 99, .8); animation: lit-card 1s ease-in-out infinite alternate; position: relative; }
.pp-tile.lit::after { content: ''; }
.pp-ctile { width: 58px; height: 23px; border-radius: 3px; box-shadow: 0 1px 2px rgba(0, 0, 0, .5); }
.pp-penalty { height: 24px; border-radius: 3px; }
body[data-rail="bottom"] .pp-tile { width: 26px; height: 23px; }

/* ── panels opened from the header ─────────────────────────────────────────────────── */
.side-panel {
    position: fixed; z-index: 420; left: calc(var(--strip-w, 58px) + 8px); top: 10px; width: min(380px, calc(100vw - 20px)); max-height: calc(100vh - var(--ticker-h, 40px) - 20px);
    display: flex; flex-direction: column;
    background: var(--enamel-deep); border-radius: 10px; box-shadow: inset 0 0 0 1.5px rgba(244, 239, 228, .6), 0 10px 26px rgba(0, 0, 0, .65);
}
.side-head { display: flex; align-items: center; justify-content: space-between; padding: 6px 6px 4px 16px; font: 400 18px var(--font-display); letter-spacing: .08em; }
.side-x, .sheet-x, .lens-x, .cl-x { width: 44px; height: 44px; display: grid; place-items: center; border-radius: 8px; color: var(--ink); }
.side-x:hover, .sheet-x:hover, .lens-x:hover { background: rgba(244, 239, 228, .1); }
.side-body { overflow-y: auto; padding: 4px 14px 14px; font: 500 13px/1.45 var(--font-ui); color: var(--ink-dim); }
.log-block { position: relative; padding: 6px 0 6px 12px; border-top: 1px solid rgba(244, 239, 228, .1); }
.log-block::before { content: ''; position: absolute; left: 0; top: 11px; width: 6px; height: 6px; border-radius: 1px; background: var(--pc); }
.log-line { color: var(--ink); }
.log-divider { margin: 10px 0 4px; font: 400 14px var(--font-display); letter-spacing: .12em; color: var(--ochre); text-transform: uppercase; }
.ai-entry { position: relative; padding: 8px 0 8px 12px; border-top: 1px solid rgba(244, 239, 228, .1); }
.ai-entry::before { content: ''; position: absolute; left: 0; top: 13px; width: 6px; height: 6px; border-radius: 1px; background: var(--pc); }
.ai-entry-head { color: var(--ink); font-weight: 700; }
.ai-entry-sub { font-size: 11.5px; }
.ai-entry-note { margin-top: 3px; font-size: 11.5px; font-style: italic; color: var(--ochre); }
.ai-row { display: flex; justify-content: space-between; gap: 10px; font-size: 12px; font-variant-numeric: tabular-nums; }
.ai-row.chosen { color: var(--ochre); font-weight: 700; }
.side-foot { margin-top: 12px; padding-top: 8px; border-top: 1px solid rgba(244, 239, 228, .2); font-size: 11.5px; }

.sheet-layer { position: fixed; inset: 0; z-index: 600; display: grid; place-items: center; background: rgba(18, 16, 22, .7); padding: 12px; }
.sheet { position: relative; width: min(620px, 100%); max-height: calc(100vh - 24px); overflow-y: auto; padding: 22px 26px 24px; }
.sheet h2 { font: 400 24px var(--font-display); letter-spacing: .1em; margin-bottom: 10px; padding-right: 40px; }
.sheet h3 { font: 700 12px var(--font-ui); letter-spacing: .14em; text-transform: uppercase; color: var(--ochre); margin: 12px 0 3px; }
.sheet p { font: 500 14px/1.5 var(--font-ui); color: var(--ink); max-width: 66ch; }
.sheet-x { position: absolute; right: 8px; top: 8px; }
.pp-big { margin-top: 30px; }
.pp-big .pp-tiles { display: flex; }

/* ── the lens: one board, large; the card lens: one card ───────────────────────────── */
#lens, #cardlens { position: fixed; z-index: 250; display: grid; place-items: center; background: rgba(18, 16, 22, .62); }
#lens[hidden], #cardlens[hidden] { display: none; }
.lens-sign { position: relative; grid-area: 1 / 1; padding: 0; overflow: visible; pointer-events: auto; }
.lens-sign.under { filter: brightness(.86); }
/* boards cross-fade in and out of the lens */
#lens { transition: opacity .3s var(--ease); }
#lens:not([hidden]) { animation: lens-in .28s var(--ease); }
#lens.closing { opacity: 0; pointer-events: none; }
@keyframes lens-in { from { opacity: 0; } }
.lens-sign { transition: opacity .32s var(--ease), filter .32s var(--ease); }
.lens-sign.entering { opacity: 0; }
.lens-sign.leaving { opacity: 0; pointer-events: none; }
/* the phone's cards <-> boards switch (View Transitions) */
::view-transition-old(root), ::view-transition-new(root) { animation-duration: .26s; animation-timing-function: ease-out; }
.lens-head { cursor: grab; touch-action: none; user-select: none; }
.lens-head.grabbing { cursor: grabbing; }
#lens.open-table { background: transparent; pointer-events: none; }
.lens-head { height: 40px; display: flex; align-items: center; justify-content: space-between; padding: 0 2px 0 14px; }
.lens-title { font: 400 18px var(--font-display); letter-spacing: .12em; text-transform: uppercase; }
.lens-x[hidden] { display: none; }
.lens-stage { position: relative; overflow: visible; }
.cl-card { position: relative; border-radius: 4.5% / 3%; overflow: hidden; box-shadow: 0 12px 34px rgba(0, 0, 0, .7); }
.cl-card > img { width: 100%; height: 100%; display: block; pointer-events: none; -webkit-user-drag: none; }
.cl-card { touch-action: none; cursor: grab; pointer-events: auto; }
.cl-card.grabbing { cursor: grabbing; }
#cardlens.open-table { background: transparent; pointer-events: none; }
.cl-half { position: absolute; left: 0; right: 0; display: flex; align-items: flex-end; justify-content: center; padding-bottom: 10px; transition: background .15s, box-shadow .15s; }
.cl-half:not(:disabled):hover { background: rgba(230, 179, 99, .18); box-shadow: inset 0 0 0 4px var(--ochre); }
.cl-half:not(:disabled) { box-shadow: inset 0 0 0 3px rgba(230, 179, 99, .7); }
.cl-half:disabled { cursor: not-allowed; background: rgba(28, 26, 32, .45); }
.cl-top { align-items: flex-start; padding-top: 10px; }
.cl-label { font: 700 13px var(--font-ui); padding: 7px 14px; border-radius: 5px; background: var(--ochre); color: var(--ochre-ink); box-shadow: 0 2px 6px rgba(0, 0, 0, .5); }
.cl-half:disabled .cl-label { background: rgba(244, 239, 228, .85); color: var(--enamel-deep); opacity: .8; }
.cl-x { position: absolute; right: 6px; top: 6px; background: rgba(28, 26, 32, .7); }

/* the big print of a card or tile: the art on a paper mat, a steel keyline round it */
#tip { position: fixed; z-index: 1400; pointer-events: none; padding: 6px; border-radius: 12px;
    background: linear-gradient(172deg, #fff, var(--paper) 45%, var(--paper-shade));
    box-shadow: inset 0 0 0 1.5px var(--steel), 0 12px 28px rgba(0, 0, 0, .6); }
#tip img { display: block; width: 100%; border-radius: 7px; }
#tip.tip-card { width: 220px; }
#tip.tip-tile { width: 240px; }

/* ── round banner, welcome, the end notice ─────────────────────────────────────────── */
#banner { position: fixed; z-index: 700; display: grid; place-items: center; pointer-events: none; opacity: 0; transition: opacity .25s; }
#banner.show { opacity: 1; }
.banner-sign { position: relative; padding: 18px 54px 20px; text-align: center; transform: translateY(8px); transition: transform .4s var(--ease); }
#banner.show .banner-sign { transform: none; }
.banner-title { font: 400 clamp(22px, 4vmin, 40px)/1.1 var(--font-display); letter-spacing: .14em; text-transform: uppercase; }
.banner-line { margin-top: 6px; font: 600 clamp(13px, 2.2vmin, 17px) var(--font-ui); color: var(--ochre); }

#end { position: fixed; inset: 0; z-index: 650; display: grid; place-items: center; background: rgba(18, 16, 22, .66); padding: 10px; }
.end-sign { position: relative; width: min(760px, 100%); max-height: calc(100vh - 20px); display: flex; flex-direction: column; padding: 24px 30px 22px; }
.end-sign h2 { font: 400 clamp(26px, 5vmin, 44px)/1.1 var(--font-display); letter-spacing: .1em; text-align: center; margin: 6px 0 14px; }
.end-scroll { overflow: auto; min-height: 0; }
.end-table { width: 100%; border-collapse: collapse; font: 500 14px var(--font-ui); font-variant-numeric: tabular-nums; }
.end-table th { font: 700 10.5px var(--font-ui); letter-spacing: .08em; text-transform: uppercase; color: var(--ink-dim); padding: 4px 8px; text-align: right; white-space: nowrap; }
.end-table th:nth-child(2) { text-align: left; }
.end-table td { padding: 8px; text-align: right; border-top: 1px solid rgba(244, 239, 228, .16); }
.end-table td.end-name { text-align: left; font-weight: 700; position: relative; padding-left: 20px; }
.end-table td.end-name::before { content: ''; position: absolute; left: 4px; top: 50%; width: 10px; height: 10px; margin-top: -5px; border-radius: 2px; background: var(--pc); }
.end-table td.end-total { font: 800 18px var(--font-ui); color: var(--ink); }
.end-table tr.winner td { color: var(--ochre); }
.end-table tr.winner td.end-total { color: var(--ochre); }
.end-note { margin-top: 8px; font: 500 12px var(--font-ui); color: var(--ink-dim); text-align: center; }
.end-doors { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin-top: 16px; }

/* ── the Event sign: the card large, and what it did to every player ───────────────────── */
#event-sign { position: fixed; inset: 0; z-index: 690; display: grid; place-items: center; padding: 10px;
    background: rgba(18, 16, 22, .58); opacity: 0; transition: opacity .2s; }
#event-sign.show { opacity: 1; }
.ev-sign {
    background:
        linear-gradient(170deg, rgba(255, 255, 255, .10), transparent 38%),
        radial-gradient(140% 90% at 80% 120%, rgba(0, 0, 0, .28), transparent 60%),
        var(--enamel);
    border-radius: 10px;
    box-shadow: inset 0 0 0 3px var(--enamel), inset 0 0 0 4.5px rgba(244, 239, 228, .82), 0 6px 18px rgba(0, 0, 0, .55);
}
.ev-sign { position: relative; display: flex; gap: 26px; align-items: center; width: min(820px, 100%); max-height: calc(100vh - 20px);
    padding: 24px 28px; overflow: hidden; transform: translateY(10px) scale(.98); transition: transform .35s var(--ease); }
#event-sign.show .ev-sign { transform: none; }
.ev-card { flex: 0 0 auto; width: clamp(150px, 26vw, 250px); max-height: calc(100vh - 68px); object-fit: contain; border-radius: 8px;
    box-shadow: 0 0 0 2px rgba(244, 239, 228, .7), 0 10px 24px rgba(0, 0, 0, .55); }
.ev-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 10px; }
.ev-head { margin: 0; font: 400 clamp(24px, 4.4vmin, 38px)/1.05 var(--font-display); letter-spacing: .12em; text-transform: uppercase; }
.ev-what { margin: 0; font: 600 14px/1.35 var(--font-ui); color: var(--ochre); text-wrap: pretty; }
.ev-rows { list-style: none; margin: 4px 0 6px; padding: 0; display: flex; flex-direction: column; }
.ev-row { display: flex; align-items: center; gap: 12px; padding: 9px 4px; border-top: 1px solid rgba(244, 239, 228, .16); }
.ev-row:last-child { border-bottom: 1px solid rgba(244, 239, 228, .16); }
.ev-who { flex: 0 0 38%; min-width: 0; display: flex; align-items: center; gap: 9px; font: 700 15px/1.2 var(--font-ui);
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--ink); }
.ev-fac { width: 28px; height: 28px; object-fit: contain; flex: 0 0 auto; filter: drop-shadow(0 1px 2px rgba(0, 0, 0, .6)); }
.ev-fx { flex: 1; min-width: 0; font: 700 15px/1.3 var(--font-ui); color: var(--ink); font-variant-numeric: tabular-nums; }
.ev-row.out .ev-fx, .ev-row.none .ev-fx { font-weight: 500; color: var(--ink-dim); }
/* a School tile an Event gave: the tile itself in the row (user 2026-12-01) */
.ev-tile { display: inline-block; width: 34px; height: 30px; vertical-align: middle; margin: -4px 0 -4px 8px; border-radius: 3px; box-shadow: 0 1px 3px rgba(0, 0, 0, .45); }
.ev-fx > .ev-tile:first-child { margin-left: 0; }
.ev-row.out .ev-who { opacity: .7; }
.ev-body > .tab { align-self: flex-start; }
/* the time the sign stays: a thin bar along its foot; a mouse moved onto the sign slows it (game.js evBarRuns) */
.ev-bar { position: absolute; left: 0; right: 0; bottom: 0; height: 3px; background: var(--ochre); transform-origin: left; opacity: .85;
    animation: ev-time 8s linear both; }
@keyframes ev-time { from { transform: scaleX(1); } to { transform: scaleX(0); } }
@media (max-height: 520px) {
    .ev-sign { gap: 16px; padding: 14px 18px; }
    .ev-card { width: clamp(110px, 22vw, 170px); }
    .ev-head { font-size: 22px; }
    .ev-what { font-size: 12.5px; }
    .ev-row { padding: 5px 2px; }
    .ev-who, .ev-fx { font-size: 13px; }
    .ev-fac { width: 22px; height: 22px; }
}
@media (max-width: 560px) {
    .ev-sign { flex-direction: column; align-items: stretch; }
    .ev-card { align-self: center; width: 140px; }
}
@media (prefers-reduced-motion: reduce) { #event-sign, .ev-sign { transition: none; } .ev-bar { animation: none; } }

/* ── start screen: the cover whole, enamel signs on brick beside it ─────────────────── */
#start-screen, #start-screen-off {
    position: fixed; inset: 0; z-index: 800; display: grid; place-items: center; overflow: hidden;
    background:
        radial-gradient(90% 70% at 25% 10%, rgba(230, 179, 99, .22), transparent 60%),
        linear-gradient(rgba(22, 20, 26, .78), rgba(22, 20, 26, .9)),
        url('assets/cover.webp') 50% 58% / max(130vw, 185vh) auto no-repeat,
        var(--soot);
}
.start-card {
    position: absolute; left: 50%; top: 50%; display: flex; width: 980px; height: 640px; transform-origin: center; transform: translate(-50%, -50%);
    border-radius: 12px; overflow: hidden; box-shadow: 0 20px 60px rgba(0, 0, 0, .7);
    background: var(--soot-2);
}
.start-art { flex: 0 0 456px; position: relative; background: #ddd; min-height: 0; min-width: 0; overflow: hidden; }
.start-art img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 0; display: block; }
.start-panel {
    position: relative; flex: 1; min-width: 0; padding: 26px 30px 18px; display: flex; flex-direction: column; gap: 12px;
    background:
        repeating-linear-gradient(0deg, transparent 0 21px, rgba(0, 0, 0, .18) 21px 23px),
        linear-gradient(180deg, rgba(58, 42, 38, .55), rgba(28, 26, 32, .95)),
        var(--soot-2);
}
.start-sign { position: relative; padding: 12px 18px 12px; border-radius: 10px; text-align: center;
    background: linear-gradient(170deg, rgba(255, 255, 255, .12), transparent 40%), var(--enamel);
    box-shadow: inset 0 0 0 3px var(--enamel), inset 0 0 0 4.5px rgba(244, 239, 228, .85), 0 6px 14px rgba(0, 0, 0, .5); }
/* the cover beside it already prints RISE: the heading stays for screen readers only */
.start-mark { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.start-tag { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }   /* likewise: read out, not shown */
.start-fields { display: flex; flex-direction: column; gap: 9px; }
.start-row { display: flex; align-items: center; gap: 12px; }
.start-label { flex: 0 0 118px; font: 700 11px/1.2 var(--font-ui); letter-spacing: .14em; text-transform: uppercase; color: var(--ink-dim); }   /* wraps: a long label never pushes its row off the grid */
.start-tiles { display: flex; gap: 6px; flex: 1; min-width: 0; }   /* a long word (es, fr, uk) shrinks its tile, never widens the card */
.start-tile {
    flex: 1 1 0; min-width: 0; min-height: 46px; padding: 4px 8px; border-radius: 6px; display: flex; flex-direction: column; align-items: center; justify-content: center;
    background: rgba(244, 239, 228, .07); box-shadow: inset 0 0 0 1px rgba(244, 239, 228, .3); color: var(--ink);
    transition: background .15s, box-shadow .15s;
}
.start-tile:hover { background: rgba(244, 239, 228, .13); }
.start-tile.on { background: var(--ink); color: var(--enamel-deep); box-shadow: inset 0 0 0 2px var(--ochre); }
.tile-num { font: 400 24px/1 var(--font-display); }
.tile-main { font: 700 13px/1.15 var(--font-ui); white-space: nowrap; }
.tile-sub { font: 500 11.5px/1.2 var(--font-ui); opacity: .8; text-align: center; text-wrap: balance; }
.start-tile.swatch img { width: 34px; height: 34px; }
.start-tile.swatch.on { background: rgba(244, 239, 228, .18); box-shadow: inset 0 0 0 2.5px var(--ochre); }
/* the cube you pick lands on its square: a short drop, a wooden squash, settled */
.start-tile.swatch img.land { animation: cube-land .34s cubic-bezier(.3, 0, .2, 1) both; transform-origin: 50% 100%; }
@keyframes cube-land {
    0%   { transform: translateY(-16px) scale(.92, 1.06); opacity: .4; }
    62%  { transform: translateY(0) scale(1.08, .9); opacity: 1; }
    82%  { transform: translateY(-1.5px) scale(.98, 1.02); }
    100% { transform: none; }
}

/* the cover breathes: soft puffs leave the three chimneys and the engine's stack and climb
   into the smoke the illustrator drew, fading as they go. Placed on the cover's own pixels
   (start.js placeSmoke); still under reduced motion. */
.start-smoke { position: absolute; pointer-events: none; overflow: visible; }
.start-smoke .puff {
    position: absolute; width: calc(8.5% * var(--s, 1)); aspect-ratio: 1; translate: -50% -50%; border-radius: 50%;
    background: radial-gradient(circle, rgba(70, 64, 62, .8) 0, rgba(88, 82, 78, .42) 40%, transparent 70%);   /* soot, as drawn */
    filter: blur(2px); opacity: 0; will-change: transform, opacity;
    animation: puff-rise 9s linear infinite;
}
.start-smoke .puff.steam {
    background: radial-gradient(circle, rgba(250, 248, 244, .7) 0, rgba(245, 242, 236, .34) 45%, transparent 72%);
    animation-name: steam-rise; animation-duration: 5s;
}
@keyframes puff-rise {
    0%   { transform: translate(0, 0) scale(.4); opacity: 0; }
    14%  { opacity: calc(.75 * var(--a, 1)); }
    60%  { opacity: calc(.4 * var(--a, 1)); }
    100% { transform: translate(-55%, -520%) scale(2.4); opacity: 0; }
}
@keyframes steam-rise {
    0%   { transform: translate(0, 0) scale(.45); opacity: 0; }
    12%  { opacity: .75; }
    100% { transform: translate(-80%, -330%) scale(2.8); opacity: 0; }
}
/* pressure: while Play is under the pointer (or holds keyboard focus) the engine puffs faster */
.start-smoke .puff.more { animation-duration: 1.8s; visibility: hidden; }
.start-art.steam-up .puff.more { visibility: visible; }
/* Play: the engine lets its steam off. A cloud grows from its stack over the whole menu, the card thins
   out inside it, and the cloud clears onto the table, which has been there since the press. */
#start-screen-off { pointer-events: none; animation: menu-off .56s linear both; }
.start-cloud {
    position: fixed; width: 180vmax; aspect-ratio: 1; translate: -50% -50%; border-radius: 50%; pointer-events: none; z-index: 3;
    background: radial-gradient(circle, rgba(250, 248, 244, .98) 0, rgba(246, 243, 237, .94) 30%, rgba(240, 236, 228, .6) 52%, transparent 70%);
    filter: blur(14px); will-change: transform, opacity;
    animation: cloud-out .56s cubic-bezier(.33, .7, .3, 1) both;
}
.going .start-card { animation: card-off .56s linear both; }
@keyframes cloud-out {
    0%   { transform: scale(.02); opacity: .85; }
    55%  { transform: scale(.8); opacity: .88; }
    100% { transform: scale(1); opacity: 0; }
}
@keyframes card-off { 0%, 30% { opacity: 1; } 55%, 100% { opacity: 0; } }
@keyframes menu-off { 0%, 45% { opacity: 1; } 100% { opacity: 0; } }
@media (prefers-reduced-motion: reduce) {
    .start-smoke { display: none; }
    .start-tile.swatch img.land { animation: none; }
}
.start-hint { margin: -2px 0 0 130px; font: 500 12px/1.35 var(--font-ui); color: var(--ink-dim); text-wrap: pretty; }
/* a saved game: its settings shown, locked until "new game" */
.start-fields.locked .start-tiles, .start-fields.locked .side-open { opacity: .5; }
.start-fields.locked .start-tile, .start-fields.locked .side-open { cursor: default; }
.start-fields.locked .start-tile:hover { background: rgba(244, 239, 228, .07); }
.start-fields.locked .start-tile.on:hover { background: var(--ink); }
.start-fields.locked .start-hint { display: none; }
/* Speed is this device's preference, not the saved match's: it stays open */
.start-fields.locked .row-speed .start-tiles { opacity: 1; }
.start-fields.locked .row-speed .start-tile { cursor: pointer; }
/* per track: one line on the panel opens the boards themselves */
.side-open {
    margin-left: 130px; min-height: 44px; padding: 0 14px; border-radius: 6px; display: flex; align-items: center; justify-content: space-between; gap: 12px;
    background: rgba(244, 239, 228, .07); box-shadow: inset 0 0 0 1px rgba(244, 239, 228, .3); color: var(--ink);
}
.side-open:hover:not(:disabled) { background: rgba(244, 239, 228, .13); }
.side-open-main { font: 700 13px var(--font-ui); }
.side-open-main::after { content: ' \203A'; color: var(--ochre); }
.side-open-sum { font: 600 12.5px var(--font-ui); font-variant-numeric: tabular-nums; letter-spacing: .04em; color: var(--ink-dim); white-space: nowrap; }

/* the boards overlay: the ten boards in the table's own order, each turned over by a tap */
.sides-board {
    position: fixed; inset: 0; z-index: 30; display: grid; place-items: center; padding: 14px;
    background: rgba(16, 14, 18, .78); animation: sb-in .22s ease-out;
}
@keyframes sb-in { from { opacity: 0; } }
.sb-box {
    width: min(1180px, 100%); height: min(860px, 100%); display: flex; flex-direction: column; gap: 10px; padding: 14px 18px 18px;
    border-radius: 10px; background: linear-gradient(180deg, rgba(58, 42, 38, .97), rgba(28, 26, 32, .99)), var(--soot-2);
    box-shadow: inset 0 0 0 1.5px rgba(244, 239, 228, .45), 0 18px 40px rgba(0, 0, 0, .6);
}
.sb-head { display: flex; align-items: center; gap: 16px; }
.sb-title { font: 400 24px/1 var(--font-display); letter-spacing: .12em; text-transform: uppercase; color: var(--ink); }
.sb-hint { flex: 1; font: 500 13px/1.35 var(--font-ui); color: var(--ink-dim); }
.sb-done { min-height: 44px; padding: 0 24px; border-radius: 6px; font: 700 14px var(--font-ui); background: var(--ochre); color: var(--ochre-ink); }
.sb-done:hover { background: #efc47e; }
.sb-stage { flex: 1; min-height: 0; display: grid; place-items: center; }
.sb-town { position: relative; perspective: 1600px; }
.sb-board { position: absolute; padding: 0; border-radius: 4px; background: none; perspective: 900px; }
.sb-board:focus-visible { outline: 2px solid var(--ochre); outline-offset: 3px; }
.sb-flip {
    position: absolute; inset: 0; transform-style: preserve-3d;
    transition: transform .6s cubic-bezier(.45, 0, .25, 1);
}
.sb-board.is-b .sb-flip { transform: rotateY(180deg); }
.sb-board:hover .sb-face img { filter: brightness(1.08); }
.sb-board:active .sb-flip { scale: .985; }
.sb-face {
    position: absolute; inset: 0; backface-visibility: hidden; -webkit-backface-visibility: hidden;
    border-radius: 4px; box-shadow: 0 3px 8px rgba(0, 0, 0, .55);
}
.sb-face.sb-B { transform: rotateY(180deg); }
.sb-face img { display: block; width: 100%; height: 100%; border-radius: 4px; }
.sb-badge {
    position: absolute; left: 6px; top: 6px; width: var(--badge, 26px); height: var(--badge, 26px); border-radius: 50%;
    display: grid; place-items: center; background: #dcdcd8; color: #22252a;
    font: 700 calc(var(--badge, 26px) * .58)/1 var(--font-ui); box-shadow: 0 1px 3px rgba(0, 0, 0, .5);
}
@media (prefers-reduced-motion: reduce) {
    .sb-flip { transition: none; }
    .sides-board { animation: none; }
}
/* phones in landscape: the head becomes a column beside the boards */
@media (max-height: 520px) {
    .sides-board { padding: 6px; }
    .sb-box { flex-direction: row; padding: 8px; gap: 10px; }
    .sb-head { flex-direction: column; align-items: stretch; justify-content: space-between; width: 150px; flex: none; }
    .sb-title { font-size: 18px; }
    .sb-hint { flex: 1; font-size: 12px; }
    .sb-board { min-width: 44px; }
}

/* the spare height is shared: a third above the rows (the sign's place, never less than the language
   menu needs), two thirds between the rows and the doors */
.start-doors { flex: 2.2 0 auto; justify-content: flex-end; display: flex; flex-direction: column; align-items: stretch; gap: 8px; }
.start-first { display: flex; flex-direction: column; align-items: stretch; gap: 4px; }
.start-play {
    position: relative; min-height: 62px; padding: 8px 40px; border-radius: 8px; display: flex; flex-direction: column; align-items: center; justify-content: center;
    background: linear-gradient(170deg, rgba(255, 255, 255, .28), transparent 45%), var(--ochre); color: var(--ochre-ink);
    box-shadow: inset 0 0 0 3px var(--ochre), inset 0 0 0 4.5px rgba(42, 33, 23, .55), 0 6px 16px rgba(0, 0, 0, .55);
    transition: filter .15s, transform .1s;
}
.start-play:hover { filter: brightness(1.06); }
.start-play:active { transform: translateY(1px); }
.play-main { font: 400 26px/1 var(--font-display); letter-spacing: .2em; text-transform: uppercase; padding-left: .2em; }
.play-sub { font: 600 11.5px var(--font-ui); opacity: .8; margin-top: 3px; }
.start-quiet { min-height: 44px; font: 600 13px var(--font-ui); color: var(--ink-dim); text-decoration: underline; text-underline-offset: 3px; }
.start-second { display: flex; gap: 8px; justify-content: center; }
.start-ghost { min-height: 44px; padding: 0 18px; border-radius: 6px; font: 700 13px var(--font-ui); color: var(--ink); box-shadow: inset 0 0 0 1.5px rgba(244, 239, 228, .5); }
.start-ghost:hover { background: rgba(244, 239, 228, .08); }
.start-ghost.lead { color: var(--ochre); box-shadow: inset 0 0 0 2px var(--ochre); }   /* the first thing a newcomer should find after Play */
.start-ghost.lead:hover { background: rgba(230, 179, 99, .12); }
.start-credit { font: 500 12px/1.35 var(--font-ui); color: var(--ink-dim); text-align: center; text-wrap: balance; }
.start-credit .cr-a { display: block; }          /* the authors' line; a wide panel sets all of it in one (below) */
.start-credit .cr-sep { display: none; }
.start-support { display: block; margin-top: 3px; color: var(--ochre); font-weight: 600; text-decoration: underline; text-underline-offset: 3px; }
.start-support:hover { color: var(--ink); }
.start-lang { position: absolute; right: 12px; top: 12px; z-index: 2; }
.start-panel .start-sign { flex: 1 1 34px; margin-right: 138px; min-height: 34px; padding: 0; background: none; box-shadow: none; }   /* no sign any more: only the room the language menu needs above the first row */

/* ── phone: no band, the controls float; the rail is a narrow strip on the right ───── */
/* the view switch: ONE button at the foot of the left strip — the strip's own column, so it never
   covers a board; it names the view it goes to (icon + word) */
#view-switch { display: flex; justify-content: center; }
#view-switch[hidden] { display: none; }
.vs-btn { width: 46px; min-height: 50px; padding: 5px 0 4px; border-radius: 9px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
    color: var(--ochre); background: var(--enamel); box-shadow: inset 0 0 0 1.5px var(--ochre), 0 3px 8px rgba(0, 0, 0, .5); }
.vs-btn:active { transform: translateY(1px); }
.vs-label { max-width: 44px; font: 700 9.5px/1 var(--font-ui); letter-spacing: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* phone: the strip is no band any more — no enamel, no AI lamp; the home and the tools buttons
   carry their own frame and float in the strip's column (the boards still start right of it) */
body.phone #header-bar { background: none; box-shadow: none; }
body.phone #ai-indicator { display: none; }
body.phone #menu-btn, body.phone #tools-btn { opacity: 1; background: var(--enamel); box-shadow: inset 0 0 0 1.5px rgba(244, 239, 228, .75), 0 3px 8px rgba(0, 0, 0, .5); }
body.phone #menu-btn:hover, body.phone #tools-btn:hover { background: var(--enamel-hi); }

body.phone .hb-desk { display: none; }
body.phone .hb-phone { display: grid; }
body.phone #header-bar { padding-top: 4px; padding-bottom: 4px; }
body.phone #rail { gap: 6px; padding: 6px 6px 6px 2px; }
body.phone #plate { padding: 9px 10px; }
body.phone .pl-q { font-size: 13.5px; }
body.phone .pl-sub { font-size: 11px; }
body.phone .pl-tabs { gap: 5px; margin-top: 7px; }
body.phone .tab { padding: 5px 9px; }
body.phone .tab-main { font-size: 12px; }
body.phone .tab-sub { font-size: 10.5px; }
body.phone .pl-free { margin-top: 7px; padding-top: 6px; }
body.phone #panels { gap: 4px; }
body.phone .pp { padding: 2px 7px; cursor: pointer; display: flex; align-items: center; gap: 6px; min-height: 30px; }
body.phone .pp-head { flex: 1 1 auto; min-width: 0; gap: 5px; }
body.phone .pp-order { display: none; }
body.phone .pp-stats { margin-top: 0 !important; flex-wrap: nowrap; flex: 0 0 auto; }
body.phone .pp-coins small, body.phone .pp-vp small { display: none; }
body.phone .pp-big { display: block; }
body.phone .pp-big .pp-stats { margin-top: 7px !important; }
body.phone .pp-big small { display: inline !important; }
body.phone .pp-cube { width: 16px; height: 16px; }
body.phone .pp-nm { font-size: 11.5px; padding: 1px 6px; }
body.phone .pp-stats { margin-top: 3px; gap: 8px; }
body.phone .pp-vp b, body.phone .pp-coins b { font-size: 14px; }
body.phone .pp-box, body.phone .pp-income { display: none; }
body.phone .pp-tiles { display: none; }
body.phone .pp-big .pp-tiles { display: flex; }
body.phone .pp-big .pp-box, body.phone .pp-big .pp-income { display: inline; }
body.phone .lens-head { height: 34px; }

#rotate-cover { display: none; }
@media (orientation: portrait) and (min-width: 561px) {
    .start-card { flex-direction: column; width: 640px; height: 960px; }
    .start-art { flex: 0 0 330px; min-height: 0; overflow: hidden; }
    .start-art img { object-position: 50% 0; }
    .start-lang { top: 342px; }                                     /* on the panel, under the cover: off the authors' names */
    .start-credit .cr-a, .start-credit .cr-sep { display: inline; }
}
body[data-rail="bottom"] .pp-box { display: none; }
body[data-rail="bottom"] .pp-stats { gap: 8px; }
body[data-rail="bottom"] #plate { padding: 10px 14px; }
body[data-rail="bottom"] .pl-tabs { margin-top: 8px; }
body[data-rail="bottom"] .pl-free { margin-top: 8px; padding-top: 6px; }
body[data-rail="bottom"] .pp { padding: 7px 9px; }
@media (pointer: coarse) and (orientation: portrait) and (max-width: 560px) {
    #rotate-cover { display: grid; place-items: center; position: fixed; inset: 0; z-index: 2000; padding: 30px; text-align: center;
        background: var(--enamel); color: var(--ink); font: 400 20px/1.4 var(--font-display); letter-spacing: .06em; }
}

/* start card on short / narrow screens: the cover becomes a band */
@media (max-height: 520px), (max-width: 700px) {
    .start-card { width: 760px; height: 492px; }      /* 492: the credit's second line (illustrator, publisher) fits; fitCard scales it */
    .start-art { flex-basis: 250px; }
    .start-panel { padding: 14px 18px 10px; gap: 8px; }
    .start-panel .start-sign { min-height: 40px; }
    .start-fields { gap: 6px; }
    .start-tile { min-height: 44px; }
    .start-play { min-height: 52px; }
    .play-main { font-size: 22px; }
    .side-open { margin-left: 0; }
    .start-hint { margin-left: 0; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation: none !important; transition: none !important; }
}
body.phone #lens { justify-items: end; padding-right: 4px; }
body.phone .lens-sign.wide .lens-head { justify-content: flex-end; gap: 6px; padding-left: 150px; }
body.phone .lens-title { font-size: 14px; text-align: right; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#end { grid-template-columns: minmax(0, 1fr); justify-items: center; }
.end-sign { min-width: 0; max-width: 100%; }
@media (max-height: 520px) {
    .end-sign { padding: 12px 16px 12px; }
    .end-sign h2 { font-size: 24px; margin: 2px 0 6px; }
    .end-table { font-size: 12.5px; }
    .end-table td { padding: 4px 6px; }
    .end-table td.end-total { font-size: 15px; }
    .end-table th { font-size: 9.5px; padding: 2px 6px; }
    .end-note { display: none; }
    .end-doors { margin-top: 8px; }
}


/* ── review round 1 ───────────────────────────────────────────────────────────────── */
/* the yard: the factory town at dusk (painted by Gemini, 2026-11-27) under a soot veil */
#game {
    background:
        radial-gradient(120% 70% at 30% -10%, rgba(230, 179, 99, .12), transparent 60%),
        linear-gradient(180deg, rgba(20, 18, 24, .34), rgba(20, 18, 24, .6)),
        url('assets/news/town-dusk.webp') 50% 100% / cover no-repeat,
        var(--soot);
    background-blend-mode: normal;
}

/* player plates: enamel nameplates — slate enamel, the cream keyline, the seat's own name tab */
.pp {
    background: linear-gradient(170deg, rgba(255, 255, 255, .09), transparent 40%), var(--enamel-deep);
    box-shadow: inset 0 0 0 2px var(--enamel-deep), inset 0 0 0 3px rgba(244, 239, 228, .55), 0 3px 8px rgba(0, 0, 0, .45);
    border-radius: 8px;
}
.pp.deciding { box-shadow: inset 0 0 0 2px var(--enamel-deep), inset 0 0 0 3.5px var(--ochre), 0 0 14px rgba(230, 179, 99, .3); }

/* the choices hang from the sign: one hanger rail, tabs with square tops beneath it */
.pl-tabs { position: relative; padding-top: 9px; gap: 6px 8px; }
.pl-tabs::before { content: ''; position: absolute; left: -4px; right: -4px; top: 0; height: 3px; border-radius: 2px; background: rgba(244, 239, 228, .82); }
.pl-tabs .tab { border-radius: 0 0 6px 6px; }
.pl-tabs .tab::before { content: ''; position: absolute; top: -9px; left: 14px; width: 2px; height: 9px; background: rgba(244, 239, 228, .82); }
.pl-tabs .tab::after { content: ''; position: absolute; top: -9px; right: 14px; width: 2px; height: 9px; background: rgba(244, 239, 228, .82); }
.tab { position: relative; }

/* portrait: the sign takes the height it needs; the plates size to their content */
body[data-rail="bottom"] #plate { max-height: none; }
body[data-rail="bottom"] #panels { align-items: flex-start; }

/* phone: while a lens is up, the floating chrome steps aside */
body.phone.lens-open #view-switch { visibility: hidden; }
body.phone #lens { justify-items: center; padding-right: 0; }
body.phone .lens-sign.wide .lens-head { padding-left: 14px; justify-content: space-between; }

/* phone: two plates a row, each a full 44px tap */
body.phone #panels { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; align-content: start; }
body.phone #panels[data-n="2"] { grid-template-columns: 1fr; }
body.phone .pp { min-height: 46px; flex-direction: column; align-items: stretch; justify-content: center; gap: 2px; padding: 4px 7px; }
body.phone .pp-head { gap: 4px; }
body.phone .pp-nm { font-size: 11px; }
body.phone .pp-stats { gap: 6px; }
body.phone .pp-cube { width: 14px; height: 14px; }
body.phone .pl-tabs::before { left: 0; right: 0; }
body.phone .pp-big { position: relative; width: min(420px, 100%); padding: 16px 52px 16px 16px; display: block; }
body.phone .pp-big .sheet-x { position: absolute; right: 4px; top: 4px; }
.pp-big { position: relative; }

/* phone start: its own arrangement — a cover band, 44px rows, no shrinking */
@media (max-height: 520px) and (pointer: coarse) {
    .start-card { width: 100vw; height: 100vh; border-radius: 0; transform: translate(-50%, -50%) !important; }
    /* the band is exactly the cover's own shape (637 x 892): nothing of it is cut, the publisher's mark included */
    .start-art { flex: 0 0 auto; height: 100%; aspect-ratio: 637 / 892; }
    .start-art img { object-position: 50% 0; }
    .start-panel { padding: 6px 14px 6px; gap: 6px; overflow-y: auto; }
    .start-panel .start-sign { display: none; }
    .start-fields { margin-top: 0; }
    .start-fields { gap: 5px; }
    .start-row { gap: 8px; }
    .start-label { flex-basis: 92px; font-size: 11px; letter-spacing: .08em; }
    .start-tile { min-height: 44px; padding: 2px 6px; }
    .tile-main { white-space: normal; text-align: center; text-wrap: balance; font-size: 12.5px; line-height: 1.1; overflow-wrap: anywhere; }   /* a long word wraps, the tile keeps its width */
    .tile-sub { font-size: 11px; }
    /* two rows of doors: the decision (Play / Continue + its quiet line), then Tutorial,
       Play together, Rules sharing the width — nothing ever runs off the right edge */
    .start-doors { flex: 0 0 auto; flex-direction: column; gap: 6px; margin-top: 2px; }
    .start-first { flex-direction: row; align-items: stretch; gap: 8px; }
    .start-play { flex: 1; min-height: 48px; padding: 4px 16px; }
    .play-sub { display: none; }
    .start-quiet { flex: 0 1 auto; padding: 0 6px; font-size: 12px; line-height: 1.2; }
    .start-second { gap: 6px; }
    .start-second .start-ghost { flex: 1 1 0; min-width: 0; padding: 0 8px; font-size: 12.5px; line-height: 1.15; }
    .start-hint { display: none; }
    .start-credit { display: none; font-size: 11px; }
    .start-lang { left: auto; right: calc(100vw - 100vh * 637 / 892 + 6px); top: auto; bottom: 6px; }   /* the band's right corner, clear of the mark, whatever the name's length */
    .start-lang .lang-select { background: rgba(28, 26, 32, .72); }
}
/* the 640x300 floor: every pixel of the two door rows counts */
@media (max-height: 320px) and (pointer: coarse) {
    .start-panel { padding-top: 4px; padding-bottom: 4px; gap: 4px; }
    .start-fields { gap: 4px; }
    .start-doors { gap: 4px; margin-top: 0; }
    .start-play { min-height: 44px; }
}
/* a taller phone has room for the A/B line and the credit under the doors */
@media (max-height: 520px) and (min-height: 380px) and (pointer: coarse) {
    .start-hint { display: block; margin: 0; font-size: 11.5px; }
    .start-credit { display: block; }
    .start-credit .cr-a, .start-credit .cr-sep { display: inline; }
    .start-panel { justify-content: safe center; }
    .start-fields { margin-top: 0; }
    .start-doors { margin-top: 6px; }
}
body.phone .pl-tabs .tab::before, body.phone .pl-tabs .tab::after { display: none; }
body.phone .pl-tabs .tab { border-radius: 6px; }

/* ── Tutorial ──────────────────────────────────────────────────────────────────────────
   The caption is one more enamel sign bolted to the yard: slate enamel, white keyline, Marcellus
   tag; when the move is yours an ochre rule runs along its top (the sunrise = act now). The
   spotlight darkens the soot around what it names and rings it in ochre. */
.tut-veil { position: fixed; left: 0; top: 0; z-index: 270; pointer-events: none; opacity: 0; transition: opacity 240ms ease; }
.tut-veil.on { opacity: 1; }
.tut-dim { fill: rgba(16, 14, 20, .62); transition: fill 240ms ease; }
.tut-dim.soft { fill: rgba(16, 14, 20, .28); }
.tut-ring { fill: none; stroke: var(--ink); stroke-width: 1.5; stroke-dasharray: 6 4; opacity: .85; }
.tut-veil.act .tut-ring { stroke: var(--ochre); stroke-width: 3; stroke-dasharray: none; opacity: 1; animation: tut-breathe 1.6s ease-in-out infinite; }
.tut-veil.pulse .tut-ring { animation: tut-pulse .36s ease-in-out 3; }
@keyframes tut-breathe { 50% { stroke-width: 4.5; opacity: .75; } }
@keyframes tut-pulse { 50% { stroke: var(--ink); stroke-width: 6; } }

.tut-cap {
    position: fixed; z-index: 310; left: 50%; top: 60px;
    width: max-content; max-width: min(460px, calc(100vw - 12px));
    padding: 12px 16px 12px;
    background:
        linear-gradient(170deg, rgba(255, 255, 255, .10), transparent 38%),
        radial-gradient(140% 90% at 80% 120%, rgba(0, 0, 0, .28), transparent 60%),
        var(--enamel);
    border-radius: 10px;
    box-shadow: inset 0 0 0 3px var(--enamel), inset 0 0 0 4.5px rgba(244, 239, 228, .82), 0 10px 26px rgba(0, 0, 0, .6);
    color: var(--ink);
    transition: opacity 200ms ease, transform 200ms var(--ease);
}
.tut-cap.away { opacity: 0; pointer-events: none; transform: translateY(6px); }
.tut-cap.pinned { box-shadow: inset 0 0 0 3px var(--enamel), inset 0 0 0 4.5px var(--ochre), 0 0 0 2px rgba(230, 179, 99, .35), 0 10px 26px rgba(0, 0, 0, .6); }
.tut-cap.pinned::before {
    content: ''; position: absolute; left: 14px; right: 14px; top: 0; height: 3px; border-radius: 0 0 3px 3px;
    background: var(--ochre);
}
.tut-cap.hint { max-width: min(360px, calc(100vw - 12px)); }
.tut-cap.shake { animation: tut-shake .38s ease; }
@keyframes tut-shake { 20%, 60% { transform: translateX(-5px); } 40%, 80% { transform: translateX(5px); } }
.tut-head { display: flex; align-items: center; gap: 10px; margin: -2px -6px 4px 0; }
.tut-tag { font: 400 15px/1 var(--font-display); letter-spacing: .2em; text-transform: uppercase; color: var(--ink); }
.tut-cap.pinned .tut-tag, .tut-cap.hint .tut-tag { color: var(--ochre); }
.tut-count { font: 600 11px/1 var(--font-ui); color: var(--ink-dim); font-variant-numeric: tabular-nums; letter-spacing: .04em; }
.tut-exit { margin-left: auto; width: 36px; height: 36px; display: grid; place-items: center; border-radius: 6px; color: var(--ink); opacity: .8; }
.tut-exit:hover { opacity: 1; background: rgba(244, 239, 228, .1); }
.tut-text { margin: 0; font: 500 15px/1.45 var(--font-ui); color: var(--ink); text-wrap: pretty; }
.tut-nag { display: none; margin: 6px 0 0; font: 700 13px/1.35 var(--font-ui); color: var(--ochre); }
.tut-cap.nagging .tut-nag { display: block; }
.tut-btns { display: flex; align-items: center; gap: 8px; margin-top: 10px; }
.tut-btns button { min-height: 44px; padding: 0 16px; border-radius: 6px; font: 700 13.5px var(--font-ui); }
.tut-back { background: transparent; color: var(--ink); box-shadow: inset 0 0 0 1.5px rgba(244, 239, 228, .55); }
.tut-back:disabled { opacity: .35; cursor: default; }
.tut-alt { background: transparent; color: var(--ink); box-shadow: inset 0 0 0 1.5px rgba(244, 239, 228, .55); }
.tut-next { margin-left: auto; background: var(--ink); color: var(--enamel-deep); box-shadow: 0 2px 0 rgba(0, 0, 0, .35); }
.tut-next.primary { background: var(--ochre); color: var(--ochre-ink); }
.tut-alt:not([hidden]) + .tut-next { margin-left: 0; }
.tut-alt:not([hidden]) { margin-left: auto; }
.tut-hint { margin-left: auto; font: 700 11px var(--font-ui); letter-spacing: .14em; text-transform: uppercase; color: var(--ochre); }
.tut-hint[hidden], .tut-btns [hidden], .tut-exit[hidden] { display: none; }
.tut-cap.hint .tut-btns { margin-top: 8px; }
.tut-cap.narrow .tut-text { font-size: 13.5px; line-height: 1.4; }
.tut-cap.narrow .tut-btns button { padding: 0 12px; }
body.phone .tut-cap { padding: 6px 10px 8px; }
/* a phone's full-width plate: head and buttons share the top row, the text runs underneath */
body.phone .tut-cap:not(.narrow) {
    display: grid; grid-template-columns: 1fr auto; column-gap: 8px;
    grid-template-areas: "head btns" "text text" "nag nag";
}
body.phone .tut-cap:not(.narrow) .tut-head { grid-area: head; margin: 0; }
body.phone .tut-cap:not(.narrow) .tut-btns { grid-area: btns; margin: 0; }
body.phone .tut-cap:not(.narrow) .tut-text { grid-area: text; margin-top: 2px; }
body.phone .tut-cap:not(.narrow) .tut-nag { grid-area: nag; }
body.phone .tut-cap:not(.narrow) .tut-hint { margin-left: 4px; }
.tut-cap.mini .tut-text, .tut-cap.mini .tut-count { display: none; }
body.phone .tut-cap.mini { grid-template-areas: "head btns" "nag nag"; padding-bottom: 6px; }
body.phone .tut-text { font-size: 13px; line-height: 1.36; }
body.phone .tut-head { margin-bottom: 2px; }
body.phone .tut-exit { width: 44px; height: 36px; }
body.phone .tut-btns { margin-top: 6px; }
body.phone .tut-btns button { min-height: 44px; padding: 0 12px; }
@media (prefers-reduced-motion: reduce) {
    .tut-cap, .tut-veil { transition: none; }
    .tut-veil.act .tut-ring, .tut-veil.pulse .tut-ring, .tut-cap.shake { animation: none; }
}

/* ── desktop / landscape tablet: the cards head the rail, the boards take the full height ── */
body.rail-market #rail { pointer-events: none; }
body.rail-market #rail > * { pointer-events: auto; }
.order-chip {
    display: grid; place-items: center; border-radius: 50%;
    font: 400 clamp(11px, 1.5vmin, 15px) var(--font-display); color: var(--ochre-ink);
    background: radial-gradient(circle at 35% 30%, #f3e6c8, #d9c29a 62%, #a98d5c);
    box-shadow: inset 0 0 0 1px rgba(42, 33, 23, .45), 0 1px 3px rgba(0, 0, 0, .55);
    pointer-events: none;
}
/* slim player plates: name and numbers on one line, the tiles on a second */
body.rail-market #panels { gap: 6px; }
body.rail-market .pp { display: flex; flex-wrap: wrap; align-items: center; gap: 3px 10px; padding: 6px 10px 7px; }
body.rail-market .pp-head { flex: 0 1 auto; gap: 6px; }
body.rail-market .pp-cube { width: 17px; height: 17px; }
body.rail-market .pp-nm { font-size: 12.5px; padding: 1px 6px; max-width: 9em; }
body.rail-market .pp-order { margin-left: 0; font-size: 13px; }
body.rail-market .pp-stats { margin-top: 0; gap: 9px; flex: 1 1 auto; }
body.rail-market .pp-vp b, body.rail-market .pp-coins b { font-size: 15.5px; }
body.rail-market .pp-coin { width: 15px; height: 15px; }
body.rail-market .pp-box { width: 12px; height: 19px; }
body.rail-market .pp-tiles { flex: 1 0 100%; margin-top: 1px; gap: 3px; }
body.rail-market .pp-tiles:empty { display: none; }
body.rail-market .pp-tile { width: 25px; height: 22px; }
body.rail-market .pp-ctile { width: 50px; height: 20px; }
body.rail-market .pp-penalty { height: 20px; }
body.rail-market #plate { padding: 11px 13px; }

/* ── THE PAPER: every overlay in the cover's own title colours ────────────────────────────
 * The RISE wordmark is steel blue lettering on a shaded white sky, so everything that floats
 * over the yard — sheets, the rules book, side panels, menus, the lens frame, banners, the end
 * notice, the online and Pass & Play dialogs, tooltips — is that: shaded white paper, steel blue
 * ink, a steel keyline inside the edge. The yard itself (header band, decision sign, player
 * plates, start screen) stays enamel on soot.
 *   --steel       #3b5466   the wordmark's letter core (sampled #5c6c77 over paper, deepened
 *                           to 7:1 on the paper so 12px text holds)
 *   --steel-dim   #5d717f   secondary text, 4.9:1 on --paper
 *   --paper       #f6f4ef   the sky behind the title, warmed toward the sketch paper
 *   --paper-shade #dde2e5   the shading toward the foot of a sheet (the smoke's cool grey)
 *   --ochre-text  #8a5717   the sunrise ochre deepened for text on paper (5.6:1)
 */
:root {
    --steel: #3b5466; --steel-deep: #2a3d4b; --steel-dim: #5d717f;
    --paper: #f6f4ef; --paper-shade: #dde2e5; --paper-line: rgba(59, 84, 102, .2);
    --ochre-text: #8a5717;
}
.paper, .enamel-sheet, .lens-sign, .banner-sign, .end-sign, .ai-detail, #tools-menu, .side-panel, .rmp, #rise-mp-toast {
    --ink: var(--steel); --ink-dim: var(--steel-dim);
    color: var(--steel);
    background:
        linear-gradient(172deg, #ffffff 0%, var(--paper) 38%, var(--paper-shade) 100%);
    border-radius: 10px;
    box-shadow: inset 0 0 0 3px rgba(255, 255, 255, .7), inset 0 0 0 4.5px var(--steel), 0 10px 28px rgba(0, 0, 0, .55);
}
.ai-detail, #tools-menu, .side-panel { box-shadow: inset 0 0 0 1.5px var(--steel), 0 10px 26px rgba(0, 0, 0, .55); }
/* text accents: the ochre for "now" reads on enamel, not on white — deepened here */
.enamel-sheet .sheet h3, .sheet h3, .banner-line, .log-divider, .ai-row.chosen,
.end-table tr.winner td, .end-table tr.winner td.end-total, .rmp-code { color: var(--ochre-text); }
.rmp-layer .rmp-error { color: #a4301a; }
.rmp-layer .rmp-pill.on { background: var(--steel); color: var(--paper); }
.rmp-layer .rmp-code { color: var(--ochre-text); }
/* hairlines drawn for enamel become steel on paper */
.log-block, .ai-entry, .end-table td { border-top-color: var(--paper-line); }
.side-foot, .rmp-layer .rmp-foot { border-top-color: var(--paper-line); }
.side-x:hover, .sheet-x:hover, .lens-x:hover, .tools-item:hover { background: rgba(59, 84, 102, .1); }
.side-x, .sheet-x, .lens-x { color: var(--steel); }
/* tabs on paper: steel buttons with paper lettering; the ochre one stays the ochre one */
.paper .tab, .end-sign .tab, .rmp .tab { background: var(--steel); color: var(--paper); box-shadow: 0 2px 0 rgba(0, 0, 0, .25); }
.paper .tab.primary, .end-sign .tab.primary, .rmp .tab.primary { background: var(--ochre); color: var(--ochre-ink); }
.paper .tab.quiet, .end-sign .tab.quiet, .rmp .tab.quiet { background: transparent; color: var(--steel); box-shadow: inset 0 0 0 1.5px var(--steel); }
.rmp-layer .rmp-field input { background: #fff; color: var(--steel-deep); box-shadow: inset 0 0 0 1.5px var(--paper-line); }
.rmp-layer .rmp-mark, .rmp-layer .rmp-pill { background: rgba(59, 84, 102, .06); box-shadow: inset 0 0 0 1.5px var(--paper-line); }
.rmp-layer .rmp-mark.on { background: rgba(230, 179, 99, .25); box-shadow: inset 0 0 0 2.5px var(--ochre-deep); }
.rmp-layer .rmp-seat { background: rgba(59, 84, 102, .07); }
.rmp-layer .rmp-seat.me { background: rgba(230, 179, 99, .22); }
#rise-mp.rmp-layer, .sheet-layer, #end { background: rgba(18, 16, 22, .62); }
.lens-title, .banner-title, .end-sign h2, .sheet h2, .side-head, .rmp-title { color: var(--steel); }
.cl-x { background: var(--paper); color: var(--steel); box-shadow: inset 0 0 0 1.5px var(--steel); }

/* ── the language selector: "🇬🇧 English ▾" on enamel, its menu on the paper ───────────── */
.lang-select {
    display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 12px 0 10px; border-radius: 8px;
    font: 600 13.5px var(--font-ui); color: var(--ink);
    background: rgba(244, 239, 228, .07); box-shadow: inset 0 0 0 1.5px rgba(244, 239, 228, .42);
    transition: background .15s, box-shadow .15s;
}
.lang-select:hover, .lang-select[aria-expanded="true"] { background: rgba(244, 239, 228, .14); box-shadow: inset 0 0 0 1.5px rgba(244, 239, 228, .75); }
.lang-select.compact { padding: 0 8px; gap: 5px; }
.lang-chev { opacity: .75; transition: transform .2s var(--ease); }
.lang-select[aria-expanded="true"] .lang-chev { transform: rotate(180deg); }
.lang-select .flag, .lang-item .flag { display: inline-block; width: 24px; height: 16px; flex: none; }
.lang-item .flag { box-shadow: 0 0 0 1px rgba(59, 84, 102, .35); }
.lang-menu {
    position: fixed; z-index: 1500; min-width: 190px; padding: 6px; display: flex; flex-direction: column; gap: 2px;
    box-shadow: inset 0 0 0 1.5px var(--steel), 0 12px 30px rgba(0, 0, 0, .55);
    animation: menu-in .16s var(--ease) both;
}
@keyframes menu-in { from { opacity: 0; transform: translateY(-4px); } }
/* eight languages: the list never leaves the window (it scrolls inside if it must), and on a
   phone held sideways it stands in two columns, four rows of 44px */
.lang-menu { max-height: calc(100vh - 16px); max-height: calc(100dvh - 16px); overflow-y: auto; overscroll-behavior: contain; }
@media (max-height: 460px) {
    .lang-menu { display: grid; grid-template-columns: 1fr 1fr; column-gap: 4px; }
}
.lang-item { display: flex; align-items: center; gap: 12px; min-height: 44px; padding: 0 12px; border-radius: 6px; font: 600 14.5px var(--font-ui); color: var(--steel); text-align: left; }
.lang-item:hover, .lang-item:focus-visible { background: rgba(59, 84, 102, .1); outline: none; }
.lang-item:focus-visible { box-shadow: inset 0 0 0 2px var(--steel); }
.lang-item.on { font-weight: 800; }
.lang-name { flex: 1; }
.lang-tick { width: 16px; color: var(--ochre-text); display: grid; place-items: center; }
@media (prefers-reduced-motion: reduce) { .lang-menu { animation: none; } .lang-chev { transition: none; } }

/* ── tooltips (tooltip.js): a steel label on the paper, a pointer at what it names ─────── */
.tooltip {
    position: fixed; z-index: 1600; left: 0; top: 0; max-width: min(280px, calc(100vw - 12px));
    padding: 6px 10px 7px; border-radius: 6px; pointer-events: none;
    font: 600 12.5px/1.3 var(--font-ui); color: var(--steel); text-wrap: balance;
    background: linear-gradient(180deg, #ffffff, var(--paper) 55%, var(--paper-shade));
    box-shadow: inset 0 0 0 1px var(--steel), 0 6px 16px rgba(0, 0, 0, .45);
    opacity: 0; transform: translateY(3px); transition: opacity .14s, transform .14s var(--ease);
}
.tooltip.below { transform: translateY(-3px); }
.tooltip.on { opacity: 1; transform: none; }
.tooltip-arrow {
    position: absolute; top: 100%; width: 10px; height: 10px; margin: -5px 0 0 -5px;
    background: var(--paper-shade); transform: rotate(45deg);
    box-shadow: 1px 1px 0 0 var(--steel);
}
.tooltip.below .tooltip-arrow { top: 0; background: #fff; box-shadow: -1px -1px 0 0 var(--steel); }
@media (prefers-reduced-motion: reduce) { .tooltip { transition: opacity .1s; transform: none !important; } }

/* ── Pass & Play (core/passplay.js): its shell and .pp-* rules, copied from core/deckades.css
 * (Rise does not link that sheet — its header and start-screen rules would fight Rise's own),
 * fed with Rise's paper: steel blue on shaded white, ochre for the one thing to press. ────── */
.pp-overlay, .pp-turn {
    --dk-z-overlay: 1100; --dk-z-start: 1200;
    --dk-scrim: rgba(18, 16, 22, .62); --dk-scrim-solid: #1c1a20;
    --dk-dialog-bg: linear-gradient(172deg, #ffffff 0%, var(--paper) 38%, var(--paper-shade) 100%);
    --dk-dialog-line: var(--steel); --dk-dialog-radius: 10px;
    --dk-panel-text: var(--steel); --dk-panel-accent: var(--steel);
    --dk-font-ui: var(--font-ui); --dk-font-display: var(--font-display);
    --dk-accent: var(--steel); --dk-accent-soft: rgba(59, 84, 102, .12); --dk-accent-ink: var(--paper);
    --dk-start-field: #fff; --dk-start-field-ink: var(--steel-deep); --dk-start-field-edge: rgba(59, 84, 102, .35);
    --dk-start-focus: 2px solid var(--ochre-deep);
}
.overlay {
    position: fixed; inset: 0;
    z-index: var(--dk-z-overlay);
    display: grid; place-items: center;
    padding: 16px;
    background: var(--dk-scrim);
}
.overlay.hidden { display: none; }
.panel {
    position: relative;
    box-sizing: border-box;
    background: var(--dk-dialog-bg);
    border: 1px solid var(--dk-dialog-line);
    border-radius: var(--dk-dialog-radius);
    padding: 22px 24px;
    width: min(440px, 94vw);
    max-height: calc(100dvh - 32px);
    overflow-y: auto;
    text-align: center;
    color: var(--dk-panel-text);
    font-family: var(--dk-font-ui);
    box-shadow: 0 12px 44px rgba(0, 0, 0, 0.7);
}
.panel h2 {
    font-family: var(--dk-font-display); font-weight: 700;
    font-size: 24px; color: var(--dk-panel-accent, var(--dk-accent)); margin-bottom: 12px;
}
.over-line { font-size: 15px; line-height: 1.6; margin-bottom: 10px; }
.primary-btn {
    margin-top: 16px; width: 100%; min-height: 48px;
    border: 1px solid var(--dk-accent);
    border-radius: 10px;
    background: var(--dk-accent); color: #fff;
    font-family: var(--dk-font-ui);
    font-size: 16px; font-weight: 700;
    cursor: pointer; touch-action: manipulation;
    transition: filter 0.15s;
}
.primary-btn:hover { filter: brightness(1.15); }
.primary-btn:focus-visible { outline: 2px solid var(--dk-accent); outline-offset: 3px; }
.primary-btn.alt {
    background: transparent;
    color: var(--dk-panel-text);
    border-color: var(--dk-accent-soft);
    font-weight: 600;
}
@media (hover: hover) { .primary-btn.alt:hover { background: var(--dk-accent-soft); filter: none; } }
.pp-overlay { z-index: calc(var(--dk-z-start, 1200) + 2); }
.pp-overlay.pp-conceal { background: var(--dk-scrim-solid, #0b0912); }
.pp-panel { width: min(420px, 94vw); text-align: left; }
.pp-panel h2 { text-align: center; }
.pp-modes { display: flex; flex-direction: column; gap: 10px; margin: 4px 0 6px; }
.pp-mode {
    display: flex; align-items: center; gap: 14px;
    width: 100%; min-height: 72px; padding: 12px 16px;
    box-sizing: border-box; text-align: left;
    background: var(--dk-start-field); color: var(--dk-start-field-ink);
    border: 1px solid var(--dk-start-field-edge); border-radius: 10px;
    font-family: var(--dk-font-ui); cursor: pointer; touch-action: manipulation;
    transition: border-color 0.15s, background-color 0.15s, transform 0.15s;
}
.pp-mode:hover { border-color: var(--dk-accent); background-color: var(--dk-accent-soft); }
.pp-mode:active { transform: translateY(1px); }
.pp-mode:focus-visible,
.pp-step:focus-visible,
.pp-name:focus-visible {
    outline: var(--dk-start-focus, 2px solid var(--dk-accent));
    outline-offset: var(--dk-start-focus-offset, 3px);
}
.pp-mode-icon { flex: none; display: grid; place-items: center; color: var(--dk-accent); }
.pp-mode-text { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.pp-mode-title { font-size: 17px; font-weight: 700; }
.pp-mode-sub { font-size: 13px; line-height: 1.35; opacity: 0.8; }
.pp-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 44px; }
.pp-label { font-size: 14px; font-weight: 600; }
.pp-stepper { display: flex; align-items: center; gap: 4px; }
.pp-step {
    width: 44px; height: 44px; padding: 0;
    display: grid; place-items: center;
    background: var(--dk-start-field); color: var(--dk-start-field-ink);
    border: 1px solid var(--dk-start-field-edge); border-radius: 8px;
    cursor: pointer; touch-action: manipulation;
}
.pp-step:hover:not(:disabled) { border-color: var(--dk-accent); }
.pp-step:disabled { opacity: var(--dk-start-disabled, 0.4); cursor: default; }
.pp-value {
    min-width: 2.2ch; text-align: center;
    font-size: 20px; font-weight: 700; font-variant-numeric: tabular-nums;
}
.pp-disc {
    flex: none; width: 24px; height: 24px; border-radius: 50%;
    display: grid; place-items: center;
    background: var(--dk-accent); color: #fff; font: 700 12px/1 var(--dk-font-ui);
}
.pp-name {
    min-width: 0; height: 44px; padding: 0 12px; box-sizing: border-box;
    background: var(--dk-start-field); color: var(--dk-start-field-ink);
    border: 1px solid var(--dk-start-field-edge); border-radius: 8px;
    font-family: var(--dk-font-ui); font-size: 15px;
}
.pp-name::placeholder { color: currentColor; opacity: 0.5; }
.pp-actions { display: flex; flex-direction: column; gap: 8px; margin-top: 16px; }
.pp-actions .primary-btn { margin-top: 0; }
.pp-actions .primary-btn:disabled { opacity: 0.5; cursor: default; filter: none; }
.pp-pass { text-align: center; width: min(360px, 92vw); }
.pp-pass-icon { color: var(--dk-accent); display: grid; place-items: center; margin-bottom: 6px; }
.pp-pass-line { font-size: 14px; }
.pp-panel h2.pp-pass-name { font-size: 34px; margin: 2px 0 6px; overflow-wrap: anywhere; }
.pp-turn {
    position: fixed; top: 50%; left: 50%;
    z-index: calc(var(--dk-z-overlay, 1100) - 1);
    display: flex; align-items: center; gap: 14px;
    padding: 16px 30px;
    background: var(--dk-dialog-bg); color: var(--dk-panel-text);
    border: 1px solid var(--dk-dialog-line); border-radius: 14px;
    box-shadow: 0 18px 50px rgba(0, 0, 0, 0.5);
    font: 700 30px/1.15 var(--dk-font-display);
    pointer-events: none;
    opacity: 0; transform: translate(-50%, -50%) scale(0.94);
    transition: opacity 0.25s ease, transform 0.45s cubic-bezier(0.16, 1, 0.3, 1);
}
.pp-turn.on { opacity: 1; transform: translate(-50%, -50%) scale(1); }
#pp-turn { border-bottom: 4px solid var(--pp-seat, var(--dk-dialog-line)); }
.pp-turn.folding { transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.45s ease 0.05s; }
.pp-turn svg { color: var(--dk-accent); flex: none; }
@media (max-height: 460px) { .pp-turn { font-size: 24px; padding: 12px 22px; } }
@media (prefers-reduced-motion: reduce) { .pp-turn { transition: opacity 0.2s; transform: translate(-50%, -50%); } }
@media (max-height: 460px) and (min-width: 640px) {
    .pp-panel:not(.pp-pass) { width: min(600px, 96vw); padding: 14px 20px 16px; }
    .pp-panel h2 { font-size: 20px; margin-bottom: 8px; }
    .pp-modes { flex-direction: row; gap: 10px; margin: 0; }
    .pp-mode { flex: 1 1 0; min-width: 0; min-height: 64px; padding: 10px 12px; gap: 10px; }
    .pp-mode-title { font-size: 16px; }
    .pp-mode-sub { font-size: 12px; }
    .pp-label { font-size: 13px; }
    .pp-name { height: 44px; padding: 0 10px; font-size: 14px; }
    .pp-actions { flex-direction: row-reverse; margin-top: 12px; }
    .pp-actions .primary-btn { flex: 1 1 0; min-height: 44px; }
    .pp-panel h2.pp-pass-name { font-size: 28px; }
}
.pp-chairs { list-style: none; margin: 4px 0 0; padding: 0; display: grid; grid-template-columns: 1fr; gap: 8px; }
.pp-chair { display: flex; align-items: center; gap: 8px; min-width: 0; }
.pp-chair .pp-name { flex: 1 1 auto; min-width: 0; }
.pp-ai-label {
    flex: 1 1 auto; min-width: 0; height: 44px; box-sizing: border-box;
    display: flex; align-items: center; padding: 0 12px;
    border: 1px dashed var(--dk-start-field-edge); border-radius: 8px;
    font-size: 15px; font-style: italic; opacity: 0.85;
}
.pp-icon-btn {
    flex: none; width: 44px; height: 44px; padding: 0;
    display: grid; place-items: center;
    background: transparent; color: inherit;
    border: 1px solid transparent; border-radius: 8px;
    cursor: pointer; touch-action: manipulation;
}
.pp-icon-btn:disabled { opacity: 0.3; cursor: default; }
@media (hover: hover) { .pp-icon-btn:hover:not(:disabled) { border-color: var(--dk-start-field-edge); background: var(--dk-start-field); } }
.pp-icon-btn:focus-visible, .pp-add:focus-visible {
    outline: var(--dk-start-focus, 2px solid var(--dk-accent));
    outline-offset: var(--dk-start-focus-offset, 3px);
}
.pp-swap { color: var(--dk-accent); }
.pp-add {
    display: flex; align-items: center; justify-content: center; gap: 8px;
    width: 100%; min-height: 44px; box-sizing: border-box;
    background: transparent; color: inherit;
    border: 1px dashed var(--dk-start-field-edge); border-radius: 8px;
    font: 600 14px var(--dk-font-ui); cursor: pointer; touch-action: manipulation;
}
.pp-add:disabled { display: none; }
@media (hover: hover) { .pp-add:hover { border-style: solid; border-color: var(--dk-accent); } }
.pp-note { margin: 8px 0 0; font-size: 13px; text-align: center; }
.pp-note.pp-warn { font-weight: 600; }
.pp-kind { flex: none; display: flex; border: 1px solid var(--dk-start-field-edge); border-radius: 999px; padding: 2px; gap: 2px; }
.pp-kind-opt {
    display: flex; align-items: center; gap: 4px; min-height: 38px; padding: 0 10px;
    background: transparent; color: inherit; border: 0; border-radius: 999px;
    font: 600 12.5px var(--dk-font-ui); cursor: pointer; touch-action: manipulation; opacity: 0.7;
}
.pp-kind-opt.on { background: var(--dk-accent); color: var(--dk-accent-ink, #111); opacity: 1; }
.pp-kind-opt:focus-visible { outline: var(--dk-start-focus, 2px solid var(--dk-accent)); outline-offset: 2px; }
@media (hover: hover) { .pp-kind-opt:not(.on):hover { opacity: 1; } }
.pp-levelrow { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-top: 10px; }
.pp-levelrow[hidden] { display: none; }
.pp-levels { display: flex; gap: 4px; }
.pp-level {
    min-height: 38px; min-width: 44px; padding: 2px 12px; border-radius: 999px; cursor: pointer;
    background: transparent; color: inherit; border: 1px solid var(--dk-start-field-edge);
    font: 600 13px var(--dk-font-ui); touch-action: manipulation;
}
.pp-level.on { background: var(--dk-accent); border-color: var(--dk-accent); color: var(--dk-accent-ink, #111); }
.pp-level:focus-visible { outline: var(--dk-start-focus, 2px solid var(--dk-accent)); outline-offset: 2px; }
@media (max-height: 460px) and (min-width: 640px) {
    .pp-chairs { grid-template-columns: 1fr 1fr; column-gap: 14px; row-gap: 6px; }
    .pp-chair { gap: 4px; }
    .pp-chair .pp-name { padding: 0 8px; }
    .pp-icon-btn { width: 40px; }
    .pp-note { margin-top: 4px; font-size: 12px; }
    .pp-kind-opt { min-height: 34px; padding: 0 7px; }
    .pp-kind-opt svg { display: none; }
    .pp-levelrow { margin-top: 6px; }
    .pp-level { min-height: 34px; }
}
@media (max-height: 400px) and (min-width: 640px) {
    .pp-panel:not(.pp-pass) { padding: 10px 18px 12px; }
    .pp-panel h2 { font-size: 19px; margin-bottom: 4px; }
    .pp-chairs { row-gap: 4px; }
    .pp-note { margin-top: 2px; font-size: 11.5px; }
    .pp-actions { margin-top: 8px; }
}

/* Rise's own finish over the copied rules */
.pp-panel.rise-pp, #pp-turn.rise-pp { box-shadow: inset 0 0 0 3px rgba(255, 255, 255, .7), inset 0 0 0 4.5px var(--steel), 0 12px 34px rgba(0, 0, 0, .55); border: 0; }
.pp-panel.rise-pp h2 { font: 400 26px var(--font-display); letter-spacing: .08em; color: var(--steel); }
.pp-panel.rise-pp .primary-btn:not(.alt) { background: var(--ochre); border-color: var(--ochre-deep); color: var(--ochre-ink);
    box-shadow: inset 0 0 0 1.5px rgba(42, 33, 23, .35), 0 2px 0 rgba(0, 0, 0, .25); }
.pp-panel.rise-pp .primary-btn.alt { color: var(--steel); border-color: var(--steel); }
.pp-panel.rise-pp .pp-disc { color: #fff; text-shadow: 0 1px 1px rgba(0, 0, 0, .4); }
.pp-panel.rise-pp .pp-level.on, .pp-panel.rise-pp .pp-kind-opt.on { background: var(--steel); color: var(--paper); }
.pp-panel.rise-pp .pp-mode-icon, .pp-panel.rise-pp .pp-pass-icon { color: var(--ochre-text); }
#pp-turn.rise-pp { font: 400 28px/1.15 var(--font-display); letter-spacing: .06em; color: var(--steel); border-bottom: 0; }
#pp-turn.rise-pp::after { content: ''; position: absolute; left: 14px; right: 14px; bottom: 7px; height: 4px; border-radius: 2px; background: var(--pp-seat, var(--steel)); }
#pp-turn.rise-pp svg { color: var(--ochre-text); }
/* Pass & Play: the name of the person the decision sign is talking to, in their colour */
.pl-who { display: inline-block; margin-bottom: 6px; padding: 2px 9px; border-radius: 4px; font: 700 12.5px var(--font-ui); letter-spacing: .04em;
    background: var(--pc); color: #fff; text-shadow: 0 1px 1px rgba(0, 0, 0, .4); }


/* ── "Rise Today!": the round's newspaper ───────────────────────────────────────────── */
#news {
    --news-ink: #1e1a15; --news-ink2: #4d4337; --news-paper: #efe6d2;
    position: fixed; inset: 0; z-index: 640; display: grid; place-items: center; padding: 10px;
    background: rgba(16, 14, 18, 0); transition: background .3s var(--ease);
}
#news.show { background: rgba(16, 14, 18, .62); }
.news-paper {
    position: relative; width: min(720px, 100%); max-height: calc(100dvh - 20px);
    display: flex; flex-direction: column;
    padding: clamp(12px, 2.6vmin, 24px) clamp(16px, 3.4vmin, 32px) clamp(12px, 2.4vmin, 22px);
    color: var(--news-ink); background: var(--news-paper) url('assets/news/paper.webp') center / cover;
    box-shadow: 0 18px 50px rgba(0, 0, 0, .6), 0 2px 6px rgba(0, 0, 0, .35);
    /* the one moment: the paper is tossed onto the table */
    transform: translateY(40px) rotate(-4deg) scale(.96); opacity: 0;
    transition: transform .55s cubic-bezier(.16, 1, .3, 1), opacity .3s ease-out;
}
#news.show .news-paper { transform: rotate(-.8deg); opacity: 1; }
.news-paper ::selection { background: var(--news-ink); color: var(--news-paper); }
.news-mast { font: clamp(34px, 8vmin, 68px)/1 'Unifraktur', 'Playfair Display', serif; text-align: center; }
.news-vignette { height: clamp(44px, 10vmin, 86px); margin: 6px 0 4px; background: url('assets/news/skyline.webp') center 58% / cover; mix-blend-mode: multiply; }
.news-date {
    display: flex; justify-content: space-between; gap: 10px;
    font: 600 clamp(10px, 1.6vmin, 12.5px)/1.7 var(--font-ui); letter-spacing: .14em; text-transform: uppercase;
    border-top: 3px double var(--news-ink); border-bottom: 1px solid var(--news-ink); padding: 1px 2px;
}
.news-body { overflow: auto; min-height: 0; padding: clamp(8px, 2vmin, 16px) 2px 4px; scrollbar-color: var(--news-ink2) transparent; }
.news-lead {
    font: 900 clamp(22px, 5vmin, 40px)/1.02 'Playfair Display', var(--font-display); text-transform: uppercase;
    text-align: center; text-wrap: balance; margin: 0; letter-spacing: -.005em;
}
.news-deck { font: italic clamp(14px, 2.4vmin, 18px)/1.35 'Crimson Pro', var(--font-display); text-align: center; color: var(--news-ink2); margin: 6px auto 0; max-width: 46ch; text-wrap: balance; }
.news-cols {
    display: grid; grid-template-columns: 1.2fr 1fr; gap: clamp(12px, 3vmin, 24px);
    margin-top: clamp(2px, .8vmin, 8px);
}
.news-items { border-right: 1px solid rgba(30, 26, 21, .5); padding-right: clamp(12px, 3vmin, 24px); }
.news-item, .news-calm { font: 600 clamp(15px, 2.6vmin, 19px)/1.28 'Playfair Display', var(--font-display); margin: 0 0 9px; text-wrap: balance; }
.news-item::before { content: ''; display: inline-block; width: .6em; height: .6em; margin-right: .45em; border-radius: 1px; background: var(--pc); transform: rotate(-4deg); box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .35); }
.news-item small { display: block; margin-top: 2px; padding-left: 1.05em; font: italic 400 .86em/1.25 'Crimson Pro', var(--font-display); color: var(--news-ink2); }
.news-calm { font-style: italic; font-weight: 400; font-family: 'Crimson Pro', var(--font-display); color: var(--news-ink2); }
.news-standings { width: 100%; border-collapse: collapse; font: 500 clamp(15px, 2.5vmin, 18.5px)/1.3 'Crimson Pro', var(--font-display); font-variant-numeric: tabular-nums lining-nums; align-self: start; }
.news-standings caption { font: 700 clamp(10px, 1.6vmin, 12px)/1 var(--font-ui); letter-spacing: .16em; text-transform: uppercase; text-align: left; padding-bottom: 6px; }
.news-standings td { padding: clamp(4px, 1vmin, 8px) 5px; border-top: 1px dotted rgba(30, 26, 21, .55); }
.news-standings .ns-name { font-weight: 700; position: relative; padding-left: 16px; }
.news-standings .ns-name::before { content: ''; position: absolute; left: 0; top: 50%; width: 9px; height: 9px; margin-top: -5px; border-radius: 1px; background: var(--pc); box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .35); }
.news-standings .ns-vp { text-align: right; font-weight: 700; white-space: nowrap; }
.news-standings .ns-gain { text-align: right; color: #2f5a2c; }
.news-standings .ns-gain.down { color: #8a1f1c; }
.news-standings .ns-coins { text-align: right; color: var(--news-ink2); }
.news-standings .ns-lost { text-align: right; white-space: nowrap; color: #8a1f1c; font-weight: 700; }
.news-standings .ns-xcoin {                             /* a coin struck out: what the coin limit took */
    position: relative; display: inline-block; width: .85em; height: .85em; margin-right: .25em; vertical-align: -.1em;
    background: url('tokens/coin1_front.webp') center / contain no-repeat; filter: saturate(.55); opacity: .85;
}
.news-standings .ns-xcoin::after {
    content: ''; position: absolute; left: -12%; right: -12%; top: 50%; height: 2px; margin-top: -1px;
    background: #8a1f1c; border-radius: 1px; transform: rotate(-40deg); box-shadow: 0 0 0 1px rgba(239, 230, 210, .7);
}
.news-standings .ns-coins { font-weight: 700; color: var(--news-ink); white-space: nowrap; }
.news-standings .ns-inc { text-align: left; color: #2f5a2c; white-space: nowrap; padding-left: 2px; }
.news-standings .ns-coins::after { content: ''; display: inline-block; width: .8em; height: .8em; margin-left: .25em; vertical-align: -.08em; background: url('tokens/coin1_front.webp') center / contain no-repeat; }
.news-next { font: italic clamp(13px, 2.1vmin, 16px)/1.3 'Crimson Pro', var(--font-display); text-align: center; margin: clamp(10px, 2vmin, 14px) 0 0; padding-top: 8px; border-top: 1px solid var(--news-ink); }
.news-paper .news-go { align-self: center; margin-top: clamp(8px, 1.8vmin, 14px); min-width: 200px; justify-content: center; text-align: center; }
@media (max-width: 560px) {
    .news-cols { grid-template-columns: 1fr; }
    .news-items { border-right: 0; padding-right: 0; }
}
@media (max-height: 430px) {
    .news-vignette, .news-deck { display: none; }
    .news-mast { font-size: 28px; }
    .news-lead { font-size: 20px; }
    .news-body { padding-top: 6px; }
    .news-cols { margin-top: 6px; padding-top: 6px; }
    .news-standings td { padding: 2px 4px; }
    .news-next { margin-top: 6px; padding-top: 4px; }
    .news-paper .news-go { margin-top: 6px; min-height: 40px; }
}
@media (prefers-reduced-motion: reduce) {
    .news-paper, #news.show .news-paper { transition: opacity .2s; transform: none; }
}
@media (prefers-reduced-motion: reduce) { #lens, #lens:not([hidden]), .lens-sign, .card-in { transition: none; animation: none; } }


/* ── "Rise Today!": the news ticker along the foot of the screen ─────────────────────────
   the newest headline at the left, after the paper's name; each new one pushes the line right */
#newsstand {
    --news-ink: #1e1a15; --news-ink2: #4d4337; --news-paper: #efe6d2;
    position: fixed; left: var(--strip-w, 58px); right: 0; bottom: 0; height: var(--ticker-h, 40px); z-index: 280;
    display: flex; align-items: stretch; padding-bottom: env(safe-area-inset-bottom);
    background: linear-gradient(180deg, rgba(24, 22, 28, .95), rgba(14, 13, 17, .98));
    border-top: 1px solid rgba(239, 230, 210, .42);
    box-shadow: 0 -6px 16px rgba(0, 0, 0, .35);
    color: var(--news-paper);
}
.nt-mast {
    position: relative; flex: none; display: flex; align-items: center; gap: 8px; min-width: 44px; max-width: 300px;
    padding: 0 16px 0 14px; text-align: left; color: var(--news-paper); border-right: 1px solid rgba(239, 230, 210, .22);
}
.nt-words { display: flex; flex-direction: column; justify-content: center; gap: 2px; min-width: 0; }
/* the newsboy: cut out, on a soft glow of lamplight, standing on the band and rising above its line */
.nt-boy {
    flex: none; align-self: flex-end; position: relative; width: calc(var(--boy-h) * 333 / 640); height: 100%;
    margin: 0 10px 0 2px; padding: 0; border: 0; background: none; cursor: pointer;
    --boy-h: calc(var(--ticker-h, 50px) * 1.7);
}
.nt-boy::before {
    content: ''; position: absolute; left: 50%; bottom: 0; height: var(--boy-h); aspect-ratio: 333 / 640; translate: -50% 0;
    background:
        url('assets/news/newsboy-cut.webp') center bottom / contain no-repeat,
        radial-gradient(50% 46% at 50% 56%, rgba(239, 222, 186, .22), rgba(239, 222, 186, 0) 100%);
    filter: drop-shadow(0 3px 6px rgba(0, 0, 0, .5));
    transform-origin: 50% 100%;
}
/* the intro of an Event (its card before its moves): no button, a quicker bar */
.ev-sign.intro .ev-fx:empty { display: none; }
/* a new headline: he lifts and calls it out */
.nt-boy.call::before { animation: nt-call .7s cubic-bezier(.16, 1, .3, 1); }
@keyframes nt-call { 35% { transform: translateY(-5px) rotate(-3deg) scale(1.04); } }
.nt-boy:hover::before { filter: drop-shadow(0 3px 6px rgba(0, 0, 0, .5)) brightness(1.12); }
.nt-boy:focus-visible { outline: 2px solid #8a1f1c; outline-offset: 2px; }
body.phone .nt-boy { --boy-h: calc(var(--ticker-h, 32px) * 1.6); }
.nt-name { font: 25px/1 'Unifraktur', 'Playfair Display', serif; white-space: nowrap; transition: color .2s; }
.nt-round { font: 500 11px/1.2 var(--font-ui); letter-spacing: .02em; color: rgba(239, 230, 210, .6); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nt-mast:hover .nt-name { color: var(--ochre); }
.nt-mast:focus-visible, .nt-feed:focus-visible { outline: 2px solid var(--ochre); outline-offset: -3px; }
.nt-feed {
    display: flex; justify-content: flex-end; flex: 1 1 auto; min-width: 0; overflow: hidden; touch-action: none; cursor: grab;
    -webkit-mask-image: linear-gradient(90deg, transparent, #000 120px, #000 calc(100% - 12px), transparent);
    mask-image: linear-gradient(90deg, transparent, #000 120px, #000 calc(100% - 12px), transparent);
}
.nt-feed::-webkit-scrollbar { display: none; }
.nt-feed.dragging { cursor: grabbing; user-select: none; -webkit-user-select: none; }
.nt-row { display: flex; align-items: center; flex: none; height: 100%; width: max-content; padding: 0 6px; }   /* right-anchored (the feed's flex-end): the newest is always at the right edge */
.nt-item { position: relative; display: flex; align-items: baseline; gap: 9px; padding: 0 18px; white-space: nowrap; cursor: pointer; }
.nt-item + .nt-item::before {                         /* a small ochre lozenge between two stories */
    content: ''; position: absolute; left: -3px; top: 50%; width: 5px; height: 5px; margin-top: -3px;
    background: rgba(230, 179, 99, .6); transform: rotate(45deg);
}
.nt-dot { flex: none; align-self: center; width: 9px; height: 9px; border-radius: 1px; background: var(--pc); box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .4), 0 0 0 1px rgba(239, 230, 210, .25); }
.nt-h { font: 800 16px/1 'Playfair Display', var(--font-display); letter-spacing: .005em; transition: color 1.8s ease-out; }
.nt-p { font: italic 400 16px/1 'Crimson Pro', var(--font-display); color: rgba(239, 230, 210, .6); }
.nt-item:hover .nt-h { color: #fff; transition-duration: .15s; }
/* the one moment: the fresh headline comes in lit, then cools to newsprint */
.nt-item.fresh .nt-h { color: var(--ochre); transition: none; }
.nt-item.reprint .nt-h { animation: nt-reprint .5s ease-out; }
@keyframes nt-reprint { from { opacity: .35; filter: blur(2px); } }
.nt-tag {
    flex: none; margin: 0 8px; padding: 4px 8px 3px; border-radius: 2px;
    font: 700 11px/1 var(--font-ui); letter-spacing: .03em;
    color: var(--news-ink); background: rgba(239, 230, 210, .8);
}
.nt-empty { padding: 0 18px; font: italic 14.5px/1 'Crimson Pro', var(--font-display); color: rgba(239, 230, 210, .55); }
body.phone .nt-mast { gap: 6px; padding: 0 10px; }
body.phone .nt-boy { margin-right: 4px; }
body.phone .nt-words { flex-direction: row; align-items: center; gap: 8px; }
body.phone .nt-name { font-size: 18px; }
body.phone .nt-round { font-size: 10.5px; }
body.phone .nt-item { padding: 0 13px; gap: 7px; }
body.phone .nt-h { font-size: 13px; }
body.phone .nt-p { display: none; }
body.phone .nt-dot { width: 7px; height: 7px; }
@media (prefers-reduced-motion: reduce) { .nt-h { transition: none; } .nt-item.reprint .nt-h { animation: none; } }

/* the paper's clippings (the whole paper below) */
.ns-clip {
    position: absolute; right: 0; bottom: 0; width: clamp(188px, 15vw, 236px); max-height: 100%; overflow: hidden;
    padding: 8px 12px 10px; color: var(--news-ink); pointer-events: auto;
    background: var(--news-paper) url('assets/news/paper.webp') center / cover;
    box-shadow: 0 4px 12px rgba(0, 0, 0, .5);
    clip-path: polygon(0 4%, 6% 0, 14% 3%, 23% 0, 31% 4%, 40% 1%, 52% 4%, 61% 0, 72% 3%, 83% 0, 92% 4%, 100% 1%, 99% 96%, 91% 100%, 80% 97%, 70% 100%, 58% 97%, 47% 100%, 35% 98%, 24% 100%, 13% 97%, 4% 100%, 0 97%);
    transform-origin: 100% 100%; user-select: none; -webkit-user-select: none;
}
.ns-kick { display: flex; justify-content: space-between; gap: 8px; font: 700 10px/1.2 var(--font-ui); letter-spacing: .12em; text-transform: uppercase; color: var(--news-ink2); }
.ns-who { position: relative; padding-left: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ns-who::before { content: ''; position: absolute; left: 0; top: 50%; width: 8px; height: 8px; margin-top: -4.5px; border-radius: 1px; background: var(--pc); box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .35); transform: rotate(-4deg); }
.ns-clip h4 { margin: 5px 0 0; font: 900 15px/1.06 'Playfair Display', var(--font-display); text-transform: uppercase; text-wrap: balance; letter-spacing: -.003em; }
.ns-clip p { margin: 4px 0 0; font: italic 400 13px/1.25 'Crimson Pro', var(--font-display); color: var(--news-ink2); text-wrap: pretty; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

/* the whole paper: every clipping, round by round */
#news-archive { position: fixed; inset: 0; z-index: 630; display: grid; place-items: center; padding: 10px; background: rgba(16, 14, 18, .62); }
.na-sheet {
    --news-ink: #1e1a15; --news-ink2: #4d4337; --news-paper: #efe6d2;
    position: relative; width: min(820px, 100%); max-height: calc(100dvh - 20px); display: flex; flex-direction: column;
    padding: 14px clamp(14px, 3vmin, 28px) 10px; color: var(--news-ink);
    background: var(--news-paper) url('assets/news/paper.webp') center / cover; box-shadow: 0 18px 50px rgba(0, 0, 0, .6);
    transform: rotate(-.5deg);
}
.na-mast { font: clamp(30px, 6vmin, 52px)/1 'Unifraktur', 'Playfair Display', serif; text-align: center; padding-bottom: 6px; border-bottom: 3px double var(--news-ink); }
.na-x { position: absolute; right: 8px; top: 8px; width: 44px; height: 44px; display: grid; place-items: center; border-radius: 8px; border: 0; background: transparent; color: var(--news-ink); cursor: pointer; box-shadow: inset 0 0 0 1.5px var(--news-ink); }
.na-x:hover { background: rgba(30, 26, 21, .08); }
.na-x:focus-visible { outline: 2px solid var(--news-ink); outline-offset: 2px; }
.na-body { overflow: auto; min-height: 0; padding: 6px 2px 8px; scrollbar-color: var(--news-ink2) transparent; }
.na-round { display: flex; align-items: center; gap: 10px; font: 700 11px/1 var(--font-ui); letter-spacing: .2em; text-transform: uppercase; margin: 12px 0 8px; }
.na-round::before, .na-round::after { content: ''; flex: 1; border-top: 1px solid var(--news-ink); }
.na-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px 16px; }
.ns-clip.na-clip { position: relative; inset: auto; transform: none; box-shadow: 0 2px 6px rgba(0, 0, 0, .25); }
.ns-clip.na-clip h4 { font-size: 15px; }
.na-empty { font: italic 16px 'Crimson Pro', var(--font-display); text-align: center; color: var(--news-ink2); margin: 24px 0; }

/* phones: your own plate always shows your School tiles (face up / used) and your coin limit —
   the state you decide by (author feedback 2026-11-28) */
body.phone .pp.mine { flex-wrap: wrap; row-gap: 2px; padding-bottom: 4px; }
body.phone .pp.mine .pp-coins small { display: inline; font-size: 9.5px; margin-left: 1px; }
body.phone .pp.mine .pp-tiles { display: flex; flex-basis: 100%; margin-top: 0; gap: 3px; }
body.phone .pp.mine .pp-tile { width: 22px; height: 19px; }
body.phone .pp.mine .pp-tile.used { filter: brightness(.6) saturate(.5); }
body.phone .pp.mine .pp-ctile { display: none; }
body.phone .pp.mine .pp-penalty { height: 18px; }

/* ── the ticker as a strip of newsprint (user, 2026-11-29): the paper's own sheet, black ink,
   a double rule along its top edge like a page's head, column rules between the stories ───── */
#newsstand {
    background: var(--news-paper) url('assets/news/paper.webp') 0 40% / 900px auto repeat-x;
    color: var(--news-ink);
    border-top: 4px double var(--news-ink);
    box-shadow: 0 -5px 14px rgba(0, 0, 0, .45);
}
.nt-mast { color: var(--news-ink); border-right: 3px double var(--news-ink); }
.nt-mast:hover .nt-name { color: #6b1714; }
.nt-round { color: var(--news-ink2); font: italic 500 12.5px/1.15 'Crimson Pro', var(--font-display); letter-spacing: 0; }
.nt-item + .nt-item::before {                          /* a column rule between two stories */
    left: 0; top: 22%; width: 1px; height: 56%; margin-top: 0; transform: none; background: rgba(30, 26, 21, .45);
}
.nt-dot { box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .45); }
.nt-h { color: var(--news-ink); font-weight: 900; }
.nt-p { color: var(--news-ink2); }
.nt-item:hover .nt-h { color: #6b1714; }
.nt-item.fresh .nt-h { color: #8a1f1c; }               /* the stop-press: fresh ink in red, drying to black */
.nt-tag { color: var(--news-paper); background: var(--news-ink); border-radius: 0; font: 700 11px/1 'Playfair Display', var(--font-display); letter-spacing: .04em; padding: 4px 8px; }
.nt-empty { color: var(--news-ink2); }
.nt-mast:focus-visible, .nt-feed:focus-visible { outline-color: #8a1f1c; }
.nt-boy::before { filter: drop-shadow(0 2px 3px rgba(0, 0, 0, .35)); }
.nt-boy:hover::before { filter: drop-shadow(0 2px 3px rgba(0, 0, 0, .35)) brightness(1.08); }
body.phone #newsstand { border-top-width: 3px; }

/* the Speed row (2026-12-01) costs a row on a landscape phone: the sides hint gives way there so
   Play and the credits still fit the screen without scrolling */
@media (max-height: 420px) and (pointer: coarse) {
    .start-hint { display: none; }
    /* and the publisher's line under the credits (browser only): the gaps give it room */
    .start-panel { gap: 3px; }
    .start-play { min-height: 44px; }   /* the tap floor */
    .start-support { margin-top: 1px; }
}

/* phones (2026-12-01): no "choose each board" row under the sides — the Je Leiste tile carries the
   A/B count and reopens the boards, so the menu never scrolls; at the 300px floor Play and the
   three small doors share one row */
.sides-sum { display: none; }
@media (max-height: 520px) and (pointer: coarse) {
    .start-fields .side-open { display: none; }
    .tiles-sidesMode .sides-sum { display: block; }
}
@media (max-height: 340px) and (pointer: coarse) {
    .start-doors { flex-direction: row; align-items: stretch; }
    .start-first { flex: 1.15 1 0; min-width: 0; }
    .start-second { flex: 3 1 0; min-width: 0; }
    .start-first .start-quiet { display: none; }
}

/* an opponent's chosen bonus: a ring in their colour drawn round the printed icon (2026-12-01) */
.choice-ring { position: absolute; z-index: 55; pointer-events: none; border-radius: 50%;
    box-shadow: 0 0 0 4px var(--pc, #e6b363), 0 0 0 6.5px rgba(255, 255, 255, .9), 0 0 14px 6px rgba(0, 0, 0, .35);
    animation: choice-ring-in .32s cubic-bezier(.2, .9, .3, 1.3) both; }
@keyframes choice-ring-in { from { transform: scale(1.6); opacity: 0; } to { transform: scale(1); opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .choice-ring { animation: none; } }
