/* Böhmische Dörfer — UI polish 2026-11-16 (the user's play-test list), in THE PAINTED CHEST.
 * Kept in its own sheet, linked after style.css: the drawers stacked together, the shop numbers,
 * the building tooltip, the thrown dice, the income ring, the Undo button and the crawlable intro.
 * Same world as style.css: chest blue panels, ochre bands + vermilion hair line, lime-wash white as
 * the one "you may act" signal (the tick on an owned shop is lime because it is the player's own
 * mark, not a signal to press), Grenze Gotisch for numerals and names, Vollkorn for lines.
 */

/* ── All drawers in one stack, the tray directly below them ────────────────────────────── */
body:not(.phone):not(.tall) #tray { margin-top: 0; }
#own:empty { display: none; }
#seats { overflow-y: auto; }
body.tall #tray { grid-column: 1 / span 2; grid-row: 3; }
body.tall #own { display: none; }

/* ── Shops owned: the numbers 2 3 4 5, a lime-wash tick on each kind held ─────────────── */
.dr-shops { margin-left: auto; display: inline-flex; align-items: center; gap: 1px; flex: none; }
/* a kind not held: a quiet number that still reads (≥3:1 on the lit drawer); held: full lime-wash
   with its tick (critique 2026-11-16: the old 0.32 opacity read 1.6:1) */
.shop-n {
    position: relative; width: 17px; text-align: center;
    font: 600 17px/1 var(--f-display); color: rgba(242, 234, 216, 0.62);
    font-variant-numeric: tabular-nums lining-nums;
}
.shop-n.on { color: var(--lime); font-weight: 800; text-shadow: 0 1px 0 rgba(13, 31, 51, 0.8); }
.shop-n .tick {
    position: absolute; right: -3px; top: -6px; width: 11px; height: 9px; color: var(--lime);
    filter: drop-shadow(0 1px 0 rgba(13, 31, 51, 0.9)) drop-shadow(0 0 1px rgba(13, 31, 51, 0.9));
}
.drawer.compact .shop-n { font-size: 15px; width: 15px; }
.drawer.compact .shop-n .tick { width: 10px; height: 8px; top: -5px; }
/* the phone chip: the same four numbers along its foot, smaller */
/* the chip is narrow (≈50px at five players): the figure beside the supply count is the seat's
   mark, so the big figure column goes and the four lines stack — coins, figures, then 2 3 4 5;
   the held tiles ride down the right edge */
body.phone .chip:not(.supply-chip) { justify-content: flex-start; padding: 3px 3px 12px 6px; }
body.phone .chip .ch-fig { display: none; }
body.phone .chip .ch-l { line-height: 15px; }
body.phone .chip .ch-marks { flex-direction: column; top: 3px; right: 3px; gap: 1px; }
body.phone .chip .ch-marks img { height: 11px; }
body.phone .chip.supply-chip { flex: 1.2 1 0; padding-left: 4px; }
body.phone .chip.supply-chip .ch-l { gap: 2px; }
.chip .ch-shops { position: absolute; left: 6px; right: 4px; bottom: 2px; display: flex; justify-content: space-between; pointer-events: none; }
.chip .shop-n { width: auto; flex: 0 0 auto; font-size: 10px; line-height: 10px; }
.chip .shop-n .tick { width: 7px; height: 6px; right: -3px; top: -4px; }

