/* ========================================
   Game Loading Animation - Shared Styles
   ======================================== */

/* Loading Screen Container */
.loading-screen {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: transparent;
    z-index: 1200;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.loading-screen.active {
    opacity: 1;
    pointer-events: auto;
}

/* Hide game elements and footer when loading screen is active */
.loading-screen.active~main .game-container,
.loading-screen.active~main .game-back-link,
.loading-screen.active~main .page,
.loading-screen.active~main.page,
.loading-screen.active~.page {
    opacity: 0 !important;
    visibility: hidden !important;
}

/* Hide footer during loading */
.loading-screen.active~.footer,
.loading-screen.active~footer,
.loading-screen.active~footer.footer {
    opacity: 0 !important;
    visibility: hidden !important;
}

/* Ensure full background during loading on mobile */
body.loading-active {
    min-height: 100vh;
    min-height: 100dvh;
    overflow: hidden;
}

@media (max-width: 900px) {
    body.loading-active {
        background-attachment: fixed !important;
        background-size: cover;
        background-position: center bottom;
    }
}

.loading-screen__container {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 20px;
}

.loading-screen__figure {
    width: 180px;
    height: auto;
    animation: bounce-jump 0.5s ease-in-out infinite;
}

/* Loading Bar - FC Betreuung Style */
.loading-bar-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.loading-text {
    color: var(--color-text, #1A1D21);
    font-size: 0.9rem;
    font-weight: 600;
    text-shadow: 0 1px 2px rgba(255, 255, 255, 0.8);
}

.loading-text .dot {
    animation: blink 1.5s infinite;
}

.loading-text .dot:nth-child(2) {
    animation-delay: 0.3s;
}

.loading-text .dot:nth-child(3) {
    animation-delay: 0.6s;
}

.loading-bar-background {
    display: flex;
    align-items: center;
    padding: 5px;
    width: 220px;
    height: 32px;
    background: rgba(255, 255, 255, 0.45);
    backdrop-filter: blur(20px) saturate(1.4);
    -webkit-backdrop-filter: blur(20px) saturate(1.4);
    box-shadow:
        0 8px 32px rgba(0, 0, 0, 0.1),
        0 2px 8px rgba(0, 0, 0, 0.05),
        inset 0 1px 0 rgba(255, 255, 255, 0.8),
        inset 0 -1px 0 rgba(0, 0, 0, 0.03);
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.5);
    position: relative;
    overflow: hidden;
}

/* Glare effect on loading bar background */
.loading-bar-background::before {
    content: "";
    position: absolute;
    top: 0;
    left: 10%;
    width: 80%;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.9), transparent);
}

.loading-bar-background::after {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 50%;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.3), transparent);
    border-radius: 16px 16px 0 0;
    pointer-events: none;
}

.loading-bar {
    position: relative;
    display: flex;
    align-items: center;
    width: 0%;
    height: 22px;
    overflow: hidden;
    background: linear-gradient(145deg, #F26522, #e55a1f);
    border-radius: 11px;
    animation: loading-fill 1s ease-out forwards;
    box-shadow:
        0 0 15px rgba(242, 101, 34, 0.5),
        inset 0 1px 0 rgba(255, 255, 255, 0.3);
    z-index: 1;
}

.white-bars-container {
    position: absolute;
    display: flex;
    align-items: center;
    gap: 14px;
    left: 5px;
}

.white-bar {
    background: linear-gradient(-45deg, rgba(255, 255, 255, 0.5) 0%, rgba(255, 255, 255, 0) 70%);
    width: 8px;
    height: 30px;
    transform: rotate(45deg);
}

/* Animations */
@keyframes bounce-jump {

    0%,
    100% {
        transform: translateY(0) scale(1);
    }

    50% {
        transform: translateY(-12px) scale(1.02);
    }
}

@keyframes loading-fill {
    0% {
        width: 0%;
    }

    20% {
        width: 20%;
    }

    40% {
        width: 45%;
    }

    60% {
        width: 70%;
    }

    80% {
        width: 90%;
    }

    100% {
        width: 100%;
    }
}

@keyframes blink {

    0%,
    100% {
        opacity: 0;
    }

    50% {
        opacity: 1;
    }
}