/* ========================================
   RPGテーマ ローディングアニメーション
   ======================================== */

/* ローディングオーバーレイ */
.rpg-loader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #0a0a0a 0%, #1a1a2e 100%);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    transition: opacity 0.5s ease, visibility 0.5s ease;
}

.rpg-loader.hidden {
    opacity: 0;
    visibility: hidden;
}

/* ローディングコンテンツ */
.loader-content {
    text-align: center;
    position: relative;
}

/* ゲームパッドアイコン */
.loader-icon {
    font-size: 4rem;
    color: var(--color-primary);
    margin-bottom: 2rem;
    animation: iconBounce 1s ease-in-out infinite;
    filter: drop-shadow(0 0 20px rgba(255, 215, 0, 0.8));
}

@keyframes iconBounce {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-20px);
    }
}

/* Now Loading テキスト */
.loader-text {
    font-family: 'Press Start 2P', cursive;
    font-size: 1.5rem;
    color: var(--color-primary);
    margin-bottom: 2rem;
    text-shadow: 0 0 20px rgba(255, 215, 0, 0.8);
    animation: textGlow 1.5s ease-in-out infinite;
}

@keyframes textGlow {
    0%, 100% {
        text-shadow: 0 0 20px rgba(255, 215, 0, 0.8);
    }
    50% {
        text-shadow: 0 0 40px rgba(255, 215, 0, 1), 0 0 60px rgba(255, 215, 0, 0.6);
    }
}

/* ドットアニメーション */
.loader-dots {
    display: inline-block;
}

.loader-dots span {
    animation: dotBlink 1.5s infinite;
}

.loader-dots span:nth-child(1) {
    animation-delay: 0s;
}

.loader-dots span:nth-child(2) {
    animation-delay: 0.3s;
}

.loader-dots span:nth-child(3) {
    animation-delay: 0.6s;
}

@keyframes dotBlink {
    0%, 20% {
        opacity: 0;
    }
    40%, 100% {
        opacity: 1;
    }
}

/* プログレスバー */
.loader-progress {
    width: 300px;
    height: 20px;
    background: rgba(255, 215, 0, 0.1);
    border: 2px solid var(--color-primary);
    border-radius: 10px;
    overflow: hidden;
    position: relative;
    box-shadow: 0 0 20px rgba(255, 215, 0, 0.3);
}

.loader-progress-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--color-primary) 0%, var(--color-secondary) 100%);
    width: 0%;
    transition: width 0.3s ease;
    position: relative;
    overflow: hidden;
}

.loader-progress-bar::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
    animation: progressShine 1.5s infinite;
}

@keyframes progressShine {
    0% {
        left: -100%;
    }
    100% {
        left: 200%;
    }
}

/* レベルアップテキスト */
.loader-level {
    margin-top: 1rem;
    font-family: 'Noto Sans JP', sans-serif;
    font-size: 0.9rem;
    color: var(--color-text-secondary);
}

/* キラキラエフェクト */
.loader-sparkle {
    position: absolute;
    width: 4px;
    height: 4px;
    background: var(--color-primary);
    border-radius: 50%;
    animation: sparkleFloat 2s ease-in-out infinite;
    box-shadow: 0 0 10px rgba(255, 215, 0, 0.8);
}

.loader-sparkle:nth-child(1) {
    top: 20%;
    left: 10%;
    animation-delay: 0s;
}

.loader-sparkle:nth-child(2) {
    top: 60%;
    left: 20%;
    animation-delay: 0.5s;
}

.loader-sparkle:nth-child(3) {
    top: 30%;
    right: 15%;
    animation-delay: 1s;
}

.loader-sparkle:nth-child(4) {
    bottom: 20%;
    right: 10%;
    animation-delay: 1.5s;
}

@keyframes sparkleFloat {
    0%, 100% {
        transform: translateY(0) scale(0.5);
        opacity: 0;
    }
    10% {
        opacity: 1;
    }
    90% {
        opacity: 1;
    }
    100% {
        transform: translateY(-100px) scale(1);
        opacity: 0;
    }
}

/* レスポンシブ */
@media (max-width: 768px) {
    .loader-text {
        font-size: 1rem;
    }
    
    .loader-icon {
        font-size: 3rem;
    }
    
    .loader-progress {
        width: 250px;
    }
}

@media (max-width: 480px) {
    .loader-text {
        font-size: 0.8rem;
    }
    
    .loader-icon {
        font-size: 2.5rem;
    }
    
    .loader-progress {
        width: 200px;
    }
}
