/* Cartoon kitchen stage. Screens remain real controls on the illustrated table. */
:root{--ink:#342f34;--green:#367567;--orange:#fa7455;--line:#d7c7a0;--chat-height:0px;--header-height:56px}
body,body:has(#chat-feed[hidden]){--chat-height:0px;background:#f7e7b7;color:var(--ink)}
.masthead{background:#fff3cd;border-bottom:3px solid #493d39;padding-inline:22px}.brand{font-weight:800}.header-actions{gap:20px}.text-button{font-weight:600;color:#493d39}main{padding:10px 14px;height:calc(100dvh - var(--header-height))}
.game{border:3px solid #493d39;border-radius:20px;box-shadow:0 5px 0 #493d39;background:#fff4d7;grid-template-rows:31px 68px minmax(0,1fr) 37px;max-width:1600px}.game-top{background:#367567;border-bottom:2px solid #493d39}.scoreboard{padding:10px 0;margin:0 18px;border-bottom:0}.score-item{border-color:#dfcb9c}.score-item>strong{color:#342f34}.stat-label{font-weight:500;color:#766146}.meter-track{height:12px;border:2px solid #493d39;border-radius:7px;background:#e9d9b8}.meter-track span{background:#71bb85!important}.game-bottom{display:none}.control-zone{background:#fff2c9;border-top:2px solid #493d39;padding:5px 10px}.control-zone .live-message{font:600 14px var(--sans);margin:0}.keyboard-tip{display:none}
.kitchen-stage{position:relative;isolation:isolate;min-height:0;overflow:hidden;border-top:2px solid #493d39;background:#f5dea0 url('assets/kitchen.png') center center/100% 100% no-repeat}
.player,.start-player{background-image:url('assets/ticket-hunter.png');background-size:300% 200%;background-repeat:no-repeat;background-position:0 0;pointer-events:none}
.player{position:absolute;width:clamp(210px,24vw,340px);height:clamp(190px,23vw,305px);left:16%;top:-3%;z-index:1;transform-origin:50% 85%;filter:drop-shadow(0 5px 0 #493d3918)}
[data-emotion=worried] .player{background-position:50% 0}[data-emotion=annoyed] .player{background-position:100% 0}[data-emotion=panicked] .player{background-position:0 100%;animation:frazzled .22s steps(2,end) infinite}[data-emotion=happy] .player{background-position:50% 100%;animation:celebrate .7s ease-in-out infinite alternate}[data-emotion=defeated] .player{background-position:100% 100%}
.emotion-caption{position:absolute;z-index:2;left:3%;top:13%;width:145px;padding:10px;background:#fff8d9;border:2px solid #493d39;border-radius:15px 15px 3px 15px;font:italic 600 14px var(--serif);box-shadow:2px 3px 0 #493d3920;transform:rotate(-4deg)}
.devices{position:absolute;inset:auto 0 10px;height:270px;display:grid;grid-template-columns:1.17fr 1.17fr .86fr .86fr 1fr;grid-template-rows:1fr;gap:26px;padding:0 30px;align-items:end;z-index:3;overflow:visible}
.device,.device.laptop{height:100%;max-height:none;grid-template-rows:22px minmax(0,1fr) 12px;align-content:end;position:relative}.device-name{font:700 12px var(--sans);background:#fff8df;border:2px solid #493d39;border-radius:6px;padding:3px 7px;justify-self:center;align-self:start;transform:rotate(-2deg);box-shadow:2px 2px 0 #493d3925;z-index:1;white-space:nowrap}.device-name kbd{background:none;border:0;color:#92703d;padding:0;width:auto;font-size:11px}.device-note{display:none}.device:nth-child(n+3){grid-column:auto;width:100%;margin:0}
.device .device-shell{border:3px solid #493d39!important;box-shadow:4px 5px 0 #493d39!important;max-width:100%;background:#83c8a6}.device:nth-child(2) .device-shell{background:#e8be65}.device:nth-child(3) .device-shell{background:#83bbd0}.device:nth-child(4) .device-shell{background:#f3a184}.device:nth-child(5) .device-shell{background:#b9a4d5}.device.laptop .device-shell{height:178px;width:100%;max-width:300px;border-radius:11px 11px 3px 3px;padding:8px 5px 5px}.device.laptop .device-under{border-color:#493d39;background:#6eb992;box-shadow:0 3px 0 #493d39;height:11px;width:108%;max-width:325px}.device.laptop:nth-child(2) .device-under{border-color:#493d39;background:#ddb355;box-shadow:0 3px 0 #493d39}.device .browser-bar{border-color:#aaad96;background:#f3f3e2;height:19px}.device .screen{background:#fffef1;border-color:#aaad96}.device.laptop .screen{height:139px;min-height:0;grid-template-rows:20px auto 1fr 38px;padding:5px}.device .screen strong{font-family:var(--sans);font-weight:700;font-size:14px}.device .refresh-button{background:#ffe597;border:2px solid #493d39;border-radius:7px;box-shadow:0 2px 0 #493d39;font:700 13px var(--sans);min-height:37px;padding:6px 3px}.device .refresh-button:hover:not(:disabled){background:#ffd064;box-shadow:0 3px 0 #493d39}.device .refresh-button:disabled{background:#eee7ce;border-color:#9c957e;box-shadow:none;color:#908c79}.device.ready .refresh-button{background:#438769;color:#fff}.device.ready .device-shell{box-shadow:0 0 0 5px #fff37e,4px 5px 0 #493d39!important}.device .screen p{font-size:11px}.device.phone .device-shell{height:230px;width:140px;padding:20px 5px 13px;border-radius:24px}.device.phone .screen{height:172px;min-height:0;display:flex;justify-content:space-between;padding:6px}.device.tablet .device-shell{height:230px;width:185px;padding:16px 7px 23px}.device.tablet .screen{height:166px;min-height:0;padding:7px 5px}.device .screen-icon{font-size:24px;height:25px;line-height:25px}
#chat-dock{position:absolute;z-index:5;left:48%;right:4%;top:12px;bottom:auto;width:auto;height:auto;background:none;border:0;padding:0;box-shadow:none;pointer-events:none}#chat-feed{height:auto;max-height:none;overflow:visible;padding:0;display:grid;grid-template-columns:1fr 1fr;align-items:start;gap:16px}.chat-message{position:relative;display:block;background:#fffef4;border:3px solid #493d39;border-radius:19px 19px 19px 5px;box-shadow:3px 4px 0 #493d392b;padding:10px 12px;min-height:81px;animation:bubble-pop .2s ease-out;line-height:1.35}.chat-message:nth-child(even){margin-top:16px;background:#fff0be}.chat-message::after{content:'';position:absolute;width:14px;height:14px;bottom:-10px;left:35%;background:inherit;border-right:3px solid #493d39;border-bottom:3px solid #493d39;transform:skewY(25deg) rotate(22deg)}.bubble-sender{display:flex;align-items:center;gap:6px;margin-bottom:6px}.friend-avatar{display:grid!important;place-items:center;width:23px;height:23px;padding:0!important;border:2px solid #493d39;border-radius:50%!important;background:#a5d4bd!important;font:700 12px var(--sans);color:#343b34}.chat-message strong{font:700 12px var(--sans);color:#385d4b;min-width:0}.chat-message .bubble-text,.chat-message:nth-child(even) .bubble-text{background:none;padding:0;border:0;border-radius:0;font-size:13px;color:#423932}.chat-message:nth-child(even) .friend-avatar{background:#ffc7a7!important}
.start-screen{background:linear-gradient(90deg,#ffefccee 0%,#ffefcc77 45%,transparent 70%),url('assets/kitchen.png') center/cover no-repeat}.start-copy{position:relative;z-index:2;pointer-events:none}.start-copy button,.start-copy kbd{pointer-events:auto}.start-copy h1{color:#367567;text-shadow:3px 4px 0 #fff8dc}.start-copy h1 em{color:#f27555}.start-screen #start{border:3px solid #493d39;background:#ffb957;color:#493d39;box-shadow:0 6px 0 #493d39;font-weight:800}.start-player{position:absolute;left:54%;top:10%;width:min(44vw,520px);height:min(44vw,480px);z-index:1}.start-disclaimer{color:#6b573c}.start-mission{font-family:var(--sans);font-weight:700}.primary{border:2px solid #493d39;background:#f57c55;box-shadow:0 3px 0 #493d39;color:#fffdf5}dialog{border:3px solid #493d39;border-radius:20px;box-shadow:6px 7px 0 #493d39;max-height:calc(100dvh - 30px);margin:15px auto auto;background:#fff5dc}dialog::backdrop{background:#332e3d80;backdrop-filter:blur(3px)}#booking-dialog{max-height:calc(100dvh - 30px)}#booking-dialog .booking-heading{background:#fff5dc}
@keyframes bubble-pop{from{opacity:0;transform:translateY(8px) scale(.96)}to{opacity:1;transform:none}}@keyframes frazzled{0%{transform:rotate(-2deg)}100%{transform:rotate(2deg)}}@keyframes celebrate{to{transform:translateY(-10px) rotate(4deg)}}
@media(max-height:760px) and (min-width:761px){.devices{height:230px;bottom:8px;gap:23px}.device.phone .device-shell,.device.tablet .device-shell{height:193px}.device.phone .screen{height:135px}.device.tablet .screen{height:129px}.device.phone .screen p,.device.tablet .screen p{display:none}.device.laptop .device-shell{height:153px}.device.laptop .screen{height:114px;grid-template-rows:auto 1fr 36px}.device.laptop .screen-icon{display:none}.device .screen strong{font-size:13px}.device .refresh-button{font-size:12px;min-height:34px}.player{width:240px;height:240px;left:17%;top:-3%}.emotion-caption{top:12%;font-size:12px;width:125px}#chat-dock{top:9px}.chat-message .bubble-text{font-size:12px}.chat-message{padding:8px 10px}.start-player{top:4%}}
@media(max-width:1000px) and (min-width:761px){.header-actions{gap:14px}.devices{gap:20px;padding-inline:22px}.device-name{font-size:10px}.device-name kbd{display:none}.player{left:12%;width:230px;height:230px}.emotion-caption{left:2%;width:100px;font-size:11px;top:9%}#chat-dock{left:45%;right:3%}.chat-message .bubble-text{font-size:11px}.device .browser-url{font-size:7px}}
@media(max-width:760px){:root{--header-height:83px;--chat-height:0px}.masthead{height:83px;padding:8px 12px}.header-actions{gap:10px}.header-actions .text-button{font-size:11px}main{padding:6px;height:calc(100dvh - 83px)}.game{grid-template-rows:26px 59px minmax(0,1fr) 30px;border-radius:15px}.scoreboard{margin:0 9px;padding:8px 0}.stat-label{font-size:9px}.score-item{padding:0 9px}.score-item>strong{font-size:23px}.kitchen-stage{background-size:cover;background-position:center}.player{width:190px;height:185px;left:0;top:-2%;z-index:1}.emotion-caption{left:3%;top:145px;width:125px;font-size:11px;padding:6px;transform:rotate(-3deg)}.devices{height:calc(100% - 160px);min-height:255px;bottom:8px;inset-inline:0;padding:0 15px;grid-template-columns:repeat(6,minmax(0,1fr));grid-template-rows:1fr 1fr;gap:5px 13px;align-items:end}.device,.device.laptop{grid-column:span 3;grid-template-rows:21px minmax(0,1fr) 8px;max-height:none;height:100%;align-content:end}.device:nth-child(n+3){grid-column:span 2}.device-name{font-size:9px;padding:2px 5px;border-width:1.5px;white-space:nowrap}.device-name kbd{display:none}.device .device-shell,.device.laptop .device-shell{height:100%;max-height:142px;width:100%;max-width:100%;display:flex;flex-direction:column;border-width:2px!important;box-shadow:2px 3px 0 #493d39!important;padding:6px 4px 4px}.device .browser-bar{height:15px;flex-shrink:0}.device .browser-url{font-size:6px}.device .screen,.device.laptop .screen,.device.phone .screen,.device.tablet .screen{height:auto;min-height:0;flex:1;padding:4px;display:flex;justify-content:space-between;gap:4px}.device .screen strong{font-size:12px;margin:auto 0;line-height:1.15}.device .screen p,.device .screen-icon{display:none}.device .refresh-button{font-size:11px;min-height:33px;padding:5px 1px;border-width:1.5px}.device.phone .device-shell{width:105px;height:100%;max-height:167px;min-height:0;padding:15px 4px 10px;border-radius:18px}.device.tablet .device-shell{height:100%;max-height:167px;padding:12px 4px 16px;border-radius:11px}.device.laptop .device-under{height:7px;border-width:1.5px;width:106%}.phone .device-shell::before{top:5px;height:3px}.device.tablet .device-shell::after{bottom:3px}.control-zone .live-message{font-size:11px}.devices .device-note{display:none}
#chat-dock{left:47%;right:8px;top:7px;z-index:5}#chat-feed{display:flex;flex-direction:column;gap:8px;height:auto}.chat-message{width:100%;padding:6px 8px;min-height:0;border-width:2px;border-radius:12px 12px 12px 3px}.chat-message:nth-child(even){margin:0}.chat-message::after{width:10px;height:10px;bottom:-7px;border-width:2px;left:66%}.chat-message:first-child::after{display:none}.bubble-sender{margin-bottom:3px;gap:5px}.friend-avatar{width:18px;height:18px;font-size:10px;border-width:1.5px}.chat-message strong{font-size:10px}.chat-message .bubble-text{font-size:10px;line-height:1.25;display:block}.start-player{left:40%;top:37%;width:63vw;height:61vw;opacity:.95}.start-copy{align-self:start;padding:28px 25px}.start-copy h1{font-size:76px;margin:20px 0}.start-mission{font-size:15px;max-width:220px}.start-instructions{font-size:11px;max-width:225px}.start-screen{background-position:center}.start-screen #start{font-size:19px;padding:16px 22px}.start-copy .eyebrow{font-size:8px}.start-disclaimer{max-width:180px;display:block}dialog,#booking-dialog{max-height:calc(100dvh - 22px);margin-top:10px}}
@media(max-width:760px) and (max-height:730px){.player{width:155px;height:153px;left:0;top:-3%}.emotion-caption{display:none}.devices{height:calc(100% - 125px);min-height:240px;padding-inline:12px;gap:3px 11px}.device .device-name{font-size:8px}.device .screen strong{font-size:11px}.device .browser-bar{height:13px}.device .refresh-button{font-size:10px;min-height:30px}#chat-dock{left:43%;top:5px}.chat-message .bubble-text{font-size:9px}.chat-message{padding:5px 7px}.friend-avatar{display:none!important}.chat-message strong{font-size:9px}.bubble-sender{margin-bottom:2px}.start-copy{padding-top:18px}.start-copy h1{font-size:64px;margin:16px 0}.start-player{top:37%}.start-instructions{max-width:210px}.start-disclaimer{font-size:9px}}
@media(prefers-reduced-motion:reduce){.player,.chat-message{animation:none!important}}
@media(min-width:761px){.player{top:auto;bottom:43%;left:22%}#chat-dock{left:48%;right:18%;top:auto;bottom:286px}.emotion-caption{top:22%}.chat-message{min-height:88px}}
@media(min-width:761px) and (max-height:760px){#chat-dock{bottom:246px}.player{top:auto;bottom:43%;left:22%}}
#chat-toggle{background:none;border:0;padding:2px 0;min-width:0;height:auto;min-height:0;font:600 13px var(--sans);box-shadow:none}.header-actions #chat-toggle{font-size:12px}
.device{grid-template-columns:minmax(0,1fr)}
@media(max-width:760px){.device.tablet .device-shell{width:100%;max-width:100%;min-width:0}.emotion-caption{display:none}.chat-message .bubble-text,.chat-message:nth-child(even) .bubble-text{font-size:10px;line-height:1.25}.device .device-name{max-width:100%;white-space:normal;text-align:center}}
@media(max-width:760px) and (max-height:730px){.chat-message .bubble-text,.chat-message:nth-child(even) .bubble-text{font-size:9px}}
@media(max-width:760px){.kitchen-stage{background-size:auto 145%;background-position:center bottom}}
/* All group messages originate from the primary phone, never the spare. */
#device-2{z-index:6}
#device-2 #chat-dock{position:absolute;left:50%;right:auto;top:auto;bottom:calc(100% + 13px);width:clamp(190px,20vw,270px);height:auto;transform:translateX(-50%);padding:0}
#device-2 #chat-feed{display:flex;flex-direction:column;gap:7px;height:auto;padding:0}
#device-2 .chat-message{width:100%;min-height:0;margin:0;text-align:left;padding:8px 11px}
#device-2 .chat-message::after{display:none}
#device-2 .chat-message:last-child::after{display:block;left:calc(50% - 8px);bottom:-10px}
@media(max-width:760px){.devices{row-gap:76px}.device .device-shell,.device.laptop .device-shell,.device.phone .device-shell,.device.tablet .device-shell{min-height:0}#device-2 #chat-dock{width:175px;left:0;transform:none;bottom:calc(100% + 9px)}#device-2 .chat-message:not(:last-child){display:none}#device-2 .chat-message{padding:5px 7px}#device-2 .chat-message:last-child::after{left:36px;bottom:-7px}#device-2 .bubble-text{font-size:10px;line-height:1.25}#device-2 .friend-avatar{display:none!important}.device .screen strong{font-size:11px}.device .browser-bar{height:12px}.device .refresh-button{min-height:29px}}
.booking-bonus{font:600 12px var(--sans);color:#367567;margin-left:auto;text-align:right}#booking-dialog .booking-heading{gap:12px}#booking-dialog #booking-sheet{overflow:hidden}#booking-dialog #booking-sheet .sheet-toolbar{border-radius:5px 5px 0 0}
@media(max-width:760px){.booking-bonus{font-size:10px;max-width:100px}#booking-dialog .booking-heading .eyebrow{font-size:8px;max-width:145px}}

/* Winning gets its own stage so the result dialog never hides the celebration. */
#victory-scene{position:relative;width:230px;height:195px;margin:-15px auto 5px;isolation:isolate}
.victory-dancer{position:absolute;left:25px;top:5px;width:180px;height:180px;background:url('assets/ticket-hunter.png') 0 0/300% 200% no-repeat;transform-origin:50% 85%}
#result-dialog[open] .victory-dancer{animation:mushroom-munch 2.4s ease-in-out both,victory-boogie .85s 2.4s infinite linear}
.victory-mushroom{position:absolute;font-size:38px;line-height:1;left:44%;top:72%;transform:rotate(-20deg)}
#result-dialog[open] .victory-mushroom{animation:mushroom-bite 2.4s both}
.victory-notes{position:absolute;inset:20px 0 auto;font-size:32px;font-weight:900;color:#cf613f;letter-spacing:58px;white-space:nowrap;opacity:0;pointer-events:none}
#result-dialog[open] .victory-notes{animation:party-notes 1.4s 2.4s infinite}
@keyframes mushroom-bite{0%,15%{top:72%;transform:rotate(-20deg);opacity:1}45%,60%{top:40%;transform:rotate(15deg) scale(.9);opacity:1}75%{top:40%;transform:scale(.45);opacity:1}90%,100%{top:40%;transform:scale(0);opacity:0}}
@keyframes mushroom-munch{0%,45%{transform:none;background-position:0 0}60%,80%{transform:rotate(-4deg) scale(1.03,.97);background-position:0 0}70%,90%{transform:rotate(4deg) scale(.97,1.03);background-position:0 0}100%{transform:none;background-position:50% 100%}}
@keyframes victory-boogie{0%,100%{background-position:50% 100%;transform:translateX(-18px) rotate(-15deg) scale(1.05,.95)}25%{background-position:50% 100%;transform:translate(0,-24px) rotate(12deg) scale(.93,1.07)}50%{background-position:50% 100%;transform:translateX(18px) rotate(15deg) scale(1.05,.95)}75%{background-position:50% 100%;transform:translate(0,-15px) rotate(-12deg) scale(.93,1.07)}}
@keyframes party-notes{0%,100%{opacity:.65;transform:translateY(0) rotate(-6deg)}50%{opacity:1;transform:translateY(-12px) rotate(6deg)}}
#result-dialog:has(#victory-scene:not([hidden])){padding-top:24px}
#result-dialog:has(#victory-scene:not([hidden])) h2{font-size:30px;margin:8px 0}
#result-dialog:has(#victory-scene:not([hidden])) .result-receipt{margin:12px 0;padding:10px 0}
@media(max-height:700px){#victory-scene{height:145px;width:185px}.victory-dancer{width:140px;height:140px;left:22px}.victory-mushroom{font-size:30px}#result-dialog:has(#victory-scene:not([hidden])){padding:20px}#result-dialog .result-footnote{margin-top:10px}}
@media(prefers-reduced-motion:reduce){#result-dialog[open] .victory-dancer{animation:none;background-position:50% 100%}#result-dialog[open] .victory-mushroom{animation:none;display:none}#result-dialog[open] .victory-notes{animation:none;opacity:1}}
