/* The build stays at the center; the toy box shows the next useful choices. */
#gameScreen{--toybox-height:266px;--play-inset:18px;background:#dceee4}
#gameScreen .build-progress{width:min(350px,calc(100vw - 180px));min-width:180px;grid-template-columns:20px auto 1fr;gap:7px 9px;padding:11px 17px;border:1px solid #ffffffd9;border-radius:23px;box-shadow:0 3px 0 #a5b1a55c,0 8px 20px #2e485518}
#gameScreen .active-build-title{grid-column:1/-1;display:flex;align-items:center;gap:10px;min-width:0}
#gameScreen #activeLessonNumber{flex-shrink:0;max-width:45px;font:900 10px/1.15 var(--kid-font);letter-spacing:.08em;color:#7d6044}
#gameScreen #activeLessonName{display:block;min-width:0;font:900 17px/1.14 var(--kid-font);letter-spacing:-.4px;color:#253b48}
#gameScreen .progress-star{height:20px;width:20px}
#gameScreen .build-progress-label{font-size:17px;letter-spacing:0}
#gameScreen .stability-track{grid-column:3;height:6px;background:#e6e6d6}
#gameScreen #stabilityFill{background:#839c6c}
#gameScreen .mission-panel,#gameScreen .mission-panel.collapsed{inset:111px auto auto var(--play-inset)!important;width:350px!important}
#gameScreen .puppy-portrait{width:65px;height:65px;flex-basis:65px;border-color:#e1bc72;box-shadow:0 3px 0 #b69a5f55}
#gameScreen .puppy-portrait img{width:71px;height:85px;bottom:-21px;left:-4px}
#gameScreen .puppy-bubble{min-height:62px;border:1px solid #ffffffd9;gap:10px;padding:9px 9px 9px 15px;box-shadow:0 3px 0 #a5b1a55c}
#gameScreen .mission-action strong{font-size:20px!important;line-height:1.17!important}
#gameScreen #voiceReplayBtn{width:46px;height:46px;min-width:46px;min-height:46px;flex-basis:46px}
#gameScreen .piece-tray,#gameScreen .piece-tray.collapsed{width:min(740px,calc(100% - 36px))!important;gap:8px;padding:12px 16px 14px!important;border-radius:25px!important;border-bottom-color:#c3cbb3!important;box-shadow:0 4px 0 #98aa8d,0 12px 28px #25413c20!important}
#gameScreen .build-stage{display:flex;align-items:center;justify-content:space-between;gap:12px;min-height:25px;padding-bottom:5px;border-bottom:1px solid #e6e7dc;color:#526b50;font:800 15px/1.15 var(--kid-font)}
#gameScreen #buildStageDots{display:flex;align-items:center;gap:6px;flex-shrink:0}
#gameScreen #buildStageDots span{display:grid;place-items:center;width:22px;height:22px;border:1px solid #d6ddcb;border-radius:50%;background:#f0f1e8;color:#859181;font-size:11px;font-weight:900}
#gameScreen #buildStageDots .current{background:#fff1c6;border-color:#d8b86b;color:#68501f;box-shadow:0 0 0 2px #f7e8c8}
#gameScreen #buildStageDots .done{background:#7b9768;border-color:#7b9768;color:white}
#gameScreen .toybox-heading{height:24px;min-height:24px}
#gameScreen .tray-title{font-size:21px!important;letter-spacing:-.4px}
#gameScreen .piece-list{justify-content:center;gap:10px!important;padding:2px 2px 5px!important}
#gameScreen .piece-card{flex:1 0 105px!important;min-width:105px!important;max-width:160px;width:105px!important;background:#f3f3e9;border-color:#d5dccb!important;box-shadow:0 3px 0 #c9d0bd!important;border-radius:18px!important}
#gameScreen .piece-card.available{background:#f0f5e9;border-color:#a4b899!important}
#gameScreen .piece-card.selected{background:#e5f2ec!important;border-color:#557f72!important;box-shadow:0 3px 0 #557f72,0 0 0 2px #bad9ca!important}
#gameScreen .piece-card.locked{opacity:.52!important;background:#f2f0e8!important;filter:saturate(.35)}
#gameScreen .piece-card[hidden],#gameScreen .play-button[hidden],#gameScreen [hidden].build-play-idea{display:none!important}
#gameScreen .piece-card-copy strong{font-size:14px!important;line-height:1.12!important}
#gameScreen .piece-card .piece-quantity{position:absolute;top:5px;left:6px;right:auto;display:grid!important;place-items:center;width:22px;height:22px;padding:0;border-radius:8px;background:#fffcf4;color:#627058;font:900 12px var(--kid-font);box-shadow:0 1px 1px #334b2920}
#gameScreen .piece-card.locked .piece-quantity{display:none!important}
#gameScreen .piece-preview{min-height:0;overflow:hidden}
#gameScreen .play-actions{grid-template-columns:minmax(0,400px) 64px 64px;gap:10px;height:56px;min-height:56px}
#gameScreen .place-assist,#gameScreen .test-button{height:56px;min-height:56px;font-size:23px;border-radius:17px}
#gameScreen .test-button:not(:disabled){background:#557440;color:#fff9e8;border-color:#789362;box-shadow:0 4px 0 #354b2c}
#gameScreen .undo-button,#gameScreen .hint-button,#gameScreen .replay-adventure{min-height:56px;border-radius:17px}
#gameScreen .piece-prompt{font-size:17px;background:#edf1e9;color:#65785e}
#gameScreen .replay-adventure{flex-direction:column;gap:2px;background:#edf3ec;color:#416252;border-color:#c1d3bd;box-shadow:0 3px 0 #a2b59a;padding:5px}
#gameScreen .replay-adventure svg{width:24px;height:24px}
#gameScreen .replay-adventure b{font:800 12px var(--kid-font)}
#gameScreen .build-play-idea{margin:0;color:#3f6453;text-align:center;font:900 20px/1.15 var(--kid-font)}
#gameScreen .show-finale .toybox-heading{display:none}
#gameScreen .show-finale .play-actions{grid-template-columns:minmax(0,1fr) 70px}
#gameScreen .show-finale:has(#replayAdventureBtn[hidden]) .play-actions{grid-template-columns:minmax(0,1fr)}
#gameScreen:has(.piece-tray.collapsed){--toybox-height:174px}
#gameScreen .play-button:focus-visible,#gameScreen .piece-card:focus-visible{outline:3px solid #264f70;outline-offset:4px}
@media(max-width:600px){
 #gameScreen{--toybox-height:248px;--play-inset:12px}
 #gameScreen .game-header{gap:8px;height:75px!important}
 #gameScreen .game-back,#gameScreen .build-help{width:46px;height:46px;min-width:46px;min-height:46px;padding:10px;border-radius:17px}
 #gameScreen .game-back svg,#gameScreen .build-help svg{width:25px;height:25px}
 #gameScreen .build-progress{width:calc(100% - 112px);min-width:0;gap:5px 6px;padding:9px 11px;border-radius:19px;grid-template-columns:17px auto 1fr}
 #gameScreen .active-build-title{gap:5px;min-height:32px}
 #gameScreen #activeLessonNumber{font-size:8px;max-width:29px}
 #gameScreen #activeLessonName{font-size:14px;line-height:1.1}
 #gameScreen .build-progress-label{font-size:14px}
 #gameScreen .progress-star{width:16px;height:16px}
 #gameScreen .mission-panel,#gameScreen .mission-panel.collapsed{inset:103px auto auto 12px!important;width:calc(100% - 24px)!important;max-width:none!important}
 #gameScreen .puppy-portrait{width:56px;height:56px;flex-basis:56px}
 #gameScreen .puppy-portrait img{width:63px;height:77px;bottom:-20px}
 #gameScreen .puppy-bubble{min-height:57px;padding:7px 8px 7px 14px}
 #gameScreen .mission-action strong{font-size:18px!important;line-height:1.16!important}
 #gameScreen #voiceReplayBtn{width:44px;height:44px;min-width:44px;min-height:44px;flex-basis:44px}
 #gameScreen .piece-tray,#gameScreen .piece-tray.collapsed{width:calc(100% - 20px)!important;inset:auto auto calc(10px + var(--play-safe)) 50%!important;padding:10px 11px 12px!important;border-radius:22px!important;gap:7px}
 #gameScreen .build-stage{font-size:13px;min-height:25px}
 #gameScreen .toybox-heading{min-height:21px;height:21px}
 #gameScreen .tray-title{font-size:19px!important}
 #gameScreen .piece-list{justify-content:flex-start;gap:8px!important}
 #gameScreen .piece-card{flex:1 0 92px!important;min-width:92px!important;width:92px!important;max-width:150px;padding:4px 4px 6px!important;border-radius:15px!important}
 #gameScreen .piece-card-copy strong{font-size:12px!important;letter-spacing:-.2px}
 #gameScreen .play-actions{grid-template-columns:minmax(0,1fr) 53px 53px;gap:8px;min-height:54px;height:54px}
 #gameScreen .place-assist,#gameScreen .test-button{font-size:21px;height:54px;min-height:54px;padding:8px}
 #gameScreen .undo-button,#gameScreen .hint-button,#gameScreen .replay-adventure{min-height:54px}
 #gameScreen .piece-prompt{font-size:14px;padding:7px}
 #gameScreen .build-play-idea{font-size:18px}
 #gameScreen:has(.piece-tray.collapsed){--toybox-height:167px}
}
@media(max-height:500px) and (orientation:landscape){
 #gameScreen .game-header{inset:10px 270px auto 10px!important;height:55px!important}
 #gameScreen .build-progress{left:50%;width:calc(100% - 116px);min-width:0;padding:7px 10px;border-radius:17px}
 #gameScreen .active-build-title{min-height:0}
 #gameScreen #activeLessonName{font-size:12px}
 #gameScreen #activeLessonNumber{font-size:8px}
 #gameScreen .game-back,#gameScreen .build-help{width:44px;height:44px;min-width:44px;min-height:44px;padding:9px}
 #gameScreen .mission-panel,#gameScreen .mission-panel.collapsed{inset:88px auto auto 10px!important;width:calc(100% - 282px)!important;max-width:330px!important}
 #gameScreen .mission-action strong{font-size:16px!important}
 #gameScreen .puppy-portrait{width:48px;height:48px;flex-basis:48px}
 #gameScreen .puppy-bubble{min-height:49px;padding:5px 6px 5px 12px}
 #gameScreen .piece-tray,#gameScreen .piece-tray.collapsed{inset:10px 10px 10px auto!important;transform:none!important;width:246px!important;height:calc(100% - 20px)!important;padding:12px!important;gap:10px}
 #gameScreen .build-stage{font-size:12px;min-height:28px}
 #gameScreen .piece-list{justify-content:flex-start}
 #gameScreen .piece-card{flex-basis:98px!important;min-width:98px!important;max-width:130px}
 #gameScreen .play-actions{grid-template-columns:minmax(0,1fr) 46px 46px;gap:6px}
 #gameScreen .place-assist,#gameScreen .test-button{font-size:17px}
 #gameScreen .place-assist svg{width:23px}
 #gameScreen .piece-prompt{font-size:12px}
 #gameScreen .piece-tray.collapsed{justify-content:center}
 #gameScreen .build-play-idea{font-size:18px}
 #gameScreen .toast{max-width:calc(100% - 295px)!important;left:10px!important;transform:none!important;bottom:12px!important;font-size:13px!important}
}
@media(prefers-reduced-motion:reduce){#gameScreen .stability-track i,#gameScreen .piece-card{transition:none!important;animation:none!important}}
