/* ══════════════════════════════════════════════════════════════
   Room slider — turns a room built from vw/vh-positioned elements
   into a fixed-size "stage" that pans horizontally on portrait /
   vertical viewports, instead of squeezing everything into a
   narrow stacked layout. The nav bar stays outside this wrapper
   so it never moves.

   Usage in a room page:
     1. Include this file + room-slider.js.
     2. Wrap every room element (everything except .room-nav and
        any modal/popup overlays) like so:
          <div class="room-scroll"><div class="room-stage">
            ...room-lines, back-wall, wall art, characters...
          </div></div>
     3. In that room's own <style>, change any vw -> cqw and
        vh/dvh -> cqh used to POSITION those elements (rules that
        already use % or custom properties for --bw-* need no
        change — percentages resolve against the stage automatically).
     4. Optionally set --room-stage-width on :root to tune how wide
        the virtual room is when panned (default 1300px).
   ══════════════════════════════════════════════════════════════ */

.room-scroll {
  position: fixed;
  inset: 0;
  overflow: hidden;
}

.room-stage {
  position: relative;
  width: 100vw;
  height: 100dvh;
  container-type: size;
  container-name: room;
}

@media (orientation: portrait) {
  .room-scroll {
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
  }
  .room-stage {
    width: var(--room-stage-width, 1300px);
    height: 100%;
  }
}

/* ── "scroll to explore" hint popup ── */
.room-hint-overlay {
  position: fixed; inset: 0; z-index: 500;
  background: rgba(0, 0, 0, 0.4);
  display: none; align-items: center; justify-content: center;
  padding: 20px;
}
.room-hint-overlay.open { display: flex; }
.room-hint-popup {
  position: relative;
  background: #f5f0ea;
  box-shadow: 0 0 0 3px #6579e2, 0 0 0 6px #83d2e6, 4px 8px 28px rgba(0, 0, 0, 0.35);
  max-width: min(86vw, 340px);
  padding: 28px 24px 22px;
  text-align: center;
  font-family: var(--font-hand, "ZoesHandwriting", cursive);
  animation: roomHintPopIn 0.25s ease both;
}
@keyframes roomHintPopIn {
  from { opacity: 0; transform: translateY(-8px) scale(0.96); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}
.room-hint-icon { font-size: 28px; margin-bottom: 10px; }
.room-hint-text { font-size: clamp(16px, 4vw, 19px); color: #2a1e14; line-height: 1.5; }
.room-hint-close {
  position: absolute; top: 6px; right: 10px;
  cursor: pointer; color: #aaa; font-size: 16px; padding: 4px; line-height: 1;
  background: none; border: none; font-family: inherit;
}
.room-hint-close:hover { color: #6579e2; }
