html, body {
    width: 100%;
    height: 100%;
    margin: 0;
    padding: 0;
    background-color: #7837DB;
}

#app {
    display: flex;
    flex-direction: column;
    width: 100%;
    height: 100%;
}

#loader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: #7837DB;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    padding: 24px;
    box-sizing: border-box;
}

#loader-logo {
    max-width: 200px;
    width: 60%;
    margin-bottom: 32px;
}

.spinner-wrapper {
    width: 48px;
    height: 48px;
    animation: rotate 1s linear infinite;
    opacity: 0;
    transform: scale(0.9);
    animation: rotate 1s linear infinite, fadeInElement 0.6s ease-out forwards;
    animation-delay: 0s, 0.8s; /* вращение сразу, появление чуть позже */
}

.spinner {
    width: 100%;
    height: 100%;
}

.path {
    stroke: white;
    stroke-linecap: round;
    stroke-dasharray: 125, 157;
    stroke-dashoffset: 0;
    animation: dash 1.4s ease-in-out infinite;
}

@keyframes rotate {
    100% {
        transform: rotate(360deg);
    }
}

@keyframes dash {
    0% {
        stroke-dasharray: 1, 157;
        stroke-dashoffset: 0;
    }
    50% {
        stroke-dasharray: 125, 157;
        stroke-dashoffset: -15;
    }
    100% {
        stroke-dasharray: 125, 157;
        stroke-dashoffset: -90;
    }
}

#progress-text {
    font-size: 18px;
    font-weight: bold;
    color: white;
    margin-top: 16px;
    text-align: center;
    max-width: 90vw;
    padding: 0 12px;
    word-break: break-word;
    line-height: 1.5;
    opacity: 0;
    transform: translateY(10px);
    animation: fadeInElement 0.6s ease-out forwards;
    animation-delay: 1.2s;
}


@media (max-width: 480px) {
    #progress-text {
        font-size: 15px;
        padding: 0 16px;
    }

#loader-logo {
    opacity: 0;
    transform: translateY(-20px) scale(1);
    animation: logoFadeIn 1s ease-out forwards, logoPulse 2s ease-in-out infinite;
    animation-delay: 0.3s, 1.3s; /* появление сначала, пульсация после */
}
}

/* Плавное появление логотипа */
#loader-logo {
    opacity: 0;
    transform: translateY(-20px) scale(1);
    animation:
        logoFadeIn 1s ease-out forwards,
        logoPulse 1.8s ease-in-out infinite;
    animation-delay: 0.3s, 1.3s;
    will-change: transform, opacity;
}
@keyframes logoFadeIn {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Плавное исчезновение лоадера */
#loader.fade-out {
    opacity: 0;
    transition: opacity 0.6s ease;
    pointer-events: none;
}

@keyframes logoFadeIn {
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes logoPulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.12);
    }
}

@keyframes fadeInElement {
    to {
        opacity: 1;
        transform: none;
    }
}