/* ── The building tooltip: a small painted cartouche ───────────────────────────────────── */
#bd-tip {
    position: fixed; z-index: 1000; left: 0; top: 0; max-width: 300px; pointer-events: none;
    padding: 9px 13px 11px; color: var(--lime); font-size: 14px; line-height: 1.35;
    background: linear-gradient(180deg, var(--panel-hi), var(--panel));
    clip-path: polygon(8px 0, calc(100% - 8px) 0, 100% 8px, 100% calc(100% - 8px), calc(100% - 8px) 100%, 8px 100%, 0 calc(100% - 8px), 0 8px);
    box-shadow: inset 0 0 0 2px var(--ochre), inset 0 0 0 3px var(--vermilion), inset 0 0 0 6px rgba(13, 31, 51, 0.3);
    filter: drop-shadow(0 8px 14px rgba(3, 10, 20, 0.55));
    opacity: 0; transform: translateY(4px); transition: opacity 0.16s ease, transform 0.22s var(--ease-out);
}
#bd-tip.show { opacity: 1; transform: none; }
.tip-head { display: flex; align-items: baseline; gap: 7px; margin-bottom: 3px; }
.tip-num {
    flex: none; min-width: 24px; height: 24px; padding: 0 4px; display: inline-grid; place-items: center; align-self: center;
    font: 700 17px/1 var(--f-display); color: var(--ink); background: var(--ochre);
    clip-path: polygon(5px 0, calc(100% - 5px) 0, 100% 5px, 100% calc(100% - 5px), calc(100% - 5px) 100%, 5px 100%, 0 calc(100% - 5px), 0 5px);
}
.tip-name { font: 700 19px/1.05 var(--f-display); }
.tip-village { margin-left: auto; padding-left: 8px; font-size: 12px; font-style: italic; color: rgba(242, 234, 216, 0.88); white-space: nowrap; }
.tip-who { display: flex; align-items: center; gap: 6px; font-weight: 700; font-size: 13px; margin: 2px 0 5px; }
.tip-who img { width: 12px; height: 17px; filter: drop-shadow(0 1px 1px rgba(0, 0, 0, 0.5)); }
.tip-who.free { color: var(--lime-soft); font-style: italic; font-weight: 400; }
#bd-tip p { margin: 0; max-width: 34ch; }
#bd-tip p + p { margin-top: 4px; }
#bd-tip p.tip-live { color: #f6d79a; font-weight: 600; font-size: 13px; }
@media (max-height: 480px) {
    #bd-tip { font-size: 12px; line-height: 1.28; padding: 6px 10px 8px; }
    .tip-name { font-size: 16px; }
    .tip-num { min-width: 20px; height: 20px; font-size: 15px; }
    .tip-who { margin: 1px 0 3px; font-size: 12px; }
    #bd-tip p.tip-live { font-size: 12px; }
    #bd-tip p + p { margin-top: 2px; }
}
.village { -webkit-touch-callout: none; }

/* ── Every other hint (hints.js, user 2026-11-17): the same painted cartouche, smaller — a
   display-face heading and a line or two of Vollkorn. Replaces the browser's grey title box. ── */
#bd-hint {
    position: fixed; z-index: 10000; left: 0; top: 0; max-width: 290px; pointer-events: none;
    padding: 7px 12px 9px; color: var(--lime); font-size: 13.5px; line-height: 1.32; text-align: left;
    background: linear-gradient(180deg, var(--panel-hi), var(--panel));
    clip-path: polygon(7px 0, calc(100% - 7px) 0, 100% 7px, 100% calc(100% - 7px), calc(100% - 7px) 100%, 7px 100%, 0 calc(100% - 7px), 0 7px);
    box-shadow: inset 0 0 0 2px var(--ochre), inset 0 0 0 3px var(--vermilion), inset 0 0 0 5px rgba(13, 31, 51, 0.3);
    filter: drop-shadow(0 6px 12px rgba(3, 10, 20, 0.55));
    opacity: 0; transform: translateY(3px); transition: opacity 0.14s ease, transform 0.2s var(--ease-out);
    font-variant-numeric: lining-nums tabular-nums;
}
#bd-hint.show { opacity: 1; transform: none; }
#bd-hint .hint-head { font: 700 16px/1.1 var(--f-display); letter-spacing: 0.01em; }
#bd-hint .hint-head + p { margin-top: 3px; }
#bd-hint.only-head { padding: 6px 12px 7px; }
#bd-hint p { margin: 0; max-width: 34ch; color: rgba(242, 234, 216, 0.92); }
#bd-hint p::first-letter { text-transform: uppercase; }
#bd-hint p + p { margin-top: 3px; }
@media (max-height: 480px) {
    #bd-hint { font-size: 12px; line-height: 1.26; padding: 5px 9px 7px; }
    #bd-hint .hint-head { font-size: 14px; }
}
@media (prefers-reduced-motion: reduce) { #bd-hint { transition: none; transform: none; } }
/* a long press shows a hint: no callout, no text selection on what can be pressed */
#side, #bd-head, #tray { -webkit-touch-callout: none; }
#tray button, #side [data-tip], #side [data-tip-head] { -webkit-user-select: none; user-select: none; }

/* ── The thrown dice and the income ring ───────────────────────────────────────────────── */
.ghost.bd-die-ghost { z-index: 820; }
.ghost.bd-die-ghost img { filter: none; border-radius: 9px; }
.ghost.bd-income-ring {
    z-index: 790; border-radius: 50%;
    border: 3px solid var(--ochre);
    box-shadow: 0 0 0 2px rgba(13, 31, 51, 0.75), 0 0 14px 3px rgba(211, 154, 58, 0.55);
}

/* ── Undo: a turned-back arrow beside End turn ─────────────────────────────────────────── */
#actions .btn.undo { flex: 0 0 auto; width: 48px; min-width: 48px; padding: 0; }
#actions .btn.undo svg { width: 22px; height: 22px; }
#actions .btn.undo:disabled { opacity: 0.45; }

/* the start screen's Rules is a real link now (to how-to-play/), still the same quiet underline */
a.st-link { display: inline-flex; align-items: center; }

/* ── The crawlable intro: in normal flow, a full screen below the fixed game ───────────── */
#intro {
    position: relative; z-index: 0; margin-top: 100vh; padding: 28px 20px 40px; max-width: 70ch;
    color: var(--lime); font-size: 16px; line-height: 1.5;
}
#intro h2 { font: 700 26px/1.1 var(--f-display); margin-bottom: 8px; }
#intro p + p { margin-top: 8px; }
#intro a { color: var(--lime); text-decoration-color: var(--ochre); text-underline-offset: 3px; }

