/**
 * The load screen — War 2050. js/preload.js.
 *
 * Above the HUD and the panels, below the intro (which has its own loader
 * and must win for a first-time player). Tokens only; nothing under the 12px
 * floor. The bar moves only when a stage actually settles, and under reduced
 * motion it moves without a transition.
 */

.load-screen {
    position: fixed;
    inset: 0;
    z-index: calc(var(--z-intro) - 1);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: calc(env(safe-area-inset-top, 0px) + 16px) 16px calc(env(safe-area-inset-bottom, 0px) + 16px);
    background: var(--color-primary-900, #0a0f1a);
}

.load-screen.hidden { display: none; }

/* FROM THE FIRST PAINT, BUT NOT FOR A FAST LOAD. The screen is in the HTML
   with .is-booting, before any script has run. It stays invisible (and so
   untappable) for 300ms, then appears; a load that finishes first hides it
   before anyone saw it. Once preload.js shows it (.is-visible) this rule no
   longer applies. No fade, so reduced motion needs no branch. */
.load-screen.is-booting:not(.is-visible) {
    animation: ls-appear 0s linear 300ms both;
}

@keyframes ls-appear {
    from { visibility: hidden; }
    to   { visibility: visible; }
}

/* The row being worked on now: the same stage the headline names. */
.ls-active { color: var(--color-text-primary); }
.ls-active .ls-mark { color: var(--color-accent-gold); }

.ls-panel {
    width: min(360px, 100%);
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.ls-title {
    font-family: var(--font-display);
    font-size: var(--text-2xl, 24px);
    font-weight: var(--font-bold);
    letter-spacing: 0.12em;
    text-align: center;
    color: var(--color-accent-gold);
}

.ls-now {
    min-height: 1.5em;
    font-family: var(--font-heading);
    font-size: var(--text-base);
    text-align: center;
    color: var(--color-text-primary);
}

.ls-bar {
    height: 6px;
    border-radius: 3px;
    background: var(--color-primary-700);
    overflow: hidden;
}

.ls-fill {
    height: 100%;
    background: var(--color-accent-gold);
    transition: width var(--transition-base, 200ms) ease-out;
}

@media (prefers-reduced-motion: reduce) {
    .ls-fill { transition: none; }
}

html.reduce-motion .ls-fill { transition: none; }

.ls-count {
    font-family: var(--font-mono, monospace);
    font-size: var(--text-xs);
    text-align: center;
    color: var(--color-text-muted);
    font-variant-numeric: tabular-nums;
}

.ls-stages {
    list-style: none;
    margin: 4px 0 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.ls-stage {
    display: flex;
    gap: 8px;
    align-items: baseline;
    font-family: var(--font-body);
    font-size: var(--text-sm);
    color: var(--color-text-secondary);
}

.ls-mark {
    width: 1.2em;
    text-align: center;
    color: var(--color-text-muted);
}

.ls-done .ls-mark { color: var(--color-accent-green-light, #34d399); }
.ls-failed .ls-mark { color: var(--color-accent-orange); }

.ls-note {
    font-size: var(--text-xs);
    color: var(--color-text-muted);
}
