/* The same calm scene stays behind player and name choices. */
body .av-wrap,body dialog.v2l-name::backdrop{background:linear-gradient(160deg,#d9eee2,#f9efda 58%,#e7dbf1)!important;backdrop-filter:none!important}
body .av-wrap .av-card,body dialog.v2l-name{background:#fffaf0!important;box-shadow:0 7px 0 #d9cbb9,0 16px 35px #60457515!important}
.av-card.welcome-choice{position:relative}
.welcome-mochi{position:absolute;top:12px;left:12px;width:44px;height:44px;object-fit:contain;pointer-events:none}
.av-card .av-top{padding-left:46px;min-height:44px}
.v2l-name .v2l-name-top{min-height:48px}
@media(prefers-reduced-motion:reduce){.welcome-choice,.welcome-mochi{animation:none!important;transition:none!important}}

/* Keep the room steady as the toy's welcome activities replace one another. */
html #modal.first-journey::backdrop{background:linear-gradient(160deg,#d9eee2,#f9efda 58%,#e7dbf1)!important;backdrop-filter:none!important}
html #modal.first-journey[open]{animation:none!important;transition:none!important;background:#fffaf0!important}
/* Mochi's workshop stays softly behind the squish and name cards, so the welcome feels like one place (Mac, 10/18). */
html #modal.first-journey:not(.first-gift)::backdrop{background:linear-gradient(#fdf6e866,#fdf6e899),#e9efe5 url('./assets/onboarding/welcome-workshop-landscape.webp') center / cover no-repeat!important}
@media(max-aspect-ratio:4/5){html #modal.first-journey:not(.first-gift)::backdrop{background:linear-gradient(#fdf6e866,#fdf6e899),#e9efe5 url('./assets/onboarding/welcome-workshop-portrait.webp') center / cover no-repeat!important}}
html #modal.first-journey[open]:not(.first-gift){box-shadow:0 7px 0 #d9cbb9,0 22px 50px #4a305f40!important}
.welcome-departing::backdrop{background:transparent!important;pointer-events:none!important}

/* One frame and fixed slots from the closed box through the first shelf. */
html body:not(.v2l-typing) #modal[open]:has(>.first-reveal,>.toy-workshop,>.first-shelf){
 width:min(540px,calc(100vw - 28px))!important;max-width:none!important;height:min(600px,calc(100svh - 48px - env(safe-area-inset-top) - env(safe-area-inset-bottom)))!important;
 box-sizing:border-box!important;padding:20px!important;overflow:visible!important;
}
html #modal[open]>.first-reveal,html #modal[open]>.toy-workshop,html #modal[open]>.first-shelf{
 display:grid!important;grid-template-columns:minmax(0,1fr);grid-template-rows:64px 64px minmax(0,1fr) 52px;
 gap:10px!important;align-items:center;justify-items:center;height:100%;min-height:0;width:100%;margin:0!important;
}
html #modal[open]>:is(.first-reveal,.toy-workshop,.first-shelf)>h2{grid-row:1;margin:0!important;line-height:1.1;text-align:center;font-size:clamp(24px,6vw,34px)}
html #modal[open]>:is(.first-reveal,.toy-workshop,.first-shelf)>:is(p,label){grid-row:2;min-height:0;margin:0!important}
html #modal[open]>:is(.first-reveal,.toy-workshop,.first-shelf)>:is(.first-box,.first-meet-stage,.toy-workshop-stage,.first-shelf-stage){grid-row:3;grid-column:1;min-height:0!important;max-height:100%;margin:0!important}
html #modal[open]>:is(.first-reveal,.toy-workshop,.first-shelf)>button:not(.first-box){grid-row:4;width:100%!important;min-height:48px!important;margin:0!important}
html .first-reveal-action{display:flex!important;align-items:center;justify-content:center;animation:none!important;opacity:1;transition:opacity .28s ease-out}
html .first-reveal-action[hidden]{display:flex!important;visibility:hidden;opacity:0;pointer-events:none}
html .first-reveal-instruction{width:100%;height:64px;display:grid;place-items:center}
html #modal .first-box{width:min(100%,320px)!important;height:100%!important;max-height:320px!important}
html #modal .first-meet-stage{width:min(280px,65vw,calc(100svh - 330px))!important;height:min(280px,65vw,calc(100svh - 330px))!important;max-height:100%!important;aspect-ratio:1}
html #modal .toy-workshop-stage{width:min(280px,65vw,calc(100svh - 330px))!important;height:min(280px,65vw,calc(100svh - 330px))!important;max-height:100%!important}
html #modal .toy-workshop-stage .toy{width:100%!important;height:100%!important;object-fit:contain}
html #modal .first-shelf-stage{width:100%!important;height:100%!important}
html dialog.v2l-name[open]{animation:none!important}
@media(max-width:759px){html body .av-card .av-opts{height:clamp(80px,14svh,128px)!important;min-height:clamp(80px,14svh,128px)!important;max-height:clamp(80px,14svh,128px)!important;overflow-y:auto;align-content:start}}
@media(prefers-reduced-motion:reduce){html .first-reveal-action{transition:none}}

/* A wall-mounted wooden shelf; toy baselines share the top of the plank. */
html #modal.first-shelf-modal .first-shelf-stage{display:flex!important;align-items:center!important;justify-content:center!important;padding:0 8px 44px!important;background:radial-gradient(ellipse at 50% 70%,#f3e4cd55,transparent 70%)!important;box-shadow:none!important;border-radius:0!important;overflow:visible!important}
html #modal.first-shelf-modal .first-shelf-row{display:flex!important;align-items:flex-end!important;width:100%;height:160px;min-height:0!important;padding:0 10px!important;gap:8px;isolation:isolate}
html #modal.first-shelf-modal .first-shelf-row:before{left:0;right:0;top:100%;bottom:auto;height:22px;border:0;border-radius:3px 3px 6px 6px;background:repeating-linear-gradient(2deg,transparent 0 5px,#9b60341c 6px 7px),linear-gradient(#f2cc94 0 5px,#c68d54 5px 19px,#aa7143 19px);box-shadow:0 2px 0 #8e5d36,0 10px 12px #73523626;z-index:2}
html #modal.first-shelf-modal .first-shelf-row:after{content:'';position:absolute;left:12%;right:12%;top:calc(100% + 22px);height:24px;background:linear-gradient(90deg,#b77e48 0 12px,transparent 12px calc(100% - 12px),#b77e48 calc(100% - 12px));clip-path:polygon(0 0,100% 0,100% 100%,calc(100% - 12px) 45%,12px 45%,0 100%);z-index:0}
html #modal.first-shelf-modal .first-shelf-row .shelf-spot{height:auto!important;min-height:0;padding:0!important;display:flex!important;align-items:flex-end;justify-content:center}
html #modal.first-shelf-modal .first-shelf-row .shelf-spot .toy{transform:translateY(9%);filter:drop-shadow(0 2px 1px #75513c40)!important}
html #modal.first-shelf-modal .first-shelf-row .first-shelf-new{animation:none!important}
/* The dumpling image has a deeper transparent lower margin than the starter art. */
html #modal.first-shelf-modal .first-shelf-row .shelf-spot .toy.toy-lavender{transform:translateY(16%)}

/* Generated shelf: the toys touch the middle of its visible top plane. */
html #modal.first-shelf-modal .first-shelf-row:before{top:100%;left:0;right:0;width:100%;height:auto;aspect-ratio:3/1;transform:translateY(-46%);background:url('./assets/onboarding/collection-shelf-phone.webp') center/contain no-repeat;box-shadow:none;border:0;border-radius:0;z-index:-1}
html #modal.first-shelf-modal .first-shelf-row:after{display:none}
html #modal.first-shelf-modal .first-shelf-row .shelf-spot:before{content:'';position:absolute;left:18%;right:18%;height:5px;bottom:-2px;border-radius:50%;background:#6a3c2455;filter:blur(2px);z-index:-1}

@media(min-width:761px){html #modal.first-shelf-modal .first-shelf-row:before{background-image:url('./assets/onboarding/collection-shelf-tablet.webp')}}

html #modal.first-shelf-modal .first-shelf-row:before{filter:drop-shadow(0 0 3px #fffbea) drop-shadow(0 0 10px #fff8dfb3) drop-shadow(0 5px 5px #69412b44)}
html #modal.first-shelf-modal .first-shelf-row .shelf-spot .toy{filter:drop-shadow(0 0 2px #fffdf2) drop-shadow(0 0 6px #fff8dfb3) drop-shadow(0 3px 2px #61432144)!important}

/* Name me: spoken name bubbles for pre-readers; dumpling first, names under it, shelf button last. */
html #modal[open]>.toy-workshop.toy-namer{grid-template-rows:52px minmax(0,1fr) 76px 52px!important}
html #modal[open]>.toy-namer>h2{grid-row:1;outline:none}
html #modal[open]>.toy-namer{position:relative}
html #modal[open]>.toy-namer>button.toy-name-type{position:absolute;top:2px;right:0;grid-row:1!important;width:48px!important;min-height:48px!important;height:48px;margin:0!important;border:3px solid #fffdf8;border-radius:50%;background:#f6effa;box-shadow:0 4px 0 #d8c6e0;font-size:20px;padding:0;display:grid;place-items:center}
html #modal[open]>.toy-namer>button.toy-workshop-stage{grid-row:2!important;padding:0;border:0;cursor:pointer;touch-action:manipulation;-webkit-tap-highlight-color:transparent;width:auto!important;height:min(300px,70vw,100%)!important;max-height:100%!important;aspect-ratio:1}
html #modal[open]>.toy-namer>button.toy-workshop-stage:focus-visible{outline:3px solid #72cdb8;outline-offset:4px}
html #modal[open]>.toy-namer>.toy-name-row{grid-row:3;width:100%;height:100%;display:flex;align-items:center;gap:8px}
html #modal[open]>.toy-namer>button.btn{grid-row:4!important}
.toy-name-choices{flex:1;min-width:0;height:100%;display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:8px}
.toy-name-choice,.toy-name-tool{min-width:0;height:100%;border:3px solid #fffdf8;border-radius:24px;background:#fff8ed;color:#8054a0;box-shadow:0 5px 0 #cbb5d1;font:inherit;font-weight:800;font-size:clamp(16px,4.4vw,22px);padding:0 2px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;transition:transform .15s}
.toy-name-choice.long{font-size:clamp(14px,3.7vw,22px);letter-spacing:-.3px}
@media(max-width:430px){.toy-name-choices{gap:6px}.toy-name-row{gap:6px!important}.toy-name-choice{border-width:2px}.toy-name-tool{width:46px}}
@media(max-width:360px){.toy-name-choices{gap:4px}.toy-name-row{gap:4px!important}.toy-name-choice{font-size:15px;padding:0 1px}.toy-name-choice.long{font-size:11.5px;letter-spacing:-.5px}.toy-name-tool{width:38px;font-size:20px}}
.toy-name-choice.selected{border-color:#72cdb8;background:#e8fcf3;color:#3f7d6f;box-shadow:0 5px 0 #68aa9b}
.toy-name-choice:active,.toy-name-tool:active{transform:translateY(3px);box-shadow:0 2px 0 #cbb5d1}
.toy-name-tool{flex:0 0 auto;width:clamp(48px,12vw,60px);font-size:clamp(22px,6vw,28px);padding:0}
.toy-namer .toy-workshop-name{display:none}
.toy-namer.typing .toy-name-choices,.toy-namer.typing [data-action=toynamedice]{display:none}
.toy-namer.typing>.toy-name-type{background:#e8fcf3;border-color:#72cdb8;box-shadow:0 4px 0 #68aa9b}
.toy-namer.typing .toy-workshop-name{display:block;flex:1;min-width:0;height:100%}
.toy-namer.typing .toy-workshop-name input{height:100%;min-height:0;font-size:20px}
.toy-namer [data-action=toyfinished] svg{width:24px;height:24px;margin-right:6px}
@media(prefers-reduced-motion:no-preference){.toy-namer-nudge{animation:namer-nudge 1.4s ease-in-out infinite}@keyframes namer-nudge{0%,100%{transform:scale(1)}50%{transform:scale(1.04)}}}
