/**
 * Loading Screen Styles
 */

.loading-screen {
    position: fixed;
    inset: 0;
    z-index: var(--z-loading);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.loading-bg-pattern {
    position: absolute;
    inset: -200px;
    background-image: url('../assets/bg.png');
    background-size: 150px 150px;
    background-repeat: repeat;
    transform: rotate(-15deg) scale(1.5);
    animation: patternDrift 12s linear infinite;
}

@keyframes patternDrift {
    0% {
        background-position: 0 0;
    }
    100% {
        background-position: 300px 300px;
    }
}

/* Audio Toggles */
.loading-audio-toggles {
    position: absolute;
    top: 2rem;
    left: 2rem;
    z-index: 10;
    display: flex;
    gap: 1rem;
}

.audio-toggle {
    width: 48px;
    height: 48px;
    padding: 8px;
    background: rgba(0, 0, 0, 0.4);
    border-radius: 8px;
    border: 2px solid rgba(255, 255, 255, 0.2);
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.audio-toggle:hover {
    background: rgba(0, 0, 0, 0.6);
    border-color: rgba(255, 255, 255, 0.4);
    transform: scale(1.05);
}

.audio-toggle.active {
    border-color: var(--color-pink-light);
    background: rgba(196, 30, 92, 0.3);
}

.toggle-icon {
    width: 28px;
    height: 28px;
    image-rendering: pixelated;
    image-rendering: crisp-edges;
}

/* Loading Tip Container - Center of screen */
.loading-tip-container {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 5;
    width: 90%;
    max-width: 600px;
    text-align: center;
}

.loading-tip {
    background: rgba(255, 255, 255, 0.108);
    border: 2px solid rgba(196, 30, 92, 0.3);
    border-radius: 12px;
    padding: 1.5rem 2rem;
    backdrop-filter: blur(5px);
}

.tip-text {
    font-family: var(--font-pixel-alt);
    font-size: clamp(0.85rem, 2vw, 1.1rem);
    color: var(--color-white);
    line-height: 1.6;
    letter-spacing: 0.02em;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5);
}

/* Loading Corner */
.loading-corner {
    position: absolute;
    bottom: 3rem;
    right: 3rem;
    z-index: 2;
    display: flex;
    align-items: center;
    gap: 2rem;
}

.loading-text {
    font-family: var(--font-title);
    font-size: clamp(2.5rem, 6vw, 4rem);
    color: var(--color-white);
    display: flex;
    letter-spacing: 0.05em;
    text-shadow: 
        3px 3px 0 var(--color-pink-dark),
        6px 6px 0 rgba(0, 0, 0, 0.4);
}

.loading-letter {
    display: inline-block;
    will-change: transform;
    transform-origin: center bottom;
}

.loading-letter.space {
    width: 0.4em;
}

.loading-gif {
    width: 220px;
    height: auto;
    image-rendering: pixelated;
    image-rendering: crisp-edges;
    -ms-interpolation-mode: nearest-neighbor;
}

/* Progress Bar */
.loading-progress {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 6px;
    background-color: rgba(255, 255, 255, 0.1);
    z-index: 3;
}

.loading-progress-bar {
    height: 100%;
    width: 0;
    background: linear-gradient(
        90deg,
        var(--color-pink-dark),
        var(--color-pink-light),
        var(--color-pink-accent)
    );
    transition: width 0.3s ease-out;
}

/* Responsive */
@media (max-width: 768px) {
    .loading-audio-toggles {
        top: 1.5rem;
        left: 1.5rem;
        gap: 0.75rem;
    }
    
    .audio-toggle {
        width: 40px;
        height: 40px;
        padding: 6px;
    }
    
    .toggle-icon {
        width: 24px;
        height: 24px;
    }
    
    .loading-tip-container {
        width: 85%;
        max-width: 450px;
    }
    
    .loading-tip {
        padding: 1.25rem 1.5rem;
    }
    
    .tip-text {
        font-size: 0.9rem;
    }
    
    .loading-corner {
        bottom: 2rem;
        right: 1.5rem;
        gap: 1.5rem;
    }
    
    .loading-gif {
        width: 160px;
    }
    
    .loading-text {
        font-size: 2.2rem;
    }
    
    .loading-bg-pattern {
        background-size: 100px 100px;
    }
}

@media (max-width: 480px) {
    .loading-audio-toggles {
        top: 1rem;
        left: 1rem;
    }
    
    .audio-toggle {
        width: 36px;
        height: 36px;
    }
    
    .toggle-icon {
        width: 20px;
        height: 20px;
    }
    
    .loading-tip-container {
        width: 90%;
        top: 45%;
    }
    
    .loading-tip {
        padding: 1rem 1.25rem;
    }
    
    .tip-text {
        font-size: 0.8rem;
    }
    
    .loading-corner {
        bottom: 1.5rem;
        right: 1rem;
        flex-direction: column-reverse;
        align-items: flex-end;
        gap: 1rem;
    }
    
    .loading-text {
        font-size: 1.6rem;
    }
    
    .loading-gif {
        width: 120px;
    }
}
