*{box-sizing:border-box}body{margin:0;background:#e9e0c9;color:#303f34;font:16px/1.35 "PingFang SC","Microsoft YaHei",sans-serif}main{max-width:640px;margin:auto;background:#fffaea;box-shadow:0 0 55px #5d4e3926}header,footer,.guest,.ribbon{display:flex;align-items:center;gap:12px}header{padding:12px 22px}.seal{border:2px solid #98432f;border-radius:8px;color:#98432f;font:900 34px serif;padding:2px 6px;transform:rotate(-5deg)}small{font-size:12px;letter-spacing:.12em}h1{margin:0;font:900 32px/1.1 "Songti SC",serif;letter-spacing:.15em}button{color:inherit;font:inherit;cursor:pointer;touch-action:manipulation}header button,footer button{margin-left:auto;border:1px solid #b7ac8f;border-radius:20px;background:#fff5d9;padding:9px 12px}.awning{height:13px;background:repeating-linear-gradient(90deg,#a54837 0 33px,#ffe6b4 33px 66px);border-bottom:3px solid #986444}.guest{padding:10px 18px;background:#e4ead6}.bubble{background:#fffdf2;border-radius:14px 14px 14px 2px;padding:8px 14px}.bubble strong{display:block}.bubble small{color:#6a7464}#number{margin-left:auto;writing-mode:vertical-rl;font-size:12px;color:#62745d}#portrait{width:75px;aspect-ratio:1;flex:none;border-radius:50%;background-image:url(plush.jpg);background-size:300% 200%;animation:bob var(--tempo,3s) infinite ease-in-out}#portrait.happy{animation:hop .42s ease-out 2}@keyframes bob{50%{transform:translateY(-3px) rotate(var(--tilt,3deg))}}@keyframes hop{50%{transform:translateY(-9px) rotate(-7deg)}}#scene{position:relative;background:#274a42}#tray{position:relative;width:100%;aspect-ratio:1.5;background:url(platter.jpg) center/100% 100%}#zones{position:absolute;inset:0;width:100%;height:100%}.zone{fill:transparent;stroke:transparent;stroke-width:5;cursor:pointer;touch-action:manipulation}.zone:hover,.zone:focus-visible{fill:#fff5ae22;stroke:#ffe7a0aa;outline:none}.ribbon{background:#294b40;color:#fff5d9;padding:8px 16px;font-size:14px}.ribbon b{border:1px solid #b9c6ab;border-radius:15px;padding:2px 9px;white-space:nowrap}.tools{padding:10px 12px;display:grid;grid-template-columns:1fr minmax(140px,38%);gap:12px;background:repeating-linear-gradient(2deg,#c19869 0 5px,#bc9065 6px 8px,#c79d73 10px 17px)}.prep{display:grid;grid-template-rows:1fr 1fr;gap:10px}#scale{background:linear-gradient(#b8bcb1,#e3e4d9 55%,#7c8377);border:2px solid #767a68;border-radius:12px;padding:5px}#pan{display:grid;place-items:center;height:43px;border-radius:50%;border:2px solid #919786;background:radial-gradient(ellipse,#c2c7bc,#eeeee8 68%,#949b90);font-size:13px}#lcd,#read{background:#d5dfbb;font:bold 18px monospace;border-radius:4px;padding:3px 8px;display:block}#lcd{margin:3px auto 0;width:fit-content;font-size:14px}#board{position:relative;overflow:hidden;border:3px solid #ba862f;background:repeating-linear-gradient(4deg,#edc365 0 7px,#e9ba59 8px 10px);border-radius:30% 20% 22% 22%;min-height:75px}#boardlabel{position:absolute;bottom:3px;left:0;right:0;font-size:12px}#slices{display:flex;justify-content:center;gap:3px;align-items:center}#blade{position:absolute;right:18%;top:8%;width:38px;height:19px;background:linear-gradient(#6f726c,#e3e6dc);border-radius:2px 3px 7px 4px;transform:rotate(-25deg);pointer-events:none}#blade:after{content:"";position:absolute;left:96%;top:0;width:25px;height:7px;border-radius:3px;background:#694638}#board.cut #blade{animation:cut .27s ease-out}@keyframes cut{0%{translate:0 -16px;rotate:-20deg}55%{translate:0 14px}100%{translate:0 0}}.calc{align-self:end;background:#4b534d;border:2px solid #313931;border-radius:12px;padding:6px 8px;box-shadow:1px 4px #665441}.calc small{color:#efe8ca}.calc output{text-align:right;margin:3px 0}#keys{display:grid;grid-template-columns:repeat(4,1fr);gap:4px}#keys button{background:#fff7de;border:0;border-radius:4px;min-height:34px;font:bold 16px monospace;box-shadow:0 2px #8e8b79}#keys button:last-child{background:#f3a263;grid-column:span 4}#keys button:disabled{opacity:.67}button:active{filter:brightness(.92)}footer{padding:10px 18px;min-height:48px}footer button{background:#285541;color:white}.foodbit{display:inline-block;width:42px;height:28px;border-radius:42%;background-image:url(platter.jpg);background-size:450px 300px;box-shadow:1px 2px 3px #0003}.sliver{width:11px;animation:slice .23s ease-out}@keyframes slice{from{transform:translateX(-8px) rotate(-10deg)}}.hand{position:fixed;z-index:5;pointer-events:none;font-size:40px;transform:translate(-50%,-50%)}.hand .foodbit{position:absolute;left:0;bottom:-3px;z-index:-1}.glow{outline:3px solid #fae08d;outline-offset:1px}button:focus-visible{outline:3px solid #ef8637}@media(min-width:700px){main{max-width:min(640px,80vh)}}@media(max-width:450px){header{padding:6px 12px}.guest{padding:6px 10px;gap:7px}#portrait{width:56px}.bubble{padding:5px 9px}.tools{gap:8px;padding:8px}.ribbon{padding:6px 10px}.seal{font-size:26px}h1{font-size:26px}}@media(prefers-reduced-motion:reduce){*,*:before,*:after{animation-duration:.01ms!important;animation-iteration-count:1!important}}
#board{touch-action:none}#board:disabled,#scale:disabled{color:inherit;opacity:1}
#tray{width:min(100%,53svh);margin:auto;aspect-ratio:1;background:radial-gradient(circle at 45% 38%,#61401e,#402211 64%,#77532a 67%,#788985 68%,#e1e1cf 69%,#60716a 70%,transparent 70.6%)}#zones{inset:0}.ingredient{position:absolute;padding:0;border:0;background:transparent;transform:translate(-50%,-50%);aspect-ratio:1;touch-action:manipulation}.ingredient img{display:block;width:100%;height:100%;pointer-events:none}.ingredient:hover,.ingredient:focus-visible{filter:brightness(1.18) drop-shadow(0 0 3px #ffdb80)}.foodbit{display:inline-block;width:45px;height:45px;border-radius:0;background:transparent center/contain no-repeat;box-shadow:none}#slices{position:relative;height:100%;align-items:center}#slices .portion{position:absolute;width:min(50%,180px);aspect-ratio:1;background-size:contain;background-position:center;background-repeat:no-repeat;transition:transform .22s ease-out}#blade{display:none;background:none;border:0;inset:auto;top:4%;left:47%;width:42%;max-width:165px;height:auto;transform:rotate(-6deg);transform-origin:85% 30%}#blade:after{display:none}#blade svg{width:100%;display:block}.cutting #blade{display:block}.cutting #board.cut #blade{animation:knife .32s ease-in-out}@keyframes knife{0%{transform:translateY(-18%) rotate(-17deg)}40%{transform:translateY(33%) rotate(4deg)}58%{transform:translateY(31%) rotate(4deg)}100%{transform:translateY(0) rotate(-6deg)}}#box{display:none;position:relative;min-height:100px;border:5px double #e6fff3d9;border-radius:14px 14px 21px 21px;background:linear-gradient(115deg,#b9e4d459,#fff5 15%,#e1f9f238 24%,#b3d0c54a 84%,#fff8);box-shadow:inset 0 -8px 5px #bde6d36e,0 5px 5px #49351c47}#box:after{content:"";position:absolute;inset:5px;border:1px solid #f7ffed99;border-radius:8px;pointer-events:none}#box small{position:absolute;bottom:3px;right:8px;color:#405548}#packed{display:flex;flex-wrap:wrap;align-content:center;justify-content:center;min-height:85px;gap:1px;padding:5px 12px}.bundle{display:flex;position:relative;width:64px;height:50px}.bundle .portion{position:absolute;inset:0;background:center/contain no-repeat}.cutting #tray,.cutting #scale,.cutting .calc{display:none}.cutting .tools{display:block}.cutting .prep{grid-template-rows:auto auto;gap:12px}.cutting #board{height:clamp(170px,32svh,290px);border-radius:38px;background:repeating-linear-gradient(2deg,#d8a954 0 5px,#ddb45e 6px 9px,#e3b962 10px 16px);box-shadow:inset 0 0 0 4px #eec981,0 4px #946b37}.cutting #box{display:block}.cutting #boardlabel{font-weight:600;bottom:10px}.cutting #board:disabled #blade{opacity:.4}.cutting.packing #blade{display:none}#board.cut{animation:impact .32s}@keyframes impact{42%{transform:translateY(2px)}64%{transform:translateY(0)}}.bundle{animation:land .32s ease-out}@keyframes land{from{transform:translateY(-25px) rotate(-7deg);opacity:.2}}
.sausage-face:after{content:"";position:absolute;left:50%;top:41%;width:6%;height:23%;border-radius:45%;background:radial-gradient(ellipse at 40% 35%,#f9c0a0 0 8%,transparent 10%),radial-gradient(ellipse at 60% 68%,#f8b99b 0 7%,transparent 9%),#d87d65;border:1px solid #a74938}
#tray{background:#334940 url(stall-photo.jpg) center/100% 100% no-repeat}
#zones>svg{position:absolute;inset:0;width:100%;height:100%}
#pan{height:65px}#pan .foodbit{width:74px;height:64px;filter:drop-shadow(0 3px 2px #44372455)}
.hand .foodbit{width:56px;height:56px;left:-12px;bottom:-18px}
.cutting .prep{grid-template-rows:auto}
.peek{position:fixed;pointer-events:none;z-index:6;width:75px;height:75px;background-color:#fff5dd;border-radius:50%;border:2px solid #d2b57e;transform:translate(-50%,-95%);box-shadow:0 4px 12px #31291c55}
#machine{display:grid;grid-template-columns:1fr auto;align-items:center;padding:6px 8px;gap:4px;background:linear-gradient(170deg,#484c49,#232b2c 80%);border-radius:6px;box-shadow:0 4px 1px #484336}#machine #scale{grid-column:span 2;background:transparent;border:0;padding:0}#machine #pan{height:64px;border-radius:5px;border:3px ridge #d2d6d3;background:repeating-linear-gradient(2deg,#ffffff10 0 1px,transparent 1px 5px),linear-gradient(155deg,#909690,#e4e8e7 24%,#aab1af 53%,#f1f3ef 72%,#a8ada9);box-shadow:inset 0 0 0 3px #acb2b0,0 3px #616966}#lcd{color:#d6fa98;background:#182421}#weigh{background:#c95d40;color:white;border-radius:5px;border:1px solid #944431;min-height:40px}.cutting #machine{display:none}#bowl,#bag{display:none}.cutting #bowl{display:grid;place-items:center;position:relative;width:164px;aspect-ratio:1;margin:6px auto;border-radius:50%;border:6px double #eff8f4;background:radial-gradient(circle,#dbe8dc99 52%,#e4f8f160 55%,#edf7ffab 70%,#abc1b0);box-shadow:inset 2px -7px 8px #667a7066,0 6px 6px #53381f45}#contents{width:80%;display:flex;flex-wrap:wrap;justify-content:center}.closed #lid{position:absolute;inset:-6px;border-radius:50%;border:6px double #effff8;background:linear-gradient(135deg,#ffffff88,#e2eeef44 37%,#ffffff80 39%,#e6efef45 47%);animation:land .35s ease-out}#scene[data-step=done] #bowl{display:none}#scene[data-step=done] #bag{display:grid;place-items:center;width:140px;height:126px;margin:28px auto 6px;background:linear-gradient(100deg,#b58b60,#e0bc88 20%,#cfaa75 82%,#997649);position:relative;color:#725431;font:bold 18px serif;box-shadow:1px 6px 7px #54391a44;animation:land .35s ease-out}#bag:before{content:"";position:absolute;top:-26px;width:54px;height:34px;border:5px solid #a47e50;border-bottom:0;border-radius:24px 24px 0 0}.cutting[data-step=lid] #board,.cutting[data-step=bag] #board,.cutting[data-step=done] #board{display:none}
#portrait{background-size:contain;background-repeat:no-repeat;background-position:center;background-color:#fff5df;width:85px;height:85px;border-radius:18px;box-shadow:0 3px 0 #c8bfa333}.guest{background:#f5e9da}.bubble{box-shadow:0 3px 0 #cab89844}.awning{background:repeating-linear-gradient(90deg,#c87766 0 32px,#fff2d5 32px 64px)}#scene{background:#f4e8d7}#finished{position:absolute;left:4%;top:14%;height:68%;display:flex;flex-flow:column wrap;align-content:flex-start;pointer-events:none;z-index:1}#finished .bundle{width:clamp(18px,6vw,45px);height:32%;min-height:18px}#finished .portion,#contents .portion{position:absolute;inset:0;background:center/contain no-repeat}#scene:is([data-step=chop],[data-step=settle]) #bowl{display:none}
#tray{border-radius:50%;overflow:hidden}#zones .zone{stroke:none;fill:transparent;-webkit-tap-highlight-color:transparent}#scene[data-step=pick] .zone:is(:hover,:active,:focus-visible){stroke:none;fill:url(#foodLight);filter:none}#zones svg{touch-action:manipulation}
#tray{background-color:#f7e9d8}#scene[data-step=pick] .zone.pressed{fill:url(#foodLight)}
.tools{background:#f6e7cf;align-items:end;grid-template-columns:1fr 36%;gap:10px}
#machine{position:relative;display:block;background:#f7e5cb url(counter-scale.jpg) center/100% 100% no-repeat;aspect-ratio:1.35;box-shadow:none;border:0;padding:0;border-radius:12px}#machine #scale{position:absolute;top:1%;left:1%;height:61%;width:98%;background:none}#machine #pan{height:100%;border:0;background:none;box-shadow:none}#machine #lcd{position:absolute;bottom:13%;left:6%;width:53%;font-size:clamp(13px,2.4vw,18px);padding:3px;letter-spacing:0;color:#d9f1a8}#weigh{position:absolute;bottom:9%;right:5%;font-size:14px;min-height:32px}.prep{grid-template-rows:auto auto}
#board,.cutting #board{background:#e7b64b url(block.jpg) center/100% 100% no-repeat;border:none;box-shadow:none;border-radius:48%;height:auto;aspect-ratio:2.4}
.cutting #board{aspect-ratio:1.4;max-width:460px;width:100%;margin:auto;height:auto}
.calc{position:relative;aspect-ratio:191/247;width:100%;background:#f6e7cf url(talking-calc.jpg) center/100% 100% no-repeat;padding:0;border:0;box-shadow:none;border-radius:10px}.calc small{position:absolute;bottom:100%;left:0;width:100%;font-size:12px;text-align:center;color:#665c4b}.calc #read{position:absolute;top:12%;left:14%;width:69%;height:14%;margin:0;border:0;background:#949782;color:#263322;padding:2px 4px;font-size:clamp(16px,3vw,24px);overflow:hidden}#keys{position:absolute;inset:0;display:block;margin:0}#keys button,#keys button:last-child{position:absolute;transform:translate(-50%,-50%);padding:0;border:0;width:14%;height:10%;min-height:0;background:transparent;color:transparent;box-shadow:none;border-radius:2px}#keys button:last-child{height:18%}#keys button:hover:enabled,#keys button:active:enabled{background:#ffbd6555}#keys button[aria-label="退"]{color:white;background:#424039;font-size:12px}#keys button:focus-visible{outline:2px solid #cb7238}
.cutting #machine{display:none}.tools .glow{outline-color:#e4ac63}#boardlabel{background:#fff6dfcb;padding:1px 7px;border-radius:12px;left:50%;right:auto;transform:translateX(-50%);white-space:nowrap}
#scene[data-step=key] #tray{width:min(47%,21svh)}
#scene[data-step=key] .tools{grid-template-columns:minmax(0,1fr) minmax(0,62%);align-items:center}
#scene[data-step=key] .calc{max-width:300px;justify-self:end}
@media(max-width:550px){#tray{width:min(94%,43svh)}#portrait{width:62px;height:62px}.tools{grid-template-columns:minmax(0,1fr) 35%}.prep{min-width:0}#machine{aspect-ratio:1.6}.guest{padding:6px 12px}}
/* A flush replacement for the two panels of the physical scale. */
#machine #lcd,#machine #weigh{position:absolute;top:64%;bottom:auto;margin:0;height:28%;box-sizing:border-box;border:2px inset #373a30;border-radius:4px;display:flex;align-items:center;justify-content:center;line-height:1;min-height:0}
#machine #lcd{left:5.5%;width:52%;font:600 clamp(13px,3.2vw,22px)/1 monospace;background:#262922;color:#f4e6bd;letter-spacing:0;padding:0}
#machine #weigh{left:59%;right:auto;width:35%;background:linear-gradient(#c57354,#a25135);color:#fff7df;font-size:clamp(16px,3.3vw,22px);letter-spacing:.12em;font-weight:700;opacity:1}
.calc #read{background:#ebd9b4;color:#302b24;font:600 clamp(18px,4vw,34px)/1 monospace;height:15%;display:flex;align-items:center;justify-content:flex-end;padding:0 5px}
#keys button[aria-label="退格"]{background:linear-gradient(#67645e,#423f3b);border-radius:15%;color:#fff3dd;font:600 clamp(12px,2.4vw,18px) sans-serif;border:1px solid #928c79}
header #sound{font-size:12px;padding:4px 9px;min-height:28px}
#finished .bundle{width:clamp(38px,10vw,66px);height:33%}#contents .bundle{width:58px;height:48px}#bowl #contents{position:relative;z-index:1}#lid{z-index:2}
#scene[data-step=packing] .bundle{animation:none}#scene[data-step=done] .prep{position:relative;display:grid;place-items:center;padding:38px 0 10px}
#scene[data-step=done] #bowl{display:grid;grid-area:1/1;width:138px;aspect-ratio:1.5;margin:14px 0 0;transform:rotate(-5deg);animation:bagDrop .55s ease-out}
#scene[data-step=done] #bag{grid-area:1/1;z-index:3;pointer-events:none;width:174px;height:144px;margin:0;border-radius:16% 12% 18% 19%;border:1px solid #f4fbf5c9;background:linear-gradient(73deg,#acbcb048,transparent 12%,#fff9 13%,transparent 16%,transparent 71%,#fff6 72%,transparent 76%),linear-gradient(118deg,#eef8f38c,#fff2 38%,#dae9df4d 70%,#fff8);box-shadow:inset 2px -5px 7px #b0bdaf61,1px 5px 7px #725a3933;animation:none}
#scene[data-step=done] #bag:before{border:4px double #e7efe5d9;border-bottom:0;top:-33px;height:39px;width:85px;background:transparent}
.bag-seal{border:2px solid #9f4b3a;color:#9f4b3a;border-radius:6px;font:900 22px/1.25 serif;padding:0 4px;transform:rotate(-6deg)}
@keyframes bagDrop{from{transform:translateY(-26px) rotate(2deg);opacity:.6}to{transform:rotate(-5deg)}}
/* Keep the calculator in its station at a constant photographic aspect ratio. */
.calc{aspect-ratio:713/900;background-image:url(desk-calc.jpg);background-size:contain;background-repeat:no-repeat}
.calc #read{left:13.5%;top:10.8%;width:74%;height:16.5%;border-radius:3px;background:#a49d71;color:#242116;font:600 clamp(17px,3vw,25px)/1 monospace}
#keys button{width:19%;height:12%}#keys button[aria-label="0"]{width:38%}#keys button:last-child{width:19%;height:39%}
#scene[data-step=key] #tray{width:min(100%,53svh)}#scene[data-step=key] .tools{grid-template-columns:1fr 36%}#scene[data-step=key] .calc{max-width:none}
@media(max-width:550px){#scene[data-step=key] #tray{width:min(94%,43svh)}#scene[data-step=key] .tools{grid-template-columns:minmax(0,1fr) 35%}}
#scale,#zones svg,#zones path{touch-action:none}#scale:enabled{cursor:grab}#scale.drag-source #pan .foodbit{opacity:.22}
.drag-food{position:fixed;z-index:20;width:74px;height:74px;pointer-events:none;transform:translate(-50%,-60%);filter:drop-shadow(1px 5px 4px #45301d55)}
#scene[data-step=key] .calc,#scene[data-step=held] #machine,#scene[data-step=chop] #board,#scene[data-step=transfer] #board,#scene[data-step=serve] #bowl{outline:3px solid #eab548;outline-offset:2px;box-shadow:0 0 15px #ecb242aa}
#scene[data-step=transfer] #scale.glow{outline:none}
#scene{--portion-size:clamp(65px,17vw,102px)}
#slices .portion,#finished .bundle{width:var(--portion-size);height:var(--portion-size);aspect-ratio:1}
#finished{display:block;left:3%;top:6%;height:93%;width:35%}#finished .bundle{position:absolute;left:0;top:0;animation:park .38s ease-out}#finished .bundle:nth-child(2){top:21%;left:19%}#finished .bundle:nth-child(3){top:38%;left:2%}
@keyframes park{from{translate:80% 8%;opacity:.75}to{translate:0 0;opacity:1}}
#board{min-height:calc(var(--portion-size) + 20px)}#board #slices{transform:translateX(9%)}
#blade,.cutting #blade{background:transparent url(cleaver.png) center/contain no-repeat;width:46%;height:auto;aspect-ratio:291/184;max-width:none;top:5%;pointer-events:none}
#blade:after{display:none}
#bowl,.cutting #bowl{background:#f7e7cd url(round-tub.png) center/100% 100% no-repeat;width:clamp(155px,36vw,195px);aspect-ratio:181/179;border:0;border-radius:24px;box-shadow:none}
#bowl #contents{transform:translateY(8%);width:77%;min-height:0;gap:0}
#bowl #lid{top:3%;left:1%;right:1%;bottom:auto;height:55%}
#scene[data-step=done] #bowl{display:none}
#scene[data-step=done] #bag{width:180px;height:210px;background:transparent url(thin-bag.png) center/contain no-repeat;border:0;box-shadow:none;border-radius:10px}
#bag:before,.bag-seal{display:none}#scene[data-step=done] .ribbon,footer #serve{background:#ffe6a4;color:#4e3c27}footer #serve{border-color:#d8b363}
#board #blade,.cutting #board #blade{aspect-ratio:1674/940;width:54%;left:calc(49% + var(--cut-offset,0px));top:33%;transform:rotate(-3deg);transform-origin:85% 80%}
.cutting #board.cut #blade{animation:bladeContact .35s both}
@keyframes bladeContact{0%{transform:translate(2%,-14%) rotate(1deg)}34%{transform:translate(-1%,7%) rotate(-4deg)}56%{transform:translate(-1%,7%) rotate(-4deg)}100%{transform:translate(0,0) rotate(-3deg)}}
#board.cut #slices{animation:yieldToBlade .35s ease-in-out;transform-origin:58% 60%}
@keyframes yieldToBlade{0%,100%{transform:translateX(9%) scaleY(1)}34%,47%{transform:translateX(9%) scaleY(var(--give,.88))}72%{transform:translateX(9%) scaleY(1.02)}}
#contents,#bagContents{position:relative;isolation:isolate}
#bowl #contents{width:74%;height:51%;min-height:0;transform:translateY(15%);overflow:hidden;border-radius:45%}
#contents .bundle,#bagContents .bundle{position:absolute;left:0;top:3%;width:61%;height:85%;transform:rotate(var(--heap-tilt)) scale(var(--heap-scale));animation:none}
#contents .bundle:nth-child(2),#bagContents .bundle:nth-child(2){left:36%;top:7%}
#contents .bundle:nth-child(3),#bagContents .bundle:nth-child(3){left:18%;top:25%}
#bagContents .portion{position:absolute;inset:0;background:center/contain no-repeat}
#scene[data-step=done] #bag{background-image:url(empty-carry.png);position:relative;overflow:hidden}
#bagContents{position:absolute;left:23%;top:65%;width:57%;height:25%;border-radius:38%;overflow:hidden;filter:saturate(.92);opacity:.93}
#bagContents:after{content:"";position:absolute;inset:0;background:linear-gradient(111deg,transparent 19%,#fff6 20%,transparent 24%,transparent 78%,#fff4 81%,transparent 85%);pointer-events:none}
@media(prefers-reduced-motion:reduce){#board.cut #slices,.cutting #board.cut #blade{animation:none}}

/* The knife edge and both photographed cut faces share a diagonal on the board. */
#slices .divided, .bundle .divided { display:grid; place-items:center; }
.cut-piece {
 position:absolute; width:var(--art-size); height:var(--art-size);
 background-position:center; background-size:contain; background-repeat:no-repeat;
 pointer-events:none;
}
#knifePivot {
 position:absolute; pointer-events:none; width:54%; aspect-ratio:1674/940;
 left:calc(59% + var(--portion-size) * var(--knife-offset,0)); top:50%;
 transform:translate(-21%,-38%); z-index:2;
}
#board #knifePivot #blade { inset:0; width:100%; height:100%; transform:rotate(-3deg); }
.cutting #board:disabled.cut #blade { opacity:1; }
#board.cut #slices { animation-duration:350ms; }
#finished .bundle { animation:none; }
#finished:empty { display:none; }

/* The contents use the same portion unit on the board and inside the tub. */
#packStation { display:none; }
.packing #packStation {
 position:relative; display:grid; align-items:end; justify-items:center;
 width:100%; height:calc(var(--portion-size) * 3.8); margin:auto; isolation:isolate;
}
.packing #packStation > * { grid-area:1 / 1; }
#scene.packing #board { display:block; }
#scene.packing .prep { grid-template-rows:auto auto; padding:0; gap:0; }
#scene.packing #bowl {
 position:relative; display:block; width:calc(var(--portion-size) * 2.65); height:auto; aspect-ratio:181/179;
 padding:0; margin:0; border:0; border-radius:0; overflow:visible; transform:none;
 background:none; box-shadow:none; animation:none;
}
#bowl::before, #bowl::after {
 content:""; position:absolute; inset:0; pointer-events:none;
 background:url(round-tub.png) center / 100% 100% no-repeat;
 clip-path:polygon(0 31%,1% 23%,5% 16%,12% 10%,23% 4%,38% 1%,55% 0,68% 2%,82% 7%,92% 14%,98% 23%,100% 32%,97% 42%,85% 82%,79% 88%,69% 94%,56% 97%,41% 97%,29% 94%,19% 88%,14% 80%,4% 45%);
}
#bowl::after {
 z-index:2; opacity:.22;
 mask-image:linear-gradient(to bottom,transparent 45%,black 66%);
}
#scene[data-step=serve] #bowl { outline:0; filter:drop-shadow(0 0 4px #efae34); }
#scene.packing #bowl #contents {
 position:absolute; inset:0; width:100%; height:100%; display:block;
 transform:none; overflow:visible; border-radius:0; z-index:1;
}
#bowl #contents .bundle {
 position:absolute; top:var(--landing-y); left:var(--landing-x); width:var(--portion-size); height:var(--portion-size);
 transform:translate(-50%,calc(-1 * var(--sole))); transform-origin:center var(--sole);
}
#contents .landed::before {
 content:""; position:absolute; left:15%; width:70%; height:6%; top:calc(var(--sole) - 5%);
 background:#55300b45; border-radius:50%; filter:blur(2px);
}
#bowl #lid { pointer-events:none; }
#bowl.closed #lid {
 top:1%; left:1%; width:98%; height:64%; z-index:3; border:3px double #fbf8ecaa;
 box-shadow:inset 0 -2px 3px #92735244; background:linear-gradient(117deg,#fff2,transparent 39%,#fff4 43%,transparent 48%);
}
#scene:is([data-step=bagging],[data-step=done]) #bag {
 display:block; position:relative; grid-area:1 / 1; width:calc(var(--portion-size) * 3.75); height:100%;
 overflow:visible; border:0; margin:0; background:none; box-shadow:none; animation:none;
}
#bag::before { display:none; }
#bag::after {
 content:""; position:absolute; inset:0; background:url(carry-film.png) center bottom / 100% 100% no-repeat;
 pointer-events:none; z-index:4;
}
#bag #bagContents {
 position:absolute; display:grid; justify-items:center; align-items:end; inset:0 0 1.2%; width:auto; height:auto;
 overflow:visible; border-radius:0; isolation:auto; filter:none; opacity:1;
}
#bagContents::after { display:none; }
#bagContents #bowl { pointer-events:none; }
@media(prefers-reduced-motion:reduce) {
 #board.cut, #board.cut #slices, .cutting #board.cut #blade, #bowl.closed #lid { animation:none; }
}

