/* The browser's visible area owns the scene and all floating UI. */
html,body{width:100%;height:100%;overflow:hidden;overscroll-behavior:none}
:root{--safe-top:env(safe-area-inset-top,0px);--safe-right:env(safe-area-inset-right,0px);--safe-bottom:env(safe-area-inset-bottom,0px);--safe-left:env(safe-area-inset-left,0px)}
#app-frame{position:fixed;inset:0;overflow:hidden;background:#0b315f;isolation:isolate}
/* The artwork bleeds beneath device safe areas; only controls are inset. */
#viewport{position:absolute;inset:0;background:#103c70}
.depth-world{width:100%;transform:none}
.depth-plane{width:1920px;right:auto}
.depth-plane.world-fill{width:var(--design-width,1920px)}
.ribbon-canvas{width:100%}
.scene{animation:scene-soft-in .6s cubic-bezier(.2,.7,.2,1) both}
.scene.leaving{animation:scene-soft-out .35s ease both}
#flash.go{animation:soft-light .5s ease-out}
@keyframes scene-soft-in{from{opacity:0;transform:scale(1.018)}to{opacity:1;transform:none}}
@keyframes scene-soft-out{to{opacity:0;transform:scale(1.025)}}
@keyframes soft-light{20%{opacity:.12}100%{opacity:0}}

