/* ===== Preloader: 3D arcade cabinet (Three.js), zoom into the screen ===== */

.preloader {
    position: fixed;
    inset: 0;
    z-index: 999;
    background: #09060c;
    opacity: 1;
    transition: opacity 0.6s ease;
}

.preloader.is-hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

#arcade-canvas {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    display: block;
}

.screen-content {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    z-index: 3;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 0 10px;
    text-align: center;
    opacity: 1;
    transition: opacity 0.35s ease;
    pointer-events: none;
}

.screen-content.is-fading {
    opacity: 0;
}

.screen-logo {
    font-family: var(--font-body);
    font-weight: 700;
    font-size: clamp(13px, 2vw, 16px);
    letter-spacing: 0.08em;
    color: var(--color-white);
    text-shadow: 0 0 8px var(--color-pink), 0 0 16px rgba(242, 94, 163, 0.6);
}

.screen-text {
    font-family: var(--font-body);
    font-weight: 700;
    font-size: clamp(10px, 1.6vw, 12px);
    letter-spacing: 0.14em;
    color: var(--color-green);
    text-shadow: 0 0 6px var(--color-green), 0 0 12px rgba(171, 217, 74, 0.6);
}

.screen-text--blink {
    animation: insert-coin-blink 1s steps(2, end) infinite;
}

/* ---------- Flash that bridges the zoom into the real page ---------- */

.preloader-flash {
    position: fixed;
    inset: 0;
    z-index: 6;
    opacity: 0;
    background: #fff;
    pointer-events: none;
    transition: opacity 0.35s ease, background 0.35s ease;
}

.preloader-flash.is-active {
    opacity: 1;
    background: #fff9fb;
}

.preloader-flash.is-fading {
    opacity: 0;
    background: var(--color-lila);
}

@keyframes insert-coin-blink {
    0%, 100% { opacity: 1; }
    50%      { opacity: 0.15; }
}

body.is-loading {
    overflow: hidden;
}
