/* Four full-scene planes, independent of gameplay geometry. */
.challenge-scene {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  isolation: isolate;
  pointer-events: none;
  background: radial-gradient(ellipse at 78% 60%, #926636, #174850 48%, #102b35);
}
.challenge-scene .challenge-plane {
  position: absolute;
  inset: -14px;
  pointer-events: none;
  user-select: none;
}
.challenge-plane > img {
  display: block;
  width: 100%;
  height: 100%;
  max-width: none;
  object-fit: cover;
  object-position: center bottom;
  pointer-events: none;
  user-select: none;
}
.challenge-plane-distance { z-index: 0; }
.challenge-plane-architecture { z-index: 1; }
.challenge-plane-guide { display: none; pointer-events: none; }
.challenge-plane-foreground { z-index: 3; }
.challenge-plane-distance > img { filter: blur(4px) saturate(.82); }
.challenge-plane-architecture > img { filter: blur(2.5px) saturate(.86); }
.challenge-plane-foreground > img { filter: blur(1.5px) saturate(.9); }
.challenge-plane[data-failed="true"] { display: none; }
body:has(dialog[open]) .challenge-plane-guide { visibility: hidden; }
.challenge-scene::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 4;
  pointer-events: none;
  background:
    radial-gradient(ellipse at 74% 22%, #91ccc82e, transparent 58%),
    linear-gradient(90deg, #092d353d, #143c4433 60%, #092d3530);
}
/* Landscape uses the unchanged full-body source as a close thigh-up portrait.
   Source y=930 meets the viewport bottom; all lower legs and ground contact
   remain beyond the screen even at the parallax limits. The protected head
   through lantern span (x307..871) fits the space beside the play column.
   Portrait below keeps its already approved composition track. */
@media (min-width: 1100px) and (min-height: 700px) and (min-aspect-ratio: 5/4) {
  .challenge-plane-guide {
    display: block;
    position: fixed;
    z-index: 4;
    inset: auto;
    --challenge-guide-crop-height: min(calc(100dvh - 84px), calc((50vw - min(18vw, 302.4px) - 48px) * 1.6489361702));
    left: auto;
    right: calc(24px - var(--challenge-guide-crop-height) * .164516129);
    top: calc(100dvh - var(--challenge-guide-crop-height));
    bottom: auto;
    width: calc(var(--challenge-guide-crop-height) * 1.1010752688);
    height: calc(var(--challenge-guide-crop-height) * 1.6516129032);
    overflow: visible;
    border: 0;
    border-radius: 0;
    background: none;
  }
  .challenge-plane-guide > img {
    object-fit: contain;
    object-position: center top;
  }
}
/* The same transparent guide plane is hosted in the portrait scene track.
   Her close portrait matches the approved scale: hair, face and hand stay
   clear, while the lantern's lower base passes behind the foreground phrase.
   The full-body source remains intact, with no painted poster or frame. */
@media (max-aspect-ratio: 1/1) {
  .study-challenge-art .challenge-plane-guide {
    display: block;
    position: absolute;
    inset: auto;
    left: 50%;
    top: 6px;
    width: calc((var(--challenge-portrait-art-height) - 12px) * 1.5);
    height: calc((var(--challenge-portrait-art-height) - 12px) * 2.25);
    transform: translateX(-50%);
    z-index: 0;
    pointer-events: none;
  }
  .study-challenge-art .challenge-plane-guide > img {
    object-fit: contain;
    object-position: center top;
  }
}
/* Frame Olga close up in the compact notebook. The hair can rise above the
   paper while the board crops the lower silhouette, leaving the face,
   lantern glow and gripping hand visible. */
@media (min-width: 700px) and (min-height: 700px) and (min-aspect-ratio: 4/5) and (max-aspect-ratio: 1249/1000) {
  .study-challenge-art .challenge-plane-guide {
    display: block;
    position: absolute;
    inset: auto;
    left: 50%;
    top: 6px;
    width: min(100%, calc((var(--challenge-square-header-height) + var(--challenge-guide-overhang) - 12px) * 1.375));
    height: auto;
    aspect-ratio: 2 / 3;
    transform: translateX(-64%);
    z-index: 0;
  }
  .study-challenge-art .challenge-plane-guide > img {
    object-fit: contain;
    object-position: center top;
  }
}
@media (prefers-reduced-motion: reduce) {
  .challenge-plane { translate: none !important; }
}
