/* Screen layers. */

#ui { position: fixed; inset: 0; z-index: 3; pointer-events: none; }
#ui .ui-layer { position: absolute; inset: 0; }
#ui .ui-screen { position: absolute; inset: 0; display: grid; place-items: center; padding: 16px; box-sizing: border-box; overflow: auto; will-change: opacity; }
#ui .ui-hud { pointer-events: none; }
#ui .ui-live-region { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }

@media (prefers-reduced-motion: reduce) { #ui * { transition: none !important; animation: none !important; } }

/* Retain each screen in its layout while it waits behind the loading cover or another screen. */
#ui :is(.ui-parked, .ui-hud.is-obscured) { opacity: 0; }
#ui .ui-preparing-screen {
  /* Composite the prepared layers into a transparent surface without skipping their raster. */
  opacity: 1;
  filter: opacity(0);
}
#ui .ui-unpainted { opacity: 0 !important; }
#ui :is(.ui-unpainted, .ui-preparing-piece) { transition: none !important; }

/* The loading screen stands over every screen and the wipe; what shows through it is the game. */
#ui .ui-loading { z-index: 40; padding: 0; overflow: visible; }