@media (prefers-reduced-motion: reduce) {
    #bd-tip { transition: none; }
}

/* ── whose turn it is (user, 2026-11-16: no little die badge — make the current player clearer
   otherwise). The acting player's drawer is PULLED OUT of the chest a little, wears a thick ring
   (lime when it is a person at this device, ochre otherwise) and the other drawers recede. On the
   phone's chip row the same, without the slide. Nothing dims at game end (no drawer is current). */
/* the others recede by their PAINT only (critique 2026-11-16: an opacity of 0.58 took their numbers
   below 4.5:1): a dark wash over the panel and its band, quieter pictures, the text kept bright */
.drawer > *, .chip > .ch-l { position: relative; z-index: 1; }
.chip > .ch-marks, .chip > .ch-shops, .chip > .ch-fig { z-index: 1; }
.drawer::after, .chip::after {
    content: ''; position: absolute; inset: 0; pointer-events: none; z-index: 0;
    background: rgba(8, 19, 32, 0.42); opacity: 0; transition: opacity 0.35s ease;
}
#side:has(.drawer.current) .drawer:not(.current)::after,
#seats:has(.chip.current) .chip:not(.current)::after { opacity: 1; }
#side:has(.drawer.current) .drawer:not(.current) img,
#seats:has(.chip.current) .chip:not(.current) img { filter: saturate(0.7) brightness(0.86); }
#side:has(.drawer.current) .drawer:not(.current) .dr-name { color: rgba(242, 234, 216, 0.9); }
/* the "pulled out" drawer: the others sit 12px further in (#seats scrolls, so nothing may move
   outside it — a transform would be clipped) */
#side:has(.drawer.current) .drawer:not(.current) { margin-left: 12px; }
.drawer, .chip { transition: opacity 0.35s ease, filter 0.35s ease, margin 0.35s cubic-bezier(.22, 1, .36, 1), box-shadow 0.3s ease; }
#side .drawer.current {
    box-shadow: inset 0 0 0 4px var(--ochre), inset 0 0 0 6px rgba(13, 31, 51, 0.55), inset 0 0 0 7px rgba(211, 154, 58, 0.45);
}
#side .drawer.current.mine {
    box-shadow: inset 0 0 0 4px var(--lime), inset 0 0 0 6px rgba(13, 31, 51, 0.55), inset 0 0 0 7px rgba(242, 234, 216, 0.5);
}
#side .drawer.current .dr-name { color: #fffaf0; }
#seats .chip.current { box-shadow: inset 0 0 0 4px var(--ochre); }
#seats .chip.current.mine { box-shadow: inset 0 0 0 4px var(--lime); }
/* portrait tablets lay the drawers in a grid: no inset there, the ring and the dimming carry it */
body.tall #side:has(.drawer.current) .drawer:not(.current) { margin-left: 0; }
@media (prefers-reduced-motion: reduce) { .drawer, .chip { transition: none; } }

/* ════ Critique fixes 2026-11-16 (the table during play) ════════════════════════════════════ */