/* Match the carrier silhouette at rest, with the sealed tub seated on its base. */
#scene[data-step=done] #bagContents {
 clip-path:polygon(20% 34%,80% 34%,91% 97%,85% 99%,15% 99%,9% 97%);
}
#bag::after { background-size:100% 100%; }

/* Keep the cutting surface at the same scale through weighing and chopping. */
#scene .tools { display:grid; grid-template-columns:minmax(0,1fr) minmax(0,54%); align-items:start; gap:14px 10px; padding:10px 12px; }
#scene .prep { display:contents; }
#machine { grid-row:1; grid-column:1; }
#scene .calc { grid-row:1; grid-column:2; align-self:start; justify-self:center; width:100%; max-width:295px; margin-top:16px; }
#scene #board {
 grid-column:1 / -1; width:100%; max-width:460px; height:auto; aspect-ratio:1.4;
 margin:0 auto; min-height:0;
}
#packStation { grid-column:1 / -1; }
#scene[data-step=key] #tray { width:min(92%,34svh); }
#scene[data-step=key] .tools { grid-template-columns:minmax(0,1fr) minmax(0,57%); }
#scene .calc #read { font-size:clamp(20px,5vw,34px); }
#scene.cutting .tools { grid-template-columns:1fr; }
#keys .add-key::after {
 position:absolute; content:""; left:50%; top:49%; width:80%; aspect-ratio:1;
 border:2px solid #fff0aa; border-radius:50%; transform:translate(-50%,-50%);
 box-shadow:0 0 8px #e7a126, inset 0 0 6px #e7a126; pointer-events:none;
}
#keys .add-key:disabled::after { display:none; }
#keys.ready-to-add .add-key::after {
 border-color:#ffdb58; border-width:3px; animation:add-ring 1s alternate infinite ease-in-out;
}
@keyframes add-ring { to { box-shadow:0 0 0 5px #ffd85d40,0 0 15px #e7a126; } }
#scene[data-step=transfer] #pan .foodbit {
 filter:brightness(1.22) saturate(1.13) drop-shadow(0 0 4px #ffcf55) drop-shadow(0 0 8px #ffc14d);
 animation:food-ready .85s alternate infinite ease-in-out;
}
@keyframes food-ready { to { filter:brightness(1.39) saturate(1.17) drop-shadow(0 0 6px #ffe17d) drop-shadow(0 0 12px #ffc14d); } }
.cutting #board.cut #blade { animation:bladeContactV12 .39s both; }
@keyframes bladeContactV12 {
 0% { transform:translate(2%,-18%) rotate(1deg); }
 19% { transform:translate(2%,-20%) rotate(1deg); }
 33%,52% { transform:translate(-1%,7%) rotate(-4deg); }
 67% { transform:translate(0,2%) rotate(-3deg); }
 100% { transform:translate(0,0) rotate(-3deg); }
}
#board.cut { animation:board-tap 390ms ease-out; }
@keyframes board-tap { 0%,32%,66%,100% { translate:0 0; } 39% { translate:0 2px; } 51% { translate:0 1px; } }

/* Opening and end-of-day tally for a single shift of six orders. */
.day-screen {
 background:#f6e7cf; color:#342c23; padding:26px 16px 34px; min-height:66svh; text-align:center;
}
.day-screen h2 { font:900 clamp(32px,8vw,48px)/1.15 "Songti SC",serif; margin:12px 0; }
.day-screen h2:focus { outline:none; }
.day-screen p { margin:12px 0 18px; }
.day-button {
 border:1px solid #c8933b; background:#ffe6a4; color:#47321c; border-radius:24px;
 min-height:46px; padding:10px 22px; font-weight:700;
}
.day-button:active { transform:translateY(2px); }
.opening-art {
 width:min(72%,305px); aspect-ratio:1; margin:10px auto 24px; border-radius:50%;
 background:url(stall-photo.jpg) center/cover; box-shadow:0 10px 20px #603a2533;
 animation:open-stall .4s ease-out both;
}
@keyframes open-stall { from { opacity:0; transform:translateY(12px); } }
#receipts {
 display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:10px;
 list-style:none; margin:24px auto 14px; padding:0; max-width:480px;
}
.receipt {
 display:flex; flex-direction:column; align-items:center; padding:5px 5px 10px;
 border-radius:12px; min-width:0; background:#fff5df; line-height:1.28;
 animation:receipt-in .38s cubic-bezier(.2,.7,.3,1) var(--reveal-delay) both;
}
@keyframes receipt-in {
 from { opacity:0; transform:translateY(-23px) scale(.91); }
 75% { opacity:1; transform:translateY(3px) scale(1.02); }
}
.receipt strong { font-size:clamp(12px,3.4vw,15px); }
.receipt span { font-size:clamp(12px,3vw,14px); margin:4px 0; }
.receipt b { margin-top:auto; color:#963d26; }
.receipt-bag {
 position:relative; width:min(100%,95px); aspect-ratio:.83; isolation:isolate;
}
.receipt-bag::after { content:""; position:absolute; inset:0; background:url(carry-film.png) center/100% 100%; pointer-events:none; }
.receipt-tub {
 position:absolute; bottom:2%; left:16%; width:68%; aspect-ratio:1.05;
 background:url(round-tub.png) center/100% 100%; border-radius:32% 32% 42% 42%; overflow:hidden;
}
.receipt-tub .bundle {
 position:absolute; width:38%; height:38%; top:var(--landing-y); left:var(--landing-x);
 transform:translate(-50%,calc(-1 * var(--sole))); animation:none;
}
.receipt-tub .bundle span { margin:0; }
#dayResult { animation:receipt-in .4s ease-out 900ms both; }
#dayTotal { display:block; color:#963d26; font-size:clamp(38px,11vw,62px); line-height:1.1; }

/* The counter clock stays visible as the player moves between stations. */
main:has(#service:not([hidden])) > header {
 position:sticky; top:0; z-index:10; background:#fffaea;
}
main:has(#opening:not([hidden])) > :is(header,.awning) { display:none; }
header:has(#shiftClock:not([hidden])) { gap:8px; }
header:has(#shiftClock:not([hidden])) #sound { margin-left:0; padding:7px 8px; white-space:nowrap; }
.shift-clock:not([hidden]) {
 display:inline-block; min-width:5ch; padding:6px 12px; border-radius:99px;
 background:#294b40; color:#fff7de; font-variant-numeric:tabular-nums;
 font-size:1.125rem; font-weight:750; white-space:nowrap;
}
header .shift-clock { margin-left:auto; }
.shift-clock.running-low { background:#963e29; }
@media(max-width:380px) {
 header:has(#shiftClock:not([hidden])) h1 { font-size:1.45rem; }
 header:has(#shiftClock:not([hidden])) small { letter-spacing:0; }
}
#opening .opening-art {
 width:min(92%,390px); aspect-ratio:auto; margin:0 auto 24px;
 border-radius:0; background:none; box-shadow:none; position:relative;
}
.stall-canopy {
 position:relative; z-index:1; height:52px; border-radius:7px 7px 12px 12px;
 background:repeating-linear-gradient(90deg,#a54837 0 10%,#ffe6b4 10% 20%);
 box-shadow:0 6px 8px #54361b38;
}
.stall-wall {
 margin:-9px 4% 0; padding:24px 0 0; background:#eac393;
 border-inline:10px solid #966544; border-radius:4px 4px 8px 8px;
 box-shadow:0 7px 12px #653d2626;
}
.stall-wall .seal {
 display:inline-block; color:#fff5df; background:#a54837;
 border:0; padding:4px 9px; font-size:2rem; transform:rotate(-4deg);
}
.stall-counter {
 display:flex; justify-content:center; align-items:center; gap:5%; margin-top:12px;
 padding:5px 9px 12px; border-bottom:15px solid #a46b42;
 background:linear-gradient(to bottom,transparent 60%,#bd8758 60%);
}
.stall-counter img { object-fit:cover; border-radius:50%; }
.stall-guest { width:20%; aspect-ratio:1; }
.stall-counter .stall-platter {
 width:42%; aspect-ratio:1; flex:none; box-shadow:0 3px 7px #59311160;
}
#openStall { display:block; margin:18px auto 0; }
#closing #dayResult { animation-delay:var(--tally-delay,900ms); }
#receipts:empty { display:none; }

/* Mobile counter: the platter stays large while the tools share two columns. */
#scene { scroll-margin-top:66px; }
#scene:not(.cutting) #tray {
 width:min(calc(100% - 20px),480px); margin:4px auto 8px;
}
#scene:not(.cutting) .tools {
 grid-template-columns:minmax(0,44%) minmax(0,1fr);
 grid-template-rows:auto auto; gap:9px 12px; align-items:end; padding:28px 12px 8px;
}
#scene:not(.cutting) #machine {
 width:min(100%,175px); justify-self:center; aspect-ratio:1.03;
}
#machine .scale-label {
 position:absolute; bottom:calc(100% + 3px); inset-inline:0; text-align:center;
 font-size:14px; font-weight:600;
}
#scene:not(.cutting) #board {
 grid-row:2; grid-column:1; width:100%; max-width:200px;
 aspect-ratio:2.18; --portion-size:clamp(28px,10vw,50px);
}
#scene:not(.cutting) .calc {
 grid-row:1 / 3; grid-column:2; align-self:stretch;
 width:100%; height:100%; max-width:255px; margin:0; aspect-ratio:auto;
 background-size:100% 100%;
}
#scene .calc small { font-size:14px; padding-bottom:2px; }
#machine #lcd,#machine #weigh { top:65%; height:27%; }
#machine #lcd { font-size:clamp(11px,3.15vw,16px); white-space:nowrap; }
#machine #weigh { font-size:clamp(12px,3.5vw,16px); letter-spacing:0; }
#scene #keys .add-key {
 width:20%; height:52%; color:#fff3dd; border:1px solid #826751; border-radius:7px;
 font:700 clamp(23px,8vw,36px)/1 sans-serif;
 background:linear-gradient(#67574a,#433931);
 box-shadow:inset 0 1px #bea68b,0 2px 2px #3b271c66;
}
#scene #keys .add-key::after { display:none; }
#scene #keys .add-key:enabled {
 outline:2px solid #ffce63; outline-offset:1px; background:linear-gradient(#7c6347,#594637);
}
#scene #keys.ready-to-add .add-key:enabled { animation:add-ring .9s alternate infinite ease-in-out; }

#board #finished {
 top:0; left:0; width:100%; height:100%; overflow:visible;
}
#board #finished .bundle { left:12%; top:38%; }
#board #finished .bundle:nth-child(2) { left:29%; top:23%; }
#board #finished .bundle:nth-child(3) { left:45%; top:38%; }
#scene:not(.cutting) #board #finished .bundle { top:17%; }
#scene:not(.cutting) #board #finished .bundle:nth-child(2) { top:8%; }
#scene:not(.cutting) #board #finished .bundle:nth-child(3) { top:13%; }

/* Move the camera in: board, cutting edge and food share the same close view. */
#scene:is([data-step=chop],[data-step=settle]) .tools { padding:0; }
#scene:is([data-step=chop],[data-step=settle]) #board {
 --portion-size:clamp(140px,47vw,220px);
 max-width:none; aspect-ratio:0.86; border-radius:0;
 background-size:175% 116%; background-position:50% 48%;
 outline:0; box-shadow:none;
}
#scene:is([data-step=chop],[data-step=settle]) #board #slices { transform:translateX(-5%); }
#scene:is([data-step=chop],[data-step=settle]) #slices { animation:none; }
#scene:is([data-step=chop],[data-step=settle]) #knifePivot {
 width:142%; left:calc(11% + var(--portion-size) * var(--knife-offset,0));
 top:11%; transform:none;
}
#scene:is([data-step=chop],[data-step=settle]) #finished .bundle {
 width:calc(var(--portion-size) * .58); height:calc(var(--portion-size) * .58);
 top:12%; left:6%;
}
#scene:is([data-step=chop],[data-step=settle]) #finished .bundle:nth-child(2) { left:25%; top:8%; }
#scene:is([data-step=chop],[data-step=settle]) #finished .bundle:nth-child(3) { left:43%; top:15%; }
#scene:is([data-step=chop],[data-step=settle]) #boardlabel { z-index:3; bottom:13px; }

#board #finished .bundle { transform-origin:top left; }

.curtain {
 position:absolute; z-index:1; top:36px; bottom:15px; width:calc(46% + 1px);
 background:repeating-linear-gradient(90deg,#743026 0%,#aa5748 7%,#7b342a 14%);
 box-shadow:inset 0 -4px 5px #4f221f44;
}
.curtain-left { left:4%; transform-origin:left center; }
.curtain-right { right:4%; transform-origin:right center; }
.stall-canopy { z-index:2; }

header:has(#income:not([hidden])) { gap:6px; }
header:has(#income:not([hidden])) h1 { font-size:clamp(18px,5vw,28px); white-space:nowrap; }
header:has(#income:not([hidden])) .seal { font-size:clamp(20px,6vw,32px); }
header:has(#income:not([hidden])) small { display:none; }
#income:not([hidden]) {
 display:grid; place-items:center; margin-left:auto; padding:0 7px; height:34px;
 border-radius:99px; background:#ffe7ae; color:#4c371f; font:bold 12px/1 system-ui; white-space:nowrap;
}
header:has(#income:not([hidden])) :is(#shiftClock,#sound) {
 display:grid; place-items:center; box-sizing:border-box; min-width:0; height:34px;
 margin-left:0; padding:0 7px; font-size:13px;
}
#scene #keys .add-key { opacity:1; }
#scene #board { position:relative; display:grid; border:0; padding:0; cursor:default; text-align:center; }
#scene[data-step=chop] #board { cursor:pointer; }
#scene:is([data-step=serve],[data-step=packing],[data-step=lid]) #board {
 max-width:min(86%,390px); aspect-ratio:1.6;
}
#scene:is([data-step=serve],[data-step=packing],[data-step=lid]) #packStation {
 height:auto; min-height:0; margin-top:4px;
}
#scene:is([data-step=serve],[data-step=packing],[data-step=lid]) #bowl {
 width:calc(var(--portion-size) * 2.8);
}
#scene[data-step=serve] #bowl { filter:none; pointer-events:none; }
#scene[data-step=serve] #finished .bundle {
 pointer-events:auto; cursor:grab; touch-action:none;
}
#scene[data-step=serve] #finished .bundle:focus-visible {
 outline:2px solid #80571e; border-radius:18px;
}
#finished .drag-source { opacity:.18; }
.bundle.drag-food { position:fixed; margin:0; z-index:20; }
@media(max-width:350px) {
 header:has(#income:not([hidden])) { gap:4px; padding-inline:7px; }
 header:has(#income:not([hidden])) h1 { font-size:17px; letter-spacing:.06em; }
 header:has(#income:not([hidden])) :is(#income,#shiftClock,#sound) { padding-inline:5px; font-size:12px; }
}

/* Fit the portrait game to the space Safari leaves around its browser bars. */
@media (max-width:640px) and (orientation:portrait) {
 #opening.day-screen {
  min-height:100vh; min-height:100dvh;
  display:flex; flex-direction:column; align-items:center; justify-content:center;
  padding:clamp(10px,2.2dvh,22px) 8px max(18px,env(safe-area-inset-bottom));
 }
 #opening[hidden] { display:none; }
 #opening .opening-art {
  display:grid; grid-template-rows:auto 1fr;
  width:100%; max-width:530px;
  height:clamp(235px,58dvh,535px); margin:0 auto clamp(10px,2dvh,20px);
 }
 #opening .stall-canopy { height:clamp(35px,7dvh,61px); }
 #opening .stall-wall {
  margin-inline:1.5%; padding-top:0; display:flex;
  flex-direction:column; align-items:center; justify-content:flex-end;
 }
 #opening .stall-counter { width:100%; margin-top:8px; }
 #opening .stall-platter { width:min(48%,22dvh); }
 #opening .curtain { width:calc(48.5% + 1px); top:clamp(26px,6dvh,52px); }
 #opening .curtain-left { left:1.5%; }
 #opening .curtain-right { right:1.5%; }
 #opening h2 { margin:3px 0 6px; font-size:clamp(27px,7.6vw,44px); }
 #opening p { margin:6px 0 12px; }
 #opening .shift-clock { padding-block:4px; }
 #openStall { margin-top:12px; }

 main:has(#service:not([hidden])) > header { padding-block:7px; }
 #service .guest { padding-block:5px; gap:8px; }
 #service #portrait { width:46px; }
 #service .bubble { padding:4px 10px; }
 #service .bubble strong { font-size:15px; }
 #service footer { padding:6px 12px; min-height:34px; }
 #service .ribbon { padding:5px 10px; gap:7px; }
 #scene { scroll-margin-top:56px; }
 #scene:not(.cutting) {
  --tools-height:clamp(170px,31dvh,247px);
 }
 #scene:not(.cutting) #tray {
  width:min(calc(100% - 12px), max(155px,calc(100dvh - var(--tools-height) - 208px)));
  margin:3px auto 5px;
 }
 #scene:not(.cutting) .tools {
  height:var(--tools-height);
  grid-template-rows:minmax(0,1.65fr) minmax(0,1fr);
  gap:5px 9px; padding:23px 9px 4px;
  align-items:stretch;
 }
 #scene:not(.cutting) #machine {
  width:min(100%,175px); height:100%; aspect-ratio:auto;
 }
 #scene:not(.cutting) #board {
  aspect-ratio:auto; height:100%; scroll-margin-top:56px;
 }
 #scene:not(.cutting) #boardlabel { bottom:2px; line-height:1.15; }
 #machine .scale-label,#scene .calc small { font-size:13px; }
 #scene .calc #read { font-size:clamp(16px,4.2vw,28px); }
 #scene:is([data-step=chop],[data-step=settle]) #board {
  aspect-ratio:auto; height:min(120vw,calc(100dvh - 178px));
 }
 #scene:is([data-step=serve],[data-step=packing],[data-step=lid],[data-step=bag],[data-step=bagging],[data-step=done]) {
  --portion-size:clamp(54px,10.5dvh,77px);
 }
 #scene:is([data-step=serve],[data-step=packing],[data-step=lid],[data-step=bag]) #board {
  max-width:min(88%,390px); aspect-ratio:auto;
  height:clamp(110px,25dvh,200px);
 }
 #scene:is([data-step=serve],[data-step=packing],[data-step=lid],[data-step=bag]) #packStation {
  height:auto; min-height:0; margin-top:4px;
 }
 #scene:is([data-step=bagging],[data-step=done]) #board { display:none; }
}

