/* All eight PSD scenes keep their original paper and transformed coordinates. */
/* Explicit scene aspect ratios retain scroll geometry while offscreen content rests. */
.map-legacy .journey-stop { content-visibility: auto; }
.journey-stop.is-hy-ready > img { visibility: hidden; }
.journey-stop.is-hy-ready > .image-fallback,
.journey-stop.is-hy-ready.is-map-loading::before,
.journey-stop.is-hy-ready.is-map-arriving::before { display: none; }
.hy-scene {
  position: absolute;
  z-index: 1;
  inset: 0;
  visibility: hidden;
  pointer-events: none;
}
.journey-stop.is-hy-ready .hy-scene { visibility: visible; }
.hy-camera {
  position: absolute;
  inset: 0;
  perspective: 1100px;
  perspective-origin: var(--hy-cx, 73.4667%) var(--hy-cy, 46.3978%);
  transform-style: preserve-3d;
}
.hy-world, .hy-flight-world {
  position: absolute;
  inset: 0;
  transform-style: preserve-3d;
}
.hy-background { position: absolute; inset: 0; }
.hy-background > img, img.hy-background {
  display: block;
  width: 100%;
  height: 100%;
  max-width: none;
  object-fit: cover;
}
.hy-landmark, .hy-world > .hy-shadow, .hy-flight-world > .hy-shadow {
  position: absolute;
  left: var(--hy-left, 46.9333%);
  top: var(--hy-top, 32.38916%);
  width: var(--hy-width, 58.1333%);
  height: var(--hy-height, 28.01724%);
}
.hy-landmark {
  transform-style: preserve-3d;
  transform-origin: 50% 50%;
}
.hy-lift, .hy-tilt {
  position: absolute;
  inset: 0;
  transform-style: preserve-3d;
  transform-origin: 50% 50%;
}
.hy-tilt > img {
  display: block;
  width: 100%;
  height: 100%;
  max-width: none;
  object-fit: fill;
  backface-visibility: hidden;
}
/* Keep the paper edge and soft lift on Hongyadong's existing image only. */
#spot-hongyadong .hy-tilt > img {
  filter: drop-shadow(0 1px 0 rgba(102, 66, 32, .22))
    drop-shadow(1px 6px 6px rgba(57, 43, 29, .24));
}
/* This filter belongs to the shadow image, never a preserve-3d wrapper. */
.hy-shadow {
  display: block;
  max-width: none;
  object-fit: fill;
  opacity: .12;
  filter: brightness(0) blur(4px);
  transform: translate3d(3px, 6px, 0);
  pointer-events: none;
}
.hy-landmark > .hy-shadow { position: absolute; inset: 0; width: 100%; height: 100%; }

/* The detail scrolls independently while the map stays at its saved position. */
.hy-detail {
  position: fixed;
  z-index: 1000;
  inset: 0;
  overflow: hidden;
  background: #153c68;
}
.hy-detail[hidden] { display: none !important; }
.hy-detail.is-preparing { visibility: hidden; pointer-events: none; }
.hy-detail-scroll {
  width: 100%;
  height: 100%;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior-y: contain;
  -webkit-overflow-scrolling: touch;
}
.hy-detail .detail-canvas {
  min-height: 100%;
  background: var(--paper);
}
.hy-detail .detail-back {
  position: fixed;
  z-index: 30;
  top: max(16px, env(safe-area-inset-top));
  left: max(16px, calc((100vw - 520px) / 2 + 16px));
}
.hy-detail .hy-detail-hero { position: relative; }
.hy-detail .detail-title, .hy-detail .detail-sheet { animation: none; }
.hy-detail .detail-sheet { box-shadow: 0 -3px 12px rgba(78,50,14,.06); }
body.is-hy-detail > .map-nav { visibility: hidden; pointer-events: none; }

/* A fixed visual proxy moves with transforms; JS sets its initial rectangle once. */
.hy-flight {
  position: fixed;
  z-index: 1001;
  overflow: hidden;
  background: var(--paper);
  perspective: 1100px;
  perspective-origin: var(--hy-cx, 73.4667%) var(--hy-cy, 46.3978%);
  transform-origin: 0 0;
  pointer-events: none;
}
.hy-flight-world { transform-origin: 0 0; }
.hy-flight[hidden] { display: none !important; }
.hy-flight-image {
  display: block;
  width: 100%;
  height: 100%;
  max-width: none;
  object-fit: cover;
}

@media (hover: none), (pointer: coarse) {
  .hy-camera, .hy-flight { perspective: 1400px; }
}
@media (max-width: 340px) {
  .hy-detail .collect-row { flex-wrap: wrap; gap: 12px; }
  .hy-detail .collect-button { flex: 1 0 100%; }
  .hy-detail .detail-title > p:last-child { font-size: 13px; }
}
@media (orientation: landscape) and (max-height: 520px) {
  .hy-detail .hy-detail-hero:not(.is-image-error) {
    height: 78vh;
    height: 78svh;
    min-height: 260px;
    max-height: 420px;
  }
  .hy-detail .detail-title { bottom: 26px; }
  .hy-detail .detail-title h1 { font-size: 36px; }
  .hy-detail .detail-title > p:last-child { font-size: 13px; }
}
@media (prefers-reduced-motion: reduce) {
  .hy-scene *, .hy-detail *, .hy-flight * {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
  }
  .hy-scene .hy-world, .hy-scene .hy-landmark, .hy-scene .hy-lift, .hy-scene .hy-tilt { transform: none !important; }
  .hy-flight { display: none !important; }
}
