/* Local cake-making workbench. Shared viewport handles portrait rotation. */
.game-immersive .games-shell.bakery-game{background:#f6deca url('graphics/bakery-v1/background.webp') center/cover;color:#244d7b;font-family:FalaPiano,system-ui,sans-serif}
.bk-layout{height:100%;width:100%;display:grid;grid-template-rows:clamp(44px,calc(var(--th)*.12),76px) clamp(44px,calc(var(--th)*.115),76px) clamp(20px,calc(var(--th)*.06),40px) minmax(0,1fr) clamp(98px,calc(var(--th)*.245),176px);gap:4px;padding:max(6px,var(--safe-top)) max(8px,var(--safe-right)) max(8px,var(--safe-bottom)) max(8px,var(--safe-left));}
.bk-header{display:flex;align-items:center;gap:12px;min-width:0;background:linear-gradient(140deg,#d7efffef,#a8d7f3ed);border:1px solid #a3cde9;border-radius:20px;padding:3px 8px;box-shadow:0 4px 0 #91b9d24a;z-index:2}
.game-immersive .games-shell .bk-header h2{flex:1;min-width:0;text-align:center;font-size:clamp(18px,calc(var(--tw)*.029),36px);line-height:1.08;color:#214571;letter-spacing:-.5px}
.bk-header-actions{display:flex;gap:8px}.bk-icon{display:flex;align-items:center;justify-content:center;width:clamp(44px,calc(var(--th)*.09),62px);height:clamp(44px,calc(var(--th)*.09),62px);min-width:44px;min-height:44px;padding:7px;background:linear-gradient(145deg,#fff,#e6f3ff);border:1px solid #9ebedc;border-radius:15px;color:#286296;box-shadow:inset 0 2px 1px #fff,0 3px 0 #9bbad58c;flex:none}
.bk-icon .game-symbol{width:clamp(24px,calc(var(--th)*.055),34px);height:clamp(24px,calc(var(--th)*.055),34px)}.bk-icon[aria-pressed=false]{background:#dce2eb;color:#4d5c70}.bk-icon[aria-pressed=false]:after{content:'';position:absolute;width:26px;height:3px;transform:rotate(-45deg);background:currentColor;border:1px solid #dce2eb}
.bk-steps{display:flex;justify-content:center;align-items:stretch;gap:8px;width:min(80%,920px);margin:0 auto;min-width:0;z-index:1}.bk-steps button{display:flex;align-items:center;justify-content:center;gap:8px;flex:1;min-width:0;min-height:44px;border:2px solid #c2dcee;border-bottom:4px solid #afc7dc;border-radius:22px;background:linear-gradient(145deg,#fffffff5,#edf7fff5);color:#294f7b;font-weight:900;font-size:clamp(14px,calc(var(--tw)*.022),26px);line-height:1.1;padding:4px 10px}.bk-steps button[aria-pressed=true]{background:linear-gradient(145deg,#2c9be4,#2866b5);border-color:#83c5f2;border-bottom-color:#245794;color:#fff;box-shadow:0 0 0 2px #fff}.bk-step-number{display:grid;place-items:center;height:29px;width:29px;border-radius:50%;background:#d4e9f8;flex:none;color:#34638d;font-size:.8em}.bk-steps button[aria-pressed=true] .bk-step-number{background:#ffffff30;color:#fff}.bk-step-check{color:#2c7d40;font:900 22px system-ui}.bk-steps button[aria-pressed=true] .bk-step-check{color:#fff}.bk-steps button:disabled{opacity:.65}
.bk-instruction{justify-self:center;max-width:94%;align-self:center;min-width:0;padding:2px 17px;border-radius:30px;background:#ffffffd9;text-align:center;font-weight:800;font-size:clamp(12px,calc(var(--tw)*.019),23px);line-height:1.12;color:#244974;z-index:1}
.bk-workspace{position:relative;display:flex;align-items:center;justify-content:center;min-width:0;min-height:0}.bk-cake-stage{height:100%;width:min(74%,760px);min-width:0;min-height:0;border-radius:50%;transition:background-color .18s}.bk-cake-art{display:block;width:100%;height:100%;overflow:visible;filter:drop-shadow(0 7px 5px #895d3220)}.bk-drop-ready{background:#daeeff80;outline:3px dashed #448fc5;outline-offset:-8px}.bk-edit-tools{position:absolute;right:4%;bottom:10px;display:flex;flex-direction:column;align-items:center;gap:9px}.bk-clear{min-height:44px;min-width:62px;padding:5px 9px;border:1px solid #b8cde1;border-radius:13px;background:#ffffffec;color:#34587a;font:750 clamp(11px,calc(var(--tw)*.013),16px)/1.1 system-ui}.bk-decoration-count{background:#ffffffd9;border-radius:20px;padding:2px 9px;font:700 12px system-ui;color:#4b637a}
.bk-tray{display:flex;align-items:stretch;gap:12px;min-height:0;min-width:0;width:min(94%,1280px);justify-self:center;border:2px solid #c0deee;border-bottom:5px solid #93b9d6;border-radius:27px;padding:8px 10px 5px;background:linear-gradient(145deg,#e9f8fff5,#baddf3f0);box-shadow:inset 0 2px 2px #fff,0 7px 17px #946c4220;z-index:2}.bk-picker{min-width:0;flex:1;display:flex;flex-direction:column;gap:2px}.bk-options-wrap{display:flex;align-items:center;gap:7px;flex:1;min-height:0;min-width:0}.bk-options-wrap>.bk-icon{width:44px;height:44px;padding:7px;border-radius:13px}.bk-options{display:flex;gap:8px;align-items:stretch;flex:1;min-width:0;min-height:0;height:100%}.bk-option{position:relative;flex:1;min-width:0;min-height:44px;display:flex;flex-direction:column;align-items:center;justify-content:center;padding:3px 7px 5px;border:2px solid #b4cfe6;border-bottom:4px solid #aec3d9;border-radius:21px;background:linear-gradient(145deg,#fff,#eef6ff);color:#284b77;box-shadow:inset 0 2px 0 #fff;touch-action:none}.bk-option[aria-pressed=true]{border-color:#287fca;background:#f0faff;box-shadow:inset 0 0 0 2px #a5d8fa,0 0 0 2px #fff}.bk-option-art{display:block;min-height:0;flex:1;width:100%}.bk-option-art img,.bk-option-art svg{display:block;width:100%;height:100%;object-fit:contain;pointer-events:none}.bk-option strong{display:block;flex:none;width:100%;text-align:center;font-size:clamp(12px,calc(var(--tw)*.017),21px);line-height:1.05;overflow-wrap:break-word}.bk-choice-check{position:absolute;right:4px;top:4px;display:grid;place-items:center;width:20px;height:20px;background:#2e80bd;border:1px solid #fff;border-radius:50%;color:#fff;font:800 13px system-ui}.bk-page{font:700 clamp(10px,calc(var(--tw)*.011),13px)/1 system-ui;text-align:center;color:#486984;height:13px;margin:0}
.bk-main{display:flex;align-items:center;justify-content:center;gap:8px;padding:8px 14px;min-width:96px;min-height:44px;border:2px solid #76b5e4;border-bottom:5px solid #2b5f9b;border-radius:21px;background:linear-gradient(145deg,#3b9ee4,#2561ad);color:#fff;font-weight:900;font-size:clamp(16px,calc(var(--tw)*.023),30px);box-shadow:inset 0 2px 2px #ffffff60,0 3px 0 #ffffffb0}.bk-next{width:19%;max-width:230px;flex:none;align-self:center;height:82%}.bk-main .game-symbol{height:30px;width:30px}.bk-next>span:first-child:not(:last-child){font:900 36px system-ui}.bk-secondary{min-height:44px;padding:7px 15px;border:2px solid #b4cfe6;border-bottom:4px solid #a2bed5;border-radius:17px;background:#fff;color:#2d5b87;font-size:clamp(12px,calc(var(--tw)*.017),21px);font-weight:800;display:flex;align-items:center;justify-content:center;gap:6px}.bk-secondary .game-symbol{width:26px;height:26px}.bk-finished-actions{display:flex;align-items:center;justify-content:center;gap:14px;width:100%}.bk-recipe{position:absolute;right:1%;top:20%;width:24%;max-height:80%;overflow:auto;padding:12px;border:1px solid #d5bca6;border-radius:19px;background:#fff8eaf0;color:#5b493e;font:700 clamp(12px,calc(var(--tw)*.015),21px)/1.3 system-ui;touch-action:pan-y}.bakery-game[data-bk-finished=true] .bk-cake-stage{margin-right:15%}
.bk-drag-ghost{position:fixed;z-index:999;pointer-events:none;width:90px;height:80px;transform:translate(-50%,-70%);filter:drop-shadow(0 5px 5px #64422745)}.bk-drag-ghost img,.bk-drag-ghost svg{width:100%;height:100%;object-fit:contain}.game-turned .bk-drag-ghost{transform:translate(-50%,-50%) rotate(90deg)}
.bk-instruction{white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-height:100%;pointer-events:none}.bk-icon{position:relative}
.bakery-game button:focus-visible{outline:3px solid #154c83;outline-offset:2px}.bakery-game button:not(:disabled):active{filter:brightness(.95)}.bakery-game[data-bk-motion=false] *{animation:none!important;transition:none!important}.game-choice-art>.bk-cake-art{max-height:220px}
@media(max-height:450px),(max-width:450px){.bk-layout{gap:2px;padding:4px 6px 6px;grid-template-rows:44px 44px 21px minmax(0,1fr) 98px}.bk-header{border-radius:15px;padding:0 5px;gap:5px}.bk-header-actions{gap:5px}.bk-header .bk-icon{height:44px;width:44px;border-radius:12px}.bk-steps{width:78%;gap:5px}.bk-steps button{padding:3px 6px;border-radius:17px;gap:5px;font-size:14px}.bk-step-number{width:23px;height:23px}.bk-step-check{font-size:16px}.bk-instruction{font-size:12px;padding:2px 10px}.bk-tray{width:98%;gap:7px;padding:5px 6px 3px;border-radius:20px;border-bottom-width:3px}.bk-options-wrap{gap:5px}.bk-options{gap:5px}.bk-option{border-radius:14px;padding:2px 3px 4px;border-bottom-width:3px}.bk-option strong{font-size:12px}.bk-next{min-width:85px;padding:5px;gap:4px;font-size:17px;border-radius:16px}.bk-next .game-symbol{height:24px;width:24px}.bk-next>span:first-child:not(:last-child){font-size:25px}.bk-page{font-size:10px;height:12px}.bk-edit-tools{right:2%;bottom:3px;gap:4px}.bk-clear{min-width:58px;padding:3px;font-size:11px}.bk-decoration-count{font-size:10px}.bk-finished-actions{gap:7px}.bk-finished-actions .bk-main{font-size:17px;min-width:100px}.bk-secondary{font-size:12px;padding:5px 8px;gap:4px}.bk-recipe{padding:8px;font-size:11px;top:0;max-height:100%}.bk-choice-check{right:2px;top:2px;width:16px;height:16px;font-size:11px}}
@media(prefers-reduced-motion:reduce){.bakery-game *{animation:none!important;transition:none!important}}
.high-contrast .bk-instruction,.high-contrast .bk-option,.high-contrast .bk-secondary,.high-contrast .bk-clear,.high-contrast .bk-recipe{background:#fff;color:#152f4e;border:2px solid #152f4e}.high-contrast .bk-option[aria-pressed=true]{outline:3px solid #152f4e}.high-contrast .bk-page{color:#152f4e}.high-contrast .bk-main,.high-contrast .bk-steps button[aria-pressed=true]{background:#183c66;color:#fff;border-color:#183c66}
@media(forced-colors:active){.bakery-game button{border:2px solid ButtonText;forced-color-adjust:auto}.bk-option[aria-pressed=true],.bk-steps button[aria-pressed=true]{outline:3px solid Highlight}}

/* Match the shared tactile game controls and calm blue workbench. */
.game-immersive .games-shell.bakery-game{background:radial-gradient(ellipse at 45% 35%,#fff,#eff6ff 85%)}
.bk-header{background:none;border:0;box-shadow:none;border-radius:0;padding:0 4px}
.bk-icon{border:1px solid #c7dcf6;border-radius:18px;background:linear-gradient(145deg,#fff,#eff6ff);color:#3566a8;box-shadow:0 4px 0 #cbdcf1,0 7px 18px #3566a81c}
.bk-workspace{margin:2px 12px;border:1px solid #cfdef0;border-radius:28px;background:radial-gradient(ellipse at 50% 35%,#fff,#e9f3ff);box-shadow:inset 0 1px 3px #fff,0 6px 14px #365d8720}
.bk-tray{background:linear-gradient(145deg,#e9f2ff,#dceafa);border-color:#c5d9f0;border-bottom-color:#b9d0e9}
.bk-cover{min-height:44px;width:120px;max-width:18vw;padding:7px;border:1px solid #b4cfe6;border-bottom:3px solid #aec3d9;border-radius:14px;background:#fff;color:#345f90;font:750 14px/1.1 system-ui}
.bk-cover[aria-pressed=true]{background:#3566a8;border-color:#28568d;color:white}
.bk-edit-tools{right:2%;top:8px;bottom:auto;max-height:100%;gap:6px;flex-wrap:wrap}
@media(max-height:450px),(max-width:450px){.bk-cover{width:102px;max-width:none;font-size:11px;padding:4px}.bk-edit-tools{top:3px;gap:3px;flex-direction:row;width:156px;justify-content:flex-end}.bk-decoration-count{display:none}.bk-workspace{margin:0 5px}.bk-cake-stage{margin-right:12%}}

.bakery-game[data-bk-step="2"][data-bk-finished="false"] [data-bk-decoration]{cursor:grab;pointer-events:all;touch-action:none}.bakery-game [data-bk-decoration]:active{cursor:grabbing}

.bk-coating{position:absolute;left:12px;top:10px;bottom:10px;width:18%;display:grid;grid-template-rows:repeat(2,minmax(0,1fr));gap:8px;z-index:3}
.bk-coating button{position:relative;display:flex;flex-direction:column;align-items:center;min-height:44px;padding:3px 5px 7px;border:2px solid #c2d7ed;border-bottom:4px solid #adc7e1;border-radius:20px;background:linear-gradient(145deg,#fff,#edf5ff);color:#294f7b}
.bk-coating button[aria-pressed=true]{border-color:#367ebe;background:#deefff;box-shadow:0 0 0 2px #fff}
.bk-coating-art{min-height:0;flex:1;width:100%}.bk-coating-art svg{height:100%;width:100%;filter:none}.bk-coating strong{font-size:clamp(11px,1.5vw,18px);line-height:1.1}.bk-coating-check{position:absolute;right:7px;top:3px;color:#245f9c;font:900 20px system-ui}
.bk-cake-stage{width:70%;margin-left:6%}.bk-workspace{background:radial-gradient(ellipse at 50% 40%,#fffdfa,#edf4ff)}
@media(max-height:450px),(max-width:450px){.bk-coating{left:5px;top:3px;bottom:3px;width:140px;grid-template-columns:1fr 1fr;grid-template-rows:1fr;gap:4px}.bk-coating button{padding:2px 2px 6px;border-radius:12px}.bk-coating strong{font-size:11px}.bk-edit-tools{width:90px}.bk-cake-stage{margin-left:8%;margin-right:0}.bk-coating-check{font-size:14px;right:3px}}

.bk-shapes{position:absolute;left:10px;top:8px;bottom:8px;width:21%;display:grid;grid-template-columns:1fr 1fr;grid-template-rows:1fr 1fr;gap:6px;z-index:3}.bk-shapes button{min-height:44px;min-width:0;display:flex;flex-direction:column;align-items:center;padding:5px;border:2px solid #bfd5ea;border-bottom:4px solid #adc6df;border-radius:16px;background:#f7fbff;color:#2d537e}.bk-shapes img{min-height:0;flex:1;object-fit:contain;width:100%}.bk-shapes strong{font-size:clamp(10px,1.2vw,15px);line-height:1.1}.bk-shapes button[aria-pressed=true]{border-color:#347dc1;background:#dfedff}
.bk-surfaces{display:flex;gap:5px}.bk-surfaces button{display:flex;flex-direction:column;align-items:center;width:70px;min-height:55px;background:#fff;border:2px solid #c2d7ec;border-radius:12px;color:#31577f;font:700 11px system-ui;padding:3px}.bk-surfaces svg{height:34px;width:45px}.bk-surfaces button[aria-pressed=true]{background:#dfedff;border-color:#347dc1}
@media(max-height:450px),(max-width:450px){.bk-shapes{width:135px;left:4px;gap:3px}.bk-shapes button{padding:2px;border-radius:10px}.bk-shapes strong{font-size:10px}.bk-edit-tools{width:95px;gap:3px}.bk-surfaces{gap:3px}.bk-surfaces button{width:44px;min-height:44px;font-size:9px;padding:1px}.bk-surfaces svg{height:25px;width:35px}.bk-edit-tools .bk-icon{width:44px;height:44px}.bk-clear{min-width:44px;width:44px;font-size:10px}.bk-coating{width:128px}.bk-coating strong{font-size:10px}}

/* Pictorial tier choice stays reachable even in the rotated phone viewport. */
.bk-tiers{position:absolute;right:10px;top:12px;display:flex;gap:5px;width:23%;z-index:3}.bk-tiers button{flex:1;min-width:44px;min-height:70px;border:2px solid #bfd5ea;border-bottom:4px solid #adc6df;border-radius:15px;padding:4px;background:#f7fbff;color:#2d537e}.bk-tiers svg{display:block;width:100%;height:65px}.bk-tiers strong{display:block;font:800 12px system-ui}.bk-tiers button[aria-pressed=true]{border-color:#347dc1;background:#dfedff}
@media(max-height:450px),(max-width:450px){.bk-tiers{right:4px;top:4px;width:150px;gap:3px}.bk-tiers button{padding:2px;border-radius:10px;min-height:62px}.bk-tiers svg{height:40px}.bk-tiers strong{font-size:10px}}

/* Candy-shop palette; shared game navigation remains in the same positions. */
.game-immersive .games-shell.bakery-game{background:radial-gradient(ellipse at 50% 10%,#fff8dc,#fff0f7 68%,#e6f8ff);color:#70458e}
.game-immersive .games-shell .bk-header h2{color:#87458e;text-shadow:0 2px #fff}
.bk-workspace{overflow:hidden;border:3px solid #fff;background:radial-gradient(circle at 50% 42%,#fffbe8 0,#fff1cb 44%,#ffe3d8 100%);box-shadow:0 5px 0 #e9c5dd,inset 0 0 0 2px #ffd0b5}
.bk-workspace:before{content:'';position:absolute;inset:0 0 auto;height:22px;background:repeating-linear-gradient(110deg,#fb86b4 0 28px,#fff7de 28px 56px,#6adbd4 56px 84px,#fff7de 84px 112px);border-bottom:3px solid #fff;opacity:.8;pointer-events:none}
.bk-workspace:after{content:'';position:absolute;inset:28px 24% 5px;pointer-events:none;background:radial-gradient(circle at 10% 25%,#ffbdd7 0 5px,transparent 6px),radial-gradient(circle at 88% 15%,#c1b0f4 0 6px,transparent 7px),radial-gradient(circle at 92% 65%,#7ddfd7 0 4px,transparent 5px),radial-gradient(circle at 6% 70%,#ffce5d 0 6px,transparent 7px);z-index:0}
.bk-cake-stage{position:relative;z-index:1}.bk-cake-art{filter:drop-shadow(0 5px 2px #8d5e8220)}
.bk-tray{background:linear-gradient(#e6fffc,#b8ebe9);border-color:#8bd8dc;border-bottom-color:#69bdcb;box-shadow:inset 0 2px #fff,0 6px 13px #9e75a520}
.bk-option{border-color:#e0b6dc;border-bottom-color:#c996c7;background:linear-gradient(#fff,#fff0fa)}
.bk-option[aria-pressed=true]{background:#fff3c9;border-color:#eda638;box-shadow:0 0 0 2px #fff}
.bk-main,.bk-steps button[aria-pressed=true]{background:linear-gradient(#ff85b6,#e94f95);border-color:#ffb2d1;border-bottom-color:#ba3d7e;color:white}
.bk-steps button{background:#fffaf0;border-color:#ecd1e4;border-bottom-color:#d3add3;color:#80548d}.bk-step-number{background:#f5def0;color:#80548d}
.bk-instruction{color:#795188;background:#ffffffc9}.bk-edit-tools{z-index:4}
.bk-shape-art{display:block;flex:1;min-height:0;width:100%}.bk-shape-art svg{width:100%;height:100%;filter:none}
.bk-shapes,.bk-coating{top:27px}.bk-tiers{top:28px}.bk-tiers~.bk-edit-tools{top:auto;bottom:10px}
.bk-finishes{position:absolute;right:10px;top:28px;display:flex;gap:5px;width:23%;z-index:4}.bk-finishes button{display:flex;flex-direction:column;align-items:center;flex:1;min-width:44px;min-height:75px;padding:3px;border:2px solid #d9b4df;border-bottom:4px solid #bd91c9;border-radius:14px;background:#fff8fe;color:#795188}.bk-finishes button[aria-pressed=true]{background:#fff2c7;border-color:#e7a83f}.bk-finishes span{display:block;width:100%;height:64px}.bk-finishes svg{width:100%;height:100%;filter:none}.bk-finishes strong{font-size:11px}.bakery-game[data-bk-step="1"] .bk-edit-tools{top:auto;bottom:10px}
.bakery-game [data-bk-decoration]>*{pointer-events:none}
@media(max-height:450px),(max-width:450px){.bk-workspace:before{height:9px}.bk-shapes,.bk-coating{top:12px;bottom:3px}.bk-tiers,.bk-finishes{top:12px;right:4px;width:150px;gap:3px}.bk-finishes button{min-height:44px;padding:1px;border-radius:9px}.bk-finishes span{height:28px}.bk-finishes strong{font-size:9px}.bakery-game[data-bk-step="1"] .bk-edit-tools{bottom:3px}.bk-tiers~.bk-edit-tools{bottom:3px}.bk-shapes strong{font-size:9px}}
.high-contrast .bk-finishes button,.high-contrast .bk-tiers button{background:white;color:#152f4e;border-color:#152f4e}