/* Fast taps are game actions. Leave panning and pinch zoom to the page. */
main { touch-action:manipulation; }
@media (pointer:coarse) {
 #keys button, #weigh, #board, #openStall, #newDay, #serve,
 #sound, #bowl, #scale, #zones .zone { touch-action:none; }
}
#scene[data-step=held] #machine { outline:0; box-shadow:none; }
#scene[data-step=held] #machine #weigh {
 background:linear-gradient(#ffe7a0,#ffca60); color:#412b22; border-color:#ad7433;
 outline:2px solid #ffe6a0; box-shadow:0 0 0 4px #f1b54766;
 animation:weigh-ready .9s ease-in-out infinite alternate;
}
@keyframes weigh-ready { to { box-shadow:0 0 0 5px #e6a72b85,0 0 12px #ffc94b; } }
#weigh { scroll-margin-top:56px; }
#reaction:not([hidden]) { display:block; margin-top:3px; font-size:13px; color:#80502c; }
#portrait.leaving { animation:guest-leave .48s ease-in both; }
@keyframes guest-leave { to { opacity:.25; translate:-12px 0; } }
#board #finished .bundle:nth-child(4) { left:20%; top:55%; }
#board #finished .bundle:nth-child(5) { left:40%; top:55%; }
#board #finished .bundle:nth-child(6) { left:58%; top:42%; }
#scene:not(.cutting) #board #finished .bundle:nth-child(n+4) { top:35%; }
#scene:is([data-step=chop],[data-step=settle]) #finished .bundle:nth-child(4) { left:8%; top:25%; }
#scene:is([data-step=chop],[data-step=settle]) #finished .bundle:nth-child(5) { left:28%; top:23%; }
#scene:is([data-step=chop],[data-step=settle]) #finished .bundle:nth-child(6) { left:47%; top:27%; }
.result-actions { display:flex; justify-content:center; flex-wrap:wrap; gap:10px; margin:14px 0; }
dialog {
 width:min(calc(100% - 24px),410px); max-height:calc(100dvh - 28px);
 border:1px solid #cfb383; border-radius:20px; padding:24px 18px;
 background:#fff8e7; color:#463323; text-align:center; overflow:auto;
}
dialog::backdrop { background:#35241888; }
dialog .seal { display:inline-block; }
dialog h2 { font-size:24px; margin:16px 0 10px; }
dialog p { font-size:15px; }
.dialog-close {
 position:absolute; top:7px; right:8px; width:36px; height:36px;
 background:transparent; border:0; font-size:28px; color:#665142;
}
#tipAmounts { display:grid; grid-template-columns:repeat(4,1fr); gap:8px; margin:20px 0; }
#tipAmounts button {
 min-height:44px; background:#f2e4cc; border:2px solid transparent; border-radius:12px;
}
#tipAmounts button[aria-pressed=true] { background:#ffe2a0; border-color:#b27b36; }
#tipQr { display:block; width:min(78%,250px); height:auto; margin:10px auto; }
dialog a.day-button { display:inline-block; text-decoration:none; }
#continuePlaying { display:block; margin:16px auto 0; }
.save-help { font-size:13px; line-height:1.5; color:#7f684f; }
#scoreImage { display:block; width:100%; height:auto; margin:12px 0; }
#portrait { background-position:center; background-size:cover; }

#seasonStation:not([hidden]) { display:grid; grid-column:1/-1; justify-items:center; gap:6px; width:100%; }
#scene:is([data-step=sauce],[data-step=toppings],[data-step=mix],[data-step=serve],[data-step=packing]) #board { display:none; }
#scene[data-step=sweep] #board { width:min(92%,390px); height:clamp(120px,25dvh,220px); }
#scene[data-step=sweep] #board,
#scene[data-step=mix] #steelBowl,
#scene[data-step=serve] #mixFood .bundle,
.sauce-choice { touch-action:none; }
#steelBowl {
 position:relative; isolation:isolate;
 width:min(94%,420px); height:clamp(172px,35dvh,285px);
 background:url(steel-bowl.png) center/100% 100% no-repeat;
}
#mixFood { position:absolute; inset:0; pointer-events:none; }
#mixFood .bundle {
 position:absolute; width:var(--portion-size); height:var(--portion-size);
 top:var(--mix-y); left:var(--mix-x);
 transform:translate(-50%,-50%) rotate(var(--mix-angle));
 transform-origin:center; animation:none;
}
#scene[data-step=serve] #mixFood .bundle { pointer-events:auto; cursor:grab; }
#scene[data-step=serve] #mixFood .bundle:focus-visible { outline:2px solid #c49139; border-radius:10px; }
#mixFood .drag-source { opacity:.18; }
.bundle[data-seasoning] .cut-piece::after {
 content:""; position:absolute; inset:0; pointer-events:none;
 mask:var(--cut-mask) center/contain no-repeat;
 -webkit-mask:var(--cut-mask) center/contain no-repeat;
 clip-path:inset(0 0 0 calc(100% - var(--sauce-coverage,0%)));
 background:linear-gradient(128deg,#fff7d131 17%,#c0761759 28%,#ffdb7a63 47%,#a9522266 83%);
}
.bundle[data-seasoning=hot] .cut-piece::after {
 background:radial-gradient(circle,#a92910 1px,transparent 1.7px) 0 0/11px 9px,
 linear-gradient(128deg,#fff7ce45 17%,#e8562569 31%,#ffba5365 50%,#ac280e79 85%);
}
.season-flake { position:absolute; z-index:1; width:5px; height:4px; pointer-events:none; border-radius:45%; box-shadow:0 1px 1px #52331555; }
.season-flake[data-topping=garlic] { background:#f4da98; border-radius:30%; }
.season-flake[data-topping=cilantro] { background:#548822; rotate:36deg; }
.season-flake[data-topping=peanut] { background:#b56734; width:7px; height:5px; rotate:-18deg; }
#seasonControls { width:min(100%,410px); text-align:center; padding-bottom:5px; }
#seasonControls > div:not([hidden]) { display:flex; justify-content:center; align-items:center; flex-wrap:wrap; gap:8px; margin-bottom:5px; }
#seasonControls button { min-height:40px; border-radius:18px; border:1px solid #d4aa66; background:#fff1ce; padding:5px 12px; font-weight:650; }
#seasonControls button[aria-pressed=true] { background:#ffdc90; outline:2px solid #a85d23; }
#seasonControls button:disabled { opacity:.47; }
#pourControls span { flex-basis:100%; color:#715339; font-size:13px; }
.sauce-choice i,.sauce-spoon {
 display:inline-block; width:33px; height:22px; vertical-align:middle; margin-right:6px;
 border:2px solid #b7ac9d; border-radius:55%; background:radial-gradient(ellipse at 35% 30%,#ffd780,#a75b1a 50%,#773616);
 position:relative;
}
.sauce-choice i::after,.sauce-spoon::after {
 content:""; position:absolute; width:24px; height:6px; border-radius:4px;
 background:linear-gradient(#eff0e8,#aaa9a3 55%,#686861); top:0; left:86%; rotate:-26deg;
}
[data-sauce=hot] > i,.sauce-spoon[data-sauce=hot] {
 background:radial-gradient(circle,#ffc06c 1px,transparent 2px) 0 0/6px 6px,linear-gradient(#ac340b,#77170b);
}
.sauce-choice { padding-right:16px!important; }
.sauce-spoon.drag-food { width:42px; height:28px; position:fixed; }
#tongs { position:absolute; z-index:3; right:4%; top:22%; width:48%; height:15%; opacity:0; pointer-events:none; rotate:-23deg; }
#tongs::before,#tongs::after {
 content:""; position:absolute; width:100%; height:7px; left:0;
 border-radius:8px 3px 3px 10px; background:linear-gradient(#fff,#999 52%,#615b53);
 box-shadow:0 2px 3px #35282054;
}
#tongs::before { top:12%; rotate:5deg; }
#tongs::after { bottom:13%; rotate:-6deg; }
@media(max-width:640px) and (orientation:portrait){
 #scene:not(.cutting) #tray { width:min(calc(100% - 12px),max(155px,calc(100dvh - var(--tools-height) - 208px))); }
 #scene:is([data-step=serve],[data-step=packing]) .tools { grid-template-columns:1fr; }
 #scene:is([data-step=serve],[data-step=packing]) :is(#packStation,#seasonStation) { grid-column:1/-1; }
 #scene:is([data-step=serve],[data-step=packing]) #seasonControls { display:none; }
}
#scene:is([data-step=lid],[data-step=bag],[data-step=bagging],[data-step=done]) #board { display:none; }
@media(max-width:640px) and (orientation:portrait) {
 #scene:is([data-step=sweep],[data-step=sauce],[data-step=toppings],[data-step=mix],
 [data-step=serve],[data-step=packing],[data-step=lid],[data-step=bag],[data-step=bagging],[data-step=done]) {
  --portion-size:clamp(54px,10.5dvh,77px);
 }
}

/* Condiment bottles and tongs use the same first-person view as the chopping board. */
#sauceControls .sauce-choice {
 display:grid; justify-items:center; align-content:end; min-width:82px;
 gap:3px; border-color:transparent; background:#fff1ce;
}
#sauceControls .sauce-choice i {
 width:60px; height:88px; margin:0; border:0; border-radius:0;
 background:var(--bottle-image) center/contain no-repeat;
}
.sauce-choice[data-sauce=mild],.sauce-spoon[data-sauce=mild] { --bottle-image:url(sauce-bottle-mild.png); }
.sauce-choice[data-sauce=hot],.sauce-spoon[data-sauce=hot] { --bottle-image:url(sauce-bottle-hot.png); }
#sauceControls .sauce-choice i::after,.sauce-spoon::after { display:none; }
.sauce-spoon.drag-food {
 width:62px; height:99px; border:0; border-radius:0; rotate:-30deg;
 background:var(--bottle-image) center/contain no-repeat;
}
#sauceHand {
 position:absolute; opacity:0; z-index:5; pointer-events:none;
 width:58%; height:74%; top:-7%; left:49%;
 background-position:left bottom; background-size:contain; background-repeat:no-repeat;
}
#steelBowl[data-sauce=mild] #sauceHand { background-image:url(sauce-hand-mild.png); }
#steelBowl[data-sauce=hot] #sauceHand { background-image:url(sauce-hand-hot.png); }
#tongs {
 width:68%; height:62%; right:auto; translate:-7% -46%; rotate:none;
 background-size:contain; background-repeat:no-repeat; background-position:left center;
 z-index:5;
}
#tongs::before,#tongs::after { display:none; }
#tongs[data-grip=open] { opacity:1; background-image:url(tongs-open.png); }
#tongs[data-grip=closed] { opacity:1; background-image:url(tongs-closed.png); }
.soft-lift .divided { visibility:hidden; }
.soft-lift::after {
 content:"";position:absolute;inset:-4% -5% -15%;pointer-events:none;
 background:url(duck-lift.png) center/contain no-repeat;
}
#toppingControls button[data-topping] { display:grid; justify-items:center; min-width:61px; padding:4px 7px; }
#toppingControls button[data-topping]::before {
 content:""; width:42px; height:33px; background:var(--topping-image) center/contain no-repeat;
}
#toppingControls [data-topping=garlic] {--topping-image:url(cup-garlic.png)}
#toppingControls [data-topping=peanut] {--topping-image:url(cup-peanut.png)}
#toppingControls [data-topping=cilantro] {--topping-image:url(cup-cilantro.png)}
#toppingControls [data-topping=chili] {--topping-image:url(cup-chili.png)}
#sauceHand {display:none;height:auto;aspect-ratio:503/451;width:42%;left:53%;top:1%;border:0;padding:0;background-color:transparent;background-size:100% 100%;touch-action:none;}
#scene[data-step=sauce] #steelBowl[data-sauce] #sauceHand {display:block;opacity:1;pointer-events:auto;}
#scene[data-step=mix] #tongs:not([data-grip]) {opacity:1;background-image:url(tongs-open.png);}
#pourSauce {touch-action:none;}
.season-flake[data-topping] {background-size:cover;border-radius:45%;box-shadow:0 1px 1px #43251155;}
.season-flake[data-topping=garlic] {background-image:url(garlic-chip.png);width:5px;height:4px;border-radius:28% 42% 25% 37%;}
.season-flake[data-topping=peanut] {background-image:url(peanut-chip.png);width:6px;height:5px;border-radius:25% 43% 28% 38%;}

#toppingControls button[data-topping]::before {border-radius:50%;background-size:100% 100%;}
.season-flake[data-topping=cilantro] {width:9px;height:8px;background:linear-gradient(55deg,#316d20,#80ac36);clip-path:polygon(0 40%,19% 33%,12% 12%,36% 21%,44% 0,57% 22%,76% 7%,75% 30%,96% 26%,84% 49%,100% 60%,78% 71%,56% 67%,39% 100%,31% 94%,44% 66%,20% 76%,23% 58%);}
.season-flake[data-topping=chili] {box-sizing:border-box;width:7px;height:6px;background:transparent;border:1.8px solid #bc2510;border-bottom-color:#e34719;border-radius:45%;}
.season-flake[data-topping=cilantro] {background-image:url(parsley-detail.png);background-size:cover;}
#service #portrait,.stall-guest {aspect-ratio:1;height:auto;flex-shrink:0;border-radius:50%;object-fit:contain;background-size:contain;}
#firstCoach:not([hidden]) {display:flex;align-items:center;gap:10px;position:fixed;z-index:100;max-width:calc(100vw - 12px);padding:8px 12px;background:#fff6dc;border:1px solid #bd8a48;border-radius:13px;color:#313e32;box-shadow:0 3px 12px #49321933;font-size:15px;pointer-events:none;}
#skipCoach {pointer-events:auto;padding:7px;border:0;background:#f2e3c6;color:#574734;border-radius:8px;}
.coach-target {filter:drop-shadow(0 0 4px #eeb433);outline:2px solid #d7952c;outline-offset:2px;}
#zones .coach-target {fill:#ffcb554a;outline:none;}

#saucePour {position:absolute;inset:0;width:100%;height:100%;pointer-events:none;z-index:4;}
