/* Northern Mist Zone atmosphere, with denser mist over the upper Highlands.
   Loaded after the existing level styles; no shared forest files are changed.
   Both cloud images already exist in the game directory.
   Mist sits above the scene and below the clouds; the HUD stays above both. */
#world .highlands-mist {
  position: absolute;
  inset: 0;
  z-index: 20;
  pointer-events: none;
  opacity: var(--highlands-mist-opacity, .96);
  mix-blend-mode: screen;
  overflow: hidden;
  contain: layout paint;
  background: linear-gradient(to bottom,
    rgba(238, 248, 255, .40) 0%,
    rgba(238, 248, 255, .30) 24%,
    rgba(238, 248, 255, .16) 50%,
    rgba(238, 248, 255, .05) 76%,
    rgba(238, 248, 255, 0) 100%);
  -webkit-mask-image: linear-gradient(to bottom, #000 0%, #000 48%, rgba(0, 0, 0, .55) 75%, transparent 100%);
  mask-image: linear-gradient(to bottom, #000 0%, #000 48%, rgba(0, 0, 0, .55) 75%, transparent 100%);
}

#world .highlands-mist::before, #world .highlands-mist::after {
  content: "";
  position: absolute;
  left: -122px;
  top: -156px;
  width: 920px;
  height: 560px;
  pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%22920%22%20height%3D%22560%22%20viewBox%3D%220%200%20920%20560%22%3E%0A%3Cdefs%3E%0A%20%20%3CradialGradient%20id%3D%22haze%22%3E%0A%20%20%20%20%3Cstop%20offset%3D%220%22%20stop-color%3D%22%23eef8ff%22%20stop-opacity%3D%22.48%22%2F%3E%0A%20%20%20%20%3Cstop%20offset%3D%22.30%22%20stop-color%3D%22%23dcefff%22%20stop-opacity%3D%22.30%22%2F%3E%0A%20%20%20%20%3Cstop%20offset%3D%22.65%22%20stop-color%3D%22%23dcefff%22%20stop-opacity%3D%22.10%22%2F%3E%0A%20%20%20%20%3Cstop%20offset%3D%221%22%20stop-color%3D%22%23dcefff%22%20stop-opacity%3D%220%22%2F%3E%0A%20%20%3C%2FradialGradient%3E%0A%20%20%3Cfilter%20id%3D%22soft%22%20x%3D%22-20%25%22%20y%3D%22-40%25%22%20width%3D%22140%25%22%20height%3D%22180%25%22%20color-interpolation-filters%3D%22sRGB%22%3E%0A%20%20%20%20%3CfeTurbulence%20type%3D%22fractalNoise%22%20baseFrequency%3D%22.010%20.017%22%20numOctaves%3D%222%22%20seed%3D%2212%22%20result%3D%22noise%22%2F%3E%0A%20%20%20%20%3CfeDisplacementMap%20in%3D%22SourceGraphic%22%20in2%3D%22noise%22%20scale%3D%2242%22%20xChannelSelector%3D%22R%22%20yChannelSelector%3D%22G%22%2F%3E%0A%20%20%20%20%3CfeGaussianBlur%20stdDeviation%3D%2210%22%2F%3E%0A%20%20%3C%2Ffilter%3E%0A%3C%2Fdefs%3E%0A%3Cg%20fill%3D%22url%28%23haze%29%22%20filter%3D%22url%28%23soft%29%22%3E%0A%20%20%3Cellipse%20cx%3D%22200%22%20cy%3D%22250%22%20rx%3D%22250%22%20ry%3D%2295%22%2F%3E%0A%20%20%3Cellipse%20cx%3D%22610%22%20cy%3D%22340%22%20rx%3D%22280%22%20ry%3D%2280%22%2F%3E%0A%20%20%3Cellipse%20cx%3D%22660%22%20cy%3D%22140%22%20rx%3D%22210%22%20ry%3D%2265%22%2F%3E%0A%20%20%3Cellipse%20cx%3D%22360%22%20cy%3D%22440%22%20rx%3D%22240%22%20ry%3D%2270%22%2F%3E%0A%3C%2Fg%3E%0A%3C%2Fsvg%3E");
  background-repeat: no-repeat;
  background-size: 100% 100%;
  will-change: transform;
}

#world .highlands-mist::before {
  opacity: .96;
  transform: translate3d(-28px, -8px, 0);
  animation: highlands-mist-near-drift 52s ease-in-out -16s infinite alternate;
}

#world .highlands-mist::after {
  opacity: .64;
  transform: translate3d(34px, 10px, 0) scaleX(-1);
  animation: highlands-mist-far-drift 68s ease-in-out -31s infinite alternate;
}

@keyframes highlands-mist-near-drift {
  from {
    transform: translate3d(-28px, -8px, 0);
  }

  to {
    transform: translate3d(36px, 8px, 0);
  }

}

@keyframes highlands-mist-far-drift {
  from {
    transform: translate3d(34px, 10px, 0) scaleX(-1);
  }

  to {
    transform: translate3d(-32px, -6px, 0) scaleX(-1);
  }

}

#world .highlands-cloud {
  position: absolute;
  left: 0 !important;
  top: var(--cloud-top, 0px);
  opacity: .8;
  z-index: 21 !important;
  pointer-events: none !important;
  will-change: transform;
  animation-name: highlands-cloud-pass-676;
  animation-timing-function: linear;
  animation-iteration-count: infinite;
  animation-duration: var(--dur, 140s);
  animation-delay: var(--delay, 0s);
  filter: none !important;
}

#world .highlands-cloud .cloud-image {
  display: block;
  animation: none !important;
  transform: none !important;
  filter: none !important;
  box-shadow: none !important;
  will-change: auto;
}

@keyframes highlands-cloud-pass-676 {
  from {
    transform: translateX(calc(-1 * (var(--img-w, 260px) + 80px)));
  }

  to {
    transform: translateX(calc(676px + 80px));
  }

}

/* Retain the source images' natural 200 x 57 size without global image styles. */
#world .highlands-cloud .cloud-image {
  width: 200px;
  height: auto;
  max-width: none;
}

/* The shared forest engine toggles scene-paused when the document is hidden. */
.scene-paused #world .highlands-mist::before,
.scene-paused #world .highlands-mist::after,
.scene-paused #world .highlands-cloud {
  animation-play-state: paused !important;
}

@media (prefers-reduced-motion: reduce) {
  #world .highlands-mist::before,
  #world .highlands-mist::after {
    animation: none !important;
  }

  /* A fixed, visible cloud arrangement when movement is disabled. */
  #world .highlands-cloud {
    animation: none !important;
    transform: translateX(var(--still-x, 0px));
  }
}
