.village-stage {
  position: relative;
  isolation: isolate;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: #21324a;
  pointer-events: none;
}

.village-stage .village-backdrop,
.village-characters,
.village-snow {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.village-stage .village-backdrop {
  display: block;
  max-width: none;
  object-fit: cover;
  user-select: none;
}

.village-characters,
.village-snow {
  isolation: isolate;
}

.village-actor {
  position: absolute;
  overflow: visible;
}

.village-stage .village-sticker {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center bottom;
  transform-origin: 50% 100%;
  user-select: none;
}

.village-shadow {
  position: absolute;
  bottom: -3.6%;
  left: 16%;
  width: 68%;
  height: 7.2%;
  background: radial-gradient(ellipse closest-side, rgb(34 44 67 / 34%), transparent);
}

.village-waiting {
  opacity: 0;
}

.village-arriving .village-sticker {
  animation: village-land 1700ms both;
}

.village-arriving .village-shadow {
  animation: village-shadow-in 1450ms ease-out both;
}

.village-arriving::before,
.village-arriving::after {
  content: "";
  position: absolute;
  bottom: 3%;
  width: clamp(5px, 15%, 23px);
  aspect-ratio: 1;
  background: #ffe9a0;
  clip-path: polygon(50% 0, 62% 37%, 100% 50%, 62% 62%, 50% 100%, 38% 62%, 0 50%, 38% 37%);
  animation: village-glint 550ms 1090ms ease-out both;
}

.village-arriving::before {
  left: 9%;
  --glint-x: -75%;
}

.village-arriving::after {
  right: 6%;
  bottom: 9%;
  --glint-x: 80%;
  animation-delay: 1150ms;
}

.village-snow {
  overflow: hidden;
}

.village-snow > i {
  position: absolute;
  top: 0;
  height: 100%;
  animation: village-snowfall 12s linear infinite;
}

.village-snow > i::before {
  content: "";
  display: block;
  width: 100%;
  aspect-ratio: 1;
  border-radius: 50%;
  background: #fff9e9;
}

@keyframes village-land {
  0% { opacity: 0; transform: translate(-13%, var(--fall-y)) rotate(-9deg) scale(0.94); animation-timing-function: cubic-bezier(.28,.02,.65,.55); }
  14% { opacity: 1; }
  58% { transform: translate(2%, -19%) rotate(5deg); animation-timing-function: ease-in; }
  68% { transform: translate(0, 0) rotate(-2deg) scale(1.035,.965); animation-timing-function: ease-out; }
  80% { transform: translate(0, -4.3%) rotate(1deg); animation-timing-function: ease-in; }
  91% { transform: translate(0, 0) scale(1.012,.988); animation-timing-function: ease-out; }
  100% { opacity: 1; transform: none; }
}

@keyframes village-shadow-in {
  0%, 40% { opacity: 0; transform: scale(0.65); }
  100% { opacity: 1; transform: none; }
}

@keyframes village-glint {
  0% { opacity: 0; transform: scale(.45); }
  30% { opacity: .95; }
  100% { opacity: 0; transform: translate(var(--glint-x), -170%) scale(.8); }
}

@keyframes village-snowfall {
  from { transform: translate3d(-6px, -2%, 0); }
  to { transform: translate3d(18px, 103%, 0); }
}

@keyframes village-materialize {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* The whole cutout travels with its contact shadow. Only the sticker lifts
   on each step. Resting intervals at both ends keep a crowded scene quiet. */
@media (prefers-reduced-motion: no-preference) {
  .village-actor:not(.village-waiting, .village-arriving) {
    animation: village-stroll var(--walk-cycle) var(--walk-delay) infinite;
  }
  .village-actor:not(.village-waiting, .village-arriving) .village-sticker {
    animation: village-steps var(--walk-cycle) var(--walk-delay) ease-in-out infinite;
  }
  .recap-stage .village-stage .village-actor,
  .recap-stage .village-stage .village-sticker {
    animation: none;
  }
}

@keyframes village-stroll {
  0%, 53%, 100% { transform: none; }
  20%, 33% { transform: translateX(var(--walk-x)); }
}

@keyframes village-steps {
  0%, 5%, 10%, 15%, 20%, 33%, 38%, 43%, 48%, 53%, 100% { transform: none; }
  2.5%, 12.5%, 40.5%, 50.5% { transform: translateY(-2.4%) rotate(-2.2deg); }
  7.5%, 17.5%, 35.5%, 45.5% { transform: translateY(-2.4%) rotate(2.2deg); }
}

@media (prefers-reduced-motion: reduce) {
  .village-snow,
  .village-arriving::before,
  .village-arriving::after { display: none; }
  .village-arriving .village-sticker,
  .village-arriving .village-shadow { animation: village-materialize 240ms ease-out both; }
}
