/* ===== テーマエフェクトCSS ===== */
/**
 * themes.jsから作成されたすべてのテーマエフェクト用CSS
 * メンテナンス性向上のためインラインスタイルからリファクタリング
 */

/* === ベーステーマエフェクトクラス === */
.theme-effect {
    position: fixed;
    pointer-events: none;
    z-index: 1;
}

/* === キーフレームアニメーション === */
/* 落下アニメーション */
@keyframes fall {
    0% {
        transform: translateY(0);
    }
    100% {
        transform: translateY(100vh);
    }
}

@keyframes sway {
    0% {
        transform: translateX(0px);
    }
    50% {
        transform: translateX(20px);
    }
    100% {
        transform: translateX(0px);
    }
}

@keyframes rotate {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

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

@keyframes twinkle {
    0%, 100% {
        opacity: 0.3;
    }
    50% {
        opacity: 1;
    }
}

@keyframes glow {
    0%, 100% {
        box-shadow: 0 0 5px currentColor;
    }
    50% {
        box-shadow: 0 0 20px currentColor;
    }
}

@keyframes fade-in-out {
    0%, 100% {
        opacity: 0;
    }
    50% {
        opacity: 1;
    }
}

/* === 太陽のまぶしさエフェクト === */
.theme-effect.sun-glare {
    background: radial-gradient(circle, rgba(255, 255, 0, 0.3) 0%, transparent 70%);
    border-radius: 50%;
    animation: twinkle 2s ease-in-out infinite;
}

/* === コウモリエフェクト === */
.theme-effect.bat {
    background: #000;
    border-radius: 50% 10px 50% 10px;
    animation: float 3s ease-in-out infinite;
}

.theme-effect.bat::before {
    content: '';
    position: absolute;
    top: 50%;
    left: -50%;
    width: 100%;
    height: 50%;
    background: #000;
    border-radius: 50% 0 0 50%;
    transform: translateY(-50%);
}

.theme-effect.bat::after {
    content: '';
    position: absolute;
    top: 50%;
    right: -50%;
    width: 100%;
    height: 50%;
    background: #000;
    border-radius: 0 50% 50% 0;
    transform: translateY(-50%);
}

/* === 花びらエフェクト === */
.theme-effect.petal {
    background: linear-gradient(45deg, #FFB6C1, #FFC0CB, #FFCCCB);
    border-radius: 50% 0 50% 0;
    animation: fall 5s linear infinite, sway 2s ease-in-out infinite, rotate 3s linear infinite;
    opacity: 0.8;
}

/* === 葉っぱエフェクト === */
.theme-effect.leaf {
    /* 背景色はバリエーションのため動的に設定されます */
    /* 異なる葉の形状のためボーダー半径は動的に設定されます */
    animation: fall 7s linear infinite, sway 2s ease-in-out infinite, rotate 3s linear infinite;
}

/* === 雪の結晶エフェクト === */
.theme-effect.snowflake {
    background: #FFF;
    border-radius: 50%;
    animation: fall 5s linear infinite, sway 1s ease-in-out infinite;
    box-shadow: 0 0 3px rgba(255, 255, 255, 0.8);
}

/* === 提灯エフェクト === */
.theme-effect.lantern {
    background: linear-gradient(to bottom, #FFD700 0%, #FF8C00 50%, #FF4500 100%);
    border-radius: 10px 10px 50% 50%;
    animation: float 3s ease-in-out infinite, glow 2s ease-in-out infinite;
    box-shadow: 0 0 10px rgba(255, 215, 0, 0.6);
}

.theme-effect.lantern::before {
    content: '';
    position: absolute;
    top: -5px;
    left: 50%;
    width: 2px;
    height: 10px;
    background: #8B4513;
    transform: translateX(-50%);
}

/* === クリスマスライトエフェクト === */
.theme-effect.christmas-light {
    width: 8px !important;
    height: 12px !important;
    border-radius: 50% 50% 50% 50% / 60% 60% 40% 40%;
    animation: twinkle 1s ease-in-out infinite;
    box-shadow: 0 0 5px currentColor;
}

/* === 花火エフェクト === */
.theme-effect.firework {
    width: 4px !important;
    height: 4px !important;
    border-radius: 50%;
    animation: firework-explode 2s ease-out forwards;
}

@keyframes firework-explode {
    0% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(20);
        opacity: 0.8;
    }
    100% {
        transform: scale(40);
        opacity: 0;
    }
}

/* === おばけエフェクト === */
.theme-effect.ghost {
    background: rgba(255, 255, 255, 0.8);
    border-radius: 50% 50% 0 0;
    animation: float 5s ease-in-out infinite, fade-in-out 3s ease-in-out infinite;
    position: relative;
}

.theme-effect.ghost::before {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 100%;
    height: 10px;
    background: linear-gradient(90deg, 
        transparent 0%, 
        rgba(255, 255, 255, 0.8) 10%, 
        transparent 20%,
        rgba(255, 255, 255, 0.8) 30%, 
        transparent 40%,
        rgba(255, 255, 255, 0.8) 50%, 
        transparent 60%,
        rgba(255, 255, 255, 0.8) 70%, 
        transparent 80%,
        rgba(255, 255, 255, 0.8) 90%, 
        transparent 100%
    );
}

.theme-effect.ghost::after {
    content: '👻';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 0.8em;
}

/* === レスポンシブ調整 === */
@media (max-width: 768px) {
    .theme-effect {
        transform: scale(0.7);
    }
    
    .theme-effect.lantern,
    .theme-effect.ghost {
        transform: scale(0.5);
    }
}

@media (max-width: 480px) {
    .theme-effect {
        transform: scale(0.5);
    }
    
    .theme-effect.lantern,
    .theme-effect.ghost {
        transform: scale(0.3);
    }
}

/* === パフォーマンス最適化 === */
.theme-effect {
    will-change: transform, opacity;
    backface-visibility: hidden;
    transform-style: preserve-3d;
}

/* 低スペックデバイスでのアニメーション減少 */
@media (prefers-reduced-motion: reduce) {
    .theme-effect {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        opacity: 0.3;
    }
}