/* A single portrait reader for the cover, map and all five chapters. */
/* No native touch rectangles on HTML/SVG; keep scene keyboard focus cues. */
*{-webkit-tap-highlight-color:transparent}
:focus:not(:focus-visible){outline:none}
html[data-story-input="pointer"] :focus{outline:none!important}
dialog>.storybook-version{display:block;margin-top:20px;text-align:right;font:11px/1.5 Georgia,serif;letter-spacing:.3px;color:inherit;opacity:.65;pointer-events:none;user-select:none;-webkit-user-select:none}
:root{--story-max:480px;--story-room:#e8ead9;--story-ink:#54634b;--story-light:#e9f1cf;--story-paper:#f6efda;--story-page-ink:#69745a}
body[data-book-chapter="2"]{--story-room:#ede2c9;--story-ink:#7a694c;--story-light:#fff0c3;--story-paper:#f6e8cc;--story-page-ink:#80704f}
body[data-book-chapter="3"]{--story-room:#c8a7a5;--story-ink:#654f5c;--story-light:#f4c7ae;--story-paper:#f0e0d1;--story-page-ink:#816978}
body[data-book-chapter="4"]{--story-room:#253a50;--story-ink:#d3dfdf;--story-light:#a7c9d7;--story-paper:#cad9da;--story-page-ink:#486171}
body[data-book-chapter="5"]{--story-room:#182d41;--story-ink:#d0dce2;--story-light:#8ba8bd;--story-paper:#c3d4d7;--story-page-ink:#405e73}
body[data-book-chapter]{background:radial-gradient(ellipse at 25% 5%,var(--story-light),transparent 62%),var(--story-room);color:var(--story-ink);min-height:100vh;min-height:100dvh;overflow-x:hidden}
.book-room,body[data-book-chapter]>main{box-sizing:border-box;width:100%;max-width:var(--story-max);min-height:100vh;min-height:100dvh;margin-inline:auto;padding:env(safe-area-inset-top,0px) 0 env(safe-area-inset-bottom,0px);display:flex;flex-direction:column;align-items:center}
.book-room>.reader-header,body[data-book-chapter]>main>header{box-sizing:border-box;width:100%;min-height:56px;padding:6px 18px;display:flex;align-items:center;justify-content:space-between;font-size:10px;letter-spacing:1px;color:inherit;gap:8px;flex:none}
body[data-book-chapter] header>a{min-height:44px;display:inline-flex;align-items:center;padding:7px 0;white-space:nowrap}
body[data-book-chapter] header>span{font-size:9px;opacity:.6;letter-spacing:1px}
body[data-book-chapter] .header-actions{gap:5px;align-items:center}
body[data-book-chapter] header button{min-width:44px;min-height:44px;padding:7px;font-size:11px;letter-spacing:.5px}
body[data-book-chapter]>main>.title,.book-room>.heading{box-sizing:border-box;flex:none;min-height:100px;margin:0;width:100%;padding:12px 18px 13px;text-align:center}
body[data-book-chapter] .title h1,.book-room>.heading h1{font-weight:400;font-size:25px;line-height:1.3;letter-spacing:4px;margin:10px 0 9px;color:inherit}
body[data-book-chapter] .title .eyebrow{font-size:8px;letter-spacing:2.7px;color:inherit;opacity:.6}
body[data-book-chapter] .title p{font-size:11px;line-height:1.75;letter-spacing:1px;margin:0;color:inherit;opacity:.72}
body[data-book-chapter] .book{box-sizing:border-box;isolation:isolate;position:relative;width:min(calc(100% - 32px),382px);max-width:calc(100% - 32px);margin:7px auto 0;padding:12px 12px 9px;border-radius:15px 15px 9px 9px;background:var(--story-paper);color:var(--story-page-ink);box-shadow:0 8px 0 #ac987530,0 15px 35px #2d38251a;flex:none}
body[data-book-chapter] .book:before{content:"";position:absolute;inset:0;border:1px solid #917f5730;border-radius:inherit;pointer-events:none;z-index:12}
body[data-book-chapter] .page-caption{min-height:20px;align-items:center;gap:8px;margin:0 2px 8px;font-size:10px;line-height:1.4;letter-spacing:2px;color:inherit}
body[data-book-chapter] .page-caption span:last-child{font-size:10px;color:inherit;opacity:.6}
body[data-book-chapter] .scene{width:100%;aspect-ratio:2/3;border-radius:19px 19px 7px 7px;box-shadow:0 0 0 1px #88775630;flex:none}
body[data-book-chapter] .whisper{min-height:34px;margin:10px 2px 4px;font-size:11px;line-height:1.7;letter-spacing:.5px;color:inherit;text-align:center}
body[data-book-chapter] .continue-space{min-height:0;margin:0;display:flow-root}
body[data-book-chapter] .continue,body[data-book-chapter] .completion-next,body[data-book-chapter] .next-link,body[data-book-chapter] .next-link#next{display:block;min-height:44px;margin:0 auto 4px;padding:10px 7px;border:0;border-bottom:1px solid #8c87634d;border-radius:0;background:none;color:inherit;font-size:11px;line-height:1.6;letter-spacing:1px;text-align:center}
body[data-book-chapter] .book-bottom{min-height:42px;padding:2px 0 0;gap:8px;color:inherit;align-items:center}
body[data-book-chapter] .book-bottom button{min-height:40px;min-width:44px;padding:5px 7px;font-size:10px;letter-spacing:.5px;color:inherit;border-radius:20px}
body[data-book-chapter] .book-bottom .bookmarks{position:static;transform:none;display:flex;gap:7px;min-width:30px;justify-content:center}
body[data-book-chapter] .bookmark{width:5px;height:5px;min-width:0;border-color:currentColor}
body[data-book-chapter] .bookmark.current{background:currentColor;box-shadow:none}
body[data-book-chapter]>main>.footer-note{flex:none;margin:15px 12px 14px;font-size:9px;line-height:1.6;letter-spacing:1.5px;color:inherit;opacity:.5;text-align:center}
.book-room .book-world{width:94%;height:auto;aspect-ratio:1.022/1;min-height:0;max-width:94%;margin:8px auto 18px;flex:none;perspective:none!important}
.book-room .book-stage{perspective:none!important;transform-style:flat}
.paper-leaf-window{position:absolute;left:-2%;bottom:0;width:104%;aspect-ratio:3/2;overflow:hidden;pointer-events:none;z-index:25;perspective:none}
.paper-leaf-window>.paper-turn,.turn-back .paper-leaf-window>.paper-turn{left:0;bottom:0;right:auto;top:auto;width:100%;height:100%;aspect-ratio:auto;transform-origin:50% 82%;perspective:none;filter:drop-shadow(2px 3px 2px #4f3d2c35)}
.book-cover{width:min(100vw,var(--story-max));left:50%;right:auto;transform:translateX(-50%);height:100vh;height:100dvh;max-width:none}
.book-cover::backdrop{background:#e4e7d8}
body[data-book-chapter]>main{animation:chapter-sheet-enter .5s ease-out both}
@keyframes chapter-sheet-enter{from{opacity:.35;translate:0 5px}to{opacity:1;translate:0 0}}
@media(max-width:520px){body[data-book-chapter] header>span{display:none}.book-room>.reader-header>span{display:none}}
@media(prefers-reduced-motion:reduce){body[data-book-chapter]>main{animation:none}}
/* Keep chapter art broad on a phone by spending fewer rows on surrounding UI. */
.book-room>.reader-header,body[data-book-chapter]>main>header{min-height:52px;padding-top:4px;padding-bottom:4px}body[data-book-chapter]>main>.title{min-height:84px;padding-top:7px;padding-bottom:8px}body[data-book-chapter] .title h1{font-size:24px;margin:7px 0;line-height:1.3}body[data-book-chapter] .title .eyebrow{line-height:1.2}body[data-book-chapter] .title p{font-size:10.5px;line-height:1.5}body[data-book-chapter] .book{padding-top:8px;padding-bottom:6px}body[data-book-chapter] .page-caption{min-height:18px;margin-bottom:6px}body[data-book-chapter] .whisper{min-height:30px;margin:8px 1px 0;line-height:1.6}body[data-book-chapter] .completion-next,body[data-book-chapter] .next-link,body[data-book-chapter] .continue{margin-bottom:0}body[data-book-chapter] .book-bottom,body[data-book-chapter] .book-bottom button{min-height:44px}body[data-book-chapter]>main>.footer-note{margin:9px 10px 10px;line-height:1.5}
body[data-book-chapter] .continue-space{min-height:44px}
.companion-home{width:min(100vw,var(--story-max));left:50%;right:auto;transform:translateX(-50%)}.companion-home .home-page{width:min(100%,calc(100dvh * 2 / 3))}
/* A viewport-tall reader must never grow a scrollbar during its entrance. */
@keyframes chapter-sheet-enter{from{opacity:.35}to{opacity:1}}.cover-reveal{transform:none!important;translate:none!important}@keyframes door-reader-light{from{opacity:.5}to{opacity:1}}
body[data-book-chapter] .continue-space{display:flex;justify-content:center;align-items:center;gap:10px;flex-wrap:wrap}body[data-book-chapter] .continue-space>button,body[data-book-chapter] .continue-space>a{margin:0;max-width:100%;flex:0 1 auto}body[data-book-chapter] .continue-space>.home-revisit{min-height:44px;padding:8px 10px;font-size:10px;color:inherit;border-bottom:1px solid #8c87634d}
body[data-book-chapter] header #sound,body[data-book-chapter] header #daySound,body[data-book-chapter] header #moonSound,body[data-book-chapter] header #rainSound{font-size:10px!important;letter-spacing:.5px;min-width:44px}body[data-book-chapter] header #sound::before,body[data-book-chapter] header #daySound::before,body[data-book-chapter] header #moonSound::before,body[data-book-chapter] header #rainSound::before{content:none!important}body[data-book-chapter] header #menu{font-size:22px}body[data-book-chapter] .title h1{font-size:25px}
body.reader-entering .book-world{transform:translateY(2px) scale(1.02)}
body[data-book-chapter="4"]{--story-paper:#f1ead8}body[data-book-chapter="5"]{--story-paper:#ece6d6}
