/* One launcher leaves room for the creature; the drawer stays inside that scene. */
#legacy-home-actions{display:none!important}.action-launcher{display:flex;justify-content:center;padding:10px;background:#123d61}#actions-open{min-height:56px;min-width:210px;padding:9px 22px;border:3px solid white;border-radius:18px;background:#ffcf24;color:#123d61;font-size:21px;font-weight:bold}#actions-open:disabled{opacity:.5}.shell{max-width:1100px}.home-rooms-active{aspect-ratio:1000/720!important}.home-action-drawer{position:absolute;inset:0;z-index:20;display:flex;flex-direction:column;padding:12px;background:#103b5af5;color:white;animation:drawer-rise .2s ease-out}.drawer-header{display:flex;align-items:center;gap:9px;min-height:54px;margin-bottom:10px}.drawer-header h2{color:#fff;flex:1;margin:0;font-size:clamp(17px,3vw,28px);line-height:1.2}.drawer-header button{width:52px;min-width:52px;height:52px;min-height:52px;padding:0;border:3px solid white;border-radius:14px;font-size:30px;line-height:1;background:#ffcf24;color:#123d61}#drawer-close{background:#db283c;color:white}#drawer-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px;overflow-y:auto;min-height:0;align-content:start;padding:3px 3px 12px;overscroll-behavior:contain}#drawer-grid button{display:flex;flex-direction:column;justify-content:center;align-items:center;gap:8px;min-height:120px;padding:12px 4px;border:3px solid white;border-radius:19px;background:#ffcf24;color:#123d61;font-size:18px;font-weight:bold;line-height:1.15}#drawer-grid button:nth-child(3n+2){background:#3cdaef}#drawer-grid button:nth-child(3n){background:#a787ff}#drawer-grid button span:first-child{font-size:44px}#drawer-grid button:focus-visible,.drawer-header button:focus-visible{outline:4px solid #ffcf24;outline-offset:1px}body.reduced .home-action-drawer{animation:none}@keyframes drawer-rise{from{transform:translateY(100%)}}@media(prefers-reduced-motion:reduce){.home-action-drawer{animation:none}}@media(max-width:600px){.home-action-drawer{padding:8px}.drawer-header{gap:6px;margin-bottom:6px;min-height:48px}.drawer-header button{width:46px;min-width:46px;height:46px;min-height:46px}#drawer-grid{gap:7px}#drawer-grid button{min-height:91px;padding:7px 3px;font-size:13px;gap:4px;border-radius:13px}#drawer-grid button span:first-child{font-size:32px}.home-rooms-active{aspect-ratio:1000/820!important}}
/* Finish and cancel live in a reserved header, never over a play target. */
#activity-dialog,#painting-dialog,#tumble-dialog{padding-top:78px!important}#activity-dialog h2,#painting-dialog h2,#tumble-dialog h2{padding:0!important;margin-top:0!important}#activity-dialog.playful-dialog #activity-finish,#activity-dialog #activity-finish,#painting-dialog #painting-finish,#tumble-dialog #tumble-finish{position:absolute!important;top:10px!important;left:12px!important;bottom:auto!important;right:auto!important;width:58px!important;height:58px!important;min-height:58px!important;margin:0!important;padding:0!important;border:3px solid white!important;border-radius:50%!important;background:#079e4e!important;color:white!important;font-size:0!important;line-height:1!important;box-shadow:0 2px 8px #123d6144;z-index:20}#activity-finish::after,#painting-finish::after,#tumble-finish::after{content:'✓';font-size:34px}dialog .dialog-close.dialog-close{top:10px;right:12px;width:52px;min-height:52px;height:52px;border-radius:14px;font-size:34px;line-height:40px;background:#d92735;color:white}#activity-close.dialog-close{top:10px!important;right:12px!important;width:58px!important;min-height:58px!important;height:58px!important;z-index:20!important}

