/* Ascended companions and the finite welcome sequence. */
.rarity-ascendant{--ascend:#429fac}.rarity-titan{--ascend:#549967}.rarity-eternal{--ascend:#b77535}.rarity-empyrean{--ascend:#8361bb}.rarity-primordial{--ascend:#b94d84}.rarity-genesis{--ascend:#d29520}
.dex-card[class*="rarity-ascendant"],.dex-card.rarity-titan,.dex-card.rarity-eternal,.dex-card.rarity-empyrean,.dex-card.rarity-primordial,.dex-card.rarity-genesis{border:2px solid var(--ascend);background:radial-gradient(ellipse at 50% 12%,#ffffff,#f0ecfa 56%,#fff8df);box-shadow:0 5px 0 color-mix(in srgb,var(--ascend) 35%,transparent),0 8px 25px #41336616}
.dex-card.rarity-genesis{background:radial-gradient(ellipse at 50% 20%,#fff7da,#eee2ff 55%,#fffbeb);box-shadow:0 0 0 3px #f4da9b,0 10px 30px #c5a8eb66}
.dex-card .ascension-mark{display:inline-flex;align-items:center;gap:6px;padding:5px 9px;border-radius:20px;background:#30254c;color:#ffedb0;font-size:11px;font-weight:800;margin:5px 0}
.dex-card .dex-rarity{letter-spacing:.05em}
.welcome-cinematic{position:absolute;inset:0;z-index:3;pointer-events:none;overflow:hidden;isolation:isolate}
.welcome-spell-book{position:absolute;left:58%;bottom:21%;width:150px;transform:translateX(-50%);opacity:0;filter:drop-shadow(0 0 18px #f9d47a);perspective:450px}
.welcome-spell-book svg{width:100%;display:block;overflow:visible}
.spell-page-left{transform-origin:120px 60px}.spell-page-right{transform-origin:120px 60px}
.welcome-word{position:absolute;left:58%;top:48%;border:2px solid #fff5c5;border-radius:12px;background:linear-gradient(135deg,#7754bc,#4367b8);box-shadow:0 0 18px #fdd782b3,0 4px 0 #4e338c;color:#fff8df;font:900 19px var(--quest-display);padding:7px 13px;opacity:0;transform:translate(-50%,20px)}
.word-play{background:linear-gradient(135deg,#267e99,#37a992)}.word-grow{background:linear-gradient(135deg,#ac548c,#785ac6)}
.welcome-magic-path{position:absolute;left:58%;top:50%;width:37%;height:26%;border-top:5px solid #ffec9c;border-radius:50%;transform-origin:left center;opacity:0;filter:drop-shadow(0 0 9px #f3be63)}
.welcome-star-burst{position:absolute;left:90%;top:41%;width:1px;height:1px;opacity:0}
.welcome-star-burst i{position:absolute;color:#efbd55;font-size:18px;font-style:normal;text-shadow:0 0 8px #fff4b9;transform:rotate(calc(var(--spark)*30deg)) translateX(65px)}
.dashboard .party-welcome .welcome-story-controls{position:absolute;bottom:8px;left:6%;right:6%;z-index:5;display:flex;align-items:center;justify-content:center;flex-wrap:wrap;gap:6px;color:#fff9e6}
.welcome-story-caption{padding:6px 10px;border-radius:20px;background:#352a63e8;font-size:12px;line-height:1.2;text-align:center}
.welcome-story-controls button{min-height:36px;padding:5px 10px;border:1px solid #ddcbf3;border-radius:15px;background:#fffcf4;color:#654896;font-weight:800;font-size:11px;cursor:pointer}
.welcome-story-controls button:focus-visible{outline:3px solid #8063d7;outline-offset:2px}
.welcome-story-controls button:disabled{opacity:.6;cursor:default}
.dashboard .party-welcome:has(.welcome-story-controls) .welcome-school-party>figcaption{display:none}
.welcome-playing .welcome-spell-book{animation:welcome-book-story 5s ease both}
.welcome-playing .spell-page-left{animation:welcome-open-left 5s ease both}.welcome-playing .spell-page-right{animation:welcome-open-right 5s ease both}
.welcome-playing .word-learn{animation:welcome-word-one 5s ease both}.welcome-playing .word-play{animation:welcome-word-two 5s ease both}.welcome-playing .word-grow{animation:welcome-word-three 5s ease both}
.welcome-playing .welcome-magic-path{animation:welcome-path-story 5s ease both}.welcome-playing .welcome-star-burst{animation:welcome-burst-story 5s ease both}
.welcome-playing #petStage .companion-play-pet{animation:welcome-pet-story 5s ease both}
.welcome-playing .welcome-explore{animation:welcome-invite-story 5s ease both}
@keyframes welcome-book-story{0%{opacity:0;transform:translate(-50%,30px) scale(.6)}12%,48%{opacity:1;transform:translate(-50%,0) scale(1)}72%,100%{opacity:0;transform:translate(-50%,-15px) scale(.85)}}
@keyframes welcome-open-left{0%{transform:rotateY(84deg)}18%,100%{transform:rotateY(0)}}
@keyframes welcome-open-right{0%{transform:rotateY(-84deg)}18%,100%{transform:rotateY(0)}}
@keyframes welcome-word-one{0%,16%{opacity:0;transform:translate(-50%,20px) scale(.5)}28%,42%{opacity:1;transform:translate(-155%,-55px) rotate(-9deg)}64%,100%{opacity:0;transform:translate(190%,-50px) scale(.35)}}
@keyframes welcome-word-two{0%,23%{opacity:0;transform:translate(-50%,20px) scale(.5)}36%,48%{opacity:1;transform:translate(-40%,-85px) rotate(5deg)}70%,100%{opacity:0;transform:translate(190%,-50px) scale(.35)}}
@keyframes welcome-word-three{0%,30%{opacity:0;transform:translate(-50%,20px) scale(.5)}42%,54%{opacity:1;transform:translate(60%,-55px) rotate(9deg)}76%,100%{opacity:0;transform:translate(190%,-50px) scale(.35)}}
@keyframes welcome-path-story{0%,39%{opacity:0;transform:rotate(var(--welcome-path-rotation,0deg)) scaleX(0)}50%,66%{opacity:.85;transform:rotate(var(--welcome-path-rotation,0deg)) scaleX(1)}80%,100%{opacity:0;transform:rotate(var(--welcome-path-rotation,0deg)) scaleX(1)}}
@keyframes welcome-burst-story{0%,59%{opacity:0;transform:scale(.3)}68%{opacity:1;transform:scale(1)}82%,100%{opacity:0;transform:scale(1.7)}}
@keyframes welcome-pet-story{0%,62%{transform:translateY(0)}69%{transform:translateY(-19px) rotate(-5deg)}75%{transform:translateY(0) rotate(4deg)}81%,100%{transform:translateY(0)}}
@keyframes welcome-invite-story{0%,78%{filter:none}87%{filter:brightness(1.25) drop-shadow(0 0 14px #e4bf60)}100%{filter:none}}
@media (max-width:1199px){.welcome-spell-book{left:73%;bottom:47%;width:125px}.welcome-word{left:73%;top:36%}.welcome-magic-path{left:73%;top:44%;width:30%;--welcome-path-rotation:120deg}.welcome-star-burst{left:50%;top:83%}}
@media (max-width:700px){.welcome-spell-book{left:50%;bottom:24%;width:115px}.welcome-word{left:50%;top:61%;font-size:14px}.welcome-magic-path{left:50%;top:68%;width:25%;--welcome-path-rotation:130deg}.welcome-star-burst{left:18%;top:88%}.welcome-story-caption{font-size:10px}.welcome-story-controls button{min-height:32px;font-size:10px}.dashboard .party-welcome .welcome-story-controls{left:3%;right:3%;bottom:3px;gap:3px}}
@media (prefers-reduced-motion:reduce){.welcome-playing *, .welcome-playing .welcome-spell-book,.welcome-playing .welcome-word{animation:none!important}.welcome-cinematic{display:none}}
/* The three illustrated consoles have different openings. Register the real
   board and shop sample to the same safe square; art never intercepts input. */
#wordforgeDialog .wf-mini-board.ornate,#wordforgeDialog .wf-board-shell.ornate{--frame-size:60%;--frame-x:50%;--frame-y:50%;padding:0}
#wordforgeDialog .wf-mini-board[data-frame=forest],#wordforgeDialog .wf-board-shell[data-frame=forest]{--frame-size:54%;--frame-x:49%;--frame-y:52%}
#wordforgeDialog .wf-mini-board.ornate .wf-mini-grid,#wordforgeDialog .wf-board-shell.ornate .wf-board-viewport.fit,#wordforgeDialog .wf-board-shell.ornate .wf-board-viewport:not(.fit){position:absolute;inset:auto;left:var(--frame-x);top:var(--frame-y);width:var(--frame-size)!important;height:var(--frame-size);transform:translate(-50%,-50%);margin:0;aspect-ratio:1;z-index:1}
#wordforgeDialog .wf-mini-board.ornate>img{position:absolute;inset:0;width:100%;height:100%;object-fit:contain;pointer-events:none}
#wordforgeDialog .wf-board-shell.ornate .wf-board-viewport.fit .wf-square>b{font-size:clamp(10px,1.25vw,18px)}
@media (max-width:760px){#wordforgeDialog .wf-board-shell.ornate .wf-board-viewport.fit .wf-square>b{font-size:clamp(10px,2.9vw,15px)}}

#wordforgeDialog .wf-mini-board[data-frame=frost],#wordforgeDialog .wf-board-shell[data-frame=frost]{--frame-size:52%;--frame-x:49%;--frame-y:48%}
#wordforgeDialog .wf-mini-board[data-frame=astral],#wordforgeDialog .wf-board-shell[data-frame=astral]{--frame-size:56%;--frame-x:49%;--frame-y:45%}
/* Keep the new collection filter reachable on narrow phones. */
#petDexDialog .dex-filters{flex-wrap:wrap;max-width:100%;box-sizing:border-box}
