﻿/* ================= GAME LOADER ================= */

.game-loader {
    position: fixed;
    inset: 0;
    background: radial-gradient(circle at center, #0b1020 0%, #05060c 70%);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 999999;
    overflow: hidden;
    transition: opacity .5s ease, visibility .5s ease;
}

    .game-loader.hide {
        opacity: 0;
        visibility: hidden;
        pointer-events: none;
    }

/* ================= CORE ================= */

.loader-core {
    position: relative;
    width: min(35vw,180px);
    height: min(35vw,180px);
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ================= RINGS ================= */

.ring {
    position: absolute;
    border-radius: 50%;
    border: 2px solid transparent;
    border-top-color: #6365f1;
    border-bottom-color: #22d3ee;
    animation: loaderSpin 1.6s linear infinite;
    filter: drop-shadow(0 0 12px rgba(99,101,241,.7));
}

.r1 {
    width: 100%;
    height: 100%;
    animation-duration: 2s;
}

.r2 {
    width: 75%;
    height: 75%;
    animation-duration: 1.4s;
    border-top-color: #a855f7;
    border-bottom-color: #38bdf8;
}

.r3 {
    width: 50%;
    height: 50%;
    animation-duration: 1s;
    border-top-color: #facc15;
    border-bottom-color: #6365f1;
}

/* ================= CENTER ================= */

.core-text {
    position: absolute;
    display: flex;
    align-items: center;
    justify-content: center;
}

    .core-text img {
        width: min(22vw,120px);
        height: auto;
        object-fit: contain;
    }

    .core-text span {
        font-size: 14px;
        font-weight: 700;
        letter-spacing: 3px;
        color: #fff;
        animation: loaderPulse 1.3s infinite;
    }

/* ================= PARTICLES ================= */

.game-loader::before,
.game-loader::after {
    content: "";
    position: absolute;
    width: 200%;
    height: 200%;
    background: radial-gradient( circle, rgba(99,102,241,.08) 1px, transparent 1px );
    background-size: 40px 40px;
    animation: loaderBg 12s linear infinite;
}

.game-loader::after {
    animation-direction: reverse;
    opacity: .25;
}

/* ================= ANIMATIONS ================= */

@keyframes loaderSpin {
    to {
        transform: rotate(360deg);
    }
}

@keyframes loaderPulse {
    0%,100% {
        opacity: .5;
        transform: scale(1);
    }

    50% {
        opacity: 1;
        transform: scale(1.08);
    }
}

@keyframes loaderBg {
    to {
        transform: translate(-50px,-50px);
    }
}

/* ================= MOBILE ================= */

@media(max-width:768px) {

    .loader-core {
        width: 140px;
        height: 140px;
    }

    .core-text img {
        width: 90px;
    }
}

@media(max-width:420px) {

    .loader-core {
        width: 110px;
        height: 110px;
    }

    .core-text img {
        width: 75px;
    }
}
