*{box-sizing:border-box}
html,body{margin:0;width:100%;min-height:100%;background:#090f20}
body{overflow:hidden;color:#f5d9a3}
.scene{position:fixed;inset:0;display:grid;place-items:center;isolation:isolate;overflow:hidden;background:#090f20}
/* Full-height scene. Wide screens extend only the peripheral scenery;
   the central staff, inscription, sky and water keep their original framing. */
.ambient{position:absolute;inset:-45px;z-index:-1;background:linear-gradient(rgba(5,8,18,.74),rgba(5,8,18,.74)),url('assets/temple-restored.webp') center/cover no-repeat;filter:blur(28px);pointer-events:none}
.stage{position:absolute;left:50%;top:50%;width:max(100vw,150vh);width:max(100vw,150dvh);aspect-ratio:3/2;transform:translate(-50%,-50%);z-index:1;isolation:isolate;animation:arrival 1.8s ease-out both}
.original-scene{display:block;position:absolute;inset:0;width:100%;height:100%;object-fit:contain;z-index:0}
.aura{position:absolute;left:30.5%;top:2%;width:39%;height:57%;z-index:1;pointer-events:none;background:radial-gradient(ellipse,rgba(255,205,73,.18),rgba(255,180,41,.09) 50%,transparent 72%);mix-blend-mode:screen;animation:breathe 6s ease-in-out infinite}
/* All emblem coordinates are locked to the original 1536 x 1024 composition. */
.staff{position:absolute;left:41.796875%;top:7.8125%;width:16.40625%;height:48.828125%;object-fit:fill;pointer-events:none}
.staff-fire{z-index:3;filter:saturate(1.3) brightness(1.15) drop-shadow(0 0 5px rgba(109,68,255,.50));transform-origin:50% 88%;animation:fire-breath 3.6s ease-in-out infinite alternate}
.staff-gold{z-index:4;filter:drop-shadow(0 1px 3px rgba(66,27,2,.18))}
.fire-canvas{position:absolute;left:29.1666667%;top:0;width:41.6666667%;height:58.59375%;z-index:2;pointer-events:none}
.sparks{position:absolute;inset:0;pointer-events:none;z-index:5;overflow:hidden}
.spark{position:absolute;width:2px;height:2px;border-radius:50%;background:#ffe2a0;box-shadow:0 0 10px 2px rgba(255,182,63,.7);left:var(--x);top:var(--y);opacity:0;animation:rise var(--d) linear var(--delay) infinite}
.vignette{position:absolute;inset:0;pointer-events:none;z-index:6;background:radial-gradient(ellipse at center,transparent 58%,rgba(5,8,20,.13) 100%)}
.sound-control{position:fixed;z-index:10;right:max(20px,env(safe-area-inset-right));bottom:max(20px,env(safe-area-inset-bottom));display:flex;align-items:center;gap:10px}
.music-toggle{display:grid;place-items:center;width:46px;height:46px;padding:0;border:1px solid rgba(255,214,145,.5);border-radius:50%;background:rgba(10,13,26,.62);color:#f5d9a3;cursor:pointer;backdrop-filter:blur(9px);-webkit-backdrop-filter:blur(9px);box-shadow:0 0 24px rgba(250,181,64,.14);transition:box-shadow .3s,background .3s;touch-action:manipulation}
.music-toggle:hover{background:rgba(47,32,21,.8)}
.music-toggle:focus-visible{outline:2px solid #fff0c0;outline-offset:4px}
.music-toggle[aria-pressed="true"]{box-shadow:0 0 21px rgba(250,181,64,.42)}
.music-toggle[aria-pressed="false"] .sound-waves,.music-toggle[aria-pressed="true"] .sound-off{display:none}
.sound-hint{max-width:230px;padding:7px 11px;border-radius:18px;background:rgba(7,11,22,.74);border:1px solid rgba(255,214,145,.14);font:12px/1.35 system-ui,-apple-system,Segoe UI,sans-serif;letter-spacing:.01em;box-shadow:0 0 20px rgba(0,0,0,.12)}
.sound-hint:empty{display:none}
@keyframes arrival{from{opacity:0}to{opacity:1}}
@keyframes breathe{0%,100%{opacity:.35;transform:scale(.97)}50%{opacity:1;transform:scale(1.025)}}
@keyframes fire-breath{from{opacity:.85;transform:scaleX(.96) skewX(-1deg)}to{opacity:1;transform:scaleX(1.045) skewX(1deg)}}
@keyframes rise{0%{opacity:0;transform:translateY(15px) scale(.5)}20%{opacity:.75}80%{opacity:.55}100%{opacity:0;transform:translateY(-90px) scale(1.1)}}
@media(max-width:600px){.sound-control{right:15px;bottom:max(16px,env(safe-area-inset-bottom))}.sound-hint{font-size:11px}.staff-fire{filter:saturate(1.3) brightness(1.15)}}
@media(prefers-reduced-motion:reduce){*,*::before,*::after{animation:none!important;transition:none!important}.stage{opacity:1}}

/* Wide-screen adaptation using the SAME original artwork. The central 736px
   of the 1536px composition stays proportional. The outer 400px on each side
   flex to reach the screen edges, so there are no bars or vertical cropping.
   No artwork, emblem, flame animation or audio is replaced. */
@media (min-aspect-ratio:3/2){
  .stage{width:150vh;width:150dvh}
  .original-scene{clip-path:inset(0 26.0416666667%)}
  .scene::before,.scene::after{
    content:"";position:absolute;top:0;bottom:0;z-index:0;pointer-events:none;
    width:calc((100vw - 71.875vh)/2);width:calc((100vw - 71.875dvh)/2);
    background-image:url('assets/temple-restored.webp');background-repeat:no-repeat;
    background-size:calc((100vw - 71.875vh)*1.92) 100%;
    background-size:calc((100vw - 71.875dvh)*1.92) 100%;
    animation:arrival 1.8s ease-out both;
  }
  .scene::before{left:0;background-position:left top}
  .scene::after{right:0;background-position:right top}
}
