.world-media {
  position: relative;
  overflow: hidden;
  isolation: isolate;
  background: #16322c;
  aspect-ratio: 16 / 9;
}
.world-media img, .world-light {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.world-media.scene-enter img { animation: forest-reveal .62s ease-out both; }
.world-light {
  opacity: 0;
  pointer-events: none;
  background: radial-gradient(ellipse at 56% 76%, #ffe6a3c4, #ffc36959 24%, transparent 65%);
  mix-blend-mode: screen;
}
.world-media.step-light .world-light { animation: amber-step .52s ease-out; }
.world-heading { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.world-heading .quiet { flex: none; }
.world-copy p { margin-top: 4px; }
.tracks li {
  border-radius: 50% 50% 40% 40%;
  transform: rotate(-20deg) scaleX(.78);
  justify-self: center;
  width: clamp(9px, 2vw, 17px);
}
.tracks .is-lit { box-shadow: 0 0 9px #ffc47188; }
.scene-preview { width: min(840px, calc(100% - 28px)); max-height: calc(100% - 24px); }
.scene-preview header, .scene-controls { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.scene-preview img { width: 100%; height: auto; display: block; border-radius: 9px; margin-block: 12px; }
.scene-preview h2 { font-size: clamp(20px, 4vw, 30px); }
.scene-controls .button { min-width: 102px; }

.forest-finale {
  position: fixed;
  inset: 0;
  width: 100%;
  max-width: none;
  height: 100%;
  max-height: none;
  margin: 0;
  padding: 15px;
  border: 0;
  border-radius: 0;
  isolation: isolate;
  overflow: hidden;
  background: #101a17;
}
.forest-finale[open] { display: grid; align-items: end; justify-items: center; }
.finale-backdrop {
  position: absolute;
  inset: 0;
  z-index: -2;
  background: linear-gradient(0deg, #111916 3%, #1119169c 31%, transparent 73%),
    url("../images/cave.webp") center / cover no-repeat;
}
.forest-finale[open] .finale-backdrop { animation: cave-focus 4.4s ease-out both; }
.finale-crystal {
  position: absolute;
  left: 50%;
  top: 43%;
  width: clamp(65px, 14vw, 176px);
  aspect-ratio: 1 / 1.15;
  transform: translate(-50%, -50%);
  transform-origin: center;
  filter: drop-shadow(0 0 27px #ffd67d7f);
}
.finale-crystal::before, .finale-crystal::after { content: ""; position: absolute; inset: 0; }
.finale-crystal::before {
  background: conic-gradient(from 60deg at 48% 52%, #ffd885, #c37632, #e9a24c, #fff0bc, #d98634, #ffd885);
  clip-path: polygon(49% 0,84% 18%,98% 58%,68% 93%,37% 100%,0 71%,12% 27%);
}
.finale-crystal::after {
  clip-path: polygon(49% 4%,66% 51%,37% 97%,27% 50%);
  background: linear-gradient(145deg,#fff4be,#ffc05538);
}
.forest-finale[open] .finale-crystal { animation: amber-rise 4.4s cubic-bezier(.18,.73,.25,1) both; }
.finale-path { position: absolute; inset: 0; z-index: -1; pointer-events: none; }
.finale-path i {
  --cx: 14%; --cy: 81%; --delay: .23s;
  position: absolute;
  left: var(--cx);
  top: var(--cy);
  width: clamp(50px,13vw,175px);
  aspect-ratio: 1;
  transform: translate(-50%,-50%);
  background: radial-gradient(circle,#fff3be90 0%,#f9ac4d50 19%,transparent 69%);
  opacity: 0;
}
.finale-path i:nth-child(2) { --cx: 28%; --cy: 69%; --delay: .64s; }
.finale-path i:nth-child(3) { --cx: 42%; --cy: 58%; --delay: 1.05s; }
.finale-path i:nth-child(4) { --cx: 50%; --cy: 43%; --delay: 1.46s; }
.forest-finale[open] .finale-path i { animation: amber-step 1.2s var(--delay) ease-out both; }
.finale-copy { max-width: calc(100vw - 30px); text-align: center; padding: 0 0 clamp(3px,3vh,24px); }
.finale-copy h2 { color: #ffe3aa; font: 800 clamp(34px,7vw,88px)/1 Georgia,serif; margin: 7px 0; text-shadow: 0 3px 24px #171b16; }
.finale-copy .button { margin-top: 6px; }
@keyframes forest-reveal { from{opacity:.52;transform:scale(1.035)}to{opacity:1;transform:none} }
@keyframes amber-step { 0%,100%{opacity:0}38%{opacity:1} }
@keyframes cave-focus { from{transform:scale(1.06);filter:brightness(.71)}to{transform:none;filter:brightness(1)} }
@keyframes amber-rise {
  0%,18%{opacity:0;transform:translate(-50%,60%) scale(.48) rotate(-16deg)}
  54%{opacity:1;transform:translate(-50%,-52%) scale(1.12) rotate(8deg)}
  100%{opacity:1;transform:translate(-50%,-50%) rotate(3deg)}
}
@media (max-width: 450px) {
  .world-heading { flex-wrap: wrap; }
  .scene-preview { padding: 11px; }
}
@media (max-height: 410px) and (orientation: landscape) {
  .finale-crystal { top: 31%; width: 73px; }
  .finale-copy { padding: 0; }
  .finale-copy h2 { font-size: clamp(28px,8vh,60px); }
  .finale-copy p { margin-block: 4px; }
}
@media (prefers-reduced-motion: reduce) {
  .world-media.scene-enter img, .world-media.step-light .world-light, .forest-finale[open] .finale-backdrop,
  .forest-finale[open] .finale-path i, .forest-finale[open] .finale-crystal { animation: none; }
}

.finale-manta {
  position: absolute; top: 24%; left: 0; width: clamp(162px,30vw,474px); height: auto;
  pointer-events: none; opacity: 0; filter: brightness(.75) drop-shadow(0 0 26px #77ddf288);
}
.forest-finale[open] .finale-manta { animation: portal-swim 4s 2s ease-in-out both; }
@keyframes portal-swim {
  0% { opacity: 0; transform: translate(-45vw,5vh) rotate(9deg); }
  25%,65% { opacity: .82; }
  100% { opacity: 0; transform: translate(110vw,-12vh) rotate(-10deg); }
}
@media (prefers-reduced-motion:reduce) {
  .forest-finale[open] .finale-manta { opacity: .78; left: 66%; animation: none; }
}
