/* Full bleed, single menu and consistent parchment UI. */
html body #game-root{padding:0!important}
html body #game-root #stage{border:0!important;border-radius:0!important;box-shadow:none!important;overflow:hidden!important;background:#ead5b6!important}
#stage #hud{display:none!important}
html body #stage #cb-header{background:transparent!important;border:0!important;box-shadow:none!important;pointer-events:none!important}
#stage #cb-header>*{pointer-events:auto}
html body #stage #cb-header #cb-yard-return{display:none!important}
#stage .rw-world:not([hidden]){inset:0!important;display:block!important;padding:0!important;background:transparent!important;overflow:hidden!important}
#stage .rw-world:not([hidden])>.rw-shell{position:absolute!important;inset:0!important;width:100%!important;height:100%!important;margin:0!important;padding:0!important;border:0!important;border-radius:0!important;outline:0!important;background:transparent!important;overflow:hidden!important;container-type:size;display:block!important;max-width:none!important;max-height:none!important}
#stage .rw-world>.rw-shell::before{display:none!important}
#stage .rw-world:not([hidden])>.rw-shell .rw-surface{position:absolute!important;left:50%!important;top:50%!important;transform:translate(-50%,-50%)!important;width:max(100cqw,calc(100cqh * 1.77777778))!important;height:auto!important;max-width:none!important;max-height:none!important;aspect-ratio:16/9!important;border:0!important;border-radius:0!important;outline:0!important;box-shadow:none!important}
#stage .rw-world:not([hidden])>.rw-head{position:absolute!important;top:12px!important;left:14px!important;right:100px!important;width:auto!important;max-width:none!important;display:block!important;z-index:4!important;padding:0!important;background:transparent!important;border:0!important;box-shadow:none!important;pointer-events:none!important}
#stage .rw-world>.rw-head>.rw-button:not([data-next-scene]),#stage .rw-atlas-menu:not([open])>summary{display:none!important}
/* Preserve the one explicit main-story affordance while secondary controls stay in the menu. */
#stage .rw-world>.rw-head>button[data-next-scene]{display:block!important;pointer-events:auto!important;max-width:min(62vw,440px);min-height:36px;margin-top:5px;white-space:normal;overflow-wrap:anywhere;}
#stage .rw-world .rw-brand{width:max-content;max-width:min(62vw,440px);padding:7px 12px;background:#fff4dbea;border-radius:10px;box-shadow:0 2px 10px #513a2026}
#stage .rw-world .rw-brand strong{color:#483927!important;font-size:clamp(16px,2vw,25px)}
#stage .rw-world .rw-fit-summary{font-size:12px;color:#695540!important;white-space:normal}
#stage .rw-world:not([hidden])>.rw-fit-rail{position:absolute!important;left:auto!important;right:12px!important;top:62px!important;bottom:auto!important;width:min(400px,calc(100% - 24px))!important;height:auto!important;max-height:calc(100% - 82px)!important;padding:8px!important;border:1px solid #bea170!important;border-radius:12px!important;background:#fff6e9f5!important;box-shadow:0 5px 22px #47321d38!important;overflow:auto!important;overscroll-behavior:contain!important;z-index:5!important}
#stage .rw-world>.rw-fit-rail[hidden],#stage .rw-atlas-mode>.rw-atlas-rail:has(.rw-atlas-menu:not([open])){display:none!important}
#stage .rw-world .rw-atlas-menu[open]{position:static!important;width:100%!important;height:auto!important;max-height:none!important;overflow:visible!important;background:transparent!important;border:0!important;box-shadow:none!important}
#stage .rw-world .rw-atlas-menu[open]>summary{display:list-item!important;position:sticky!important;top:0!important;background:#f3e5ca!important}
#stage .rw-world .rw-fit-rail:has(.rw-puzzle-controls){top:auto!important;bottom:12px!important;max-height:65%!important;right:12px!important;width:min(450px,calc(100% - 24px))!important}
#stage .rw-world .rw-floating-notice{position:absolute!important;top:var(--rw-notice-top,100px)!important;bottom:auto!important;left:50%!important;right:auto!important;transform:translateX(-50%);width:max-content;max-width:min(440px,calc(100% - 24px));z-index:6;margin:0!important;pointer-events:none;background:#fff6e9f5;color:#493e2b;border:1px solid #b99a61;border-radius:10px;padding:9px 14px;text-align:center;box-shadow:0 4px 18px #47321d38}
#stage .rw-reward-popup{position:absolute;top:100px;left:50%;transform:translateX(-50%);z-index:24;box-sizing:border-box;width:max-content;max-width:min(420px,calc(100% - 24px));padding:10px 20px;background:linear-gradient(155deg,#fff8e5,#f4e5c4);color:#49371d;border:1px solid #b99a61;border-radius:12px;box-shadow:0 5px 20px #47321d55;text-align:center;pointer-events:none;font-family:var(--cb-font-body);line-height:1.4;overflow-wrap:anywhere}
#stage .rw-reward-title{display:block;font:700 clamp(16px,2.1vw,22px)/1.3 var(--cb-font-display)}
#stage .rw-reward-amounts{font-size:clamp(14px,1.8vw,18px);font-weight:700;margin-top:4px;color:#61471e}
#stage:not(:has(#battle-ui.on)) #toasts{top:max(64px,calc(env(safe-area-inset-top,0px) + 48px));max-width:calc(100% - 24px);width:max-content}
#stage:not(:has(#battle-ui.on)) #toasts .toast{max-width:min(420px,calc(100vw - 24px));box-sizing:border-box;overflow-wrap:anywhere;font-size:clamp(14px,1.7vw,18px);font-weight:700}
#stage #battle-ui .battle-topbar,#stage #battle-ui .battle-tools,#stage #battle-ui .team-slot,#stage #battle-ui .move,#stage #battle-ui .cb-region-combat,#stage #battle-ui #ult-wrap{background:#f6e9cde8!important;border:0!important;box-shadow:0 2px 8px #4f351c24!important;border-radius:10px!important;color:#493e2b!important}
#stage #battle-ui .team-slot.active{outline:2px solid #b18b4d!important;outline-offset:-2px!important}
#stage #battle-ui .move-bar{background:transparent!important;border:0!important;box-shadow:none!important}
#stage #battle-ui .battle-tools .tiny-btn{background:transparent!important;border:0!important;box-shadow:none!important}
#stage #battle-ui .battle-tools #btn-auto.is-auto{background:#d9e4c7!important;border-radius:6px}
#stage #panel .cat-capture-card{box-sizing:border-box!important;width:min(720px,100%)!important;padding:clamp(12px,2vw,28px)!important;background:#fff7e6!important;color:#4c3e2b!important;border:1px solid #b89b66!important;border-radius:14px!important}
#stage #panel .cat-capture-card :is(.skill-reveal-card,.duo-unlock,.first-adventure-tip,.golden-paw-unlock,.first-capture-rewards,.collection-reward,.reunion-reward){box-sizing:border-box!important;width:100%!important;max-width:none!important;margin:8px 0!important;padding:12px 14px!important;background:#f5e9ce!important;border:1px solid #cdb685!important;border-radius:10px!important;color:#51422d!important;text-align:left!important;box-shadow:none!important}
#stage #panel .cat-capture-card :is(.skill-reveal-card,.duo-unlock,.golden-paw-unlock) :is(b,strong,span,small,p){color:inherit!important}
#stage #panel .cat-capture-card .btn-row{display:grid!important;grid-template-columns:repeat(auto-fit,minmax(min(145px,100%),1fr))!important;gap:8px!important;margin:14px 0 0!important;width:100%!important}
#stage #panel .cat-capture-card .btn-row>.btn{width:100%!important;min-width:0!important;min-height:44px!important;height:100%!important;margin:0!important;padding:9px 12px!important;white-space:normal!important;background:#eedbb4!important;color:#493e2b!important;border:1px solid #ae905d!important;border-radius:8px!important;box-shadow:none!important}
#stage #panel .cat-capture-card .btn-row>#cr-next{background:#d4b47a!important}
#stage .rb-wallet{display:flex;justify-content:flex-end;gap:8px;padding:5px 12px;background:#f5e8cd;border-bottom:1px solid #d3bd8e}
#stage .rb-wallet .rb-stat{display:flex;align-items:center;gap:8px;margin:0!important;padding:4px 10px!important;border:0!important;background:transparent!important;color:#493e2b!important}
@media(max-width:680px) and (orientation:portrait){#stage .rw-world>.rw-head{left:8px!important;top:8px!important;right:82px!important}#stage .rw-world .rw-brand{max-width:calc(100vw - 110px)}#stage .rw-world>.rw-fit-rail{right:8px!important;width:calc(100% - 16px)!important}#stage .rw-world .rw-fit-rail:has(.rw-puzzle-controls){max-height:48%!important}#stage #panel .cat-capture-card .btn-row{grid-template-columns:1fr!important}}

/* Actual stage bounds, not just the art inside a framed desktop stage. */
html body #game-root #stage{width:100%!important;height:100%!important;max-width:none!important;max-height:none!important}
#stage #intro .cb-title-landscape{background-size:cover!important;background-position:center!important}
#stage .rw-world .rw-fit-rail:not(:has(.rw-puzzle-controls)){scrollbar-width:thin}
#stage .rw-world .rw-fit-rail:has(.rw-puzzle-controls){scrollbar-width:thin}
#stage .rw-world .rw-brand{pointer-events:none}

#stage .rw-world .rw-brand{max-width:100%}
#stage .rw-world .rw-fit-summary{display:block!important;max-width:100%;overflow-wrap:normal;line-height:1.3}
#stage .rw-world .rw-fit-rail .rw-button,#stage .rw-world .rw-fit-rail .rw-system-nav button{min-height:44px!important;border-radius:8px!important}
#stage .rw-world .rw-fit-rail .rw-metrics{gap:8px}
#stage #panel .cat-capture-card .first-adventure-tip{background:transparent!important;border:0!important;padding:4px 2px!important}

/* RPG interaction pass: compact dialogue, no duplicate HUD or gray menu scrim. */
html body #stage #cb-header-actions #hud,html body #stage #cb-header-actions .hud-pill,html body #stage #hud,html body #stage .hud-pill{display:none!important;visibility:hidden!important}
html body #stage #cb-yard-return,html body #stage #cb-header #cb-yard-return,html[data-mw-fullscreen-game="cat-bond"] body #stage #cb-header #cb-yard-return{display:none!important}
html body #stage #cb-system-menu:not([hidden]){background:transparent!important;backdrop-filter:none!important;align-items:flex-start!important;justify-content:flex-end!important;padding:58px 12px 12px!important}
#stage #cb-system-menu .cb-system-card{width:min(460px,100%)!important;max-height:100%!important;background:#fff7e6!important;color:#493d2d!important;border:1px solid #bca274!important;box-shadow:0 5px 24px #50391b35!important;border-radius:12px!important}
#stage #cb-system-menu .cb-system-rows button{min-height:38px!important;background:#f5ead1!important;border:1px solid #cfb98e!important;border-radius:7px!important;color:#534431!important;padding:6px 10px!important}
.cb-confirm-dialog{position:fixed!important;inset:0!important;margin:auto!important;width:min(460px,calc(100% - 32px))!important;height:max-content!important;max-height:calc(100dvh - 32px)!important}
#stage .res-host:not(.res-library-reveal){background:linear-gradient(0deg,#49362220,transparent 42%)!important;backdrop-filter:none!important}
#stage .res-host .res-dialogue{width:min(860px,94%)!important;grid-template-columns:minmax(80px,22%) minmax(0,1fr)!important;gap:12px!important;align-items:end!important}
#stage .res-host .res-dialogue:has(.res-portrait[hidden]){grid-template-columns:1fr!important}
#stage .res-host .res-portrait{max-height:32vh!important;filter:drop-shadow(0 4px 8px #47332628)!important}
#stage .res-host .res-body{padding:12px 18px!important;background:#fff7e8f5!important;border:1px solid #c7ad83!important;border-radius:10px!important;box-shadow:0 3px 14px #3d281e26!important;color:#46382b!important;cursor:pointer}
#stage .res-host .res-speaker{font:600 14px/1.3 var(--cb-font-display)!important;color:#856336!important;margin:0 0 5px!important}
#stage .res-host .res-line{font:500 clamp(14px,1.25vw,18px)/1.55 var(--cb-font-body)!important;min-height:0!important;margin:0!important;color:#493d32!important}
#stage .res-host .res-choices:empty,#stage .res-host .res-controls:has(.res-legacy-control),#stage .res-host .res-legacy-control{display:none!important}
#stage .res-host .res-skip-top{position:absolute!important;top:12px!important;right:94px!important;min-height:36px!important;padding:6px 12px!important;background:#fff1d7!important;color:#56432f!important;border:1px solid #bca274!important;box-shadow:none!important}
#stage:has(.res-host .res-dialogue) #cb-system-toggle{display:inline-flex!important;z-index:2147483000!important;right:10px!important;top:10px!important}
#stage .res-host .res-history{color:#594b3a!important}
#stage .res-host .res-prologue-context{color:#856a42!important}
#stage .cat-capture-card .battle-grade,#stage .cat-capture-card .battle-rating,#stage .cat-capture-card .battle-reward-card{width:100%!important;max-width:none!important;margin:6px 0!important;box-sizing:border-box!important}
@media(max-width:600px){#stage .res-host .res-dialogue{display:grid!important;width:100%!important;grid-template-columns:22% minmax(0,1fr)!important;gap:6px!important}#stage .res-host .res-body{padding:9px 10px!important}#stage .res-host .res-portrait{max-height:24vh!important;width:100%!important}}

/* Context-sensitive RPG menu: navigation first, settings and save management on separate pages. */
html body #stage #cb-system-menu:not([hidden]){background:none!important;align-items:flex-start!important;justify-content:flex-end!important}
html body #stage #cb-system-menu .cb-system-card{width:min(340px,calc(100vw - 24px))!important;max-height:100%!important;overflow:auto!important;padding:14px!important;background:#fff9ed!important;border:1px solid #cbb58c!important;box-shadow:0 7px 25px #503b252c!important}
#stage #cb-system-menu .cb-system-card header{gap:10px;margin:0 0 8px!important;padding:0 0 8px;border-bottom:1px solid #e6d8bd}
#stage #cb-system-menu .cb-system-card header h2{flex:1;font:600 19px/1.3 var(--cb-font-display)!important}
#stage #cb-system-menu .cb-system-card header button{min-width:32px!important;min-height:32px!important;border:0!important;background:transparent!important;color:#806442!important;padding:0!important;font-size:22px!important}
#stage #cb-system-menu .cb-system-rows{display:flex!important;flex-direction:column!important;gap:10px!important}
#stage #cb-system-menu .cb-menu-group{display:flex;flex-direction:column;gap:0}
#stage #cb-system-menu .cb-menu-group h3{margin:4px 0 4px;padding:0 8px;color:#947b54;font-size:11px;letter-spacing:.07em;font-weight:600}
#stage #cb-system-menu .cb-system-rows button{display:flex!important;justify-content:space-between!important;min-height:38px!important;padding:8px 10px!important;border:0!important;border-bottom:1px solid #e9dec9!important;border-radius:0!important;background:transparent!important;box-shadow:none!important;font:500 14px/1.3 var(--cb-font-body)!important}
#stage #cb-system-menu .cb-system-rows button:last-child{border-bottom:0!important}
#stage #cb-system-menu .cb-system-rows button:hover,#stage #cb-system-menu .cb-system-rows button:focus-visible{background:#f0e4ca!important;border-radius:6px!important}
#stage #cb-system-menu .cb-system-rows small{font-size:12px;color:#89734c!important}
#stage #cb-system-menu .cb-system-rows>div{display:flex!important;flex-direction:column;gap:10px!important}
#stage #cb-system-menu .cb-system-rows output{color:#76613f!important}
@media(max-height:480px) and (orientation:landscape){html body #stage #cb-system-menu .cb-system-card{width:min(560px,100%)!important;padding:10px!important}#stage #cb-system-menu .cb-system-card[data-menu-page=home] .cb-system-rows{display:grid!important;grid-template-columns:repeat(3,minmax(0,1fr));gap:10px!important}#stage #cb-system-menu .cb-system-rows button{min-height:32px!important;font-size:12px!important}}

/* Keep global typography quiet and readable; remove oversized nested reward panels. */
#stage button,#stage input,#stage select,#stage .rb-open,#stage #panel{font-family:var(--cb-font-body)}
#stage :is(.rb-open,#panel,.cb-system-card) :is(h1,h2,h3){font-family:var(--cb-font-display);line-height:1.3}
#stage #panel .cat-capture-card :is(.battle-grade,.battle-rating,.battle-reward-card,.battle-heal-summary,.battle-exp-card,.battle-level-card){font-size:clamp(12px,1.1vw,15px)!important;padding:8px 10px!important;margin:5px 0!important;background:#f7ecd6!important;color:#534431!important;border-color:#d5c09a!important;box-sizing:border-box!important;width:100%!important;max-width:none!important}
#stage #panel .cat-capture-card details[open]>summary .capture-detail-hint{font-size:0}
#stage #panel .cat-capture-card details[open]>summary .capture-detail-hint::after{content:'−';font-size:14px}

#stage .res-ambient-simple{position:absolute;inset:0;display:grid;place-items:center;background:none!important;backdrop-filter:none!important}
#stage .res-ambient-card,#stage .res-key-handover{width:min(440px,calc(100% - 24px));max-height:96%;overflow:auto;background:#fff8e9;color:#534431;padding:16px;border:1px solid #c5a774;border-radius:12px;box-sizing:border-box;text-align:center;box-shadow:0 6px 22px #513b2330}
#stage .res-ambient-card h2,#stage .res-key-handover h2{font:600 20px var(--cb-font-display);color:#59452f;margin:0 0 9px}
#stage .res-ambient-card button,#stage .res-key-handover button{min-height:40px;padding:8px 16px;border:1px solid #b99b66;border-radius:8px;background:#e9d4ad;color:#493e2b;cursor:pointer}
#stage .res-route-preview{position:relative;aspect-ratio:16/9;background:url("../assets/resonance-world-v2/harbor.webp") center/cover;border-radius:8px;margin:10px 0}
#stage .res-route-west{position:absolute;top:22%;left:5%;font-size:12px;background:#fff2d7;color:#6c512d;padding:5px 7px;border-radius:6px;border:1px solid #c1a477}
#stage .res-key-handover img{height:min(22vh,110px);object-fit:contain}
#stage #cb-leisure{position:absolute;inset:0;display:flex;flex-direction:column;z-index:2147483000;background:#fff8e8}
#stage #cb-leisure header{display:flex;justify-content:space-between;align-items:center;padding:7px 14px;color:#57442d;min-height:44px}
#stage #cb-leisure header button{min-height:36px;background:#eddab2;border:1px solid #bfa16a;border-radius:8px;color:#58442d;padding:5px 10px}
#stage #cb-leisure iframe{width:100%;flex:1;min-height:0;border:0}
#stage #panel .first-capture-rewards .capture-detail-hint::after{content:attr(data-collapsed);font-size:12px}
#stage #panel .first-capture-rewards[open] .capture-detail-hint::after{content:attr(data-open);font-size:12px}

/* Quest panel: current objective, main actions, then optional exploration. */
#stage .rw-world .rw-fit-rail .rw-camera-controls[hidden]{display:none!important}
#stage .rw-world .rw-fit-rail .rw-objective{display:grid!important;grid-template-columns:minmax(0,1fr);gap:8px;padding:12px!important}
#stage .rw-world .rw-fit-rail .rw-current{gap:5px}
#stage .rw-world .rw-fit-rail .rw-current strong{font-size:clamp(18px,2vw,23px)!important;line-height:1.25}
#stage .rw-world .rw-fit-rail .rw-next-label{margin-top:6px;font-size:12px!important;font-weight:700;color:#806135!important;letter-spacing:0}
#stage .rw-world .rw-fit-rail .rw-next{font-size:clamp(15px,1.6vw,18px)!important;line-height:1.5;color:#493e2b!important;white-space:normal}
#stage .rw-world .rw-fit-rail .rw-quest-progress{border-top:1px solid #d6c3a3;padding-top:7px;color:#786249;font-size:12px}
#stage .rw-world .rw-fit-rail .rw-quest-progress summary,#stage .rw-world .rw-fit-rail .rw-optional-actions summary{cursor:pointer;padding:5px 0;font-weight:700}
#stage .rw-world .rw-fit-rail .rw-world-actions{grid-template-columns:repeat(2,minmax(0,1fr))!important;gap:6px!important}
#stage .rw-world .rw-fit-rail .rw-action-heading,#stage .rw-world .rw-fit-rail .rw-optional-actions{grid-column:1/-1}
#stage .rw-world .rw-fit-rail .rw-action-heading{font-size:14px;color:#72552f;padding:4px 2px}
#stage .rw-world .rw-fit-rail .rw-world-actions [data-quest-primary]{background:#ead4a4!important;border-color:#b08a4d!important;font-weight:700}
#stage .rw-world .rw-fit-rail .rw-optional-actions{border-top:1px solid #d6c3a3;color:#786249;padding:5px 0}
#stage .rw-world .rw-fit-rail .rw-optional-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:6px;margin-top:6px}
#stage .rw-world .rw-fit-rail .rw-optional-grid .rw-button{white-space:normal;min-width:0}
#stage .res-ambient-dismiss{margin-inline-start:8px;background:transparent!important;color:#786249!important}

/* Opening encounter has its own actions, not the retired generic dialogue toolbar.
   Keep controls visible even under the fullbleed dialogue simplification. */
#stage #cb-traveler-encounter .cb-encounter-controls{display:flex!important;flex-wrap:wrap;align-items:center;gap:6px;margin-top:10px!important}
#stage #cb-traveler-encounter .cb-encounter-controls button{min-height:44px;cursor:pointer;margin:0;padding:7px 12px}
#stage #cb-traveler-encounter .cb-encounter-next{background:#e7ca91!important;border-color:#ab854d!important;color:#44341f!important;font-weight:750;flex:1 1 auto}
#stage .sg-prologue-guide.sg-minimal-opening{width:min(320px,calc(100% - 24px));padding:9px 11px;gap:5px}
#stage .sg-minimal-opening>div{display:flex;align-items:center;gap:6px}
#stage .sg-minimal-opening .sg-main-continue{flex:1 1 auto;min-height:44px;background:#e7ca91!important;font-weight:750!important}
#stage .sg-explore-options{flex:0 1 auto}
#stage .sg-explore-options summary{cursor:pointer;min-height:44px;display:flex;align-items:center;padding:0 7px;font-weight:650;color:#725631}
#stage .sg-explore-options summary::after{content:" ▾";padding-left:4px}
#stage .sg-explore-options[open]{flex:1 1 100%;display:grid;gap:4px}
#stage .sg-explore-options[open] button{display:block;width:100%;margin:3px 0 0;text-align:left}
@media(max-height:480px){#stage #cb-traveler-encounter .res-portrait{max-height:24vh!important}#stage #cb-traveler-encounter .cb-encounter-controls{margin-top:6px!important;gap:4px}#stage #cb-traveler-encounter .cb-encounter-controls button{min-height:40px;padding:5px 8px}}

/* Physical NPC talk affordance: map coordinates follow the painted cat, not the HUD. */
#stage .sg-npc-talk-marker{position:absolute;z-index:3;transform:translate(-50%,-100%);display:flex;align-items:center;justify-content:center;gap:5px;min-height:36px;min-width:54px;padding:5px 9px;border:1px solid #aa844c;border-radius:12px;background:#fff1d2;color:#654923;box-shadow:0 3px 8px #3a2b2533;font:700 12px var(--cb-font-body);cursor:pointer;pointer-events:auto;white-space:nowrap}
#stage .sg-npc-talk-marker::after{content:"";position:absolute;bottom:-5px;left:calc(50% - 4px);width:8px;height:8px;transform:rotate(45deg);background:#fff1d2;border-right:1px solid #aa844c;border-bottom:1px solid #aa844c}
#stage .sg-npc-talk-marker[hidden],#stage .sg-hotspots.is-placing .sg-npc-talk-marker{display:none!important}
#stage:has(.sg-discovery-choice) :is(.sg-discovery,.sg-prologue-guide){display:none!important;pointer-events:none!important}
#stage .sg-npc-talk-marker:focus-visible{outline:2px solid #714e23;outline-offset:3px}
#stage .res-host [data-res-language],#stage .res-host .cb-encounter-language{display:none!important}

/* Discoveries sit in the illustration, with generous invisible touch targets. */
#stage .sg-exploration-layer{position:absolute;inset:0;pointer-events:none;z-index:1}
#stage .sg-exploration-layer[hidden],#stage .sg-discovery[hidden]{display:none!important}
#stage .sg-discovery{position:absolute;transform:translate(-50%,-50%);width:48px;height:48px;padding:4px;display:grid;place-items:center;background:none!important;border:0!important;box-shadow:none!important;cursor:pointer;pointer-events:auto;color:#6f4f35;touch-action:manipulation}
#stage .sg-discovery svg{width:33px;height:33px;overflow:visible;filter:drop-shadow(0 1px 1px #6b51374d);pointer-events:none}
#stage .sg-discovery-butterfly svg{animation:sg-flutter .95s ease-in-out infinite;transform-origin:center}
#stage .sg-discovery-seed svg,#stage .sg-discovery-door svg{animation:sg-glint 2.4s ease-in-out infinite}
#stage .sg-discovery:focus-visible{outline:2px solid #986b35;outline-offset:1px;border-radius:50%}
#stage .sg-discovery:hover svg{filter:drop-shadow(0 0 4px #fff0b5)}
#stage .sg-discovery-choice{position:absolute;left:50%;top:50%;transform:translate(-50%,-50%);width:min(285px,90%);padding:14px;border:1px solid #b99a65;border-radius:14px;background:#fff1da;color:#684f35;box-shadow:0 5px 24px #634b3b44;pointer-events:auto;z-index:4;font:600 13px var(--cb-font-body)}
#stage .sg-discovery-choice p{margin:0 0 7px}
#stage .sg-discovery-choice button{display:block;width:100%;min-height:40px;margin:4px 0;padding:7px;background:#f3dfba;color:#60482f;border:1px solid #c6a779;border-radius:8px;cursor:pointer}
#stage .sg-hotspots.is-placing .sg-exploration-layer,#stage:has(.res-host,#cb-player-first-intro,#panel.open,#cb-system-menu:not([hidden])) .sg-exploration-layer{display:none!important}
@keyframes sg-flutter{0%,100%{transform:translateY(0) scaleX(1)}50%{transform:translateY(-4px) scaleX(.62)}}
@keyframes sg-glint{0%,100%{opacity:.64}50%{opacity:1}}
@media(prefers-reduced-motion:reduce){#stage .sg-discovery svg{animation:none!important}}

/* Canon 2.2 opening: readable, tactile discoveries instead of tiny decorative props. */
#stage .sg-discovery{width:104px;height:80px;padding:1px 2px;grid-template-rows:48px auto;gap:2px;align-content:center;justify-items:center;color:#593c25;isolation:isolate}
#stage .sg-discovery::before{content:"";position:absolute;top:0;left:50%;transform:translateX(-50%);width:52px;height:52px;border-radius:50%;background:#fff4d9ed;border:2px solid #ad7c3b;box-shadow:0 2px 8px #5f3c2855,0 0 12px #ffe5a6;z-index:-1;pointer-events:none}
#stage .sg-discovery svg{width:46px;height:46px;filter:drop-shadow(0 1px 1px #68442666)}
#stage .sg-discovery-label{max-width:102px;padding:3px 6px;border-radius:7px;background:#fff5e5f5;border:1px solid #b99460;color:#593c25;font:700 12px/1.15 var(--cb-font-body);text-align:center;box-shadow:0 2px 5px #57381b33;pointer-events:none;overflow-wrap:anywhere}
#stage .sg-discovery:hover::before,#stage .sg-discovery:focus-visible::before{border-color:#785020;box-shadow:0 0 0 3px #fff2be,0 2px 8px #5f3c2855}
#stage .sg-discovery:disabled{opacity:.7}
#stage .sg-npc-talk-marker{min-height:44px;min-width:72px;font-size:14px;padding:6px 12px}

/* Compact landscape and narrow phone: keep meaningful labels and 44px+ touch regions. */
@media(max-width:480px),(max-height:420px){#stage .sg-discovery{width:84px;height:70px;grid-template-rows:39px auto;gap:1px}#stage .sg-discovery::before{width:44px;height:44px}#stage .sg-discovery svg{width:38px;height:38px}#stage .sg-discovery-label{max-width:82px;font-size:11px;padding:2px 4px}#stage .sg-npc-talk-marker{font-size:12px;padding:5px 8px;min-width:64px}}

/* Preserve both ends of puzzle art on narrow screens; input uses actual canvas bounds. */
@media (max-aspect-ratio: 1/1){
 #stage .rw-world.rw-interaction-fit:not([hidden])>.rw-shell .rw-surface{width:min(100cqw,calc(100cqh * 1.77777778))!important;height:auto!important;aspect-ratio:16/9!important;}
}

/* Reveal scenes already have full-screen portraits; reserve the whole dialogue row for text. */
#stage .res-host.res-library-reveal .res-dialogue{width:min(860px,94%)!important}
#stage .res-host.res-library-reveal .res-dialogue:has(.res-portrait:not([hidden])){display:grid!important;grid-template-columns:68px minmax(0,1fr)!important;align-items:center!important;gap:8px!important;padding:8px!important;box-sizing:border-box;background:#fff8ebf7;border:1px solid #cbb38a;border-radius:14px}
#stage .res-host.res-library-reveal .res-portrait:not([hidden]){display:block!important;grid-column:1;grid-row:1;width:68px!important;height:78px!important;max-height:none!important;object-fit:contain!important;background:#f5e8d5;border:1px solid #d8bf97;border-radius:10px;box-sizing:border-box;filter:none!important;animation:none!important}
#stage .res-host.res-library-reveal .res-dialogue:has(.res-portrait:not([hidden])) .res-body{grid-column:2;grid-row:1;min-width:0;box-sizing:border-box;padding:5px!important;background:transparent!important;border:0!important;box-shadow:none!important}
#stage .res-host.res-library-reveal .res-dialogue:has(.res-portrait[hidden]) .res-body{grid-column:1/-1;min-width:0}
@media(max-width:600px){#stage .res-host.res-library-reveal .res-dialogue{width:100%!important}}

/* Direct pursuit: preserve the entire playfield and keep only compact controls. */
#stage .rw-world>.rw-chase-bar{position:absolute;top:60px;left:50%;transform:translateX(-50%);z-index:5;display:flex;align-items:center;gap:8px;width:max-content;max-width:calc(100% - 24px);box-sizing:border-box;padding:6px 10px;border-radius:12px;background:#fff7e8ed;color:#493e2b;font-size:clamp(12px,2.6vw,16px);box-shadow:0 2px 8px #47371d26}
#stage .rw-chase-bar button{min-height:34px;flex-shrink:0;font-size:12px;padding:4px 8px}
#stage .rw-world>.rw-chase-stick{position:absolute;bottom:12px;left:12px;width:92px;height:92px;display:grid;place-items:center;z-index:6;border-radius:50%;background:#fff7e8bc;border:2px solid #9c8969;touch-action:none;user-select:none;box-sizing:border-box}
#stage .rw-chase-knob{display:block;width:34px;height:34px;border-radius:50%;background:#a28c66;border:2px solid #fff4d9;pointer-events:none}
#stage .rw-world>.rw-chase-jump{position:absolute;bottom:22px;right:16px;z-index:6;min-width:68px;min-height:48px;touch-action:manipulation}
#stage #battle-ui .move{background:#fff3d9fa!important;color:#3b3020!important;box-shadow:0 2px 6px #49341f50!important;border:1px solid #a3885d55!important}
@media(max-width:680px) and (orientation:portrait){#stage .rw-world>.rw-chase-bar{top:70px;font-size:12px;line-height:1.35;max-width:calc(100% - 16px)}#stage .rw-world>.rw-chase-stick{bottom:max(12px,env(safe-area-inset-bottom));left:12px}#stage .rw-world>.rw-chase-jump{bottom:max(22px,env(safe-area-inset-bottom))}}

/* Minigames use reserved layout space, not a floating card over the playfield. */
#stage .rw-world.rw-dedicated-puzzle:not([hidden]){--rw-game-top:64px;--rw-game-controls:min(36%,400px);--rw-game-gap:10px;background:#f2e7d7!important;overflow:hidden!important}
#stage .rw-world.rw-dedicated-puzzle:not([hidden])>.rw-shell{inset:var(--rw-game-top) calc(var(--rw-game-controls) + 2 * var(--rw-game-gap)) var(--rw-game-gap) var(--rw-game-gap)!important;width:auto!important;height:auto!important;background:#26342e!important;border-radius:10px!important}
#stage .rw-world.rw-dedicated-puzzle:not([hidden])>.rw-shell .rw-surface{width:min(100cqw,calc(100cqh * 1.77777778))!important;height:auto!important}
#stage .rw-world.rw-dedicated-puzzle>.rw-dedicated-rail{position:absolute!important;left:auto!important;right:var(--rw-game-gap)!important;top:var(--rw-game-top)!important;bottom:var(--rw-game-gap)!important;width:var(--rw-game-controls)!important;height:auto!important;max-height:none!important;display:flex!important;flex-direction:column;gap:8px;overflow:auto!important;overscroll-behavior:contain;box-shadow:none!important;background:#fff9ee!important;padding:10px!important}
#stage .rw-minigame-goal{display:flex;flex-direction:column;gap:5px;align-items:stretch;color:#493e2b}
#stage .rw-minigame-title{font-size:clamp(15px,2vw,21px);line-height:1.25;color:#4a3c2c}
#stage .rw-minigame-hint,#stage .rw-minigame-progress{margin:0;font-size:clamp(12px,1.35vw,15px);line-height:1.4;overflow-wrap:anywhere}
#stage .rw-minigame-progress{color:#28634e;font-weight:700}
#stage .rw-minigame-goal .rw-minigame-leave{align-self:flex-end;min-height:36px!important;padding:3px 10px!important;font-size:12px!important;background:transparent!important;color:#70583c!important;border-color:#c6b596!important}
#stage .rw-dedicated-rail .rw-puzzle-controls{display:grid!important;grid-template-columns:repeat(2,minmax(0,1fr))!important;gap:7px!important;align-content:start;padding:0!important;margin:0!important}
#stage .rw-dedicated-rail .rw-puzzle-controls> :not(button){grid-column:1/-1;min-width:0}
#stage .rw-dedicated-rail .rw-puzzle-controls button{min-height:44px!important;white-space:normal!important;overflow-wrap:anywhere;font-size:clamp(12px,1.3vw,15px)!important;line-height:1.25;touch-action:manipulation}
#stage .rw-dedicated-rail .rw-quality-cards .rw-quality-card{touch-action:none!important}
#stage .rw-dedicated-rail .rw-puzzle-controls button[data-minigame-key]:not(:disabled):focus-visible{outline:3px solid #97652b;outline-offset:1px}

@media(max-height:500px) and (orientation:landscape){#stage .rw-world.rw-dedicated-puzzle:not([hidden]){--rw-game-top:48px;--rw-game-controls:40%;--rw-game-gap:6px}#stage .rw-world.rw-dedicated-puzzle>.rw-dedicated-rail{padding:6px!important;gap:4px}#stage .rw-minigame-hint,#stage .rw-minigame-progress{font-size:12px}#stage .rw-minigame-title{font-size:15px}}
@media(orientation:portrait){
#stage .rw-world.rw-dedicated-puzzle:not([hidden]){--rw-game-top:62px;--rw-game-controls:47%;--rw-game-gap:8px}
#stage .rw-world.rw-dedicated-puzzle:not([hidden])>.rw-shell{inset:var(--rw-game-top) var(--rw-game-gap) calc(var(--rw-game-controls) + 2 * var(--rw-game-gap)) var(--rw-game-gap)!important}
#stage .rw-world.rw-dedicated-puzzle>.rw-dedicated-rail{top:auto!important;left:var(--rw-game-gap)!important;right:var(--rw-game-gap)!important;bottom:var(--rw-game-gap)!important;width:auto!important;height:var(--rw-game-controls)!important}
#stage .rw-dedicated-rail .rw-puzzle-controls{grid-template-columns:repeat(2,minmax(0,1fr))!important}
#stage .rw-minigame-goal{position:relative;padding-right:0}
}

#stage .rw-dedicated-rail button[data-path-available="true"]{border-color:#58846c!important;background:#e1edda!important;color:#2e523e!important}
#stage .rw-dedicated-rail button[data-path-available="false"]{opacity:.58}

#stage .rw-world.rw-dedicated-puzzle>.rw-dedicated-rail{box-sizing:border-box}
#stage .rw-world.rw-chase-mode:not([hidden])>.rw-shell{inset:112px 8px 8px!important;width:auto!important;height:auto!important}
#stage .rw-world.rw-chase-mode:has(.rw-chase-stick):not([hidden])>.rw-shell{bottom:116px!important}
@media(orientation:portrait){#stage .rw-world.rw-chase-mode:not([hidden])>.rw-shell{top:132px!important}}
@media(max-height:500px) and (orientation:landscape){#stage .rw-world.rw-chase-mode:not([hidden])>.rw-chase-bar{top:45px}#stage .rw-world.rw-chase-mode:not([hidden])>.rw-shell{top:93px!important}#stage .rw-world.rw-chase-mode:has(.rw-chase-stick):not([hidden])>.rw-shell{inset:93px 92px 8px 112px!important}}

/* Postgame: small groups of physically spaced visitors; no duplicate overhead nameplates. */
#stage .sg-prologue-guide.sg-postgame-guide{width:min(310px,calc(100% - 24px));padding:8px 10px;gap:4px}
#stage .sg-postgame-guide>div{display:flex;gap:5px;flex-wrap:wrap}
#stage .sg-postgame-guide button{min-height:44px;padding:5px 8px;flex:1 1 auto}
#stage .sg-npc-talk-marker.sg-guest-marker{min-height:44px;max-width:112px;min-width:56px;font-size:12px;padding:5px 8px;box-shadow:0 2px 5px #3a2b2533}
#stage .sg-guest-marker::after{display:none}

/* Dedicated gameplay owns both containing blocks: exploration grid/cover rules must never leak. */
#stage .rw-world.rw-dedicated-puzzle:not([hidden]){display:block!important;position:absolute!important;inset:0!important;box-sizing:border-box!important;padding:0!important;--rw-game-gap:10px;--rw-game-top:64px;--rw-game-controls:min(36%,400px)}
#stage .rw-world.rw-dedicated-puzzle:not([hidden])>.rw-shell{position:absolute!important;grid-area:auto!important;inset:var(--rw-game-top) calc(var(--rw-game-controls) + var(--rw-game-gap) + var(--rw-game-gap)) var(--rw-game-gap) var(--rw-game-gap)!important;width:auto!important;height:auto!important;min-width:0!important;min-height:0!important;max-width:none!important;max-height:none!important;container-type:size;overflow:hidden!important}
#stage .rw-world.rw-dedicated-puzzle:not([hidden])>.rw-shell>.rw-surface{position:absolute!important;inset:auto!important;left:50%!important;top:50%!important;transform:translate(-50%,-50%)!important;width:min(100cqw,calc(100cqh * 1.77777778))!important;height:auto!important;max-width:100%!important;max-height:100%!important;aspect-ratio:16/9!important}
#stage .rw-world.rw-dedicated-puzzle:not([hidden])>.rw-fit-rail.rw-dedicated-rail{grid-area:auto!important;position:absolute!important;inset:var(--rw-game-top) var(--rw-game-gap) var(--rw-game-gap) auto!important;box-sizing:border-box!important;width:var(--rw-game-controls)!important;height:auto!important;min-width:0!important;min-height:0!important;max-width:none!important;max-height:none!important;margin:0!important;overflow:auto!important;touch-action:pan-y}
@media(max-height:500px) and (orientation:landscape){#stage .rw-world.rw-dedicated-puzzle:not([hidden]){--rw-game-top:48px;--rw-game-controls:40%;--rw-game-gap:6px}}
@media(orientation:portrait){#stage .rw-world.rw-dedicated-puzzle:not([hidden]){--rw-game-top:62px;--rw-game-controls:47%;--rw-game-gap:8px}#stage .rw-world.rw-dedicated-puzzle:not([hidden])>.rw-shell{inset:var(--rw-game-top) var(--rw-game-gap) calc(var(--rw-game-controls) + var(--rw-game-gap) + var(--rw-game-gap)) var(--rw-game-gap)!important}#stage .rw-world.rw-dedicated-puzzle:not([hidden])>.rw-fit-rail.rw-dedicated-rail{inset:auto var(--rw-game-gap) var(--rw-game-gap) var(--rw-game-gap)!important;width:auto!important;height:var(--rw-game-controls)!important}}

/* Explicit dimensions prevent size-contained absolute boxes from shrink-wrapping to zero. */
#stage .rw-world.rw-dedicated-puzzle:not([hidden])>.rw-shell{box-sizing:border-box!important;width:calc(100% - var(--rw-game-controls) - 3 * var(--rw-game-gap))!important;height:calc(100% - var(--rw-game-top) - var(--rw-game-gap))!important;margin:0!important;justify-self:stretch!important;align-self:stretch!important}
@media(orientation:portrait){#stage .rw-world.rw-dedicated-puzzle:not([hidden])>.rw-shell{width:calc(100% - 2 * var(--rw-game-gap))!important;height:calc(100% - var(--rw-game-top) - var(--rw-game-controls) - 2 * var(--rw-game-gap))!important}}

/* Regional main quest tracker: always readable, independent of exploration visibility. */
#stage .rw-world>.rw-head>button[data-next-scene]{font-size:clamp(17px,2.1vw,23px)!important;line-height:1.35!important;min-height:44px!important;max-width:min(66vw,470px)!important;text-align:left!important;font-weight:800!important}
#stage .rw-world .rw-fit-summary{font-size:clamp(15px,1.7vw,19px)!important;line-height:1.35!important;font-weight:700!important;overflow-wrap:anywhere}
#stage .rw-world .rw-fit-rail .rw-current strong{font-size:clamp(20px,2.3vw,26px)!important}
#stage .rw-world .rw-fit-rail .rw-next{font-size:clamp(17px,1.9vw,21px)!important;font-weight:750!important}
#stage .rw-world .rw-fit-rail .rw-world-actions [data-quest-primary]{font-size:17px!important;min-height:44px!important}
@media(max-width:480px),(max-height:420px){#stage .rw-world>.rw-head>button[data-next-scene]{font-size:16px!important;max-width:min(68vw,440px)!important}#stage .rw-world .rw-fit-summary{font-size:14px!important}}

/* Global story marker hierarchy: optional exploration stays visible, never leads. */
#stage .sg-npc-talk-marker[data-quest-primary="true"]{min-height:45px;min-width:84px;font-size:18px;padding:6px 12px;border:2px solid #b17d28;background:#fff1ca;color:#5c3a16;box-shadow:0 0 0 2px #d6ac64,0 3px 8px #3a2b2533;z-index:5}
#stage .sg-npc-talk-marker[data-quest-primary="true"]::before{content:"";position:absolute;width:10px;height:10px;left:calc(50% - 5px);top:-15px;transform:rotate(45deg);background:#e9b955;border:1px solid #875e27}
#stage .sg-npc-talk-marker[data-quest-primary="false"]{min-height:44px;min-width:48px;font-size:12px;padding:4px 7px;background:#fbf5e9;border-color:#b4a58c;color:#716858;box-shadow:none}
#stage .sg-npc-talk-marker.sg-guest-marker{box-sizing:border-box;min-height:44px;min-width:56px;max-width:112px;max-height:44px;line-height:1.2;white-space:nowrap}
#stage .sg-npc-talk-marker.sg-guest-marker span{overflow:hidden;text-overflow:ellipsis;min-width:0}
#stage .sg-npc-talk-marker.sg-guest-marker svg{flex:none}
#stage .sg-npc-talk-marker[data-quest-primary="false"]::after{background:#fbf5e9;border-color:#b4a58c}
#stage .sg-discovery[data-quest-primary="false"]{width:76px;height:56px;grid-template-rows:29px auto;gap:2px;color:#716858}
#stage .sg-discovery[data-quest-primary="false"]::before{width:30px;height:30px;background:#f8f1e2;border:1px solid #a59a86;box-shadow:none}
#stage .sg-discovery[data-quest-primary="false"] svg{width:26px;height:26px;animation:none!important;filter:none}
#stage .sg-discovery[data-quest-primary="false"] .sg-discovery-label{max-width:76px;font-size:11.5px;font-weight:650;color:#716858;border:1px solid #b4a58c;background:#fbf5e9;box-shadow:none;padding:2px 4px}
#stage .sg-discovery[data-quest-primary="true"] .sg-discovery-label{font-size:16px;font-weight:800;border:2px solid #b17d28;background:#fff1ca;color:#5c3a16}
#stage .sg-discovery[data-quest-primary="true"]{z-index:4}
#stage .sg-prologue-guide .sg-main-continue{background:#e7ca91!important;color:#5c3a16!important;font-weight:800!important;font-size:16px!important;min-height:44px;order:-1}
#stage .sg-prologue-guide .sg-main-continue~button{font-size:12px!important}

#stage .sg-prologue-guide.sg-opening-quest{top:12px!important;left:10px!important;bottom:auto!important;right:auto!important;width:max-content!important;max-width:calc(100% - 20px)!important;padding:0!important;gap:6px;background:transparent!important;border:0!important;box-shadow:none!important;z-index:6;justify-items:start}
#stage .sg-opening-quest>.sg-quest-toggle{width:auto;min-height:44px!important;font-weight:750!important;white-space:nowrap}
#stage .sg-opening-quest>.sg-quest-detail{box-sizing:border-box;display:grid;gap:8px;width:min(300px,calc(100vw - 24px));max-width:100%;max-height:calc(100dvh - 120px);overflow:auto;padding:12px;background:#fff9ed;border:1px solid #cdb49d;border-radius:10px;box-shadow:0 4px 12px #493e2b33;color:#493948}
#stage .sg-opening-quest>.sg-quest-detail[hidden]{display:none!important}
#stage .sg-opening-quest .sg-quest-detail>div{display:flex;flex-wrap:wrap;gap:6px}

/* Starbell: one NPC label; the golden exclamation identifies the active story target. */
#stage .sg-npc-talk-marker .sg-quest-exclamation{display:none}
#stage .sg-npc-talk-marker[data-quest-primary="true"] svg{display:none}
#stage .sg-npc-talk-marker[data-quest-primary="true"] .sg-quest-exclamation{display:grid;place-items:center;width:22px;height:26px;flex:none;font:900 25px/1 var(--cb-font-body);font-style:normal;color:#9c5d0b;text-shadow:0 1px #fff8d6}
#stage .sg-npc-talk-marker[data-quest-primary="true"]::before{content:none!important}

/* Keep the optional guardian list reachable in full-bleed landscape exploration.
 * The main-story action stays in its existing position; the secondary menu stays closed until requested. */
@media (orientation:landscape){
 #stage .rw-world.rw-region-compact:has([data-regional-boss])>.rw-fit-rail:not([hidden]){max-height:calc(100% - 130px)!important;}
}

/* Fit illustration to the playfield, not a dark 16:9 box inside a second box. */
@media(orientation:landscape){
 #stage .rw-world.rw-dedicated-puzzle:not([hidden]){--rw-game-controls:clamp(220px,25%,300px);--rw-game-gap:8px;background:#f7ecdd!important}
 #stage .rw-world.rw-dedicated-puzzle:not([hidden])>.rw-shell{background:linear-gradient(#f7ecdd44,#f7ecdd44),var(--rw-puzzle-art,none) center/cover no-repeat!important;border:1px solid #cbb79a;border-radius:14px!important}
 #stage .rw-world.rw-dedicated-puzzle:not([hidden])>.rw-fit-rail.rw-dedicated-rail{height:auto!important;bottom:auto!important;max-height:calc(100% - var(--rw-game-top) - 2 * var(--rw-game-gap))!important;align-content:start;justify-content:flex-start!important;border:1px solid #cbb79a;border-radius:14px!important;background:#fff9ee!important}
 #stage .rw-world.rw-dedicated-puzzle:not([hidden])>.rw-shell>.rw-surface{width:min(100cqw,calc(100cqh * var(--rw-map-width-ratio,1.77777778)))!important;height:auto!important;aspect-ratio:var(--rw-map-ratio,16/9)!important;max-height:100%!important;object-fit:contain!important}
}
@media(orientation:landscape) and (max-height:500px){#stage .rw-world.rw-dedicated-puzzle:not([hidden]){--rw-game-controls:clamp(180px,32%,255px);--rw-game-gap:6px}}

/* One small gold quest button, no duplicated objective or bottom overlay. */
#stage .rw-world>.rw-head>button[data-next-scene]{display:block!important;box-sizing:border-box!important;width:max-content!important;max-width:min(68vw,340px)!important;min-height:44px!important;max-height:58px!important;overflow:hidden!important;margin:4px 0 0!important;padding:7px 11px!important;border:1px solid #8a6633!important;border-left:4px solid #b78335!important;border-radius:9px!important;background:#fff0cdeF!important;color:#64421e!important;font-size:clamp(14px,1.85vmin,17px)!important;line-height:1.25!important;font-weight:750!important;box-shadow:0 2px 8px #392a2040!important;pointer-events:auto!important;text-align:left!important}
#stage .rw-world>.rw-head:has(>button[data-next-scene]) .rw-fit-summary{display:none!important}
#stage .rw-world>.rw-head:has(>button[data-next-scene]) .rw-brand{width:max-content!important;max-width:min(60vw,300px)!important;padding:4px 8px!important}
#stage .rw-world>.rw-head>button[data-next-scene][data-walking=true]{opacity:.83!important}
@media(orientation:landscape) and (max-height:500px){#stage .rw-world>.rw-head>button[data-next-scene]{max-width:min(48vw,320px)!important;min-height:44px!important;font-size:14px!important}}

#stage .rw-world>.rw-head>button[data-next-scene]{max-height:none!important;overflow:visible!important;font-size:16px!important;line-height:1.4!important;white-space:normal!important}

/* Mirror gallery: the scene itself is the control surface. Assistance is optional. */
#stage .rw-world.rw-dedicated-puzzle.rw-mirror-direct:not([hidden]){--rw-game-controls:116px;display:grid!important;grid-template-rows:var(--rw-game-top) minmax(0,1fr) auto!important;grid-template-columns:minmax(0,1fr)!important;}
#stage .rw-world.rw-dedicated-puzzle.rw-mirror-direct:not([hidden])>.rw-shell{grid-area:2/1/3/2!important;position:relative!important;inset:auto!important;width:100%!important;height:100%!important;max-width:none!important;max-height:none!important;margin:0!important;min-height:0!important;}
#stage .rw-world.rw-dedicated-puzzle.rw-mirror-direct:not([hidden])>.rw-shell>.rw-surface{position:absolute!important;inset:0!important;transform:none!important;width:100%!important;height:100%!important;max-width:none!important;max-height:none!important;aspect-ratio:auto!important;}
#stage .rw-world.rw-dedicated-puzzle.rw-mirror-direct:not([hidden])>.rw-dedicated-rail{grid-area:3/1/4/2!important;position:relative!important;inset:auto!important;display:grid!important;grid-template-columns:minmax(0,1fr) auto!important;align-items:start!important;width:auto!important;height:auto!important;max-height:32dvh!important;margin:4px 8px 8px!important;padding:6px 9px!important;overflow:auto!important;background:#fff7e9!important;gap:8px!important;}
#stage .rw-mirror-direct .rw-minigame-goal{padding:0!important;}#stage .rw-mirror-direct .rw-minigame-hint{display:none!important;}#stage .rw-mirror-direct .rw-mirror-assist summary{cursor:pointer;font-size:13px;min-height:36px;display:flex;align-items:center;}#stage .rw-mirror-direct .rw-mirror-assist[open]{min-width:min(260px,38vw);}#stage .rw-mirror-direct .rw-mirror-assist:not([open])>.rw-puzzle-controls{display:none!important;}
@media(orientation:portrait){#stage .rw-world.rw-dedicated-puzzle.rw-mirror-direct:not([hidden])>.rw-dedicated-rail{grid-template-columns:minmax(0,1fr)!important;}#stage .rw-mirror-direct .rw-mirror-assist[open]{min-width:0;}}

/* Full-stage lookout: the existing approved painting owns the scene. */
#stage .res-host.rw-lookout-full .res-dialogue{z-index:2!important;position:absolute!important;bottom:0!important;top:auto!important;left:0!important;right:0!important;max-height:45%!important;background:#202a39dc!important;border-radius:12px 12px 0 0!important;overflow:auto!important;}
#stage .res-host.rw-lookout-full .sky-lookout-view{position:absolute!important;inset:0!important;z-index:0!important;}#stage .res-host.rw-lookout-full .sky-lookout-painting{object-fit:cover!important;}
#stage .res-dialogue .res-controls:has(.res-visible-next){display:flex!important;justify-content:flex-end!important;}
#stage .res-dialogue .res-visible-next:not([hidden]){display:inline-flex!important;min-height:44px!important;padding:5px 18px!important;border:1px solid #e7c58c!important;background:#fff0d0!important;color:#453c38!important;border-radius:9px!important;align-items:center!important;}

@media(orientation:landscape){#stage .rw-world.rw-dedicated-puzzle.rw-mirror-direct:not([hidden])>.rw-shell>.rw-surface{inset:auto!important;left:50%!important;top:50%!important;transform:translate(-50%,-50%)!important;width:min(100cqw,calc(100cqh * 1.77777778))!important;height:auto!important;aspect-ratio:16/9!important;max-width:100%!important;max-height:100%!important;}}

/* The direct minigame canvas is centered within the available viewport, never clipped by the obsolete side rail. */
#stage .rw-world.rw-dedicated-puzzle.rw-mirror-direct:not([hidden])>.rw-shell{container-type:size;overflow:hidden!important;box-sizing:border-box!important;}
@media(orientation:landscape){#stage .rw-world.rw-dedicated-puzzle.rw-mirror-direct:not([hidden])>.rw-shell>.rw-surface{inset:auto!important;left:50%!important;top:50%!important;transform:translate(-50%,-50%)!important;width:min(100cqw,calc(100cqh * var(--rw-map-width-ratio,1.77777778)))!important;height:auto!important;aspect-ratio:var(--rw-map-ratio,16/9)!important;max-width:100%!important;max-height:100%!important;}}

/* Optional, non-blocking garden help: independent from the primary quest. */
#stage .sg-opening-quest .sg-optional-guide{box-sizing:border-box;pointer-events:auto;width:min(300px,calc(100vw - 24px));max-width:100%;padding:6px 10px;color:#59432f;background:#fff6e7f5;border:1px solid #c8af82;border-radius:10px;font-size:14px;line-height:1.45}
#stage .sg-opening-quest .sg-optional-guide summary{cursor:pointer;min-height:32px;display:list-item;padding:4px 0;font-weight:650}
#stage .sg-opening-quest .sg-optional-guide[open]{max-height:min(37dvh,260px);overflow:auto}
#stage .sg-opening-quest .sg-optional-guide p{margin:6px 0}
#stage .sg-opening-quest .sg-optional-guide button{min-height:44px}

/* Keep beginner directions readable without replacing the main quest bar. */
#stage .sg-opening-quest .sg-optional-guide section{padding:7px 0;border-top:1px solid #d6c4a4}
#stage .sg-opening-quest .sg-optional-guide section strong{display:block;font-size:14px;color:#654b30}
#stage .sg-opening-quest .sg-optional-guide button{display:block;max-width:100%;white-space:normal;box-sizing:border-box;padding:6px 10px}
#stage .sg-opening-quest .sg-optional-guide:not([open])>button{display:none}
#stage .sg-opening-quest .sg-optional-guide[open]{overscroll-behavior:contain;touch-action:pan-y}

#stage .sg-discovery[data-garden-explore^="memory-"]{width:100px;height:58px;grid-template-rows:28px auto;z-index:2}
#stage .sg-discovery[data-garden-explore^="memory-"] .sg-discovery-label{max-width:100px;background:#fff3ce;border:1px solid #b07c39;color:#63421f;font-weight:800}
#stage .sg-memory-view{width:min(330px,88%);max-height:80%;overflow:auto;box-sizing:border-box;display:grid;gap:8px;text-align:center;z-index:8}
#stage .sg-memory-view img{width:100%;height:clamp(75px,22vh,155px);object-fit:contain;transition:filter .3s}
#stage .sg-memory-view img.is-lit{filter:drop-shadow(0 0 15px #ffc85b) brightness(1.12)}
#stage .sg-memory-view button{min-height:44px}
#stage .sg-memory-view button[hidden]{display:none!important}

#stage .res-host .res-skip-top{z-index:12!important;pointer-events:auto!important;touch-action:manipulation;min-height:44px!important;min-width:88px!important}
