.room-view{display:block;margin-top:8px;min-height:44px;padding:8px 12px;background:#17231ee8;border:1px solid #e0c39680;border-radius:2px;color:#fff8ed;font:inherit;font-size:.8125rem;cursor:pointer}
.room-view[hidden]{display:none}
.stage[data-room=true] .chapter-copy{visibility:hidden}
.stage[data-room=true] .scene-shade{opacity:0}
.stage[data-room=true] .fallback{left:var(--room-x,0);top:var(--room-y,0);width:var(--room-w,100%);height:var(--room-h,100%);object-fit:var(--room-fit,contain);object-position:var(--room-position,center);background:#101712}
@media(max-width:900px),(max-height:649px){
 .stage[data-room=true] .scene-caption{top:var(--room-caption-y);bottom:auto;left:16px;font-size:.75rem;background:none;padding:0;max-width:calc(100% - 32px)}
 .stage[data-room=true] .intro{visibility:hidden}
 .stage[data-room=true][data-room-landscape=true] .control-panel{left:auto;right:16px;top:var(--room-controls-top);bottom:auto;width:316px}
 .stage[data-room=true][data-room-landscape=true] .scene-caption{max-width:calc(100% - 364px)}
 .stage[data-room=true][data-room-landscape=true] .demo-note{display:none}
}
@media(max-width:700px){.stage[data-room=true] .control-panel{bottom:16px}.stage[data-room=true] .demo-note{display:none}}
/* Share a row for chapter transport and framing, leaving the room enough
   height on short portrait phones. All controls retain 44px touch targets. */
@media(max-width:900px) and (orientation:portrait){
 .journey:not(.still) .stage[data-room=true] .control-panel{top:var(--room-controls-top);bottom:auto}
 .stage[data-room=true] .control-panel{display:grid;grid-template-columns:minmax(0,1fr) auto;column-gap:12px}
 .stage[data-room=true] .scene-caption{grid-column:1/-1;grid-row:1}
 .stage[data-room=true] .chapter-buttons{grid-column:1/-1;grid-row:2}
 .stage[data-room=true] .transport{grid-column:1;grid-row:3;min-width:0}
 .stage[data-room=true] .room-view{grid-column:2;grid-row:3;margin:6px 0 0;align-self:center}
 .stage[data-room=true] .timeline{grid-column:1/-1;grid-row:4}
 .journey.still .stage[data-room=true] .timeline{grid-column:1;grid-row:3}
}
.timeline input[type=range]{touch-action:pan-y}
.journey.still{height:max(100svh,620px)}.journey.still .stage{height:max(100svh,620px);min-height:620px;top:0}

/* Desktop room story: a single image, with its navigation at the lower edge. */
@media(min-width:1100px) and (min-height:650px){
 .stage[data-room=true]{background:#141b17}
 .stage[data-room=true] .control-panel{left:var(--room-rail-x);right:auto;top:var(--room-rail-y);bottom:auto;width:var(--room-rail-w);box-sizing:border-box;padding:8px 24px 10px;display:grid;grid-template-columns:1fr auto;gap:0 24px;background:#111916eb}
 .stage[data-room=true] .scene-caption{position:static;grid-column:1;grid-row:1;margin:0;max-width:none;padding:0;background:none;font-size:.8125rem;align-self:center}
 .stage[data-room=true] .scene-caption span{background:none;padding:0}
 .stage[data-room=true] .chapter-buttons{grid-column:1;grid-row:2;display:flex;gap:24px;justify-content:flex-start;overflow:visible}
 .stage[data-room=true] .chapter-buttons button{font-size:.8125rem;white-space:nowrap;padding:8px 0;min-height:44px}
 .stage[data-room=true] .transport{grid-column:2;grid-row:1;border:0;margin:0}
 .stage[data-room=true] .timeline{grid-column:2;grid-row:2;width:280px;gap:12px}
 .stage[data-room=true] .timeline input{height:44px}
 .stage[data-room=true] .demo-note{left:24px;bottom:12px;max-width:calc((100% - var(--room-w))/2 - 36px);font-size:10px;line-height:1.5}
 .stage[data-room=true] #chapter-count{min-width:48px;margin-left:16px}
 .journey.still .stage[data-room=true] .timeline{grid-row:1/3}
}
@media(min-width:1100px) and (min-height:650px) and (max-height:760px){
 .stage[data-room=true] .control-panel{padding:4px 16px 6px;column-gap:16px}
 .stage[data-room=true] .chapter-buttons{gap:16px}
 .stage[data-room=true] .timeline{width:220px}
}

/* Enlarged reading text gets its own measured row, never an oversized image overlay. */
@media(min-width:1100px) and (min-height:650px){
 .stage[data-room=true][data-room-reflow=true] .control-panel{left:24px;width:calc(100% - 48px)}
 .stage[data-room=true][data-room-reflow=true] .chapter-buttons{flex-wrap:wrap}
 .stage[data-room=true][data-room-reflow=true] .demo-note{display:none}
}
