/* NALAROO Storybook Home Handoff v1.0
 * Show the real Explorer chooser while dashboard data loads. For direct deep
 * links / refreshes only, replace legacy UbayBian Adventure Loading visuals.
 * No artificial timer, backend/coin changes, or generated assets.
 */
.explorer-opening .explorer-play[aria-busy="true"]{
 background:linear-gradient(180deg,#a6caa9,#5f9d6d);
 border-color:#568b60;
 cursor:progress;
}
.explorer-opening .explorer-edit,
.explorer-opening .explorer-add{cursor:wait}
.explorer-handoff-error{
 width:min(560px,100%);
 margin:16px auto 0;
 padding:15px 18px;
 border:1px solid #c4a181;
 border-radius:18px;
 color:#65442c;
 background:#fffaf0f5;
 box-shadow:0 4px 14px #483c2730;
 text-align:center;
 font:600 15px/1.5 ui-rounded,system-ui,sans-serif;
}
.explorer-handoff-error p{margin:0 0 10px}
.explorer-handoff-retry{
 min-height:44px;
 padding:10px 20px;
 border:1px solid #8c9e7a;
 border-radius:15px;
 color:#27513a;
 background:#e7f0df;
 font:800 15px ui-rounded,system-ui,sans-serif;
 cursor:pointer;
}
.explorer-handoff-retry:focus-visible{outline:3px solid #3367a1;outline-offset:3px}

/* NALAROO first paint and direct Home access: never reveal the UbayBian
 * blue shell or match .loading-card, whose old selectors override theme styles.
 * Static initial splash renders even before Firebase / JS bootstraps. */
html:has(.storybook-initial-splash),
html:has(.storybook-home-placeholder),
html:has(.storybook-home-error){
 background:#e5efe7!important;
}
body:has(.storybook-initial-splash),
body:has(.storybook-home-placeholder),
body:has(.storybook-home-error){
 margin:0!important;
 padding:0!important;
 min-height:100dvh!important;
 background:linear-gradient(rgba(247,246,226,.26),rgba(224,236,214,.21)),
  url('assets/world/explorer-garden.webp') center / cover no-repeat!important;
 color:#365542;
}
body:has(.storybook-initial-splash) .shell,
body:has(.storybook-home-placeholder) .shell,
body:has(.storybook-home-error) .shell{
 width:100%!important;
 max-width:none!important;
 min-height:100dvh!important;
 margin:0!important;
 padding:0!important;
 border:0!important;
 border-radius:0!important;
 overflow:visible!important;
 box-shadow:none!important;
 background:transparent!important;
}
body:has(.storybook-initial-splash) #main,
body:has(.storybook-home-placeholder) #main,
body:has(.storybook-home-error) #main{
 display:grid!important;
 place-items:center!important;
 width:100%!important;
 min-height:100dvh!important;
 margin:0!important;
 padding:24px max(16px,env(safe-area-inset-right))!important;
 overflow:visible!important;
 background:transparent!important;
}
body:has(.storybook-initial-splash) #main::before,
body:has(.storybook-initial-splash) #main::after,
body:has(.storybook-home-placeholder) #main::before,
body:has(.storybook-home-placeholder) #main::after,
body:has(.storybook-home-error) #main::before,
body:has(.storybook-home-error) #main::after{
 display:none!important;
 content:none!important;
}
body:has(.storybook-initial-splash) .shell>footer,
body:has(.storybook-home-placeholder) .shell>footer,
body:has(.storybook-home-error) .shell>footer{
 display:none!important;
}
.storybook-initial-splash,.storybook-home-placeholder,.storybook-home-error{
 box-sizing:border-box;
 display:flex;
 flex-direction:column;
 align-items:center;
 justify-content:center;
 width:min(420px,calc(100vw - 32px));
 margin:auto;
 padding:27px 26px 24px;
 text-align:center;
 border:1.5px solid #bfa785;
 border-radius:24px;
 background:linear-gradient(145deg,rgba(255,253,244,.97),rgba(249,242,222,.97));
 box-shadow:0 3px 0 rgba(145,110,71,.2),0 15px 34px rgba(62,58,40,.16);
 color:#325a47;
}
.storybook-initial-splash img{
 display:block;
 width:min(220px,76%);
 height:auto;
 object-fit:contain;
}
.storybook-initial-splash p{
 margin:12px 0 0;
 font:700 15px/1.45 ui-rounded,system-ui,sans-serif;
}
.storybook-home-placeholder::before{
 content:'NALAROO STORYBOOK';
 color:#78966f;
 font:800 11px/1.3 ui-rounded,system-ui,sans-serif;
 letter-spacing:.12em;
 margin-bottom:12px;
}
.storybook-status-image{
 display:block;
 width:76px;
 height:76px;
 object-fit:contain;
 margin:0 auto 14px;
}
.storybook-home-placeholder strong,.storybook-home-error strong{
 color:#315544;
 font:900 21px/1.35 ui-rounded,'Trebuchet MS',system-ui,sans-serif;
}
.storybook-home-placeholder p,.storybook-home-error p{
 margin:9px 0 0;
 color:#5d725e;
 font:600 14px/1.5 ui-rounded,system-ui,sans-serif;
}
.storybook-home-placeholder p::after{
 content:'';
 display:block;
 width:108px;
 height:4px;
 margin:18px auto 0;
 border-radius:20px;
 background:linear-gradient(90deg,#d1c896,#7fa68b,#e6c997);
}
.storybook-home-error .storybook-return-retry{margin-top:16px}
body.storybook-returning-world #primary-navigation-hud button[data-page="home"][aria-busy="true"]{
 cursor:progress;
 background:linear-gradient(180deg,#dff1df,#afd9b4);
}
.storybook-return-error{
 position:fixed;
 z-index:200;
 left:50%;
 bottom:max(104px,calc(96px + env(safe-area-inset-bottom)));
 transform:translateX(-50%);
 width:min(470px,calc(100vw - 32px));
 box-sizing:border-box;
 margin:0;
 padding:14px 18px;
 border:1.5px solid #c4a181;
 border-radius:18px;
 color:#65442c;
 background:#fffaf2f9;
 box-shadow:0 10px 28px rgba(64,49,30,.21);
 text-align:center;
 font:600 14px/1.5 ui-rounded,system-ui,sans-serif;
}
.storybook-return-error p{margin:0 0 10px}
.storybook-return-retry{
 min-height:44px;
 padding:9px 19px;
 border:1px solid #82996b;
 border-radius:14px;
 color:#285641;
 background:#e8f2e1;
 font:800 15px ui-rounded,system-ui,sans-serif;
 cursor:pointer;
}
.storybook-return-retry:focus-visible{outline:3px solid #3864a0;outline-offset:3px}
@media(max-width:700px){
 body:has(.storybook-initial-splash),
 body:has(.storybook-home-placeholder),
 body:has(.storybook-home-error){
  background:linear-gradient(rgba(247,246,226,.24),rgba(224,236,214,.18)),
   url('assets/world/explorer-garden-portrait.webp') center / cover no-repeat!important;
 }
 .storybook-initial-splash,.storybook-home-placeholder,.storybook-home-error{padding:24px 20px}
}
