/* A world's room (#262): full-screen dialog over the hall, one template, per-world accent (--acc, from the cover photo). */
dialog.room { --acc: #f3d48e; position: fixed; inset: 0; width: 100vw; max-width: none; height: 100vh; height: 100dvh; max-height: none; margin: 0; padding: 0; border: 0;
  overflow-y: auto; overscroll-behavior: contain; color: #f4e6c4; background: #0b0710 radial-gradient(90% 60% at 50% 0%, color-mix(in srgb, var(--acc) 14%, transparent), transparent 70%); }
dialog.room::backdrop { background: rgba(5,3,8,.85); }
dialog.room[open] { animation: rm-in .5s ease both; }
@keyframes rm-in { from { opacity: 0; } to { opacity: 1; } }
.rm-x { position: fixed; top: 14px; right: 16px; z-index: 5; width: 44px; height: 44px; border-radius: 50%; border: 1px solid color-mix(in srgb, var(--acc) 60%, transparent); background: rgba(10,6,4,.7); color: #fff4dc; font-size: 18px; cursor: pointer; }
/* the arrival: the only full-height section */
.rm-arrival { position: relative; min-height: 100vh; min-height: 100svh; display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: end; gap: clamp(28px, 4vw, 64px); padding: 96px clamp(16px, 5vw, 72px) 72px; isolation: isolate; }
/* stepping into the photograph: full bleed, a very slow push (none under reduced motion) */
.rm-cover { position: absolute; inset: 0; z-index: -1; padding: 0; border: 0; background: #000; cursor: zoom-in; overflow: hidden; }
.rm-frame { position: absolute; inset: 0; display: block; }
.rm-cover img { width: 100%; height: 100%; object-fit: cover; display: block; transform-origin: 50% 40%; animation: rm-push 48s cubic-bezier(.2,.6,.3,1) both; }
@keyframes rm-push { from { transform: scale(1); } to { transform: scale(1.09); } }
/* the gilded frame the hall hangs its worlds in: gold moulding, a dark mat, a glow in the room's own colour */
.rm-gild { padding: 12px; background: linear-gradient(145deg, #5a3c14, #e8c47a 22%, #8a6224 48%, #f3d48e 72%, #6b4a1c); border: 0;
  box-shadow: 0 0 0 1px rgba(0,0,0,.6), 0 30px 70px rgba(0,0,0,.72), 0 0 90px color-mix(in srgb, var(--acc) 24%, transparent); }
.rm-gild img { border: 8px solid #140d06; outline: 1px solid rgba(243,212,142,.55); outline-offset: -9px; }
.rm-cover::after { content: ''; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(8,5,10,.15) 0%, rgba(8,5,10,0) 35%, rgba(8,5,10,.72) 70%, rgba(8,5,10,.96) 100%); }
.rm-arrival.is-poster .rm-cover { background: radial-gradient(80% 70% at 50% 40%, color-mix(in srgb, var(--acc) 22%, #120b06), #07050a); }
.rm-arrival.is-poster .rm-cover img { object-fit: contain; padding: 72px 16px 34vh; filter: drop-shadow(0 20px 50px rgba(0,0,0,.7)); animation: none; }
.rm-arrival.is-type .rm-vault { position: absolute; inset: 0; z-index: -1; background: radial-gradient(60% 50% at 50% 38%, rgba(243,212,142,.16), transparent 70%), url("/assets/metatron.svg") 50% 34% / min(62vw, 520px) no-repeat, #0b0710; opacity: .9; }
.rm-plate { max-width: 680px; align-self: end; padding: 22px 26px 24px; background: linear-gradient(180deg, rgba(28,18,8,.86), rgba(10,7,4,.92)); border: 1px solid color-mix(in srgb, var(--acc) 70%, transparent);
  box-shadow: 0 0 0 5px rgba(10,7,4,.55), 0 0 0 6px color-mix(in srgb, var(--acc) 30%, transparent), 0 24px 60px rgba(0,0,0,.6); }
.rm-when { margin: 0; font: 600 13px/1.3 'Montserrat', sans-serif; letter-spacing: .18em; text-transform: uppercase; color: var(--acc); }
.rm-plate h2 { margin: 6px 0 4px; font: 500 clamp(30px, 4.4vw, 58px)/1.05 'Cinzel', serif; color: #fff4dc; }
.rm-where { margin: 0 0 12px; font: 400 16px/1.4 'Lora', serif; color: rgba(244,230,196,.88); }
.rm-line, .rm-plate .chron { margin: 0; font: 400 16px/1.55 'Lora', serif; color: #f4e6c4; }
.rm-poster { margin: 0; align-self: end; }
.rm-poster button { display: block; cursor: zoom-in; }
/* one framed poster beside the plate: about half the arrival's height */
.rm-poster img { display: block; width: auto; height: 50svh; max-width: 34vw; object-fit: contain; background: #140d06; }
.rm-poster.is-wide img { height: auto; width: min(40vw, 720px); max-width: none; max-height: 50svh; }
/* the chronicle (a world's shows, one medallion each) has its own band under the arrival */
.rm-chron { padding: 56px clamp(16px, 5vw, 72px) 0; }
.rm-chron .chron { max-width: 1200px; margin: 0 auto; }
.rm-chron .chron-t { color: #f4e6c4; }
.rm-chron .chron-m { color: var(--acc); }
.rm-chron .chron-m b { background: #140d06; color: #f3d48e; }
/* the film, the inline photos, the gallery of lit frames, the acts */
.rm-film, .rm-inline, .rm-gallery, .rm-acts, .rm-cta { padding: 56px clamp(16px, 5vw, 72px) 0; }
.rm-film video { width: 100%; max-height: 80vh; background: #000; border: 1px solid color-mix(in srgb, var(--acc) 40%, transparent); }
.rm-film p { margin: 8px 0 0; font: 400 13px/1.4 'Lora', serif; color: rgba(244,230,196,.75); }
.rm-inline { display: grid; gap: 28px; }
.rm-inline figure, .rm-gallery figure { margin: 0; }
.rm-inline button, .rm-gallery button { display: block; width: 100%; padding: 0; border: 0; background: none; cursor: zoom-in; }
.rm-inline img { width: 100%; max-height: 86vh; object-fit: contain; background: #000; }
figcaption { margin-top: 8px; font: 400 13px/1.4 'Lora', serif; color: rgba(244,230,196,.78); }
.rm-track { display: flex; gap: clamp(16px, 3vw, 40px); overflow-x: auto; scroll-snap-type: x mandatory; padding: 12px 4px 24px; scrollbar-width: thin; scrollbar-color: var(--acc) transparent; }
.rm-track figure { flex: 0 0 auto; scroll-snap-align: center; }
.rm-track button { padding: 12px; background: linear-gradient(#2a1d10, #110b06); border: 1px solid color-mix(in srgb, var(--acc) 55%, transparent);
  box-shadow: 0 0 40px color-mix(in srgb, var(--acc) 18%, transparent), 0 20px 40px rgba(0,0,0,.6); transition: box-shadow .3s; }
.rm-track button:hover, .rm-track button:focus-visible { box-shadow: 0 0 60px color-mix(in srgb, var(--acc) 40%, transparent), 0 20px 40px rgba(0,0,0,.6); }
.rm-track img { display: block; height: auto; width: auto; max-height: min(74vh, 720px); max-width: min(86vw, 1240px); min-height: 320px; object-fit: contain; }
.rm-track figcaption { max-width: 60ch; }
.rm-acts ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 12px; }
.rm-acts a { display: inline-flex; align-items: center; min-height: 44px; padding: 0 18px; font: 500 15px/1.2 'Cinzel', serif; color: #fff4dc; text-decoration: none;
  border: 1px solid color-mix(in srgb, var(--acc) 60%, transparent); background: rgba(20,13,6,.7); }
.rm-acts a:hover, .rm-acts a:focus-visible { background: color-mix(in srgb, var(--acc) 20%, #140d06); }
.rm-cta { text-align: center; }
/* onward: previous · the worlds · next */
.rm-onward { position: relative; z-index: 4; margin-top: 72px; display: grid; grid-template-columns: 1fr auto 1fr; gap: 10px; align-items: center; padding: 12px clamp(16px, 5vw, 72px) calc(12px + env(safe-area-inset-bottom));
  padding-bottom: calc(28px + env(safe-area-inset-bottom)); border-top: 1px solid color-mix(in srgb, var(--acc) 25%, transparent); background: rgba(11,7,16,.94); }
.rm-onward button { min-height: 44px; padding: 0 14px; font: 500 14px/1.2 'Cinzel', serif; color: #f4e6c4; background: rgba(20,13,6,.85); border: 1px solid color-mix(in srgb, var(--acc) 50%, transparent); cursor: pointer; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rm-onward button:first-child { justify-self: start; max-width: 100%; }
.rm-onward button:last-child { justify-self: end; max-width: 100%; }
.rm-onward .rm-hall { color: #1a1006; background: linear-gradient(#f3d48e, #c9973f); border: 0; font-family: 'Montserrat', sans-serif; font-weight: 600; font-size: 12px; letter-spacing: .14em; text-transform: uppercase; }
@media (min-width: 761px) {
  .rm-arrival.is-poster { grid-template-columns: auto minmax(0, 1fr); align-items: center; padding-top: 72px; padding-bottom: 72px; }
  .rm-arrival.is-poster::before { content: ''; position: absolute; inset: 0; z-index: -1; background: radial-gradient(60% 70% at 28% 50%, color-mix(in srgb, var(--acc) 20%, transparent), transparent 70%); }
  .rm-arrival.is-poster .rm-cover { position: relative; inset: auto; z-index: 0; overflow: visible; background: none; justify-self: start; }
  .rm-arrival.is-poster .rm-frame { position: static; padding: 12px; background: linear-gradient(145deg, #5a3c14, #e8c47a 22%, #8a6224 48%, #f3d48e 72%, #6b4a1c);
    box-shadow: 0 0 0 1px rgba(0,0,0,.6), 0 30px 70px rgba(0,0,0,.72), 0 0 90px color-mix(in srgb, var(--acc) 24%, transparent); }
  .rm-arrival.is-poster .rm-frame img { border: 8px solid #140d06; outline: 1px solid rgba(243,212,142,.55); outline-offset: -9px; }
  .rm-arrival.is-poster .rm-cover img { height: min(80svh, calc(100svh - 168px)); width: auto; max-width: 52vw; padding: 0; filter: none; object-fit: contain; background: #140d06; }
  .rm-arrival.is-poster .rm-plate { align-self: center; }
}
@media (prefers-reduced-motion: reduce) { .rm-cover img { animation: none; } dialog.room[open] { animation: none; } }
@media (max-width: 760px) {
  dialog.room { padding-bottom: 0; }
  /* phones: the photograph stands clear in the top of the screen; the plate overlaps its lower third */
  .rm-arrival { grid-template-columns: 1fr; padding: 0 16px 28px; gap: 16px; min-height: 0; }
  .rm-cover { position: relative; inset: auto; z-index: 0; height: 64svh; margin: 0 -16px; }
  .rm-arrival.is-type .rm-vault { position: relative; inset: auto; z-index: 0; height: 52svh; margin: 0 -16px; }
  .rm-plate { position: relative; z-index: 1; margin-top: -22svh; }
  .rm-plate { padding: 16px 16px 18px; }
  .rm-poster { justify-self: center; }
  .rm-poster img, .rm-poster.is-wide img { height: auto; width: auto; max-width: 78vw; max-height: 46vh; }
  .rm-arrival.is-poster .rm-cover img { padding: 64px 12px 24svh; }
  .rm-track img { height: auto; width: 82vw; max-height: 62vh; }
  .rm-onward { position: fixed; left: 0; right: 0; bottom: 0; margin: 0; grid-template-columns: 1fr auto 1fr; padding: 10px 12px calc(10px + env(safe-area-inset-bottom)); border-top: 0; background: linear-gradient(180deg, rgba(11,7,16,0), rgba(11,7,16,.94) 30%); }
  .rm-chron { padding-top: 36px; }
  .rm-onward button { font-size: 13px; padding: 0 10px; }
  .rm-cta { padding-bottom: 96px; }
}
/* #266: the room in 3D (roomgl.js). Only with .rm-gl (WebGL, no reduced motion); without it the DOM room above stands alone. */
.rm-glc { position: fixed; inset: 0; z-index: 0; width: 100vw; height: 100vh; height: 100dvh; display: block; pointer-events: none; }
dialog.room.rm-gl { background: #0c080b; }
.rm-gl > header, .rm-gl > section, .rm-gl > .rm-cta { position: relative; z-index: 1; }
/* the arrival is the 3D plate: the DOM photo steps aside, its button stays (tap = the lightbox), the shade keeps the plate legible */
.rm-gl .rm-arrival:not(.is-poster) .rm-cover { background: transparent; }
.rm-gl .rm-arrival:not(.is-poster) .rm-cover img { opacity: 0; animation: none; }
/* the gallery hangs in the space: its section is the scroll distance, the frames are drawn; the DOM strip stays for the keyboard */
.rm-gl .rm-gallery { min-height: min(calc(var(--gn, 4) * 46vh), 480vh); }
.rm-gl .rm-track { opacity: 0; pointer-events: none; position: sticky; top: 30vh; }
.rm-gl .rm-track:focus-within { opacity: 1; pointer-events: auto; }
.rm-gl .rm-gallery { cursor: zoom-in; }
/* the poster on its wall, light falling on it from above and a slow glint across the gilt */
.rm-gl .rm-poster { position: relative; }
.rm-gl .rm-poster::before { content: ''; position: absolute; left: 0; right: 0; top: -40%; bottom: -10%; z-index: -1; pointer-events: none;
  background: radial-gradient(50% 60% at 50% 20%, color-mix(in srgb, var(--acc) 30%, transparent), transparent 70%); }
.rm-gl .rm-gild { position: relative; overflow: hidden; }
.rm-gl .rm-gild::after { content: ''; position: absolute; inset: 0; pointer-events: none; mix-blend-mode: screen;
  background: linear-gradient(100deg, transparent 38%, rgba(255,240,200,.28) 50%, transparent 62%); transform: translateX(-130%); animation: rm-glint 9s ease-in-out 1.4s infinite; }
@keyframes rm-glint { 0% { transform: translateX(-130%); } 35%, 100% { transform: translateX(130%); } }
/* the chronicle's medallions: engraved gold discs that catch the light in turn */
.rm-gl .rm-chron .chron-m { border-radius: 50%; color: #4a2c0e; overflow: hidden;
  background: radial-gradient(circle at 34% 28%, #fff3c4 0, #f0cf7e 18%, #c08a34 46%, #7a5018 74%, #4a2e10 100%);
  box-shadow: inset 0 0 0 3px rgba(80,50,16,.55), inset 0 0 0 5px rgba(255,236,180,.45), inset 0 -6px 14px rgba(40,22,6,.55), 0 10px 26px rgba(0,0,0,.55), 0 0 30px color-mix(in srgb, var(--acc) 22%, transparent); }
.rm-gl .rm-chron .chron-m svg { filter: drop-shadow(0 1px 0 rgba(255,244,210,.6)); opacity: .85; }
.rm-gl .rm-chron .chron-m b { background: rgba(30,18,6,.82); color: #f6dc96; }
.rm-gl .rm-chron .chron-m::after { content: ''; position: absolute; inset: 0; border-radius: 50%; pointer-events: none; mix-blend-mode: screen;
  background: linear-gradient(115deg, transparent 35%, rgba(255,250,225,.55) 50%, transparent 65%); transform: translateX(-140%); animation: rm-glint 7s ease-in-out infinite; animation-delay: calc(var(--k, 0) * .35s + 1.2s); }
@media (max-width: 760px) { .rm-gl .rm-gallery { min-height: min(calc(var(--gn, 4) * 58vh), 480vh); } }
/* the push-in cross-fades: while the 3D room arrives the dialog is clear, so the hall's frame shows until the plate covers it */
dialog.room.rm-glin { background: transparent; animation: none; }
dialog.room.rm-glin::backdrop { background: transparent; }
