/* Touch layouts keep the central habitat clear and respect device safe areas. */
#zoo{height:100dvh;min-height:0}html,body{overscroll-behavior:none}button{min-height:44px}.view-menu,.profile-toggle{display:none}.selected-card{overscroll-behavior:contain}#collection-panel{overscroll-behavior:contain;-webkit-overflow-scrolling:touch}.panel-head{position:sticky;top:0;background:#faf7ef;z-index:1;padding-bottom:10px}.animal-button{min-height:72px}.animal-button strong{font-size:17px}.animal-button small{font-size:14px}.panel-head button{width:44px;height:44px}.need-row label,.need-row span{font-size:13px}
@media(max-width:1100px),(pointer:coarse){
 .topbar{top:calc(12px + env(safe-area-inset-top));left:calc(14px + env(safe-area-inset-left));right:calc(14px + env(safe-area-inset-right));align-items:flex-start}.ambient-label{display:none}.brand{font-size:25px}.view-menu{display:block;pointer-events:auto;border:1px solid #fff9;border-radius:24px;background:#faf7edef;padding:10px 17px;min-height:44px;font-size:14px;color:#343b30}.tools{display:none!important;position:absolute;right:0;top:52px;grid-template-columns:repeat(5,44px);gap:5px;padding:9px;background:#faf7eff5;border:1px solid #fff;border-radius:18px;box-shadow:0 6px 24px #343b3025;z-index:6}.topbar.tools-open .tools{display:grid!important}.tools .icon-button{width:44px;height:44px}.tools svg{width:20px}.tools .ambient-label{display:none}.habitat-switch{top:62px;left:50%;max-width:100%;padding:3px}.connected-world .habitat-button{font-size:14px;min-height:44px;padding:10px 16px}.area-count{font-size:11px}
 .garden-play-button{top:calc(130px + env(safe-area-inset-top));left:14px;transform:none;font-size:13px;padding:10px 16px;min-height:44px}.world-actions{top:calc(130px + env(safe-area-inset-top));left:auto;right:14px;transform:none;gap:7px}.world-actions button{font-size:13px;padding:9px 13px;min-height:44px}.social-note{top:calc(182px + env(safe-area-inset-top));max-width:90%;width:max-content;font-size:12px;padding:5px 10px}
 footer{left:calc(14px + env(safe-area-inset-left));right:calc(14px + env(safe-area-inset-right));bottom:calc(12px + env(safe-area-inset-bottom));gap:8px}.hint,.collection-button{font-size:13px;min-height:46px;padding:10px 14px}.hint-secondary{display:none}.hint{max-width:48%;line-height:1.35}.count{font-size:12px}.collection-button{gap:7px}.care-bar{left:auto;right:14px;bottom:calc(72px + env(safe-area-inset-bottom));min-width:355px}.care-actions button{font-size:14px;min-height:48px}.care-status{font-size:12px}
 .selected-card:has(#needs-panel){left:14px;bottom:calc(76px + env(safe-area-inset-bottom));width:300px;max-width:300px;max-height:calc(100dvh - 300px);padding:14px}.intro{left:18px;bottom:calc(145px + env(safe-area-inset-bottom));max-width:285px}.intro h1{font-size:27px}.intro p{font-size:14px}.selected-card:has(#needs-panel) p{font-size:13px}.selected-card:has(#needs-panel) h2{font-size:27px}.selected-card:has(#needs-panel) .eyebrow{font-size:10px}
 #collection-panel{top:calc(76px + env(safe-area-inset-top));bottom:calc(72px + env(safe-area-inset-bottom));right:14px;width:390px;padding:18px;max-width:calc(100% - 28px)}
}
@media(max-width:700px){
 .brand{font-size:24px;max-width:170px}.brand-icon{font-size:27px}.edition{font-size:8px}.connected-world .habitat-button{font-size:13px;padding:9px 11px}.habitat-switch{width:100%;justify-content:space-between}.garden-play-button{top:calc(120px + env(safe-area-inset-top));font-size:12px;padding:9px 10px;max-width:36%}.world-actions{top:calc(120px + env(safe-area-inset-top));right:14px;width:calc(64% - 35px);display:grid;grid-template-columns:1fr 1fr;gap:5px}.world-actions button{font-size:12px;white-space:normal;padding:5px 7px;line-height:1.25}.social-note{top:calc(171px + env(safe-area-inset-top));max-width:calc(100% - 28px);font-size:12px}
 .care-bar{bottom:calc(69px + env(safe-area-inset-bottom));left:14px;right:14px;min-width:0}.care-actions button{font-size:13px;padding:8px 5px;gap:5px}.care-status{display:none!important}.hint{font-size:11px;padding:8px 10px}.collection-button{font-size:12px;padding:10px 12px}.hint svg{display:none}.intro{bottom:calc(140px + env(safe-area-inset-bottom));max-width:75%}.intro h1{font-size:25px;margin:8px 0}.intro p,.intro .eyebrow{display:none}
 .selected-card:has(#needs-panel),.in-garden .selected-card:has(#needs-panel){bottom:calc(132px + env(safe-area-inset-bottom));left:14px;right:14px;width:auto;max-width:none;padding:10px 14px;max-height:min(42dvh,350px)}.selected-card:has(#needs-panel) h2{font-size:23px;margin:2px 0 4px;padding-right:100px}.selected-card #selected-description,.selected-card #pet{display:none!important}.selected-card #needs-panel{margin:0}.selected-card .need-state{font-size:12px;margin:0}.selected-card:not(.profile-expanded) .need-row,.selected-card:not(.profile-expanded) .jelly-personality{display:none}.profile-toggle{display:block;position:absolute;top:12px;right:10px;min-height:44px;border:1px solid #d6ddcb;background:#e9eedf;border-radius:15px;font-size:12px;padding:9px 10px;color:#343b30}.selected-card.profile-expanded .jelly-personality{margin-top:8px}.selected-card.profile-expanded .need-row{line-height:1.7}.selected-card .jelly-personality p{font-size:13px}.selected-card:has(#needs-panel) .eyebrow{font-size:9px}
 #collection-panel{top:calc(70px + env(safe-area-inset-top));bottom:calc(68px + env(safe-area-inset-bottom));border-radius:21px}.panel-head h2{font-size:26px}.panel-copy{font-size:14px;margin:8px 0 14px}
}
@media(max-height:520px) and (orientation:landscape){
 .topbar{top:calc(8px + env(safe-area-inset-top));left:14px;right:14px}.brand{font-size:20px;padding:8px 10px}.edition{font-size:7px}.view-menu{padding:8px 13px}.habitat-switch{top:0;left:50%;width:auto;max-width:50%;}.connected-world .habitat-button{padding:8px 9px;font-size:12px}.garden-play-button{top:64px;left:14px;font-size:12px}.world-actions{top:64px;right:14px;width:auto;display:flex}.world-actions button{font-size:12px}.social-note{top:113px;left:14px;transform:none;max-width:210px;width:auto;font-size:11px;text-align:left}.intro,.hint{display:none}.care-bar{left:auto;right:14px;bottom:calc(64px + env(safe-area-inset-bottom));min-width:310px;width:auto}.care-status{display:none!important}footer{justify-content:flex-end}.selected-card:has(#needs-panel),.in-garden .selected-card:has(#needs-panel){display:block;left:14px;right:auto;bottom:calc(12px + env(safe-area-inset-bottom));width:260px;max-width:38%;max-height:calc(100dvh - 165px);padding:10px}.profile-toggle{font-size:11px;right:7px;top:6px}.selected-card:has(#needs-panel) h2{font-size:22px;padding-right:90px}.selected-card .need-row label,.selected-card .need-row span{font-size:11px}.selected-card #selected-description,.selected-card #pet{display:none!important}.selected-card:not(.profile-expanded) .need-row,.selected-card:not(.profile-expanded) .jelly-personality{display:none}.selected-card:has(#needs-panel) .eyebrow{font-size:9px}.selected-card #needs-panel{margin:2px 0}.profile-toggle{display:block}#collection-panel{top:62px;bottom:12px;width:390px}#animals{grid-template-columns:repeat(3,1fr)}.animal-button{padding:8px;gap:5px}.animal-button strong{font-size:14px}.animal-button small{font-size:12px}.panel-copy{display:none}.panel-head h2{font-size:23px}
}
@media(max-height:520px) and (orientation:landscape){.profile-toggle{position:absolute}.selected-card .jelly-personality p{font-size:12px}.selected-card:has(#needs-panel) h2{padding-right:95px}}
/* Ball controls share a compact, keyboard-accessible sheet on all devices. */
#ball-panel{position:absolute;z-index:8;right:24px;top:90px;bottom:85px;width:350px;max-width:calc(100% - 28px);overflow:auto;overscroll-behavior:contain;padding:20px;background:#faf8f0f7;border:1px solid white;border-radius:24px;box-shadow:0 12px 50px #34432a30;color:#343b30}#ball-panel .ball-panel-head{display:flex;align-items:center;justify-content:space-between;gap:12px}#ball-panel h2{font:28px Georgia,serif;margin:6px 0 17px}#ball-panel label{display:block;font-size:14px;margin:14px 0 7px}#ball-panel label output{float:right;font-size:13px;color:#596c4c}#ball-panel select{width:100%;min-height:44px;padding:10px;font:14px Arial;color:#343b30;background:#fffdf6;border:1px solid #c9d3bd;border-radius:12px}#ball-panel input[type=range]{width:100%;min-height:36px;accent-color:#67864f;touch-action:pan-y}.ball-panel-actions{display:grid;grid-template-columns:1fr 1fr;gap:8px;margin-top:17px}.ball-panel-actions button,.favorite-trip{border:1px solid #c9d3bd;border-radius:14px;background:#e9eedf;color:#343b30;padding:10px 8px;font-size:13px;min-height:44px}#ball-message{font-size:13px;line-height:1.55;margin:14px 0 0}.favorite-trip{display:block;margin-top:10px;width:100%;font-size:12px}.care-bar{min-width:420px}.care-actions button{padding:9px 10px}.care-status.feedback{font-weight:600}
@media(max-width:1100px),(pointer:coarse){.tools{grid-template-columns:repeat(3,44px)}#ball-panel{right:14px;top:calc(70px + env(safe-area-inset-top));bottom:calc(70px + env(safe-area-inset-bottom));padding:17px}.care-bar{min-width:390px}}
@media(max-width:700px){.care-bar{min-width:0}.care-actions button{padding:9px 4px;font-size:12px}.care-actions button span{display:none}.selected-card:not(.profile-expanded) .favorite-trip{display:none}.care-status.feedback{display:block!important;position:fixed;top:calc(205px + env(safe-area-inset-top));left:14px;right:14px;bottom:auto;margin:0;padding:9px 12px;background:#4d6543f0;border-radius:16px;color:#fff9e9;text-shadow:none;font-size:12px;max-width:none;pointer-events:none;z-index:9}#ball-panel{width:350px}.favorite-trip{font-size:12px}}
@media(max-height:520px) and (orientation:landscape){.care-bar{min-width:360px}.selected-card:not(.profile-expanded) .favorite-trip{display:none}.care-status.feedback{display:none!important}#ball-panel{top:14px;bottom:14px;width:360px}}
.topbar.tools-open{z-index:10}
.throw-note{position:absolute;top:236px;left:50%;transform:translateX(-50%);z-index:4;margin:0;padding:9px 16px;border-radius:18px;background:#4d6543f0;color:#fff9e9;font-size:14px;pointer-events:none;text-align:center;max-width:90%}@media(max-width:1100px){.throw-note{top:calc(212px + env(safe-area-inset-top));width:max-content;max-width:calc(100% - 28px);font-size:12px}}@media(max-height:520px) and (orientation:landscape){.throw-note{top:125px;left:50%;max-width:46%}}

.summon-link{margin-left:auto;margin-right:20px;border:1px solid #83957666;border-radius:20px;padding:9px 16px;font-size:13px;text-decoration:none;background:#faf8f0dd;white-space:nowrap;min-height:44px;display:flex;align-items:center;justify-content:center;color:#414e38}.garden-legal{position:absolute;left:28px;bottom:13px;z-index:3;display:flex;gap:14px;font:9px Arial;color:#414e38}.garden-legal a{padding:5px 0}.night .garden-legal{color:#fff5df}@media(max-width:1100px){.summon-link{margin-right:12px;padding:8px 11px;font-size:12px}.garden-legal{bottom:calc(7px + env(safe-area-inset-bottom));left:16px;font-size:8px;gap:10px}.garden-legal a{padding:8px 0}}@media(max-width:700px){.topbar{gap:8px}.summon-link{margin-right:0;font-size:11px;padding:8px 10px}.garden-legal{left:auto;right:16px;bottom:calc(62px + env(safe-area-inset-bottom));gap:9px;background:#faf8f0d9;border-radius:12px;padding:0 8px}.night .garden-legal{background:#373342dd}}
.selected-card:has(#needs-panel){max-height:calc(100dvh - 240px);overflow-y:auto;scrollbar-width:thin;scrollbar-color:#a4b58f #f8f3e8}@media(max-width:700px){.selected-card:not(.profile-expanded){max-height:95px;overflow:hidden}.selected-card.profile-expanded{max-height:calc(100dvh - 290px)}}
