/* Slice and Bake. Point of view (design/VISUAL_ROUND.md): the order spike of a one-oven home bakery. Duplicate slips torn from a
   carbon pad, a floured board, raw dough logs with a cut face, and a black steel tray out of the oven.
   Sizes follow taste/ACCESSIBLE_PLAY.md: rule 22 (zh 24), body and buttons 20, HUD 24, title 28, nothing under 18. */
:root {
  --walnut:#35251A; --walnut-2:#2C1E15; --board:#EDE4D1; --flour:#F6F1E6; --slip:#FBF6EA; --slip-rule:#B4432F; --carbon:#23408E;
  --ink:#24180F; --muted:#5E4B3A; --brass:#C2913F; --brass-dark:#7A5520; --tray:#26272A; --tray-edge:#45474C;
  --matcha:#7E9A3C; --vanilla:#F0DFB2; --cocoa:#4F3326; --ok:#3F5E17;
  --serif: Georgia, "Noto Serif TC", "Songti TC", serif; --sans: system-ui, -apple-system, "Segoe UI", "Noto Sans TC", "PingFang TC", sans-serif;
  --mono: "Courier Prime", "Courier New", ui-monospace, "Noto Sans TC", monospace;
}
* { box-sizing:border-box; }
html, body { margin:0; background:var(--walnut); color:var(--ink); font:20px/1.45 var(--sans); touch-action:manipulation; }
html:lang(zh-Hant) body, html:lang(zh-Hant) body * { line-height:1.6 !important; }
body { min-width:320px; background-image:repeating-linear-gradient(90deg, rgba(0,0,0,.10) 0 1px, transparent 1px 9px, rgba(255,255,255,.025) 9px 10px, transparent 10px 31px); }
button { font:inherit; color:inherit; cursor:pointer; -webkit-tap-highlight-color:transparent; }
button:focus-visible, a:focus-visible { outline:3px solid var(--brass); outline-offset:2px; }
[hidden] { display:none !important; }
.app { width:min(100%, 520px); min-height:100svh; margin:0 auto; padding:0 14px max(8px, env(safe-area-inset-bottom)); color:var(--flour); }

