:root{--ink:#592b82;--muted:#876a9c;--pink:#ff66b5;--gold:#ffe376;--purple:#9c64ec}*{box-sizing:border-box}body{margin:0;color:var(--ink);font:17px/1.5 ui-rounded,'Trebuchet MS',sans-serif;background:linear-gradient(145deg,#fff3b7,#ffe3ef 48%,#e4d4ff);min-height:100vh}button,input,select{font:inherit}button{cursor:pointer;touch-action:manipulation;-webkit-tap-highlight-color:transparent}button:disabled{opacity:.55;cursor:default}button:focus-visible,input:focus-visible,select:focus-visible{outline:4px solid #6947dd;outline-offset:3px}button{color:inherit}small{display:block;font-size:12px}h2,h3,p{margin:0 0 16px}h2{font-size:clamp(23px,3vw,34px)}h3{font-size:24px}.topbar{max-width:1280px;margin:auto;padding:18px 28px;display:flex;align-items:center;justify-content:space-between;gap:12px}.brand,.icon-button{background:#fff8;border:2px solid #fff;border-radius:22px;padding:10px 16px;font-weight:900;min-height:48px}.brand small{display:inline}.brand-stone{color:#fb85bf}.top-actions{display:flex;gap:8px}.icon-button span{display:none}#app{max-width:1200px;margin:auto;padding:12px 28px 40px}.candy{border:3px solid #fff9;border-radius:24px;background:linear-gradient(#fface0,#f653a8);box-shadow:0 6px 0 #be3887,0 9px 20px #b650aa30,inset 0 3px 0 #fffc;color:#fff;text-shadow:0 2px 1px #9d287c66;min-height:64px;padding:15px 25px;font-weight:900;font-size:20px;display:flex;align-items:center;justify-content:center;gap:18px;transition:transform .15s}.candy:hover{transform:translateY(-3px)}.candy:active{transform:translateY(4px);box-shadow:0 2px 0 #be3887}.candy small{color:#fff;font-size:12px}.blue{background:linear-gradient(#a58bff,#7f56e6);box-shadow:0 6px 0 #6341af}.pink{background:linear-gradient(#ffd285,#ffa557);box-shadow:0 6px 0 #d57a41}.full{width:100%}.quiet,.back{background:#fff9;border:2px solid #e5c9f3;border-radius:17px;padding:10px 17px;min-height:48px;font-weight:800}.home-layout{display:grid;grid-template-columns:1fr 1fr;align-items:center;min-height:75vh;gap:40px}.logo{width:100%;border-radius:32px;box-shadow:0 10px 35px #a547b766;border:5px solid #fff9}.home-actions{display:grid;gap:17px;margin:28px auto;max-width:430px}.home-actions .candy{justify-content:flex-start;text-align:left}.menu-icon{font-size:40px;min-width:58px;text-align:center}.hero-scene{height:530px;position:relative;border-radius:50%;background:radial-gradient(ellipse,#fff3ad80,transparent 70%)}.character{object-fit:contain;max-width:100%}.hero-scene .prince{position:absolute;width:60%;right:-3%;top:0;filter:drop-shadow(0 15px 15px #995ab533)}.hero-scene .shiba{position:absolute;width:70%;left:-4%;bottom:5%}.hero-scene .pebble{position:absolute;width:50%;right:0;bottom:0}.scene-flower{position:absolute;font-size:60px;left:15%;top:0;animation:float 6s ease-in-out infinite}.center-screen{max-width:790px;margin:15px auto}.screen-heading{display:flex;justify-content:space-between;align-items:center;gap:20px;margin:10px 0 24px}.screen-heading h2{margin:0}.panel{padding:28px;border:3px solid #fff;border-radius:30px;background:#fffc;box-shadow:0 10px 30px #b96fbc18}.options-row{display:flex;gap:14px;justify-content:center;flex-wrap:wrap}.avatar{font-size:48px;border:3px solid transparent;background:#f1e5ff;border-radius:24px;width:90px;height:90px}.avatar.selected{border-color:#ba69ed;box-shadow:0 0 0 4px #ffe488}.companion{display:flex;align-items:center;justify-content:center;gap:15px;font-weight:800;margin-bottom:20px}.companion img{width:100px;height:100px}.field{display:block;margin:20px 0;font-weight:800}.field input:not([type=range]),.field select{display:block;width:100%;min-height:50px;border:2px solid #dcc3ef;border-radius:14px;background:#fff;color:var(--ink);padding:10px;margin-top:6px}input[type=range]{display:block;width:100%;min-height:44px;accent-color:#b267e8}.form-grid{display:grid;grid-template-columns:1fr 1fr;gap:20px}.check-label{display:flex;align-items:center;gap:12px;margin-bottom:22px}input[type=checkbox]{width:27px;height:27px;accent-color:#b568e8}.menu-options{display:grid;gap:20px}.story-layout{display:grid;grid-template-columns:minmax(230px,.8fr) minmax(350px,1.4fr);gap:28px;align-items:start}.boss-card{background:radial-gradient(ellipse,#ffdfef,#d6b7f1);border-radius:35px;text-align:center;border:3px solid #fff;overflow:hidden}.boss-card img{width:100%;max-height:480px;object-fit:contain}.story-tools{display:flex;align-items:center;justify-content:space-between;gap:10px;margin-bottom:15px}.badge{font-size:12px;font-weight:900}.story-text{font-size:20px}.sentence{padding:12px 0;line-height:1.8}.word{padding:0;border:0;background:none;display:inline;font:inherit;min-height:28px}.word:hover{color:#e946a2;text-decoration:underline}.listen{border:0;background:#eddcff;color:#8b47bd;border-radius:50%;min-width:44px;min-height:44px}.active,.wrong{background:#fff0a2!important;border-radius:15px}.quiz-options{display:grid;gap:16px}.quiz-choice{border:3px solid #e8d0f5;border-radius:24px;background:#fff;min-height:75px;padding:18px;font-weight:800;display:flex;align-items:center;gap:20px;text-align:left}.picture{font-size:34px;white-space:pre;line-height:1.2}.map-card{border:4px solid #fff;border-radius:35px;background:linear-gradient(#c4e6ff,#e1e0ff);overflow:hidden}.map-card svg{width:100%;display:block}.asia-lit{fill:#fff18b;filter:drop-shadow(0 0 10px #fff36c);transition:opacity 1s}.stage-path{display:flex;justify-content:space-between;align-items:center;background:#fff9;border-radius:26px;padding:24px;margin-top:20px;gap:18px}.stage-path h3{margin:4px 0}.coming{text-align:center;font-size:13px;margin:25px 0;color:var(--muted)}.game-layout{display:grid;grid-template-columns:minmax(0,1fr) 300px;gap:28px;align-items:start}.board-wrap{border:8px solid #e89d58;border-radius:25px;padding:22px;background:linear-gradient(135deg,#ffe2a0,#f7bf74);box-shadow:0 7px 0 #cc874e,0 12px 25px #a45f4b33}.board{display:grid;grid-template-columns:repeat(9,1fr);aspect-ratio:1}.board-cell{position:relative;padding:0;border:0;background:none;min-width:0;aspect-ratio:1}.board-cell:before,.board-cell:after{content:'';position:absolute;background:#ae744b80;pointer-events:none}.board-cell:before{height:2px;left:0;right:0;top:calc(50% - 1px)}.board-cell:after{width:2px;top:0;bottom:0;left:calc(50% - 1px)}.board-cell.left:before{left:50%}.board-cell.right:before{right:50%}.board-cell.top:after{top:50%}.board-cell.bottom:after{bottom:50%}.stone{position:absolute;inset:5%;border-radius:50%;z-index:2;box-shadow:1px 3px 4px #8b5e5655;pointer-events:none}.white{background:radial-gradient(circle at 32% 23%,#fff 10%,#fff9f8 38%,#dccdf1 80%,#bca5d8);border:2px solid #fff;box-shadow:0 0 9px #fff9,inset -3px -4px 4px #ab9bc144}.black{background:radial-gradient(circle at 35% 25%,#54465f,#211b2d 70%);color:white}.critter{border-radius:43% 47% 42% 49%;box-shadow:0 0 0 2px #382d43,0 0 0 4px #382d4355;animation:fluff var(--glance) ease-in-out var(--delay) infinite}.eyes{position:absolute;top:32%;left:19%;width:65%;height:35%;display:flex;gap:10%;animation:blink var(--blink) var(--delay) infinite}.eyes i{display:block;width:45%;height:100%;background:#fff;border-radius:50%;position:relative}.eyes i:after{content:'';background:#242032;width:42%;height:55%;border-radius:50%;position:absolute;left:28%;top:25%;animation:glance var(--glance) var(--delay) infinite}.sweat{display:none;position:absolute;right:-13%;top:-20%;font-size:20px}.nervous{animation:nervous .5s infinite}.nervous .sweat{display:block}.last:after{content:'';position:absolute;width:14%;height:14%;bottom:10%;left:43%;border-radius:50%;background:#ff93cb}.dead{opacity:.3}.starpoint{width:7px;height:7px;background:#a86e47;position:absolute;left:calc(50% - 3px);top:calc(50% - 3px);border-radius:50%}.territory{position:absolute;inset:36%;background:#4d3a5f;z-index:1}.territory.white{background:white;border:0;border-radius:0}.board-note{text-align:center;font-size:12px;margin-top:16px}.player-card{display:flex;align-items:center;gap:10px;background:#fff8;border:3px solid transparent;border-radius:20px;padding:12px;margin:10px 0;font-size:14px}.current{border-color:#c57af1;background:#fff}.player-disc{display:inline-block;min-width:36px;height:36px;border-radius:50%;text-align:center;line-height:36px}.turn-status{text-align:center;font-weight:900;padding:15px}.game-controls{display:flex;gap:10px;margin:10px 0}.game-controls button{flex:1}.boss-mini{display:flex;align-items:center;justify-content:center;gap:10px}.boss-mini img{height:130px;max-width:150px;object-fit:contain}.light-meter{height:40px;position:relative;border:3px solid #fff;border-radius:24px;background:#d8c1ee;overflow:hidden;box-shadow:0 3px 0 #bd95d4}.light-meter>span{position:absolute;height:100%;background:linear-gradient(#fff7a8,#ffc755);transition:width .6s}.light-meter b{position:relative;display:block;text-align:center;line-height:34px}.full-light{box-shadow:0 0 20px #ffda41;animation:celebrate 1s ease-in-out 2}.hint-button{width:100%;flex-wrap:wrap;padding:8px;gap:5px;font-size:18px}.hint-button img{width:45px;height:45px}.hint-button small{width:100%;letter-spacing:4px;font-size:12px}#hint-offer{display:flex;align-items:center;margin-top:15px}#hint-offer img{width:65px;height:65px}.hint-target{outline:4px solid #ffde60}.hint-move{border-radius:50%;box-shadow:inset 0 0 0 5px #fff,0 0 20px 8px #ffe456;z-index:4;animation:celebrate 1s infinite}.score-box{padding:20px;text-align:center;font-weight:900;font-size:22px}.particle{position:fixed;width:12px;height:12px;border-radius:30% 70%;z-index:9999;pointer-events:none;animation:burst .9s ease-out forwards}#toast{position:fixed;bottom:25px;left:50%;transform:translate(-50%,20px);background:#75459a;color:white;padding:12px 25px;border-radius:20px;opacity:0;pointer-events:none;z-index:10000;text-align:center;max-width:90vw;font-weight:900}#toast.visible{opacity:1;transform:translate(-50%,0)}dialog{border:4px solid #fff;border-radius:30px;max-width:min(560px,92vw);width:560px;max-height:90vh;padding:32px;background:#fff4fb;color:var(--ink);text-align:center;box-shadow:0 20px 90px #6a248e66}dialog::backdrop{background:#58257988;backdrop-filter:blur(5px)}.modal-close{position:absolute;right:10px;top:8px;border:0;border-radius:50%;background:#f4d6ef;width:42px;height:42px;font-size:24px}.transformation{position:relative;height:300px}.transformation img{position:absolute;inset:0;width:100%;height:100%;object-fit:contain}.corrupted-form{animation:dissolve 1.2s both}.rescued-form{animation:rescue 1.8s both}.cape-shards{position:absolute;inset:0;z-index:2;pointer-events:none}.cape-shards i{position:absolute;left:50%;top:55%;width:13px;height:20px;background:linear-gradient(#8a50bf,#fff5a4);border-radius:3px;transform:rotate(var(--a));animation:shatter 1.4s both}.tutorial{text-align:center}#tree{font-size:75px}.tree-saved{filter:drop-shadow(0 0 15px #ffda45);animation:celebrate 1s 2}.mini-board{display:grid;grid-template-columns:repeat(3,60px);justify-content:center;gap:5px;margin:15px auto}.mini-board>*{width:60px;height:60px;display:grid;place-items:center;font-size:34px}.mini-board button{border:3px solid #d5aeed;border-radius:50%;background:#fff8}.mini-critter{background:#302638;color:#fff;border-radius:45%}#tutorial-next[hidden]{display:none}@keyframes blink{0%,44%,48%,100%{transform:scaleY(1)}46%{transform:scaleY(.08)}}@keyframes glance{0%,30%,100%{transform:translateX(0)}40%,55%{transform:translateX(-35%)}70%,85%{transform:translateX(35%)}}@keyframes fluff{0%,85%,100%{transform:rotate(0) scale(1)}90%{transform:rotate(-6deg) scale(1.07)}95%{transform:rotate(6deg)}}@keyframes nervous{25%{transform:rotate(-4deg)}75%{transform:rotate(4deg)}}@keyframes float{50%{transform:translateY(-18px) rotate(10deg)}}@keyframes burst{to{transform:translate(var(--dx),var(--dy)) rotate(180deg) scale(.2);opacity:0}}@keyframes celebrate{50%{filter:brightness(1.2);transform:scale(1.03)}}@keyframes dissolve{0%,20%{opacity:1}100%{opacity:0;transform:scale(1.12);filter:brightness(3)}}@keyframes rescue{0%,45%{opacity:0;transform:scale(.8)}100%{opacity:1;transform:scale(1)}}@keyframes shatter{0%,20%{opacity:0}30%{opacity:1}100%{opacity:0;transform:rotate(var(--a)) translateY(var(--d)) scale(.2)}}@media(max-width:850px){.home-layout{gap:10px}.hero-scene{height:430px}.game-layout{grid-template-columns:minmax(0,1fr) 240px;gap:18px}.board-wrap{padding:15px}.game-sidebar .boss-mini img{height:95px}.story-layout{grid-template-columns:.7fr 1.3fr;gap:18px}.panel{padding:20px}.story-text{font-size:18px}}@media(max-width:650px){.topbar{padding:12px}.brand{font-size:13px}.brand small{display:none}.icon-button{padding:8px 12px}#app{padding:10px 15px 30px}.home-layout{display:flex;flex-direction:column;min-height:0}.home-copy{width:100%}.logo{max-height:240px;object-fit:cover}.home-actions{margin:22px auto;width:100%;gap:15px}.hero-scene{width:100%;height:320px;max-width:400px}.candy{min-height:64px;font-size:19px}.menu-icon{font-size:32px}.story-layout,.game-layout{grid-template-columns:1fr}.boss-card img{max-height:230px}.boss-card h3{font-size:18px;margin:0 0 12px}.story-text{font-size:18px}.form-grid{grid-template-columns:1fr;gap:0}.avatar{width:65px;height:70px;font-size:37px}.options-row{gap:8px}.screen-heading{gap:10px}.screen-heading h2{font-size:25px}.game-sidebar{display:grid;grid-template-columns:1fr 1fr;gap:8px}.boss-mini,.light-meter,.turn-status,.game-controls,.hint-button,#hint-offer,.score-box,#finish{grid-column:1/-1}.boss-mini{display:none}.player-card{margin:0;padding:9px;font-size:12px;gap:6px}.player-disc{min-width:27px;height:27px;line-height:27px}.board-wrap{padding:12px;border-width:6px}.board-note{margin-bottom:0}.stage-path{padding:18px}.stage-path h3{font-size:20px}.picture{font-size:28px}.quiz-choice{padding:12px}.companion img{width:80px;height:80px}dialog{padding:30px 20px}.transformation{height:260px}}@media(prefers-reduced-motion:reduce){*,*:before,*:after{animation:none!important;transition:none!important;scroll-behavior:auto!important}.corrupted-form,.cape-shards{display:none}.rescued-form{opacity:1}}
.hero-scene{display:flex;align-items:center}.trio-card{width:100%;border:4px solid #fff;border-radius:32px;box-shadow:0 15px 40px #b76ac533}.hero-scene .pebble{width:38%;bottom:0;right:4%;filter:drop-shadow(0 8px 15px #b286d244)}
.hint-move{animation:hint-glow 1s infinite}@keyframes hint-glow{50%{filter:brightness(1.15);box-shadow:inset 0 0 0 5px #fff,0 0 24px 10px #ffe456}}
.critter:before{content:'';position:absolute;inset:-9%;background:#302638;z-index:-1;clip-path:polygon(50% 0,56% 8%,64% 2%,68% 12%,78% 9%,79% 21%,91% 22%,87% 33%,98% 38%,91% 47%,100% 54%,90% 61%,94% 72%,82% 75%,82% 87%,70% 85%,65% 97%,55% 91%,47% 100%,41% 90%,29% 96%,27% 83%,15% 84%,17% 72%,5% 68%,12% 57%,0 50%,10% 43%,3% 32%,15% 29%,12% 17%,25% 19%,29% 7%,40% 12%,43% 2%)}

.capture-fx{position:fixed;z-index:9999;pointer-events:none;width:10px;height:10px;contain:layout style;box-shadow:0 0 8px currentColor}
.capture-fx[hidden]{display:none}
.capture-spark{clip-path:polygon(50% 0,62% 36%,100% 50%,62% 64%,50% 100%,38% 64%,0 50%,38% 36%)}
.capture-shard{width:9px;height:19px;clip-path:polygon(50% 0,100% 40%,65% 100%,0 70%)}
.capture-ray{width:65px;height:4px;border-radius:50%}
.capture-glow{width:64px;height:64px;border-radius:50%;box-shadow:0 0 22px 8px currentColor}
/* v2.1 cinematic storybook */
body{background:#ded0ee url('assets/art/gen/home-bg.png') center/cover fixed no-repeat}.character,.boss-mini img,.transformation img{border:0;border-radius:0;background:none;filter:drop-shadow(0 10px 14px #42205d55);object-fit:contain}.home-scene{position:relative;min-height:calc(100svh - 125px);display:flex;flex-direction:column;justify-content:center;isolation:isolate}.home-scene:before{content:'';position:fixed;inset:0;z-index:-1;pointer-events:none;background:radial-gradient(ellipse,transparent 40%,#26103988);animation:mist-drift 13s alternate infinite}.home-composition{position:relative;width:min(800px,88vw);margin:auto;isolation:isolate;background:radial-gradient(ellipse,#fff4be70,transparent 65%)}.home-hero{width:100%;max-height:65svh;animation:hero-idle 5s ease-in-out infinite}.contact-shadow{position:absolute;bottom:4%;left:20%;width:60%;height:6%;border-radius:50%;background:#3f28564d;filter:blur(14px);z-index:-1}.home-actions{display:flex;justify-content:center;gap:20px;max-width:none;margin:15px 0 25px;z-index:4}.scene-particles{position:absolute;inset:15% 2%;color:#ffe6fc;font-size:clamp(25px,5vw,60px);pointer-events:none;animation:petal-drift 12s ease-in-out infinite;z-index:2;white-space:nowrap}.behind{z-index:-1;opacity:.5}.front{z-index:3;animation-delay:-6s;top:45%}.options-row{gap:8px}.avatar{width:110px;height:auto;padding:8px;border:0;border-radius:0;background:radial-gradient(ellipse,#eacbfa88,transparent 70%);font-size:16px;min-height:190px}.avatar img{width:95px;height:130px}.avatar.selected{border:0;box-shadow:none;filter:drop-shadow(0 0 10px #ffda60);animation:hero-idle 2s infinite}.avatar small{font-size:13px}.player-card .character{width:48px;height:60px}.victory-hero,.victory-pebble{width:90px;height:100px}.locked-stages{display:flex;justify-content:center;gap:10px;margin-top:20px}.locked-stages>div{width:24%;text-align:center}.locked-stages img{width:100%;height:130px;filter:grayscale(1) brightness(.6) drop-shadow(0 6px 10px #55227755)}.locked-stages strong{display:block;font-size:14px}.settings-dropdown{position:fixed;z-index:1000;right:18px;top:80px;width:min(380px,calc(100vw - 30px));max-height:calc(100svh - 95px);overflow:auto;padding:24px;background:#fff8f5f5;border-radius:24px;box-shadow:0 12px 40px #3d185c55;animation:menu-pop .18s ease-out}.settings-dropdown .field{margin:12px 0}.settings-dropdown .check-label{margin:12px 0}.settings-dropdown button{margin:5px}.settings-dropdown small{margin-top:15px}#app.book-host{max-width:none;padding:0;margin:0}.book-page{position:relative;min-height:calc(100svh - 86px);overflow:hidden;isolation:isolate;background:linear-gradient(145deg,#a08acd,#f6cce7,#fff2cc);box-shadow:inset 0 0 35px #41204e44;animation:page-turn .55s ease-out}.page-art{position:absolute;inset:0;width:100%;height:100%;object-fit:cover;object-position:var(--focal,50% 45%);z-index:-3;animation:ken-burns 24s ease-out both}.pan-left .page-art{animation-direction:reverse}.book-page:after{content:'';position:absolute;inset:0;pointer-events:none;box-shadow:inset 0 0 35px #39245266;z-index:5}.page-copy{position:relative;z-index:3;padding:45svh max(6vw,24px) 100px;background:linear-gradient(transparent 30%,#fff5e3d9 72%,#fff5e3f2);min-height:calc(100svh - 86px);display:flex;flex-direction:column;justify-content:flex-end}.page-copy h1{font-size:clamp(30px,5vw,62px);line-height:1.2;text-shadow:0 0 22px #fff8c8}.page-copy h1 small{font-size:clamp(20px,3vw,32px);margin-top:12px}.page-copy .sentence{font-size:clamp(21px,2.4vw,32px);line-height:1.55;margin:0;padding:5px 0;text-shadow:0 1px 6px #fff}.narration-controls{display:flex;gap:12px;margin-top:15px}.book-nav{position:absolute;bottom:14px;left:4%;right:4%;display:flex;align-items:center;gap:15px;z-index:8}.page-dots{display:flex;justify-content:center;flex-wrap:wrap;gap:6px;flex:1}.page-dots i{width:7px;height:7px;border-radius:50%;background:#9d76b8}.page-dots i.on{background:#fff;box-shadow:0 0 5px #813fba}.skip{font-size:12px}.hero-overlay{position:absolute;transform:translate(-50%,-100%);z-index:-1;max-width:320px;filter:sepia(.08) saturate(.9)}.hero-overlay:after{content:'';position:absolute;bottom:0;left:15%;width:70%;height:6%;background:#4d345b66;filter:blur(9px);border-radius:50%;z-index:-1}.hero-overlay img{width:100%;max-height:55svh}.fallback-companion{position:absolute;left:45%;top:15%;width:25%;height:40%}.reading{color:#9a287c;background:#fff4a3;border-radius:5px}.reading-sentence,.clue-highlight{filter:drop-shadow(0 0 5px #fff59b)}.clue-highlight{text-decoration:underline;text-decoration-color:#efaf36}.book-page:has(#book-quiz) .page-copy{padding-top:20vh}.book-page .quiz-choice{background:#fff8;border:0;box-shadow:0 0 25px #fff7}.alive-book{background:linear-gradient(transparent,#fff3dfb0);max-width:1200px}.tutorial.panel,.boss-mini,.player-card{background:transparent;border:0;box-shadow:none}.tutorial .companion .character{height:100px;width:90px}.stone.white:before,.brand-stone:before{content:none!important}.transformation:before{content:'';position:absolute;inset:10%;background:radial-gradient(circle,#fff9a3,transparent 65%);animation:rescue 1.8s both}.rescued-form{animation:rescue-bounce 1.8s both}@keyframes rescue-bounce{0%,45%{opacity:0;transform:scale(.3)}70%{opacity:1;transform:scale(1.12)}85%{transform:scale(.95)}100%{transform:scale(1)}}@keyframes hero-idle{50%{transform:translateY(-3px) scale(1.008)}}@keyframes mist-drift{to{opacity:.7;transform:scale(1.08)}}@keyframes petal-drift{50%{transform:translate(3%,22px);opacity:.6}}@keyframes ken-burns{from{transform:scale(1.02) translateX(-.5%)}to{transform:scale(1.1) translateX(1%)}}@keyframes page-turn{from{opacity:.1;transform:perspective(1600px) rotateY(-7deg) translateX(3%)}to{opacity:1;transform:none}}@keyframes menu-pop{from{opacity:0;transform:translateY(-8px) scale(.95)}to{opacity:1;transform:none}}.reduce-motion *,.reduce-motion *:before,.reduce-motion *:after{animation:none!important;transition:none!important}.reduce-motion .corrupted-form,.reduce-motion .cape-shards{display:none}.reduce-motion .rescued-form{opacity:1}.reduce-motion .book-page{animation:crossfade .2s!important}@keyframes crossfade{from{opacity:0}to{opacity:1}}@media(prefers-reduced-motion:reduce){.book-page{animation:crossfade .2s!important}}@media(max-width:650px){.home-actions{flex-direction:column;width:90%;margin:5px auto 25px;gap:13px}.home-composition{width:100%;margin:0 auto}.home-hero{max-height:45svh}.home-scene{justify-content:flex-start}.page-copy{padding:42svh 22px 100px}.page-copy .sentence{font-size:21px}.book-nav{gap:8px}.locked-stages img{height:95px}.avatar{width:95px}.game-sidebar .boss-mini{display:flex}.settings-dropdown{top:70px}.hero-overlay{max-width:180px}}
.story-pebble{position:absolute;width:45%!important;left:75%;bottom:0}.stage-path>.character{height:140px;width:120px}.tutorial-book{min-height:calc(100svh - 100px);background:linear-gradient(transparent,#fff3dfd9)}.tutorial-book .center-screen{max-width:900px}.tutorial-book .panel{border:0;border-radius:0;background:linear-gradient(transparent,#fff6e9bb);box-shadow:none}.tutorial-book .companion{flex-wrap:wrap}.tutorial-book .companion p{flex-basis:100%}.alive-book .game-sidebar{background:radial-gradient(ellipse,#fff5e8c9,transparent 75%)}

/* Keep long read-aloud passages inside the full-bleed scene. */
.book-page{height:calc(100svh - 86px);min-height:0}
.page-copy{position:absolute;inset:auto 0 76px;min-height:0;max-height:54%;overflow-y:auto;padding:24px max(6vw,24px) 12px;display:block;background:linear-gradient(#fff5e3d9,#fff5e3f5);scrollbar-gutter:stable;border-radius:22px 22px 0 0}
.page-copy .sentence{font-size:clamp(19px,2vw,25px);line-height:1.45;padding:4px 0}
.book-page:has(h1) .page-copy{max-height:70%}
.book-page:has(#book-quiz) .page-copy{max-height:85%;padding-top:20px}
@media(max-width:650px){.page-copy{padding:16px 20px;max-height:58%}.page-copy .sentence{font-size:20px}}

/* v2.1c: local rounded fonts, including Traditional Chinese on every device. */
@font-face{font-family:Fredoka;src:url('assets/fonts/Fredoka.woff2') format('woff2');font-weight:300 700;font-style:normal;font-display:swap}
@font-face{font-family:Huninn;src:url('assets/fonts/Huninn.woff2') format('woff2');font-weight:400;font-style:normal;font-display:swap}
@font-face{font-family:'Zen Maru Gothic';src:url('assets/fonts/ZenMaruGothic.woff2') format('woff2');font-weight:400;font-style:normal;font-display:swap}
:root{--game-font:Fredoka,Huninn,'Zen Maru Gothic',sans-serif}
body,input,select,button{font-family:var(--game-font)}
h1,h2,h3,button,label,.badge,.turn-status,.score-box{font-weight:600}
.page-copy .sentence,.story-text{font-family:var(--game-font);font-weight:400;line-height:1.6}
/* Inline glossary words and Go intersections retain their text/board geometry. */
button:is(.quiet,.back,.brand,.icon-button,.listen,.modal-close),
button:where(:not(.word):not(.board-cell):not(.avatar):not(.mini-board button)){
 border:2px solid #fffbdc;border-radius:20px;
 background:linear-gradient(180deg,#bf8bf7,#8651d2);
 color:#fff;text-shadow:0 1px 0 #64308c,1px 0 #64308c,-1px 0 #64308c,0 -1px #64308c;
 box-shadow:0 5px 0 #633394,0 8px 14px #54227530,inset 0 2px 0 #fff7;
 min-height:48px;min-width:48px;padding:10px 16px;
 transition:transform .14s ease,box-shadow .14s ease;
 overflow-wrap:anywhere;
}
button.candy{background:linear-gradient(#ff9bd6,#ed4c9d);box-shadow:0 6px 0 #ad286f,0 9px 18px #7f285333,inset 0 3px 0 #fff9;min-height:64px;padding:15px 25px;font-size:20px}
button.blue{background:linear-gradient(#b89aff,#8053dc)}
button.pink{background:linear-gradient(#ffbb79,#e57d3d)}
button.quiz-choice,.book-page button.quiz-choice{background:linear-gradient(#c393f4,#8c55c9);min-height:75px}
button:not(.word):not(.board-cell):not(.avatar):not(.mini-board button):not(:disabled):active{transform:translateY(4px) scale(.97);box-shadow:0 1px 0 #633394,inset 0 2px 0 #fff7}
button:disabled{transform:none}
button.wrong{color:#592b82;text-shadow:none}
button.brand .brand-stone{color:#ffe8a4}
button.modal-close{padding:0;top:10px;right:10px}
button small{color:inherit}
.narration-controls{flex-wrap:wrap}
.screen-heading>*{min-width:0}
@media(prefers-reduced-motion:reduce){button:not(.word):not(.board-cell):active{transform:none!important}}
.reduce-motion button:not(.word):not(.board-cell):active{transform:none!important}

.boss-dialogue{grid-column:1/-1;margin:0 0 12px;text-align:center;color:#582c83;font-weight:700}

/* v2.1f: light returns to the bridge as captures fill the meter. */
body.battle-scene{background:#21132f;isolation:isolate;color:#fff1db}
.battle-scene:before,.battle-scene:after{content:'';position:fixed;inset:0;pointer-events:none;z-index:-2}
.battle-scene:before{background:var(--battle-landscape) center/cover no-repeat}
.battle-scene:after{z-index:-1;background:#130c26;opacity:var(--battle-darkness,.6);transition:opacity 1.2s ease}
.battle-scene #app.alive-book{background:none;max-width:1120px}
.battle-scene .screen-heading h2{text-shadow:0 2px 8px #130b22}
.battle-scene .game-layout{grid-template-columns:minmax(0,620px) minmax(230px,300px);justify-content:center;gap:36px}
.battle-scene .board-wrap{border:7px solid #77608f;background:linear-gradient(135deg,#382a40,#231c30);box-shadow:inset 0 0 22px #0c071a,0 0 0 2px #c7a3ff,0 0 26px #b47cff88,0 16px 35px #08041299;padding:20px}
.battle-scene .board-cell:before,.battle-scene .board-cell:after{background:#c1a3d1}
.battle-scene .starpoint{background:#f2d6ff}
.battle-scene .stone.white{background:radial-gradient(circle at 35% 25%,#fff 30%,#fff8dc 65%,#e4cfff);box-shadow:0 0 10px #fff,0 0 18px #edc9ff99;border:2px solid #fff}
.battle-scene .stone.black{box-shadow:0 0 0 2px #bda4dc,0 0 7px #cfa4f499; background:radial-gradient(circle at 35% 25%,#584466,#171122 75%)}
.battle-scene .board-note{font-size:15px;color:#fff3df;text-shadow:0 2px 4px #000;background:#1c102bd9;border-radius:14px;padding:7px}
.battle-scene .game-sidebar{background:#21132fe8;border:1px solid #b995d899;border-radius:28px;padding:16px;box-shadow:0 10px 30px #12081e66}
.battle-scene .boss-mini{display:flex;flex-direction:column;gap:0}
.battle-scene .boss-mini img{height:190px;max-width:240px;filter:drop-shadow(0 0 16px #a45eef88);animation:boss-breathe 4s ease-in-out infinite}
.battle-scene .boss-mini strong{display:none}
.battle-scene .boss-dialogue{color:#fff0d8;font-size:18px;line-height:1.35;margin:8px 0 16px}
.battle-scene .player-card{padding:6px;margin:8px 0;color:#fff1df}
.battle-scene .player-card.current{background:#5f4176;border-radius:16px}
.battle-scene .light-meter{color:#38204e;background:#d9c9eb}
.battle-scene .turn-status{padding:8px}
.battle-scene .boss-react img{animation:boss-capture .8s ease-out}
.mist-flash{position:fixed;inset:0;pointer-events:none;z-index:5;background:radial-gradient(circle at var(--flash-x) var(--flash-y),#fff4b5aa,#d2a1ff55 28%,transparent 65%)}
@keyframes boss-breathe{50%{transform:translateY(-4px) rotate(-2deg)}}
@keyframes boss-capture{25%{transform:translateX(9px) rotate(6deg);filter:brightness(1.5)}60%{transform:translateX(-4px) rotate(-3deg)}}
@media(max-width:900px){.battle-scene .game-layout{grid-template-columns:minmax(0,1fr) 230px;gap:20px}.battle-scene .board-wrap{padding:14px}.battle-scene .boss-mini img{height:160px}}
@media(orientation:portrait){.battle-scene:before{background-image:var(--battle-portrait)}}
@media(min-width:651px) and (orientation:portrait){.battle-scene .game-layout{grid-template-columns:minmax(0,1fr);max-width:620px;margin:auto;gap:14px}.battle-scene .game-sidebar{display:grid;grid-template-columns:160px 1fr;gap:8px 18px}.battle-scene .boss-mini{grid-column:1;grid-row:1/4}.battle-scene .boss-mini img{height:160px;max-width:160px}.battle-scene .boss-dialogue{grid-column:2;font-size:17px}.battle-scene .player-card{display:none}.battle-scene .game-controls{margin:0}.battle-scene .hint-button{grid-column:2;min-height:56px;padding:6px}.battle-scene #hint-offer{grid-column:1/-1;margin:0}.battle-scene .turn-status{grid-column:2}.battle-scene .board-note{margin:8px 0 0}}
@media(max-width:650px){.battle-scene .game-layout{grid-template-columns:1fr;gap:14px}.battle-scene .board-wrap{padding:10px}.battle-scene .game-sidebar{padding:12px}.battle-scene .boss-mini{flex-direction:row}.battle-scene .boss-mini img{height:120px}.battle-scene .player-card{display:none}.battle-scene .boss-dialogue{font-size:17px}}
@media(prefers-reduced-motion:reduce){.battle-scene .boss-mini img{animation:none}.mist-flash{display:none}}
.reduce-motion .mist-flash{display:none}
@media(min-width:901px){.battle-scene .game-layout{grid-template-columns:minmax(0,560px) minmax(230px,300px)}.battle-scene .boss-mini img{height:160px}.battle-scene .player-card .character{height:44px;width:38px}.battle-scene .player-card{margin:5px 0}.battle-scene #hint-offer{margin-top:8px}}
@media(min-width:651px) and (orientation:portrait){.battle-scene .game-layout{max-width:540px}.battle-scene .board-wrap{max-width:490px;width:100%;margin:auto}.battle-scene .game-sidebar{grid-template-columns:140px 1fr;gap:6px 12px;padding:12px}.battle-scene .boss-mini img{height:140px;max-width:140px}.battle-scene .light-meter{grid-column:2}.battle-scene .game-controls{grid-column:1;grid-row:4}.battle-scene .hint-button{grid-row:4}.battle-scene .hint-button small{width:auto}.battle-scene .boss-dialogue{margin:0}.battle-scene .turn-status{padding:4px}}
@media(min-width:651px) and (orientation:portrait){.battle-scene .game-sidebar{grid-template-columns:200px 1fr}.battle-scene .game-controls button{padding:10px 8px;white-space:nowrap}.battle-scene .hint-button{gap:5px}.battle-scene .hint-button small{font-size:10px;letter-spacing:2px}}
/* v2.1g: compact, sentence-paced text leaves the illustration visible. */
.book-page .page-copy{inset:auto 0 68px;max-height:none;min-height:0;padding:10px max(6vw,24px) 8px;border-radius:0;overflow:visible;scrollbar-gutter:auto;background:linear-gradient(transparent,#fff5e3b8 20%,#fff5e3d9);}
.book-page .page-copy .sentence{font-size:20px;line-height:1.45;padding:0;margin:0;}
.book-page .narration-controls{position:absolute;right:12px;bottom:calc(100% + 8px);margin:0;gap:6px;}
.book-page .narration-controls .quiet{font-size:14px;padding:5px 10px;min-height:44px;background:#fff9;}
.book-page .art-toggle{position:absolute;right:12px;top:12px;z-index:9;font-size:14px;}
.book-page .text-hidden{display:none;}
.book-page:has(h1) .page-copy,.book-page:has(#book-quiz) .page-copy{max-height:75%;padding:20px max(6vw,24px);overflow:auto;background:#fff5e3d9;}
.chunk-count{font-size:13px;white-space:nowrap;}
@media(max-width:650px){.book-page .page-copy{padding:10px 20px;}.book-page .page-copy .sentence{font-size:18px;line-height:1.45;}.page-dots{display:none;}}
.book-page .page-copy .word{min-height:0;line-height:inherit;vertical-align:baseline;}
.quiz-choice .picture img{width:90px;height:58px;object-fit:cover;border-radius:12px;display:block;margin:0 auto 6px}
.capture-bloom,.capture-ring,.capture-anticipation,.capture-godray{position:fixed;pointer-events:none;z-index:110;transform:translate(-50%,-50%)}
.capture-bloom{width:120px;height:120px;border-radius:50%;background:radial-gradient(circle,#fff 0%,#fffbd5 15%,#ffd96799 35%,transparent 70%);mix-blend-mode:screen;filter:drop-shadow(0 0 20px #ffe68a)}
.capture-ring{width:24px;height:24px;border:3px solid #fff2b1;border-radius:50%;box-shadow:0 0 14px #ffd85c}
.capture-anticipation{width:30px;height:30px;background:#17132c;border-radius:50%;box-shadow:inset 0 0 5px #8d65a9;color:white;text-align:center;font-size:15px;line-height:26px}
.capture-godray{width:150px;height:150px;background:repeating-conic-gradient(from 0deg,#fff8c977 0deg 6deg,transparent 6deg 30deg);mask-image:radial-gradient(circle,#000 5%,transparent 70%);mix-blend-mode:screen}

.episode-progress{display:flex;flex-wrap:wrap;gap:12px;list-style:none;padding:16px;background:#ffffff80;border-radius:18px}.episode-progress li{padding:8px;border-radius:12px;background:#fff8}.battle-scene #episode-restart{margin-top:16px}.battle-scene #episode-result{width:100%}

/* Shared story and Free Play showdown scenery. */
.scene-picker{border:0;padding:0;margin:0 0 16px;min-width:0}.scene-picker legend{font-weight:bold;margin-bottom:10px}.scene-options{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:8px}.scene-option{position:relative;padding:0;border:3px solid transparent;border-radius:14px;overflow:hidden;background:#312344;color:white;min-height:90px;cursor:pointer}.scene-option img{width:100%;height:74px;object-fit:cover;display:block}.scene-option span{display:block;font-size:12px;padding:6px}.scene-option[aria-pressed=true]{border-color:#9c65d6;box-shadow:0 0 0 2px #fff}.random-scene{font-size:30px}.quest-prince{height:150px;max-width:160px;object-fit:contain}.battle-scene .game-layout{position:relative}.battle-scene .game-layout:before{content:'';position:fixed;inset:0;pointer-events:none;background:radial-gradient(ellipse at 15% 80%,#bd96ec22,transparent 60%),linear-gradient(100deg,transparent,#bc9bd51c,transparent);z-index:-1;animation:showdown-mist 15s ease-in-out infinite alternate}@keyframes showdown-mist{to{transform:translateX(3%);opacity:.5}}.reduce-motion .game-layout:before{animation:none}@media(prefers-reduced-motion:reduce){.battle-scene .game-layout:before{animation:none}}

.light-stone-collection {padding:.6rem 1rem;border-radius:18px;background:#fff8e8;color:#593782;text-align:center;box-shadow:0 2px 10px #6d459322;max-width:100%;}
.light-stone-collection small {display:block;font-size:.75rem;}
.collection-stone {display:inline-block;margin:0 .35rem;color:#b8aec4;font-size:1.5rem;}
.collection-stone.collected {color:#b7790d;text-shadow:0 0 10px #ffd766;}
.transform-stone {position:absolute;z-index:4;left:46%;top:37%;width:30px;height:35px;border-radius:50%;background:#171020;color:#171020;animation:stone-to-light 2.8s forwards;}
@keyframes stone-to-light {0%,25%{background:#171020;color:#171020;box-shadow:0 0 16px #542272;}65%,100%{background:#fff8cc;color:#fff;box-shadow:0 0 24px 12px #ffe183;transform:translate(-30px,35px);}}
@media(prefers-reduced-motion:reduce){.transform-stone{animation:none;background:#fff8cc;color:#fff;box-shadow:0 0 20px #ffe183;}}
.reduce-motion .transform-stone{animation:none;background:#fff8cc;color:#fff;box-shadow:0 0 20px #ffe183;}
/* v2.1m book navigation */
.book-nav #prev-page,.book-nav #next-page{min-height:48px;padding:8px 14px;font-size:16px;gap:5px}.previous-game{margin:8px 0 18px}.book-page.turn-back{animation-name:page-turn-back}.save-candy{text-align:center;padding:15px}.save-candy .menu-options{display:grid;gap:18px}@keyframes page-turn-back{from{opacity:.1;transform:perspective(1600px) rotateY(7deg) translateX(-3%)}to{opacity:1;transform:none}}@media(max-width:650px){.book-nav .page-dots{display:none}.book-nav #prev-page{font-size:13px;padding:6px 9px}}
/* Illustrated journey: full art retained in either orientation. */
.world-map-page{text-align:center;max-width:1000px;margin:auto}.world-map-page h2{margin-bottom:6px}.world-map-page .light-stone-collection{margin:4px auto 10px}.illustrated-map{position:relative;width:100%;aspect-ratio:8/5;isolation:isolate;overflow:hidden;border-radius:46% 8% 40% 8% / 6% 42% 7% 40%;box-shadow:0 0 24px #fff4c7}.illustrated-map>img{width:100%;height:100%;object-fit:fill;display:block}.continent-light{position:absolute;inset:0;width:100%;height:100%;mix-blend-mode:screen}.land-light{fill:#ffe7a4;filter:url(#sun-glow);opacity:.78;animation:land-dawn 2.8s ease-out both}.map-label{position:absolute;font-weight:bold;font-size:clamp(11px,1.6vw,19px);text-shadow:0 0 6px white,0 0 8px white}.asia-label{left:69%;top:28%}.cottage-label{left:79%;top:49%;font-size:clamp(9px,1.2vw,14px)}.light-boat{position:absolute;left:72%;top:44%;font-size:clamp(20px,3vw,38px);filter:drop-shadow(0 0 7px #fff7ac)}.start .light-boat{animation:boat-depart 3s ease-in-out both}.victory .light-boat{left:57%;top:53%;animation:boat-onward 3s ease-in-out both}.route-teaser{position:absolute;left:42%;top:53%;color:#fff5a5;text-shadow:0 0 7px #9760a9;font-size:28px;animation:land-dawn 3s both}.route-teaser small{color:#533771;background:#fff9d9cc;border-radius:20px;padding:2px 9px}.map-navigation{display:flex;justify-content:space-between;gap:16px;margin:16px auto}.journey-panel{display:block;width:min(480px,100%);border:0;color:var(--ink);padding:12px 20px;background:radial-gradient(ellipse,#fff5dff5 50%,#fff5df88 70%,transparent 73%);text-align:center;filter:drop-shadow(0 5px 12px #744e7a22)}.journey-panel .illustrated-map{margin:5px auto;width:100%;max-height:230px}.journey-panel strong{font-size:21px}.journey-details{font-weight:bold}.journey-stones{display:block}.journey-stones>span{color:#a47825}.rescue-portraits{display:flex;justify-content:center;gap:12px;height:48px;margin:4px}.rescue-portraits img{width:42px;object-fit:contain}.rescue-portraits .locked{filter:brightness(.25) sepia(1) hue-rotate(220deg);opacity:.45}.home-scene:has(.journey-panel){display:grid;grid-template-columns:1fr 1fr;gap:12px;min-height:650px;align-items:center}.home-scene:has(.journey-panel) .home-composition{width:100%}.home-scene:has(.journey-panel) .home-actions{display:flex;flex-wrap:wrap;justify-content:center;gap:12px;width:100%;margin:0}.home-scene:has(.journey-panel) .journey-panel{flex-basis:100%}.home-scene:has(.journey-panel) .home-hero{max-height:560px}.world-map-page>.illustrated-map{max-height:470px;max-width:752px;margin:auto}.world-map-page>p{margin:12px auto}.world-map-page .map-navigation{max-width:752px}@keyframes boat-depart{from{left:87%;top:47%}to{left:72%;top:44%}}@keyframes boat-onward{from{left:72%;top:44%}to{left:57%;top:53%}}@keyframes land-dawn{from{opacity:0}to{opacity:.78}}@media(max-width:850px){.home-scene:has(.journey-panel){grid-template-columns:1fr;gap:0;min-height:0}.home-scene:has(.journey-panel) .home-hero{max-height:290px}.home-scene:has(.journey-panel) .home-composition{margin:0 auto}.home-scene:has(.journey-panel) .home-actions{margin:0 auto 20px}.journey-panel{width:560px}.journey-panel .illustrated-map{max-height:245px}.world-map-page>.illustrated-map{max-height:none}}@media(prefers-reduced-motion:reduce){.land-light,.light-boat,.route-teaser{animation:none!important}}
.continent-light{mix-blend-mode:normal}.land-light{filter:none;opacity:1}@keyframes land-dawn{from{opacity:0}to{opacity:1}}
.journey-panel{border:0!important;border-radius:48% 8% 44% 10% / 6% 44% 8% 42%!important;box-shadow:none!important;text-shadow:none!important}.journey-panel .illustrated-map{max-width:368px;max-height:none}.world-map-page>.illustrated-map{max-width:640px;max-height:none}.world-map-page>.light-stone-collection{padding:7px;background:radial-gradient(ellipse,#fff8df 55%,transparent 72%)}.world-map-page>p{font-size:16px}.world-map-page .map-navigation{margin-top:8px}.land-light{filter:blur(.45px)}@media(max-width:850px){.journey-panel .illustrated-map{max-width:392px}.world-map-page>.illustrated-map{max-width:100%}}
.victory .light-boat{left:65%;top:65%}.route-teaser{left:62%;top:73%}@keyframes boat-onward{from{left:72%;top:44%}to{left:65%;top:65%}}
.land-light{filter:none;opacity:.8}@keyframes land-dawn{from{opacity:0}to{opacity:.8}}

/* The same conjured light boat as the boarding illustration. */
.light-boat{width:clamp(45px,7vw,78px);line-height:0}.light-boat img{display:block;width:100%;height:auto}.journey-panel .light-boat{width:11%}

/* Restored land keeps the generated greens, blossoms and golden light intact. */
.land-light{opacity:1;filter:none}@keyframes land-dawn{from{opacity:0}to{opacity:1}}
/* Saved progress displays the completed restoration immediately. */
.home .land-light{animation:none}

/* v2.1s: artwork stays still while text accumulates in its own band. */
.book-page,.book-page.turn-back{animation:none}
.page-art,.pan-left .page-art{animation:none;transform:none}
.book-page.scene-turn{animation:page-turn .55s ease-out}
.book-page.scene-turn.turn-back{animation-name:page-turn-back}
.book-page .page-copy{height:auto;max-height:32svh;overflow-y:auto;display:block}
.book-page .narration-controls{position:static;justify-content:flex-end;margin-top:8px}
.reduce-motion .book-page{animation:none!important}
@media(prefers-reduced-motion:reduce){.book-page.scene-turn{animation:none!important}}
.book-page .page-copy.text-hidden{display:none}
/* Keep the hero selection target stationary; animate its artwork only. */
.avatar.selected{animation:none}
.avatar.selected img{animation:hero-idle 2s infinite}

/* v2.1v: home is a pin on the East Asia coast; departure shares its anchor. */
.home-pin{position:absolute;left:var(--home-x);top:var(--home-y);width:5%;transform:translate(-50%,-100%);filter:drop-shadow(0 2px 2px #77515a66)}
.home-pin svg{display:block;width:100%}
.cottage-label{left:69%;top:43%;font-size:clamp(9px,1.2vw,14px)}
.departure-route{position:absolute;inset:0;width:100%;height:100%;pointer-events:none}
.departure-route path{fill:none;stroke:#fff4b4;stroke-width:.55;stroke-dasharray:1 1;filter:drop-shadow(0 0 1px #a67543)}
.victory .departure-route{display:none}
.light-boat,.start .light-boat{left:var(--japan-x);top:var(--japan-y);transform:translate(-50%,-100%);width:10%}
@keyframes boat-depart{from{left:var(--home-x);top:var(--home-y)}to{left:var(--japan-x);top:var(--japan-y)}}
@keyframes boat-onward{from{left:var(--japan-x);top:var(--japan-y)}to{left:65%;top:65%}}

#ai-load{position:fixed;bottom:12px;left:50%;transform:translateX(-50%);z-index:20;background:#fff3fa;border:2px solid #e8b1d5;border-radius:18px;padding:8px 18px;font-size:14px;pointer-events:none;box-shadow:0 3px 12px #59375a22;max-width:90vw}
#ai-load progress{display:block;width:100%;height:9px;accent-color:#b676cf;margin-top:4px}

/* v2.2b: generated expressions and actions; one isolated atlas cell per scene. */
.hero-overlay.hero-pose{aspect-ratio:2/3;overflow:hidden;max-height:55svh;filter:sepia(.08) saturate(.9)}
.hero-overlay.hero-pose:after{display:none}
.hero-overlay.hero-pose img{position:absolute;left:calc(var(--pose-x) * -100%);top:calc(var(--pose-y) * -100%);width:600%;height:500%;max-width:none;max-height:none;object-fit:fill;filter:none;animation:none}

.walking-route-marker{position:absolute;left:var(--home-x);top:var(--home-y);font-size:clamp(18px,3vw,30px);transform:translate(-50%,-100%)}

/* Grandpa's wooden practice board stays warm beside the cottage. */
.battle-scene #app.practice-scene .game-sidebar{background:#fff2dcea;color:#593c28;border-color:#deb47b}
.battle-scene #app.practice-scene .boss-dialogue{color:#593c28;text-shadow:none}
/* v2.3a: a single line at a time; dialogue follows its speaker. */
.book-page .page-art {animation:none!important;transform:none!important}
.book-page .scene-particles {display:none}
.book-page .page-copy {min-height:0;max-height:30%;padding:12px 22px 8px}
.book-page .page-copy .sentence {margin:0;font-size:clamp(18px,2.1vw,28px);line-height:1.4}
.book-page .speech-copy {position:absolute;inset:auto;left:var(--bubble-x);top:var(--bubble-y);bottom:auto;width:min(36%,420px);max-height:46%;border:3px solid #715642;border-radius:28px;background:#fffaf0f5;color:#342c29;box-shadow:0 8px 24px #221b3330;overflow:visible;z-index:4}
.speech-copy::after {content:'';position:absolute;bottom:-17px;left:24%;width:25px;height:25px;background:#fffaf0;border-right:3px solid #715642;border-bottom:3px solid #715642;transform:rotate(45deg)}
.speaker-name {display:block;font-size:15px;color:#775132;margin-bottom:5px}
.book-page .narration-controls {margin-top:6px;gap:5px}
.book-page .narration-controls button {padding:5px 10px;font-size:13px}
@media(max-width:650px){.book-page .speech-copy{width:72%;left:14%;top:26%;max-height:48%;padding:12px}.book-page .page-copy .sentence{font-size:19px}.book-page .narration-copy{max-height:35%}}
.book-page .quiz-copy {max-height:70%;overflow:auto}
.final-stone-count{position:absolute;top:10%;left:50%;transform:translateX(-50%);padding:12px 22px;background:#fff9e8ed;border-radius:24px;font-weight:800;color:#694721;z-index:3;white-space:nowrap}
/* Show the full cast on narrow screens instead of cropping the speaker away. */
@media(max-width:650px){
 .book-page .page-art{object-fit:contain;object-position:50% 0%;background:linear-gradient(150deg,#c7b0d9,#fbe3dc)}
 .book-page .speech-copy{left:7%;top:39%;width:86%;max-height:45%}
 .book-page .speech-copy::after{top:-16px;bottom:auto;border:0;border-left:3px solid #715642;border-top:3px solid #715642}
}
@media(max-width:650px){.book-page .art-toggle{top:31%}}
/* v2.3g: uniform veil; the board retains its original purple and colours. */
.battle-scene:after{background:rgba(6,0,18,calc(.82 * (1 - var(--lit,0))))!important;opacity:1!important;transition:background .8s}
.battle-scene .board-wrap{position:relative;z-index:5;filter:none!important;isolation:isolate}
.battle-thorns,.battle-thorn-debris{position:absolute;inset:-24px;width:calc(100% + 48px);height:calc(100% + 48px);pointer-events:none;overflow:visible;filter:drop-shadow(0 0 9px #7828be);z-index:3}
.battle-scene .board-wrap:before{content:'';position:absolute;inset:0;border-radius:inherit;background:linear-gradient(135deg,#E2BD76,#D4A85C);opacity:0;transition:opacity .8s;z-index:-1}
.battle-scene .board-wrap.battle-won:before{opacity:1}
.battle-scene .battle-won .board-cell:before,.battle-scene .battle-won .board-cell:after,.battle-scene .battle-won .starpoint{background:#5A3D1E;transition:background .8s}
.capture-bloom{background:radial-gradient(circle,#fff 0%,#f3e6ff 18%,#dc96ffe6 36%,#8c3cff88 55%,transparent 70%);filter:drop-shadow(0 0 20px #c58bff)}
.capture-ring{border-color:#fff;box-shadow:0 0 16px 5px #be6effcc}
@media(prefers-reduced-motion:reduce){.battle-scene .board-wrap:before,.battle-scene .board-cell:before,.battle-scene .board-cell:after{transition:none}}
.reduce-motion .board-wrap:before{transition:none}
.battle-scene .game-layout:before{display:none}
/* Parent controls stay readable on phones and in the game. */
dialog {max-height:90dvh;overflow:auto;width:min(480px,92vw)}
#auth-form,#child-form,#edit-child {display:grid;gap:12px}
.child-row {display:flex;gap:6px;align-items:center;flex-wrap:wrap}
#account-status {min-height:1.5em;color:#65406f}
.settings-dropdown {max-height:80dvh;overflow-y:auto}
@media(max-width:600px){.top-actions{gap:3px}.top-actions .icon-button{font-size:11px;padding:7px 5px}.brand small{display:none}}
.settings-dropdown{top:84px;max-height:calc(100dvh - 100px);padding-top:28px;box-sizing:border-box}.settings-dropdown h2{margin-top:0}
/* v2.3k phone layout (iPhone). iPad/desktop rules above are untouched. */
@media(max-width:850px){.home-scene:has(.journey-panel){grid-template-columns:minmax(0,1fr)}.home-scene>*{min-width:0}.rescue-portraits{flex-wrap:wrap;height:auto}}
@media(max-width:600px),(max-height:500px) and (orientation:landscape){
 html,body{max-width:100%;overflow-x:clip}
 .topbar{padding:calc(6px + env(safe-area-inset-top)) calc(8px + env(safe-area-inset-right)) 6px calc(8px + env(safe-area-inset-left));gap:6px}
 .brand{white-space:nowrap;font-size:12px;padding:6px 10px;min-height:44px}
 .brand small{display:none}
 .top-actions{gap:4px;flex-wrap:nowrap}
 .top-actions .icon-button{min-height:44px;min-width:44px;padding:4px 7px;font-size:11px;line-height:1.15;white-space:nowrap}
 #app{padding:6px calc(10px + env(safe-area-inset-right)) calc(20px + env(safe-area-inset-bottom)) calc(10px + env(safe-area-inset-left))}
 .previous-game{min-height:44px;font-size:14px;padding:6px 14px;margin:2px 0 4px}
 .screen-heading{margin:4px 0 8px;gap:8px}
 .screen-heading h2{font-size:19px;line-height:1.2}
 .screen-heading .quiet{min-height:44px;padding:6px 12px;font-size:13px}
 .game-sidebar button{min-height:44px}
 .settings-dropdown{top:calc(60px + env(safe-area-inset-top));right:8px;max-height:calc(100dvh - 70px - env(safe-area-inset-top))}
 dialog{max-height:calc(100dvh - 20px);width:min(480px,calc(100vw - 20px));margin:auto}
 .book-page,.page-copy{min-height:calc(100dvh - 60px)}
}
@media(max-width:600px){
 #account-button{font-size:0}#account-button:before{content:'家長';font-size:12px}
 .board-wrap{width:min(100%,calc(100dvh - 220px));margin:0 auto;padding:8px;border-width:5px}
}
@media(max-width:360px){.brand{font-size:0;padding:6px 10px}.brand .brand-stone{font-size:16px}}
@media(max-height:500px) and (orientation:landscape){
 .topbar{padding-top:4px;padding-bottom:4px}
 .game-layout{grid-template-columns:auto minmax(0,1fr);gap:12px;align-items:start}
 .board-wrap{width:calc(100dvh - 150px);min-width:200px;padding:6px;border-width:5px}
 .game-sidebar{display:block;max-height:calc(100dvh - 140px);overflow:auto}
 .home-hero{max-height:60dvh}
}
@media(max-width:600px),(max-height:500px) and (orientation:landscape){
 #app .previous-game{min-height:44px!important;font-size:14px!important;padding:6px 14px!important;margin:2px 0 4px!important}
}
@media(max-height:500px) and (orientation:landscape){
 #app .previous-game{float:left;margin:0 10px 0 0!important}
 .screen-heading{margin:0 0 6px}
 .board-wrap{width:calc(100dvh - 120px)}
}
@media(max-height:500px) and (orientation:landscape){
 .board-wrap{width:calc(100dvh - 100px);padding:4px}
 .game-sidebar{font-size:13px;padding:8px!important;max-height:calc(100dvh - 105px)}
 .game-sidebar .boss-dialogue{font-size:13px;line-height:1.3;margin:0 0 6px}
 .game-sidebar p{margin:4px 0}
}
@media(max-width:600px){.game-sidebar .boss-dialogue{font-size:15px;line-height:1.35}}
@media(max-height:500px) and (orientation:landscape){#app .game-sidebar,#app .game-sidebar .boss-dialogue{font-size:13px!important;line-height:1.3!important}#app .game-sidebar{overflow:auto!important;max-height:calc(100dvh - 110px)!important}}
@media(max-width:600px){.home-scene:has(.journey-panel) .journey-panel{width:100%!important;max-width:100%;padding:10px 8px}.journey-panel .illustrated-map{max-width:100%!important}.home-actions>*{max-width:100%}.journey-panel strong{font-size:18px}}
