:root {
  color-scheme: light;
  --ink: #24302d;
  --muted: #68736e;
  --cream: #f6f1e7;
  --paper: #fffdf8;
  --tomato: #dd553d;
  --tomato-dark: #963b2e;
  --sage: #5b8765;
  --sage-dark: #315d3c;
  --aqua: #4aa9a7;
  --gold: #efb83e;
  --dough: #e6ad58;
  --crust: #995b2d;
  font-family: "Avenir Next", "Trebuchet MS", system-ui, sans-serif;
  font-synthesis: none;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { width: 100%; height: 100%; min-width: 1000px; min-height: 680px; overflow: hidden; }
body { margin: 0; color: var(--ink); background: var(--cream); }
button { color: inherit; font: inherit; cursor: pointer; -webkit-tap-highlight-color: transparent; }
:focus-visible { outline: 4px solid #087d91; outline-offset: 3px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }

.lesson { height: 100%; display: grid; grid-template-rows: minmax(0, 1fr) 168px; gap: 12px; padding: 14px 18px 16px; }
.kitchen { position: relative; min-height: 0; overflow: hidden; border: 1px solid #d8cbb8; border-radius: 22px; background: linear-gradient(#d9eee7 0 45%, #f5e8cc 45% 100%); box-shadow: 0 8px 0 #d9c9af, 0 20px 42px rgba(73,55,32,.12); isolation: isolate; }
.kitchen::before { position: absolute; inset: 0 0 55%; z-index: -1; content: ""; opacity: .4; background: linear-gradient(90deg, transparent 49.5%, rgba(70,115,103,.17) 50%, transparent 50.5%), linear-gradient(rgba(70,115,103,.14) 1px, transparent 1px); background-size: 92px 100%, 100% 54px; }
.wall-art { position: absolute; left: 26px; top: 26px; display: flex; align-items: center; gap: 13px; color: #54766d; font-size: 9px; font-weight: 950; letter-spacing: .13em; }
.wall-art i { width: 48px; height: 48px; border: 4px solid #6b9185; border-radius: 50%; background: conic-gradient(var(--tomato) 0 25%, var(--gold) 25% 50%, var(--sage) 50% 75%, var(--aqua) 75%); box-shadow: inset 0 0 0 5px #e9f5f0; }
.mute { position: absolute; z-index: 20; right: 22px; top: 20px; width: 44px; height: 44px; display: grid; place-items: center; padding: 0; border: 1px solid #c9d9d2; border-radius: 50%; background: rgba(255,255,255,.9); box-shadow: 0 3px 0 #b9ccc4; transition: transform 150ms ease-out, box-shadow 150ms ease-out; }
.mute:hover { transform: translateY(-2px); box-shadow: 0 5px 0 #b9ccc4; }
.mute svg { width: 21px; height: 21px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.sound-off { display: none; }.mute[aria-pressed="true"] .sound-on { display: none; }.mute[aria-pressed="true"] .sound-off { display: block; }
.level-label { position: absolute; z-index: 4; left: 50%; top: 22px; transform: translateX(-50%); text-align: center; }
.level-label span { display: block; color: var(--sage-dark); font-size: 10px; font-weight: 950; letter-spacing: .1em; text-transform: uppercase; }
.level-label strong { display: block; margin-top: 3px; font-size: 18px; }

.counter { position: absolute; left: 50%; bottom: 21px; width: calc(100% - 64px); height: calc(100% - 88px); min-height: 420px; display: grid; grid-template-columns: 190px minmax(0, 1fr) 210px; align-items: center; gap: 28px; padding: 30px 34px 36px; transform: translateX(-50%); border: 4px solid #956039; border-bottom-width: 13px; border-radius: 24px 24px 16px 16px; background: repeating-linear-gradient(92deg, #c98a53 0 100px, #bc7644 101px 105px, #d39961 106px 204px); box-shadow: 0 20px 35px rgba(59,39,24,.25), inset 0 4px rgba(255,255,255,.22); }
.counter-edge { position: absolute; left: 18px; right: 18px; bottom: -27px; height: 25px; border-radius: 0 0 16px 16px; background: #6f412a; }
.order-ticket, .piece-tray { position: relative; z-index: 2; padding: 20px; border: 2px solid rgba(255,255,255,.9); border-radius: 10px; background: rgba(255,253,248,.96); box-shadow: 0 10px 22px rgba(74,43,24,.17); }
.order-ticket { transform: rotate(-1.5deg); }
.order-ticket::before { position: absolute; left: 16px; right: 16px; top: -8px; height: 16px; content: ""; opacity: .75; background: repeating-linear-gradient(90deg, #f1d276 0 24px, #fff0ae 24px 48px); }
.order-ticket span { color: var(--tomato-dark); font-size: 10px; font-weight: 950; letter-spacing: .12em; text-transform: uppercase; }
.order-ticket strong { display: block; margin: 9px 0 8px; font-size: 29px; line-height: 1.05; letter-spacing: -.04em; }
.order-ticket p { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.4; }
.boards { min-width: 0; display: flex; align-items: center; justify-content: center; gap: 22px; }
.board-wrap { min-width: 0; display: grid; justify-items: center; gap: 9px; }
.board-wrap.is-active .plate-shell { box-shadow: 0 0 0 7px rgba(255,255,255,.55), 0 0 0 12px rgba(74,169,167,.56), 0 16px 22px rgba(83,46,23,.24); }
.board-label { max-width: 240px; color: #51371f; font-size: 12px; font-weight: 900; text-align: center; }
.board-label b { color: var(--tomato-dark); font-size: 17px; }
.plate-shell { position: relative; width: min(31vw, 360px); max-height: 390px; aspect-ratio: 1; border-radius: 50%; transition: box-shadow 180ms ease-out, transform 180ms ease-out; box-shadow: 0 16px 22px rgba(83,46,23,.24); }
.boards.has-two .plate-shell { width: min(23vw, 285px); }
.plate-svg { width: 100%; height: 100%; overflow: visible; filter: drop-shadow(0 3px 0 rgba(255,255,255,.55)); }
.plate-rim { fill: #d8e2db; stroke: #fff; stroke-width: 9; }.plate-inner { fill: #fffdf5; stroke: #90c7bf; stroke-width: 2; stroke-dasharray: 5 6; }
.guide { fill: rgba(75,165,160,.055); stroke: rgba(53,134,132,.25); stroke-width: 1.4; }
.food-piece { fill: var(--dough); stroke: var(--crust); stroke-width: 3.2; cursor: pointer; transform-origin: 100px 100px; animation: piece-in 220ms cubic-bezier(.2,.9,.3,1.25); }
.food-piece:hover { filter: brightness(1.06); }.food-piece.is-focus { animation: piece-pulse 600ms ease-in-out 3; }
.piece-speck { pointer-events: none; fill: #945427; opacity: .6; }
.plate-centre { fill: #fffdf8; stroke: #fff; stroke-width: 4; }.plate-readout { fill: var(--sage-dark); font-size: 17px; font-weight: 1000; text-anchor: middle; dominant-baseline: middle; }
.equals-sign { flex: 0 0 auto; width: 48px; height: 48px; display: grid; place-items: center; border: 3px solid var(--ink); border-radius: 50%; background: var(--gold); box-shadow: 4px 4px 0 rgba(36,48,45,.2); font-size: 26px; font-weight: 1000; }
.piece-tray { display: grid; gap: 10px; }
.tray-title { color: var(--sage-dark); font-size: 10px; font-weight: 950; letter-spacing: .1em; text-transform: uppercase; }
.piece-button { min-height: 64px; display: grid; grid-template-columns: 48px 1fr; align-items: center; gap: 11px; padding: 8px 12px; border: 2px solid #d7d9cd; border-radius: 10px; background: #fffdf8; text-align: left; transition: transform 150ms ease-out, border-color 150ms ease-out, box-shadow 150ms ease-out; }
.piece-button:hover { transform: translateY(-2px); border-color: var(--aqua); box-shadow: 0 4px 0 #b9ddda; }
.piece-icon { width: 45px; height: 45px; border: 3px solid var(--crust); border-radius: 50%; background: conic-gradient(var(--dough) 0 var(--slice), #f5eee0 var(--slice) 100%); }
.piece-button strong { display: block; font-size: 18px; }.piece-button small { display: block; color: var(--muted); font-size: 10px; font-weight: 800; }
.remove-note { margin: 3px 0 0; color: var(--muted); font-size: 10px; line-height: 1.35; }

.level-intro, .finale { position: absolute; z-index: 30; left: 50%; top: 50%; width: min(520px, calc(100% - 60px)); min-height: 350px; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 32px 48px; transform: translate(-50%,-50%); border: 1px solid #d8cdbb; border-radius: 24px; background: rgba(255,253,248,.98); box-shadow: 0 17px 0 rgba(91,67,40,.14), 0 30px 65px rgba(64,46,26,.23); text-align: center; }
.level-intro::before, .finale::before { position: absolute; inset: 10px; content: ""; border: 2px dashed #d6c6aa; border-radius: 16px; pointer-events: none; }
.level-intro > span, .finale > span { z-index: 1; color: var(--tomato-dark); font-size: 10px; font-weight: 950; letter-spacing: .12em; text-transform: uppercase; }
.intro-mark { z-index: 1; width: 78px; height: 78px; display: grid; place-items: center; margin: 12px 0; transform: rotate(-5deg); border: 3px solid var(--ink); border-radius: 50%; color: var(--ink); background: var(--gold); box-shadow: 5px 5px 0 var(--ink); font-size: 33px; font-weight: 1000; }
.level-intro h1, .finale h1 { z-index: 1; margin: 5px 0 8px; font-size: 39px; line-height: 1; letter-spacing: -.04em; }
.level-intro p, .finale p { z-index: 1; max-width: 410px; margin: 0 0 22px; color: #59635f; font-size: 15px; line-height: 1.45; }
.level-intro button, .finale button { z-index: 1; min-width: 220px; min-height: 52px; padding: 0 22px; border: 2px solid var(--sage-dark); border-radius: 11px; color: white; background: var(--sage); box-shadow: 0 6px 0 var(--sage-dark); font-weight: 950; transition: transform 150ms ease-out, box-shadow 150ms ease-out; }
.level-intro button:hover, .finale button:hover { transform: translateY(-2px); box-shadow: 0 8px 0 var(--sage-dark); }
.finale { min-height: 390px; background: #fffdf1; }.final-breads { z-index: 1; display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }.final-breads span { width: 70px; height: 70px; display: grid; place-items: center; border: 3px solid var(--crust); border-radius: 50%; background: var(--dough); font-size: 24px; font-weight: 1000; }.final-breads span:nth-child(2) { width: auto; border: 0; background: transparent; }
.toast { position: absolute; z-index: 40; left: 50%; bottom: 20px; max-width: 80%; padding: 10px 18px; opacity: 0; transform: translate(-50%,12px); border-radius: 999px; color: white; background: var(--ink); box-shadow: 0 5px 0 rgba(36,48,45,.2); pointer-events: none; font-size: 13px; font-weight: 900; transition: opacity 160ms ease-out, transform 160ms ease-out; }.toast.is-showing { opacity: 1; transform: translate(-50%,0); }

.decision { min-height: 0; display: grid; grid-template-columns: minmax(260px,.72fr) minmax(0,1.8fr); align-items: center; gap: 28px; padding: 18px 22px 18px 26px; border: 1px solid #d9d3c8; border-radius: 17px; background: var(--paper); box-shadow: 0 5px 0 #ded7ca; }
.decision-copy span { display: block; margin-bottom: 5px; color: var(--tomato-dark); font-size: 10px; font-weight: 950; letter-spacing: .1em; text-transform: uppercase; }.decision-copy h2 { max-width: 390px; margin: 0; font-size: 24px; line-height: 1.12; letter-spacing: -.025em; }
.decision-actions { min-width: 0; display: flex; align-items: center; justify-content: center; gap: 11px; }
.choice-grid { width: 100%; display: grid; grid-template-columns: repeat(var(--columns,3), minmax(0,1fr)); gap: 10px; }
.choice { min-height: 84px; padding: 12px 16px; border: 2px solid #d8d9d1; border-radius: 12px; background: #fbfaf6; font-weight: 900; transition: transform 150ms ease-out, border-color 150ms ease-out, background 150ms ease-out, box-shadow 150ms ease-out; }.choice:hover { transform: translateY(-2px); border-color: var(--aqua); background: #f1fbf9; box-shadow: 0 5px 0 #d2e9e5; }.choice strong { display: block; font-size: 22px; }.choice small { display: block; margin-top: 4px; color: var(--muted); font-size: 11px; line-height: 1.25; }
.primary { min-width: 220px; min-height: 62px; padding: 0 24px; border: 2px solid var(--sage-dark); border-radius: 12px; color: white; background: var(--sage); box-shadow: 0 6px 0 var(--sage-dark); font-weight: 950; transition: transform 150ms ease-out, box-shadow 150ms ease-out; }.primary:hover { transform: translateY(-2px); box-shadow: 0 8px 0 var(--sage-dark); }.primary:active { transform: translateY(4px); box-shadow: 0 2px 0 var(--sage-dark); }.primary.is-coral { border-color: var(--tomato-dark); background: var(--tomato); box-shadow: 0 6px 0 var(--tomato-dark); }
.evidence { width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 20px; }.evidence-text { display: flex; align-items: center; gap: 13px; }.evidence-mark { width: 57px; height: 57px; flex: 0 0 57px; display: grid; place-items: center; border: 3px solid var(--ink); border-radius: 50%; background: var(--gold); font-size: 25px; font-weight: 1000; }.evidence-text strong { display: block; font-size: 19px; }.evidence-text p { margin: 3px 0 0; color: var(--muted); font-size: 12px; }
.kitchen.is-celebrating .plate-shell { animation: plate-hop 420ms ease-out 2; }
.kitchen.is-highlighting .food-piece { animation: piece-pulse 600ms ease-in-out 3; }
@keyframes piece-in { from { opacity: .2; transform: scale(.72); } }
@keyframes piece-pulse { 50% { filter: drop-shadow(0 0 8px #fff) drop-shadow(0 0 13px var(--aqua)); transform: scale(1.025); } }
@keyframes plate-hop { 50% { transform: translateY(-8px) rotate(1deg); } }
@media (max-height: 780px) { .lesson { grid-template-rows: minmax(0,1fr) 154px; gap: 10px; padding-top: 10px; }.counter { min-height: 380px; padding-top: 22px; padding-bottom: 28px; }.plate-shell { width: min(28vw,325px); }.boards.has-two .plate-shell { width: min(21vw,250px); }.level-intro { min-height: 315px; } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; } }