/* ── Numerals: Vollkorn sets old-style figures by default ("10" read "IO"). Every figure on the
   table is lining; the font shorthand resets font-variant-numeric, so the feature is also set by
   font-feature-settings, which the shorthand never touches and every element inherits. ──────── */
html { font-feature-settings: "lnum" 1; }
.dr-row, .chip, .ch-l, .log-gain, .ai-row, .ai-row .sc, #supply, #tray-supply, .total, .dr-proj, #bd-tip,
.end-table, .dchip, .tt .cnt, .dr-inn i, .dr-th i, .bd-gain { font-variant-numeric: tabular-nums lining-nums; }

/* ── The end, foreseen: churches (crown for the most), the town hall (−5 until one is held),
   "if it ended now", the end warning ───────────────────────────────────────────────────────── */
.dr-stat .ic, .dr-th .ic { width: 19px; height: 19px; display: block; flex: none; color: var(--lime); }
.dr-church { gap: 3px; }
.dr-church .crown { width: 15px; height: 13px; display: block; color: var(--ochre); margin-left: -1px; transform: translateY(-5px); }
.dr-church .crown svg { width: 100%; height: 100%; display: block; }
.dr-church.zero .ic { opacity: 0.7; }
.dr-th { position: relative; display: inline-flex; align-items: center; gap: 2px; white-space: nowrap; }
.dr-th i {
    position: absolute; right: -4px; bottom: -3px; font: 700 10px/1 var(--f-ui); font-style: normal;
    background: var(--chest-deep); color: var(--lime); padding: 1px 3px; border-radius: 3px;
}
.dr-th.open .ic { color: rgba(242, 234, 216, 0.8); }
.dr-th.done .ic { color: var(--ochre); }
/* the board's own "village full" seal, small, on a town hall that already pays */
.dr-th.done::before {
    content: ''; position: absolute; left: -4px; top: -4px; width: 11px; height: 11px; z-index: 1;
    background: center / contain no-repeat url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 40 40'%3E%3Ccircle cx='20' cy='20' r='17' fill='%23d39a3a' stroke='%239c6b22' stroke-width='2'/%3E%3Cpath d='M12 20.5l5.5 5.5L29 14' fill='none' stroke='%23142c45' stroke-width='4' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}
.dr-th + .dr-th { margin-left: 4px; }
.dr-th.none {
    padding: 1px 6px 1px 3px; color: var(--lime); background: #a83a26;
    clip-path: polygon(4px 0, calc(100% - 4px) 0, 100% 4px, 100% calc(100% - 4px), calc(100% - 4px) 100%, 4px 100%, 0 calc(100% - 4px), 0 4px);
}
.dr-th.none .ic { width: 16px; height: 16px; color: var(--lime); }
.dr-th.none b { font-weight: 800; font-size: 15px; }
.dr-proj {
    margin-left: auto; display: inline-flex; align-items: baseline; gap: 2px; white-space: nowrap;
    font-size: 15px; font-weight: 600; font-style: italic; color: rgba(242, 234, 216, 0.85);
}
.dr-proj small { font-size: 13px; font-weight: 400; }
.dr-head .dr-proj + .dr-shops { margin-left: 12px; }
.dr-head .dr-proj { flex: none; }
.dr-row { column-gap: 8px; }
.dr-proj.lead { color: var(--lime); font-weight: 800; text-decoration: underline; text-decoration-color: var(--ochre); text-decoration-thickness: 2px; text-underline-offset: 4px; }
.drawer.compact .dr-stat .ic, .drawer.compact .dr-th .ic { width: 17px; height: 17px; }
.drawer.compact .dr-proj { font-size: 14px; }
/* two figures or fewer: the count sits on an ochre plate (it warns; it does not invite a tap) */
.dr-stat.supply.low b { background: var(--ochre); color: var(--ink); padding: 0 5px; min-width: 20px; text-align: center; clip-path: polygon(3px 0, calc(100% - 3px) 0, 100% 3px, 100% calc(100% - 3px), calc(100% - 3px) 100%, 3px 100%, 0 calc(100% - 3px), 0 3px); }
.dr-stat.supply.low { opacity: 1; }
/* the opened drawer on a phone says its end marks in words (touch has no tooltip) */
.dr-legend { margin-top: 7px; padding-top: 6px; border-top: 1px dashed rgba(242, 234, 216, 0.3); font-size: 12.5px; line-height: 1.3; color: rgba(242, 234, 216, 0.9); }
.dr-legend p + p { margin-top: 2px; }

/* the end warning: a small plate by the tray, never over the villages */
#bd-endwarn { flex: 0 0 auto; display: flex; align-items: center; gap: 10px; padding: 8px 14px 9px 12px; }
#bd-endwarn img { width: 17px; height: 24px; flex: none; filter: drop-shadow(1px 1px 1px rgba(0, 0, 0, 0.5)); }
#bd-endwarn .ew-text { display: flex; flex-direction: column; min-width: 0; }
#bd-endwarn b { font-size: 16px; font-weight: 700; line-height: 1.2; }
#bd-endwarn small { font-size: 13px; font-style: italic; color: rgba(242, 234, 216, 0.86); }
body.tall #bd-endwarn { grid-column: 1 / span 2; grid-row: 3; }
body.tall #side:has(#bd-endwarn) #tray { grid-row: 4; }
body.tall #tray.acting #totals { min-height: 44px; }
@media (prefers-reduced-motion: no-preference) {
    #bd-endwarn { animation: ew-in 0.42s cubic-bezier(0.22, 1, 0.36, 1); transform-origin: center bottom; }
}
@keyframes ew-in { from { transform: scaleY(0.2); } }

/* ── Status, totals and the tray ─────────────────────────────────────────────────────────── */
.total { height: 44px; }
.total::before { content: none; }
/* while you act the chips keep two rows of room, so End turn never jumps when they re-wrap */
body:not(.phone) #tray.acting #totals { min-height: 94px; align-content: flex-start; }

/* a lit building's keyboard focus: the buttons' inset double ring, round */
.vg-ring:focus-visible::before { outline: none; box-shadow: 0 0 0 3px var(--chest-deep), 0 0 0 6px var(--ochre), 0 2px 8px rgba(0, 0, 0, 0.45); }

/* ── The log: names in lime-wash, the seat colour as the dot and the underline ──────────── */
.log-line .who { color: var(--lime); text-shadow: none; text-decoration: underline; text-decoration-color: var(--who); text-decoration-thickness: 2px; text-underline-offset: 3px; }
/* a panel's last line is never under the screen's edge */
.side-panel { max-height: calc(100dvh - var(--head-h) - 16px); scroll-padding-bottom: 18px; }
.side-panel > :last-child { padding-bottom: 6px; }

/* ── Big moments: the scoring plate at the board's foot, the factories glowing, coin pops,
   the kicked figure's vermilion beat ──────────────────────────────────────────────────────── */
#bd-toast { opacity: 1; transition: none; }
#bd-toast .plate, #bd-toast.show .plate { transform: none; transition: none; }
#bd-toast.anchored { display: block; }
#bd-toast.anchored .plate { padding: 12px 20px 13px; text-align: center; }
.bd-scoring-glow {
    position: fixed; z-index: 790; pointer-events: none; border-radius: 50%;
    border: 3px solid var(--ochre);
    box-shadow: 0 0 0 2px rgba(13, 31, 51, 0.75), 0 0 16px 5px rgba(211, 154, 58, 0.6), inset 0 0 12px 3px rgba(242, 234, 216, 0.45);
}
.ghost.bd-gain {
    z-index: 830; padding: 1px 7px 2px; white-space: nowrap;
    font: 800 18px/1.15 var(--f-ui); color: var(--lime);
    background: rgba(13, 31, 51, 0.82); box-shadow: inset 0 0 0 1.5px var(--ochre);
    clip-path: polygon(4px 0, calc(100% - 4px) 0, 100% 4px, 100% calc(100% - 4px), calc(100% - 4px) 100%, 4px 100%, 0 calc(100% - 4px), 0 4px);
}
.ghost.bd-knocked { z-index: 805; }

/* ── The end sheet: "See the table", the shelf beside it, a quieter strip ──────────────────── */
#bd-end[hidden] { display: none; }
.end-aside { display: flex; justify-content: center; align-items: center; gap: 4px 14px; flex-wrap: wrap; margin-top: 6px; }
.end-aside .end-ach { margin: 0; }
.end-look {
    display: flex; align-items: center; gap: 7px; min-height: 44px; padding: 0 12px;
    color: rgba(242, 234, 216, 0.86); font-size: 15px; border-radius: 6px;
}
.end-look svg { width: 22px; height: 22px; color: var(--ochre); }
.end-look span { text-decoration: underline; text-decoration-color: rgba(211, 154, 58, 0.6); text-underline-offset: 4px; }
@media (hover: hover) { .end-look:hover { color: var(--lime); background: var(--lime-faint); } }
.end-look:focus-visible { outline: none; box-shadow: inset 0 0 0 3px var(--ochre), inset 0 0 0 5px var(--chest-deep); }
#bd-end-back { position: fixed; z-index: 1100; transform: translate(-50%, -100%); min-width: 200px; box-shadow: 0 6px 18px rgba(3, 10, 20, 0.6); }
#bd-end .dk-more { --dk-more-ink: rgba(242, 234, 216, 0.8); max-width: 500px; margin: 10px auto 0; padding-top: 10px; }
#bd-end .dk-more-title { font-size: 13px; font-weight: 600; }
#bd-end .dk-more-row { gap: 6px; }
#bd-end .dk-more img { aspect-ratio: 16 / 7; }
#bd-end .dk-more-name { font-size: 11.5px; padding: 3px 5px 5px; }
#bd-end .dk-more-discord { font-size: 12px; }
.end-why { color: rgba(242, 234, 216, 0.88); }

/* ── THE PHONE (640×300 floor): a narrow column, the board ≈380 wide ───────────────────────── */
/* the header: the way back and four tools (the trophy shelf stays on the end sheet and the menu) */
body.phone .bd-name, body.phone #ach-btn { display: none; }
body.phone .bd-tools { margin-left: auto; }
/* the seat chips: one row, three lines each (coins, figures, ≈ if it ended now), the end marks and
   the held tiles down the right edge, the shops along the foot */
body.phone #seats .chip { height: 56px; padding: 3px 12px 12px 5px; justify-content: flex-start; gap: 0; }
body.phone .chip .ch-l { line-height: 13.5px; font-size: 13px; }
body.phone .chip .ch-l img { height: 12px; }
body.phone .chip .ch-l.low { color: #f6c46a; }
body.phone .chip .ch-proj { font-weight: 600; font-style: italic; color: rgba(242, 234, 216, 0.85); gap: 1px; }
body.phone .chip .ch-proj small { font-size: 11px; font-weight: 400; }
body.phone .chip .ch-proj.lead { color: var(--lime); font-weight: 800; text-decoration: underline; text-decoration-color: var(--ochre); text-underline-offset: 2px; }
body.phone .chip .ch-marks { flex-direction: column; align-items: center; top: 3px; right: 2px; gap: 1px; }
body.phone .chip .ch-marks img { height: 10px; }
.ch-crown { display: block; width: 10px; height: 9px; color: var(--ochre); }
.ch-crown svg { width: 100%; height: 100%; display: block; }
.ch-noth { display: block; font: 800 9px/10px var(--f-ui); color: var(--lime); background: #a83a26; padding: 0 1px; border-radius: 2px; }
/* the dice tray as a grid: four dice + the supplies / the totals in ONE row / the bishop and the
   re-roll tile + Undo, Re-roll and End as icon buttons */
body.phone #tray {
    display: grid; grid-template-columns: 91px minmax(0, 1fr) 44px; column-gap: 3px; row-gap: 5px;
    grid-template-areas: "dice dice sup" "tot tot tot" "tiles act act"; padding: 6px;
}
body.phone #tray-row { display: contents; }
body.phone #dice { grid-area: dice; gap: 3px; }
body.phone #tray-supply { grid-area: sup; display: flex; flex-direction: column; justify-content: center; gap: 0; font-size: 11.5px; font-weight: 700; line-height: 14px; color: rgba(242, 234, 216, 0.9); }
body.phone #tray-supply .sp { display: flex; align-items: center; gap: 3px; white-space: nowrap; }
body.phone #tray-supply img { height: 12px; width: 12px; object-fit: contain; filter: drop-shadow(0 1px 1px rgba(0, 0, 0, 0.5)); }
#tray-supply:empty { display: none; }
body.phone #totals { grid-area: tot; margin: 0; height: 44px; min-height: 44px; max-height: none; flex-wrap: nowrap; overflow-x: auto; overflow-y: hidden; scrollbar-width: none; gap: 4px; padding: 0; }
body.phone #totals::-webkit-scrollbar { display: none; }
body.phone #totals .total.clip { visibility: hidden; }
/* more totals to the right: an ochre chevron at the row's end (swipe the row) */
body.phone #tray { position: relative; }
body.phone #tray.totals-more::after {
    content: ''; position: absolute; right: 0; top: 55px; width: 14px; height: 44px; pointer-events: none;
    background: var(--ochre);
    -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 14 44'%3E%3Cpath d='M4 14l6 8-6 8' fill='none' stroke='%23000' stroke-width='2.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / contain no-repeat;
    mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 14 44'%3E%3Cpath d='M4 14l6 8-6 8' fill='none' stroke='%23000' stroke-width='2.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / contain no-repeat;
}body.phone #totals:empty { display: flex; }
body.phone #totals .total { height: 44px; }
body.phone #tray-tiles { grid-area: tiles; margin: 0; gap: 3px; }
body.phone #actions { grid-area: act; margin: 0; gap: 3px; justify-content: flex-end; min-width: 0; }
body.phone #actions:empty { display: flex; }
body.phone #actions .btn { flex: 0 0 44px; width: 44px; min-width: 44px; padding: 0; }
body.phone #actions .btn .lbl { display: none; }
body.phone #actions .btn[data-act="end"], body.phone #actions .btn[data-act="rerollGo"] { flex: 1 1 44px; width: auto; }
body.phone #actions .btn svg { width: 22px; height: 22px; }
/* the end warning on the phone: one tight line (the reason lives in the opened drawer) */
body.phone #bd-endwarn { padding: 4px 9px 5px 8px; gap: 6px; }
body.phone #bd-endwarn img { width: 11px; height: 16px; }
body.phone #bd-endwarn b { font-size: 12.5px; line-height: 1.15; }
body.phone #bd-endwarn small { display: none; }
body.phone .side-panel { width: min(420px, calc(100vw - 266px)); max-height: calc(100dvh - 12px); padding-bottom: 18px; }
body.phone .ach-note { max-width: min(330px, calc(100vw - 266px)); }
/* the scoring plate on the phone stands over the idle dice tray, its type a step smaller */
body.phone #bd-toast.anchored .plate { padding: 9px 12px 10px; }
body.phone #bd-toast.anchored .pl-pics img { height: 28px; }
body.phone #bd-toast.anchored .pl-pics { margin-bottom: 4px; }
body.phone #bd-toast.anchored .pl-title { font-size: 19px; }
body.phone #bd-toast.anchored .pl-line { font-size: 13px; line-height: 1.3; }
.end-btns.with-aside { gap: 6px; align-items: center; flex-wrap: nowrap; }
.end-btns.with-aside .btn { min-width: 0; padding: 0 16px; }
.end-btns.with-aside .end-ach { margin: 0; padding: 0 8px; }
.end-btns.with-aside .end-ach small { display: none; }
.end-btns.with-aside .end-look { padding: 0 8px; }

/* farms held (user 2026-11-18): drawn like the church count; on a chip it shares the figures' line */
.dr-farm { gap: 3px; }
.dr-farm.zero .ic { opacity: 0.7; }
.chip .ch-row { display: flex; align-items: center; gap: 5px; position: relative; z-index: 1; }
.chip .ch-farm { gap: 2px; }
.chip .ch-farm .ic { width: 13px; height: 13px; display: block; flex: none; color: var(--lime); }
.chip .ch-farm.zero { opacity: 0.5; }
body.phone .chip .ch-row { gap: 3px; }
body.phone .chip .ch-farm .ic { width: 11px; height: 11px; }

/* the end sheet's three ways (user 2026-11-18): new game, look at the table, menu — one row, wrapping */
.end-btns { flex-wrap: wrap; }
.end-btns .btn.end-look-btn svg { color: var(--ochre); }
.end-btns:not(.with-aside) .btn { min-width: 160px; }

/* ── The 3D table (board3d.js, user 2026-11-18) ── the canvas takes the board's room; the 2D board
   stays laid out underneath (hidden), so its zoom and every DOM measure keep working */
#bd-3d { position: absolute; z-index: 0; touch-action: none; cursor: grab; }
#bd-3d:active { cursor: grabbing; }
#bd-3d[hidden] { display: none; }
#bd-3d canvas { display: block; width: 100%; height: 100%; }
body.view3d #board, body.view3d #board-frame { visibility: hidden; }
/* the switch says the view it leads to: "3D" / "2D", in the header's ink */
.tool.view-tool { font: 800 15px/1 var(--f-ui); letter-spacing: 0.02em; }
.tool.view-tool[hidden] { display: none; }
