/* Distinct play surfaces for one ruleset. The ingredient drawings are shared. */
:root {
  color-scheme: light;
  font-family: system-ui, sans-serif;
  font-synthesis: none;
  -webkit-font-smoothing: antialiased;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }

body {
  --ink: #3b2a24;
  --muted: #966a58;
  --paper: #fff4d9;
  --paper-alt: #ffe4a7;
  --line: #9d6249;
  --focus: #9f391c;
  --accent: #ce5934;
  --accent-light: #ffc748;
  --wash: #f2b86a;
  --body-bg: #c8744d;
  --tray-bg: #6b3e34;
  --tile: #fff1cf;
  --tile-other: #fce8c0;
  --tile-edge: #d29a6a;
  --well: #ca9268;
  --shop-pad: clamp(11px, 4.7vw, 23px);
  margin: 0;
  min-width: 0;
  min-height: 100vh;
  color: var(--ink);
  background: var(--body-bg);
  overscroll-behavior-y: contain;
}

body[data-layout="b"] {
  --ink: #193f36;
  --muted: #527068;
  --paper: #fffdf0;
  --paper-alt: #e1ead5;
  --line: #82a891;
  --focus: #155e58;
  --accent: #16746a;
  --accent-light: #ffc86c;
  --wash: #bdcbb2;
  --body-bg: #a3b6a3;
  --tray-bg: #316b62;
  --tile: #eaf5e4;
  --tile-other: #eef0e3;
  --tile-edge: #9ab6aa;
  --well: #93a9a0;
  --shop-pad: clamp(9px, 3vw, 17px);
}

body[data-layout="c"] {
  color-scheme: dark;
  --ink: #f5eed8;
  --muted: #a6aecc;
  --paper: #303c69;
  --paper-alt: #3a4879;
  --line: #6171a3;
  --focus: #ffd46f;
  --accent: #ffc765;
  --accent-light: #ffeb9f;
  --wash: #242e56;
  --body-bg: #171f3d;
  --tray-bg: #15213e;
  --tile: #51658d;
  --tile-other: #46577f;
  --tile-edge: #758ab0;
  --well: #354467;
  --shop-pad: clamp(10px, 3.7vw, 20px);
}

button {
  appearance: none;
  color: inherit;
  font: inherit;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
button:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
}
button:disabled { cursor: default; }

