/* ============================================
 * 抽奖动画系统 - 精简样式表
 * 5种动画全部使用全屏Canvas渲染，无需CSS动画类
 * 本文件仅保留：CSS变量、通用粒子、结果卡片、天选之人特效
 * ============================================ */

:root {
    --lottery-gold: #ffd700;
    --lottery-brown: #8b5a2b;
    --lottery-parchment: #e8d4b8;
    --lottery-dark: #2c1810;
    --rarity-common: #9e9e9e;
    --rarity-rare: #2196f3;
    --rarity-epic: #9c27b0;
    --rarity-legendary: #ff9800;
    --rarity-mythic: #f44336;
}

/* ==========================================
 * 通用粒子效果（用于DOM粒子场景）
 * ========================================== */
.particle {
    position: absolute;
    border-radius: 50%;
    pointer-events: none;
    animation: particleFly var(--duration, 1s) ease-out forwards;
}

.particle-star {
    border-radius: 0;
    clip-path: polygon(50% 0%, 61% 35%, 98% 35%, 68% 57%, 79% 91%, 50% 70%, 21% 91%, 32% 57%, 2% 35%, 39% 35%);
}

@keyframes particleFly {
    0% { transform: translate(0, 0) scale(1); opacity: 1; }
    100% { transform: translate(var(--tx, 100px), var(--ty, -100px)) scale(0); opacity: 0; }
}

/* ==========================================
 * 天选之人 特效（全屏DOM覆盖）
 * ========================================== */
.lucky-event-overlay {
    position: fixed;
    top: 0; left: 0;
    width: 100vw; height: 100vh;
    z-index: 99999;
    pointer-events: none;
    overflow: hidden;
}

.lucky-flash {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: radial-gradient(circle at center, rgba(255,215,0,0.9) 0%, rgba(255,215,0,0) 70%);
    animation: luckyFlash 0.6s ease-out forwards;
}

@keyframes luckyFlash {
    0% { opacity: 1; transform: scale(0.5); }
    50% { opacity: 0.8; transform: scale(2); }
    100% { opacity: 0; transform: scale(3); }
}

.lucky-text {
    position: absolute;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%) scale(0);
    font-size: 72px;
    font-weight: 900;
    color: #ffd700;
    text-shadow:
        0 0 20px rgba(255,215,0,0.8),
        0 0 40px rgba(255,215,0,0.6),
        0 0 80px rgba(255,215,0,0.4),
        0 4px 0 #b8860b;
    white-space: nowrap;
    animation: luckyTextAppear 1.2s cubic-bezier(0.34, 1.56, 0.64, 1) 0.3s forwards;
    letter-spacing: 8px;
}

@keyframes luckyTextAppear {
    0% { transform: translate(-50%, -50%) scale(0) rotate(-10deg); opacity: 0; }
    60% { transform: translate(-50%, -50%) scale(1.2) rotate(3deg); opacity: 1; }
    100% { transform: translate(-50%, -50%) scale(1) rotate(0deg); opacity: 1; }
}

.screen-shake {
    animation: screenShake 0.5s ease-out;
}

@keyframes screenShake {
    0%, 100% { transform: translate(0, 0); }
    10% { transform: translate(-8px, 4px); }
    20% { transform: translate(6px, -6px); }
    30% { transform: translate(-4px, 8px); }
    40% { transform: translate(8px, -2px); }
    50% { transform: translate(-6px, 6px); }
    60% { transform: translate(4px, -8px); }
    70% { transform: translate(-8px, 2px); }
    80% { transform: translate(6px, 4px); }
    90% { transform: translate(-2px, -6px); }
}

/* ==========================================
 * 响应式适配
 * ========================================== */
@media (max-width: 768px) {
    .lucky-text {
        font-size: 42px;
        letter-spacing: 4px;
    }
}

@media (max-width: 480px) {
    .lucky-text {
        font-size: 32px;
        letter-spacing: 2px;
    }
}
