:root {
  color-scheme: light;
  --ink: #173633;
  --muted: #66716d;
  --cream: #fff8e8;
  --paper: #fffdf6;
  --teal: #177c78;
  --teal-dark: #0c504d;
  --mint: #b9e2d3;
  --red: #d94b3d;
  --red-dark: #8f2d25;
  --gold: #f3b83d;
  --blue: #286f88;
  --line: #d9cdb5;
  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: 900px; min-height: 620px; overflow: hidden; }
body { margin: 0; color: var(--ink); background: #174f4b; }
button, input { color: inherit; font: inherit; }
button { cursor: pointer; -webkit-tap-highlight-color: transparent; }
:focus-visible { outline: 4px solid #0a638c; outline-offset: 4px; }
.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%; padding: 12px; }
.diner { position: relative; height: 100%; min-height: 596px; overflow: hidden; isolation: isolate; border: 1px solid #775b3b; border-radius: 25px; background: #f0b75f; box-shadow: 0 8px 0 #103e3c, 0 26px 56px rgba(3,27,25,.32); }
.backdrop { position: absolute; z-index: -3; inset: 0; background: linear-gradient(rgba(20,61,56,.08),rgba(18,52,48,.28)), url("art/diner-backdrop-01.webp") center / cover no-repeat; filter: saturate(.94) contrast(1.02); }
.diner::before { position: absolute; z-index: -2; inset: 0; content: ""; background: radial-gradient(circle at 75% 42%,rgba(255,244,187,.32),transparent 38%), linear-gradient(90deg,rgba(12,53,50,.26),transparent 34%); }

.shift-hud { position: absolute; z-index: 20; left: 24px; right: 24px; top: 18px; height: 68px; display: grid; grid-template-columns: 210px 1fr auto; align-items: center; gap: 18px; }
.shift-chip,.difficulty,.scoreboard { border: 1px solid rgba(37,56,48,.22); background: rgba(255,253,246,.94); box-shadow: 0 5px 0 rgba(76,47,24,.22); backdrop-filter: blur(10px); }
.shift-chip { align-self: stretch; display: flex; flex-direction: column; justify-content: center; padding: 10px 16px; border-radius: 14px; }
.shift-chip span,.difficulty span,.scoreboard span,.counter-sign span,.counter-sign small { color: var(--muted); font-size: 10px; font-weight: 900; letter-spacing: .1em; text-transform: uppercase; }
.shift-chip strong { margin-top: 3px; font-size: 17px; }
.difficulty { justify-self: center; width: min(330px,100%); display: grid; grid-template-columns: 1fr auto; gap: 5px 12px; padding: 9px 14px; border-radius: 14px; }
.difficulty > i { grid-column: 1/-1; height: 7px; overflow: hidden; border-radius: 99px; background: #dce1d7; }
.difficulty > i b { display: block; width: 20%; height: 100%; border-radius: inherit; background: linear-gradient(90deg,var(--gold),var(--red)); transition: width 220ms ease-out; }
.difficulty strong { font-size: 12px; }
.scoreboard { height: 68px; display: flex; padding: 7px; border-radius: 14px; }
.scoreboard > div { min-width: 70px; display: grid; place-content: center; padding: 0 10px; text-align: center; }
.scoreboard > div + div { border-left: 1px solid #ddd5c6; }
.scoreboard strong { display: block; margin-top: 2px; font-size: 21px; line-height: 1; }
.scoreboard strong i { color: #d98d12; font-style: normal; font-size: 15px; }

.chef-corner { position: absolute; z-index: 4; left: 18px; top: 104px; bottom: 22px; width: 248px; }
.chef { position: absolute; left: 1px; bottom: 38px; width: 238px; height: 238px; object-fit: contain; object-position: bottom; filter: drop-shadow(0 10px 6px rgba(22,33,27,.28)); transform-origin: 50% 90%; transition: transform 180ms ease-out, filter 180ms ease-out; }
.speech { position: absolute; z-index: 3; left: 10px; right: 2px; top: 4px; min-height: 86px; display: grid; place-items: center; padding: 13px 16px 18px; border: 2px solid var(--ink); border-radius: 19px 19px 19px 5px; background: var(--paper); box-shadow: 0 6px 0 rgba(44,40,26,.2); font-size: 14px; font-weight: 800; line-height: 1.25; text-align: center; }
.speech::after { position: absolute; left: 19px; bottom: -14px; width: 23px; height: 23px; content: ""; transform: rotate(45deg); border-right: 2px solid var(--ink); border-bottom: 2px solid var(--ink); background: var(--paper); }
.counter-sign { position: absolute; z-index: 5; left: 20px; right: 18px; bottom: 0; display: grid; grid-template-columns: 1fr auto; align-items: center; padding: 9px 13px; border: 2px solid #744829; border-radius: 10px; background: #f8d382; box-shadow: 0 5px 0 rgba(74,45,25,.28); transform: rotate(-1deg); }
.counter-sign strong { grid-row: 1/3; grid-column: 2; font-size: 29px; color: var(--red-dark); }
.counter-sign small { font-size: 8px; }
.diner.is-happy .chef { transform: translateY(-8px) rotate(-2deg) scale(1.04); }
.diner.is-concerned .chef { transform: rotate(2deg) scale(.98); filter: drop-shadow(0 10px 6px rgba(22,33,27,.28)) saturate(.72); }

.ticket { position: absolute; z-index: 8; left: 282px; right: 26px; top: 104px; bottom: 24px; display: grid; grid-template-rows: auto auto minmax(190px,1fr) 35px 82px; padding: 22px 30px 24px; overflow: hidden; border: 1px solid #d4c7ae; border-radius: 7px 7px 20px 20px; background: rgba(255,253,246,.97); box-shadow: 0 9px 0 rgba(76,47,24,.26), 0 25px 50px rgba(41,32,19,.21); }
.ticket::before { position: absolute; left: 0; right: 0; top: 0; height: 8px; content: ""; background: repeating-linear-gradient(90deg,var(--red) 0 28px,var(--cream) 28px 56px,var(--teal) 56px 84px,var(--cream) 84px 112px); }
.ticket::after { position: absolute; inset: 12px; pointer-events: none; content: ""; border: 1px dashed rgba(111,94,63,.25); border-radius: 3px 3px 14px 14px; }
.ticket-topline { position: relative; z-index: 2; display: flex; align-items: center; justify-content: space-between; padding-top: 4px; }
.ticket-topline > span { color: var(--red-dark); font-size: 10px; font-weight: 1000; letter-spacing: .13em; text-transform: uppercase; }
.ticket-topline > b { padding: 5px 10px; border-radius: 99px; color: var(--teal-dark); background: #d9eee5; font-size: 11px; }
.mission-copy { position: relative; z-index: 2; text-align: center; }
.mission-copy h1 { margin: 4px 0 4px; font-size: clamp(28px,3.1vw,42px); line-height: 1; letter-spacing: -.045em; }
.mission-copy p { margin: 0; color: var(--muted); font-size: 14px; }
.play-stage { position: relative; z-index: 2; min-height: 0; display: grid; place-items: center; padding: 12px 8px 7px; }
.feedback { position: relative; z-index: 2; min-height: 30px; display: grid; place-items: center; color: var(--teal-dark); font-size: 14px; font-weight: 900; text-align: center; }
.feedback.is-error { color: var(--red-dark); }
.action-area { position: relative; z-index: 2; min-height: 78px; display: flex; align-items: center; justify-content: center; gap: 12px; }

.menu-scene { width: min(750px,100%); display: grid; grid-template-columns: 150px 1fr; align-items: center; gap: 22px; }
.food-sprite { width: 145px; height: 145px; border-radius: 50%; background-image: url("art/food-props.png"); background-size: 300% 200%; background-repeat: no-repeat; filter: drop-shadow(0 7px 4px rgba(44,36,23,.18)); }
.food-sprite.milkshake { background-position: 0 0; }.food-sprite.pancakes { background-position: 50% 0; }.food-sprite.pie { background-position: 100% 0; }.food-sprite.fries { background-position: 0 100%; }.food-sprite.burger { background-position: 50% 100%; }.food-sprite.bell { background-position: 100% 100%; }
.menu-callout { display: grid; justify-items: center; gap: 8px; padding: 12px 18px; border: 2px solid #c7b992; border-radius: 16px; background: #fff8dc; box-shadow: 0 6px 0 #e4d8b8; }
.menu-callout span { color: var(--muted); font-size: 11px; font-weight: 900; text-transform: uppercase; letter-spacing: .1em; }
.menu-callout strong { font-size: 30px; line-height: 1; }

.digit-register { display: flex; align-items: flex-end; justify-content: center; gap: 6px; }
.digit-column { display: grid; grid-template-rows: 40px 70px 40px auto; justify-items: center; gap: 5px; }
.digit-column > button { width: 45px; height: 40px; border: 1px solid #b6aa92; border-radius: 10px; background: white; box-shadow: 0 3px 0 #d8d0c1; font-size: 22px; font-weight: 1000; }
.digit-column > button:hover { transform: translateY(-1px); border-color: var(--teal); }
.digit-column > b { width: 58px; height: 70px; display: grid; place-items: center; border: 2px solid var(--ink); border-radius: 12px; color: #fff8df; background: linear-gradient(#2c5550,#173633); box-shadow: inset 0 0 0 4px rgba(255,255,255,.08), 0 5px 0 #b49b72; font: 1000 42px/1 ui-monospace,monospace; }
.digit-column > small { color: var(--muted); font-size: 9px; font-weight: 900; text-transform: uppercase; }
.decimal-dot { align-self: center; padding-bottom: 28px; color: var(--red); font: 1000 54px/1 ui-monospace,monospace; }
.register-value { margin-top: 7px; color: var(--teal-dark); font-size: 13px; font-weight: 900; text-align: center; }

.number-line-wrap { width: min(720px,100%); padding: 16px 20px 12px; }
.number-line-readout { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.number-line-readout strong { padding: 8px 15px; border: 2px solid var(--teal-dark); border-radius: 10px; color: white; background: var(--teal); box-shadow: 0 4px 0 var(--teal-dark); font-size: 25px; }
.number-line-readout span { color: var(--muted); font-size: 12px; font-weight: 900; }
.number-slider { width: 100%; height: 42px; margin: 0; accent-color: var(--red); cursor: ew-resize; }
.line-labels { display: flex; justify-content: space-between; margin: -3px 2px 0; font: 900 12px/1 ui-monospace,monospace; }
.tick-row { display: grid; grid-template-columns: repeat(21,1fr); height: 26px; margin: -21px 8px 0; pointer-events: none; }
.tick-row i { justify-self: center; width: 2px; height: 11px; background: #a8997c; }.tick-row i:nth-child(5n+1) { height: 18px; background: var(--ink); }

.price-grid { width: min(730px,100%); display: grid; grid-template-columns: repeat(3,1fr); gap: 13px; }
.price-card { position: relative; min-height: 142px; display: grid; align-content: center; justify-items: center; gap: 5px; border: 2px solid #c6b999; border-radius: 16px; background: #fff9df; box-shadow: 0 6px 0 #ddd0ad; transition: transform 140ms ease-out, box-shadow 140ms ease-out, opacity 140ms ease-out; }
.price-card:hover { transform: translateY(-3px) rotate(-1deg); border-color: var(--teal); box-shadow: 0 9px 0 #c4d8ce; }
.price-card:active { transform: translateY(4px); box-shadow: 0 2px 0 #c4d8ce; }
.price-card strong { font-size: 33px; }.price-card span { color: var(--muted); font-size: 11px; font-weight: 900; text-transform: uppercase; }
.price-card.is-served { opacity: .36; transform: scale(.96); pointer-events: none; }
.order-rack { min-height: 47px; display: flex; align-items: center; justify-content: center; gap: 8px; margin-top: 8px; }
.order-rack b { min-width: 88px; padding: 9px 12px; border: 2px solid var(--teal-dark); border-radius: 10px; color: white; background: var(--teal); text-align: center; }
.order-rack i { color: var(--red); font-style: normal; font-weight: 1000; }

.receipt-math { width: min(590px,100%); display: grid; grid-template-columns: 190px 1fr; align-items: center; gap: 28px; }
.receipt { position: relative; padding: 15px 24px 14px; border: 1px solid #cabfa9; background: white; box-shadow: 0 6px 0 #ded5c3; font: 1000 28px/1.25 ui-monospace,monospace; text-align: right; }
.receipt::after { position: absolute; left: 0; right: 0; bottom: -7px; height: 8px; content: ""; background: linear-gradient(135deg,transparent 5px,white 0) 0 0/10px 10px repeat-x,linear-gradient(45deg,transparent 5px,white 0) 0 0/10px 10px repeat-x; }
.receipt .sum-line { display: block; border-top: 3px solid var(--ink); color: var(--red-dark); }
.receipt small { display: block; margin-bottom: 7px; color: var(--muted); font: 900 9px/1 sans-serif; letter-spacing: .1em; text-transform: uppercase; text-align: center; }
.point-rail { position: absolute; top: 37px; bottom: 12px; right: 67px; width: 2px; border-left: 2px dashed rgba(217,75,61,.48); }
.point-rail::before { position: absolute; top: -9px; left: -18px; content: "point rail"; color: var(--red-dark); font: 900 8px/1 sans-serif; white-space: nowrap; transform: rotate(-90deg) translateX(-100%); transform-origin: left top; }

.observe-card { width: min(650px,100%); display: grid; grid-template-columns: 130px 1fr; align-items: center; gap: 22px; padding: 16px 22px; border: 2px solid #afcabe; border-radius: 18px; background: #eef8f1; box-shadow: 0 6px 0 #c9ddd3; }
.observe-card strong { display: block; font-size: 28px; }.observe-card p { margin: 5px 0 0; color: var(--muted); font-size: 13px; line-height: 1.35; }
.place-value { display: flex; align-items: center; justify-content: center; gap: 5px; }
.place-value b { min-width: 43px; padding: 10px 8px; border-radius: 9px; background: white; box-shadow: 0 3px 0 #cbd8d1; font-size: 24px; text-align: center; }.place-value i { color: var(--red); font-style: normal; font-size: 30px; font-weight: 1000; }

.primary,.secondary,.reason { min-height: 58px; border-radius: 13px; font-weight: 1000; transition: transform 130ms ease-out,box-shadow 130ms ease-out; }
.primary { min-width: 220px; padding: 0 23px; border: 2px solid var(--teal-dark); color: white; background: var(--teal); box-shadow: 0 6px 0 var(--teal-dark); font-size: 16px; }
.primary.is-red { border-color: var(--red-dark); background: var(--red); box-shadow: 0 6px 0 var(--red-dark); }
.primary:hover,.reason:hover { transform: translateY(-2px); }.primary:active,.reason:active { transform: translateY(4px); box-shadow: 0 2px 0 var(--teal-dark); }
.secondary { min-width: 130px; padding: 0 18px; border: 2px solid #b8ad98; background: white; box-shadow: 0 5px 0 #d8d0c2; }
.reason-grid { width: min(720px,100%); display: grid; grid-template-columns: repeat(3,1fr); gap: 11px; }
.reason { padding: 8px 13px; border: 2px solid #bdb19a; background: white; box-shadow: 0 5px 0 #dbd2c3; font-size: 13px; }
.reason small { display: block; margin-top: 4px; color: var(--muted); font-size: 10px; font-weight: 700; }

.practice-board { width: min(730px,100%); display: grid; justify-items: center; gap: 13px; }
.practice-question { min-width: 360px; padding: 15px 25px; border: 2px solid #bba974; border-radius: 15px; background: #fff7d6; box-shadow: 0 6px 0 #ded1a7; text-align: center; }
.practice-question span { display: block; color: var(--muted); font-size: 10px; font-weight: 1000; letter-spacing: .12em; text-transform: uppercase; }
.practice-question strong { display: block; margin-top: 5px; font-size: clamp(27px,4vw,50px); line-height: 1; letter-spacing: -.025em; }
.vertical-expression { display: inline-grid; justify-items: end; padding: 5px 20px; border-bottom: 3px solid var(--ink); font: 1000 35px/1.1 ui-monospace,monospace; }
.vertical-expression i { color: var(--red); font-style: normal; }

.order-bell { position: absolute; z-index: 7; right: 12px; bottom: 12px; width: 62px; height: 48px; opacity: .72; filter: drop-shadow(0 5px 3px rgba(48,31,18,.25)); }
.order-bell::before { position: absolute; left: 10px; right: 10px; bottom: 6px; height: 29px; content: ""; border: 3px solid #5d5548; border-radius: 34px 34px 7px 7px; background: linear-gradient(135deg,#fff,#9faaa9 54%,#f1f2ed); }
.order-bell::after { position: absolute; left: 5px; right: 5px; bottom: 0; height: 9px; content: ""; border: 3px solid #4b4036; border-radius: 6px; background: #292725; }
.order-bell span { position: absolute; z-index: 1; left: 27px; top: 0; width: 10px; height: 10px; border: 2px solid #514a41; border-radius: 50%; background: #f1f1e9; }
.diner.is-ringing .order-bell { animation: ring 420ms ease-out; }
.money-flourish { position: absolute; z-index: 1; left: -42px; bottom: -86px; width: 270px; opacity: .18; transform: rotate(10deg); pointer-events: none; }
.confetti { position: absolute; z-index: 40; left: 66%; top: 47%; pointer-events: none; }
.confetti i { position: absolute; width: 11px; height: 18px; opacity: 0; border-radius: 3px; background: var(--gold); }.confetti i:nth-child(2n){background:var(--red)}.confetti i:nth-child(3n){background:var(--teal)}
.diner.is-celebrating .confetti i { animation: confetti 720ms ease-out both; }.confetti i:nth-child(1){--x:-120px;--y:-100px}.confetti i:nth-child(2){--x:-55px;--y:-145px;animation-delay:40ms}.confetti i:nth-child(3){--x:30px;--y:-135px;animation-delay:80ms}.confetti i:nth-child(4){--x:110px;--y:-90px;animation-delay:120ms}.confetti i:nth-child(5){--x:135px;--y:5px;animation-delay:160ms}.confetti i:nth-child(6){--x:80px;--y:90px;animation-delay:200ms}.confetti i:nth-child(7){--x:-35px;--y:110px;animation-delay:240ms}.confetti i:nth-child(8){--x:-130px;--y:45px;animation-delay:280ms}
.ticket.is-shaking { animation: shake 330ms ease-out; }
.toast { position: absolute; z-index: 50; left: 62%; bottom: 33px; max-width: 65%; padding: 10px 17px; opacity: 0; transform: translate(-50%,12px); border-radius: 99px; color: white; background: var(--ink); pointer-events: none; font-size: 13px; font-weight: 900; transition: opacity 150ms ease-out,transform 150ms ease-out; }.toast.is-showing { opacity: 1; transform: translate(-50%,0); }

@keyframes confetti { 0%{opacity:0;transform:translate(0,0) rotate(0) scale(.4)} 28%{opacity:1} 100%{opacity:0;transform:translate(var(--x),var(--y)) rotate(280deg) scale(1)} }
@keyframes shake { 20%{transform:translateX(-8px) rotate(-.4deg)} 45%{transform:translateX(7px) rotate(.4deg)} 70%{transform:translateX(-4px)} }
@keyframes ring { 25%{transform:rotate(-8deg) scale(1.08)} 55%{transform:rotate(7deg) scale(1.05)} }
@media (max-height: 730px) { .shift-hud { top: 12px; }.chef-corner,.ticket { top: 91px; bottom: 17px; }.ticket { padding-top: 18px; padding-bottom: 17px; grid-template-rows:auto auto minmax(155px,1fr) 30px 68px; }.chef { width: 220px; height: 220px; }.speech { min-height: 72px; font-size: 12px; }.price-card { min-height: 114px; }.action-area { min-height: 65px; }.primary,.secondary,.reason { min-height: 52px; } }
@media (prefers-reduced-motion: reduce) { *,*::before,*::after { animation-duration:.01ms !important; animation-iteration-count:1 !important; transition-duration:.01ms !important; scroll-behavior:auto !important; } }
