@import url('https://fonts.googleapis.com/css2?family=Gowun+Dodum&family=Jua&family=Noto+Sans+KR:wght@400;500;600;700;800&display=swap');
:root{font-family:'Noto Sans KR',sans-serif;color:#633c32;background:#f9f3e9;font-synthesis:none;--red:#ab4540;--wine:#743a32;--muted:#a18372;--cream:#fffaf0;--line:#e8d9c6;--green:#4b8461}
*{box-sizing:border-box}body{margin:0;background:radial-gradient(ellipse at 50% 0%,#fffaf3 0,#f9f3e9 75%);min-height:100vh}button{font:inherit;cursor:pointer;-webkit-tap-highlight-color:transparent;touch-action:manipulation}button:focus-visible{outline:3px solid #397780;outline-offset:4px}button:disabled{cursor:wait;opacity:.65}.bakery-app{max-width:1280px;padding:33px 40px 23px;margin:auto}.page-header{display:flex;align-items:center;justify-content:space-between;margin-bottom:26px;gap:15px}.brand{display:flex;align-items:center;gap:15px}.brand-mark{font-size:49px;color:var(--red);line-height:1}.eyebrow{font-size:10px;font-weight:800;letter-spacing:3px;color:var(--red);margin-bottom:5px}h1{font-family:'Jua','Noto Sans KR',sans-serif;font-size:37px;line-height:1.15;font-weight:400;letter-spacing:-1px;margin:0}.title-dot{color:var(--red)}.header-tools{display:flex;align-items:center;gap:9px}.header-caption{font-family:'Gowun Dodum',sans-serif;font-size:14px;margin-right:18px;color:#977b66}.icon-button{width:37px;height:37px;border:1px solid #e1d3c1;border-radius:50%;display:grid;place-items:center;background:transparent;color:#795243;font-size:20px;font-weight:600;flex-shrink:0}.icon-button:hover{background:#efe3d4}.icon-button svg{width:18px;height:18px}.sound-waves{display:none}.sound-on .sound-waves{display:block}.sound-on .sound-off{display:none}.game-shell{border:1px solid #d9c4ab;border-radius:19px;overflow:hidden;background:var(--cream);box-shadow:0 7px 0 #eee1d0,0 13px 30px #5e35290b}.hud{height:99px;display:grid;grid-template-columns:1.45fr .9fr 1.4fr .8fr 37px;align-items:center;padding:0 29px;gap:27px;background:#fffaf1;border-bottom:1px solid #ddcbb8}.hud-label,.control-label{display:block;font-size:12px;font-weight:500;color:#937563}.stage-hud>div{display:flex;align-items:baseline;gap:4px;white-space:nowrap}.stage-hud b{font-size:31px;font-weight:800}.muted{color:#ab9180;font-size:14px;font-weight:500}.stage-flavor{font-size:12px;margin-left:10px;color:#856954}.time-hud{padding-left:23px;border-left:1px solid #e8d9c6}.time-hud strong{font-size:29px;font-weight:700;letter-spacing:1px;font-variant-numeric:tabular-nums}.score-label{display:flex;justify-content:space-between;align-items:center;gap:10px;margin-bottom:10px}.score-label strong{font-size:22px;color:var(--red)}.score-track,.window-track{overflow:hidden;border-radius:5px;background:#eee0cd;height:7px}.score-track i{display:block;background:var(--red);width:0%;height:100%;transition:width .3s}.hearts-hud{border-left:1px solid #e8d9c6;padding-left:27px}.hearts-hud>div{display:flex;gap:6px;color:#b94a46;font-size:28px;line-height:1.3;margin-top:3px}.hearts-hud .lost{color:#dfcfc0}.scene-wrap{position:relative;aspect-ratio:2/1;background:#e9c59b;isolation:isolate;overflow:hidden}#game-canvas{width:100%;height:100%;display:block}.scene-label{position:absolute;pointer-events:none;text-align:center;font-size:12px;color:#805746}.bakery-label{left:4.5%;top:6%;padding:7px 13px;background:#fff5dcde;border:1px solid #aa724441;border-radius:6px}.work-label{left:60.3%;bottom:7%;width:23%;background:#ffeed5eb;border:1px dashed #ae7455;border-radius:8px;padding:8px 10px}.work-label span{font-size:12px;display:block;opacity:.8}.work-label b{font-size:14px;display:block;letter-spacing:1px;margin-top:2px}.scene-feedback{position:absolute;left:63%;top:22%;font-family:'Jua',sans-serif;font-size:25px;color:var(--green);transform:rotate(-5deg);text-shadow:0 2px white;pointer-events:none}.scene-feedback.bad{color:#b5433d}.overlay{position:absolute;inset:0;display:flex;align-items:center;justify-content:center;z-index:10;background:#6c392515;backdrop-filter:blur(1.2px)}.modal-card{width:385px;max-height:94%;overflow:auto;padding:29px 30px 23px;text-align:center;background:#fffaf0f7;border:2px solid #e8cba4;border-radius:19px;box-shadow:0 10px 0 #72452c22,0 18px 50px #54302520}.small-stamp{display:inline-block;font-size:11px;font-weight:700;letter-spacing:2px;color:#ac5042;margin-bottom:13px}.modal-card h2{font-family:'Jua',sans-serif;font-size:32px;line-height:1.25;letter-spacing:-.5px;font-weight:400;margin:0 0 13px;color:#723c30}.modal-card p{font-size:14px;line-height:1.8;margin:0 0 18px;color:#94715a}.start-rules{display:flex;justify-content:center;gap:19px;font-size:12px;margin:17px 0;color:#96725b}.start-rules b{color:#824634}.primary-button{display:flex;justify-content:center;align-items:center;gap:24px;border:1px solid #923b35;background:#ab4941;color:#fff8e8;width:100%;padding:13px 18px;border-radius:9px;font-weight:700;font-size:15px;box-shadow:0 4px 0 #823a31;transition:transform .15s,background .15s}.primary-button:hover{background:#b75348;transform:translateY(-1px)}.primary-button:active{transform:translateY(3px);box-shadow:0 1px 0 #823a31}.primary-button span{font-size:22px;line-height:1}.start-note{display:block;font-size:11px;color:#ab8e78;margin-top:17px}.secondary-button{width:100%;border:1px solid #dbc4ac;background:transparent;border-radius:8px;padding:10px;margin-top:12px;font-size:14px;color:#855b47}.workbench{min-height:218px;display:grid;grid-template-columns:1.15fr 1.35fr .85fr;padding:22px 34px 20px;align-items:center;gap:30px;border-top:1px solid #cda77f;background:#fffaf1}.cookie-comparison{display:flex;align-items:center;justify-content:center;gap:14px}.preview-item{text-align:center}.control-label{margin-bottom:8px;font-size:12px}.cookie-swatch{width:105px;height:117px;border-radius:9px;position:relative;display:flex;flex-direction:column;align-items:center;justify-content:center;border:1px solid #e6d4bc;background:#f6eddf;overflow:hidden}.cookie-swatch canvas{width:87px;height:87px}.cookie-swatch span{font-size:11px;color:#a18065;padding:2px 0 8px;white-space:nowrap}.current-swatch{background:#fffcf5;border-color:#d4b994}.target-swatch{background:repeating-linear-gradient(45deg,#f0e3d2 0 5px,#f4e9dc 5px 10px);border:2px dashed #d5b891}.comparison-arrow{color:#c7ad91;font-size:20px;padding-top:18px}.keyboard-area{border-left:1px solid var(--line);border-right:1px solid var(--line);text-align:center;align-self:stretch;display:flex;flex-direction:column;justify-content:center;align-items:center}.key-instruction{font-size:12px;color:#8e6d54;margin-bottom:5px}.dpad{position:relative;width:284px;height:145px;display:grid;grid-template-columns:43px 43px 43px;grid-template-rows:39px 39px 39px;gap:4px;justify-content:center;align-content:center}.key{border:1px solid #d9c5ac;border-bottom:3px solid #c9aa8c;border-radius:7px;background:#fffcf5;color:#7d513d;display:grid;place-items:center;font-size:24px;line-height:1;user-select:none;touch-action:none}.key:hover{background:#f0dfc7}.key:active,.key.pressed{background:#e7cba9;transform:translateY(2px);border-bottom-width:1px}.key-up{grid-row:1;grid-column:2}.key-left{grid-row:2;grid-column:1}.key-right{grid-row:2;grid-column:3}.key-down{grid-row:3;grid-column:2}.key-center{grid-row:2;grid-column:2;display:grid;place-items:center;font-size:22px;color:#d5b697}.dpad-left-label,.dpad-right-label,.dpad-up-label,.dpad-down-label{position:absolute;color:#a08065;font-size:10px;white-space:nowrap}.dpad-left-label{left:3px;top:64px}.dpad-right-label{right:3px;top:64px}.dpad-up-label{left:174px;top:20px}.dpad-down-label{left:174px;bottom:17px}.packing-status{padding-left:4px}.window-time{display:flex;align-items:baseline;gap:7px;margin:0 0 10px}.window-time strong{font-size:37px;line-height:1.1;font-weight:600;font-variant-numeric:tabular-nums}.window-time>span{color:#a58870;font-size:14px}.window-time .clock-symbol{font-size:34px;margin-left:auto;color:#bc9e7d}.window-track i{height:100%;width:100%;display:block;background:#be9154;transition:background .2s}.packing-status p{font-size:12px;line-height:1.7;color:#ab8a70;margin:11px 0 0}.page-footer{display:flex;justify-content:space-between;align-items:center;font-size:11px;color:#aa907a;margin-top:22px;gap:15px}.page-footer b{letter-spacing:1.4px;font-size:9px;margin-right:14px;color:#94765f}.page-footer i{margin:0 10px;font-style:normal;color:#cbb5a0}.footer-flower{font-size:17px;color:#aa5c4b;margin-left:12px}.hidden{display:none!important}.stage-intro{position:absolute;inset:0;z-index:6;background:#fff0d4a8;backdrop-filter:blur(3px);display:flex;align-items:center;justify-content:center;flex-direction:column;animation:intro-in .3s ease}.stage-intro>span{font-size:17px;color:#965637;letter-spacing:3px}.stage-intro canvas{width:84%;height:auto}.stage-intro strong{font-family:'Jua',sans-serif;font-size:24px;font-weight:400;color:#7c4430}.tasting{position:absolute;inset:0;z-index:6;background:radial-gradient(circle,#fff8dfee,#f4cda5f5);display:flex;flex-direction:column;align-items:center;justify-content:center}.tasting canvas{height:64%;width:auto;object-fit:contain;animation:taste-bounce .45s ease infinite alternate}.tasting h2{font-family:'Jua',sans-serif;margin:0;font-weight:400;font-size:34px}.tasting p{font-size:12px;letter-spacing:3px;color:#a7754c;margin:5px}.tasting-sparkle{position:absolute;top:15%;font-size:50px;letter-spacing:60px;color:#d9a650}.results-card{width:540px;padding:20px 24px;max-height:95%}.results-card h2{font-size:27px}.results-card>p{margin-bottom:10px}.results-summary{display:flex;justify-content:center;gap:30px;margin-bottom:12px;font-size:12px}.results-summary b{font-size:23px;color:var(--red);margin-right:4px}.results-table-wrap{max-height:190px;overflow-y:auto;margin-bottom:15px;border:1px solid #ecdcc7;border-radius:8px}.results-table{border-collapse:collapse;width:100%;font-size:12px;text-align:left}.results-table th{font-weight:500;color:#a07f67;background:#f5e8d8;position:sticky;top:0}.results-table th,.results-table td{padding:7px 10px;border-bottom:1px solid #eddfce}.results-table td:last-child{text-align:right}.result-clear{color:var(--green)}.result-fail{color:var(--red)}.help-list{text-align:left;padding-left:18px;color:#8e6d54;font-size:14px;line-height:1.85}.help-list li{margin-bottom:7px}.help-list b{color:#784733}.low-time{color:#b1443d}.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}@keyframes intro-in{from{opacity:0;transform:scale(1.05)}to{opacity:1;transform:scale(1)}}@keyframes taste-bounce{to{transform:translateY(-7px) rotate(2deg)}}
@media(min-width:1450px){.bakery-app{padding-top:40px;max-width:1360px}.page-header{margin-bottom:30px}.scene-wrap{aspect-ratio:2.12/1}.workbench{min-height:233px}}
@media(max-width:1050px){.bakery-app{padding:24px}.hud{padding:0 20px;gap:18px;grid-template-columns:1.25fr .8fr 1.1fr .65fr 32px}.stage-flavor{display:none}.hearts-hud{padding-left:17px}.workbench{padding:20px;gap:16px;grid-template-columns:1.1fr 1.2fr .8fr}.cookie-comparison{gap:9px}.cookie-swatch{width:91px}.dpad{width:234px}.dpad-left-label,.dpad-right-label{font-size:9px}.dpad-up-label,.dpad-down-label{left:151px;font-size:9px}}
@media(max-width:760px){.bakery-app{padding:16px 12px 15px}.page-header{margin-bottom:15px}.brand{gap:10px}.brand-mark{font-size:36px}.eyebrow{font-size:8px;letter-spacing:2px;margin-bottom:3px}h1{font-size:29px}.header-caption{display:none}.header-tools{gap:7px}.icon-button{width:32px;height:32px;font-size:17px}.game-shell{border-radius:14px}.hud{height:80px;padding:0 13px;gap:13px;grid-template-columns:.75fr .82fr 1.22fr .78fr}.hud-label{font-size:10px}.stage-hud b{font-size:26px}.stage-hud .muted{font-size:11px}.time-hud{padding-left:0;border:none}.time-hud strong{font-size:24px}.score-label{margin-bottom:7px;gap:4px}.score-label strong{font-size:20px}.score-label .muted{font-size:10px}.hearts-hud{padding-left:0;border:none}.hearts-hud>div{gap:3px;font-size:22px}.pause-button{position:absolute;right:22px;margin-top:113px;background:#fff6e6e8;z-index:4;width:30px;height:30px;border-color:#d8b998}.scene-wrap{aspect-ratio:1.3/1}#game-canvas{object-fit:fill}.bakery-label{font-size:9px;padding:5px 8px;left:3%;top:4%}.work-label{width:31%;left:60%;bottom:5%;padding:5px 4px}.work-label span{font-size:9px}.work-label b{font-size:10px;margin-top:0;letter-spacing:0}.scene-feedback{font-size:18px;left:58%;top:17%}.modal-card{width:320px;padding:19px 23px 17px;border-radius:14px;max-height:94%}.small-stamp{font-size:9px;margin-bottom:8px}.modal-card h2{font-size:27px;margin-bottom:8px}.modal-card p{font-size:12px;margin-bottom:10px;line-height:1.65}.start-rules{font-size:11px;gap:14px;margin:10px 0}.primary-button{font-size:14px;padding:10px 13px}.start-note{font-size:10px;margin-top:10px}.workbench{grid-template-columns:1fr 1.05fr;gap:15px;padding:19px 15px 15px;position:relative}.cookie-comparison{gap:7px;align-self:start;padding-top:2px}.control-label{font-size:11px;margin-bottom:7px}.cookie-swatch{width:72px;height:91px}.cookie-swatch canvas{width:68px;height:68px}.cookie-swatch span{font-size:9px;padding:0 0 5px}.comparison-arrow{font-size:15px;padding-top:18px}.keyboard-area{border:none;grid-row:1 / 3;grid-column:2}.key-instruction{font-size:11px;margin-bottom:3px;white-space:nowrap}.dpad{width:157px;height:165px;grid-template-columns:45px 45px 45px;grid-template-rows:46px 46px 46px;gap:5px}.key{font-size:27px;border-bottom-width:4px}.dpad-left-label,.dpad-right-label,.dpad-up-label,.dpad-down-label{display:none}.packing-status{grid-column:1;grid-row:2;margin-top:-6px;padding:0}.packing-status .control-label{display:none}.window-time{gap:4px;margin-bottom:5px;justify-content:center}.window-time strong{font-size:21px}.window-time>span{font-size:10px}.window-time .clock-symbol{display:none}.window-track{height:5px}.packing-status p{font-size:10px;margin-top:6px;text-align:center;line-height:1.35}.packing-status p br{display:none}.page-footer{font-size:10px;margin-top:16px;justify-content:center;text-align:center}.page-footer>span:first-child{display:none}.stage-intro>span{font-size:12px;letter-spacing:1.5px}.stage-intro strong{font-size:20px}.tasting h2{font-size:25px}.tasting p{font-size:10px}.tasting-sparkle{font-size:25px;letter-spacing:30px}.results-card{width:93%;padding:15px 17px}.results-card h2{font-size:24px}.results-summary{gap:20px;font-size:11px;margin-bottom:8px}.results-summary b{font-size:17px}.results-table-wrap{max-height:95px;margin-bottom:10px}.results-table{font-size:11px}.results-table th,.results-table td{padding:5px 7px}.help-list{font-size:12px;line-height:1.55;margin:8px 0;padding-left:17px}.help-list li{margin-bottom:4px}}
@media(max-width:370px){.bakery-app{padding:12px 8px}.hud{gap:8px;padding:0 10px}.hud-label{font-size:9px}.time-hud strong{font-size:21px}.hearts-hud>div{font-size:19px}.scene-wrap{aspect-ratio:1.4/1}.workbench{padding:15px 10px;gap:8px}.cookie-swatch{width:65px}.cookie-swatch canvas{width:61px;height:65px}.cookie-comparison{gap:4px}.dpad{width:143px;grid-template-columns:43px 43px 43px;gap:4px}.key-instruction{font-size:10px}.modal-card{width:280px;padding:16px 20px}.modal-card h2{font-size:25px}}
@media(prefers-reduced-motion:reduce){*,*::before,*::after{animation:none!important;transition:none!important}}

.character-select{width:490px;padding:23px 28px 20px}.character-select h2{font-size:29px;margin-bottom:16px}.character-select .small-stamp{font-size:12px;margin-bottom:10px}.family-options{display:grid;grid-template-columns:1fr 1fr;gap:12px;margin:0 0 17px;padding:0;border:0;min-width:0}.family-option{position:relative;display:block;cursor:pointer;min-width:0;-webkit-tap-highlight-color:transparent}.family-option input{position:absolute;width:1px;height:1px;opacity:0}.family-option-card{display:flex;align-items:center;justify-content:center;gap:11px;border:2px solid #e6d1b6;background:#fff8eb;border-radius:12px;padding:9px 12px;position:relative;transition:background .15s,border-color .15s;min-height:100px}.family-option-card canvas{width:78px;height:78px;object-fit:contain;flex-shrink:0}.family-option-card strong{font-size:18px;white-space:nowrap}.family-check{position:absolute;right:7px;top:5px;font-size:14px;line-height:1;color:#a6443c;visibility:hidden}.family-option input:checked+.family-option-card{border-color:#ad4d43;background:#fbe8d6;box-shadow:0 0 0 1px #ad4d43}.family-option input:checked+.family-option-card .family-check{visibility:visible}.family-option input:focus-visible+.family-option-card{outline:3px solid #397780;outline-offset:3px}.family-option:hover .family-option-card{background:#f7eddd}.family-option input:disabled+.family-option-card{opacity:.55;cursor:wait}.character-select .start-note{font-size:12px;margin-top:14px}.character-select .primary-button:disabled{cursor:default;box-shadow:none}.results-player{color:#a64940;font-weight:600}.difficulty-options{margin:0 0 16px}.difficulty-title{display:block;font-size:12px;font-weight:800;letter-spacing:1px;color:#a6443c;margin-bottom:7px}.difficulty-row{display:grid;grid-template-columns:repeat(3,1fr);gap:9px}.difficulty-option{position:relative;display:block;cursor:pointer;min-width:0;-webkit-tap-highlight-color:transparent}.difficulty-option input{position:absolute;width:1px;height:1px;opacity:0}.difficulty-card{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:3px;min-height:52px;padding:7px 5px;border:2px solid #e6d1b6;background:#fff8eb;border-radius:11px;transition:background .15s,border-color .15s}.difficulty-card strong{font-size:15px;white-space:nowrap}.difficulty-card small{font-size:10px;color:#9b7255;white-space:nowrap}.difficulty-option input:checked+.difficulty-card{border-color:#ad4d43;background:#fbe8d6;box-shadow:0 0 0 1px #ad4d43}.difficulty-option input:focus-visible+.difficulty-card{outline:3px solid #397780;outline-offset:3px}.difficulty-option:hover .difficulty-card{background:#f7eddd}
@media(max-width:760px){.scene-wrap.choosing-player{min-height:370px}.character-select{width:calc(100% - 24px);max-width:360px;padding:17px 17px 15px;max-height:96%}.character-select h2{font-size:25px;margin-bottom:12px}.character-select .small-stamp{font-size:11px;margin-bottom:8px}.family-options{gap:10px;margin-bottom:13px}.family-option-card{padding:7px 9px;min-height:91px;gap:7px}.family-option-card canvas{width:64px;height:64px}.family-option-card strong{font-size:16px}.character-select .start-note{font-size:11px;margin-top:11px}.character-select .primary-button{font-size:14px;min-height:44px}.difficulty-options{margin-bottom:12px}.difficulty-title{font-size:11px;margin-bottom:6px}.difficulty-row{gap:7px}.difficulty-card{min-height:46px;padding:5px 3px}.difficulty-card strong{font-size:14px}.difficulty-card small{font-size:9px}}
@media(max-width:370px){.family-option-card{padding:7px 5px;gap:4px}.family-option-card canvas{width:58px;height:58px}.family-option-card strong{font-size:15px}.character-select h2{font-size:23px}.difficulty-card{min-height:42px;padding:4px 2px}.difficulty-card strong{font-size:13px}.difficulty-card small{font-size:8px}}

.game-shell{position:relative}
.play-surface{min-width:0}
.side-controls,.orientation-hint{display:none}
.side-key{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:7px;min-width:0;min-height:64px;padding:8px 3px;border:1px solid #c9aa8c;border-bottom:4px solid #ba9270;border-radius:14px;background:#fffaf0;color:#754b39;font-size:13px;font-weight:700;line-height:1.3;touch-action:none;user-select:none;-webkit-user-select:none;-webkit-touch-callout:none}
.side-key-icon{font-size:33px;font-weight:500;line-height:1}
.side-key:active,.side-key.pressed{background:#e7cba9;transform:translateY(2px);border-bottom-width:2px}
@media(orientation:portrait) and (max-width:760px){.orientation-hint{display:block;text-align:center;color:#94765f;font-size:11px;margin:16px 0 0}}

/* Reserve both thumb areas without covering the conveyor or cookie previews. */
@media (orientation:landscape){
 body{height:100dvh;min-height:0;overflow:hidden;overscroll-behavior:none}
 .bakery-app{height:100dvh;max-width:none;min-height:0;display:flex;flex-direction:column;gap:6px;padding:max(6px,env(safe-area-inset-top)) max(8px,env(safe-area-inset-right)) max(8px,env(safe-area-inset-bottom)) max(8px,env(safe-area-inset-left))}
 .page-header{min-height:32px;height:32px;flex-shrink:0;margin:0;gap:10px}
 .brand{gap:8px}.brand-mark{font-size:26px}.eyebrow,.header-caption{display:none}h1{font-size:23px}
 .header-tools{gap:7px}.icon-button{width:32px;height:32px;font-size:17px}
 .game-shell{flex:1;min-height:0;display:grid;grid-template-rows:48px minmax(0,1fr) 78px;border-radius:12px;box-shadow:none}
 .hud{height:auto;min-height:0;padding:3px 14px;gap:16px;grid-template-columns:1fr .9fr 1.25fr .75fr 32px}
 .hud-label{font-size:9px}.stage-hud b{font-size:24px}.stage-hud .muted{font-size:11px}.stage-flavor{display:none}
 .time-hud{padding:0;border:none}.time-hud strong{font-size:23px}
 .score-label{margin-bottom:3px;gap:4px}.score-label strong{font-size:20px}.score-label .muted{font-size:10px}.score-track{height:5px}
 .hearts-hud{padding:0;border:none}.hearts-hud>div{font-size:21px;gap:4px;margin:0;line-height:1.1}
 .pause-button{position:static;right:auto;margin:0;width:32px;height:32px;background:transparent}
 .play-surface{display:grid;grid-template-columns:clamp(76px,11vw,104px) minmax(0,1fr) clamp(76px,11vw,104px);gap:6px;min-height:0;overflow:hidden;background:#f4e5d0}
 .scene-wrap,.scene-wrap.choosing-player{height:100%;width:100%;min-height:0;min-width:0;aspect-ratio:auto}
 .side-controls{display:grid;grid-template-rows:1fr 1fr;gap:12px;padding:8px 4px;min-height:0}
 .side-key{padding:4px 2px;gap:4px;font-size:12px}.side-key-icon{font-size:28px}
 .side-controls-left{padding-left:6px}.side-controls-right{padding-right:6px}
 .bakery-label{font-size:9px;padding:4px 7px;left:3%;top:4%}
 .work-label{left:60%;bottom:4%;width:31%;padding:4px}.work-label span{font-size:9px}.work-label b{font-size:10px;letter-spacing:0;margin:0}
 .scene-feedback{font-size:18px;top:18%;left:58%}
 .workbench{min-height:0;display:flex;padding:4px 12px;gap:24px;align-items:center;justify-content:center}
 .keyboard-area{display:none}.cookie-comparison{gap:10px;align-self:center;padding:0}
 .preview-item{display:flex;align-items:center;gap:6px}.control-label{font-size:11px;margin:0}
 .cookie-swatch{width:64px;height:64px}.cookie-swatch canvas{width:60px;height:60px}.cookie-swatch span{display:none}
 .comparison-arrow{padding:0;font-size:18px}.packing-status{width:110px;padding:0;margin:0;flex-shrink:0}
 .packing-status .control-label{display:block;font-size:9px;text-align:center}.packing-status p,.window-time .clock-symbol{display:none}
 .window-time{justify-content:center;gap:4px;margin:2px 0 4px}.window-time strong{font-size:24px}.window-time>span{font-size:11px}.window-track{height:5px}
 .page-footer,.orientation-hint{display:none}
 .game-shell.choosing-player{grid-template-rows:48px minmax(0,1fr)}
 .game-shell.choosing-player .play-surface{grid-template-columns:1fr}
 .game-shell.choosing-player .side-controls,.game-shell.choosing-player .workbench{display:none}
 .modal-card{max-width:calc(100% - 24px);max-height:96%;padding:16px 22px}
 .character-select{width:490px;max-width:calc(100% - 24px);padding:12px 20px}
 .character-select .small-stamp{display:none}.character-select h2{font-size:25px;margin:0 0 10px}
 .family-options{gap:8px;margin-bottom:12px}.family-option-card{min-height:72px;padding:4px 10px;gap:10px}
 .difficulty-options{margin-bottom:10px}.difficulty-title{font-size:11px;margin-bottom:5px}.difficulty-row{gap:7px}
 .difficulty-card{min-height:44px;padding:4px 3px;gap:1px}.difficulty-card strong{font-size:14px}.difficulty-card small{font-size:9px}
 .family-option-card canvas{width:60px;height:60px}.family-option-card strong{font-size:17px}
 .character-select .primary-button{min-height:44px;font-size:14px;padding:8px 12px}
 .character-select .start-note{font-size:11px;margin-top:10px}
 .stage-intro>span{font-size:12px;letter-spacing:1px}.stage-intro canvas{max-height:50%;width:84%;object-fit:contain}.stage-intro strong{font-size:20px}
 .tasting h2{font-size:23px}.tasting p{font-size:10px;margin:3px}.tasting-sparkle{font-size:25px;letter-spacing:25px}
 .results-card h2{font-size:25px}.results-table-wrap{max-height:120px}
}

/* The full scene keeps its width and 2:1 ratio. Fullscreen frees the vertical space. */
.scene-wrap{display:grid;place-items:center;aspect-ratio:2/1}
.scene-stage{width:100%;aspect-ratio:2/1;position:relative;isolation:isolate}
#game-canvas{width:100%;height:100%;aspect-ratio:2/1;object-fit:contain}
.side-key{word-break:keep-all}
.rotate-prompt{position:absolute;inset:0;z-index:8;display:flex;flex-direction:column;align-items:center;justify-content:center;background:#fff5e9f5;text-align:center;padding:20px}
.rotate-prompt>span{font-size:60px;color:#ab4941}.rotate-prompt strong{font-family:'Jua',sans-serif;font-size:25px}.rotate-prompt p{font-size:13px;line-height:1.7}
.header-caption{display:none}
.hud{grid-template-columns:1fr .8fr 1.2fr .7fr .65fr 32px 110px;gap:12px}
.hud .packing-status{width:auto;min-width:0;padding:0;margin:0}.hud .packing-status>p,.hud .clock-symbol{display:none}
.hud .packing-status .control-label{font-size:10px;margin:0}
.hud .window-time{justify-content:center;margin:2px 0 4px;gap:3px}.hud .window-time strong{font-size:24px}.hud .window-time>span{font-size:10px}.hud .window-track{height:4px}
.header-tools{gap:5px}.header-tools .icon-button{width:32px;height:32px}
@media (orientation:landscape){
 .game-shell,.game-shell.choosing-player{grid-template-rows:48px minmax(0,1fr)}
 .bakery-app.game-started .page-header{display:none}
 .bakery-app.game-started{gap:0}
 .hud{grid-template-columns:.85fr .8fr 1.15fr .7fr .6fr 32px 106px;padding:3px 10px;gap:8px}
 .hud .packing-status{grid-column:auto;grid-row:auto}
 .side-controls{grid-template-rows:minmax(44px,1fr) auto minmax(44px,1fr);gap:8px;padding-top:6px;padding-bottom:6px}
 .side-controls .preview-item{display:flex;flex-direction:column;gap:3px;align-items:center;justify-content:center;min-width:0}
 .side-controls .control-label{font-size:10px;white-space:nowrap}
 .side-controls .cookie-swatch{width:68px;height:68px}.side-controls .cookie-swatch canvas{width:64px;height:64px}
 .scene-wrap{align-content:center;overflow:visible}
 .scene-stage{height:auto}
 .scene-label{font-size:9px}.work-label{width:25%;left:59%;bottom:4%;padding:3px}
 .work-label span{display:none}.work-label b{font-size:10px}
 .bakery-label{top:3%;padding:3px 5px}
 .character-select .start-note{font-size:10px}
}
@media (orientation:portrait){
 .hud{height:auto;min-height:106px;grid-template-columns:repeat(4,minmax(0,1fr));gap:8px;padding:8px}
 .hud .packing-status{grid-row:2;grid-column:1 / 3}.hud .window-time{display:inline-flex;margin:0 6px}.hud .packing-status .control-label{display:inline}.hud .window-track{display:none}
 .hud .pause-button{position:static;margin:0;grid-row:2;grid-column:3}
 .hud .header-tools{grid-row:2;grid-column:4;justify-content:flex-end}
 .hud .header-tools #sound-button,.hud .header-tools #help-button{display:none}
}
@media (orientation:landscape) and (max-height:340px) and (max-width:1200px){
 .side-controls{gap:8px;padding-top:4px;padding-bottom:4px}
 .side-key{flex-direction:row;min-height:44px;padding:4px 2px;gap:3px;font-size:10px}
 .side-key-icon{font-size:23px}.side-key>span:last-child{max-width:4em}
}

/* Leave the conveyor and both previews visible throughout the five-second run-up. */
.stage-intro{background:none;backdrop-filter:none;pointer-events:none;justify-content:center;padding-top:10px;animation:none}
.stage-intro>span{font-size:13px;letter-spacing:0;padding:6px 10px;border:1px solid #d9ba91;border-radius:20px;background:#fff8eaf2;color:#80513a;box-shadow:0 2px 5px #6b392315}
.stage-intro>span b{color:#4b8461;font-size:17px;font-variant-numeric:tabular-nums}
.stage-intro canvas{width:68%;max-width:680px;height:auto;max-height:42%;object-fit:contain}
.stage-intro strong{font-size:20px;text-shadow:0 1px 3px #fff8ea,0 0 8px #fff8ea}
.stage-intro.compact canvas,.stage-intro.compact strong{display:none}
.stage-intro.compact{justify-content:flex-start}
@media (max-height:500px){.stage-intro{padding-top:5px}.stage-intro>span{font-size:10px;padding:4px 8px}.stage-intro>span b{font-size:14px}.stage-intro strong{font-size:14px}}

/* Keep each family menu visible while choosing a player. */
.family-option-name{display:flex;flex-direction:column;align-items:center;gap:5px;min-width:0}.family-option-name small{font-size:10px;line-height:1.35;color:#9b7255;word-break:keep-all;overflow-wrap:anywhere}.family-option-card{gap:8px}

/* Three-box transformation puzzle */
.question-hud strong{display:block;font-size:23px;font-variant-numeric:tabular-nums}
.play-surface{display:block;position:relative;min-height:0}
.puzzle-panel{position:absolute;z-index:4;inset:0}
.instruction-panel{position:absolute;z-index:4;left:27%;right:4%;top:4%;padding:10px 12px 13px;text-align:center;pointer-events:none;background:#fff5e5ed;border:3px solid #ad7955;border-radius:18px;box-shadow:0 7px 0 #70452e66,0 12px 28px #5131252e}
.instruction-panel>span{display:inline-block;color:#70422f;background:#f2d4aa;border:1px solid #b47b52;border-radius:15px;padding:5px 18px;font-size:16px;font-weight:800;margin-bottom:9px}
#instruction-steps{display:flex;justify-content:center;align-items:center;flex-wrap:wrap;gap:7px;min-height:76px}
.instruction-step{position:relative;width:72px;height:72px;display:grid;place-items:center;padding:0;border:3px solid #985f3e;border-radius:12px;background:#fffdf7;color:#633724;box-shadow:0 4px 0 #7541277d}
.instruction-step b{position:absolute;left:5px;top:4px;font-size:13px;color:#a76542}.instruction-step i{font-style:normal;font-size:60px;font-weight:700;line-height:1}
#instruction-steps em{font-style:normal;color:#9b6847;font-size:30px;font-weight:800}
.instruction-wait{padding:10px 17px;border-radius:12px;background:#fff8e8ed;color:#89624c;font-size:13px}
.scene-stage{container-type:inline-size}
.answer-row{position:absolute;z-index:3;left:20%;right:20%;top:36%;bottom:12%;display:grid;grid-template-columns:repeat(3,1fr);align-items:stretch;gap:24px}
.answer-row.timeout::before{content:'X  시간 끝!';position:absolute;z-index:8;left:50%;top:42%;transform:translate(-50%,-50%);padding:8px 17px;border-radius:14px;background:#fff8e9e8;color:#c34c45;font:900 30px/1.1 sans-serif;text-shadow:0 2px white;box-shadow:0 5px 15px #4c2a2340}
.answer-box{position:relative;height:100%;min-width:0;border:0;background:transparent;padding:0 4px 7px;display:flex;align-items:center;justify-content:center;flex-direction:column;isolation:isolate;touch-action:manipulation}
.answer-box::after{content:'';position:absolute;inset:22% 2% 0;z-index:-1;border-radius:9px;background:linear-gradient(#efd2a5,#d5a06a);border:3px solid #9c683f;box-shadow:inset 0 0 0 7px #f8e5c3,0 5px 0 #71472e}
.answer-box canvas{width:15cqw;height:auto;max-width:96%;aspect-ratio:1;object-fit:contain;filter:drop-shadow(0 5px 3px #57331d45);transition:transform .15s}
.answer-box:hover canvas,.answer-box:focus-visible canvas{transform:scale(1.06)}
.answer-box:focus-visible{outline:3px solid #3f7f86;outline-offset:2px;border-radius:12px}
.answer-number{position:absolute;left:11px;top:24%;display:grid;place-items:center;width:31px;height:31px;border-radius:50%;background:#86533b;color:#fff8e9;font-size:16px;font-weight:800;z-index:2}
.answer-caption{font-size:13px;font-weight:800;color:#744832;z-index:2;margin-top:-13px}
.answer-row.answered .answer-box:not(.selected):not(.correct){opacity:.53}
.answer-row.revealing .answer-box:not(.chosen){opacity:.58}.answer-box.chosen::after{border-color:#397780;box-shadow:inset 0 0 0 7px #e1f0e8,0 5px 0 #285d63}.answer-box.chosen canvas{transform:scale(1.06)}
.instruction-step.active{border-color:#397780;background:#e8f5ef;box-shadow:0 4px 0 #285d63,0 0 0 4px #d6eee4}.instruction-step.done{border-color:#4b8461;background:#dcebdd;opacity:.72}
.answer-box.correct::before,.answer-box.wrong::before{position:absolute;z-index:6;left:50%;top:42%;transform:translate(-50%,-50%);font:900 72px/1 sans-serif;text-shadow:0 3px #fff8e9,-2px 0 #fff8e9,2px 0 #fff8e9}
.answer-box.correct::before{content:'O';color:#438655}.answer-box.wrong::before{content:'X';color:#c34c45}
.answer-box.selected.correct{animation:box-fly .62s ease-in forwards}
.answer-box.selected.wrong{animation:box-drop .62s ease-in forwards}
.answer-box.selected.wrong::after{box-shadow:inset 0 0 0 7px #f8e5c3,0 12px 0 10px #2b211d}
.scene-feedback{left:auto;right:5%;top:25%;z-index:5;font-size:31px}
.bakery-label{left:4%;top:62%;max-width:23%}
@keyframes box-fly{60%{transform:translateY(-24px) rotate(-3deg)}to{transform:translateY(-620px) rotate(8deg) scale(.72);opacity:.35}}
@keyframes box-drop{30%{transform:translateY(8px) rotate(2deg)}to{transform:translateY(310px) rotate(-13deg) scale(.55);opacity:.15}}

@media (orientation:landscape){
 .play-surface{display:block;overflow:hidden;background:#f4e5d0}
 .scene-wrap{height:100%;width:100%;overflow:hidden}
 .hud{grid-template-columns:.9fr .72fr 1.05fr .68fr .62fr 32px 105px}
 .question-hud strong{font-size:20px}
 .puzzle-panel{inset:0}
 .instruction-panel{left:27%;right:3%;top:3%}
 .answer-row{left:19%;right:19%;top:35%;bottom:11%;height:auto;gap:clamp(12px,2.4vw,28px)}
 .answer-box canvas{width:15cqw;max-width:96%}
 .answer-box::after{inset:20% 1% 0}
 .answer-caption{font-size:10px}
 .bakery-label{top:61%}
}
@media (orientation:landscape) and (max-height:430px){
 .puzzle-panel{inset:0}
 .instruction-panel{left:27%;right:2%;top:2%;padding:4px 6px 6px;border-width:2px;border-radius:10px;box-shadow:0 4px 0 #70452e66}
 .instruction-panel>span{font-size:11px;padding:2px 12px;margin-bottom:4px}
 #instruction-steps{gap:3px;min-height:42px}
 .instruction-step{width:48px;height:48px;padding:0;border-width:2px;border-radius:7px}
 .instruction-step i{font-size:42px}.instruction-step b{left:3px;top:2px;font-size:9px}
 #instruction-steps em{display:none}
 .answer-row{left:18%;right:18%;top:34%;bottom:8%;height:auto;gap:10px}.answer-box canvas{width:15cqw;max-width:94%}
 .answer-number{width:24px;height:24px;font-size:12px;left:6px}
 .answer-box.correct::before,.answer-box.wrong::before{font-size:52px}
 .scene-feedback{font-size:22px}
}

/* iPhone Safari viewport fallback when element fullscreen is unavailable. */
.ios-fullscreen-fallback,.ios-fullscreen-fallback body{width:100%;height:100%;overflow:hidden;overscroll-behavior:none}
.ios-fullscreen-fallback body{position:fixed;inset:0}
.ios-fullscreen-fallback .bakery-app{height:100dvh;min-height:0}

/* If iOS rotation is locked, rotate the app itself into a landscape canvas. */
@media (orientation:portrait){
 .ios-fullscreen-fallback .bakery-app{position:fixed;top:0;left:100vw;width:100dvh;height:100dvw;max-width:none;margin:0;padding:max(6px,env(safe-area-inset-left)) max(8px,env(safe-area-inset-top)) max(8px,env(safe-area-inset-right)) max(8px,env(safe-area-inset-bottom));display:flex;flex-direction:column;gap:0;transform:rotate(90deg);transform-origin:top left}
 .ios-fullscreen-fallback .bakery-app.game-started .page-header{display:none}
 .ios-fullscreen-fallback .game-shell,.ios-fullscreen-fallback .game-shell.choosing-player{flex:1;min-height:0;display:grid;grid-template-rows:48px minmax(0,1fr);border-radius:12px;box-shadow:none}
 .ios-fullscreen-fallback .hud{height:auto;min-height:0;grid-template-columns:.85fr .8fr 1.15fr .7fr .6fr 32px 106px;grid-template-rows:1fr;padding:3px 10px;gap:8px}
 .ios-fullscreen-fallback .hud .packing-status{grid-column:auto;grid-row:auto}
 .ios-fullscreen-fallback .hud .pause-button{position:static;grid-column:auto;grid-row:auto}
 .ios-fullscreen-fallback .hud .header-tools{grid-column:auto;grid-row:auto;display:flex}
 .ios-fullscreen-fallback .hud .header-tools #sound-button,.ios-fullscreen-fallback .hud .header-tools #help-button{display:grid}
 .ios-fullscreen-fallback .play-surface{display:block;min-height:0;overflow:hidden;background:#f4e5d0}
 .ios-fullscreen-fallback .scene-wrap{height:100%;width:100%;min-height:0;aspect-ratio:auto;align-content:center;overflow:hidden}
 .ios-fullscreen-fallback .scene-stage{height:auto}
 .ios-fullscreen-fallback .instruction-panel{left:27%;right:2%;top:2%;padding:4px 6px 6px;border-width:2px;border-radius:10px;box-shadow:0 4px 0 #70452e66}
 .ios-fullscreen-fallback .instruction-panel>span{font-size:11px;padding:2px 12px;margin-bottom:4px}
 .ios-fullscreen-fallback #instruction-steps{gap:3px;min-height:42px}
 .ios-fullscreen-fallback .instruction-step{width:48px;height:48px;padding:0;border-width:2px;border-radius:7px}
 .ios-fullscreen-fallback .instruction-step i{font-size:42px}.ios-fullscreen-fallback .instruction-step b{left:3px;top:2px;font-size:9px}
 .ios-fullscreen-fallback #instruction-steps em{display:none}
 .ios-fullscreen-fallback .answer-row{left:18%;right:18%;top:34%;bottom:8%;height:auto;gap:10px}
 .ios-fullscreen-fallback .answer-box canvas{width:15cqw;max-width:94%}
 .ios-fullscreen-fallback .answer-number{width:24px;height:24px;font-size:12px;left:6px}
 .ios-fullscreen-fallback .answer-box.correct::before,.ios-fullscreen-fallback .answer-box.wrong::before{font-size:52px}
 .ios-fullscreen-fallback .scene-feedback{font-size:22px}
}

/* Family, difficulty, and start button must all fit a short landscape phone. */
@media (max-height:470px){
 .character-select{padding:10px 16px 12px}
 .character-select h2{font-size:21px;margin:0 0 7px}
 .family-options{gap:6px;margin-bottom:9px}
 .family-option-card{min-height:54px;padding:3px 8px;gap:7px}
 .family-option-card canvas{width:44px;height:44px}
 .family-option-card strong{font-size:15px}
 .family-option-name{gap:1px}.family-option-name small{font-size:9px}
 .difficulty-options{margin-bottom:9px}.difficulty-title{font-size:10px;margin-bottom:4px}
 .difficulty-row{gap:6px}.difficulty-card{min-height:38px;padding:3px 2px;gap:0}
 .difficulty-card strong{font-size:13px}.difficulty-card small{font-size:8px}
 .character-select .primary-button{min-height:38px;font-size:13px;padding:6px 10px}
 .character-select .start-note{font-size:9px;margin-top:6px}
}
@media (orientation:portrait) and (max-width:470px){
 .ios-fullscreen-fallback .character-select{padding:10px 16px 12px}
 .ios-fullscreen-fallback .character-select h2{font-size:21px;margin:0 0 7px}
 .ios-fullscreen-fallback .family-options{gap:6px;margin-bottom:9px}
 .ios-fullscreen-fallback .family-option-card{min-height:54px;padding:3px 8px;gap:7px}
 .ios-fullscreen-fallback .family-option-card canvas{width:44px;height:44px}
 .ios-fullscreen-fallback .family-option-card strong{font-size:15px}
 .ios-fullscreen-fallback .family-option-name{gap:1px}.ios-fullscreen-fallback .family-option-name small{font-size:9px}
 .ios-fullscreen-fallback .difficulty-options{margin-bottom:9px}
 .ios-fullscreen-fallback .difficulty-title{font-size:10px;margin-bottom:4px}
 .ios-fullscreen-fallback .difficulty-row{gap:6px}
 .ios-fullscreen-fallback .difficulty-card{min-height:38px;padding:3px 2px;gap:0}
 .ios-fullscreen-fallback .difficulty-card strong{font-size:13px}
 .ios-fullscreen-fallback .difficulty-card small{font-size:8px}
 .ios-fullscreen-fallback .character-select .primary-button{min-height:38px;font-size:13px;padding:6px 10px}
 .ios-fullscreen-fallback .character-select .start-note{font-size:9px;margin-top:6px}
}
