/* Fullscreen "theater" pan/zoom overlay for the cached level images.
   The "Pan & zoom" button moves #level-images-wrapper into #panzoom-stage and
   shows this fixed, viewport-filling overlay. A translate+scale transform on
   .panzoom-scale drives pan (drag) and zoom (wheel). When closed, the wrapper
   goes back to normal document flow with no transform. */

#panzoom-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgba(0, 0, 0, 0.9);
}
#panzoom-overlay.open {
  display: block;
}

/* The clipped pan surface fills the overlay. */
#panzoom-stage {
  position: absolute;
  inset: 0;
  overflow: hidden;
  cursor: grab;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
}
#panzoom-stage.panzoom-grabbing {
  cursor: grabbing;
}

/* While in the overlay the wrapper fills the stage and the scaled content is
   pinned to its top-left so the JS translate positions it from (0,0). */
#panzoom-stage #level-images-wrapper {
  position: absolute;
  inset: 0;
}
#panzoom-stage .panzoom-scale {
  position: absolute;
  top: 0;
  left: 0;
  transform-origin: 0 0;
  will-change: transform;
}

#panzoom-close {
  position: absolute;
  top: 12px;
  right: 16px;
  z-index: 2;
  width: 40px;
  height: 40px;
  font-size: 24px;
  line-height: 1;
  color: #fff;
  background: rgba(0, 0, 0, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.4);
  border-radius: 4px;
  cursor: pointer;
}
#panzoom-close:hover {
  background: rgba(255, 255, 255, 0.2);
}

#panzoom-hint {
  position: absolute;
  bottom: 12px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 2;
  padding: 4px 10px;
  font-size: 13px;
  color: #fff;
  background: rgba(0, 0, 0, 0.5);
  border-radius: 4px;
  pointer-events: none;
  white-space: nowrap;
}

/* Nearest-neighbour scaling so zoomed pixel art stays crisp. */
img.cached-image {
  image-rendering: crisp-edges;
  image-rendering: pixelated;
  -webkit-user-drag: none;
}
