:root {
  color-scheme: light;
  font-family: "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  background: #f4efe4;
  color: #282a23;
  --ink: #282a23;
  --sub: #504d40;
  --paper: #fbf7ed;
  --line: #ded4bf;
  --accent: #a13829;
  --accent-dark: #83291f;
  font-synthesis: none;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; }
html, body { overflow: hidden; overscroll-behavior: none; }
button, input, a { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: default; opacity: .6; }
a { color: inherit; text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: .25em; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; }
.kitchen { width: min(1180px, calc(100% - 64px)); margin: auto; }
.masthead { display: flex; align-items: center; justify-content: space-between; height: 66px; border-bottom: 1px solid var(--line); }
.brand { display: inline-flex; align-items: center; gap: .65rem; font-size: .81rem; font-weight: 650; letter-spacing: .1em; }
.brand:hover { text-decoration: none; }
.brand img { display: block; width: 26px; height: 26px; border-radius: 5px; }
.masthead-end { display: flex; align-items: center; gap: 14px; }
.games-link { color: var(--sub); font-size: .85rem; }
.heading { display: flex; justify-content: space-between; align-items: end; gap: 20px; padding: 30px 0 22px; }
h1, h2 { font-family: "Songti SC", "Noto Serif SC", SimSun, serif; margin: 0; }
h1 { font-size: clamp(2.7rem, 6.4vw, 4.7rem); line-height: 1; font-weight: 800; letter-spacing: .025em; }
.stages { list-style: none; display: flex; gap: 16px; font-size: .82rem; padding: 0; margin: 0 0 4px; color: var(--sub); white-space: nowrap; }
.stages li:not(:last-child)::after { content: "·"; padding-left: 16px; color: #968873; }
.stages [aria-current] { color: var(--accent-dark); font-weight: 800; }
.workbench { display: grid; grid-template-columns: minmax(0, 2.18fr) minmax(268px, 1fr); min-height: 445px; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; background: var(--paper); }
.stage { position: relative; overflow: hidden; isolation: isolate; min-height: 445px; background: #ae8060; }
.music-control, .music-status { position: absolute; z-index: 3; right: 12px; border-radius: 6px; }
.music-control { top: 12px; min-height: 44px; padding: 0 13px; border: 1px solid #e6d8bc;
  background: #312a21; color: #fff4e1; font-size: .82rem; font-weight: 700; }
.music-control:hover { background: #493a2b; }
.music-control[aria-pressed="true"] { background: #fbf4e5; color: #4d3124; }
.music-control:focus-visible { outline-color: #fff5df; }
.music-status { top: 62px; max-width: min(240px, calc(100% - 24px)); margin: 0; padding: 7px 10px;
  background: #312a21; color: #fff4e1; font-size: .74rem; line-height: 1.45; }
.scene { position: absolute; inset: 0; }
.scene canvas { display: block; width: 100%; height: 100%; touch-action: pan-y; }
.gesture-zones { position: absolute; inset: 0; z-index: 1; pointer-events: none; }
.gesture-zone { position: absolute; cursor: grab; pointer-events: auto; touch-action: none; }
.gesture-zone:active { cursor: grabbing; }
[data-gesture="pinch"] { cursor: crosshair; }
[data-phase="result"] canvas { cursor: grab; touch-action: pan-y; }
/* While a piece is pulled off the dough log, a finger sliding on the board must not scroll the page: the
   browser would cancel the press and the piece would tear off at once, small. */
[data-dough="pull"] canvas { touch-action: none; cursor: grab; }
[data-phase="result"] canvas:active { cursor: grabbing; }
.scene canvas:focus-visible { outline-offset: -5px; outline-color: #fff1d5; }
.scene-tag { position: absolute; pointer-events: none; bottom: 18px; left: 18px; margin: 0; color: #fff5e7; background: #36291fbd; border-radius: 5px; padding: 6px 9px; font-size: .73rem; letter-spacing: .06em; }
.scene-tag:empty { display: none; }
/* While the kitchen loads: a quiet note in the middle of the stage, clear of the masthead. */
#loading { position: absolute; z-index: 2; left: 50%; top: 50%; transform: translate(-50%, -50%); margin: 0; padding: 9px 16px; border-radius: 999px; background: rgba(40, 30, 22, .45); color: #fff4e4; font-size: .9rem; white-space: nowrap; }
.pinch-guide { position: absolute; pointer-events: none; inset: 0; }
[data-phase="pinch"] .pinch-guide { animation: find-seam 150ms 230ms both; }
@keyframes find-seam { from { opacity: 0; } to { opacity: 1; } }
@media (prefers-reduced-motion: reduce) {
  [data-phase="pinch"] .pinch-guide { animation: none; }
}
.pinch-guide span { position: absolute; width: 20px; height: 20px; border: 2px solid #fff1d4; border-radius: 50%; transform: translate(-50%, -50%); box-shadow: 0 0 0 2px #802e28; }
.actions { display: flex; flex-direction: column; gap: 22px; border-left: 1px solid var(--line); padding: clamp(19px, 3vw, 37px); }
.slots { display: flex; flex-wrap: wrap; gap: clamp(8px, 2.2vw, 13px); }
.slot { display: inline-flex; align-items: center; justify-content: center; white-space: nowrap;
  min-width: 60px; min-height: 37px; padding: 5px 10px; letter-spacing: .025em;
  border-radius: 6px; background: #eee7d7; border: 1px solid transparent; color: #675f50; font-size: .79rem; }
.slot[aria-current] { border-color: #ab4b39; background: #f5e1cf; color: #7b2d23; font-weight: 700; }
.slot[data-filled] { color: #71372a; }
.instruction h2, dialog h2 { font-size: clamp(1.44rem, 2.5vw, 2rem); line-height: 1.3; letter-spacing: .02em; }
.instruction p, .result-detail { color: var(--sub); line-height: 1.63; margin: 9px 0 0; font-size: .9rem; }
.shared-note { margin: 0; padding: 10px 13px; border-radius: 6px; background: #f3e3d3; color: #71372a; font-size: .88rem; line-height: 1.55; }
.instruction .result-score.is-legend { color: #9a7322; background: linear-gradient(180deg, #d0a345, #8a6417); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }
.legend-seal { display: inline-block; margin-left: 12px; padding: 2px 9px 3px; background: #fbf1d6; border: 1.5px solid #c49a3a; color: #9a7322; -webkit-text-fill-color: #9a7322; font-size: .95rem; letter-spacing: .08em; border-radius: 2px; transform: rotate(-3deg); vertical-align: 3px; }
/* The same switch as the food quiz's share dialog: whether the share card carries its QR code. */
.share-qr { display: flex; align-items: center; justify-content: center; gap: 8px; margin: 12px 0 0; color: var(--sub); font-size: .8rem; cursor: pointer; user-select: none; }
.share-qr b { font-weight: inherit; }
.share-qr small { margin-left: 6px; font-size: inherit; opacity: .8; }
.share-qr small::before { content: "· "; }
.share-qr input { appearance: none; -webkit-appearance: none; position: relative; flex: none; width: 32px; height: 18px; margin: 0; border-radius: 999px; background: #c8bfb0; cursor: pointer; transition: background .15s ease; }
.share-qr input::after { content: ""; position: absolute; top: 2px; left: 2px; width: 14px; height: 14px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0, 0, 0, .2); transition: transform .15s ease; }
.share-qr input:checked { background: var(--accent); }
.share-qr input:checked::after { transform: translateX(14px); }
.share-qr input:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.title-part { display: inline-block; }
.instruction .result-score { margin: 4px 0 0; color: var(--accent); font-family: "Songti SC", SimSun, serif; font-size: 1.5rem; font-weight: 700; letter-spacing: .04em; }
.instruction .result-line { color: #71372a; font-family: "Songti SC", SimSun, serif; font-size: 1.28rem; line-height: 1.5; font-weight: 650; }
.buttons { display: flex; flex-wrap: wrap; column-gap: 10px; row-gap: 9px; margin-top: auto; }
.buttons > button { width: 100%; }
button.primary { display: flex; justify-content: space-between; align-items: center; border: 0; min-height: 46px; padding: 10px 15px; border-radius: 6px; background: var(--accent); color: #fff8ee; font-weight: 650; font-size: .91rem; }
button.primary:hover { background: var(--accent-dark); }
button.quiet { min-height: 42px; padding: 8px 11px; background: transparent; border: 1px solid var(--line); color: var(--ink); border-radius: 5px; font-size: .8rem; }
/* Buttons side by side in the panel share one size, so the second choice does not look like an afterthought. */
.buttons > button.quiet { min-height: 46px; padding: 10px 15px; border-radius: 6px; font-size: .86rem; text-align: left; }
button.quiet:hover { border-color: #a94b3b; }
.feedback { margin: -10px 0 0; color: #6f3329; font-size: .8rem; }
.feedback:empty { display: none; }
.result-detail summary { cursor: pointer; padding-block: 4px; }
.result-detail p { margin: 4px 0 0; }
.result-detail { border-top: 1px solid var(--line); margin: 0; padding-top: 13px; }
.read-more { color: var(--sub); font-size: .82rem; }
/* On the result card the remark, the tip and the link to the dish are read, not glanced at: a size up. */
.workbench:has([data-phase="result"]) .result-detail { font-size: 1rem; }
.workbench:has([data-phase="result"]) .read-more { font-size: .95rem; }
dialog { width: min(460px, calc(100% - 28px)); border: 1px solid var(--line); color: var(--ink); border-radius: 12px; background: var(--paper); padding: 27px; }
dialog form { position: relative; }
dialog .close { position: absolute; top: -7px; right: -7px; }
/* How to play: each step's name in a narrow column, its line beside it, all in one ink colour. */
.how-to { max-height: calc(100dvh - 24px); overflow: auto; }
.how-to h2 { margin: 0 44px 0 0; }
.how-to h2:focus { outline: none; }
.how-to .close { top: -9px; right: -9px; width: 34px; min-height: 34px; padding: 0; border-radius: 50%; font-size: 1rem; }
.steps { margin: 16px 0 0; }
.steps > div { display: grid; grid-template-columns: 2.6em 1fr; gap: 10px; padding: 6px 0; line-height: 1.6; }
.steps dt { font-weight: 700; }
.steps dd { margin: 0; color: var(--sub); }
.secret { margin: 18px 0 16px; padding: 12px 16px 13px; border-radius: 8px; background: #f2ebdc; }
.secret h3 { margin: 0; font-size: .86rem; color: var(--accent-dark); letter-spacing: .04em; }
.secret .steps { margin-top: 6px; }
.secret .steps > div { padding: 4px 0; font-size: .92rem; }
/* The hidden ending is its own rumour, apart from the folds, so it does not hint how to get there. */
.rumor { margin: 6px 0 0; color: var(--sub); font-size: .86rem; }
/* The keys are read out to screen readers; sighted players use the mouse or a finger. */
.keys { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
/* 晒一晒: the card first, scaled so the whole of it shows with the title and buttons on any screen. */
.share-dialog { width: min(560px, calc(100% - 24px)); max-height: calc(100dvh - 24px); overflow: auto; padding: 22px 22px 20px; }
.share-dialog::backdrop { background: rgba(20, 18, 15, .6); }
.share-dialog .close { position: absolute; top: 12px; right: 12px; min-height: 34px; width: 34px; padding: 0; }
.share-dialog h2 { margin: 0 40px 4px 0; }
.share-hint { margin: 0 0 12px; color: var(--sub); font-size: .84rem; line-height: 1.55; }
.share-hint span { display: inline-block; }
.share-hint[hidden] { display: none; }
.share-preview { display: grid; place-items: center; min-height: 200px; padding: 8px; border-radius: 10px; background: #ece4d5; color: var(--sub); font-size: .86rem; }
.share-preview img { display: block; width: 100%; max-height: max(180px, calc(100dvh - 300px)); object-fit: contain; border-radius: 4px; box-shadow: 0 2px 10px rgba(60, 40, 20, .18); -webkit-touch-callout: default; }
.share-press { display: flex; align-items: center; justify-content: center; gap: 8px; width: fit-content; max-width: 100%; margin: 12px auto 0; padding: 8px 15px; border-radius: 999px; background: rgba(161, 56, 41, .1); color: var(--accent-dark); font-size: .9rem; font-weight: 600; }
.share-press[hidden] { display: none; }
.share-press .ring { transform-origin: 10px 10px; animation: press-ring 1.6s ease-out 3; }
@keyframes press-ring { 0% { opacity: .9; transform: scale(.7); } 70%, 100% { opacity: 0; transform: scale(1.15); } }
@media (prefers-reduced-motion: reduce) { .share-press .ring { animation: none; } }
.share-buttons { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 16px; }
/* English page: posting to X is the main way to share, so it takes the whole first row. */
.share-buttons > .share-x { flex-basis: 100%; justify-content: center; text-align: center; min-height: 48px; border: 0; border-radius: 6px; background: #14171a; color: #fff; font-size: .95rem; font-weight: 700; }
.share-buttons > .share-x:hover { background: #000; }
a.button.quiet { display: flex; align-items: center; justify-content: center; min-height: 46px; padding: 10px 15px; border: 1px solid var(--line); border-radius: 6px; color: var(--ink); font-size: .88rem; text-decoration: none; }
a.button.quiet:hover { border-color: #a94b3b; }
.share-buttons[hidden] { display: none; }
.share-buttons > * { flex: 1; justify-content: center; text-align: center; min-height: 46px; }
.share-buttons > [hidden] { display: none; }
a.button.primary { display: flex; align-items: center; justify-content: center; min-height: 46px; padding: 10px 15px; border-radius: 6px; background: var(--accent); color: #fff8ee; font-weight: 650; font-size: .91rem; text-decoration: none; }
a.button.primary:hover { background: var(--accent-dark); }
.share-buttons > button.quiet { border-radius: 6px; font-size: .88rem; }
/* The game fills the window, as the dashimaki game does, with no page to scroll: the site's logo, the
   title and the steps sit small at the top left, the games link, help and sound at the top right, and
   the current dumpling, the step and its buttons in a small see-through group at the bottom left. The
   foot of the window stays clear: when a bottom ad runs, set --ad-band to its height and the board ends
   above it, carrying the buttons with it. The verdict comes up as a card over the board's right side
   (at the bottom on phones, next block). */
:root { --ad-band: 0px; --card-floor: 0px; }
/* Where the site runs ads (html.has-ads), the bottom anchor arrives a moment after the first result,
   and the board shrinks above it. So that it does not push the result card and its buttons up under a
   thumb, the card already stands as high as it will with the anchor there (--card-floor: about an
   anchor with its tab) and keeps that place whether the anchor comes or not; below it the board shows. */
html.has-ads { --card-floor: 120px; }
.kitchen { position: relative; width: 100%; }
.workbench { display: block; position: relative; border: 0; border-radius: 0; }
.stage { height: calc(100svh - var(--ad-band)); min-height: 320px; }
.masthead { position: absolute; z-index: 6; top: 0; left: 0; right: 0; height: 56px; padding: 0 16px; border: 0; pointer-events: none; }
.masthead > * { pointer-events: auto; }
.brand, .games-link { color: #fff7ea; text-shadow: 0 1px 3px rgba(30, 20, 10, .45); }
.masthead .help, .music-control, .masthead .games-link { min-height: 36px; border: 1px solid rgba(255, 255, 255, .4); background: rgba(255, 250, 240, .28); color: #fff7ea;
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); }
.music-control[aria-pressed="true"] { background: rgba(255, 250, 240, .28); color: #fff7ea; }
.music-control:hover, .masthead .help:hover, .masthead .games-link:hover { background: rgba(255, 250, 240, .42); }
/* Back to the games page: a pill like the sound button, so it reads as a way out, not a caption. */
.masthead .games-link { white-space: nowrap; display: inline-flex; align-items: center; gap: 4px; padding: 0 13px 0 10px; border-radius: 999px; font-size: .82rem; font-weight: 600; text-decoration: none; text-shadow: none; }
.masthead .games-link::before { content: "‹"; font-size: 1.15rem; line-height: 1; margin-top: -2px; }
/* The language picker and the sound switch sit side by side under the masthead, on phones too. The
   picker is a pill showing the language in use; the real select lies over it, invisible, so a tap
   opens the system's own list of languages. */
.stage-tools { position: absolute; z-index: 3; top: 64px; right: 16px; display: flex; align-items: center; gap: 8px; }
.stage-tools .music-control { position: static; }
.lang-pick { position: relative; display: inline-flex; align-items: center; gap: 5px; min-height: 36px; padding: 0 11px 0 9px; border: 1px solid rgba(255, 255, 255, .4); border-radius: 999px;
  background: rgba(255, 250, 240, .28); color: #fff7ea; font-size: .8rem; font-weight: 700; white-space: nowrap; -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); }
.lang-pick:hover { background: rgba(255, 250, 240, .42); }
.lang-pick:focus-within { outline: 2px solid #fff5df; outline-offset: 2px; }
.lang-pick svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.6; }
.lang-pick::after { content: ""; width: 6px; height: 6px; margin: -3px 0 0 1px; border: solid currentColor; border-width: 0 1.5px 1.5px 0; transform: rotate(45deg); }
.lang-pick select { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; font-size: 16px; }
/* Help is one round "?" at the top right, as in the dashimaki game. */
.masthead .help { width: 36px; min-width: 36px; padding: 0; border-radius: 50%; font-weight: 700; font-size: .95rem; }
/* While playing, the group holds only which dumpling it is and the buttons: no step name, no hints.
   The steps along the top left already say where the game is. */
.workbench:not(:has([data-phase="result"])) .instruction { display: none; }
.heading { position: absolute; z-index: 6; top: 52px; left: 16px; display: block; padding: 0; pointer-events: none; }
h1 { font-size: 1.7rem; color: #fff7ea; text-shadow: 0 1px 4px rgba(30, 20, 10, .45); }
.stages { margin-top: 8px; gap: 10px; font-size: .76rem; color: rgba(255, 247, 234, .85); text-shadow: 0 1px 3px rgba(30, 20, 10, .5); }
.stages li:not(:last-child)::after { padding-left: 10px; color: rgba(255, 247, 234, .6); }
.stages [aria-current] { color: #fff7ea; }
.actions { position: absolute; z-index: 4; left: 16px; bottom: 16px; width: 264px; flex-direction: column; align-items: stretch; gap: 10px;
  padding: 12px; border: 1px solid rgba(255, 255, 255, .38); border-left: 1px solid rgba(255, 255, 255, .38); border-radius: 12px;
  background: rgba(255, 250, 240, .3); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); }
.actions .slots { flex-wrap: nowrap; gap: 5px; }
/* Wide enough for the longest label ("Dumpling 1", bold when current) in Safari's wider text, with an
   ellipsis rather than spilling over the edge should a label still not fit. */
.actions .slot { flex: 1; min-width: 0; min-height: 28px; padding: 3px 2px; overflow: hidden; text-overflow: ellipsis; background: rgba(255, 250, 240, .55); font-size: .74rem; }
.actions .slot[aria-current] { background: #f5e1cf; }
.actions .instruction h2 { font-size: 1.2rem; }
.actions .buttons { flex-direction: column; margin: 0; }
.actions .buttons > button { width: 100%; }
.actions .buttons > button.quiet { background: rgba(255, 250, 240, .6); border-color: rgba(255, 255, 255, .5); }
.actions .shared-note, .actions .feedback { margin: 0; }
.workbench:has([data-phase="result"]) .actions { top: 108px; bottom: calc(16px + max(var(--card-floor), var(--ad-band)) - var(--ad-band)); left: auto; right: 16px; width: clamp(300px, 30%, 380px); gap: 14px; padding: 22px; overflow-y: auto;
  border-color: rgba(255, 255, 255, .55); background: var(--result-card); box-shadow: 0 6px 24px rgba(40, 25, 10, .18); }
.workbench:has([data-phase="result"]) .instruction h2 { font-size: clamp(1.3rem, 2vw, 1.7rem); }
.workbench:has([data-phase="result"]) .slots { display: none; }
.workbench:has([data-phase="result"]) .buttons { margin: auto 0 0; }
/* From the plating on, the 3D view reaches past the board's left edge by the card's width, so the
   camera centres the plate in the space left of the card instead of behind it. */
[data-phase="reveal"] .scene, [data-phase="result"] .scene { left: calc(-1 * clamp(300px, 30%, 380px) - 32px); }
/* On a short window (a laptop with the bookmarks bar and a banner open) the card cannot hold everything,
   so its buttons stay pinned to its foot and only the words above them scroll, under a short fade. The
   card is opaque so that the pinned strip matches it. Below 700px of height it tightens and the two
   buttons sit side by side. */
:root { --result-card: rgb(244, 240, 230); }
@media (min-width: 741px) {
  .workbench:has([data-phase="result"]) .read-more, .workbench:has([data-phase="result"]) .feedback { order: 1; }
  .workbench:has([data-phase="result"]) .buttons { order: 2; position: sticky; bottom: -22px; z-index: 1; margin: auto -22px -22px; padding: 12px 22px 22px; background: var(--result-card); border-radius: 0 0 12px 12px; }
  .workbench:has([data-phase="result"]) .buttons::before { content: ""; position: absolute; left: 0; right: 0; bottom: 100%; height: 18px; background: linear-gradient(rgb(244 240 230 / 0), var(--result-card)); pointer-events: none; }
}
@media (min-width: 741px) and (max-height: 700px) {
  .workbench:has([data-phase="result"]) .actions { gap: 10px; padding: 16px 18px; }
  .workbench:has([data-phase="result"]) .instruction h2 { font-size: 1.25rem; line-height: 1.3; }
  .workbench:has([data-phase="result"]) .result-score { font-size: 1.2rem; }
  .workbench:has([data-phase="result"]) .result-line { font-size: 1.1rem; line-height: 1.5; }
  .workbench:has([data-phase="result"]) .result-detail { font-size: .92rem; line-height: 1.5; padding-top: 8px; }
  .workbench:has([data-phase="result"]) .buttons { flex-direction: row; bottom: -16px; margin: auto -18px -16px; padding: 10px 18px 16px; }
  .workbench:has([data-phase="result"]) .buttons > button { flex: 1 1 auto; width: auto; min-height: 40px; padding: 8px 12px; }
}
@media (max-width: 740px) {
  .masthead { height: 48px; padding: 0 12px; }
  .masthead-end { gap: 6px; }
  .brand { white-space: nowrap; font-size: .82rem; letter-spacing: .02em; gap: .5rem; }
  .masthead .games-link { padding: 0 11px 0 8px; }
  .heading { top: 44px; left: 12px; }
  h1 { font-size: 1.35rem; }
  .stages { margin-top: 6px; gap: 7px; font-size: .7rem; }
  .stages li:not(:last-child)::after { padding-left: 7px; }
  /* Below the title and steps, not beside them: in Spanish or Portuguese the steps run wider. */
  .stage-tools { top: 98px; right: 12px; gap: 6px; }
  /* Below the result card, where the anchor ad's place is kept, the dark of the table's front, not a tan band. */
  .stage { min-height: 0; background: #24150e; }
  .actions { left: 12px; bottom: 12px; width: min(260px, calc(100% - 24px)); gap: 8px; padding: 10px; }
  .actions .instruction h2 { font-size: 1.05rem; }
  .actions .buttons { flex-direction: row; }
  .actions .buttons > button { flex: 1; width: auto; min-height: 42px; padding: 8px 12px; }
  .actions .buttons > .primary { flex: 2; }
  /* The verdict takes the lower half and the plate moves into the upper half. */
  /* Compact, so the whole card (both buttons and the link) fits even when a bottom ad takes its band. */
  html.has-ads { --card-floor: 170px; }
  .workbench:has([data-phase="result"]) .actions { top: auto; left: 10px; right: 10px; bottom: calc(10px + max(var(--card-floor), var(--ad-band)) - var(--ad-band)); width: auto; max-height: 60%; gap: 8px; padding: 14px 14px 12px; }
  .workbench:has([data-phase="result"]) .instruction h2 { font-size: 1.15rem; line-height: 1.35; }
  .workbench:has([data-phase="result"]) .result-score { font-size: 1.2rem; }
  .workbench:has([data-phase="result"]) .result-line { font-size: 1.05rem; line-height: 1.5; }
  .workbench:has([data-phase="result"]) .result-detail { font-size: .88rem; line-height: 1.5; padding-top: 8px; }
  .workbench:has([data-phase="result"]) .buttons { flex-direction: row; }
  /* Share and play again side by side, as wide as each other: the colour already says which comes first,
     and a narrow second button wraps its words onto two lines. */
  .workbench:has([data-phase="result"]) .buttons > button { flex: 1 1 0; min-height: 40px; }
  .workbench:has([data-phase="result"]) .read-more { font-size: .88rem; }
  /* While the plate is served there is no card yet, so the kitchen fills the window. When the card comes
     up, the scene draws back to just under the card's top edge (--card-height comes from game.js), so no
     empty band is left between the plate and the card. It is laid out as it will be with the anchor ad
     there, so the plate does not move either when the ad arrives (see --card-floor). */
  [data-phase="reveal"] .scene, [data-phase="result"] .scene { left: 0; bottom: 0; transition: bottom .5s cubic-bezier(.2, .7, .2, 1); }
  [data-phase="result"] .scene { bottom: calc(var(--card-height, 40svh) - 4px + max(var(--card-floor), var(--ad-band)) - var(--ad-band)); }
  .workbench:has([data-phase="result"]) .scene-tag { top: auto; bottom: calc(60% + 20px); }
}
@media (hover: none) and (pointer: coarse) { .keys { display: none; } }
/* While the dumplings boil: cold water and scooping side by side, the pour first. */
.workbench:has([data-phase="cook"]) .buttons, .workbench:has([data-phase="cook"]) .actions .buttons { flex-direction: row; flex-wrap: nowrap; }
.workbench:has([data-phase="cook"]) .buttons > button { flex: 1 1 0; width: auto; }
.workbench:has([data-phase="cook"]) #secondary { order: -1; text-align: center; }

/* 三开三点水: the boil chips light up as each pour goes in, in the colour of how it was timed, and the
   call over the pot says it in words (game.js, sayOverPot). */
.slot[data-grade="spotOn"] { border-color: #5f7d3a; background: #e3ecd2; color: #3d5523; font-weight: 700; }
.slot[data-grade="close"] { border-color: #b08a3c; background: #f3e7c8; color: #6b4f17; }
.slot[data-grade="spilled"] { border-color: #a9493a; background: #f3d8cf; color: #7b2d23; }
.actions .slot[data-grade="spotOn"] { background: #e3ecd2; }
.actions .slot[data-grade="close"] { background: #f3e7c8; }
.actions .slot[data-grade="spilled"] { background: #f3d8cf; }
.pot-call { position: absolute; z-index: 2; left: 50%; top: 30%; margin: 0; padding: 8px 16px; width: max-content; max-width: min(88%, 420px);
  transform: translate(-50%, 8px); opacity: 0; pointer-events: none; white-space: pre-line; text-align: center;
  border-radius: 999px; background: rgba(38, 26, 19, .82); color: #fff5e7; font-weight: 700; font-size: 1.15rem; line-height: 1.35;
  transition: opacity .18s ease, transform .18s ease; }
.pot-call.is-shown { opacity: 1; transform: translate(-50%, 0); }
.pot-call[data-grade="spotOn"] { color: #d9f0b4; }
.pot-call[data-grade="close"] { color: #ffe3a3; }
.pot-call[data-grade="spilled"], .pot-call[data-grade="early"] { color: #ffc2b3; }
.pot-call[data-grade] { border-radius: 18px; }
@media (prefers-reduced-motion: reduce) { .pot-call { transition: none; transform: translate(-50%, 0); } }
