/* SV Loot Loading Screen */
/* Clean and Outstanding Interface with Black/White Theme */

.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background:
        radial-gradient(ellipse at center, rgba(255, 215, 0, 0.05) 0%, transparent 70%),
        var(--soft-white, #f2f2f2);
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 1;
    visibility: visible;
    transition: opacity 0.5s ease, visibility 0.5s ease;
}

/* Dark mode loading screen */
body.dark-mode .loading-overlay {
    background:
        radial-gradient(ellipse at center, rgba(255, 215, 0, 0.05) 0%, transparent 70%),
        #121314;
}

.loading-overlay.fade-out {
    opacity: 0;
    visibility: hidden;
}

.loading-container {
    text-align: center;
    max-width: 400px;
    padding: 2rem;
}

.loading-header {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 2rem;
}

.loading-logo {
    width: 60px;
    height: 60px;
    background: transparent;
    border-radius: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.loading-logo img {
    width: 50px;
    height: 50px;
    object-fit: contain;
}

.loading-logo-fallback {
    color: #121314;
    font-size: 1.8rem;
    font-weight: 700;
    font-family: 'Inter', sans-serif;
}



.loading-title {
    font-size: 1.8rem;
    font-weight: 700;
    color: #121314;
    margin: 0;
    font-family: 'Inter', sans-serif;
    transition: color 0.3s ease;
}

.loading-subtitle {
    font-size: 1rem;
    color: #666;
    margin-bottom: 2rem;
    font-family: 'Inter', sans-serif;
    transition: color 0.3s ease;
}

/* Dark mode loading text */
body.dark-mode .loading-title {
    color: #f2f2f2;
}

body.dark-mode .loading-subtitle {
    color: #b0b0b0;
}

body.dark-mode .loading-logo-fallback {
    color: #f2f2f2;
}

body.dark-mode .loading-status {
    color: #b0b0b0;
}

body.dark-mode .loading-dot {
    background: #b0b0b0;
}

.loading-coins-container {
    width: 300px;
    height: 150px;
    margin: 0 auto 2rem;
    position: relative;
    perspective: 1500px;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 25px;
    filter: drop-shadow(0 10px 30px rgba(255, 215, 0, 0.3));
}

.loading-coin {
    width: 85px;
    height: 85px;
    position: relative;
    transform-style: preserve-3d;
}

.coin {
    width: 100%;
    height: 100%;
    position: relative;
    transform-style: preserve-3d;
}

.coin-face {
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    backface-visibility: hidden;
    padding: 12px;
    box-sizing: border-box;
}

.coin-heads {
    background:
        radial-gradient(ellipse at 30% 30%, rgba(255, 255, 255, 0.4) 0%, transparent 50%),
        linear-gradient(135deg, #ffd700 0%, #ffed4e 30%, #ffc107 70%, #e6c200 100%);
    border: 5px solid #d4af00;
    box-shadow:
        0 0 0 2px #fff,
        0 0 0 4px #e6c200,
        0 12px 35px rgba(255, 215, 0, 0.5),
        inset 0 3px 15px rgba(255, 255, 255, 0.4),
        inset 0 -3px 15px rgba(0, 0, 0, 0.15);
}

.coin-tails {
    background:
        radial-gradient(ellipse at 30% 30%, rgba(255, 255, 255, 0.4) 0%, transparent 50%),
        linear-gradient(135deg, #ffd700 0%, #ffed4e 30%, #ffc107 70%, #e6c200 100%);
    border: 5px solid #d4af00;
    transform: rotateY(180deg);
    box-shadow:
        0 0 0 2px #fff,
        0 0 0 4px #e6c200,
        0 12px 35px rgba(255, 215, 0, 0.5),
        inset 0 3px 15px rgba(255, 255, 255, 0.4),
        inset 0 -3px 15px rgba(0, 0, 0, 0.15);
}

.coin-logo {
    width: 100%;
    height: 100%;
    object-fit: contain;
    filter: drop-shadow(0 2px 6px rgba(0,0,0,0.4));
}

/* Individual coin animations */
.coin-1 {
    animation: coinFlip1 3s ease-in-out infinite;
}

.coin-2 {
    animation: coinFlip2 3s ease-in-out infinite 0.5s;
}

.coin-3 {
    animation: coinFlip3 3s ease-in-out infinite 1s;
}

/* 3D Coin Flip Animations */
@keyframes coinFlip1 {
    0% {
        transform: translateY(0px) rotateY(0deg) rotateX(0deg) rotateZ(0deg);
    }
    25% {
        transform: translateY(-30px) rotateY(180deg) rotateX(20deg) rotateZ(10deg);
    }
    50% {
        transform: translateY(-50px) rotateY(360deg) rotateX(0deg) rotateZ(0deg);
    }
    75% {
        transform: translateY(-30px) rotateY(540deg) rotateX(-20deg) rotateZ(-10deg);
    }
    100% {
        transform: translateY(0px) rotateY(720deg) rotateX(0deg) rotateZ(0deg);
    }
}

@keyframes coinFlip2 {
    0% {
        transform: translateY(0px) rotateY(0deg) rotateX(0deg) rotateZ(0deg);
    }
    20% {
        transform: translateY(-20px) rotateY(144deg) rotateX(15deg) rotateZ(8deg);
    }
    40% {
        transform: translateY(-60px) rotateY(288deg) rotateX(-10deg) rotateZ(-5deg);
    }
    60% {
        transform: translateY(-40px) rotateY(432deg) rotateX(25deg) rotateZ(12deg);
    }
    80% {
        transform: translateY(-15px) rotateY(576deg) rotateX(-15deg) rotateZ(-8deg);
    }
    100% {
        transform: translateY(0px) rotateY(720deg) rotateX(0deg) rotateZ(0deg);
    }
}

@keyframes coinFlip3 {
    0% {
        transform: translateY(0px) rotateY(0deg) rotateX(0deg) rotateZ(0deg);
    }
    30% {
        transform: translateY(-40px) rotateY(216deg) rotateX(-18deg) rotateZ(-12deg);
    }
    60% {
        transform: translateY(-70px) rotateY(432deg) rotateX(22deg) rotateZ(15deg);
    }
    90% {
        transform: translateY(-25px) rotateY(648deg) rotateX(-12deg) rotateZ(-8deg);
    }
    100% {
        transform: translateY(0px) rotateY(720deg) rotateX(0deg) rotateZ(0deg);
    }
}



/* Coins flying away animation */
.loading-coins-container.coins-away {
    animation: coinsAway 1s ease-in-out forwards;
}

@keyframes coinsAway {
    0% {
        transform: scale(1) translateY(0);
        opacity: 1;
    }
    50% {
        transform: scale(1.2) translateY(-50px);
        opacity: 0.8;
    }
    100% {
        transform: scale(0.5) translateY(-200px);
        opacity: 0;
    }
}

.loading-status {
    font-size: 0.9rem;
    color: #666;
    font-family: 'Inter', sans-serif;
    min-height: 1.2rem;
}

.loading-dots {
    display: inline-flex;
    gap: 4px;
    margin-left: 4px;
}

.loading-dot {
    width: 4px;
    height: 4px;
    background: #666;
    border-radius: 50%;
    animation: dotBounce 1.4s ease-in-out infinite both;
}

.loading-dot:nth-child(1) { animation-delay: -0.32s; }
.loading-dot:nth-child(2) { animation-delay: -0.16s; }
.loading-dot:nth-child(3) { animation-delay: 0s; }

@keyframes dotBounce {
    0%, 80%, 100% {
        transform: scale(0);
        opacity: 0.5;
    }
    40% {
        transform: scale(1);
        opacity: 1;
    }
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .loading-container {
        padding: 1.5rem;
    }

    .loading-header {
        gap: 0.75rem;
        margin-bottom: 1.5rem;
    }

    .loading-logo {
        width: 50px;
        height: 50px;
    }

    .loading-logo img {
        width: 40px;
        height: 40px;
    }

    .loading-logo-fallback {
        font-size: 1.5rem;
    }

    .loading-title {
        font-size: 1.5rem;
    }

    .loading-subtitle {
        font-size: 0.9rem;
        margin-bottom: 1.5rem;
    }

    .loading-coins-container {
        width: 250px;
        height: 120px;
        gap: 15px;
        margin-bottom: 1.5rem;
    }

    .loading-coin {
        width: 60px;
        height: 60px;
    }

    .coin-face {
        padding: 8px;
    }
}

/* Smooth page transition */
.page-content {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.5s ease, transform 0.5s ease;
}

.page-content.loaded {
    opacity: 1;
    transform: translateY(0);
}

/* Prevent flash of unstyled content */
.no-js .loading-overlay {
    display: none;
}

.no-js .page-content {
    opacity: 1;
    transform: none;
}