/* Keep navigation visible while only the choices scroll. */
.drawer-header{flex-shrink:0}.drawer-header h2{min-width:0;overflow-wrap:anywhere}
#drawer-grid{flex:1;min-width:0;overflow-x:hidden}#drawer-grid button{min-width:0;overflow-wrap:anywhere}
/* Size the home scene to the available viewport rather than its width alone. */
html{width:100%;overflow-x:clip}.shell{width:100%;min-width:0}
.pet-heading{flex-wrap:wrap}.pet-heading>div:first-child{min-width:0;overflow-wrap:anywhere}
.needs{grid-template-columns:repeat(5,minmax(0,1fr))}.need{min-width:0}
.scene.home-rooms-active{aspect-ratio:auto!important;height:clamp(240px,calc(100dvh - 390px),700px)}
dialog{max-height:calc(100dvh - 20px);max-width:calc(100vw - 20px);overflow:auto;overflow-wrap:anywhere}
@media(max-width:600px){.brand{padding:8px 0}.brand a span{display:none}.pet-heading{padding:8px 2px}.pet-heading h1{font-size:clamp(22px,6vw,32px)}.pet-heading .eyebrow{display:none}.pet-heading .muted{margin:3px 0}.scene.home-rooms-active{height:clamp(220px,calc(100dvh - 330px),600px)}.below-note{margin:8px 0}footer{padding:8px 0}.need label{overflow-wrap:anywhere}}

/* The home card owns the viewport; the scene takes the remaining height. */
body[data-auth="yes"] .brand,body[data-auth="yes"] footer,#game>.pet-heading .eyebrow,#game>.pet-heading .muted,#home-view>.below-note{display:none}
body[data-auth="yes"] .shell{max-width:1100px;padding:6px 30px}
#game:not([hidden]):has(#home-view:not([hidden])){height:calc(100dvh - 12px);display:flex;flex-direction:column;min-height:0}
#game>.pet-heading{flex:none;padding:4px 2px 6px;gap:6px}
#game>.pet-heading h1{font-size:24px;line-height:1.1}
#home-view:not([hidden]){flex:1;min-height:0;display:flex;flex-direction:column}
#home-view>.game-card{flex:1;min-height:0;display:flex;flex-direction:column}
.game-card>.scene{flex:1;min-height:120px;height:auto!important;aspect-ratio:auto!important}
.game-card>*:not(.scene){flex-shrink:0}
.scene-top{height:30px;padding:0 12px;gap:8px}
.home-summary{display:flex;align-items:center;gap:14px;white-space:nowrap}
.scene-top #star-bank{display:inline-flex;align-items:center;gap:5px;margin:0;padding:0;font-size:14px;color:#ffcf24}
.home-room-toolbar{padding:4px 8px}.home-room-toolbar strong{display:none}
#home-room-nav button{min-height:42px;padding:2px;font-size:11px;flex-direction:row;gap:5px}
#home-room-nav button span:first-child{font-size:21px;margin:0}
.action-launcher{padding:4px}#actions-open{min-height:44px;padding:4px 20px;font-size:18px}
#home-room-actions{padding:4px 8px;gap:6px}#home-room-actions button{min-height:40px;padding:4px 8px}
.pet-message{padding:4px 8px}.pet-message p{margin:0;font-size:11px}
.needs{padding:7px 12px;gap:12px}.need label{min-height:22px}.need meter{margin-top:3px}
@media(max-width:600px){body[data-auth="yes"] .shell{padding:4px 15px}#game:not([hidden]):has(#home-view:not([hidden])){height:calc(100dvh - 8px)}#game>.pet-heading h1{font-size:20px}.scene-top{font-size:10px}.home-summary{gap:8px}#home-room-nav button{flex-direction:column;gap:0;min-height:44px;font-size:9px}.need label{gap:1px}.needs{padding:5px 8px;gap:6px}.need .need-icon{width:20px;height:20px}}

/* Preserve the room proportions while fitting below the compact controls. */
#home-view>.game-card{flex:none;width:min(100%,max(240px,calc((100dvh - 320px) * 1000 / 720)));align-self:center}
.game-card>.scene,.game-card>.scene.home-rooms-active{flex:none;width:100%;height:auto!important;min-height:0;aspect-ratio:1000/720!important}
@media(max-width:600px){#home-view>.game-card{width:min(100%,max(200px,calc((100dvh - 350px) * 1000 / 720)))}}