.shop {
  position: relative;
  isolation: isolate;
  display: flex;
  flex-direction: column;
  gap: clamp(12px, 2.8svh, 25px);
  width: min(100%, 470px);
  min-height: 100svh;
  margin: 0 auto;
  padding: max(14px, env(safe-area-inset-top)) var(--shop-pad) max(20px, env(safe-area-inset-bottom));
  background:
    radial-gradient(ellipse 90% 34% at 46% 26%, #ffe7a995, transparent 82%),
    radial-gradient(ellipse 80% 28% at 100% 70%, #c2764e46, transparent 85%),
    repeating-linear-gradient(106deg, #8758310b 0 1px, transparent 1px 5px),
    linear-gradient(159deg, #f8cd87, #efb471 51%, #d78a55);
  box-shadow: 0 0 55px #291d3440;
}
.shop::before,
.shop::after {
  position: absolute;
  z-index: -1;
  pointer-events: none;
  content: "";
}
.shop::before {
  inset: 0 0 auto;
  height: clamp(78px, 13svh, 124px);
  border-bottom: 3px solid #6d2b37;
  background:
    linear-gradient(0deg, #661a203a, transparent 60%),
    repeating-linear-gradient(100deg, #a93f3a 0 48px, #f5b063 48px 94px);
  border-radius: 0 0 24% 12% / 0 0 20% 30%;
  box-shadow: 0 11px 18px #8e4c2c23;
}
.shop::after {
  inset: auto 0 0;
  height: clamp(30px, 13svh, 105px);
  opacity: .42;
  background: linear-gradient(0deg, #ac643e78, transparent);
}
[data-layout="b"] .shop {
  background:
    radial-gradient(circle at 30% 46%, #fffef0 0 18%, transparent 74%),
    radial-gradient(circle at 2px 2px, #587c6c20 1px, transparent 1.15px) 0 0 / 11px 11px,
    repeating-linear-gradient(0deg, transparent 0 66px, #66968736 66px 67px),
    #dce6ce;
}
[data-layout="b"] .shop::before {
  inset: 0 0 auto;
  height: clamp(78px, 16svh, 137px);
  border: 0;
  border-radius: 0 0 59% 45% / 0 0 74% 67%;
  background: radial-gradient(ellipse at 65% 17%, #e1ffd6, #90b69d 68%, #779d91);
  box-shadow: inset 0 -4px #5179675a;
}
[data-layout="b"] .shop::after {
  height: 28%;
  background: radial-gradient(ellipse at 50% 100%, #547e6e72, transparent 69%);
}
[data-layout="c"] .shop {
  gap: clamp(8px, 1.5svh, 17px);
  background:
    radial-gradient(ellipse 120% 33% at 55% 8%, #414f80 0, transparent 88%),
    radial-gradient(ellipse at 4% 83%, #444567b3 0 12%, transparent 58%),
    linear-gradient(155deg, #242a54 15%, #1b2949 61%, #17203b);
}
[data-layout="c"] .shop::before {
  inset: 0 0 auto;
  height: 12svh;
  opacity: .63;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  background:
    radial-gradient(ellipse at 19% 0%, #ffce7986, transparent 24%),
    radial-gradient(ellipse at 80% 0%, #ed9369a3, transparent 28%),
    linear-gradient(#182038 0 2px, transparent 2px);
}
[data-layout="c"] .shop::after {
  height: 27%;
  background:
    radial-gradient(ellipse at 50% 100%, #9771798c, transparent 64%),
    repeating-linear-gradient(97deg, #a696a722 0 1px, transparent 1px 33px);
}

.top-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 46px;
  gap: 5px;
}
.top-actions { display: flex; align-items: center; gap: 4px; }
.layout-switch {
  display: inline-flex;
  align-items: center;
  flex: 0 0 auto;
  gap: 3px;
  padding: 4px;
  border: 1px solid #4e311e44;
  border-radius: 18px;
  background: color-mix(in srgb, var(--paper), transparent 8%);
  box-shadow: 0 3px #351f2824;
}
.layout-option {
  position: relative;
  display: grid;
  place-items: center;
  width: 42px;
  height: 36px;
  border: 1px solid transparent;
  border-radius: 12px;
  color: var(--muted);
  background: transparent;
}
.layout-option[aria-pressed="true"],
.layout-option[aria-selected="true"],
.layout-option.active {
  color: color-mix(in srgb, var(--ink), var(--focus) 47%);
  border-color: color-mix(in srgb, var(--focus), transparent 30%);
  background: var(--paper-alt);
  box-shadow: inset 0 0 0 1px #fff6df55;
}
.layout-option .mini-board,
.layout-option .mini-dock {
  position: absolute;
  display: block;
  pointer-events: none;
  border-radius: 2px;
}
.layout-option .mini-board {
  inset: 8px 9px auto;
  height: 13px;
  border: 1.5px solid currentColor;
  background:
    linear-gradient(currentColor, currentColor) center / 1px 100% no-repeat,
    repeating-linear-gradient(0deg, transparent 0 3px, currentColor 3px 4px);
}
.layout-option .mini-dock {
  bottom: 8px;
  left: 15px;
  width: 11px;
  height: 3px;
  background: currentColor;
}
.layout-option:nth-child(2) .mini-board { right: 15px; left: 8px; }
.layout-option:nth-child(2) .mini-dock {
  inset: 8px 8px auto auto;
  width: 4px;
  height: 13px;
}
.layout-option:nth-child(3) .mini-board {
  inset: 5px 14px auto 16px;
  height: 22px;
  background:
    linear-gradient(90deg, currentColor, currentColor) center / 1px 100% no-repeat,
    repeating-linear-gradient(0deg, transparent 0 4px, currentColor 4px 5px);
}
.layout-option:nth-child(3) .mini-dock {
  inset: 9px auto auto 9px;
  width: 3px;
  height: 15px;
}

.tool-button,
.rotate-button,
.place-button,
.victory button {
  display: inline-grid;
  place-items: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 13px;
  color: var(--ink);
  background: var(--paper);
  box-shadow: inset 0 2px #ffffff35, 0 3px 0 color-mix(in srgb, var(--line), transparent 22%);
  font-size: 24px;
  line-height: 1;
  touch-action: manipulation;
}
:is(.tool-button, .rotate-button, .place-button, .victory button):active {
  transform: translateY(2px);
  box-shadow: inset 0 2px 0 #30263d2a, 0 1px var(--line);
}
:is(.tool-button, .place-button):disabled { opacity: .42; }
.tool-button svg,
.rotate-button svg,
.place-button svg { width: 55%; height: 55%; }

.table {
  --gap: clamp(10px, 2.4svh, 20px);
  position: relative;
  isolation: isolate;
  display: grid;
  grid-template:
    "orders" auto
    "board" auto
    "prep" auto / minmax(0, 1fr);
  gap: var(--gap);
  width: 100%;
  margin-top: clamp(14px, 5.5svh, 55px);
}
[data-layout="b"] .table {
  --gap: clamp(5px, 2vw, 10px);
  grid-template:
    "board prep" auto
    "orders prep" auto / minmax(0, 1fr) clamp(50px, 15vw, 72px);
  gap: var(--gap);
  align-content: center;
  margin-top: clamp(44px, 18svh, 155px);
}
[data-layout="b"] .table::before {
  position: absolute;
  z-index: -1;
  inset: -7px -5px -9px;
  border: 1px solid #8caf9a70;
  border-radius: 22px 22px 24px 24px;
  background: linear-gradient(160deg, #fffff1c9, #d6e5d1);
  box-shadow: 0 5px #688a7863, 0 13px 20px #536b5623;
  content: "";
}
[data-layout="c"] .table {
  --gap: clamp(5px, 2vw, 11px);
  --c-cell: min(57px, calc((100svh - 222px) / 8));
  grid-template:
    "orders board" auto
    "prep prep" auto / clamp(50px, 17vw, 75px) minmax(0, 1fr);
  gap: var(--gap);
  align-self: center;
  width: min(100%, calc(clamp(50px, 17vw, 75px) + 4 * var(--c-cell) + 22px + var(--gap)));
  margin-top: 2px;
}

.orders {
  grid-area: orders;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(6px, 3.2vw, 16px);
  align-items: stretch;
  min-width: 0;
}
.order-card {
  --avatar-field: #eac568;
  --avatar-ink: #393248;
  --avatar-skin: #edaa7d;
  --avatar-cheek: #c56e65;
  --avatar-hair: #342b39;
  position: relative;
  container-type: inline-size;
  display: grid;
  grid-template: "guest dish" minmax(42px, 1fr) "food food" auto / minmax(0,1fr) minmax(0,1fr);
  align-items: center;
  justify-items: center;
  min-width: 0;
  min-height: 101px;
  gap: 2px;
  padding: 7px 7px 8px;
  overflow: hidden;
  border: 1px solid color-mix(in srgb, var(--line), transparent 15%);
  border-top-left-radius: 18px;
  border-top-right-radius: 18px;
  border-bottom-right-radius: 10px;
  border-bottom-left-radius: 10px;
  background:
    radial-gradient(ellipse at 17% 20%, #fffdf486, transparent 58%),
    var(--paper);
  box-shadow: inset 0 2px #ffffff32, 0 4px 0 #79443145;
  transition: background-color 120ms ease, box-shadow 140ms ease;
}
.order-card[data-side="1"] {
  --avatar-field: #c0c98d;
  --avatar-skin: #c98760;
  --avatar-cheek: #a9584e;
  --avatar-hair: #4d4536;
  border-top-right-radius: 23px;
  border-top-left-radius: 11px;
}
.order-card:is([data-id="xiaoman"], [data-guest="xiaoman"]) {
  --avatar-field: #f4bd9d;
  --avatar-skin: #f0ae82;
  --avatar-cheek: #b85d55;
  --avatar-hair: #412d3f;
}
.order-card[data-hit="true"] {
  box-shadow: inset 0 0 0 2px var(--accent-light), 0 0 0 2px var(--accent), 0 4px 0 #5436444a;
}
.order-card[data-serving="true"] {
  animation: receipt 360ms ease-out both;
}
@keyframes receipt {
  35% { transform: translateY(-5px) rotate(-3deg); }
  65% { transform: translateY(2px) rotate(2deg); }
  100% { transform: none; }
}
[data-layout="b"] .orders {
  gap: 5px;
  border-bottom: 2px solid #5770676a;
  border-radius: 8px 8px 24px 24px;
  background: #acbfaa;
}
[data-layout="b"] .order-card {
  min-height: 89px;
  padding: 4px 4px 5px;
  border-radius: 10px 10px 16px 16px;
  box-shadow: inset 0 -3px #8bac943b;
}
[data-layout="c"] .orders {
  grid-template-columns: 1fr;
  grid-template-rows: repeat(2, minmax(0,1fr));
  align-content: stretch;
  align-items: center;
}
[data-layout="c"] .order-card {
  --avatar-field: #d68a68;
  align-self: center;
  grid-template: "guest" auto "dish" auto "food" auto / minmax(0, 1fr);
  gap: 4px;
  min-height: 0;
  padding: 6px 3px;
  border-radius: 34px 34px 13px 13px;
  background: radial-gradient(ellipse at 50% 10%, #7584aa60, transparent 58%), var(--paper);
  box-shadow: inset 0 0 0 1px #c7ccea36, 0 4px 0 #0e1a43b3;
}
[data-layout="c"] .order-card[data-side="1"] { --avatar-field: #8eaa9c; }
[data-layout="c"] .order-card[data-hit="true"] {
  border-color: var(--accent);
  box-shadow: 0 0 11px #ffc97762, inset 0 0 0 1px #ffc97755;
}

.guest {
  grid-area: guest;
  position: relative;
  display: block;
  width: clamp(31px, 11vw, 48px);
  aspect-ratio: 1;
  overflow: hidden;
  border: 1px solid #5c403e58;
  border-radius: 50%;
  background:
    radial-gradient(ellipse 65% 43% at 48% 103%, #5b7374 0 98%, transparent),
    radial-gradient(circle at 36% 25%, #fff6df8a 0 12%, transparent 41%),
    var(--avatar-field);
  box-shadow: inset 0 0 0 2px #f4dfc599;
}
.guest::before,
.guest::after,
.guest-face,
.guest-hair {
  position: absolute;
  display: block;
  content: "";
}
.guest::before {
  inset: 20% 24% 17%;
  border: 1px solid #5c403e60;
  border-radius: 46% 45% 43% 42%;
  background: var(--avatar-skin);
  box-shadow: -7px -1px 0 -4px var(--avatar-skin), 7px -1px 0 -4px var(--avatar-skin);
}
.guest::after {
  inset: 18% 22% auto;
  height: 22%;
  transform: rotate(-9deg);
  border-radius: 61% 38% 42% 22%;
  background: var(--avatar-hair);
}
.guest-face {
  inset: 46% 27% 26%;
  background:
    radial-gradient(ellipse at 26% 23%, var(--avatar-ink) 0 8%, transparent 11%),
    radial-gradient(ellipse at 75% 23%, var(--avatar-ink) 0 8%, transparent 11%),
    radial-gradient(ellipse at 12% 71%, var(--avatar-cheek) 0 10%, transparent 15%),
    radial-gradient(ellipse at 88% 71%, var(--avatar-cheek) 0 10%, transparent 15%);
}
.guest-face::after {
  position: absolute;
  inset: 40% 40% 12%;
  border-bottom: 1.5px solid var(--avatar-ink);
  border-radius: 50%;
  content: "";
}
.guest-hair {
  inset: 10% 22% auto auto;
  width: 21%;
  height: 20%;
  border-radius: 50%;
  background: var(--avatar-hair);
}
.order-card[data-side="1"] .guest-hair {
  inset: 18% 20% auto;
  width: auto;
  height: 9%;
  border-radius: 80% 62% 42% 41%;
  background: #7f8d58;
  box-shadow: 0 -3px #7f8d58;
}
.order-card[data-side="1"] .guest::after { transform: rotate(5deg); }

.dish-art {
  grid-area: dish;
  --dish-size: clamp(33px, 12vw, 54px);
}
[data-layout="c"] :is(.guest,.dish-art) { width: min(10vw, 41px); }
[data-layout="c"] .dish-art { --dish-size: min(10vw, 41px); }

.recipe-food {
  grid-area: food;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  max-width: 100%;
  min-height: 20px;
  padding: 2px 5px;
  border: 1px solid #4b403b35;
  border-radius: 40px;
  background: color-mix(in srgb, var(--paper-alt), transparent 38%);
}
.recipe-food > * { flex: 0 0 auto; }
.recipe-food .ingredient {
  --ingredient-size: clamp(13px, 5vw, 22px);
  width: var(--ingredient-size);
  height: var(--ingredient-size);
}
.food-requirement { position: relative; display: grid; place-items: center; }
.food-requirement.filled .ingredient { opacity: .46; filter: saturate(.45); }
.food-requirement.filled::after {
  position: absolute;
  right: -1px;
  bottom: 1px;
  width: 9px;
  height: 5px;
  transform: rotate(-47deg);
  border-bottom: 2px solid #1f6341;
  border-left: 2px solid #1f6341;
  filter: drop-shadow(0 0 1px #fffad6);
  content: "";
}
[data-layout="c"] .food-requirement.filled::after { border-color: #c9ffb6; }
[data-layout="c"] .recipe-food { gap: 2px; padding: 1px 3px; }
[data-layout="c"] .recipe-food .ingredient { --ingredient-size: 14px; }

.board-shell {
  grid-area: board;
  position: relative;
  isolation: isolate;
  width: 100%;
  align-self: center;
  min-width: 0;
  padding: clamp(4px, 2vw, 9px);
  border: 1px solid color-mix(in srgb, var(--tray-bg), #422537 25%);
  border-radius: 16px;
  background: var(--tray-bg);
  box-shadow: inset 0 2px 1px #ffffff4c, 0 5px 0 #5940356b, 0 10px 19px #4e2a422b;
}
.board-shell[data-bridge="true"] { box-shadow: inset 0 0 0 2px var(--accent-light), 0 0 0 2px var(--accent), 0 7px 16px #6f50385b; }
.board-shell[data-dual="true"] { box-shadow: inset 0 0 0 2px #fff9c3, 0 0 0 2px var(--accent-light), 0 0 20px var(--accent-light); }
[data-layout="b"] .board-shell { align-self: start; padding: 4px; border-radius: 14px; }
[data-layout="c"] .board-shell {
  width: min(100%, calc(4 * var(--c-cell) + 22px));
  justify-self: end;
  padding: 5px;
  border-color: #8194c2;
  border-radius: 19px;
  box-shadow: inset 0 0 0 2px #7e90b550, 0 4px 0 #131f3d, 0 9px 18px #11172b70;
}
[data-layout="c"] .board-shell[data-dual="true"] {
  border-color: var(--accent);
  box-shadow: inset 0 0 0 2px #f4c178b8, 0 0 13px #dbad637a;
}
.board {
  position: relative;
  display: grid;
  grid-template-columns: repeat(8, minmax(0, 1fr));
  grid-auto-rows: 1fr;
  gap: clamp(1px, .75vw, 4px);
  min-width: 0;
  isolation: isolate;
  touch-action: none;
  user-select: none;
}
[data-layout="b"] .board { gap: 2px; }
[data-layout="c"] .board {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 2px;
}
.board::after {
  position: absolute;
  inset: 2px auto 2px calc(50% - 1px);
  z-index: 2;
  width: 2px;
  border-radius: 4px;
  background: color-mix(in srgb, var(--accent-light), var(--line) 57%);
  box-shadow: 0 0 0 1px var(--tray-bg);
  pointer-events: none;
  content: "";
}
[data-layout="c"] .board::after {
  inset: calc(50% - 1px) 2px auto;
  width: auto;
  height: 2px;
}
.board-shell[data-bridge="true"] .board::after {
  background: #fff4aa;
  box-shadow: 0 0 5px 2px var(--accent);
}

.cell {
  position: relative;
  display: grid;
  place-items: center;
  align-self: start;
  width: 100%;
  aspect-ratio: 1;
  min-width: 0;
  padding: 0;
  border: 1px solid var(--tile-edge);
  border-radius: clamp(3px, 1.2vw, 7px);
  background: var(--tile);
  box-shadow: inset 0 1px #ffffff55, inset 0 -1px #37273919;
  touch-action: none;
}
.cell.right { background: var(--tile-other); }
.cell .ingredient { --ingredient-size: 84%; }
.cell.block {
  border-color: color-mix(in srgb, var(--tile-edge), var(--tray-bg) 52%);
  background:
    repeating-linear-gradient(132deg, transparent 0 3px, #30283c2d 3px 4px),
    var(--well);
  box-shadow: inset 0 2px 3px #2827383f;
}
.cell.ghost {
  z-index: 3;
  border-color: var(--accent);
  background: color-mix(in srgb, var(--tile), var(--accent-light) 45%);
  box-shadow: inset 0 0 0 1px var(--accent), 0 0 0 1px #fff7ceaa;
}
.cell.ghost .ingredient { opacity: .82; }
.cell.overlap {
  border-color: #b53d4c;
  background:
    repeating-linear-gradient(135deg, #c4385d3d 0 3px, #78344c15 3px 7px),
    var(--tile);
  box-shadow: inset 0 0 0 1px #972e3e;
}
.cell.anchor::after {
  position: absolute;
  inset: -1px;
  z-index: 4;
  border: 1px dashed var(--ink);
  border-radius: inherit;
  pointer-events: none;
  content: "";
}
.cell.clear-mark {
  z-index: 3;
  border-color: #fffbd1;
  background: color-mix(in srgb, var(--tile), #feb629 33%);
  box-shadow: inset 0 0 0 1px #ffa931, 0 0 5px 1px #ffc54591;
}
.cell.clearing {
  z-index: 7;
  border-color: #fffbc2;
  background: #ffcb62;
  animation: disappear 270ms ease-out both;
}
@keyframes disappear {
  0% { transform: scale(.92); filter: brightness(1.14); }
  30% { transform: scale(1.12); filter: brightness(1.42); }
  100% { transform: scale(.54); opacity: 0; }
}

.prep {
  grid-area: prep;
  position: relative;
  display: grid;
  grid-template:
    "next current rotate" 1fr
    "next current place" 1fr / minmax(46px, .8fr) minmax(62px, 1.4fr) 46px;
  align-items: center;
  justify-items: center;
  gap: 5px clamp(4px, 2.6vw, 12px);
  width: 100%;
  min-width: 0;
  min-height: 119px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 95px 25px 25px 95px / 31px 25px 25px 25px;
  background: color-mix(in srgb, var(--paper), var(--wash) 16%);
  box-shadow: inset 0 2px #fffdf170, inset 0 -4px #754e4b1f, 0 4px 0 #79443152;
}
.current-holder,
.future-holder {
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
  min-width: 0;
}
.current-holder {
  grid-area: current;
  min-height: 70px;
  padding: 4px;
  touch-action: none;
  cursor: grab;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--paper-alt);
  box-shadow: inset 0 1px 4px #523b4927;
}
.future-holder {
  grid-area: next;
  opacity: .8;
}
.piece-grid,
.next-shape {
  display: grid;
  place-content: center;
  grid-template-columns: repeat(var(--piece-cols, 2), var(--piece-unit, 30px));
  grid-template-rows: repeat(var(--piece-rows, 2), var(--piece-unit, 30px));
  gap: 2px;
  user-select: none;
}
.piece-grid { cursor: grab; touch-action: none; }
.piece-grid:active { cursor: grabbing; }
.next-shape { --piece-unit: 16px; }
.piece-tile, .next-tile {
  display: grid;
  place-items: center;
  min-width: 0;
  min-height: 0;
  border-radius: 5px;
}
.piece-tile {
  border: 1px solid var(--line);
  background: var(--tile);
  box-shadow: 0 2px 0 #63433571;
}
.next-tile {
  border: 1px dashed var(--muted);
  background: color-mix(in srgb, var(--paper-alt), transparent 38%);
}
:is(.piece-tile,.next-tile) .ingredient { --ingredient-size: 90%; }
.rotate-button {
  grid-area: rotate;
  transform-origin: center;
  border-color: var(--line);
  background: var(--accent-light);
  color: #3a2c32;
}
.place-button { grid-area: place; }
.place-button:not(:disabled) {
  border-color: var(--accent);
  background: color-mix(in srgb, var(--accent-light), var(--paper) 36%);
  color: #2e2424;
}
[data-layout="b"] .prep {
  grid-template: "current" minmax(35px, 1fr) "rotate" auto "next" minmax(28px, 1fr) "place" auto / minmax(0, 1fr);
  gap: 4px;
  min-height: 0;
  height: 100%;
  padding: 4px;
  border-radius: 19px;
  box-shadow: inset 0 0 0 2px #fff6dd62, 0 3px #1b5c505f;
}
[data-layout="b"] .current-holder { min-height: 0; padding: 2px; border-radius: 11px; }
[data-layout="b"] .piece-grid { --piece-unit: clamp(16px, 5.6vw, 23px); gap: 1px; }
[data-layout="b"] .next-shape { --piece-unit: clamp(12px, 4.2vw, 18px); }
[data-layout="b"] :is(.rotate-button,.place-button) {
  width: min(100%,44px);
  height: 42px;
  border-radius: 10px;
  font-size: 20px;
}
[data-layout="c"] .prep {
  grid-template: "next current rotate place" minmax(62px, 1fr) / minmax(44px,.65fr) minmax(53px,1fr) 44px 44px;
  min-height: 83px;
  border-radius: 24px;
  border-color: #7380a6;
  background: #2a355d;
  box-shadow: inset 0 2px #b8c3ea20, 0 3px #081b39;
}
[data-layout="c"] .current-holder {
  min-height: 62px;
  border-color: #606fa0;
}
[data-layout="c"] .piece-grid { --piece-unit: clamp(23px,7.5vw,34px); }
[data-layout="c"] .tool-button { background: #394870; }

.progress {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  align-self: center;
  gap: 6px;
  min-height: 24px;
  padding: 4px 9px;
  border: 1px solid color-mix(in srgb, var(--line), transparent 50%);
  border-radius: 30px;
  background: color-mix(in srgb, var(--paper), transparent 30%);
}
.progress-dot {
  display: block;
  width: 10px;
  height: 10px;
  border: 1px solid var(--muted);
  border-radius: 50%;
  background: color-mix(in srgb, var(--paper-alt), transparent 33%);
}
.progress-dot:is(.earned,.filled,.done,.served,[data-filled="true"],[data-ready="true"],[data-served="true"]) {
  border-color: var(--accent);
  background: var(--accent-light);
  box-shadow: 0 0 0 1px var(--accent), 0 0 5px var(--accent-light);
}

.burst {
  position: absolute;
  inset: 50% auto auto 50%;
  z-index: 8;
  display: block;
  width: 27px;
  height: 27px;
  transform: translate(-50%, -50%);
  color: transparent;
  font-size: 0;
  pointer-events: none;
}
.burst::before,
.burst::after {
  position: absolute;
  inset: 0;
  transform: scale(.75);
  opacity: 0;
  pointer-events: none;
  content: "";
}
.burst::before {
  border: 2px solid var(--accent-light);
  border-radius: 50%;
  box-shadow: 0 0 14px var(--accent);
}
.burst::after {
  background: #fff7a3;
  clip-path: polygon(50% 0%,58% 34%,88% 11%,74% 43%,100% 51%,73% 62%,88% 89%,59% 76%,50% 100%,41% 75%,12% 89%,28% 62%,0% 51%,26% 43%,12% 11%,42% 34%);
}
.burst:is(.live,.active,[data-live="true"])::before { animation: ripple 420ms ease-out both; }
.burst:is(.live,.active,[data-live="true"])::after { animation: sparkle 350ms ease-out both; }
.spark {
  position: absolute;
  inset: 50% auto auto 50%;
  width: 5px;
  height: 5px;
  transform: translate(-50%,-50%) rotate(var(--angle)) translateX(0);
  opacity: 0;
  border-radius: 1px;
  background: #fff2a1;
  box-shadow: 0 0 0 1px #ffb95877;
}
.burst.live .spark { animation: ray 340ms ease-out both; }
.burst[data-dual="true"] .spark { width: 8px; height: 8px; }
@keyframes ray {
  19% { opacity: .95; }
  100% { opacity: 0; transform: translate(-50%,-50%) rotate(var(--angle)) translateX(53px) rotate(55deg); }
}
@keyframes ripple {
  0% { opacity: 1; transform: scale(.7); }
  100% { opacity: 0; transform: scale(3.15); }
}
@keyframes sparkle {
  0% { opacity: .7; transform: scale(.7) rotate(-15deg); }
  35% { opacity: 1; transform: scale(1.3) rotate(15deg); }
  100% { opacity: 0; transform: scale(1.65) rotate(35deg); }
}

.victory {
  position: absolute;
  inset: 5px;
  z-index: 9;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
  padding: 8px;
  border: 1px solid color-mix(in srgb, var(--focus), transparent 34%);
  border-radius: 12px;
  background: color-mix(in srgb, var(--paper) 91%, transparent);
}
.victory button { min-width: 44px; }
.end-symbol {
  display: grid;
  place-items: center;
  width: 56px;
  height: 56px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--paper-alt);
  font-size: 27px;
}

.visually-hidden {
  position: absolute !important;
  overflow: hidden !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  clip-path: inset(50%) !important;
  border: 0 !important;
  white-space: nowrap !important;
}

@media (max-width: 335px) {
  .top-controls { gap: 4px; }
  .layout-option { width: 38px; }
  .tool-button { width: 42px; height: 42px; }
  .order-card { min-height: 92px; }
  .piece-grid { --piece-unit: 26px; }
}
@media (max-height: 670px) {
  .table { margin-top: 10px; }
  [data-layout="b"] .table { margin-top: 38px; }
  [data-layout="c"] .table { margin-top: 0; --c-cell: min(54px, calc((100svh - 158px) / 8)); }
  [data-layout="c"] .shop { padding-top: 7px; padding-bottom: 7px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 1ms !important; transition-duration: 1ms !important; }
}

/* Original ingredient stamps. Each food reads by shape as well as by color. */
.ingredient {
  position: relative;
  isolation: isolate;
  box-sizing: border-box;
  display: inline-block;
  inline-size: var(--ingredient-size, 100%);
  max-inline-size: 100%;
  aspect-ratio: 1;
  flex: none;
  vertical-align: middle;
  pointer-events: none;
  border: 1px solid var(--tile-ink);
  border-radius: 20%;
  background: linear-gradient(160deg, var(--tile-light), var(--tile-wash));
  box-shadow: inset 0 1px #fffa, inset 0 -2px var(--tile-edge);
}
.ingredient::before,
.ingredient::after {
  content: "";
  position: absolute;
  box-sizing: border-box;
}
.ingredient[data-kind="tofu"] {
  --tile-light: #c4d9ea;
  --tile-wash: #9ebcdb;
  --tile-ink: #52738b;
  --tile-edge: #769cbb;
}
.ingredient[data-kind="tofu"]::before {
  inset: 23% 18% 21%;
  transform: rotate(-11deg) skew(-7deg, 4deg);
  border: 1px solid #786650;
  border-radius: 13%;
  background:
    radial-gradient(circle at 67% 30%, #c5a475a8 0 6%, transparent 9%),
    radial-gradient(circle at 26% 36%, #c5a475a8 0 5%, transparent 8%),
    radial-gradient(circle at 54% 58%, #c5a4758c 0 5%, transparent 8%),
    linear-gradient(165deg, #ffffea 15%, #fff2ce 70%, #e9cea0 72%);
  box-shadow: .06em .10em #8a6d55b0;
}
.ingredient[data-kind="tofu"]::after {
  inset: 28% 27% auto 26%;
  block-size: 8%;
  border-radius: 40%;
  background: #fffef4a8;
  transform: rotate(-7deg);
}
.ingredient[data-kind="spinach"] {
  --tile-light: #cae4a7;
  --tile-wash: #a6ca8b;
  --tile-ink: #537746;
  --tile-edge: #8ab075;
}
.ingredient[data-kind="spinach"]::before {
  inset: 18% 19% 19% 24%;
  border-radius: 68% 8% 67% 44%;
  transform: rotate(-15deg);
  border: 1px solid #235540;
  background:
    linear-gradient(137deg, transparent 44%, #d0eaaa 47% 52%, transparent 55%),
    linear-gradient(145deg, #5aa471 3%, #287553 62%, #20533d);
}
.ingredient[data-kind="spinach"]::after {
  inset: 43% 37% 12% 16%;
  transform: rotate(-24deg);
  border-radius: 12% 72% 48% 72%;
  border: 1px solid #2d6946;
  background:
    linear-gradient(49deg, transparent 46%, #d1e69e 48% 55%, transparent 57%),
    linear-gradient(154deg, #85b65d, #3f8653);
}
.ingredient[data-kind="tomato"] {
  --tile-light: #fad1b4;
  --tile-wash: #efa78f;
  --tile-ink: #ab5544;
  --tile-edge: #d88572;
}
.ingredient[data-kind="tomato"]::before {
  inset: 29% 16% 15%;
  border: 1px solid #a13f34;
  border-radius: 49% 48% 49% 48% / 48% 49% 50% 53%;
  transform: rotate(-5deg);
  background:
    radial-gradient(ellipse at 30% 25%, #ffb28e 0 13%, transparent 19%),
    linear-gradient(150deg, #f87a60, #df5543 63%, #c04336);
  box-shadow: inset 0 -1px #a13f3466;
}
.ingredient[data-kind="tomato"]::after {
  inset: 15% 26% 55%;
  clip-path: polygon(43% 0, 60% 5%, 60% 37%, 99% 45%, 72% 69%, 86% 97%, 50% 80%, 15% 98%, 24% 70%, 0 48%, 43% 40%);
  background: linear-gradient(160deg, #5f8b52, #30593f);
}
.ingredient[data-kind="egg"] {
  --tile-light: #ffeaa6;
  --tile-wash: #efd17f;
  --tile-ink: #ad773d;
  --tile-edge: #dfb35b;
}
.ingredient[data-kind="egg"]::before {
  inset: 15% 23% 14%;
  transform: rotate(22deg);
  border-radius: 50% 50% 48% 48% / 60% 59% 41% 42%;
  border: 1px solid #ae7a54;
  background:
    radial-gradient(circle at 44% 56%, #ffda70 0 6%, transparent 10%),
    radial-gradient(circle at 47% 60%, #ffc14d 0 27%, #df9343 29% 32%, transparent 35%),
    linear-gradient(153deg, #fffdf1 42%, #f2dfb0);
  box-shadow: inset 0 -1px #9c6c383d;
}

/* Tiny servings use a deep bowl for soup and shallow porcelain for stir-fry. */
.dish-art {
  position: relative;
  display: inline-block;
  inline-size: var(--dish-size, 44px);
  max-inline-size: 100%;
  aspect-ratio: 1;
  flex: none;
  vertical-align: middle;
  pointer-events: none;
}
.dish-art::before,
.dish-art::after {
  content: "";
  position: absolute;
  box-sizing: border-box;
}
.dish-art::before {
  inset: 20% 5% 16%;
  transform: rotate(-8deg);
  border: 1px solid #667a76;
  border-radius: 51% 47% 52% 49%;
  background: radial-gradient(ellipse, #e4eee5 48%, #84aaa4 50% 53%, #fff7dd 55% 68%, #a3bbaa 70%);
  box-shadow: 0 1px 1px #252d243d;
}
.dish-art[data-dish="spinach-tofu-soup"]::before {
  inset: 30% 8% 13%;
  transform: none;
  border-radius: 9% 12% 46% 46% / 15% 15% 72% 73%;
  border-color: #4e6982;
  background: linear-gradient(180deg, #e8f0e8 0 31%, #6c97ac 32% 43%, #ecf4e8 44% 67%, #54839e 69% 83%, #fcf0d5 85%);
}
.dish-art[data-dish="spinach-tofu-soup"]::after {
  inset: 21% 8% 40%;
  border: 1px solid #4e6982;
  border-radius: 50%;
  background:
    linear-gradient(140deg, #fff8dd 48%, #d9c498 50%) 35% 32% / 20% 21% no-repeat,
    linear-gradient(140deg, #fff6da 48%, #d7bd90 50%) 62% 69% / 20% 21% no-repeat,
    radial-gradient(ellipse at 29% 68%, #267256 0 12%, transparent 14%),
    radial-gradient(ellipse at 67% 30%, #3d9265 0 15%, transparent 17%),
    radial-gradient(ellipse, #dcbb72, #ac8050 92%);
}
.dish-art[data-dish="tomato-eggs"]::after {
  inset: 29% 14% 24%;
  border-radius: 46% 50% 51% 49%;
  background:
    radial-gradient(ellipse at 44% 20%, #ffcb5c 0 18%, transparent 20%),
    radial-gradient(ellipse at 75% 59%, #ffd777 0 19%, transparent 21%),
    radial-gradient(ellipse at 25% 71%, #f07951 0 20%, transparent 22%),
    radial-gradient(ellipse at 72% 30%, #d9583d 0 19%, transparent 21%),
    radial-gradient(ellipse at 51% 68%, #edac47 0 24%, transparent 26%),
    radial-gradient(ellipse, #e26c47, transparent 72%);
}
.dish-art[data-dish="spinach-eggs"]::after {
  inset: 29% 14% 24%;
  border-radius: 46% 50% 51% 49%;
  background:
    radial-gradient(ellipse at 37% 28%, #ffdc7d 0 18%, transparent 20%),
    radial-gradient(ellipse at 73% 57%, #ffd268 0 19%, transparent 22%),
    radial-gradient(ellipse at 27% 70%, #398864 0 18%, transparent 20%),
    radial-gradient(ellipse at 73% 25%, #337557 0 20%, transparent 22%),
    radial-gradient(ellipse at 43% 72%, #e8ad48 0 23%, transparent 25%),
    radial-gradient(ellipse, #55926a, transparent 75%);
}

[data-theme="paper"] {
  --street-art: url("moon-street.webp");
  --street: #14203b;
  --rim: #be211b;
  --surface: #ffedc6;
  --edge: #d69564;
  --order-panel: #31202bec;
  --prep-band: top;
  --prep-shadow: #221014;
  --piece-rim: #efbf75;
}
[data-theme="ink"] {
  --street-art: url("moon-street.webp");
  --street: #839ca4;
  --rim: #487d83;
  --surface: #dcebed;
  --edge: #a1b8b9;
  --order-panel: #27494be8;
  --prep-band: center;
  --prep-shadow: #21383d;
  --piece-rim: #d7eccc;
}
[data-theme="neon"] {
  --street-art: url("moon-street.webp");
  --street: #181532;
  --rim: #2bb9c4;
  --surface: #212845;
  --edge: #6c7399;
  --order-panel: #24203ce8;
  --prep-band: bottom;
  --prep-shadow: #1b1233;
  --piece-rim: #adccff;
}
body[data-layout="c"] {
  --ink: #312433;
  --paper: #fff1d1;
  --paper-alt: #ffe2a0;
  --accent: #f8ab22;
  --line: var(--edge);
  --tray-bg: var(--rim);
  --tile: var(--surface);
  --tile-other: var(--surface);
  --tile-edge: color-mix(in srgb, var(--surface), var(--rim) 12%);
  --well: color-mix(in srgb, var(--surface), var(--street) 43%);
  background: #18151c;
}
body[data-layout="c"] .shop {
  width: min(100%, 46svh, 470px);
  padding: max(6px, env(safe-area-inset-top)) 7px max(6px, env(safe-area-inset-bottom));
  gap: 0;
  background: var(--street-art) center / cover no-repeat, var(--street);
}
body[data-layout="c"] .shop::before {
  inset: 0;
  height: auto;
  background: linear-gradient(180deg, #10142b3d, transparent 15%, #10142b14 47%, transparent 85%);
  opacity: 1;
}
body[data-layout="c"] .shop::after { content: none; }
body[data-theme="neon"] .board-shell { box-shadow: 0 0 13px #00c1f577; }
body[data-theme="neon"] .cell.block {
  border-color: #71749a;
  background: repeating-linear-gradient(135deg, #1b1e3b 0 5px, #626887 5px 7px);
}
body[data-theme="ink"] .board-shell { border: 3px double #e5efec; }
.top-controls { height: clamp(46px, 11svh, 104px); flex: none; align-items: flex-start; }
.top-controls nav {
  display: flex;
  gap: 4px;
  padding: 4px;
  border-radius: 24px;
  background: #150e17ab;
}
nav button {
  width: clamp(30px, 5svh, 40px);
  aspect-ratio: 1;
  border-radius: 50%;
  border: 2px solid #fff5;
  background: var(--street-art) center top / 370% auto;
  touch-action: manipulation;
}
nav button[aria-pressed="true"] { border-color: white; box-shadow: 0 0 0 2px #f7ad36; }
.progress { align-self: flex-start; background: #150e17ab; }
.progress-dot { background: #15152b; }
body[data-layout="c"] .table {
  width: 100%;
  grid-template-columns: 29% minmax(0, 1fr);
  gap: 1.5svh 1.6%;
}
body[data-layout="c"] .board-shell {
  width: 100%;
  border: 2px solid var(--edge);
  border-radius: 14px;
  background: var(--rim);
  box-shadow: inset 0 0 0 1px #ffdc9585, 0 5px 0 #15091861, 0 8px 20px #15091855;
}
[data-layout="c"] .board::after { height: 4px; }
.top-actions {
  grid-area: orders;
  align-self: center;
  justify-self: center;
  flex-direction: column;
  gap: clamp(5px, .8svh, 8px);
  z-index: 2;
}
body[data-layout="c"] .top-actions button {
  position: relative;
  display: grid;
  grid-template-rows: 1fr auto;
  place-items: center;
  border: 0;
  padding: 0 0 2px;
  background: none;
  box-shadow: none;
  border-radius: 11px;
  width: clamp(46px, 8svh, 67px);
  height: clamp(42px, 6svh, 54px);
  touch-action: manipulation;
}
body[data-layout="c"] .top-actions button:active:not(:disabled) { translate: 0 2px; }
body[data-layout="c"] .top-actions button:disabled { opacity: .93; }
body[data-layout="c"] .top-actions button:disabled .nmo-tool-art { filter: saturate(.65) brightness(.85); }
.nmo-tool-art {
  display: inline-block;
  flex: none;
  width: clamp(44px, 7.5svh, 63px);
  aspect-ratio: 1;
  background: url("woodcut-tools.webp") left center / 200% 100% no-repeat;
  filter: drop-shadow(0 2px 2px #190b10a6);
}
.nmo-tool-art[data-tool="restart"] { background-position: right center; }
.top-actions .nmo-tool-art { position: relative; top: -4px; }
.top-actions .nmo-tool-art { width: clamp(45px, 7svh, 59px); }
.tool-count {
  position: absolute;
  bottom: 0;
  display: flex;
  gap: 3px;
  padding: 2px 4px;
  border: 1px solid #b27742;
  border-radius: 20px;
  background: #351a16;
  box-shadow: 0 2px 3px #180d14aa;
}
.tool-count i, .tool-bead {
  display: inline-block;
  width: 9px;
  aspect-ratio: 1;
  border: 1px solid #a7794c;
  border-radius: 50%;
  background: #44271f;
}
:is(.tool-count i, .tool-bead)[data-filled="true"] {
  border-color: #f4c480;
  background: radial-gradient(circle at center, #87501c 21%, transparent 24%), linear-gradient(140deg, #ffe4a4, #cf7b26 85%);
  box-shadow: 0 0 3px #f9ac52;
}
body[data-layout="c"] .orders { row-gap: clamp(91px, 13.9svh, 123px); }
body[data-layout="c"] .order-card {
  position: relative;
  isolation: isolate;
  margin: 0 2px;
  border: 1px solid var(--edge);
  border-radius: 28px 28px 13px 13px;
  background: radial-gradient(ellipse at 50% 8%, #d28f533d, transparent 53%), var(--order-panel);
  box-shadow: inset 0 0 0 2px #ffe9b019, 0 6px 13px #19122076;
  overflow: visible;
  grid-template: "dish" auto "guest" auto "food" auto / 1fr;
  gap: 1px;
  padding: 4px 2px 6px;
}
.order-card .dish-art {
  --dish-size: min(15vw, 7.2svh, 58px);
  background: var(--paper);
  border-radius: 50%;
  width: var(--dish-size);
  aspect-ratio: 1.28;
  box-shadow: 0 3px 8px #291a2f63;
}
.order-card[data-hit="true"] .dish-art { box-shadow: 0 0 10px 3px #ffce50; }
.order-card .recipe-food {
  padding: 2px 5px;
  border: 1px solid #d5af7650;
  border-radius: 8px;
  background: #181023dc;
}
.shop .guest {
  width: min(105%, 13svh, 103px);
  aspect-ratio: 1.09;
  border: 0;
  overflow: visible;
  border-radius: 0;
  box-shadow: none;
  background: none;
}
.guest::before, .guest::after, .guest-hair, .guest-face { display: none; }
.guest-walk {
  position: absolute;
  inset: 0;
  filter: drop-shadow(0 3px 2px #1c132875);
  animation: guest-pace 3.6s linear infinite;
  animation-delay: var(--pace-delay);
}
.guest-body {
  position: absolute;
  inset: 0;
  background: url("guests.webp") var(--sprite-column, 0%) center / 300% auto no-repeat;
  image-rendering: pixelated;
  animation: guest-step .45s steps(2, jump-none) infinite;
  animation-delay: var(--pace-delay);
}
[data-guest="zhou"] .guest-body { --sprite-column: 50%; }
[data-guest="xiaoman"] .guest-body { --sprite-column: 100%; }
.guest-plate {
  position: absolute;
  top: 54%;
  left: 61%;
  width: 27%;
  height: 11%;
  border: 1px solid #a07b60;
  border-radius: 50%;
  background: radial-gradient(ellipse at center, #ffedcd 45%, #a98761 47%, #fff6de 58%);
  box-shadow: 0 2px #4b3836;
  animation: plate-bob .45s steps(2, jump-none) infinite;
  animation-delay: var(--pace-delay);
}
[data-serving="true"] .guest-plate::after, [data-ready="true"] .guest-plate::after {
  position: absolute;
  inset: -35% 14% 18%;
  border-radius: 50% 40% 27% 32%;
  background: radial-gradient(circle at 68% 40%, #ba4929 0 16%, transparent 18%), #ffb64e;
  box-shadow: inset -2px -2px #97532c80;
  content: "";
}
@keyframes guest-pace {
  0% { transform: translate(-7%, 2%) scaleX(1); }
  46% { transform: translate(7%, -3%) scaleX(1); }
  47% { transform: translate(7%, -3%) scaleX(-1); }
  96% { transform: translate(-7%, 2%) scaleX(-1); }
  97%, 100% { transform: translate(-7%, 2%) scaleX(1); }
}
@keyframes guest-step { 50% { transform: translateY(-3%) rotate(-2deg); } }
@keyframes plate-bob { 50% { transform: translateY(-16%) rotate(4deg); } }
@media (prefers-reduced-motion: reduce) {
  .guest-walk, .guest-body, .guest-plate { animation: none; }
}
body[data-layout="c"] .prep {
  grid-template: "current next" auto / 2fr 1fr;
  min-height: 15svh;
  border: 1px solid var(--edge);
  background: linear-gradient(180deg, #11071c12, #11071c38), linear-gradient(#253a47,#192736) center var(--prep-band) / 100% 300%, var(--prep-shadow);
  background-size: 100% 100%, 100% 300%;
  border-radius: 16px;
  padding: 7px 6px 2px;
  box-shadow: inset 0 0 0 2px #fff8d32b, 0 3px 0 #241521, 0 8px 16px #21121e81;
}
body[data-layout="c"] .current-holder { border: 0; box-shadow: none; background: transparent; padding: 5px; }
.current-holder[data-waiting] .piece-grid { opacity: .58; cursor: wait; }
body[data-layout="c"] .piece-grid { --piece-unit: min(6.1svh, 13vw, 60px); gap: 0; }
body[data-layout="c"] .future-holder {
  position: relative;
  align-content: center;
  grid-template-rows: auto;
  align-self: stretch;
  border-left: 1px solid #ffedc641;
  opacity: 1;
  background: radial-gradient(ellipse at center, #ffe0b218, transparent 77%);
}
.next-shape { --piece-unit: min(4.25svh, 9vw, 42px); gap: 0; }
.piece-tile { border: 0; background: none; box-shadow: none; }
.prep .joined-tile {
  --joint-up: 1px;
  --joint-right: 1px;
  --joint-down: 1px;
  --joint-left: 1px;
  position: relative;
  isolation: isolate;
  border: 0;
  background: none;
}
.prep .joined-tile::before {
  position: absolute;
  inset: var(--joint-up) var(--joint-right) var(--joint-down) var(--joint-left);
  z-index: -1;
  border: 1px solid var(--piece-rim);
  border-radius: 5px;
  background: linear-gradient(#775436, #311e23);
  box-shadow: 0 3px #211318, 0 4px 6px #21131883;
  content: "";
}
.prep .joined-tile[data-join-up] { --joint-up: -1px; }
.prep .joined-tile[data-join-right] { --joint-right: -1px; }
.prep .joined-tile[data-join-down] { --joint-down: -1px; }
.prep .joined-tile[data-join-left] { --joint-left: -1px; }
.prep .joined-tile[data-join-up]::before { border-top-width: 0; border-start-start-radius: 0; border-start-end-radius: 0; }
.prep .joined-tile[data-join-right]::before { border-right-width: 0; border-start-end-radius: 0; border-end-end-radius: 0; }
.prep .joined-tile[data-join-down]::before { border-bottom-width: 0; border-end-start-radius: 0; border-end-end-radius: 0; }
.prep .joined-tile[data-join-left]::before { border-left-width: 0; border-start-start-radius: 0; border-end-start-radius: 0; }
.prep .joined-tile .ingredient { transform: scale(.91); }
.prep .joined-tile.next-tile::before { background: #53404b; box-shadow: 0 2px #211318b4; }
.next-tile:not([data-revealed])::after {
  position: absolute;
  inset: 4px;
  border: 1px dashed #ffe7bd91;
  border-radius: 2px;
  content: "";
}
.prep .next-tile { position: relative; }
.shop .order-card .dish-art[data-dish] {
  --dish-size: min(21vw, 9.4svh, 78px);
  filter: drop-shadow(0 1px 1px #120c1a) drop-shadow(0 2px 4px #111016bd);
}
.shop .order-card .recipe-food .ingredient[data-kind] { --ingredient-size: min(6.5vw, 25px); }

.shop .ingredient[data-kind] {
  --ingredient-size: 100%;
  border: 0;
  border-radius: 0;
  box-shadow: none;
}
.shop .ingredient::before, .shop .ingredient::after { display: none; }
.shop .recipe-food .ingredient[data-kind] { --ingredient-size: min(6vw, 24px); }
.cell.ghost .ingredient { opacity: .65; }
.cell.anchor::after { border: 2px dashed white; box-shadow: 0 0 0 2px #2a3440; }
.cell.clear-mark { box-shadow: inset 0 0 0 2px #ffd96d, 0 0 0 1px #9a541b; z-index: 1; }
.cell.clear-mark .ingredient { filter: brightness(1.13); }
.cell.clearing .ingredient { animation: tile-clear 305ms ease-out both; }
@keyframes tile-clear {
  25% { transform: scale(1.09); filter: brightness(1.6) saturate(1.2); }
  100% { transform: scale(.72); filter: brightness(1.5); opacity: 0; }
}
.shop .burst { visibility: hidden; }
.clear-effects { position: absolute; inset: 0; z-index: 7; pointer-events: none; overflow: hidden; border-radius: inherit; }
.clear-origin { position: absolute; width: 0; height: 0; }
.clear-ring {
  position: absolute;
  width: var(--diameter);
  height: var(--diameter);
  border-radius: 22%;
  border: 2px solid #fff1b1;
  box-shadow: 0 0 9px var(--spark), inset 0 0 5px var(--spark);
  animation: clear-ring 440ms ease-out both;
}
.clear-chip {
  position: absolute;
  width: clamp(4px, 1.2vw, 7px);
  height: clamp(4px, 1.2vw, 7px);
  border-radius: 1px;
  background: var(--spark);
  box-shadow: inset 1px 1px #fff1bd, 0 0 6px #ffc76b;
  animation: clear-chip 480ms cubic-bezier(.11,.6,.35,1) both;
}
@keyframes clear-ring {
  from { opacity: 1; transform: translate(-50%,-50%) scale(.66); }
  to { opacity: 0; transform: translate(-50%,-50%) scale(1.32); }
}
@keyframes clear-chip {
  from { opacity: 1; transform: rotate(var(--angle)) translateX(3px) rotate(45deg); }
  to { opacity: 0; transform: rotate(var(--angle)) translateX(var(--travel)) rotate(125deg); }
}
.tool-dialog {
  width: min(calc(100% - 28px), 320px);
  padding: 16px 18px 12px;
  border: 4px double #d79f5e;
  border-radius: 15px;
  background: radial-gradient(ellipse at 42% 28%, #fff8e5, #f5dcae);
  color: #3e252d;
  box-shadow: 0 12px 44px #180f2966;
}
.tool-dialog::backdrop { background: #170e24a0; }
.tool-story { min-height: 87px; display: grid; place-items: center; }
.tool-story-restart, .tool-story-refill { display: none; align-items: center; gap: 10px; }
[data-mode="restart"] .tool-story-restart,
[data-mode="refill"] .tool-story-refill { display: flex; }
.tool-board {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  width: 48px;
  aspect-ratio: .56;
  padding: 3px;
  gap: 1px;
  border: 2px solid #9b5428;
  border-radius: 5px;
  background: #9c3b24;
}
.tool-board i { border-radius: 1px; background: var(--mini-ingredient, #fff1cd); }
.tool-board .tool-board-blocked { background: repeating-linear-gradient(135deg, #82665a 0 2px, #bfac92 2px 4px); }
.tool-reset-change { display: grid; justify-items: center; gap: 1px; }
.tool-reset-change .nmo-tool-art { width: 39px; }
.tool-story-arrow {
  width: 16px;
  height: 18px;
  background: #9c4525;
  clip-path: polygon(0 36%, 51% 36%, 51% 5%, 100% 50%, 51% 95%, 51% 64%, 0 64%);
}
.tool-story .tool-bead { width: 19px; }
.tool-ticket {
  position: relative;
  width: 40px;
  height: 30px;
  border: 2px solid #a5612c;
  border-radius: 5px;
  background: #dca352;
}
.tool-ticket::before {
  content: "";
  position: absolute;
  inset: 4px;
  border-inline: 2px dotted #fff1c4;
}
.tool-ticket::after {
  content: "";
  position: absolute;
  inset: 5px 11px;
  background: #642d20;
  clip-path: polygon(0 0, 100% 50%, 0 100%);
}
.tool-dialog form { display: flex; justify-content: center; gap: 12px; margin-top: 12px; }
.tool-dialog button {
  position: relative;
  width: 53px;
  height: 42px;
  border: 1px solid #9c5337;
  border-radius: 9px;
  color: #47262d;
  background: #ffe2aa;
}
.tool-dialog button[value="confirm"] { background: #8f2924; color: #fff4d4; }
.tool-check, .tool-cross { display: block; position: absolute; inset: 10px 16px; }
.tool-check { border: solid currentColor; border-width: 0 3px 3px 0; transform: translateY(-2px) rotate(45deg) scaleX(.65); }
.tool-cross::before, .tool-cross::after {
  content: "";
  position: absolute;
  inset: 50% 0 auto;
  height: 3px;
  border-radius: 2px;
  background: currentColor;
  transform: rotate(45deg);
}
.tool-cross::after { transform: rotate(-45deg); }

@media (max-height: 670px) {
  body[data-layout="c"] .shop {
    width: min(100%, 46.8svh, 470px);
    padding-bottom: max(5px, env(safe-area-inset-bottom));
  }
  .top-controls { height: max(43px, 9svh); }
  body[data-layout="c"] .current-holder { min-height: 0; }
  body[data-layout="c"] .piece-grid { --piece-unit: min(5.4svh, 14vw, 62px); }
  .shop .guest { width: min(105%, 11.8svh); }
  .shop .order-card .dish-art[data-dish] { --dish-size: min(19vw, 8.8svh); }
  .shop .order-card .recipe-food .ingredient[data-kind] { --ingredient-size: min(5.5vw, 20px); }
}

body[data-layout="c"] .prep:has(.nmo-guide-bar) {
  --prep-height: clamp(110px, 22svh, 188px);
  --guide-height: 42px;
  --piece-room: calc(var(--prep-height) - var(--guide-height) - 21px);
  height: var(--prep-height);
  min-height: 0;
  grid-template: "current next" minmax(0, 1fr) "guide guide" var(--guide-height) / minmax(0, 2fr) minmax(0, 1fr);
  row-gap: 0;
}

body[data-layout="c"] .prep:has(.nmo-guide-bar) .current-holder { min-height: 0; }
body[data-layout="c"] .prep:has(.nmo-guide-bar) .piece-grid {
  --piece-unit: min(6.1svh, 13vw, 60px, calc(var(--piece-room) / var(--piece-span, 2)));
}
body[data-layout="c"] .prep:has(.nmo-guide-bar) .next-shape {
  --piece-unit: min(4.25svh, 9vw, 42px, calc(var(--piece-room) / var(--piece-span, 2)));
}

.nmo-guide-bar {
  grid-area: guide;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 42px;
  width: 100%;
  padding-inline: 8px 3px;
  color: var(--guide-ink, #fff0cf);
}

.nmo-guide-instruction {
  font-size: clamp(11px, 3vw, 13px);
  font-weight: 650;
  line-height: 1.25;
  text-shadow: var(--guide-shadow, 0 1px 2px #301914);
}

.nmo-guide-help {
  display: grid;
  place-items: center;
  width: 44px;
  height: 42px;
  flex: none;
  padding: 0;
  border: 1px solid #e6ad68;
  border-radius: 13px;
  color: #ffe8a5;
  background: radial-gradient(circle at 50% 38%, #965023, #472314 80%);
  box-shadow: inset 0 0 0 2px #321711, 0 2px #291418;
  touch-action: manipulation;
}
.nmo-guide-help:hover { border-color: #ffde96; filter: brightness(1.13); }
.nmo-guide-help:active { translate: 0 1px; }
.nmo-guide-help:disabled { visibility: hidden; }

.nmo-guide-symbol {
  position: relative;
  display: block;
  width: 17px;
  height: 19px;
  margin-top: -3px;
  border: 1.5px solid #fff0b9;
  border-radius: 50% 50% 35% 35%;
  background: radial-gradient(ellipse at 45% 30%, #fffbdb 4%, #ffdf83 58%, #f6a840 96%);
  box-shadow: 0 0 9px #ffcb647d;
}
.nmo-guide-symbol::before {
  content: "";
  position: absolute;
  inset: auto 4px 2px;
  height: 7px;
  border: 1px solid #ad622e;
  border-radius: 35% 35% 0 0;
  border-bottom: 0;
}
.nmo-guide-symbol::after {
  content: "";
  position: absolute;
  inset: auto 2px -6px;
  height: 4px;
  color: #ffd887;
  border-block: 1px solid currentColor;
}
.nmo-guide-bar[data-mode="serving"] .nmo-guide-instruction {
  color: #fff0bd;
  font-weight: 750;
  letter-spacing: .03em;
}

.shop:has(.nmo-guide-bar:is([data-mode="stuck"], [data-mode="exhausted"])) #undo:not(:disabled) {
  outline: 1.5px solid #f4cf8099;
  outline-offset: 1px;
}

#board .cell.anchor::after { content: none; }
.shop #board .cell.ghost .ingredient { opacity: .78; }
.shop #board .cell.ghost:not(.clear-mark) {
  border-color: #62746c;
  background: color-mix(in srgb, var(--tile), #769086 24%);
  outline: 2px dashed #4c645b;
  outline-offset: -4px;
  box-shadow: none;
}
[data-theme="neon"] .shop #board .cell.ghost:not(.clear-mark) {
  border-color: #8497b6;
  outline-color: #c3d5f0;
}
.shop #board[data-preview-state="clear"] .cell.clear-mark {
  border-color: #a16b2d;
  background: color-mix(in srgb, var(--tile), #f4b55e 43%);
  box-shadow: inset 0 0 0 1px #783d19, 0 0 6px #d89a45a8;
}
.shop #board[data-preview-state="clear"] .cell.clear-mark::after {
  position: absolute;
  inset: 2px;
  z-index: 4;
  border: 2px solid #fff0b8;
  border-radius: inherit;
  box-shadow: 0 0 0 1px #784318, inset 0 0 0 1px #784318a8;
  pointer-events: none;
  content: "";
}
.shop #board[data-preview-state="clear"] .cell.clear-mark .ingredient { opacity: 1; }
.shop #board[data-preview-state="invalid"] .cell.overlap {
  outline: 2px solid #ad3038;
  outline-offset: -4px;
  box-shadow: inset 0 0 0 3px #ffe4ca;
}
.shop #board .cell.clearing {
  background: var(--tile);
  border-color: var(--tile-edge);
  animation: none;
}
.shop #board .cell.right.clearing { background: var(--tile-other); }
.shop .cell[data-lesson-target] {
  outline: 2px dashed #9d571d;
  outline-offset: -5px;
  box-shadow: inset 0 0 0 3px #f6d083b5;
}
[data-theme="neon"] .shop .cell[data-lesson-target] { outline-color: #ffe1a0; }

/* The 388px square crop gives each printed tile the same visual footprint. */
.shop .ingredient[data-kind] {
  background: url("stamp-ingredients.webp") var(--food-x) var(--food-y, 7.01%) / 457.22% 228.61% no-repeat;
  clip-path: none;
}
.shop .ingredient[data-kind="tomato"] { --food-x: 3.46%; }
.shop .ingredient[data-kind="tofu"] { --food-x: 34.92%; }
.shop .ingredient[data-kind="spinach"] { --food-x: 65.44%; }
.shop .ingredient[data-kind="egg"] { --food-x: 96.57%; --food-y: 6.91%; }
.shop .ingredient[data-kind="rice"] { --food-x: 3.50%; --food-y: 92.69%; }
.shop .ingredient[data-kind="mushroom"] { --food-x: 34.49%; --food-y: 92.59%; }
.shop .ingredient[data-kind="shrimp"] { --food-x: 65.44%; --food-y: 92.69%; }

/* All bowls share a 425 by 329 crop and the same upper-left light. */
.shop [data-dish] {
  --dish-paint: url("painted-dishes.webp") var(--dish-x) var(--dish-y) / 295.06% 381.16% no-repeat;
}
.shop [data-dish="spinach-tofu-soup"] { --dish-x: .54%; --dish-y: 6.97%; }
.shop [data-dish="tomato-eggs"] { --dish-x: 50.42%; --dish-y: 7.03%; }
.shop [data-dish="spinach-eggs"] { --dish-x: 98.67%; --dish-y: 7.03%; }
.shop [data-dish="tomato-tofu"] { --dish-x: .48%; --dish-y: 49.14%; }
.shop [data-dish="egg-tofu"] { --dish-x: 50.30%; --dish-y: 49.08%; }
.shop [data-dish="shrimp-eggs"] { --dish-x: 98.85%; --dish-y: 49.08%; }
.shop [data-dish="mushroom-tofu"] { --dish-x: .36%; --dish-y: 91.84%; }
.shop [data-dish="shrimp-rice"] { --dish-x: 50.36%; --dish-y: 91.78%; }
.shop [data-dish="mushroom-eggs"] { --dish-x: 98.98%; --dish-y: 91.84%; }
.shop .dish-art[data-dish] {
  --dish-size: min(17vw, 8svh, 66px);
  width: var(--dish-size);
  aspect-ratio: 684 / 530;
  border-radius: 0;
  background: var(--dish-paint);
  box-shadow: none;
  filter: drop-shadow(0 2px 2px #291a2f99);
}
.shop .dish-art[data-dish]::before,
.shop .dish-art[data-dish]::after { content: none; }
.shop .order-card[data-hit="true"] .dish-art[data-dish] {
  filter: drop-shadow(0 0 4px #ffdb79) drop-shadow(0 0 2px #ffb641);
}

/* The completed dish moves up with the guest's hands. */
.shop .order-card:is([data-serving="true"], [data-ready="true"]) .guest-plate {
  border-color: transparent;
  background: none;
  box-shadow: none;
}
.shop .order-card:is([data-serving="true"], [data-ready="true"]) .guest-plate::after {
  inset: auto -14% 8%;
  aspect-ratio: 684 / 530;
  border-radius: 0;
  background: var(--dish-paint);
  box-shadow: none;
  filter: drop-shadow(0 1px 1px #251409cb);
}


.shop { --serve-handoff-ms: 1060; }

#progress[data-display="percent"] {
  flex: 0 1 146px;
  min-width: 0;
  min-height: 36px;
  gap: 8px;
  padding: 5px 9px;
  border: 1px solid #f6cb7c;
  background: linear-gradient(180deg, #472124 0%, #25141a 63%);
  box-shadow: inset 0 0 0 1px #f5cf874d, 0 2px 5px #140711cc;
  color: #fff5d6;
}
.service-progress-track {
  flex: 1 1 auto;
  min-width: 10px;
  height: 9px;
  overflow: hidden;
  border-radius: 6px;
  background: #7c5444;
  box-shadow: inset 0 1px 2px #251009aa;
}
.service-progress-fill {
  display: block;
  width: var(--service-progress, 0%);
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(180deg, #fff2bb, #f5b44c);
  transition: width 240ms ease-out;
}
[data-progress-value] {
  min-width: 49px;
  text-align: right;
  font-size: 17px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  line-height: 1;
}
.order-card[data-needs-highlight] .food-requirement:not(.filled)::before {
  position: absolute;
  inset: -2px;
  border: 2px solid #ffeb9c;
  border-radius: 5px;
  box-shadow: 0 0 6px #ffc354;
  content: "";
  pointer-events: none;
}

.shop #orders .order-card[data-service="serving"] {
  animation: none;
  box-shadow: inset 0 0 0 2px #ffe5a6, 0 0 10px #ffbf6889;
}
.shop #orders [data-service="serving"] .guest {
  animation: service-leave calc(var(--serve-handoff-ms) * 1ms) linear 300ms both;
}
.shop #orders [data-service="serving"] .guest-walk { animation: none; }
.shop #orders [data-service="serving"] .guest-plate { animation: service-lift 830ms ease-out 300ms both; }

.order-card[data-service="closed"] > * { visibility: hidden; }
.order-card[data-service="closed"]::after {
  position: absolute;
  inset: 0;
  margin: auto;
  width: 26px;
  height: 16px;
  background: #edbd70;
  clip-path: polygon(12% 45%, 39% 73%, 89% 2%, 100% 13%, 44% 98%, 2% 57%);
  content: "";
}
.order-card[data-service="arriving"] .guest { animation: service-enter 320ms ease-out both; }
.order-card[data-service="arriving"] :is(.dish-art, .recipe-food) {
  animation: service-order 260ms 170ms ease-out both;
}

@keyframes service-lift {
  24%, 65% { transform: translateY(-23%) rotate(-5deg); }
  100% { transform: none; }
}
@keyframes service-leave {
  0%, 43% { opacity: 1; transform: translateX(0) perspective(320px) rotateY(0deg); }
  68% { opacity: 1; transform: translateX(-2px) perspective(320px) rotateY(180deg); }
  100% { opacity: .65; transform: translateX(var(--service-travel)) perspective(320px) rotateY(180deg); }
}
@keyframes service-enter {
  from { transform: translateX(-55%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}
@keyframes service-order {
  from { opacity: 0; }
  to { opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
  .shop { --serve-handoff-ms: 480; }
  .shop #orders [data-service="serving"] :is(.guest, .guest-plate),
  .order-card[data-service="arriving"] :is(.guest, .dish-art, .recipe-food) { animation: none; }
  .service-progress-fill { transition: none; }
}


.shop[data-finale] .table { visibility: hidden; }
.nmo-finale[hidden] { display: none; }

.shop:is([data-finale-transition], [data-finale]) .top-controls { z-index: 3; }
.shop[data-finale-transition] .table { z-index: 2; }
.shop[data-finale-transition] #board-shell {
  transform-origin: center;
  animation: finale-tray-turn 940ms cubic-bezier(.3, .55, .25, 1) both;
}

.shop[data-finale-transition] #board-shell .cell.block { background: var(--surface); }

.shop[data-finale-transition] .table > :not(#board-shell) {
  animation: finale-table-out 520ms ease-out both;
}

.nmo-finale {
  --finale-ink: #733326;
  --finale-red: #a53d2e;
  --finale-deep: #68262b;
  position: absolute;
  inset: 0;
  z-index: 1;
  display: grid;
  align-items: center;
  padding: clamp(52px, 11svh, 105px) clamp(7px, 3vw, 15px) clamp(22px, 6svh, 50px);
  pointer-events: none;
}

.nmo-finale__panel {
  position: relative;
  isolation: isolate;
  display: grid;
  justify-items: center;
  padding: clamp(12px, 3svh, 27px) clamp(8px, 3vw, 18px) clamp(13px, 3.3svh, 29px);
  border: 3px solid #8e4f32;
  border-radius: 21px;
  background:
    radial-gradient(circle at 2px 2px, #ac693822 .6px, transparent 1px) 0 0 / 5px 5px,
    linear-gradient(140deg, #fff0cb, #efc982);
  box-shadow: inset 0 0 0 2px #ffdd97, inset 0 0 0 5px #c88c56, 0 4px #632c35, 0 11px 28px #241b2f61;
  color: var(--finale-ink);
  text-align: center;
}

.nmo-finale__panel::before {
  position: absolute;
  inset: 8px;
  z-index: -1;
  border: 1px solid #ae75497d;
  border-radius: 13px;
  content: "";
  pointer-events: none;
}

.shop[data-finale] .nmo-finale__panel { pointer-events: auto; }

.nmo-finale__seal {
  display: grid;
  place-items: center;
  width: clamp(33px, 6svh, 47px);
  aspect-ratio: 1;
  border: 1px solid #713329;
  border-radius: 50%;
  background: var(--finale-red);
  box-shadow: inset 0 0 0 1px #ffdb9d, 1px 1px #7443354d;
}

.nmo-finale__seal::before {
  width: 18%;
  height: 36%;
  margin-top: -11%;
  border: solid #fff0ca;
  border-width: 0 2px 2px 0;
  transform: rotate(42deg);
  content: "";
}

.nmo-finale h2 {
  margin: 9px 0 2px;
  outline: none;
  color: var(--finale-deep);
  font-family: KaiTi, STKaiti, "Songti SC", "SimSun", serif;
  font-size: clamp(25px, 4.8svh, 39px);
  font-weight: 700;
  line-height: 1.18;
  letter-spacing: .05em;
}

.nmo-finale__guests {
  display: grid;
  width: 100%;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 4px;
  margin: 0 0 clamp(9px, 1.9svh, 18px);
  padding: 0;
  list-style: none;
}

.nmo-finale__guests li {
  --return-delay: 420ms;
  --return-x: -14px;
  display: grid;
  justify-items: center;
  min-width: 0;
}

.nmo-finale__guests li:nth-child(2) { --return-delay: 465ms; --return-x: 0px; }
.nmo-finale__guests li:nth-child(3) { --return-delay: 510ms; --return-x: 14px; }
.nmo-finale__guests [data-guest="lin"] { --bow: 8deg; --bounce: -3%; }
.nmo-finale__guests [data-guest="zhou"] { --bow: -4deg; --bounce: -8%; }
.nmo-finale__guests [data-guest="xiaoman"] { --bow: -8deg; --bounce: -4%; }

.nmo-finale__heart {
  position: relative;
  width: 8px;
  height: 8px;
  margin: 10px 0 4px;
  background: var(--finale-red);
  transform: rotate(-45deg);
}

.nmo-finale__heart::before,
.nmo-finale__heart::after {
  position: absolute;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: inherit;
  content: "";
}

.nmo-finale__heart::before { inset: -50% auto auto 0; }
.nmo-finale__heart::after { inset: 0 auto auto 50%; }

.nmo-finale__avatar {
  position: relative;
  width: 100%;
  max-width: 104px;
  aspect-ratio: .99;
  isolation: isolate;
  transform-origin: 50% 90%;
}

.nmo-finale__avatar::before {
  position: absolute;
  inset: auto 9% 2%;
  z-index: -1;
  height: 13%;
  border-radius: 50%;
  background: radial-gradient(ellipse, #7a3a4688, #7a3a4600 73%);
  content: "";
}

.nmo-finale__avatar .guest-body { animation: none; }
.shop .nmo-finale__avatar .dish-art[data-dish] {
  --dish-size: 46%;
  position: absolute;
  bottom: 27%;
  left: 51%;
  height: auto;
  transform: translateY(-6%);
}

#nmo-finale-next {
  display: inline-flex;
  min-width: min(77%, 205px);
  min-height: 46px;
  align-items: center;
  justify-content: center;
  gap: 11px;
  padding: 8px 15px;
  border: 2px solid #f3bf68;
  border-radius: 10px;
  outline: 1px solid var(--finale-deep);
  background:
    repeating-linear-gradient(106deg, #550c1516 0 1px, transparent 1px 4px),
    linear-gradient(180deg, var(--finale-red), var(--finale-deep));
  box-shadow: inset 0 0 0 2px #ffcf8840, 0 3px var(--finale-deep), 0 6px 12px #72253a54;
  color: #fff4d1;
  cursor: pointer;
  font-size: 15px;
  font-weight: 800;
  letter-spacing: .09em;
  touch-action: manipulation;
}

#nmo-finale-next span {
  width: 8px;
  height: 8px;
  border: solid currentColor;
  border-width: 2px 2px 0 0;
  transform: rotate(45deg);
}

#nmo-finale-next:active { transform: translateY(2px); }
#nmo-finale-next:focus-visible { outline: 2px solid var(--finale-ink); outline-offset: 3px; }

.shop[data-finale-transition] .nmo-finale__panel { animation: finale-paper-in 760ms ease-out both; }
.shop[data-finale-transition] .nmo-finale__seal { animation: finale-print-in 940ms ease-out both; }
.shop[data-finale-transition] .nmo-finale__guests li { animation: finale-guest-in 315ms ease-out var(--return-delay) both; }
.shop[data-finale-transition] .nmo-finale__heart { animation: finale-heart-in 940ms ease-out both; }
.shop[data-finale-transition] .nmo-finale h2 { animation: finale-word-in 940ms ease-out both; }
.shop[data-finale-transition] #nmo-finale-next { animation: finale-action-in 940ms ease-out both; }
.shop[data-finale] .nmo-finale__avatar { animation: finale-thanks 4.8s ease-in-out calc(var(--return-delay) + .7s) infinite; }

@keyframes finale-tray-turn {
  0% { transform: translate(0, 0) rotate(0) scale(1); opacity: 1; }
  22% { transform: translate(calc(var(--seal-x) * .19), calc(var(--seal-y) * .14)) rotate(4deg) scale(.81); }
  76% { transform: translate(var(--seal-x), var(--seal-y)) rotate(-7deg) scale(var(--seal-scale)); opacity: 1; }
  100% { transform: translate(var(--seal-x), var(--seal-y)) rotate(-7deg) scale(var(--seal-scale)); opacity: 0; }
}

@keyframes finale-table-out {
  0%, 15% { opacity: 1; }
  100% { opacity: 0; }
}

@keyframes finale-paper-in {
  0%, 18% { opacity: 0; transform: translateY(7px) scale(.98); }
  100% { opacity: 1; transform: none; }
}

@keyframes finale-print-in {
  0%, 74% { opacity: 0; }
  100% { opacity: 1; }
}

@keyframes finale-guest-in {
  from { opacity: 0; transform: translate(var(--return-x), 9px); }
  to { opacity: 1; transform: none; }
}

@keyframes finale-heart-in {
  0%, 82% { opacity: 0; transform: translateY(3px) rotate(-45deg) scale(.7); }
  100% { opacity: 1; transform: rotate(-45deg) scale(1); }
}

@keyframes finale-word-in {
  0%, 76% { opacity: 0; transform: translateY(3px); }
  100% { opacity: 1; transform: none; }
}

@keyframes finale-action-in {
  0%, 81% { opacity: 0; }
  100% { opacity: 1; }
}

@keyframes finale-thanks {
  0%, 32%, 100% { transform: none; }
  10% { transform: translateY(var(--bounce)); }
  20% { transform: rotate(var(--bow)); }
}

@media (prefers-reduced-motion: reduce) {
  .shop[data-finale-transition] :is(#board-shell, .table > *) { animation: none; }
  .shop:is([data-finale-transition], [data-finale]) .nmo-finale * { animation: none; }
}

body[data-layout="c"] .prep.stack-shelf {
  --stack-height: clamp(98px, 12.5svh, 110px);
  position: relative;
  min-height: 0;
  height: var(--stack-height);
  display: grid;
  grid-template: minmax(0, 1fr) / minmax(0, 1fr) 44px;
  align-items: stretch;
  justify-items: stretch;
  gap: 6px;
  padding: 4px 5px;
  border: 1px solid #a06d43;
  border-radius: 13px;
  background: linear-gradient(120deg,#24171599,#211720dd), linear-gradient(#253a47,#192736) center var(--prep-band) / 100% 300%, #37231e;
  box-shadow: inset 0 0 0 1px #f0c88624, 0 3px #261922;
}
.supply-pieces {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(61px, 35%);
  gap: 5px;
  min-width: 0;
}
#current-piece, .supply-next {
  position: relative;
  display: grid;
  place-items: center;
  min-width: 0;
  min-height: 0;
  border-radius: 8px;
}
#current-piece {
  padding: 2px 13px;
  border: 1px solid #ac8155;
  background: radial-gradient(ellipse at center,#a274424c,#6e492820 60%,transparent 81%), #3c251ccc;
  box-shadow: inset 0 0 0 1px #d6a66c31, inset 0 -5px 10px #24152478;
  cursor: grab;
  touch-action: none;
}
#current-piece::after {
  position: absolute;
  right: 6px;
  bottom: 6px;
  color: #e4bf81;
  font: 700 16px/1 sans-serif;
  content: "↻";
  pointer-events: none;
}
#current-piece:disabled { cursor: default; }
#current-piece:disabled .piece-grid { opacity: .66; }
#current-piece:active:not(:disabled) { transform: translateY(1px); }
#current-piece[data-nudge] { animation: stack-cue 1s ease-out 2; }
.supply-next {
  container-type: inline-size;
  padding: 3px 4px 3px 10px;
  border: 1px solid #aa82554f;
  background: #26192399;
  box-shadow: inset 0 2px 6px #1f131e;
}
.supply-next:has(#next:not([data-empty]))::before {
  position: absolute;
  left: 5px;
  width: 6px;
  height: 6px;
  border: solid #ca9d68;
  border-width: 0 0 1px 1px;
  transform: rotate(45deg);
  content: "";
}
@keyframes stack-cue {
  40% { box-shadow: inset 0 0 0 1px #fff1c4, 0 3px #2a1520, 0 0 0 3px #f9b75b95; }
}
body[data-layout="c"] #piece {
  --piece-unit: min(48px, 10.7vw, calc((var(--stack-height) - 19px) / var(--piece-span, 2)));
  gap: 0;
}
body[data-layout="c"] #next {
  --piece-unit: min(28px, 6.5vw, calc(100cqw / var(--piece-cols, 2)), calc((var(--stack-height) - 22px) / var(--piece-span, 2)));
  gap: 0;
}
.stack-tools { display: grid; grid-auto-rows: 44px; align-content: center; }
#stack-hint {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border: 1px solid #f0b76d;
  border-radius: 11px;
  background: #38201be8;
  box-shadow: inset 0 0 0 2px #180d16, 0 2px #1b1220;
  cursor: pointer;
  touch-action: manipulation;
}
#stack-hint i {
  position: relative;
  display: block;
  width: 22px;
  height: 23px;
  border: 1px solid #ffce83;
  border-radius: 44%;
  background: repeating-linear-gradient(90deg,#f4b66663 0 1px,transparent 1px 5px), linear-gradient(#bc3f31,#f28a41,#913027);
  box-shadow: inset 0 0 0 3px #96281c60,0 0 8px #ec914b5c;
}
#stack-hint i::before,
#stack-hint i::after {
  position: absolute;
  left: 50%;
  width: 9px;
  height: 3px;
  border-radius: 1px;
  background: #e9af64;
  transform: translateX(-50%);
  content: "";
}
#stack-hint i::before { top: -3px; }
#stack-hint i::after { bottom: -3px; box-shadow: 2px 2px #a84d34; }
#stack-hint:disabled i { filter: saturate(.43) brightness(.67); }
#stack-hint:active:not(:disabled) { transform: translateY(1px); }
#current-piece:focus-visible, #stack-hint:focus-visible, .stack-rewind:focus-visible { outline: 2px solid #ffe8ad; outline-offset: -3px; }

.shop #board-shell { border-color: #bd7950; box-shadow: inset 0 0 0 1px #f1bd77, 0 3px #663334, 0 8px 13px #15091558; }
#board-shell::before {
  position: absolute;
  z-index: 5;
  inset: 2px;
  border-radius: inherit;
  pointer-events: none;
  background: radial-gradient(circle at top left,#ffd890 0 2px,transparent 4px),
    radial-gradient(circle at top right,#ffd890 0 2px,transparent 4px),
    radial-gradient(circle at bottom left,#ffd890 0 2px,transparent 4px),
    radial-gradient(circle at bottom right,#ffd890 0 2px,transparent 4px);
  content: "";
}
.shop #board .cell[data-lesson-target] { animation: stack-cue 1.4s ease-out 2; }
.shop .food-requirement[data-receiving] { outline: 2px solid #ffdc89; outline-offset: 1px; }
.shop .food-requirement[data-received] { outline: 2px solid #bbda94; outline-offset: 1px; }
.shop #board .cell.landed { box-shadow: inset 0 0 0 2px #efc588; }
.shop #board .cell.landed > .ingredient { animation: stack-stamp 180ms ease-out both; }
@keyframes stack-stamp {
  from { transform: scale(.86); }
  70% { transform: scale(1.05); }
  to { transform: none; }
}

.stack-shelf[data-recovery] > :is(.supply-pieces,.stack-tools) { visibility: hidden; }
.stack-recovery[hidden] { display: none; }
.stack-recovery {
  position: absolute;
  inset: 4px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 50px;
  align-items: center;
  gap: 9px;
  padding: 7px 8px;
  border: 1px solid #a97553;
  border-radius: 10px;
  background: #2e201df0;
  box-shadow: inset 0 0 0 2px #120f1b69, 0 3px #24141a;
}
.stack-shortages { display: grid; gap: 4px; }
.stack-shortage {
  display: flex;
  align-items: center;
  gap: 4px;
  min-height: 31px;
  padding: 2px 5px;
  border: 1px solid #85624f;
  border-radius: 6px;
  background: #47322c;
}
.stack-shortage .ingredient[data-kind] { --ingredient-size: 24px; width: 24px; height: 24px; }
.stack-side {
  width: 22px;
  height: 24px;
  border: 1px solid #d1a25c;
  border-radius: 4px;
  background: linear-gradient(#dc944a 0 49%,#3d2731 50%);
}
[data-side="1"] .stack-side { background: linear-gradient(#3d2731 0 49%,#dc944a 50%); }
.stack-done { color: #e6d2a0; font-size: 20px; }
.stack-rewind {
  width: 50px;
  height: 50px;
  border: 1px solid #ffcf8d;
  border-radius: 9px;
  background: #c37749 url("woodcut-tools.webp") left center / 200% 100% no-repeat;
  box-shadow: 0 3px #5e2f2d;
  cursor: pointer;
}
.stack-rewind:disabled { opacity: .45; }
.shop #undo[data-rescue]:not(:disabled) { outline: 2px solid #f6cd8c; outline-offset: 2px; }
.shop:has(.stack-recovery:not([hidden])) .food-requirement[data-recovery-missing] { outline: 2px solid #ffcd78; }
.shop:has(.stack-recovery:not([hidden])) #board-shell { box-shadow: none; }

@media (prefers-reduced-motion: reduce) {
  #current-piece[data-nudge], .shop #board .cell[data-lesson-target], .shop #board .cell.landed > .ingredient { animation: none; }
}

#market-sound {
  position: relative;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border: 1px solid #af885e;
  border-radius: 11px;
  background: #3a231ee6;
  color: #dfbc89;
  box-shadow: inset 0 0 0 2px #25161c;
  cursor: pointer;
  touch-action: manipulation;
}
#market-sound i {
  position: relative;
  width: 22px;
  height: 20px;
  background: currentColor;
  clip-path: polygon(0 31%,24% 31%,56% 5%,56% 95%,24% 69%,0 69%,0 31%,70% 22%,84% 25%,94% 38%,94% 62%,84% 75%,70% 78%,70% 66%,79% 63%,84% 57%,84% 43%,79% 37%,70% 34%,70% 22%);
}
#market-sound[aria-pressed="false"] i { opacity: .55; }
#market-sound[aria-pressed="false"]::after {
  position: absolute;
  width: 23px;
  height: 2px;
  background: currentColor;
  transform: rotate(-45deg);
  content: "";
}
#market-sound:active { transform: translateY(1px); }
#market-sound:focus-visible { outline: 2px solid #ffe7ad; }
.shop .ingredient.receipt-flight {
  --ingredient-size: 24px;
  position: fixed;
  z-index: 12;
  width: 24px;
  height: 24px;
  pointer-events: none;
  filter: drop-shadow(0 0 4px #e9b360);
  animation: receipt-flight 300ms cubic-bezier(.2,.68,.26,1) both;
}
@keyframes receipt-flight {
  0% { opacity: .8; transform: scale(.68); }
  58% { opacity: 1; transform: translate(calc(var(--fly-x)*.55),calc(var(--fly-y)*.5 - 14px)) scale(.98) rotate(-5deg); }
  100% { opacity: .25; transform: translate(var(--fly-x),var(--fly-y)) scale(.66); }
}
.shop .food-requirement[data-received] { animation: receipt-settle 320ms ease-out both; }
@keyframes receipt-settle { 75% { transform: scale(1.11); filter: drop-shadow(0 0 4px #d4edab); } }

.nmo-finale__panel {
  border-color: #913f32;
  box-shadow: inset 0 0 0 2px #fbd990, inset 0 0 0 5px #b87249, 0 4px #682325, 0 11px 28px #241b2f61;
}
.nmo-finale__panel::before {
  background: radial-gradient(circle at top left,#bb5f42 0 2px,transparent 4px),
    radial-gradient(circle at top right,#bb5f42 0 2px,transparent 4px),
    radial-gradient(circle at bottom left,#bb5f42 0 2px,transparent 4px),
    radial-gradient(circle at bottom right,#bb5f42 0 2px,transparent 4px);
}
.nmo-finale__seal { border-radius: 18%; transform: rotate(-5deg); }
#nmo-finale-next { min-width: 82px; min-height: 48px; border-radius: 9px; }
#nmo-finale-next .market-again {
  width: auto;
  height: auto;
  border: 0;
  transform: none;
  font: 28px/1 Georgia,serif;
}

@media (prefers-reduced-motion: reduce) {
  .shop .ingredient.receipt-flight, .shop .food-requirement[data-received] { animation: none; }
}

body[data-theme="paper"], nav [data-theme="paper"] {
  --street-art: url("moon-street.webp");
  --street: #8a9ca7;
  --rim: #345b58;
  --surface: #f4e6c9;
  --edge: #738f88;
  --piece-rim: #d7ac63;
}

.shop {
  --jade-dark: #163a3b;
  --jade-mid: #48766e;
  --jade-light: #a5bdb0;
  --shelf-paper: #f6dfad;
  --step-frame: polygon(
    0 8px, 3px 8px, 3px 4px, 7px 4px, 7px 0,
    calc(100% - 7px) 0, calc(100% - 7px) 4px, calc(100% - 3px) 4px,
    calc(100% - 3px) 8px, 100% 8px, 100% calc(100% - 8px),
    calc(100% - 3px) calc(100% - 8px), calc(100% - 3px) calc(100% - 4px),
    calc(100% - 7px) calc(100% - 4px), calc(100% - 7px) 100%,
    7px 100%, 7px calc(100% - 4px), 3px calc(100% - 4px),
    3px calc(100% - 8px), 0 calc(100% - 8px)
  );
}

body[data-theme="paper"][data-layout="c"] .shop {
  background-position: 37% 92%;
  background-size: auto 124%;
}
body[data-theme="paper"][data-layout="c"] .shop::before { background: none; }

/* Each set of four rows sits in its own stepped jade tray. */
.shop #board-shell,
.shop:has(.stack-recovery:not([hidden])) #board-shell {
  --tray-rim: clamp(9px, 3.2vw, 13px);
  --tray-space: 4px;
  --tray-highlight: #b7dccc;
  --tray-step: polygon(
    0 15px, 3px 15px, 3px 9px, 7px 9px, 7px 5px, 14px 5px, 14px 0,
    calc(100% - 14px) 0, calc(100% - 14px) 5px, calc(100% - 7px) 5px,
    calc(100% - 7px) 9px, calc(100% - 3px) 9px, calc(100% - 3px) 15px,
    100% 15px, 100% calc(100% - 15px), calc(100% - 3px) calc(100% - 15px),
    calc(100% - 3px) calc(100% - 9px), calc(100% - 7px) calc(100% - 9px),
    calc(100% - 7px) calc(100% - 5px), calc(100% - 14px) calc(100% - 5px),
    calc(100% - 14px) 100%, 14px 100%, 14px calc(100% - 5px), 7px calc(100% - 5px),
    7px calc(100% - 9px), 3px calc(100% - 9px), 3px calc(100% - 15px), 0 calc(100% - 15px)
  );
  padding: var(--tray-rim);
  border: 0;
  border-radius: 0;
  background: none;
  box-shadow: none;
  filter: none;
}
.shop #board-shell::before { content: none; }
.arcade-trays {
  position: absolute;
  z-index: -1;
  inset: 0;
  display: grid;
  grid-template-rows: repeat(2, minmax(0, 1fr));
  gap: var(--tray-space);
  pointer-events: none;
}
.arcade-trays > span {
  position: relative;
  min-height: 0;
  filter: drop-shadow(0 2px 0 #163636b3) drop-shadow(0 4px 3px #14293777);
}
.arcade-trays > span::before, .arcade-trays > span::after, .arcade-trays i {
  position: absolute;
  clip-path: var(--tray-step);
  content: "";
}
.arcade-trays > span::before { inset: 0; background: #13262e; }
.arcade-trays > span::after {
  inset: 2px;
  background: linear-gradient(157deg, var(--tray-highlight), #548d81 55%, #3d8f81 79%, #abd0b1);
}
.arcade-trays i {
  z-index: 1;
  inset: 5px;
  background:
    linear-gradient(90deg, #214c49 0 3px, #478a77 3px 5px, transparent 5px calc(100% - 5px),
      #2d665d calc(100% - 5px) calc(100% - 3px), #17443e calc(100% - 3px)),
    linear-gradient(#357668 0 3px, #235449 3px 5px, #19292c 5px calc(100% - 5px),
      #23594f calc(100% - 5px) calc(100% - 2px), #357b6c calc(100% - 2px));
}
.shop #board-shell[data-bridge="true"] { --tray-highlight: #f9d482; }
.shop #board {
  grid-auto-rows: auto;
  gap: 2px;
}
.shop #board .cell[data-seam="end"] { margin-bottom: calc(var(--tray-rim) + 1px); }
.shop #board .cell[data-seam="start"] { margin-top: calc(var(--tray-rim) + 1px); }
.shop #board::after {
  inset: calc(50% - 2px) 12% auto;
  height: 4px;
  border-radius: 0;
  opacity: 0;
}
.shop [data-bridge="true"] #board::after {
  opacity: 1;
  background: repeating-linear-gradient(90deg, #fff0b4 0 7px, transparent 7px 11px);
  box-shadow: none;
}
.shop #board .cell { border-radius: clamp(3px, .9vw, 5px); }
.shop #board .cell:not(:is(.block, .ghost, .overlap, .clear-mark, .clearing)) {
  border-color: #ad9980;
  background: linear-gradient(155deg, #f8ebce, #efdfbf);
  box-shadow: inset 0 0 0 1px #fff4d9, inset -1px -2px #b99b7366;
}
.shop #board .cell.block:not(.overlap) {
  border-color: #748890;
  background: repeating-linear-gradient(137deg, #4a5c65 0 3px, #596d75 3px 5px);
  box-shadow: inset 0 0 0 1px #364b56;
}
.shop #board .ingredient[data-kind] { --ingredient-size: 96%; }

/* Small tiled eaves frame the live visitors. The snowy street shows between the posts. */
.shop #orders {
  row-gap: clamp(78px, 10.3svh, 88px);
}
.shop #orders .order-card {
  --eave-depth: clamp(12px, 2.4svh, 21px);
  padding: calc(var(--eave-depth) - 1px) 1px 2px;
  gap: 1px;
  border: 0;
  border-radius: 0;
  background: none;
  box-shadow: none;
  overflow: visible;
}
.shop #orders .order-card::before {
  position: absolute;
  inset: -3px -2px auto;
  z-index: 1;
  height: calc(var(--eave-depth) + 3px);
  background:
    linear-gradient(#ebeadd 0 12%, #87a4a4 12% 19%, #1d3942 19% 38%, #b3c0ad 38% 43%,
      transparent 43% 78%, #688a89 78% 87%, #223139 87% 94%, #806247 94%),
    repeating-linear-gradient(111deg, #223e48 0 4px, #456970 4px 6px, #73968d 6px 7px, #30525a 7px 10px);
  clip-path: polygon(
    2% 0, 10% 0, 10% 12%, 17% 12%, 17% 22%, 23% 22%, 23% 31%, 77% 31%,
    77% 22%, 83% 22%, 83% 12%, 90% 12%, 90% 0, 98% 0, 98% 21%, 91% 21%,
    91% 37%, 87% 37%, 87% 50%, 91% 50%, 91% 64%, 96% 64%, 96% 77%, 100% 77%,
    100% 94%, 95% 94%, 95% 100%, 5% 100%, 5% 94%, 0 94%, 0 77%, 4% 77%,
    4% 64%, 9% 64%, 9% 50%, 13% 50%, 13% 37%, 9% 37%, 9% 21%, 2% 21%
  );
  pointer-events: none;
  content: "";
}
.shop #orders .order-card:not([data-service="closed"])::after {
  position: absolute;
  inset: calc(var(--eave-depth) - 3px) 7% 7%;
  z-index: -1;
  background:
    radial-gradient(ellipse 6px 9px at 8% 8%, #ffe4a7 0 34%, #b75b3c 38% 57%, transparent 62%),
    radial-gradient(ellipse 6px 9px at 92% 8%, #ffe4a7 0 34%, #b75b3c 38% 57%, transparent 62%),
    linear-gradient(90deg, #564743 0 2px, #a58364 2px 3px, transparent 3px calc(100% - 3px),
      #90715b calc(100% - 3px) calc(100% - 2px), #564743 calc(100% - 2px)),
    linear-gradient(#23333eaa 0, #26394946 35%, #344f5736 73%, transparent);
  pointer-events: none;
  content: "";
}
.shop #orders .dish-art[data-dish] {
  --dish-size: min(82%, 9.6svh, 80px);
}
.shop #orders .guest {
  width: min(98%, 12.2svh, 104px);
  aspect-ratio: 1;
}
.shop #orders .guest-body { background-size: 300% 100%; }
.shop #orders .recipe-food {
  padding: 2px 4px;
  border-color: #ad8c60;
  border-radius: 2px;
  background: #3f3025e3;
  box-shadow: inset 0 1px #e2bf723d, 0 2px #253539a3;
}
.shop #orders .recipe-food .ingredient[data-kind] {
  --ingredient-size: min(5.7vw, 2.8svh, 23px);
}
.shop #orders .order-card[data-hit="true"] .dish-art {
  filter: drop-shadow(0 0 4px #ffdf9c) drop-shadow(0 0 3px #f7b748);
}
.shop #orders .order-card[data-service="serving"] {
  box-shadow: none;
}
.top-actions { gap: 4px; }
body[data-layout="c"] .top-actions #restart {
  height: 37px;
}
.top-actions #restart .nmo-tool-art { top: -2px; width: 38px; }

/* The paper counter is the same size in play and on the recovery screen. */
body[data-layout="c"] .prep.stack-shelf {
  border: 2px solid #7fa090;
  border-radius: 0;
  clip-path: var(--step-frame);
  background: #192b3b;
  box-shadow: inset 0 0 0 2px #1b383c, inset 0 0 0 4px #78998e;
}
.shop .prep.stack-shelf[data-recovery] { background: var(--shelf-paper); }
.shop .prep #current-piece, .shop .prep .supply-next {
  border-radius: 4px;
  border-color: #6e7772;
  background: #304554;
  box-shadow: inset 0 1px 4px #1528348a;
}
.shop .prep .supply-next { background: #223546; }
.shop .prep #current-piece::after { color: #cdb893; }
.shop .prep .supply-next::before { border-color: #a79378; }
.shop .prep .next-tile:not([data-revealed])::after {
  border-color: #cab38f;
  background: #22354660;
}
.shop .prep :is(#stack-hint, #market-sound) {
  border-radius: 5px;
  border-color: #bd8247;
  color: #4e372f;
  background: #e8d2a9;
  box-shadow: inset 0 0 0 1px #fff2ce, 0 2px #755132;
}
.shop #stack-hint i { box-shadow: inset 0 0 0 2px #96281c65; }

.shop .stack-recovery {
  inset: 4px;
  grid-template: "title title" auto "missing retry" minmax(0, 1fr)
    / minmax(0, 1fr) clamp(77px, 31%, 120px);
  gap: 1px 7px;
  padding: 3px 5px;
  border: 0;
  border-radius: 0;
  color: #5f3024;
  background: #f7e1b7;
  box-shadow: none;
}
.recovery-title {
  grid-area: title;
  margin: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  text-align: center;
  font: 900 clamp(15px, 2.4svh, 19px)/1.15 "Microsoft YaHei UI", "Noto Sans CJK SC", sans-serif;
  letter-spacing: .035em;
}
.recovery-title::before, .recovery-title::after {
  width: 15px;
  height: 2px;
  background: #aa6046;
  content: "";
}
.shop .stack-shortages {
  grid-area: missing;
  gap: 0;
}
.shop .stack-shortage {
  gap: 3px;
  min-width: 0;
  min-height: 25px;
  padding: 1px 2px;
  border: 0;
  border-radius: 0;
  background: none;
}
.shop .stack-shortage + .stack-shortage { border-top: 1px dashed #bc8e65; }
.shop .stack-shortage .ingredient[data-kind] { --ingredient-size: 23px; width: 23px; height: 23px; }
.shop .stack-done { color: #36624f; }
.recovery-guest {
  display: block;
  flex: none;
  width: 28px;
  height: 23px;
  background: url("guests.webp") var(--guest-x, 7.85%) var(--guest-y, 4.45%) / 543% 226.25% no-repeat;
  image-rendering: pixelated;
}
.stack-shortage[data-guest="zhou"], .recovery-guest[data-guest="zhou"] {
  --guest-x: 46.3%;
  --guest-y: 6.45%;
}
.stack-shortage[data-guest="xiaoman"], .recovery-guest[data-guest="xiaoman"] {
  --guest-x: 88.6%;
  --guest-y: 12.4%;
}
.shop .stack-rewind {
  grid-area: retry;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  width: 100%;
  height: 44px;
  padding: 0 4px;
  border: 2px solid #69302a;
  border-radius: 0;
  clip-path: var(--step-frame);
  color: #ffe8b2;
  background: linear-gradient(#bc4935, #9b2e28 63%, #7c231e);
  box-shadow: inset 0 0 0 1px #eea264, inset 0 0 0 3px #a4312b, inset 0 -4px #772823;
  font: 900 clamp(16px, 2.6svh, 22px)/1 "Microsoft YaHei UI", "Noto Sans CJK SC", sans-serif;
  white-space: nowrap;
  touch-action: manipulation;
}
.shop .stack-rewind::before {
  display: block;
  width: clamp(17px, 3svh, 25px);
  aspect-ratio: 1;
  flex: none;
  background: currentColor;
  clip-path: polygon(
    2% 28%, 41% 0, 41% 12%, 62% 12%, 62% 18%, 76% 18%, 76% 26%, 89% 26%,
    89% 40%, 97% 40%, 97% 68%, 89% 68%, 89% 81%, 76% 81%, 76% 90%, 63% 90%,
    63% 97%, 35% 97%, 35% 90%, 21% 90%, 21% 81%, 10% 81%, 10% 68%, 3% 68%,
    3% 54%, 22% 54%, 22% 66%, 31% 66%, 31% 74%, 41% 74%, 41% 79%,
    60% 79%, 60% 74%, 69% 74%, 69% 66%, 78% 66%, 78% 44%, 72% 44%, 72% 36%,
    61% 36%, 61% 30%, 41% 30%, 41% 46%
  );
  content: "";
}
.shop .stack-rewind:active:not(:disabled) { translate: 0 1px; }
.shop .stack-rewind:focus-visible {
  outline: none;
  box-shadow: inset 0 0 0 3px #fff3bd;
}
.shop #board[data-recovery="true"] .cell { filter: saturate(.8) brightness(.85); }

@media (max-height: 670px) {
  .shop #orders .guest { width: min(98%, 11.2svh); }
  .shop #orders .dish-art[data-dish] { --dish-size: min(78%, 8.4svh); }
  .shop #orders .recipe-food .ingredient[data-kind] { --ingredient-size: min(5.7vw, 3svh, 23px); }
  .shop .stack-recovery { gap: 1px 4px; padding-inline: 3px; }
}

/* Open pavilion fronts let the winter scene show through. */
.shop #orders .order-card:not([data-service="closed"])::after {
  inset-inline: 8%;
  background:
    radial-gradient(ellipse 4px 6px at 6% 7%, #ffe0a3 0 31%, #b75d37 39% 63%, transparent 71%),
    radial-gradient(ellipse 4px 6px at 94% 7%, #ffe0a3 0 31%, #b75d37 39% 63%, transparent 71%),
    linear-gradient(90deg, #55443ad9 0 2px, #b59d81c7 2px 3px, transparent 3px calc(100% - 3px),
      #b59d81c7 calc(100% - 3px) calc(100% - 2px), #55443ad9 calc(100% - 2px));
}
.shop #orders .order-card::before {
  inset: -7px -3px auto;
  height: calc(var(--eave-depth) + 7px);
  background:
    linear-gradient(#f1f2e7 0 21%, transparent 21%) left top / 14% 100% no-repeat,
    linear-gradient(#f1f2e7 0 21%, transparent 21%) right top / 14% 100% no-repeat,
    linear-gradient(transparent 28%, #d6e0d7 28% 41%, transparent 41%) center / 74% 100% no-repeat,
    linear-gradient(#284958 0 53%, transparent 53% 77%, #6d8d88 77% 84%, #21333d 84% 94%, #866141 94%),
    repeating-linear-gradient(112deg, #284a58 0 4px, #426771 4px 6px, #7c9b97 6px 7px, #375b63 7px 10px);
  clip-path: polygon(
    1% 7%, 6% 7%, 6% 0, 12% 0, 12% 14%, 17% 14%, 17% 25%, 24% 25%, 24% 34%,
    76% 34%, 76% 25%, 83% 25%, 83% 14%, 88% 14%, 88% 0, 94% 0, 94% 7%, 99% 7%,
    99% 25%, 95% 25%, 95% 46%, 91% 46%, 91% 59%, 95% 59%, 95% 72%, 100% 72%,
    100% 92%, 96% 92%, 96% 100%, 4% 100%, 4% 92%, 0 92%, 0 72%, 5% 72%, 5% 59%,
    9% 59%, 9% 46%, 5% 46%, 5% 25%, 1% 25%
  );
}

/* Each order ingredient gets the same seat and its own completion mark. */
.shop #orders .recipe-food {
  --recipe-seat: min(6.4vw, 3.5svh, 27px);
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: var(--recipe-seat);
  place-items: center;
  gap: 4px;
  min-height: calc(var(--recipe-seat) + 7px);
  padding: 2px 4px 3px;
  border: 1px solid #bd945d;
  border-radius: 2px;
  background: linear-gradient(#53372d, #332826);
  box-shadow: inset 0 1px #e2c39183, inset 0 -2px #63442b, 0 2px #22323883;
}
.shop #orders .food-requirement {
  width: var(--recipe-seat);
  height: var(--recipe-seat);
}
.shop #orders .recipe-food .ingredient[data-kind] {
  --ingredient-size: 100%;
}
.shop #orders .food-requirement.filled::after {
  right: -1px;
  bottom: 2px;
  width: 11px;
  height: 6px;
  border-color: #d7f4ae;
  filter: drop-shadow(0 1px #23312b) drop-shadow(0 0 1px #23312b);
}

.shop .stack-shelf:not([data-recovery]) .supply-pieces {
  grid-template-columns: minmax(0, 1.75fr) minmax(60px, 1fr);
  align-items: stretch;
  gap: 7px;
}
.shop .stack-shelf:not([data-recovery]) #current-piece {
  padding-inline: 4px 12px;
  border-color: #6d7b7b;
  background: radial-gradient(ellipse at 46% 44%, #3d5060, transparent 74%), #263b4e;
}
.shop .stack-shelf:not([data-recovery]) #current-piece::after { right: 5px; bottom: 4px; }
.shop .stack-shelf:not([data-recovery]) .supply-next {
  padding-inline: 7px 4px;
  border: 0;
  border-left: 1px solid #bf9f68b3;
  border-radius: 0;
  background: #192b3b;
  box-shadow: none;
}
.shop .stack-shelf:not([data-recovery]) .supply-next::before { content: none; }
.shop .stack-shelf:not([data-recovery]) .next-tile:not([data-revealed]) { background: transparent; }
.shop .stack-shelf:not([data-recovery]) .next-tile:not([data-revealed])::before { content: none; }
.shop .stack-shelf:not([data-recovery]) .next-tile:not([data-revealed])::after {
  inset: 2px;
  border-color: #c8ae85;
  background: none;
}

.shop .stack-tools {
  grid-template-columns: 44px;
  grid-template-rows: repeat(2, 44px);
  gap: 3px;
}
.shop .prep :is(#stack-hint, #market-sound) {
  --key-edge: polygon(0 7px, 2px 7px, 2px 4px, 5px 4px, 5px 2px, 7px 2px, 7px 0,
    37px 0, 37px 2px, 39px 2px, 39px 4px, 42px 4px, 42px 7px, 44px 7px, 44px 37px,
    42px 37px, 42px 40px, 39px 40px, 39px 42px, 37px 42px, 37px 44px, 7px 44px,
    7px 42px, 5px 42px, 5px 40px, 2px 40px, 2px 37px, 0 37px);
  clip-path: var(--key-edge);
  border: 0;
  border-radius: 0;
  color: #ffdb91;
  background:
    linear-gradient(#29384c, #141c2e 80%) center / 33px 33px no-repeat,
    linear-gradient(#ffe4a2 0 3px, #dba459 3px 10px, #e4a252 24px, #b76c38 39px, #804a2d 39px);
  box-shadow: inset 0 0 0 1px #8c5334;
}
.shop .prep :is(#stack-hint, #market-sound):focus-visible {
  outline: none;
  box-shadow: inset 0 0 0 2px #fff7d3;
}
.shop .prep #stack-hint i {
  width: 24px;
  height: 26px;
  border: 0;
  background: none;
  box-shadow: none;
}
.shop .prep #stack-hint i::before {
  inset: 4px 1px 4px;
  width: auto;
  height: auto;
  border-radius: 0;
  background:
    linear-gradient(90deg, #8b312b 0 14%, transparent 14% 86%, #8b312b 86%),
    repeating-linear-gradient(90deg, #b85334 0 2px, transparent 2px 5px),
    linear-gradient(#d97038, #ffcb63 52%, #aa432e);
  clip-path: polygon(18% 0, 82% 0, 82% 12%, 94% 12%, 94% 28%, 100% 28%, 100% 74%,
    94% 74%, 94% 88%, 82% 88%, 82% 100%, 18% 100%, 18% 88%, 6% 88%, 6% 74%, 0 74%,
    0 28%, 6% 28%, 6% 12%, 18% 12%);
  transform: none;
}
.shop .prep #stack-hint i::after {
  inset: 1px auto auto 8px;
  width: 8px;
  height: 3px;
  border-radius: 0;
  background: #f2c27b;
  box-shadow: 0 21px #f2c27b, 2px 24px #b26e42;
  transform: none;
}

/* Keep the original carved wooden key and set its three copper cash coins into a dark rail. */
.shop #undo .nmo-tool-art {
  top: -3px;
  width: clamp(46px, 6.55svh, 55px);
}

.shop #undo .tool-count {
  gap: 3px;
  padding: 2px 4px;
  border-color: #bc8c51;
  background: #432821;
  box-shadow: inset 0 1px #794b33, 0 1px 1px #2c1718c9;
}

.shop #undo .tool-count i {
  position: relative;
  width: 9px;
  border-color: #8a6849;
  background: #51372a;
}

.shop #undo .tool-count i[data-filled="true"] {
  border-color: #edcb85;
  background: linear-gradient(145deg, #efd299 18%, #cc9052 62%, #955e38);
  box-shadow: inset 0 0 0 1px #a875456b;
}

.shop #undo .tool-count i::after {
  position: absolute;
  inset: 2px;
  background: #452d22;
  content: "";
}

.shop #undo:focus-visible {
  outline: 2px solid #fff1c5;
  outline-offset: 2px;
}

/* The recovery card belongs to the same prep slot, with its own stepped red ink frame. */
body[data-layout="c"] .shop .prep.stack-shelf[data-recovery] {
  border-color: #3f231c;
  background: #ffe8ba;
  box-shadow: inset 0 0 0 2px #e4ab60, inset 0 0 0 4px #9d4733, inset 0 0 0 5px #ffd888;
}

.shop .stack-shelf[data-recovery] > :is(.supply-pieces, .stack-tools) {
  display: none;
}

.shop .stack-recovery {
  inset: 6px;
  grid-template-columns: minmax(0, 1fr) clamp(81px, 36%, 135px);
  gap: 2px 8px;
  padding: 1px 6px;
  color: #55251e;
  background: transparent;
}

.shop .recovery-title {
  font-size: clamp(16px, 2.65svh, 21px);
}

.shop .recovery-title::before,
.shop .recovery-title::after {
  width: 13px;
  height: 5px;
  background: #ac5037;
  clip-path: polygon(0 40%, 36% 40%, 36% 0, 100% 0, 100% 65%, 67% 65%, 67% 40%,
    55% 40%, 55% 100%, 36% 100%, 36% 65%, 0 65%);
}

.shop .recovery-title::after { transform: scaleX(-1); }

.shop .stack-shortages {
  border-right: 1px solid #c58059;
  padding-right: 6px;
}

.shop .stack-shortage {
  gap: 4px;
  min-height: 26px;
}

.shop .stack-shortage:has(.ingredient)::after {
  order: 1;
  width: 5px;
  height: 8px;
  flex: none;
  margin-right: 2px;
  background: #8c4330;
  clip-path: polygon(0 0, 44% 0, 44% 25%, 100% 25%, 100% 75%, 44% 75%, 44% 100%, 0 100%);
  content: "";
}

.shop .stack-shortage .ingredient[data-kind] {
  order: 2;
  --ingredient-size: clamp(22px, 3.1svh, 26px);
  width: var(--ingredient-size);
  height: var(--ingredient-size);
}

.shop .stack-rewind {
  height: clamp(44px, 6.2svh, 52px);
  gap: 5px;
  padding-inline: 6px;
  border-color: #60271d;
  color: #fff1bd;
  background:
    linear-gradient(#c53828 0 16%, #b12620 16% 78%, #972722 78% 100%);
  box-shadow: inset 0 0 0 1px #edb060, inset 0 0 0 3px #841c1b,
    inset 0 5px 0 #d65732, inset 0 -5px 0 #611f1b;
  text-shadow: 0 1px #6f2619;
}

.shop .stack-rewind:focus-visible {
  box-shadow: inset 0 0 0 2px #fff3bd, inset 0 0 0 4px #662018;
}

@media (max-width: 335px) {
  .shop .stack-recovery { gap: 1px 5px; padding-inline: 2px; }
  .shop .stack-shortages { padding-right: 4px; }
  .shop .stack-shortage { gap: 3px; }
}

/* Lacquered red frames use hard colour steps so the bevel stays crisp at phone size. */
[data-theme="paper"] .shop #board-shell {
  --arcade-edge: #451c20;
  --arcade-red: #bf3728;
  --arcade-light: #ffd994;
  --arcade-inset: #60231f;
}

[data-theme="paper"] .shop .arcade-trays > span {
  filter: drop-shadow(0 2px 0 #481d25dd) drop-shadow(0 5px 3px #34253166);
}

[data-theme="paper"] .shop .arcade-trays > span::before {
  background: var(--arcade-edge);
}

[data-theme="paper"] .shop .arcade-trays > span::after {
  background:
    linear-gradient(90deg, #f07a48 0 1px, transparent 1px calc(100% - 2px), #83261f calc(100% - 2px)),
    linear-gradient(var(--arcade-light) 0 2px, #e86e40 2px 4px,
      var(--arcade-red) 4px calc(100% - 5px), #a83024 calc(100% - 5px) calc(100% - 2px),
      #77241f calc(100% - 2px));
}

[data-theme="paper"] .shop .arcade-trays i {
  background:
    linear-gradient(90deg, #e9844b 0 1px, #a92f24 1px 3px, #7c281f 3px 5px,
      transparent 5px calc(100% - 5px), #7b241f calc(100% - 5px) calc(100% - 3px),
      #ae3628 calc(100% - 3px) calc(100% - 1px), #e27b46 calc(100% - 1px)),
    linear-gradient(#ffd394 0 1px, #d75934 1px 3px, #923224 3px 5px,
      var(--arcade-inset) 5px calc(100% - 5px), #8d2d24 calc(100% - 5px) calc(100% - 3px),
      #c44a2f calc(100% - 3px) calc(100% - 1px), #ef9e5e calc(100% - 1px));
}

[data-theme="paper"] .shop #board-shell:is([data-bridge="true"], [data-dual="true"]) {
  --arcade-light: #fff1b3;
}

[data-theme="paper"] .shop #board .cell {
  border-radius: 2px;
}

[data-theme="paper"] .shop #board .cell:not(:is(.block, .ghost, .overlap, .clear-mark, .clearing)) {
  border-color: #aa694a;
  background: #f6e5c5;
  box-shadow: inset 1px 2px #fff4db, inset -2px -2px #d9b886;
}

[data-theme="paper"] .shop #board .cell.block:not(.overlap) {
  border-color: #534450;
  background: repeating-linear-gradient(135deg, #4a4350 0 3px, #58505d 3px 5px);
  box-shadow: inset 1px 1px #6c5f6b, inset -1px -1px #353039;
}

/* The work surface echoes a red woodblock print on warm paper. */
body[data-theme="paper"][data-layout="c"] .shop .stack-shelf:not([data-recovery]) {
  grid-template-columns: minmax(0, 1fr) auto;
  gap: clamp(4px, 1.8vw, 8px);
  padding: 8px clamp(6px, 2.4vw, 11px);
  border-color: #713027;
  background:
    radial-gradient(circle at 0 100%, #b84230 0 5px, transparent 5px 8px, #b84230 8px 11px, transparent 11px 14px, #b84230 14px 17px, transparent 17px)
      left 4px bottom 4px / 23px 20px no-repeat,
    radial-gradient(circle at 100% 100%, #b84230 0 5px, transparent 5px 8px, #b84230 8px 11px, transparent 11px)
      right 4px bottom 4px / 17px 15px no-repeat,
    linear-gradient(154deg, #fff0cb, #f5dfb3 81%, #efce98);
  box-shadow:
    inset 0 0 0 2px #a6352a, inset 0 0 0 3px #e8a25f,
    inset 0 0 0 4px #b65236, inset 0 -6px #cf8b55;
}

body[data-theme="paper"] .shop .stack-shelf:not([data-recovery]) .supply-pieces {
  grid-template-columns: minmax(0, 1.85fr) minmax(44px, 1fr);
  gap: clamp(2px, 1.1vw, 5px);
}

body[data-theme="paper"] .shop .stack-shelf:not([data-recovery]) #current-piece {
  container-type: inline-size;
  padding-inline: 3px 8px;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

body[data-theme="paper"] .shop .stack-shelf:not([data-recovery]) #current-piece::after {
  right: 1px;
  bottom: 2px;
  color: #934333;
}

body[data-theme="paper"] .shop .stack-shelf:not([data-recovery]) #current-piece:focus-visible {
  outline-color: #994230;
}

body[data-theme="paper"] .shop .stack-shelf:not([data-recovery]) #piece {
  --piece-unit: min(44px, 11.2vw, calc((100cqw - 3px) / var(--piece-cols, 2)), calc((var(--stack-height) - 24px) / var(--piece-span, 2)));
}

body[data-theme="paper"] .shop .stack-shelf:not([data-recovery]) #piece .joined-tile::before {
  border-color: #ad5b39;
  background: #9f392b;
  box-shadow: 0 2px #6e2b28, 0 3px 3px #793f3352;
}

body[data-theme="paper"] .shop .stack-shelf:not([data-recovery]) .supply-next {
  padding-inline: 3px;
  border: 0;
  background: transparent;
}

body[data-theme="paper"] .shop .stack-shelf:not([data-recovery]) #next {
  --piece-unit: min(27px, 7vw, calc((100cqw - 3px) / var(--piece-cols, 2)), calc((var(--stack-height) - 24px) / var(--piece-span, 2)));
}

body[data-theme="paper"] .shop .stack-shelf:not([data-recovery]) .next-tile:not([data-revealed])::after {
  inset: 1px;
  border-color: #a97a8b;
}

body[data-theme="paper"] .shop .stack-shelf:not([data-recovery]) .stack-tools {
  grid-template-columns: repeat(2, 44px);
  grid-template-rows: 44px;
  gap: clamp(3px, 1.35vw, 6px);
  align-self: center;
  padding: 10px 0 10px clamp(4px, 1.5vw, 8px);
  border-left: 1px solid #b75f444f;
}

body[data-theme="paper"] .shop .stack-shelf:not([data-recovery]) :is(#stack-hint, #market-sound) {
  color: #ffe5a7;
  background:
    linear-gradient(#c65a3b 0 1px, #a5342b 1px 77%, #852721 77%) center / 34px 34px no-repeat,
    linear-gradient(#6c2924 0 2px, #e29b5f 2px 5px, #b85538 5px 86%, #792e28 86%);
  box-shadow: inset 0 0 0 1px #692720;
}

body[data-theme="paper"] .shop .stack-shelf:not([data-recovery]) :is(#stack-hint, #market-sound):focus-visible {
  box-shadow: inset 0 0 0 3px #fff3be;
}

body[data-layout="c"] .shop .table {
  grid-template-columns: 30.5% minmax(0, 1fr);
}

.shop #orders {
  row-gap: clamp(88px, 11.4svh, 97px);
}

.shop #orders .order-card {
  padding: 0 0 2px;
  gap: clamp(2px, .4svh, 4px);
  border: 0;
  border-radius: 0;
  background: none;
  box-shadow: none;
  overflow: visible;
}

.shop #orders .order-card:is([data-hit="true"], [data-service="serving"]) {
  box-shadow: none;
  animation: none;
}

.shop #orders .order-card::before,
.shop #orders .order-card:not([data-service="closed"])::after {
  content: none;
}

.shop #orders .order-card[data-service="closed"]::after {
  background: #efd49b;
  filter: drop-shadow(0 1px 1px #334c59);
}

.shop #orders .dish-art[data-dish] {
  --dish-size: min(99%, 12.7svh, 112px);
  filter: drop-shadow(0 2px 0 #50606a5c) drop-shadow(0 4px 3px #253e5090);
}

.shop #orders .order-card[data-hit="true"] .dish-art[data-dish] {
  filter: drop-shadow(0 0 3px #f6c670) drop-shadow(0 2px 1px #253e50bb);
}

.shop #orders .recipe-food {
  gap: 4px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: none;
  box-shadow: none;
  --recipe-seat: min(6.4vw, 3svh, 25px);
  min-height: var(--recipe-seat);
}

.shop #orders .food-requirement {
  filter: drop-shadow(0 1px 1px #29414ab8);
}

.shop #orders .guest {
  width: min(88%, 10.8svh, 98px);
  aspect-ratio: 1;
  pointer-events: none;
}

.shop #orders .guest[data-street-entering] {
  animation: street-guest-enter var(--street-entrance) cubic-bezier(.2, .6, .32, 1) both;
  animation-delay: var(--street-entry-delay);
}

.shop #orders .guest-walk[data-street-route] {
  filter: none;
  animation: street-guest-roam var(--street-cycle) linear infinite both;
  animation-delay: var(--street-roam-delay);
}

.shop #orders [data-service="serving"] .guest-walk[data-street-route] {
  animation-play-state: paused;
}

.shop #orders .guest-walk[data-street-route] .guest-body {
  filter: drop-shadow(0 1px 0 #202b35a3);
  animation: street-guest-step .46s steps(1, end) infinite;
}

.shop #orders .order-card:not([data-service="serving"]) .guest-walk[data-street-route] .guest-plate {
  animation-delay: 0s;
}

.street-step-shadow {
  position: absolute;
  inset: auto 28% 1% 20%;
  height: 8%;
  border-radius: 50%;
  background: #172f4d6a;
  filter: blur(1px);
}

@keyframes street-guest-enter {
  0% { opacity: 0; transform: translate(var(--street-entry-x), -24%) scale(.58); }
  23% { opacity: 1; }
  58% { transform: translate(calc(var(--street-entry-x) * .34), -10%) scale(.84); }
  100% { opacity: 1; transform: translate(0, 0) scale(1); }
}

@keyframes street-guest-roam {
  0% { transform: translate(var(--street-left), 0) scaleX(1); }
  18% { transform: translate(0, var(--street-up)) scaleX(1); }
  40%, 45% { transform: translate(var(--street-right), 0) scaleX(1); }
  45.1% { transform: translate(var(--street-right), 0) scaleX(-1); }
  67% { transform: translate(0, var(--street-down)) scaleX(-1); }
  92%, 99.9% { transform: translate(var(--street-left), 0) scaleX(-1); }
  100% { transform: translate(var(--street-left), 0) scaleX(1); }
}

@keyframes street-guest-step {
  0%, 100% { translate: 0; }
  50% { translate: 0 -1.5px; }
}

@media (prefers-reduced-motion: reduce) {
  .shop #orders .guest[data-street-entering],
  .shop #orders .guest-walk[data-street-route],
  .shop #orders .guest-walk[data-street-route] :is(.guest-body, .guest-plate) {
    animation: none;
  }
}

/* 月桥夜摊 · 雪色、朱漆与灯火。 All controls remain live DOM targets. */
body.moonbridge[data-theme="paper"]{--street-art:url("moon-street.webp");--street:#344858;background:#101a28}
body.moonbridge[data-theme="paper"][data-layout="c"] .shop{
  width:min(100%,51svh,476px);background-position:center top;background-size:100% 100%;padding-inline:clamp(5px,1.9vw,9px);
}
.moonbridge .top-controls{height:clamp(44px,12svh,110px);justify-content:flex-end;padding:2px 3px 0}
.moonbridge .top-controls nav{display:none}
.moonbridge #progress[data-display="percent"]{min-height:27px;margin:2px 0 0;gap:6px;flex:0 0 clamp(90px,28vw,128px);background:linear-gradient(#32252b,#211c27);color:#fff1cb;border:2px solid #e4ac63;box-shadow:0 0 0 1px #422526,inset 0 0 0 1px #825734,0 3px 0 #322631aa;border-radius:12px 5px}
.moonbridge .service-progress-track{height:6px;background:#654c44}
.moonbridge .service-progress-fill{background:linear-gradient(#ffda89,#f2a14d)}
.moonbridge [data-progress-value]{min-width:33px;font-size:15px}
body.moonbridge[data-layout="c"] .table{grid-template-columns:30.6% minmax(0,1fr);gap:clamp(6px,1.2svh,10px) 1.15%}
.moonbridge .shop #board-shell{--tray-rim:clamp(8px,2.55vw,12px);--arcade-edge:#281e2a;--arcade-red:#a83027;--arcade-light:#fff0b2;--arcade-inset:#5c2c28}
.moonbridge .shop #board .cell:not(:is(.block,.ghost,.overlap,.clear-mark,.clearing)){border-radius:5px;border-color:#b77847;background:linear-gradient(145deg,#ffeac6,#f5d8ad);box-shadow:inset 1px 2px #fff4d7,inset -2px -2px #cd9b68}
.moonbridge .shop #board .cell.block:not(.overlap){background:repeating-linear-gradient(135deg,#5a5263 0 2px,#484458 2px 5px);border-color:#423b49}
.moonbridge .arcade-trays > span:after{box-shadow:inset 0 0 0 2px #e8af6a}
.moonbridge .shop .arcade-trays i{border-inline:1px solid #d7a461}
.moonbridge .shop #orders{row-gap:clamp(78px,10.5svh,94px)}
.moonbridge .shop #orders .order-card{position:relative;isolation:isolate;--roof-h:clamp(23px,4.1svh,34px);padding:calc(var(--roof-h) * .74) 1px 1px;gap:1px;align-content:space-evenly}
.moonbridge .shop #orders .order-card:not([data-service="closed"])::before{content:"";position:absolute;inset:-4px -2px auto;height:var(--roof-h);z-index:-1;background:url("red-awning.svg") center top/100% 100% no-repeat;clip-path:none;pointer-events:none}
.moonbridge .shop #orders .order-card[data-side="1"]:not([data-service="closed"])::before{background-image:url("tile-awning.svg")}
.moonbridge .shop #orders .order-card:not([data-service="closed"])::after{content:"";position:absolute;inset:calc(var(--roof-h)*.5) 5% 4px;z-index:-2;background:linear-gradient(90deg,#60402ed4 0 2px,#e6b87d 2px 3px,transparent 3px calc(100% - 3px),#ba865c calc(100% - 3px) calc(100% - 1px),#493133 calc(100% - 1px)),linear-gradient(180deg,#fed89bad,#fff1d97a 63%,#fbebd99c);border-bottom:2px solid #9c6846;box-shadow:0 3px 3px #27303c40;pointer-events:none}
.moonbridge .shop #orders .guest{width:min(82%,11.2svh,92px)}
.moonbridge .shop #orders .dish-art[data-dish]{--dish-size:min(89%,11.2svh,101px)}
.moonbridge .shop #orders .recipe-food{--recipe-seat:min(7vw,3.3svh,26px);padding:1px 4px;background:#f5d7a8;border:1px solid #ab7749;box-shadow:0 2px #5b3a30}
.moonbridge .shop #orders .food-requirement{filter:none}
.moonbridge .shop .ingredient[data-kind="shrimp"]{--stamp:url("shrimp.webp")}
.moonbridge .shop .ingredient[data-kind="egg"]{--stamp:url("egg.webp")}
.moonbridge .shop .ingredient[data-kind="spinach"]{--stamp:url("spinach.webp")}
.moonbridge .shop .ingredient[data-kind="tofu"]{--stamp:url("tofu.webp")}
.moonbridge .shop .ingredient[data-kind="mushroom"]{--stamp:url("mushroom.webp")}
.moonbridge .shop .ingredient:is([data-kind="shrimp"],[data-kind="egg"],[data-kind="spinach"],[data-kind="tofu"],[data-kind="mushroom"]){background:var(--stamp) center/100% 100% no-repeat;clip-path:polygon(6% 0,94% 0,100% 6%,100% 94%,94% 100%,6% 100%,0 94%,0 6%)}
.moonbridge .shop #board .ingredient[data-kind]{--ingredient-size:98%}
body.moonbridge[data-layout="c"] .shop .prep.stack-shelf:not([data-recovery]){
  padding:7px clamp(8px,2.7vw,14px);gap:5px;
  background:url("plum.svg") left -6px bottom -7px / 44px 37px no-repeat,url("plum.svg") right -9px bottom -8px / 38px 30px no-repeat,radial-gradient(ellipse at 38% -100%,#365770,#182c42 70%);
  border:2px solid #573326;box-shadow:inset 0 0 0 2px #ebba70,inset 0 0 0 3px #815642,inset 0 0 0 5px #19384a,inset 0 -6px #b28450}
body.moonbridge[data-theme="paper"] .shop .stack-shelf:not([data-recovery]) #current-piece{background:transparent;box-shadow:none}
body.moonbridge[data-theme="paper"] .shop .stack-shelf:not([data-recovery]) #current-piece::after{color:#d6a765;font-size:15px}
body.moonbridge[data-theme="paper"] .shop .stack-shelf:not([data-recovery]) .next-tile:not([data-revealed])::after{border-color:#dbbc83}
body.moonbridge[data-theme="paper"] .shop .stack-shelf:not([data-recovery]) .stack-tools{border-left:1px solid #bd995e8c}
body.moonbridge[data-theme="paper"] .shop .stack-shelf:not([data-recovery]) :is(#stack-hint,#market-sound){color:#ffe4a0;background:linear-gradient(#973c31 0 14%,#762d29 15% 74%,#531e25 76%) center / 34px 34px no-repeat,linear-gradient(#ffda8d,#c7884c 65%,#905530);box-shadow:inset 0 0 0 1px #62372f}
.moonbridge .shop .stack-shelf[data-recovery] .stack-rewind{font-weight:900}
.moonbridge .shop:has(.stack-recovery:not([hidden])) #board-shell {filter:brightness(.78) saturate(.82)}
.moonbridge .shop:has(.stack-recovery:not([hidden])) #orders .dish-art{filter:brightness(.78)}
.moonbridge .nmo-finale__panel{background:linear-gradient(140deg,#fff1ce,#f3d7a5);border-color:#a24432;box-shadow:inset 0 0 0 2px #fbdf9f,inset 0 0 0 4px #be8c56,0 5px #55372a}
.moonbridge #nmo-finale-next{background:linear-gradient(#bb4535,#852725);border-color:#bc8a48;color:#fff0c5}
@media(max-height:710px){body.moonbridge[data-layout="c"] .shop{width:min(100%,49.3svh)}.moonbridge .top-controls{height:clamp(32px,8svh,58px)}.moonbridge .shop #orders .dish-art[data-dish]{--dish-size:min(82%,9svh)}.moonbridge .shop #orders .guest{width:min(83%,9.2svh)}.moonbridge .shop #orders{row-gap:79px}}

/* The bridge stays visible above the stalls on tall phones. The original art keeps its aspect ratio. */
body.moonbridge[data-theme="paper"][data-layout="c"] .shop{background-size:cover;background-position:46% top}
body.moonbridge[data-layout="c"] .table{margin-block-start:auto}
.moonbridge .shop .top-controls{flex-grow:0}
@media(min-height:740px){body.moonbridge[data-layout="c"] .shop{padding-bottom:max(12px,env(safe-area-inset-bottom))}}