/* top bar: the name once, language, menu */
.top { display:flex; align-items:center; justify-content:space-between; gap:6px; min-height:52px; }
.brand { display:flex; align-items:center; gap:9px; min-height:44px; padding:0; border:0; background:none; color:var(--flour); font:400 28px/1.45 var(--serif); letter-spacing:-.01em; text-align:left; white-space:nowrap; }
.brand svg { flex:none; }
.top-actions { display:flex; gap:2px; }
.text-button { white-space:nowrap; min-width:44px; min-height:44px; border:0; background:transparent; color:#EADBC0; font:600 20px/1.45 var(--sans); padding:4px 8px; border-radius:4px; }
.text-button:active { background:rgba(255,255,255,.12); }
.text-button.small { color:var(--muted); font-size:20px; text-decoration:underline; text-underline-offset:4px; text-decoration-thickness:1px; }
.text-button.small:disabled { visibility:hidden; }

/* the order slip: a duplicate pad, printed rule and number in red, the request in carbon blue */
.ticket { position:relative; display:flex; gap:12px; align-items:center; margin:2px 0 0; padding:8px 12px 12px 14px; background:var(--slip); color:var(--ink);
  border-top:4px solid var(--slip-rule); box-shadow:0 2px 0 rgba(0,0,0,.25); transform:rotate(-.4deg); }
.ticket::after { content:""; position:absolute; right:24%; top:-9px; width:8px; height:8px; border-radius:50%; background:#1b1b1b; box-shadow:0 0 0 3px #8a8a8a; }
.ticket .t { flex:1; min-width:0; }
.ticket .k { font:700 18px/1.45 var(--mono); color:var(--slip-rule); letter-spacing:.02em; }
.ticket .k .who, .kicker .who { font:400 18px/1.45 var(--sans); color:var(--muted); letter-spacing:0; }
.ticket h2 { margin:2px 0 0; font:400 22px/1.45 var(--serif); color:var(--carbon); }
html:lang(zh-Hant) .ticket h2 { font-size:24px; }
.ticket .want .ok { color:var(--ok); font-weight:700; }
.ticket .want .ok::before { content:"✓ "; }
.ticket .want { flex:none; width:84px; text-align:center; font:400 18px/1.45 var(--sans); color:var(--muted); }
.ticket .want svg { display:block; width:68px; height:68px; margin:0 auto 2px; }
.ticket .want .pair { display:flex; gap:4px; justify-content:center; }
.ticket .want .pair svg { width:34px; height:34px; margin:0; }

/* a rule the first time its move is on the table */
.rule-line { margin:8px 0 0; padding:6px 12px; border-left:4px solid var(--brass); background:var(--walnut-2); color:#F6EBD3; font:400 22px/1.45 var(--sans); }
html:lang(zh-Hant) .rule-line { font-size:24px; }

/* the board: a floured bench, the cut face of the log */
.bench { display:flex; flex-direction:column; align-items:center; margin:8px -14px 0; padding:6px 14px 0; background:var(--board); color:var(--ink);
  background-image:radial-gradient(rgba(255,255,255,.6) 1px, transparent 1.4px); background-size:13px 11px; border-top:2px solid #C9B993; border-bottom:2px solid #C9B993; }
.log { width:var(--logsize, 220px); height:var(--logsize, 220px); }
.log svg { display:block; width:100%; height:100%; }
.log.settle svg { animation:settle .28s cubic-bezier(.2,.9,.3,1.25); }
@keyframes settle { from { transform:scale(.9) rotate(-2deg); } to { transform:none; } }
.log.halves { width:auto; height:auto; display:flex; gap:14px; justify-content:center; align-items:flex-start; }
.half { margin:0; width:auto; min-width:var(--half, 120px); min-height:44px; text-align:center; font:600 18px/1.45 var(--sans); color:var(--muted); padding:3px; border:3px solid transparent; border-radius:8px; background:transparent; display:block; }
.half { position:relative; }
.half span { display:block; margin-top:2px; white-space:nowrap; }

.half svg { display:block; margin:0 auto; width:var(--half, 120px); height:var(--half, 120px); }
.half.on { border-color:var(--brass); background:rgba(194,145,63,.16); color:var(--ink); }
.half.on span::before { content:"▸ "; }
.countrow { display:flex; align-items:center; justify-content:space-between; gap:8px; width:100%; min-height:44px; }
.counter { margin:0; font:400 20px/1.45 var(--sans); color:var(--muted); font-variant-numeric:tabular-nums; }
.counter b { font:700 24px/1.45 var(--serif); color:var(--ink); }
.counter .ok { color:var(--ok); font-weight:700; }
.counter .ok::before { content:"✓ "; }

/* what you do (P1SB56): the flavour picker is its own framed panel with its own label; the move cards sit under it; the action
   row (Undo, Cut and bake) comes after a clear gap and a rule, on the bare walnut, so nobody reads a dough as an action */
.cards { display:grid; gap:8px; margin:10px 0 0; }
.moverow { display:grid; grid-template-columns:repeat(3, minmax(0, 1fr)); gap:8px; }
.moverow.n1 { grid-template-columns:minmax(0, 1fr); } .moverow.n2 { grid-template-columns:repeat(2, minmax(0, 1fr)); }
.moverow.n4 { grid-template-columns:repeat(4, minmax(0, 1fr)); gap:6px; }
.card { display:flex; align-items:center; justify-content:center; gap:6px; min-height:48px; padding:3px 4px; border:2px solid var(--ink); border-radius:6px; background:var(--slip); color:var(--ink);
  font:700 20px/1.45 var(--sans); text-align:left; box-shadow:0 3px 0 #120b07; transition:transform .06s, box-shadow .06s; }
.card:active { transform:translateY(3px); box-shadow:0 0 0 #120b07; background:#EFE5CF; }
.card:disabled { opacity:.4; box-shadow:none; }
.card .ico { flex:none; width:36px; height:36px; display:block; }
.card .ico svg { width:36px; height:36px; display:block; }
.moverow.n4 .card { padding:3px 2px; }
.moverow.n4 .card .ico { display:none; }
.wraprow { display:grid; grid-template-columns:repeat(3, minmax(0, 1fr)); gap:8px; margin:0; padding:0 8px 8px; min-width:0;
  border:2px solid rgba(226,196,136,.55); border-radius:14px; background:rgba(0,0,0,.22); box-shadow:inset 0 1px 0 rgba(255,255,255,.05); }
.wraprow .lbl { padding:0 6px; margin:0 0 0 2px; font:600 18px/1.45 var(--sans); color:#E8CF98; }
/* a dough chip is a piece of that dough: its colour, its fleck, a pressed edge */
.dough { display:flex; align-items:center; justify-content:center; min-height:48px; padding:0 4px; border:2px solid var(--ink); border-radius:24px; color:var(--ink);
  font:700 20px/1.45 var(--sans); box-shadow:0 3px 0 #120b07, inset 0 -4px 0 rgba(0,0,0,.14); transition:transform .06s, box-shadow .06s; }
.dough:active { transform:translateY(3px); box-shadow:0 0 0 #120b07, inset 0 -2px 0 rgba(0,0,0,.14); filter:brightness(.94); }
.dough.d0 { background:var(--matcha) radial-gradient(#3F5520 1px, transparent 1.4px) 0 0 / 7px 7px; color:#16100A; }
.dough.d1 { background:var(--vanilla) radial-gradient(rgba(42,29,21,.55) .7px, transparent 1.1px) 0 0 / 9px 8px; }
.dough.d2 { background:var(--cocoa) radial-gradient(#A47A60 1px, transparent 1.5px) 0 0 / 8px 9px; color:#FBF6EA; }
.dough span { padding:1px 6px; border-radius:10px; }
.dough.d0 span { background:rgba(126,154,60,.9); } .dough.d1 span { background:rgba(240,223,178,.9); } .dough.d2 span { background:rgba(79,51,38,.9); }
.hint { animation:hint 1.4s ease-in-out 3; }
@keyframes hint { 50% { box-shadow:0 3px 0 #120b07, 0 0 0 6px rgba(194,145,63,.8); } }

.actions { display:flex; gap:8px; margin:12px 0 0; padding-top:12px; border-top:2px dashed rgba(234,219,192,.28); }
.ghost { min-height:50px; padding:0 16px; border:2px solid #CDBB98; border-radius:6px; background:transparent; color:var(--flour); font:700 20px/1.45 var(--sans); }
.ghost:active:not(:disabled) { background:rgba(255,255,255,.1); transform:translateY(1px); }
.ghost:disabled { opacity:.45; }
.bake { flex:1; min-height:50px; padding:0 14px; border:2px solid var(--ink); border-radius:6px; background:var(--brass); color:var(--ink); box-shadow:0 4px 0 #120b07;
  font:700 22px/1.45 var(--serif); letter-spacing:.01em; transition:transform .06s, box-shadow .06s; }
.bake:active:not(:disabled) { transform:translateY(4px); box-shadow:0 0 0 #120b07; }
.bake:disabled { background:transparent; color:#C9B897; border:2px dashed #8a765c; box-shadow:none; }
.bake.ready { animation:ready .9s ease-out 2; }
@keyframes ready { 40% { transform:translateY(-3px); } }
@media (prefers-reduced-motion: reduce) { .log.settle svg, .bake.ready, .hint, .slices svg { animation:none !important; } }

/* the tray out of the oven */
#tray .tray-sheet { margin:4px 0 0; padding:12px 14px 14px; background:var(--slip); color:var(--ink); border-top:4px solid var(--slip-rule); box-shadow:0 3px 0 rgba(0,0,0,.3); }
.kicker { margin:0; font:700 18px/1.45 var(--mono); color:var(--slip-rule); }
#tray h1 { margin:2px 0 0; font:400 28px/1.45 var(--serif); color:var(--carbon); }
.quote { margin:4px 0 0; font:italic 20px/1.45 var(--serif); color:var(--muted); }
.slices { display:flex; flex-wrap:wrap; justify-content:center; gap:8px 10px; margin:12px -4px 4px; padding:14px 8px; background:var(--tray); border:3px solid var(--tray-edge); border-radius:6px;
  box-shadow:inset 0 0 0 5px #2f3034, inset 0 0 0 6px #1a1b1d; }
.slices svg { width:var(--slice, 60px); height:var(--slice, 60px); animation:land .32s cubic-bezier(.2,.9,.3,1.2) backwards; }
.slices svg:nth-child(2) { animation-delay:.06s; } .slices svg:nth-child(3) { animation-delay:.12s; } .slices svg:nth-child(4) { animation-delay:.18s; } .slices svg:nth-child(5) { animation-delay:.24s; }
@keyframes land { from { transform:translateY(-10px) scale(.92); opacity:0; } }
.tally { margin:8px 0 0; font:400 20px/1.45 var(--sans); font-variant-numeric:tabular-nums; }
.tally b { font:700 24px/1.45 var(--serif); }
.vos { margin:6px 0 0; padding:0 0 0 12px; border-left:4px solid var(--brass); font:italic 20px/1.45 var(--serif); }
.vos cite { display:block; font:400 18px/1.45 var(--sans); font-style:normal; color:var(--muted); }
.bake.wide { display:block; width:100%; margin-top:12px; }
.tray-actions { display:flex; gap:8px; margin-top:8px; }
.tray-actions .ghost { flex:1; color:var(--ink); border-color:var(--ink); }
.tray-actions .ghost:active { background:rgba(0,0,0,.07); }
.note { margin:6px 0 0; font:400 18px/1.45 var(--sans); color:var(--muted); }
.note:empty { display:none; }

/* the menu: today first, then the tickets by chapter */
#menu { padding:0 0 12px; }
.menu-head { display:flex; align-items:center; justify-content:space-between; min-height:52px; }
.menu-head h1 { margin:0; font:400 28px/1.45 var(--serif); color:var(--flour); }
.orders { display:grid; gap:8px; }
h2.chapter { margin:12px 0 0; padding:0 2px; font:700 18px/1.45 var(--mono); color:#E3C88E; letter-spacing:.02em; }
.order-row { position:relative; display:flex; align-items:center; gap:10px; min-height:64px; padding:6px 10px 6px 6px; border:0; border-top:3px solid var(--slip-rule); background:var(--slip); color:var(--ink); text-align:left; }
.order-row:active { background:#EFE5CF; }
.order-row .n { flex:none; width:32px; text-align:center; font:700 20px/1.45 var(--mono); color:var(--slip-rule); }
.order-row .pic { flex:none; width:44px; height:44px; }
.order-row .pic svg { width:44px; height:44px; display:block; }
.order-row .pic:has(.pair) { width:56px; height:50px; }
.order-row .pic .pair { position:relative; display:block; width:56px; height:50px; }
.order-row .pic .pair svg { position:absolute; width:34px; height:34px; }
.order-row .pic .pair svg:first-child { left:0; top:0; } .order-row .pic .pair svg:last-child { right:0; bottom:0; }
.order-row .w { flex:1; min-width:0; font:400 20px/1.45 var(--serif); color:var(--carbon); }
.order-row .w small { display:block; font:400 18px/1.45 var(--sans); color:var(--muted); }
.order-row .d { flex:none; max-width:32%; font:700 18px/1.45 var(--sans); color:var(--ok); text-align:right; }
.order-row .d.todo { color:var(--muted); font-weight:400; }
.order-row.cur { outline:3px solid var(--brass); outline-offset:-3px; }
.menu-more { margin:14px 2px 0; font:400 18px/1.45 var(--sans); color:#E5D7BC; }
.menu-more a { color:#F3E8D2; min-height:44px; display:inline-flex; align-items:center; padding:0 2px; }

.credits { margin:10px 2px 0; color:#E5D7BC; font:400 18px/1.45 var(--sans); }
.credits summary { min-height:44px; display:flex; align-items:center; cursor:pointer; font-weight:700; }
.credits p { margin:6px 0 0; }
body p.why-exists-foot { margin:2px 0 0; }
#menu p.why-exists-foot { margin:6px 0 0; text-align:left; } #menu p.why-exists-foot .why-exists-btn { color:#F3E8D2; }
body p.why-exists-foot .why-exists-btn { min-height:44px; font-size:18px; }
@media (max-width:399px) { .brand { gap:6px; } .brand svg { width:26px; height:26px; } .card .ico, .card .ico svg { width:32px; height:32px; } }
@media (max-width:359px) { .app { padding-left:10px; padding-right:10px; } .bench { margin-left:-10px; margin-right:-10px; } .brand { font-size:24px; gap:6px; } .brand svg { display:none; }
  .ticket .want { width:62px; } .ticket .want svg { width:56px; height:56px; } .card { padding:3px 2px; } .card .ico { display:none; } .wraprow { padding:0 4px 6px; gap:5px; } .dough { padding:0 1px; } .dough span { padding:1px 2px; } }
html:lang(en) .credits p[lang="zh-Hant"], html:lang(zh-Hant) .credits p[lang="en"] { display:none; }
/* phones up to 700 px tall (360x640): tighter gaps, never smaller type */
@media (max-height:700px) {
  .top { min-height:46px; }
  .ticket { padding-bottom:8px; }
  .ticket .k .who.cust { display:none; }   /* read-once text goes first (ONE_SCREEN rule 10); the customer is on the tray */
  .rule-line { margin-top:6px; padding:4px 12px; }
  .bench { margin-top:6px; }
  .cards { margin-top:8px; gap:6px; }
  .wraprow { padding:0 6px 6px; gap:6px; }
  .moverow { gap:6px; }
  .card, .dough { min-height:46px; }
  .actions { margin-top:8px; padding-top:8px; }
  .ghost, .bake { min-height:48px; }
  .countrow { min-height:44px; }
}
/* short phones (320x568 and the like): tighten the spacing, not the type, so the bake row stays above the fold */
@media (max-height:600px) {
  .top { min-height:44px; }
  .ticket { padding:4px 12px 8px 14px; }
  .ticket h2 { margin:0; }
  .rule-line { margin:4px 0 0; padding:2px 10px; }
  .bench { margin-top:4px; padding-top:4px; }
  .cards, .wraprow, .moverow { gap:6px; }
  .cards { margin-top:6px; }
  .wraprow { padding:0 6px 6px; }
  .actions { padding-top:8px; }
  .card, .dough { min-height:44px; }
  .actions { margin-top:8px; }
  .ghost, .bake { min-height:46px; }
  .tray-actions .ghost { padding:0 8px; white-space:nowrap; }
  /* tickets 15 and 17 read on three lines at 320 wide: give back about 30 px of air (line gaps and margins, never type or targets) */
  .ticket { padding-top:2px; padding-bottom:4px; }
  .ticket h2 { line-height:1.28; }
  .ticket .k { line-height:1.2; }
  .rule-line { margin-top:2px; padding-top:1px; padding-bottom:1px; }
  .bench { margin-top:2px; }
  .cards { margin-top:4px; }
  .wraprow { padding-bottom:2px; }
  .actions { margin-top:4px; padding-top:4px; }
  .lbl { line-height:1.2; }
  .bench { padding-top:2px; }
}
