* { box-sizing: border-box; }
html, body, main { width: 100%; height: 100%; margin: 0; overflow: hidden; }
body { background: #020512; color: #fff6e6; }
main { position: relative; isolation: isolate; }
#outside, #invitation, #glitter, .plate, #world { position: absolute; inset: 0; width: 100%; height: 100%; }
#outside, #invitation { overflow: hidden; }
.surround { position: absolute; inset: -30px; background: url("assets/portrait-dusk.webp") center/cover; filter: blur(25px) brightness(.78); }
.scene { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); width: max(100vw,55.8vh); aspect-ratio: 937/1679; }
#sky, #castle, #trail, #exposure, #starfield { opacity: 0; }
@media (orientation: landscape) {
  .surround { background-image: url("assets/wide-dusk.webp"); }
  .scene { width: max(100vw,177.58vh); aspect-ratio: 1671/941; }
}
#invitation { opacity: 0; pointer-events: none; }
#hall { width: 100%; height: 100%; object-fit: cover; object-position: 50% 55%; display: block; }
#glitter { pointer-events: none; }
[hidden] { display: none !important; }
button { color: #fff6e8; cursor: pointer; -webkit-tap-highlight-color: transparent; font: 16px/1.2 Georgia, "Times New Roman", serif; }
#entry { position: absolute; inset-inline: 0; bottom: max(6.5%,env(safe-area-inset-bottom)); display: grid; justify-items: center; gap: 1px; }
#begin { min-height: 44px; font-size: 16px; padding: 9px 21px; border: 1px solid #f4e8d34d; background: #1c283e61; backdrop-filter: blur(5px); border-radius: 32px; text-shadow: 0 1px 4px #182238; }
#silent { min-height: 44px; font-size: 14px; padding: 8px 18px; border: 0; background: transparent; text-shadow: 0 1px 5px #060c1c,0 1px 3px #060c1c; }
@media (max-width: 767px) and (orientation: portrait) {
  .surround { background-image: url("assets/mobile-dusk.webp"); }
  #entry { bottom: calc(env(safe-area-inset-bottom, 0px) + 4px); display: flex; justify-content: center; gap: 6px; }
  #begin, #silent { padding: 0 10px; border: 0; background: transparent; backdrop-filter: none; color: #16273b; font-size: 14px; text-shadow: 0 1px 2px #ffffff45; }
}
#controls { position: absolute; right: max(9px,env(safe-area-inset-right)); bottom: max(8px,env(safe-area-inset-bottom)); display: flex; align-items: center; opacity: 0; pointer-events: none; transition: opacity .35s; }
#controls.resting { opacity: .52; pointer-events: auto; }
main.interacting #controls, #controls:has(:focus-visible) { opacity: .95; pointer-events: auto; }
.round { width: 44px; height: 44px; padding: 12px; border: 0; border-radius: 50%; background: transparent; display: grid; place-items: center; }
.round svg { width: 17px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; filter: drop-shadow(0 1px 2px #172038); }
.round:hover, .round:focus-visible { background: #14223838; }
#control path { display: none; }
#control[data-action="pause"] .pause, #control[data-action="resume"] .resume, #control[data-action="repeat"] .repeat { display: block; }
.cross, .muted .waves { display: none; }
.muted .cross { display: block; }
button:focus-visible { outline: 2px solid #ffedc2; outline-offset: 4px; }
#feedback { position: absolute; bottom: 20%; left: 50%; transform: translateX(-50%); background: #172138; padding: 10px 18px; border-radius: 18px; text-align: center; font: 15px/1.4 Georgia,serif; }
@media (prefers-reduced-motion: reduce) { #controls { transition: none; } }
