/* v1.13: self-contained toy games, including room and modal hosts. */
.toy-game{--game-ink:#3e654f;--game-green:#66966d;color:var(--game-ink);padding:14px;background:#fffdf4;border:1px solid #dde4cc;border-radius:20px;max-width:680px;margin:auto;box-sizing:border-box}
.toy-game *,.toy-game-board *{box-sizing:border-box}
.toy-game-heading{display:flex;gap:12px;justify-content:space-between;align-items:center;flex-wrap:wrap}
.toy-game-heading strong{font-size:17px;line-height:1.5;letter-spacing:.03em}
.toy-game-progress{padding:5px 10px;border-radius:20px;background:#e9f1dc;font-size:13px;font-weight:800;font-variant-numeric:tabular-nums;white-space:nowrap}
.toy-game-instruction{font-size:13px;line-height:1.8;margin:8px 0 10px;color:#5d745b}
.toy-game-board{position:relative;isolation:isolate;width:100%;height:268px;overflow:hidden;border-radius:20px;background:linear-gradient(#e8f4ed 0%,#f1f7e4 77%,#e2edcc 77%);border:1px solid #d6e4cd;color:#41654f}
.toy-game-board:before{content:"";position:absolute;width:240px;height:70px;border-radius:50%;background:#ffffff45;top:-30px;right:10%;pointer-events:none}
.toy-game-buddy{position:absolute;left:0;bottom:17px;width:28%;height:152px;z-index:2;display:flex;justify-content:center;align-items:flex-end;transform-origin:50% 95%;pointer-events:none}
.toy-game-buddy>.dressed-pet{max-width:100%;height:auto;filter:drop-shadow(0 9px 2px #72946715)}
.toy-game-buddy>.dressed-pet svg{max-width:100%;height:auto}
.toy-game-prop{position:absolute;right:-10px;bottom:0;width:58px;height:64px;object-fit:contain;filter:drop-shadow(0 4px 2px #63825520)}
.toy-game-field{position:absolute;left:27%;right:4%;top:12px;bottom:20px;z-index:3}
.toy-game-actions{display:flex;gap:8px;align-items:stretch;justify-content:center;flex-wrap:wrap;margin:12px 0 5px}
.toy-game button,.toy-game-board button{font-family:inherit;color:#426348;font-size:15px;line-height:1.4;font-weight:700;cursor:pointer;touch-action:manipulation;-webkit-user-select:none;user-select:none;min-height:46px;border:1px solid #c5d6b5;border-radius:14px;padding:9px 16px;background:#fffdf5;box-shadow:0 3px 0 #d5dec7;transition:background .12s,box-shadow .12s}
.toy-game button:focus-visible,.toy-game-board button:focus-visible{outline:3px solid #558aac;outline-offset:3px}
.toy-game button:active,.toy-game-board button:active{box-shadow:0 1px 0 #c5d2b5;background:#f0f5df}
.toy-game button:disabled,.toy-game-board button:disabled{cursor:default;opacity:.65}
.toy-game button small{display:block;font-size:10px;font-weight:500;margin-top:3px}
.toy-game-actions .toy-game-main,[data-game-start]{min-width:155px;background:#668b5b;color:#fffdf4;border-color:#668b5b;box-shadow:0 4px 0 #4b7049;font-size:16px}
.toy-game-toolbar{display:flex;gap:7px;justify-content:center;align-items:center;flex-wrap:wrap;margin-top:10px}
.toy-game .toy-game-sub{font-size:12px;min-height:40px;padding:7px 12px;background:#fffdf5;color:#637159;border-color:#d8dfcb;box-shadow:0 2px 0 #e0e6d5}
.toy-game .toy-game-sub[aria-pressed=true]{background:#e2efd4;border-color:#8fab79;color:#355d3c}
.toy-game [hidden]{display:none!important}
.toy-game-feedback{margin:8px 0 0;padding:8px 10px;text-align:center;font-size:13px;line-height:1.7;min-height:38px;background:#f1f5e5;border-radius:12px;color:#51704c}
.toy-game-key-help{display:block;text-align:center;margin-top:9px;font-size:10px;line-height:1.5;color:#798369}
.toy-game.is-complete .toy-game-feedback{background:#faf0bd;color:#70632f}
.toy-game.is-complete .toy-game-progress{background:#f1dda0}
.toy-game-confetti{position:absolute;left:20%;top:20px;right:10%;font-size:30px;letter-spacing:20px;color:#deb757;text-align:center;opacity:0;pointer-events:none;z-index:4}
.toy-game-board.is-celebrating .toy-game-confetti{opacity:1;animation:toy-game-spark .75s ease-out both}
.toy-game-board.is-celebrating .toy-game-buddy{animation:toy-game-hop .7s ease-out both}
.toy-game-target{font-size:13px;text-align:center;line-height:1.7;padding:5px 9px;border-radius:12px;background:#fffdf0ed;margin:0 0 6px}
.toy-game-target b{display:inline-block;margin-left:4px;font-size:16px}
.toy-game-rally{position:absolute;inset:20% 0 11%;background:linear-gradient(transparent 77%,#d6e4bc 78%,transparent 80%);border-radius:20px}
.toy-game-catch{position:absolute;left:54%;right:8%;top:20%;height:72%;border:3px dashed #77a864;border-radius:50%;background:#add28c30;display:flex;align-items:flex-start;justify-content:center;padding-top:8px;font-size:12px;font-weight:800;color:#5d8752}
.toy-game-ball{position:absolute;left:12%;top:40%;width:52px;height:52px;transform:translateX(-50%);will-change:left}
.toy-game-ball img{width:100%;height:100%;object-fit:contain;filter:drop-shadow(0 9px 4px #6b875729)}
.game-ball .toy-game-prop{display:none}
.toy-game-bubbles{position:relative;height:160px;display:flex;gap:8px;align-items:center;justify-content:space-around}
.toy-game-board .toy-game-bubble{width:72px;height:72px;min-height:72px;padding:0;border-radius:50%;border:2px solid #bfd7d7;background:radial-gradient(circle at 30% 23%,#fff 0%,#fffff0bf 19%,#cbddf377 52%,#eeced996 88%,#f8fcff 100%);box-shadow:inset 4px 5px 7px #fff9,0 5px 12px #66898417;font-size:29px;color:#789bb0;text-shadow:0 1px #fff;animation:toy-game-float 3.5s ease-in-out infinite}
.toy-game-bubble.bubble-1{align-self:flex-start;margin-top:12px;animation-delay:-1.3s;color:#b87c91}
.toy-game-bubble.bubble-2{animation-delay:-2.2s;color:#bdac62}
.toy-game-sky{position:absolute;inset:8px 0 2px}
.toy-game-cloud{position:absolute;top:10%;width:94px;height:88px;transform:translateX(-50%);border:3px dashed #8daf92;background:#ffffffb8;border-radius:45%;text-align:center;overflow:hidden}
.toy-game-cloud span{font-weight:800;font-size:13px;position:absolute;left:0;right:0;top:9px;z-index:2}
.toy-game-cloud i{position:absolute;bottom:0;left:0;height:8px;background:#78ac75;border-radius:4px}
.toy-game-kite{position:absolute;left:50%;top:17%;width:77px;height:144px;object-fit:contain;transform:translateX(-50%);filter:drop-shadow(0 7px 4px #6c855617)}
.game-kite .toy-game-prop{display:none}
.toy-game-music{position:absolute;inset:15% 0 10%;border-radius:20px;background:#fffbedce;border:1px solid #e1ddbe;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:15px;padding:12px 5px;text-align:center}
.toy-game-music>b{font-size:15px;color:#886c4c}
.toy-game-music>small{font-size:11px;color:#83785e}
.toy-game-score-notes{display:flex;gap:7px;align-items:center;justify-content:center;flex-wrap:wrap}
.toy-game-score-notes>span{display:flex;align-items:center;justify-content:center;width:41px;height:46px;border-radius:12px;background:#e9ecd7;border:2px solid transparent;font-size:14px;font-weight:700}
.toy-game-score-notes>.is-current{border-color:#b79650;background:#f5dfa0;transform:translateY(-4px)}
.toy-game-score-notes>.is-played{background:#d5e7ca;color:#4b7c4e}
.toy-game-actions .toy-game-drum{min-width:92px;border-radius:50%;height:65px;background:#edc7b0;color:#865c4e;box-shadow:0 5px 0 #be947f;border:4px solid #f9e5cf}
.toy-game-actions .toy-game-drum.pad-1{background:#f4e5bb;color:#8b764b;box-shadow:0 5px 0 #bfad7a}
.toy-game-actions .is-sounding{outline:3px solid #b9a060;background:#fae9b7;box-shadow:0 0 0 6px #e5c87540}
.toy-game-actions .toy-game-note{min-width:44px;height:66px;padding:7px 11px;border-radius:9px;box-shadow:0 5px 0 #b5b98d;border:1px solid #fff8;font-size:17px;color:#53654b}
.toy-game-note.note-0{background:#e7b9ad}.toy-game-note.note-1{background:#ead39c}.toy-game-note.note-2{background:#c6d8a1}.toy-game-note.note-3{background:#a8d2cd}.toy-game-note.note-4{background:#c5c4df}
.toy-game-wheel-area{position:relative;width:190px;height:174px;margin:auto}
.toy-game-wheel{position:absolute;left:50%;top:50%;width:105px;height:118px;transform:translate(-50%,-50%)}
.toy-game-wheel img{width:100%;height:100%;object-fit:contain}
.toy-game-wheel>span{position:absolute;left:50%;top:45%;width:90px;height:90px;line-height:10px;text-align:center;transform:translate(-50%,-50%) rotate(var(--wheel-turn));transform-origin:center;color:#745634;font-size:21px;text-shadow:0 1px 3px white;transition:transform .35s}
.toy-game-wheel-label{position:absolute;font-size:11px;font-weight:800;background:#fff9;padding:3px 5px;border-radius:8px}
.toy-game-wheel-label:nth-child(1){top:0;left:50%;transform:translateX(-50%)}
.toy-game-wheel-label:nth-child(2){right:0;top:45%}.toy-game-wheel-label:nth-child(3){bottom:0;left:50%;transform:translateX(-50%)}.toy-game-wheel-label:nth-child(4){left:0;top:45%}
.wheel-color-0{color:#b57164}.wheel-color-1{color:#a8862f}.wheel-color-2{color:#558ea8}.wheel-color-3{color:#6a935c}
.toy-game-story{padding:6px 0}.toy-game-story>p{font-size:13px;line-height:1.7;background:#fff9;padding:9px;border-radius:12px;margin:0 0 10px;min-height:60px}
.toy-game-story-cards{display:flex;gap:7px;justify-content:center}
.toy-game-story-cards button{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:3px;flex:1;min-width:0;padding:8px 4px;font-size:11px;background:#fffcef;min-height:78px}
.toy-game-story-cards button>span{font-size:29px;line-height:1.25}
.toy-game-pages{font-size:17px;letter-spacing:2px;text-align:center;padding:7px 0;white-space:nowrap}
.toy-game-jump{position:absolute;inset:0;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:14px}
.toy-game-jump-star{font-size:57px;line-height:1;color:#e3b957;filter:drop-shadow(0 4px 0 #fff4)}
.toy-game-power{height:31px;width:95%;position:relative;border-radius:18px;background:#fcf9e7;border:2px solid #c5d2ad;overflow:hidden}
.toy-game-power>i{position:absolute;top:0;bottom:0;background:#94bf73a6;border-left:2px dashed #639654;border-right:2px dashed #639654;z-index:2}
.toy-game-power>span{position:absolute;left:0;top:0;bottom:0;background:#e5b867;width:0}
.toy-game-jump p{margin:0;font-size:11px;line-height:1.6;text-align:center;background:#fff9;border-radius:8px;padding:4px 7px}
.game-trampoline .toy-game-prop{right:0;bottom:-15px;width:100%;height:52px;z-index:-1}
.game-trampoline.is-charging .toy-game-buddy{transform:scaleY(.88) translateY(8px)}
.toy-game-charge{touch-action:none!important}
.toy-game-plants{display:flex;gap:5px;align-items:stretch;justify-content:center;margin-top:10px}
.toy-game-plants button{display:flex;flex-direction:column;align-items:center;justify-content:center;flex:1;min-width:0;background:#fff9;padding:5px 2px;border:2px solid transparent;border-radius:15px;box-shadow:none}
.toy-game-plants button.is-selected{border-color:#87aa70;background:#fbfff0;box-shadow:0 0 0 3px #a9cc8c30}
.toy-game-plants button.is-bloomed{background:#f9f4d6}
.toy-game-flower{font-size:43px;line-height:1.5}.toy-game-plants b{font-size:10px;white-space:nowrap}.toy-game-plants small{font-size:12px;margin-top:7px;letter-spacing:-2px;white-space:nowrap}
.game-telescope{background:linear-gradient(#4e6078,#748696 77%,#96a393 77%);border-color:#708891;color:#fff4d4}
.game-telescope .toy-game-field{left:26%;right:5%;top:6px;bottom:13px}
.toy-game-stars{position:absolute;inset:0}.toy-game-stars svg{position:absolute;inset:0;width:100%;height:100%;overflow:visible;pointer-events:none}
.toy-game-board .toy-game-star{position:absolute;width:46px;height:46px;min-height:46px;padding:0;border:0;background:transparent;box-shadow:none;transform:translate(-50%,-50%);color:#f4e2a4}
.toy-game-board .toy-game-star:not(:disabled):active{transform:translate(-50%,-50%) scale(.97)}
.toy-game-star>span{font-size:41px;line-height:1;text-shadow:0 0 15px #ffffec65}.toy-game-star>b{position:absolute;inset:0;display:flex;align-items:center;justify-content:center;font-size:12px;line-height:1;color:#6a664c}
.toy-game-star.is-found{filter:drop-shadow(0 0 7px #ffec8d);color:#ffe693}.toy-game-star.is-found:after{content:"✓";position:absolute;right:-4px;top:-1px;font-size:12px;color:white;background:#719575;border-radius:50%;width:17px;height:17px}
.room-toy-game-controls .toy-game{max-width:none;border-radius:0;border:0;border-bottom:1px solid #dce5d1;padding:13px 15px;background:#fafbef}
.habitat.room-play-active.room-toy-game-active{height:330px;min-height:330px}
.room-toy-game-scene{position:absolute;inset:58px 8px 9px;z-index:4}
.room-toy-game-scene .toy-game-board{height:100%;border:none;background:#edf4df35}
.room-toy-game-scene .game-telescope{background:linear-gradient(#4e6078e6,#748696e6 77%,#96a393c9 77%)}
.room-toy-game-scene .toy-game-buddy{height:175px;left:1%;width:29%;bottom:12px}
.room-toy-game-scene .toy-game-buddy>.dressed-pet{width:180px!important}
.room-toy-game-active .pet-tag,.room-toy-game-active .habitat-weather{pointer-events:none}
.room-toy-game-controls .toy-game-instruction{margin-bottom:7px}.room-toy-game-controls .toy-game-actions{margin-top:7px}
.toy-game-board.is-paused *{animation-play-state:paused!important}
@keyframes toy-game-hop{0%,100%{transform:translateY(0)}45%{transform:translateY(-19px) rotate(-3deg)}65%{transform:translateY(-12px) rotate(2deg)}}
@keyframes toy-game-spark{0%{transform:translateY(9px) scale(.8);opacity:.1}45%{opacity:1}100%{transform:translateY(-8px) scale(1.06);opacity:.85}}
@keyframes toy-game-float{0%,100%{transform:translateY(0)}50%{transform:translateY(-8px)}}
@media(max-width:540px){
 .toy-game{padding:11px}.toy-game-board{height:250px}.toy-game-field{left:26%;right:3%;top:10px;bottom:17px}.toy-game-buddy{width:28%;height:120px;bottom:24px}.toy-game-prop{width:45px;height:56px;right:-7px}.toy-game-heading strong{font-size:15px}.toy-game-heading{gap:5px}.toy-game-progress{font-size:12px;padding:4px 8px}.toy-game-instruction{font-size:12px}.toy-game-actions{gap:6px}.toy-game button,.toy-game-board button{font-size:13px;padding:9px 12px}.toy-game-actions .toy-game-main{font-size:15px}.toy-game-feedback{font-size:12px;padding:7px 8px}.toy-game-toolbar{gap:6px}.toy-game-target{font-size:11px;padding:5px 4px}.toy-game-target b{font-size:14px}.toy-game-board .toy-game-bubble{width:54px;height:54px;min-height:54px;font-size:23px}.toy-game-bubbles{gap:2px;height:145px}.toy-game-cloud{width:73px;height:82px}.toy-game-kite{width:60px;height:130px}.toy-game-music{gap:12px}.toy-game-score-notes{gap:4px}.toy-game-score-notes>span{width:32px;height:41px;font-size:12px}.toy-game-music>small{font-size:10px}.toy-game-wheel-area{width:170px;height:165px}.toy-game-story>p{font-size:11px;padding:7px;min-height:65px}.toy-game-story-cards{gap:4px}.toy-game-story-cards button{font-size:10px;padding:7px 2px;min-height:72px}.toy-game-story-cards button>span{font-size:25px}.toy-game-pages{font-size:14px;letter-spacing:0}.toy-game-plants{gap:3px}.toy-game-plants button{padding:5px 1px}.toy-game-flower{font-size:34px}.toy-game-plants b{font-size:9px}.toy-game-plants small{font-size:10px;letter-spacing:-2px}.toy-game-actions .toy-game-note{min-width:38px;padding:7px 9px;height:58px}.toy-game-actions .toy-game-sub{padding:6px 9px}.toy-game-confetti{font-size:24px;letter-spacing:13px}.toy-game-catch{font-size:10px}.toy-game-ball{width:45px;height:45px}.toy-game-board .toy-game-star{width:44px;height:44px;min-height:44px}.toy-game-star>span{font-size:37px}.room-toy-game-controls .toy-game{padding:10px}.habitat.room-play-active.room-toy-game-active{height:300px;min-height:300px}.room-toy-game-scene{inset:49px 4px 7px}.room-toy-game-scene .toy-game-buddy{height:145px;bottom:15px}.room-toy-game-scene .toy-game-buddy>.dressed-pet{width:145px!important}
}
@media(max-width:365px){.toy-game-heading strong{font-size:14px}.toy-game-field{left:24%;right:2%}.toy-game-board .toy-game-bubble{width:47px;height:47px;min-height:47px;font-size:21px}.toy-game-buddy{width:25%}.toy-game-actions .toy-game-note{min-width:34px;padding:7px}.toy-game-key-help{font-size:9px}.toy-game-wheel-area{width:153px}.toy-game-score-notes>span{width:28px}.toy-game-plants b{font-size:8px}.toy-game-target{font-size:10px}.toy-game-target b{font-size:12px}.toy-game-story>p{font-size:10px}}
@media(prefers-reduced-motion:reduce){.toy-game-board *, .toy-game button{animation:none!important;transition:none!important}.toy-game-confetti{transform:none!important}.toy-game-board.is-celebrating .toy-game-confetti{opacity:1}.toy-game-score-notes>.is-current{transform:none}}
