:root { color-scheme: dark; --gold: #f3cf82; }
* { box-sizing: border-box; }
html,body { margin:0; width:100%; height:100%; overflow:hidden; background:#121a26; }
body { font-family:serif; }
#viewport { position:relative; width:100%; height:100%; overflow:auto; overscroll-behavior:none; scrollbar-width:none; }
#viewport::-webkit-scrollbar { display:none; }
#ambience { position:fixed; inset:-40px; background:center/cover; filter:blur(26px) brightness(.35); pointer-events:none; }
#scene { position:relative; margin:auto; overflow:hidden; isolation:isolate; box-shadow:0 0 90px #0008; transition:opacity .32s, filter .32s, transform .32s; }
#scene.changing { opacity:0; filter:blur(4px); transform:scale(.96); }
#scene.changing[data-transition="in"] { transform:scale(1.075); }
#scene.arriving { animation:scene-arrival .55s ease-out; }
@keyframes scene-arrival { from { opacity:.3; transform:scale(.97); } to { opacity:1; transform:scale(1); } }
.backdrop { position:absolute; width:100%; left:0; top:0; pointer-events:none; user-select:none; }
.location-backdrop { position:absolute; inset:0; width:100%; height:100%; object-fit:cover; pointer-events:none; user-select:none; }
.vignette { position:absolute; inset:0; box-shadow:inset 0 0 60px #15132233; pointer-events:none; z-index:110; }
.hotspot { position:absolute; border:0; padding:0; background:none; cursor:pointer; z-index:5; border-radius:40%; -webkit-tap-highlight-color:transparent; }
.object-contour { position:absolute; inset:0; width:100%; height:100%; overflow:visible; pointer-events:none; opacity:0; transition:opacity .18s; filter:drop-shadow(0 0 4px #f2c877); }
.object-contour path { fill:#ffe0a40d; stroke:#ffe3a0; stroke-width:2.5px; stroke-linejoin:round; stroke-linecap:round; vector-effect:non-scaling-stroke; }
.hotspot:hover .object-contour,.hotspot:focus-visible .object-contour,.hotspot.highlighted .object-contour { opacity:1; }
.hotspot:focus-visible { outline:none; }
.building { border-radius:0; }
.building-sprite { display:block; width:100%; height:100%; pointer-events:none; overflow:hidden; }
.building.pointer-highlight .building-sprite,.building.highlighted .building-sprite,.building:focus-visible .building-sprite,.building.terrace-highlight .building-sprite { filter:drop-shadow(1px 0 #ffe3a0) drop-shadow(-1px 0 #ffe3a0) drop-shadow(0 1px #ffe3a0) drop-shadow(0 -1px #ffe3a0) drop-shadow(0 0 4px #e5be6b); }
.mote { position:absolute; width:5px; height:5px; top:50%; left:50%; background:#ffe4b0; border-radius:100%; box-shadow:0 0 10px 3px #ffd987b0; animation:beckon 3s ease-in-out infinite; pointer-events:none; }
.pet { position:absolute; width:38%; left:36%; top:52%; z-index:4; filter:drop-shadow(0 18px 9px #1f142866); transform-origin:50% 92%; animation:breathe 4s ease-in-out infinite; cursor:pointer; border:0; background:none; padding:0; }
.pet img { width:100%; display:block; }
.pet:hover,.pet:focus-visible { outline:none; filter:drop-shadow(1px 0 #ffe3a0) drop-shadow(-1px 0 #ffe3a0) drop-shadow(0 1px #ffe3a0) drop-shadow(0 -1px #ffe3a0) drop-shadow(0 0 5px #e5be6b); }
.pet.celebrate { animation:celebrate .8s ease-in-out; }
.spark { position:absolute; width:6px; height:6px; border-radius:50%; background:#ffdf96; box-shadow:0 0 9px #ffbc53; pointer-events:none; animation:float 5s ease-in-out infinite; z-index:6; }
.fire { position:absolute; width:1.7%; height:2.4%; border-radius:50%; background:#ffbe62aa; filter:blur(5px); box-shadow:0 0 22px #ff9e45; animation:flame 1.7s ease-in-out infinite alternate; pointer-events:none; }
.water { position:absolute; border-radius:50%; border:1px solid #d4f1ff5e; animation:ripple 3s linear infinite; pointer-events:none; }
.butterfly { position:absolute; width:13px; height:9px; border-radius:80% 0; background:#8addff; box-shadow:7px 0 #3779b7; animation:butterfly 8s ease-in-out infinite; pointer-events:none; z-index:6; }
.burst { position:fixed; width:8px; height:8px; border-radius:50%; background:#ffe7b3; pointer-events:none; z-index:30; animation:burst .9s ease-out forwards; }
dialog { width:min(850px,94vw); height:min(680px,88dvh); padding:0; overflow:hidden; border:1px solid #cda86788; border-radius:45% 45% 12px 12px / 8% 8% 12px 12px; background:radial-gradient(ellipse at top,#344555,#101923 80%); box-shadow:0 0 0 7px #342b21,0 25px 100px #000b; }
dialog::backdrop { background:#080e17b8; backdrop-filter:blur(8px); }
#activity-art { width:100%; height:100%; }
#activity-art>svg { width:100%; height:100%; }
.artifact { position:absolute; bottom:12px; right:18px; width:65px; height:78px; border:0; padding:0; background:none; cursor:pointer; filter:drop-shadow(0 0 8px #e2bf6855); }
.artifact svg { width:100%; height:100%; }
.artifact:hover,.artifact:focus-visible { filter:drop-shadow(0 0 14px #ffdb99); }
.svg-action { cursor:pointer; }
.svg-action:focus-visible { outline:none; filter:drop-shadow(0 0 8px #ffd785); }
.svg-action:hover { filter:drop-shadow(0 0 8px #ffd785); }
.orbit { transform-origin:400px 280px; animation:orbit 18s linear infinite; }
.orbit.fast { animation-duration:5s; }
.shoot { animation:shoot 3s ease-in-out infinite; }
@keyframes breathe { 50% { transform:scale(1.015,1.025) rotate(.5deg); } }
@keyframes celebrate { 35% { transform:translateY(-18px) rotate(-3deg); } 65% { transform:translateY(-8px) rotate(3deg); } }
@keyframes beckon { 50% { opacity:.2; transform:translateY(-6px) scale(.6); } }
@keyframes float { 50% { transform:translate(7px,-16px); opacity:.25; } }
@keyframes flame { to { opacity:.45; transform:scale(.7,1.3); } }
@keyframes ripple { to { transform:scale(1.6); opacity:0; } }
@keyframes butterfly { 25% { transform:translate(25px,-20px) rotate(25deg); } 75% { transform:translate(-10px,-40px) rotate(-20deg); } }
@keyframes burst { to { transform:translate(var(--dx),var(--dy)); opacity:0; } }
@keyframes orbit { to { transform:rotate(360deg); } }
@keyframes shoot { 50% { opacity:.3; } }
#institutions { position:fixed; z-index:120; left:50%; bottom:max(8px,env(safe-area-inset-bottom)); transform:translateX(-50%); width:min(1420px,97vw); display:flex; gap:4px; padding:6px 8px; overflow-x:auto; border-radius:16px; background:#172127e6; border:1px solid #b28e4e55; box-shadow:0 8px 30px #0006; scrollbar-width:thin; scrollbar-color:#947b4d transparent; }
#institutions[hidden],#house-plan[hidden],#terraces[hidden] { display:none; }
.institution-icon { flex:0 0 98px; height:104px; background:none; color:#f4e7cd; border:0; padding:0 4px; cursor:pointer; display:flex; flex-direction:column; align-items:center; justify-content:flex-end; gap:4px; transition:transform .2s; }
.institution-icon .icon-art { display:block; width:72px; height:72px; pointer-events:none; }
.institution-icon span { font:12px/1.2 system-ui,sans-serif; min-height:29px; text-align:center; }
.institution-icon:hover,.institution-icon:focus-visible { transform:translateY(-3px); outline:1px solid #b39158; border-radius:8px; }
.institution-icon:hover .icon-art,.institution-icon:focus-visible .icon-art { filter:drop-shadow(0 0 4px #f2cf87); }
#terraces { position:fixed; top:12px; left:50%; transform:translateX(-50%); z-index:125; display:flex; gap:5px; padding:5px; background:#18252bd9; border-radius:22px; }
#terraces button { color:#e8dec7; padding:7px 12px; border:1px solid #947b4d66; border-radius:20px; background:none; cursor:pointer; font:12px system-ui,sans-serif; }
#terraces button:hover,#terraces button[aria-pressed=true] { background:#8c784133; border-color:#dfc289; }
#house-plan { position:fixed; bottom:max(16px,env(safe-area-inset-bottom)); left:20px; z-index:12; width:164px; height:79px; background:url('../../assets/city/children-houses-v1.png') center bottom/100% auto; border:2px solid #ac8952; border-radius:6px; box-shadow:0 5px 24px #000a; cursor:pointer; }
#house-plan:hover,#house-plan:focus-visible { box-shadow:0 0 18px #edcb84; outline:2px solid #e4bf77; }
.resident { position:absolute; width:17%; aspect-ratio:1; background-size:500% 400%; background-repeat:no-repeat; z-index:4; filter:drop-shadow(0 9px 5px #0005); animation:breathe 4s ease-in-out infinite; cursor:pointer; border:0; padding:0; background-color:transparent; }
.resident:hover,.resident:focus-visible { outline:none; filter:drop-shadow(1px 0 #ffe3a0) drop-shadow(-1px 0 #ffe3a0) drop-shadow(0 1px #ffe3a0) drop-shadow(0 -1px #ffe3a0) drop-shadow(0 0 5px #e5be6b); }
.resident.wave { animation:celebrate .8s ease-in-out; }
.plan-art { position:absolute; inset:0; background:url('../../assets/city/children-houses-v1.png') center/contain no-repeat; }
.plan-room { position:absolute; border:0; background:transparent; cursor:pointer; border-radius:6px; }
.plan-room:hover,.plan-room:focus-visible { background:#ffdd8c22; box-shadow:inset 0 0 25px #ffe2a5; outline:2px solid #d6b476; }
.exit-arrow { color:#f5dfaa; background:#253437b8; border:1px solid #c4a86b88; border-radius:12px; z-index:130; min-width:40px; min-height:44px; filter:drop-shadow(0 3px 6px #0006); }
.exit-arrow svg { display:block; width:100%; height:100%; }
.exit-arrow:hover,.exit-arrow:focus-visible { color:#fff1cb; background:#3b4b4dec; outline:2px solid #d1b271; }
.actor { border:0; padding:0; background:none; aspect-ratio:auto; animation:none; transform:none; filter:none; }
.actor-sprite { display:block; width:100%; height:100%; pointer-events:none; overflow:hidden; filter:drop-shadow(0 3px 2px #1b231d55); animation:actor-breathe 5s ease-in-out infinite; transform-origin:50% 90%; }
.actor:hover,.actor:focus-visible { filter:none; outline:none; }
.actor:hover .actor-sprite,.actor:focus-visible .actor-sprite { filter:drop-shadow(1px 0 #efd7a2) drop-shadow(-1px 0 #efd7a2) drop-shadow(0 1px #efd7a2); }
.actor.celebrate .actor-sprite,.actor.wave .actor-sprite { animation:celebrate .7s ease-in-out; }
.life { display:block; position:absolute; pointer-events:none; z-index:4; }
.life svg { width:100%; height:100%; display:block; }
.tree-canopy { background-repeat:no-repeat; clip-path:polygon(15% 0,72% 4%,100% 54%,90% 87%,32% 100%,0 52%); transform-origin:50% 100%; animation:tree-sway 7s ease-in-out infinite alternate; }
.waterfall { background:repeating-linear-gradient(170deg,transparent 0 8px,#d8f4f533 9px 12px,transparent 13px 24px); background-size:100% 200%; clip-path:polygon(34% 0,77% 8%,53% 52%,88% 100%,9% 100%,32% 50%); mix-blend-mode:screen; animation:fall-flow 2.8s linear infinite; }
.lake-light { background:repeating-linear-gradient(0deg,transparent 0 8px,#d8f4f520 9px 10px); border-radius:50%; animation:lake-shimmer 6s ease-in-out infinite; }
.ship { z-index:12; animation:sailing 42s linear infinite alternate; }
.bird { z-index:108; animation:bird-flight 30s linear infinite; }
.bird svg { animation:bird-wing 1.4s ease-in-out infinite alternate; }
.town-walker { animation:walking 24s ease-in-out infinite alternate; }
.courtyard-walker { transform-origin:50% 95%; animation:courtyard-walking 18s ease-in-out infinite alternate; }
.town-walker svg { animation:step-bob 1s ease-in-out infinite; }
.park-reader { z-index:83; animation:actor-breathe 6s ease-in-out infinite; }
.sunbeam { background:linear-gradient(120deg,#fff1b821,transparent 60%); clip-path:polygon(5% 0,50% 0,100% 100%,30% 100%); animation:sun-drift 13s ease-in-out infinite alternate; }
.dust { background:#f2e3ac99; border-radius:50%; animation:dust-drift 8s ease-in-out infinite; }
.leaf-shadow { background:radial-gradient(ellipse at 20% 30%,#64884a35 0 15%,transparent 18%),radial-gradient(ellipse at 70% 55%,#56884a25 0 18%,transparent 21%); transform-origin:bottom; animation:tree-sway 6s ease-in-out infinite alternate; }
.ground-light { background:radial-gradient(ellipse,#fbe5a80d,transparent 65%); animation:lake-shimmer 8s ease-in-out infinite; }
.mechanism { animation:orbit 24s linear infinite; }
.star-glimmer { color:#f0d699; font:22px serif; animation:lake-shimmer 4s ease-in-out infinite; }
.bubble { border:1px solid #c9eee299; border-radius:50%; animation:dust-drift 5s ease-in-out infinite; }
@keyframes actor-breathe { 50% { transform:translateY(-1px) rotate(.25deg); } }
@keyframes tree-sway { to { transform:skewX(.65deg) translateX(1px); } }
@keyframes fall-flow { to { background-position:0 100%; } }
@keyframes lake-shimmer { 50% { opacity:.35; transform:translateX(2px); } }
@keyframes sailing { to { transform:translate(-55px,6px); } }
@keyframes bird-flight { 0% { opacity:0; transform:translate(-10px,8px); } 10%,85% { opacity:1; } 100% { opacity:0; transform:translate(130px,-12px); } }
@keyframes bird-wing { to { transform:scaleY(.4); } }
@keyframes walking { 0%,10% { transform:translate(0,0); } 80%,100% { transform:translate(var(--walk-x,40px),var(--walk-y,-8px)); } }
@keyframes courtyard-walking { 0%,10% { transform:translate(0,0) scale(1); } 80%,100% { transform:translate(var(--walk-x,36px),var(--walk-y,-25px)) scale(.86); } }
@keyframes step-bob { 50% { transform:translateY(-1px); } }
@keyframes dust-drift { 0% { opacity:0; transform:translateY(8px); } 45% { opacity:.5; } 100% { opacity:0; transform:translate(8px,-25px); } }
@keyframes sun-drift { to { opacity:.6; transform:translateX(3px); } }
@media(max-width:700px) { .institution-icon { flex-basis:86px; height:98px; } .institution-icon .icon-art { width:62px; height:62px; } #institutions { gap:3px; padding:5px; } #house-plan { width:126px; height:62px; left:12px; } #terraces button { padding:7px 9px; font-size:11px; } }
@media (prefers-reduced-motion:reduce) { *,*::before,*::after { animation:none !important; transition:none !important; } }
