/* Presentation scoped to Bacavia. Desktop retains its existing world and controls. */
.bm-menu-toggle,.bm-nav,.bm-library-title,.bm-sheet-handle,.bm-reader-next,.bm-boat,.bm-book-progress{display:none}
.bg-game{animation:none}
.bm-page-fade{position:fixed;inset:0;z-index:2147483000;background:#fff8e8;opacity:0;pointer-events:none;transition:opacity .22s ease-in-out}
.bg-reader .bm-page-fade{background:var(--paper)}
.bm-page-fade.bm-leaving{opacity:1;pointer-events:auto}
@keyframes bm-enter{from{opacity:0}to{opacity:1}}
/* Both documents opt in. Unsupported browsers keep ordinary native navigation. */
@view-transition { navigation:auto; }
::view-transition-old(root),::view-transition-new(root) {animation-duration:200ms;animation-timing-function:ease-in-out;}
@media(prefers-reduced-motion:reduce) {
 @view-transition { navigation:none; }
 ::view-transition-old(root),::view-transition-new(root) {animation:none!important;}
}
@media(max-width:760px){
 html body.bg-game,html body.bg-game.public-catalog-route,html body.bg-game.bacavia-auth,html body.bg-game.bg-reader{background:#164e58 url('bacavia-world/library-mobile.webp') center top/cover fixed!important}
 .bg-game .bg-library-scene{background-image:url('bacavia-world/library-mobile.webp')}
 .bg-game .bg-library-scene::after{background:transparent}
 .bg-game{--bm-bottom:calc(66px + env(safe-area-inset-bottom,0px))}
 html body.bg-game>.shell,html body.bg-game.public-catalog-route>.shell{padding:0 0 calc(var(--bm-bottom) + 16px)!important;min-height:100svh}
 .bg-game .bg-hud{position:fixed;top:calc(12px + env(safe-area-inset-top,0px));left:14px;right:14px;max-width:none;margin:0!important;padding:4px 10px 4px 14px;min-height:54px;flex-wrap:nowrap;border:1px solid #e1c28d;border-radius:17px;background:#fff9edf7;box-shadow:0 4px 16px #153e4920;gap:8px;z-index:30}
 .bg-game .bg-brand{font-size:19px;letter-spacing:.055em}.bg-game .bg-brand small{display:none}.bg-game .bg-brand>span:first-child{font-size:29px}
 .bg-mobile-ready .bm-menu-toggle{display:grid;place-items:center;margin:0 0 0 auto;padding:0;min-height:44px;width:44px;background:transparent;color:#174653;border:0;box-shadow:none;font:25px system-ui;letter-spacing:0}
 .bg-mobile-ready .bg-hud-links{display:none;position:absolute;right:0;top:calc(100% + 8px);width:min(300px,calc(100vw - 28px));padding:10px;grid-template-columns:1fr 1fr;gap:7px;background:#fff9ed;border:1px solid #d9b985;border-radius:16px;box-shadow:0 12px 30px #123a4940;max-height:calc(100dvh - 160px);overflow:auto}
 .bg-mobile-ready .bg-hud-links[data-open]{display:grid}.bg-mobile-ready .bg-hud-links a{font-size:12px;min-height:44px}.bg-mobile-ready .bg-hud .bg-wind,.bg-mobile-ready .bg-hud .bg-sound{font-size:12px;min-height:44px;width:100%}
 .bg-game .bm-nav{position:fixed;bottom:0;left:0;right:0;z-index:25;display:grid;grid-template-columns:repeat(3,1fr);min-height:var(--bm-bottom);padding:7px 12px max(7px,env(safe-area-inset-bottom,0px));border-radius:22px 22px 0 0;background:#fff9edf7;border-top:1px solid #d9c49b;box-shadow:0 -4px 22px #4f38251a}
 .bm-nav a{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:4px;min-height:48px;text-decoration:none;color:#717875;font:11px/1.2 system-ui,sans-serif}.bm-nav svg{width:22px;height:22px;fill:none;stroke:currentColor;stroke-width:1.7;stroke-linecap:round;stroke-linejoin:round}.bm-nav a[aria-current]{color:#007b88;font-weight:800}
 /* Entire island is the world, with destinations attached to the portrait artwork. */
 html:has(.bg-game .bw-world),html body.bg-game:has(.bw-world){height:100%;overflow:hidden!important}
 html body.bg-game:has(.bw-world)>.shell{height:100dvh;min-height:0!important;padding:0!important}
 .bg-game .bw-world{height:100dvh;min-height:580px;position:relative;background:#087d9e}
 .bg-game .bw-adventure{position:relative;display:block;padding:0;margin:0;width:100%;height:100%;max-width:none}
 .bg-game .bw-header,.bg-game .bw-quests,.bg-game:has(.bw-world) #bacavia-books{display:none!important}
 .bg-game .bw-intro{position:absolute;top:calc(78px + env(safe-area-inset-top,0px));left:23px;z-index:3;padding:0;margin:0;background:none;pointer-events:none}
 .bg-game .bw-intro p{font-size:12px;letter-spacing:.03em;text-transform:capitalize;color:#fff9ed;text-shadow:0 2px 6px #174a61;font-weight:700}
 .bg-game .bw-intro h1,.bg-game .bw-intro>a{display:none}
 .bg-game .bw-island-scroll{position:absolute;inset:0;overflow:hidden}
 .bg-game .bw-island{display:block;position:relative;width:100%;height:100%;padding:0;margin:0;aspect-ratio:auto;min-width:0}
 .bg-game .bw-land,.bg-game .bw-life{position:absolute;inset:0;width:100%;height:100%;aspect-ratio:auto;border-radius:0;object-fit:fill}
 .bg-game .bw-sea{clip-path:polygon(64% 16%,86% 16%,86% 20%,64% 20%)}
 .bg-game .bw-surf{display:none}.bg-game .bw-place{position:absolute;transform:translate(-50%,-50%);width:auto;white-space:nowrap;min-height:44px;padding:5px 9px;gap:5px;border-radius:15px;background:#fff8e9f5;box-shadow:0 3px 0 #b98d50,0 5px 16px #16415822;font-size:11px!important;max-width:calc(50vw - 15px)}
 .bg-game .bw-place>span:first-child{width:26px;height:26px;min-width:26px;font-size:17px}.bg-game .bw-place>span:last-child{overflow-wrap:normal}.bg-game .bw-place small{display:none}
 .bg-game .bw-library{left:50%;top:27%;font-size:13px!important;max-width:190px}
 .bg-game .bw-writing{left:23%;top:43%}.bg-game .bw-quiz{left:78%;top:43%}.bg-game .bw-garden{left:50%;top:59%}
 .bg-game .bw-resume{position:absolute;top:auto;bottom:calc(var(--bm-bottom) + 12px);left:16px;right:16px;width:auto;max-width:none;margin:0;padding:11px 13px;gap:11px;z-index:4;min-height:100px;border-radius:17px;background:#fff9edf7}
 .bg-game .bw-resume>img{width:48px;height:66px}.bg-game .bw-resume strong{font-size:14px;margin:3px 0;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}.bg-game .bw-resume small{font-size:9px}.bg-game .bw-resume b{font-size:13px;margin-top:4px}.bg-game .bw-progress-label{font-size:11px}.bg-game .bw-resume progress{max-width:none;margin:5px 0}
 .bg-game .bw-bird{width:34px;height:51px;top:15%;animation-name:bm-flight;animation-duration:23s;animation-delay:-4s}.bg-game .bw-bird-two{top:22%;width:25px;height:37.5px;animation-duration:29s;animation-delay:-17s}.bg-game .bw-bird-three{top:11%;width:21px;height:31.5px;animation-duration:31s;animation-delay:-10s}
 .bg-game .bw-woman{left:56%;top:38%;animation-name:bm-woman-route;width:35px;height:31px}.bg-game .bw-reader{left:50%;top:57%;width:35px;height:31px}.bg-game .bw-glow-one{top:30%}.bg-game .bw-glow-two{top:45%}
 .bm-boat{display:block;position:absolute;left:65%;top:16%;width:min(30px,4svh);height:min(30px,4svh);filter:drop-shadow(0 1px 1px #034a7233);animation:bm-sailing 24s ease-in-out infinite;transform-origin:50% 80%}.bm-boat svg{position:relative;width:100%;height:100%}
 .bm-boat::before,.bm-boat::after{content:"";position:absolute;left:-25%;top:80%;width:100%;height:13%;border:1px solid #dbffff80;border-top:0;border-radius:50%;animation:bm-wake 3s ease-out infinite;pointer-events:none}
 .bm-boat::after{animation-delay:-1.5s}
 /* Scene-first library, followed by a compact two-column collection. */
 .bg-game .bm-library-title{display:flex;align-items:center;justify-content:center;flex-direction:column;gap:9px;height:clamp(220px,39svh,350px);padding:82px 40px 12px;text-align:center;color:#173e49;text-shadow:0 1px 12px #fff9ed,0 0 22px #fff9ed}
 .bm-library-title>span{font:600 24px/1.2 Georgia,serif}.bm-library-title small{font:9px/1.7 system-ui,sans-serif;letter-spacing:.15em;max-width:210px;text-transform:uppercase}
 html body.bg-game .ebook-store.ebook-catalog{position:relative;margin:0!important;padding:16px 18px 24px!important;border-radius:24px 24px 0 0;border:1px solid #dfc89f;box-shadow:0 -6px 22px #563f2420;background:#fff8eaf7;min-height:62svh;display:flex;flex-direction:column;gap:0}
 .bg-game .bm-sheet-handle{display:grid;place-items:center;align-self:center;width:80px;min-height:44px;padding:0;margin:-16px 0 -8px;background:transparent;border:0;box-shadow:none;order:-3;cursor:pointer}.bm-sheet-handle span{height:4px;width:38px;border-radius:9px;background:#c8bdab}
 html body.bg-game .ebook-store.ebook-catalog.bm-expanded{margin-top:calc(-1 * clamp(132px,25svh,260px))!important}
 .bg-game .ebook-catalog .ebook-shelf-heading{order:-2;margin:5px 0 13px;align-items:center}.bg-game .ebook-catalog .ebook-shelf-heading h1{font:700 26px/1.2 Georgia,serif!important;letter-spacing:-.02em}.bg-game .ebook-catalog .ebook-eyebrow{display:none}.bg-game .ebook-catalog .ebook-shelf-heading>span{font-size:12px}
 .bg-game .ebook-catalog .ebook-search{height:44px;min-height:44px;margin:0;border-radius:12px;padding:0 0 0 10px}.bg-game .ebook-catalog .ebook-search input{font-size:14px;min-height:42px}.bg-game .ebook-catalog .ebook-search button{min-height:42px;padding:0 12px;font-size:13px;border-radius:10px}
 .bg-game .ebook-catalog .ebook-topics{flex-wrap:nowrap;max-height:none;margin:9px 0 12px;padding:0 0 4px;gap:8px!important;scrollbar-width:none}.bg-game .ebook-catalog .ebook-topics a{min-height:40px;padding:8px 17px;font-size:12px;flex:0 0 auto}
 .bg-game .ebook-catalog .ebook-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:20px 15px;padding:0}
 .bg-game .ebook-catalog .ebook-grid .ebook-card{display:flex;flex-direction:column;gap:0;padding:0;border:0!important;background:transparent!important;border-radius:0!important;box-shadow:none!important;min-width:0}
 .bg-game .ebook-catalog .ebook-grid .ebook-cover-stage{background:none!important;padding:0!important;border:0!important;display:flex;justify-content:center;box-shadow:none;border-radius:5px;overflow:visible}
 .bg-game .ebook-catalog .ebook-grid .ebook-cover{width:min(100%,125px);height:auto;aspect-ratio:296/420;transform:none;margin:0;box-shadow:3px 5px 12px #67482226;overflow:hidden;border-radius:5px}
 .bg-game .ebook-catalog .ebook-grid .ebook-cover img{display:block;width:100%;height:100%;object-fit:contain}.bg-game .ebook-catalog .ebook-cover-caption{display:none!important}
 .bg-game .ebook-catalog .ebook-card-body{padding:10px 0 0!important;display:flex;flex-direction:column;gap:5px;flex:1}
 .bg-game .bm-book-progress{display:block;font:11px/1.5 system-ui,sans-serif;color:#63766a}.bg-game .bm-book-progress progress{display:block;width:100%;height:4px;accent-color:#087c7e;margin:5px 0 9px;border:0}
 .bg-game .ebook-catalog .ebook-card h2{font:750 13px/1.35 system-ui,sans-serif!important;margin:0;min-height:36px}.bg-game .ebook-catalog .ebook-card h2 a{color:#173e49;text-decoration:none}
 .bg-game .ebook-catalog :is(.ebook-card-meta,.ebook-byline,.ebook-card-description,.ebook-format){display:none!important}.bg-game .ebook-catalog .ebook-mobile-meta{display:block;color:#65736a;font:11px/1.4 system-ui,sans-serif}
 .bg-game .ebook-catalog .ebook-card-actions{margin-top:auto;display:flex;flex-direction:column;gap:5px}.bg-game .ebook-catalog .ebook-primary-button{min-height:44px;font-size:11px;padding:8px 5px!important;border-width:1px!important;border-radius:11px!important;box-shadow:0 2px 0 #bc9358;white-space:normal;text-align:center}.bg-game .ebook-catalog .ebook-text-link{font-size:11px;min-height:32px;text-align:center}.bg-game .ebook-catalog .ebook-store-price{font-size:13px;margin:2px 0}.bg-game .ebook-catalog .ebook-store-price strong{font-size:16px}
 .bg-game .ebook-catalog .ebook-results-note{font-size:11px;margin:0 0 12px}.bg-game .ebook-catalog .ebook-results-note a{min-height:30px}.bg-game .ebook-catalog .ebook-store-footer{margin-top:24px;font-size:11px}
 .bg-game:has(.ebook-detail-hero) .ebook-store,.bg-game.bacavia-auth .login-panel,.bg-game.bg-payment>main{margin-top:90px!important}.bg-game.bg-payment{padding:0 12px calc(var(--bm-bottom) + 20px)}
 /* Reader keeps an opaque paper surface, with foliage visible around the margins. */
 html body.bg-reader{padding:84px 12px calc(var(--bm-bottom) + 36px)!important}
 .bg-reader .bm-nav{display:none}.bg-reader .bg-hud{left:auto;right:20px;top:14px;width:44px;min-height:44px;height:44px;padding:0;border:0;background:transparent;box-shadow:none}.bg-reader .bg-hud .bg-brand{display:none}.bg-reader .bg-hud-links{top:58px}
 .bg-reader .reader-top{position:fixed;left:12px;right:12px;top:12px;height:54px;min-height:54px;padding:0 58px 0 14px;border-radius:16px;border:1px solid var(--line);background:var(--paper);gap:8px;z-index:26}.bg-reader .reader-top .back{min-width:40px;min-height:44px;display:flex;align-items:center}.bg-reader .reading-mode{font-size:12px;margin:0 auto}.bg-reader .reader-top #settings-open{padding:4px 9px;min-width:44px;border:0;background:transparent}
 .bg-reader #reading{margin:0 auto 38px;padding:22px 19px 36px;max-width:600px;border:1px solid var(--line);border-radius:26px 26px 0 0;box-shadow:0 5px 28px #45301a22;background:var(--paper);min-height:calc(100svh - 180px)}
 .bg-reader .bj-journey{margin:0 0 12px;padding:0;border:0;border-radius:0;background:transparent;box-shadow:none}.bg-reader .bj-journey>summary{min-height:24px;padding:0;justify-content:center;font-size:11px}.bg-reader .bj-journey>summary strong{display:none}.bg-reader .bj-journey[open]{padding:10px;background:var(--panel);border-radius:12px}.bg-reader .bj-route{max-height:160px;overflow:auto}
 .bg-reader .book-context{font-size:10px;line-height:1.5;margin:0 0 16px;text-align:center;letter-spacing:.04em}.bg-reader .chapter .eyebrow{font-size:9px;letter-spacing:.1em;margin:0 0 12px}.bg-reader .chapter h1{font-size:30px;line-height:1.18;margin:0 0 18px}.bg-reader .chapter-meta{font-size:10px;margin:0 0 20px}.bg-reader .chapter-body{font-size:var(--size);line-height:var(--leading)}
 .bg-reader .reader-tools{position:fixed;top:auto;bottom:0;left:0;right:0;max-width:none;z-index:26;display:grid;grid-template-columns:1fr 1.25fr 1.1fr;padding:8px 12px max(8px,env(safe-area-inset-bottom,0px));height:var(--bm-bottom);gap:7px;background:var(--paper);border:0;margin:0}
 .bg-reader .reader-tools button{display:flex;align-items:center;justify-content:center;padding:7px 4px;min-height:44px;font:11px/1.3 system-ui,sans-serif;margin:0;box-shadow:none;border:1px solid var(--line)}.bg-reader .reader-tools button span{margin-left:3px}.bg-reader .reader-tools .bm-reader-next{background:var(--accent);color:var(--paper)}
 .bg-reader .reading-progress{bottom:var(--bm-bottom);padding:8px 16px;gap:5px;min-height:35px;border-top:1px solid var(--line);border-radius:16px 16px 0 0;background:var(--paper);z-index:26;font-size:9px}.bg-reader .reading-progress progress{height:3px}
 .bg-reader .selection-save{bottom:calc(var(--bm-bottom) + 52px);z-index:28}.bg-reader .highlight-help{font-size:11px;margin:0 0 18px}.bg-reader .text-block{scroll-margin-top:90px}
 .bg-reader .skip-link:focus{position:fixed;top:8px;left:12px;z-index:40;min-height:44px;border:1px solid var(--line);border-radius:10px}
 .bg-game:not(.bg-mobile-ready) .bg-hud{position:relative;top:auto;left:auto;right:auto;margin:12px!important;flex-wrap:wrap}.bg-game:not(.bg-mobile-ready) .bm-nav{display:none}
 .bg-reader[data-theme=dark] .bg-hud{background:transparent}.bg-reader[data-theme=dark] .bm-menu-toggle{color:var(--ink)}.bg-reader[data-theme=dark] .bg-hud-links{background:var(--paper);border-color:var(--line)}
}
@keyframes bm-flight{0%{transform:translate(0,0) rotate(-4deg)}50%{transform:translate(60vw,12px) rotate(2deg)}100%{transform:translate(125vw,-12px) rotate(-4deg)}}
@keyframes bm-sailing{0%,100%{transform:translate(0,0) rotate(-2deg)}50%{transform:translate(8vw,2px) rotate(2deg)}}
@keyframes bm-woman-route{0%,100%{left:56%;top:38%}50%{left:61%;top:35%}}
@media(max-width:760px) and (max-height:640px){.bg-game .bw-resume{min-height:80px;padding:7px 11px}.bg-game .bw-resume>img{width:38px;height:53px}.bg-game .bw-resume small{display:none}.bg-game .bw-world{min-height:0}.bg-game .bw-garden{top:59%}}
@media(prefers-reduced-motion:reduce){.bg-game{animation:none}.bm-page-fade{transition:none}.bg-game .bm-boat{animation:none!important}}

@keyframes bm-wake{0%{transform:translateX(0) scale(.65);opacity:0}25%{opacity:.45}100%{transform:translateX(-10px) scale(1.25);opacity:0}}
.bw-world[data-paused="true"] .bm-boat::before,.bw-world[data-paused="true"] .bm-boat::after,.bw-world[data-offscreen="true"] .bm-boat::before,.bw-world[data-offscreen="true"] .bm-boat::after{animation-play-state:paused!important}
@media(prefers-reduced-motion:reduce){.bm-boat::before,.bm-boat::after{animation:none!important;opacity:0}}
