/* Physical stage lighting. Keep this layer below the objects and readable UI.
   Parent motion hooks: data-phase, data-tier, w-blackout, w-impact, w-has-result. */
.room-lighting{--rl-white:191 225 255;--rl-power:1;--rl-left-angle:-17deg;--rl-right-angle:17deg;position:absolute;inset:0;z-index:-1;pointer-events:none;user-select:none;isolation:isolate;opacity:1;transition:opacity .55s ease;contain:layout style}
.pack-theatre>.room-lighting{top:-36px;bottom:0}
.room-lighting span,.room-lighting i{display:block;position:absolute;pointer-events:none}
.room-lighting .rl-rail{left:23%;right:23%;top:0;height:3px;border-radius:2px;background:linear-gradient(90deg,transparent,#223653 8%,#4a688e 50%,#223653 92%,transparent);box-shadow:0 1px 0 #8aafd333,0 -3px 10px #0005;opacity:.9}
.room-lighting .rl-lamp{inset:0;--rl-source:36%;--rl-angle:var(--rl-left-angle);--rl-spread:35%;--rl-strength:.58}
.room-lighting .rl-lamp-centre{--rl-source:50%;--rl-angle:0deg;--rl-spread:24%;--rl-strength:.24}
.room-lighting .rl-lamp-right{--rl-source:64%;--rl-angle:var(--rl-right-angle);--rl-spread:35%;--rl-strength:.52}
.room-lighting .rl-fixture{left:var(--rl-source);top:1px;width:42px;height:24px;transform:translateX(-50%) rotate(calc(var(--rl-angle)*.65));transform-origin:50% 0;z-index:3;transition:transform 1.2s cubic-bezier(.22,1,.36,1)}
.room-lighting .rl-yoke{left:9px;right:9px;top:-2px;height:15px;border:3px solid #111f34;border-top:0;border-radius:0 0 7px 7px;box-shadow:inset 0 -1px 0 #7392b047}
.room-lighting .rl-housing{left:2px;right:2px;top:7px;height:18px;border:1px solid #607e9c94;border-radius:5px 5px 8px 8px;background:linear-gradient(90deg,#12243b,#385572 34%,#1b3450 70%,#0e1b30);box-shadow:0 5px 10px #02081680,inset 0 2px 0 #88a9c441}
.room-lighting .rl-housing:before{content:"";position:absolute;inset:3px 4px 7px;border-top:1px solid #0b172c;border-bottom:1px solid #6686a33b;background:repeating-linear-gradient(90deg,transparent 0 3px,#101d31aa 3px 4px)}
.room-lighting .rl-lens{left:6px;right:6px;bottom:-2px;height:5px;background:#e5f4ff;border-radius:50%;box-shadow:0 2px 7px 2px rgb(var(--rl-white)/.65),0 4px 17px 5px rgb(var(--rl-white)/.22);transition:background .4s,box-shadow .5s,opacity .25s}
.room-lighting .rl-beam{left:var(--rl-source);top:25px;width:var(--rl-spread);height:calc(100% - 28px);transform-origin:50% 0;transform:translateX(-50%) rotate(var(--rl-angle));opacity:calc(var(--rl-strength)*var(--rl-power));filter:blur(10px);mask-image:linear-gradient(180deg,transparent 0,#000 3%,#000 68%,#0007 85%,transparent 100%);transition:transform 1.2s cubic-bezier(.22,1,.36,1),opacity .6s;will-change:transform}
.room-lighting .rl-beam>i{inset:0;background:linear-gradient(180deg,rgb(var(--rl-white)/.38),rgb(var(--rl-white)/.30) 28%,rgb(var(--rl-white)/.14) 74%,transparent);clip-path:polygon(47% 0,53% 0,100% 100%,0 100%)}
.room-lighting .rl-beam:after{content:"";position:absolute;inset:0 14%;background:linear-gradient(180deg,rgb(var(--rl-white)/.15),rgb(var(--rl-white)/.085) 65%,transparent);clip-path:polygon(48% 0,52% 0,100% 100%,0 100%)}
.room-lighting .rl-haze{inset:0 -8% -3%;z-index:0;background:radial-gradient(ellipse at 50% 48%,rgb(var(--rl-white)/.07),transparent 52%);opacity:.9;transition:opacity .7s;filter:blur(18px)}
.room-lighting .rl-floor{left:50%;bottom:-1%;width:min(660px,76%);height:16%;min-height:52px;transform:translateX(-50%);z-index:1;opacity:.95;transition:opacity .6s,transform 1s cubic-bezier(.22,1,.36,1)}
.room-lighting .rl-pool{top:10%;height:75%;width:52%;border-radius:50%;background:radial-gradient(ellipse,rgb(var(--rl-white)/.25),rgb(var(--rl-white)/.11) 35%,transparent 72%);filter:blur(5px);mix-blend-mode:screen}
.room-lighting .rl-pool-left{left:12%;transform:rotate(-6deg)}
.room-lighting .rl-pool-right{right:12%;transform:rotate(6deg)}
.room-lighting .rl-pool-centre{left:27%;top:2%;width:46%;height:84%;background:radial-gradient(ellipse,rgb(var(--rl-white)/.29),rgb(var(--rl-white)/.12) 40%,transparent 72%)}
.room-lighting .rl-floor-core{left:35%;right:35%;top:30%;height:32%;border-radius:50%;background:rgb(var(--rl-white)/.18);filter:blur(12px)}
.room-lighting .rl-reflection{left:25%;right:25%;bottom:-4%;height:14%;background:radial-gradient(ellipse at 50% 0,rgb(var(--rl-white)/.15),transparent 70%);filter:blur(14px);opacity:.7;transform:scaleY(.75);transform-origin:50% 0;transition:opacity .6s}
.room-lighting .rl-wall-wash{inset:-35% -15% -20%;z-index:-1;background:radial-gradient(ellipse at 50% 53%,rgb(var(--rl-white)/.24),rgb(var(--rl-white)/.08) 42%,transparent 72%);opacity:0;transition:opacity .8s;filter:blur(12px)}

/* Slow rig movement while browsing. The fixture and its beam turn together. */
.rip-room .rl-lamp-left .rl-beam,.rip-room .rl-lamp-left .rl-fixture{animation:rl-sweep-left 13s ease-in-out infinite alternate}
.rip-room .rl-lamp-right .rl-beam,.rip-room .rl-lamp-right .rl-fixture{animation:rl-sweep-right 16s ease-in-out -4s infinite alternate}
.rip-room .rl-fixture{--rl-sweep-scale:.65}
.rip-room .rl-beam{--rl-sweep-scale:1}
.rip-room .rl-lamp-centre .rl-beam{opacity:.26}
.rip-room:before{background-image:linear-gradient(180deg,#020919d1 0%,#0310278a 24%,#06152e34 43%,#040d21e8 78%,#040b1df7 100%),var(--world-background)}
.rip-room:after{background:radial-gradient(ellipse at 50% 39%,transparent 12%,#01081744 49%,#010617a6 100%)}
.rip-room .hero-pack{filter:drop-shadow(10px 20px 16px #030d2599) drop-shadow(-4px -3px 9px #c3e7ff22)}
.rip-room .hero-pack .foil-material{filter:brightness(1.055) contrast(1.025)}
.rip-room .hero-pack .foil-shine{opacity:.72;background:linear-gradient(105deg,transparent 8%,#ffffff04 27%,#ffffffb3 44%,#ffffff1c 52%,transparent 75%)}
.rip-room .plinth>span{background:radial-gradient(ellipse at 50% 40%,#a8d4f4,#628cb8 43%,#365f8b 77%);box-shadow:inset 0 2px 2px #e1f2ff60,0 -6px 18px #c7e7ff18}
.rip-room.is-selecting .rl-lamp-centre .rl-beam{animation:rl-selection-focus .65s ease-out both}

/* The opening controller drives these phases; this layer never selects a tier. */
.world-opening .room-lighting{--rl-left-angle:-18deg;--rl-right-angle:18deg}
.world-opening[data-phase="sealed"] .rl-lamp-left .rl-beam{animation:rl-opening-idle 9s ease-in-out infinite alternate}
.world-opening[data-phase="sealed"] .rl-lamp-right .rl-beam{animation:rl-opening-idle 11s ease-in-out -3s infinite alternate-reverse}
.world-opening:is([data-phase="tearing"],[data-phase="anticipating"],[data-phase="charging"]) .room-lighting{--rl-left-angle:-24deg;--rl-right-angle:24deg;--rl-power:1.2}
.world-opening[data-phase="anticipating"] .rl-lamp-centre .rl-beam{opacity:.12}
.world-opening[data-phase="anticipating"] .rl-floor{opacity:1}
.world-opening[data-phase="charging"] .room-lighting{--rl-power:1.65}
.world-opening[data-phase="charging"] .rl-lamp-centre .rl-beam{opacity:.65}
.world-opening[data-phase="charging"] .rl-haze{opacity:1.2}
.world-opening[data-phase="charging"] .rl-floor{opacity:1;transform:translateX(-50%) scaleX(.82)}
.world-opening[data-phase="charging"] .rl-wall-wash{opacity:.24}
.world-opening[data-phase="charging"][data-tier="big"] .rl-wall-wash{opacity:.42}
.world-opening[data-phase="charging"][data-tier="chase"] .room-lighting{--rl-power:2}
.world-opening[data-phase="charging"][data-tier="chase"] .rl-wall-wash{opacity:.6}
.world-opening:is([data-phase="emerging"],[data-phase="flipping"]) .room-lighting{--rl-left-angle:-20deg;--rl-right-angle:20deg;--rl-power:1.1}
.world-opening[data-phase="revealed"] .room-lighting{--rl-left-angle:-15deg;--rl-right-angle:15deg;--rl-power:.85}
.world-opening.w-has-result:is([data-tier="big"],[data-tier="chase"]) .room-lighting{--rl-white:249 219 158;--rl-power:1.1}
.world-opening.w-has-result:is([data-tier="big"],[data-tier="chase"]) .rl-wall-wash{opacity:.16}
.world-opening.w-blackout .room-lighting{opacity:.035;transition:opacity .14s ease}
.world-opening.w-blackout .rl-lens{opacity:.12}
.world-opening.w-impact .room-lighting{opacity:1;transition:opacity .28s ease}
.world-opening.w-impact:is([data-tier="big"],[data-tier="chase"]) .room-lighting{--rl-white:255 224 163;--rl-power:1.7}
.world-opening.w-impact .rl-wall-wash{animation:rl-room-impact 1.8s cubic-bezier(.16,.7,.23,1) both}
.world-opening.w-impact[data-tier="chase"] .rl-wall-wash{animation-duration:2.5s}
.world-opening.w-impact .rl-floor{animation:rl-floor-impact 1.8s ease-out both}
.world-opening.w-impact[data-tier="chase"] .rl-floor{animation-duration:2.5s}
.world-opening.w-impact .rl-lens{background:#fff3cf;box-shadow:0 2px 9px 3px #fff5dc,0 4px 25px 8px #ffe5a73b}

/* Root mounts are supported, but stage mounts keep the pool tied to the plinth. */
.rip-room>.room-lighting{inset:82px 0 auto;height:calc(100% - 370px)}
.world-opening>.room-lighting{inset:86px 0 180px}
@keyframes rl-sweep-left{from{transform:translateX(-50%) rotate(calc(-13deg*var(--rl-sweep-scale)))}to{transform:translateX(-50%) rotate(calc(-20deg*var(--rl-sweep-scale)))}}
@keyframes rl-sweep-right{from{transform:translateX(-50%) rotate(calc(13deg*var(--rl-sweep-scale)))}to{transform:translateX(-50%) rotate(calc(21deg*var(--rl-sweep-scale)))}}
@keyframes rl-opening-idle{from{transform:translateX(-50%) rotate(calc(var(--rl-angle) - 2deg))}to{transform:translateX(-50%) rotate(calc(var(--rl-angle) + 2deg))}}
@keyframes rl-selection-focus{0%{opacity:.2}45%{opacity:.6}100%{opacity:.26}}
@keyframes rl-room-impact{0%{opacity:0;transform:scale(.92)}16%{opacity:.9;transform:scale(1)}100%{opacity:.16;transform:scale(1.06)}}
@keyframes rl-floor-impact{0%{opacity:.7;transform:translateX(-50%) scaleX(.75)}24%{opacity:1;transform:translateX(-50%) scaleX(1.14)}100%{opacity:.9;transform:translateX(-50%) scaleX(1)}}
@media(max-width:760px){.pack-theatre>.room-lighting{top:-24px;bottom:0}.room-lighting{--rl-left-angle:-12deg;--rl-right-angle:12deg}.room-lighting .rl-rail{left:23%;right:18%}.room-lighting .rl-lamp{--rl-source:34%;--rl-spread:38%;--rl-strength:.62}.room-lighting .rl-lamp-right{--rl-source:70%}.room-lighting .rl-lamp-centre{--rl-source:52%;--rl-spread:25%;--rl-strength:.2}.room-lighting .rl-fixture{width:30px;height:18px;transform:translateX(-50%) rotate(calc(var(--rl-angle)*.65))}.room-lighting .rl-housing{top:5px;height:14px;left:0;right:0;border-radius:4px 4px 6px 6px}.room-lighting .rl-yoke{left:7px;right:7px;height:11px;border-width:2px}.room-lighting .rl-lens{height:4px;left:5px;right:5px}.room-lighting .rl-beam{top:20px;height:calc(100% - 24px);filter:blur(8px)}.room-lighting .rl-floor{width:84%;min-height:40px;height:15%}.room-lighting .rl-haze{filter:blur(12px)}.rip-room>.room-lighting{inset:72px 0 auto;height:360px}.world-opening>.room-lighting{inset:80px 0 190px}.world-opening .room-lighting{--rl-left-angle:-12deg;--rl-right-angle:12deg}.world-opening:is([data-phase="tearing"],[data-phase="anticipating"],[data-phase="charging"]) .room-lighting{--rl-left-angle:-17deg;--rl-right-angle:17deg}.world-opening:is([data-phase="emerging"],[data-phase="flipping"]) .room-lighting{--rl-left-angle:-14deg;--rl-right-angle:14deg}.world-opening[data-phase="revealed"] .room-lighting{--rl-left-angle:-11deg;--rl-right-angle:11deg}}
@media(prefers-reduced-motion:reduce){.room-lighting,.room-lighting *{animation:none!important;transition:none!important;will-change:auto!important}.world-opening.w-impact .rl-wall-wash{opacity:.16}.world-opening.w-impact .rl-floor{opacity:.9;transform:translateX(-50%)}.rip-room .rl-lamp-left .rl-fixture,.rip-room .rl-lamp-right .rl-fixture{transform:translateX(-50%) rotate(calc(var(--rl-angle)*.65))}.rip-room .rl-lamp-left .rl-beam,.rip-room .rl-lamp-right .rl-beam{transform:translateX(-50%) rotate(var(--rl-angle))}}
.world-opening:is(.w-quick,.w-instant) .room-lighting,.world-opening:is(.w-quick,.w-instant) .room-lighting *{animation:none!important;transition:none!important}
.world-opening:is(.w-quick,.w-instant).w-impact .rl-wall-wash{opacity:.16}
/* Keep the fixtures in the clear space between the room title and utilities. */
.rip-room .rl-lamp-left{--rl-source:40%}.rip-room .rl-lamp-right{--rl-source:60%}
@media(max-width:760px){.pack-theatre>.room-lighting{top:-16px}.rip-room .rl-lamp-left{--rl-source:34%}.rip-room .rl-lamp-right{--rl-source:70%}}
