/* Compact appearance and existing companion controls share one toolbar. */
#ar-hub-companion-actions{display:inline-flex;align-items:center;flex:0 0 auto;max-width:100%}
.hub-cameo-controls #ar-companion-dock{margin:0}
#hub-theme-toggle[aria-expanded="true"]{outline:2px solid currentColor;outline-offset:2px}
#hub-theme-menu{position:fixed;z-index:2147481999;box-sizing:border-box;max-width:calc(100vw - 24px);overflow:auto;overscroll-behavior:contain;padding:8px;border:1px solid #84776a;border-radius:14px;background:#191611;color:#f0e9df;box-shadow:0 12px 40px #0008;text-align:left;font:13px/1.4 system-ui,sans-serif;isolation:isolate}
#hub-theme-menu[hidden]{display:none!important}
.hub-theme-menu-title{margin:3px 9px 7px;font:600 10px/1.4 system-ui,sans-serif;text-transform:uppercase;letter-spacing:.1em;color:inherit;opacity:.78}
#hub-theme-menu button{display:flex;align-items:center;gap:11px;width:100%;min-height:51px;padding:8px;border:1px solid transparent;border-radius:8px;background:transparent;color:inherit;text-align:left;font:600 13px/1.4 system-ui,sans-serif;cursor:pointer}
#hub-theme-menu button:hover,#hub-theme-menu button:focus-visible{background:#d9c5a21c;border-color:#bdab88;outline:2px solid currentColor;outline-offset:-2px}
#hub-theme-menu button[aria-checked="true"]{background:#d9c5a214;border-color:#91806b}
.hub-theme-icon{display:grid;place-items:center;width:31px;height:31px;flex:0 0 31px;border-radius:8px;background:#d5bd8e15;color:#eed0a2}
.hub-theme-icon svg{width:23px;height:23px;fill:none;stroke:currentColor;stroke-width:1.5;stroke-linejoin:round;stroke-linecap:round}
.hub-theme-check{margin-left:auto;visibility:hidden;font-size:16px}
[aria-checked="true"]>.hub-theme-check{visibility:visible}
body[data-library-theme="youth"] #hub-theme-menu{background:#fff9e9;border:2px solid #708953;color:#294a39}
body[data-library-theme="youth"] #hub-theme-menu button[aria-checked="true"]{background:#e3edbd;border-color:#708953}
body[data-library-theme="youth"] #hub-theme-menu button:hover,body[data-library-theme="youth"] #hub-theme-menu button:focus-visible{background:#e9f0cc}
body[data-library-theme="youth"] .hub-theme-icon{background:#d8e6b5;color:#385c3d}
/* The new illustration is a static viewport layer; no scrolling/parallax work. */
.hub-fantasy-scene{position:fixed;inset:0;z-index:0;overflow:hidden;pointer-events:none!important;isolation:isolate;contain:strict;background:#1b2023 url('/assets/library-fantasy-r18/lantern-stone-doorway-anime-wide.webp') center center/cover no-repeat}
.hub-fantasy-scene[hidden]{display:none!important}
.hub-fantasy-scene::before{content:"";position:absolute;inset:0;background:linear-gradient(90deg,#111c2861,#11192220 60%,#11151d33),linear-gradient(180deg,#0f152021,transparent 28%,#0f182142 75%,#0f18217a)}
.hub-fantasy-lantern{position:absolute;left:44%;top:31%;width:23vw;height:30vh;max-width:400px;max-height:300px;border-radius:50%;background:radial-gradient(ellipse,#ffd39033,transparent 68%);opacity:.5;animation:hub-fantasy-warmth 9s ease-in-out infinite alternate;animation-play-state:paused}
.hub-fantasy-motes{position:absolute;inset:0;overflow:hidden}
.hub-fantasy-motes i{position:absolute;left:var(--fantasy-x);top:var(--fantasy-y);width:var(--fantasy-size);height:var(--fantasy-size);border-radius:50%;background:#ffedbc;box-shadow:0 0 7px 1px #ffce8740;opacity:0;animation:hub-fantasy-drift var(--fantasy-duration) ease-in-out var(--fantasy-delay) infinite;animation-play-state:paused}
.hub-fantasy-scene[data-moving="true"] :is(.hub-fantasy-lantern,.hub-fantasy-motes i){animation-play-state:running}
.hub-fantasy-scene[data-still="true"] .hub-fantasy-motes{display:none}
.hub-fantasy-scene[data-still="true"] .hub-fantasy-lantern{animation:none;opacity:.3}
@keyframes hub-fantasy-warmth{from{opacity:.32}to{opacity:.64}}
@keyframes hub-fantasy-drift{0%,100%{opacity:0;transform:translate3d(0,16px,0)}25%,70%{opacity:.36}95%{opacity:0;transform:translate3d(24px,-65px,0)}}
body[data-library-theme="fantasy"]{background:#182027}
body[data-library-theme="fantasy"] .hub-world{background:transparent;--hub-bright:#f8e7c8;--hub-ink:#fff6e6;--hub-muted:#eadfcd;--hub-line:#a28e68;--hub-silver:#ecd5ad;color:var(--hub-ink)}
body[data-library-theme="fantasy"] .hub-world-scenery::before{background:none}
body[data-library-theme="fantasy"] .hub-dust{display:none}
body[data-library-theme="fantasy"] .hub-dust i{animation-play-state:paused}
body[data-library-theme="fantasy"] .hub-intro{padding:28px 30px;border:1px solid #b29a736b;border-radius:24px;background:linear-gradient(100deg,#14212aeb,#19242ad9 72%,#212a29d6);box-shadow:0 12px 32px #0a11152e;align-items:center}
body[data-library-theme="fantasy"] .hub-intro h1{color:#fff1d7;text-shadow:0 2px 12px #080e14}
body[data-library-theme="fantasy"] .hub-toolbar{padding:15px 18px;margin-bottom:26px;border:1px solid #b8a17d80;border-radius:18px;background:#172229f2;box-shadow:0 6px 20px #0810173d}
body[data-library-theme="fantasy"] .hub-mode-control{border-color:#b09971;background:linear-gradient(115deg,#564734,#2b302d);color:#fff2da}
body[data-library-theme="fantasy"] .hub-filter{color:#e3d8c8}
body[data-library-theme="fantasy"] .hub-filter[aria-pressed="true"]{background:#594b38;border-color:#bba47b;color:#fff1d8}
body[data-library-theme="fantasy"] .hub-filter:hover{background:#3e3d34;color:#fff1d8}
body[data-library-theme="fantasy"] .hub-count{color:#e3d8c8}
body[data-library-theme="fantasy"] .hub-section-heading{display:inline-flex;padding:10px 17px;border:1px solid #ad997782;border-radius:13px;background:#172229f2}
body[data-library-theme="fantasy"] :is(.hub-feature,.hub-app-card){background:linear-gradient(120deg,#1c2930f7,#152027f7);border-color:#b39b71;box-shadow:0 14px 32px #09131b5c}
body[data-library-theme="fantasy"] :is(.hub-feature-copy,.hub-card-body){color:#fff2dd}
body[data-library-theme="fantasy"] .hub-feature-copy .hub-subtitle{color:#ecd5ad}
body[data-library-theme="fantasy"] .hub-play{background:linear-gradient(120deg,#f4dfb2,#d6bb82);border-color:#fff0cc;color:#2a291e}
body[data-library-theme="fantasy"] .hub-play:hover{background:#fff0cc}
body[data-library-theme="fantasy"] .hub-library-note{padding:20px 24px;border:1px solid #aa947380;border-radius:17px;background:#152128f2;color:#e3d8c8}
body[data-library-theme="fantasy"] .hub-footer{background:#142029f2;border-color:#93836c;color:#e3d8c8}
body[data-library-theme="fantasy"] :is(.hub-library-note,.hub-footer) a{color:#f4dfb2}
body[data-library-theme="fantasy"] :is(.hub-cameo-controls button,#ar-companion-trigger){background:#263532;border-color:#ac9876;color:#f1dab2}
body[data-library-theme="fantasy"] :is(#hub-theme-menu,#ar-companion-menu){background:#18262c;border-color:#ac9876;color:#f8e7c8}
@media(max-width:700px){.hub-fantasy-scene{background-image:url('/assets/library-fantasy-r18/lantern-stone-doorway-anime.webp');background-position:56% center}.hub-fantasy-lantern{left:19%;top:28%;width:42vw;height:26vh}.hub-fantasy-motes i:nth-child(n+9){display:none}body[data-library-theme="fantasy"] .hub-intro{padding:24px 22px}body[data-library-theme="fantasy"] .hub-toolbar{gap:12px;padding:12px}body[data-library-theme="fantasy"] .hub-mode-control{width:100%;margin-top:20px}body[data-library-theme="fantasy"] .hub-library-note{padding:18px 20px}}
@media(prefers-reduced-motion:reduce){.hub-fantasy-scene *{animation:none!important}.hub-fantasy-motes{display:none!important}body[data-library-theme="fantasy"] .hub-play:hover,body[data-library-theme="fantasy"] .hub-app-card:hover{transform:none}}
@media(forced-colors:active){.hub-fantasy-scene{display:none!important}#hub-theme-menu,#hub-theme-menu button{border:1px solid ButtonText!important;background:Canvas!important;color:CanvasText!important;box-shadow:none!important}.hub-theme-icon{background:Canvas;color:CanvasText}#hub-theme-menu button:focus-visible{outline-color:Highlight!important}body[data-library-theme="fantasy"] :is(.hub-intro,.hub-toolbar,.hub-section-heading,.hub-feature,.hub-app-card,.hub-library-note,.hub-footer){background:Canvas;color:CanvasText;border-color:CanvasText;box-shadow:none}}
@media print{#hub-theme-toggle,#hub-theme-menu,.hub-fantasy-scene{display:none!important}}
/* Activity interiors follow the chosen world rather than the Classic brown inset. */
body[data-library-theme="youth"] .hub-app-card .hub-card-body{background:#fff8e6;color:#294a39}
body[data-library-theme="youth"] #hub-world[data-youth-time="night"] .hub-app-card .hub-card-body{background:#213b43;color:#dce7dd}
body[data-library-theme="fantasy"] .hub-app-card .hub-card-body{background:#1c2930;color:#fff2dd}
@media(forced-colors:active){body[data-library-theme="youth"] .hub-app-card .hub-card-body,body[data-library-theme="youth"] #hub-world[data-youth-time="night"] .hub-app-card .hub-card-body,body[data-library-theme="fantasy"] .hub-app-card .hub-card-body{background:Canvas;color:CanvasText}body[data-library-theme="fantasy"] .hub-card-body :is(h3,p){color:CanvasText}}
