/* =============================================================================
   render-failure.css - Map render failure + renderer unavailable overlays
   Shown by src/pixi/renderWatchdog.js when the render loop is dead (repeated
   frame exceptions or an unrestored WebGL context loss), or when no WebGPU or
   WebGL renderer exists at boot. Static markup lives in game.html
   (#map-render-failure, #renderer-unavailable) so it works even when rendering
   is broken.
   The markup mirrors ModalShell (.ms-shell/.ms-panel) so it matches the shared
   modal design; this file only adds the hidden-by-default state and z-index.
   ============================================================================= */

/* The authoritative closed state is the `hidden` attribute in game.html plus
   the .ms-shell[hidden] guard in modal-system.css - this stylesheet loads
   async and cannot be trusted to have applied. The :not() form keeps a higher
   specificity than .ms-shell's display:flex regardless of cascade order. */
.map-render-failure:not(.map-render-failure--open) {
    display: none;
}

.map-render-failure {
    /* Above every panel - the map is dead, nothing else is actionable */
    z-index: var(--z-system-popup);
}

.map-render-failure.map-render-failure--open {
    display: flex;
}

/* Shown during boot while the loading screen is still up (Pixi never became
   ready), so it must sit above the entry blocker, not just above panels, and
   centre on the full-viewport loading screen rather than the in-game content
   area .ms-shell is inset to. */
#renderer-unavailable {
    z-index: calc(var(--z-entry-blocker) + 1);
    left: 0;
    right: 0;
    max-width: none;
    margin-inline: 0;
}
