/* All game controls share the pet scene, including scrollable menu panels. */
.scene-sr{position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%)}
.scene-shell{display:block;min-height:100dvh;padding:0}
.scene-shell .main{padding:0;max-width:none;margin:0;display:block}
.scene-shell .workspace{display:block;margin:0}
.scene-shell .stage-column{position:relative;top:auto;min-width:0}
.scene-shell .stage{height:100dvh;min-height:500px;border:0;border-radius:0;isolation:isolate}
.scene-shell .pet-canvas{inset:75px 0 0}
.scene-shell .scene-nav{position:absolute;z-index:12;top:16px;left:16px;right:150px;display:flex;flex-wrap:wrap;gap:6px;margin:0;padding:0}
.scene-shell .scene-nav button{width:auto;min-height:44px;display:flex;align-items:center;gap:7px;padding:10px 14px;border-radius:16px;background:#fffdf0ee;border:1px solid #fff9;box-shadow:0 3px 12px #153f3520;color:#234c3f;font-size:14px}
.scene-shell .scene-nav button[aria-current=page]{background:#214f41;color:#fff9df}
.scene-shell .scene-meta{position:absolute;z-index:12;top:16px;right:16px;display:flex;align-items:center;gap:8px}
.scene-shell .coin,.scene-shell .icon-button{background:#fffdf0ee}
.scene-shell .stage-header{top:82px;left:20px;z-index:6}
.scene-shell .stage-label{background:#fffdf0dc;padding:7px 12px;border-radius:14px}
.scene-shell .speech{bottom:175px;max-width:70%;z-index:5}
.scene-shell .scene-journal{position:absolute;z-index:8;right:18px;bottom:158px;display:flex;flex-direction:column;gap:7px}
.scene-shell .scene-journal button{display:flex;align-items:center;gap:6px;background:#fffdf0ef;min-height:44px;box-shadow:0 3px 12px #173e3520}
.scene-shell .stage-quick{position:absolute;z-index:8;bottom:111px;left:18px;right:auto;margin:0;padding:0;background:none;border:0;box-shadow:none;display:block;width:auto}
.scene-shell .stage-quick button{background:#fffdf0f5;min-height:44px}
.scene-shell .stage-tools{left:auto;right:18px;bottom:112px;z-index:8;display:flex;gap:7px}
.scene-shell .stage-tools button{background:#fffdf0ee;min-width:40px;min-height:40px}
.scene-shell .progress-card{position:absolute;z-index:8;left:18px;right:18px;bottom:16px;width:auto;margin:0;padding:12px 16px;background:#fffdf0ed;border:1px solid #fff9;border-radius:20px;box-shadow:0 4px 18px #1b42351a}
.scene-shell .condition-summary{margin-top:7px;font-size:12px}
.scene-shell .preview-flag{position:absolute;z-index:8;top:140px;left:20px}
.scene-shell .panel{position:absolute;z-index:20;top:76px;right:16px;bottom:112px;width:min(420px,calc(100% - 32px));overflow:auto;overscroll-behavior:contain;padding:12px;background:#fffdf3f7;border:1px solid #fff;border-radius:24px;box-shadow:0 12px 40px #173f3540;scrollbar-width:thin}
.scene-shell .panel[hidden]{display:none!important}
.scene-panel-close{position:sticky;top:0;z-index:3;width:100%;margin-bottom:10px;background:#e6eddf!important;min-height:44px}
.scene-shell .panel .panel-card{box-shadow:none}
.scene-shell button:focus-visible{outline:3px solid #d89b24;outline-offset:3px}
@media(max-width:690px){
 .scene-shell .scene-nav{top:12px;left:10px;right:10px;gap:5px;flex-wrap:nowrap}
 .scene-shell .scene-nav button{flex:1;justify-content:center;flex-direction:column;gap:2px;padding:7px 3px;font-size:11px;border-radius:14px;min-width:0}
 .scene-shell .scene-nav button svg{width:19px;height:19px}
 .scene-shell .scene-meta{top:83px;right:12px;gap:5px}
 .scene-shell .stage-header{top:83px;left:12px;gap:5px}
 .scene-shell .stage-label{padding:5px 8px;max-width:160px}
 .scene-shell .stage-label strong{font-size:15px}
 .scene-shell .stage-label small{font-size:10px}
 .scene-shell .pet-canvas{inset:125px 0 0}
 .scene-shell .speech{bottom:206px;font-size:12px}
 .scene-shell .scene-journal{right:12px;bottom:157px}
 .scene-shell .scene-journal button{font-size:12px;padding:8px 10px}
 .scene-shell .stage-quick{left:12px;bottom:109px}
 .scene-shell .stage-tools{right:12px;bottom:111px}
 .scene-shell .progress-card{left:10px;right:10px;bottom:10px;padding:12px}
 .scene-shell .panel{top:145px;right:10px;bottom:106px;width:calc(100% - 20px);padding:10px}
 .scene-shell .preview-flag{top:137px;left:12px;font-size:11px}
}
.scene-shell[data-page=memories] .stage-column{display:block}
.scene-shell[data-page=memories] .panel{display:block}
.scene-shell .speech{left:50%;transform:translateX(-50%)}
.scene-shell.is-embedded .scene-nav,.scene-shell.is-embedded .scene-meta{top:62px}
.scene-shell.is-embedded .stage-header{top:124px}
.scene-shell.is-embedded .panel{top:124px}
@media(max-width:690px){
 .scene-shell.is-embedded .scene-meta,.scene-shell.is-embedded .stage-header{top:132px}
 .scene-shell.is-embedded .pet-canvas{top:166px}
 .scene-shell.is-embedded .panel{top:192px}
 .scene-shell.is-embedded .preview-flag{top:182px}
}

/* Keep the companion visible beside the onboarding / menu panel. */
.scene-shell:has(.panel:not([hidden])) .pet-canvas{right:min(440px,46%)}
.scene-shell:has(.panel:not([hidden])) .speech{left:27%;max-width:42%}
.scene-shell.is-embedded .scene-journal{display:none}
.scene-shell.is-embedded .scene-nav,.scene-shell.is-embedded .scene-meta{top:16px}
.scene-shell.is-embedded .stage-header,.scene-shell.is-embedded .panel{top:82px}
@media(max-width:690px){
 .scene-shell:has(.panel:not([hidden])) .pet-canvas{right:0;bottom:45%;top:125px}
 .scene-shell:has(.panel:not([hidden])) .pet-scene,.scene-shell:has(.panel:not([hidden])) .stage province-background{bottom:45%}
 .scene-shell:has(.panel:not([hidden])) .speech{left:50%;bottom:49%;max-width:85%}
 .scene-shell .panel,.scene-shell.is-embedded .panel{top:55%;bottom:106px;border-radius:22px 22px 12px 12px}
 .scene-shell.is-embedded .scene-meta,.scene-shell.is-embedded .stage-header{top:83px}
 .scene-shell.is-embedded .pet-canvas{top:125px}
}
@media(prefers-reduced-motion:reduce){.stage-ambience{display:none}.scene-shell *{scroll-behavior:auto!important}}
