/* Roomscape Adventure — app loading screen.
   Picks up exactly where the iOS launch image leaves off: same cream, same compass, same
   wordmark, same place. Sizes are in "canvas units" (--u): the launch image is a 2732px
   square that iOS scales to fill the screen, so one canvas pixel = the screen's longer side
   / 2732. Using the same unit here keeps the hand-off seamless on every iPhone and iPad.
   Only shown inside the app (html.rs-app, set by loader.js); the website never sees it. */
#rsLoader{display:none}
html.rs-app #rsLoader{
  --u:calc(max(100vh,100vw) / 2732);
  --plum:#3B1A4D;--gold:#9C7633;--cream:#F7F1E5;
  display:block;position:fixed;inset:0;z-index:10001;background:var(--cream);overflow:hidden;
  transition:opacity .45s ease,visibility 0s linear .45s;
}
html.rs-app #rsLoader.rsl-done{opacity:0;visibility:hidden;pointer-events:none}
#rsLoader .rsl-c{position:absolute;left:50%;top:50%;width:0;height:0}
#rsLoader .rsl-mark{position:absolute;left:calc(-326 * var(--u));top:calc(-545 * var(--u));
  width:calc(600 * var(--u));height:calc(597 * var(--u))}
#rsLoader .rsl-compass{position:absolute;inset:0;width:100%;height:100%;transform-origin:50% 50%}
#rsLoader .rsl-piece{position:absolute;left:calc(452 * var(--u));top:calc(504 * var(--u));
  width:calc(219 * var(--u));height:auto}
#rsLoader .rsl-word{position:absolute;left:-50vw;width:100vw;top:calc(174 * var(--u));text-align:center;
  font:400 calc(212 * var(--u))/1 'Instrument Serif',Georgia,serif;color:var(--plum);letter-spacing:-.01em;margin:0}
#rsLoader .rsl-sub{position:absolute;left:-50vw;width:100vw;top:calc(426 * var(--u));
  display:flex;align-items:center;justify-content:center;gap:calc(34 * var(--u));
  font:600 calc(50 * var(--u))/1 'Instrument Sans',system-ui,sans-serif;color:var(--gold);
  letter-spacing:.46em;text-transform:uppercase;margin:0}
#rsLoader .rsl-sub span{margin-right:-.46em}
#rsLoader .rsl-rule{display:block;width:calc(120 * var(--u));height:calc(4 * var(--u));background:var(--gold);position:relative}
#rsLoader .rsl-rule::after{content:"";position:absolute;top:50%;width:calc(16 * var(--u));height:calc(16 * var(--u));
  background:var(--gold);transform:translateY(-50%) rotate(45deg)}
#rsLoader .rsl-rule.l::after{right:calc(-4 * var(--u))}
#rsLoader .rsl-rule.r::after{left:calc(-4 * var(--u))}

/* ── Only on the live screen, never in the launch image ─────────────────────────────── */
#rsLoader .rsl-live{position:absolute;left:-50vw;width:100vw;top:calc(640 * var(--u));text-align:center}
#rsLoader .rsl-caption{margin:0;height:calc(80 * var(--u));
  font:italic 400 calc(66 * var(--u))/1.2 'Instrument Serif',Georgia,serif;color:#6E6257;
  transition:opacity .35s ease}
#rsLoader .rsl-caption.out{opacity:0}
#rsLoader .rsl-steps{display:flex;justify-content:center;gap:calc(30 * var(--u));margin-top:calc(46 * var(--u))}
#rsLoader .rsl-steps i{display:block;width:calc(16 * var(--u));height:calc(16 * var(--u));border-radius:50%;
  background:var(--gold);opacity:.22;animation:rsl-step 1.6s ease-in-out infinite}
#rsLoader .rsl-steps i:nth-child(2){animation-delay:.2s}
#rsLoader .rsl-steps i:nth-child(3){animation-delay:.4s}
#rsLoader .rsl-steps i:nth-child(4){animation-delay:.6s}
#rsLoader .rsl-steps i:nth-child(5){animation-delay:.8s}
#rsLoader.rsl-live-on .rsl-compass{animation:rsl-seek 3.2s cubic-bezier(.45,0,.3,1) .25s infinite}
#rsLoader.rsl-live-on .rsl-piece{animation:rsl-snap 3.2s ease-in-out .25s infinite}
#rsLoader .rsl-live{opacity:0;transition:opacity .5s ease .15s}
#rsLoader.rsl-live-on .rsl-live{opacity:1}
@keyframes rsl-seek{0%{transform:rotate(0)}22%{transform:rotate(-9deg)}46%{transform:rotate(6deg)}
  64%{transform:rotate(-2.5deg)}78%,100%{transform:rotate(0)}}
@keyframes rsl-snap{0%,70%{transform:translate(0,0)}80%{transform:translate(calc(10 * var(--u)),calc(12 * var(--u))) rotate(4deg)}
  90%,100%{transform:translate(0,0)}}
@keyframes rsl-step{0%,100%{opacity:.22;transform:scale(.85)}35%{opacity:1;transform:scale(1)}}
@media (prefers-reduced-motion:reduce){
  #rsLoader.rsl-live-on .rsl-compass,#rsLoader.rsl-live-on .rsl-piece,#rsLoader .rsl-steps i{animation:none}
  #rsLoader .rsl-steps i{opacity:.6}
}