/* A restrained edge highlight stays local to the chosen entry. */
.entry-halo{--halo:#c7f3ff;translate:-50% -50%;filter:none;border-radius:28px}
.entry-halo[class] i{inset:0;width:auto;height:auto;border:2px solid var(--halo);border-radius:inherit;box-shadow:0 0 18px color-mix(in srgb,var(--halo) 35%,transparent);rotate:0deg;translate:0 0;scale:1;aspect-ratio:auto;animation:entry-soft .65s ease-out both}
.entry-halo i:nth-child(2){inset:8px;border-width:1px;opacity:.5;animation-delay:.06s}
.halo-home{border-radius:100px;--halo:#e3f6ff}
.halo-video{--halo:#a8e9ff}.halo-rhyme{--halo:#b6efdc}.halo-graphic{--halo:#d8caff}.halo-knowledge{--halo:#f4dfb3}
.entry-active{filter:brightness(1.06)!important}
@keyframes entry-soft{0%{opacity:0;transform:scale(.97)}30%{opacity:.7}100%{opacity:0;transform:scale(1.09)}}

/* One small control replaces the three persistent buttons. */
#tools{position:absolute;right:max(12px,env(safe-area-inset-right,0px));bottom:max(10px,env(safe-area-inset-bottom,0px));display:block;z-index:24}
#tools #settings{width:36px;height:36px;padding:8px;border-radius:50%;display:grid;place-items:center;background:#0c365879;border:1px solid #d3ecff66;box-shadow:0 3px 12px #05204424;backdrop-filter:blur(12px)}
#settings svg{width:19px;height:19px;fill:none;stroke:currentColor;stroke-width:1.6;stroke-linecap:round}
#tools #settings[aria-expanded=true]{background:#e5f6ff;color:#19426b}
#tool-panel{position:absolute;right:0;bottom:46px;min-width:168px;padding:10px;border-radius:16px;background:#0c2c50f2;border:1px solid #a4cce64d;box-shadow:0 8px 30px #001d3f55;backdrop-filter:blur(16px);display:flex;flex-direction:column;gap:4px}
#tool-panel[hidden],#tool-panel button[hidden]{display:none!important}
.settings-heading{padding:4px 10px 7px;font-size:11px;letter-spacing:2px;color:#9bbbd2}
#tools #tool-panel button{background:transparent;border:0;border-radius:8px;text-align:left;padding:10px;font-size:13px;white-space:nowrap}
#tools #tool-panel button:hover{background:#a4dfff20}
#tools #tool-panel button[aria-pressed=true]{color:#b7e8ff}
#tour{position:absolute;bottom:max(10px,env(safe-area-inset-bottom,0px));max-width:calc(100% - 120px);padding:7px 12px;font-size:12px;gap:12px;border-radius:22px;background:#102f68cc;backdrop-filter:blur(14px);box-shadow:none;border-color:#b9d7ef55}
#tour-text{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
#tour button{flex-shrink:0;min-height:24px}
.tour-running .scene-hint{visibility:hidden}
#toast{position:absolute;top:max(12px,env(safe-area-inset-top,0px));max-width:calc(100% - 60px);font-size:12px;padding:9px 16px;white-space:normal}
#rotate,#loading{position:absolute}
dialog{max-height:calc(var(--visible-height,100dvh) - 24px)}
@media(max-height:500px){
 #tools #settings{width:32px;height:32px;padding:6px}
 #tool-panel{bottom:41px;padding:8px;min-width:156px;max-height:calc(var(--visible-height,100dvh) - 65px);overflow:auto}
 #tools #tool-panel button{font-size:12px;padding:8px 10px}
 #tour{font-size:11px;padding:5px 10px;gap:10px}
 .scene-hint{background:#10386666;border-color:#b9d7ef33}
}
@media(hover:none){
 .art-button:hover img,.portal:hover img{transform:none;filter:none}
 .split-button:hover .button-icon,.split-button:hover .button-text0,.split-button:hover .button-base{transform:none!important;filter:none!important}
 .compound-globe:hover .globe-play{scale:1;filter:none!important}
 .compound-globe:hover .globe-label,.compound-globe:hover .globe-text{translate:0 0}
 .compound-globe:hover .globe-shell{filter:none!important}
}
@media(prefers-reduced-motion:reduce){.entry-halo i{animation:none;opacity:.35;scale:1}.scene,.scene.leaving{animation:none}}

/* Atmosphere moves visibly; character-specific actions await new artwork. */
.earth-plane img{animation-duration:16s}
.distant-planet img,.space-earth img{animation-duration:14s}
.art-button .float{animation-duration:calc(var(--duration,5s)*.8)}
.moon-plane img{animation-duration:7s}
@keyframes earth-drift{0%,100%{transform:translate(-18px,-6px) rotate(-2deg)}50%{transform:translate(32px,25px) rotate(3deg)}}
@keyframes planet-sway{0%,100%{transform:translateY(-20px) rotate(-1.5deg)}50%{transform:translateY(28px) rotate(1.5deg)}}
@keyframes moon-drift{0%,100%{transform:translate(-17px,6px)}50%{transform:translate(24px,-27px)}}
@keyframes float{0%,100%{transform:translateY(4px) rotate(-1deg)}50%{transform:translateY(-28px) rotate(1deg)}}
.is-interacting .float{animation-play-state:paused!important}
.piece:not(button){pointer-events:none}
.piece[data-art="graphic-mascot"]>span,
.piece[data-art="knowledge-mascot"]>span,
.piece[data-art="space-blue"]>span,
.piece[data-art="space-red"]>span,
.piece[data-art="stars-mascot"]>span{display:block;width:100%;height:100%}
.piece[data-art="graphic-mascot"]>span>img,
.piece[data-art="knowledge-mascot"]>span>img,
.piece[data-art="space-blue"]>span>img,
.piece[data-art="space-red"]>span>img,
.piece[data-art="stars-mascot"]>span>img{display:block;width:100%;height:100%;object-fit:contain;user-select:none;pointer-events:none;-webkit-user-drag:none}
.globe-parts{pointer-events:none}
.compound-globe .globe-shell,.compound-globe .globe-glass{clip-path:ellipse(43% 45% at 50% 49%)}
.scene{animation-duration:.32s}
#motion-invite{position:absolute;z-index:40;left:50%;bottom:max(16px,env(safe-area-inset-bottom));transform:translateX(-50%);display:flex;align-items:center;gap:14px;max-width:calc(100% - 32px);width:max-content;padding:14px 18px;border:1px solid #c4eaff88;border-radius:20px;background:#102f53f2;box-shadow:0 8px 30px #001a4555;backdrop-filter:blur(14px)}
#motion-invite[hidden]{display:none}
#motion-invite strong{font-size:14px;font-weight:500;white-space:nowrap}
#motion-invite p{font-size:11px;color:#b3cee2;margin:5px 0 0;white-space:nowrap}
#motion-invite button{padding:10px 13px;border-radius:18px;font-size:12px;white-space:nowrap;background:#d8f3ff;color:#17486a}
#motion-invite #invite-skip{background:transparent;color:#b3cee2;padding:10px 4px}
@media(max-height:500px){#motion-invite{padding:10px 14px;gap:10px;bottom:max(10px,env(safe-area-inset-bottom))}#motion-invite strong{font-size:12px}}
@media(orientation:portrait){#motion-invite{flex-wrap:wrap;justify-content:center;width:300px;text-align:center}#motion-invite>div{width:100%}}
@media(prefers-reduced-motion:reduce){.art-button .float,.earth-plane img,.distant-planet img,.space-earth img,.moon-plane img{animation:none}}

/* Keep the directory mounted; both deeper levels are local overlay panels. */
#scene[hidden],.venue-panel[hidden]{display:none!important}
.venue-panel,.catalog-panel{position:absolute;inset:0;overflow:hidden;outline:none;animation:panel-open .24s ease-out both}
.venue-panel{z-index:9}
.catalog-panel{z-index:12;background:#03162c9c;isolation:isolate}
.catalog-panel::before{content:"";position:absolute;top:24px;bottom:24px;left:calc(50% - 932px);width:1864px;border:2px solid #a7d9f866;border-radius:36px;background:linear-gradient(145deg,#174b7af2,#0b294ced);box-shadow:0 16px 60px #00142b66;pointer-events:none}
.catalog-panel .list-heading{font-size:72px;letter-spacing:8px;top:64px;z-index:2}
.catalog-close{position:absolute;right:calc(50% - 890px);top:56px;height:86px;padding:0 28px;z-index:5;border-radius:48px;border:1px solid #c0e7ff88;background:#215580aa;font-size:30px}
.catalog-close:hover{background:#387fb4}
.catalog-open .venue-panel{animation:none!important;opacity:1;translate:none}
.catalog-open .venue-panel *,.catalog-open .venue-panel *::after{animation-play-state:paused!important}
.catalog-open #tools{visibility:hidden}
.catalog-panel .works-status{top:956px}
.catalog-panel .works-dots{top:1003px}
@keyframes panel-open{from{opacity:0;translate:0 12px}to{opacity:1;translate:0 0}}
@media(prefers-reduced-motion:reduce){.venue-panel,.catalog-panel{animation:none}}
