/* 庆祝动画效果 - 超级炫酷 */

/* 烟花效果 */
.firework {
    position: fixed;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    pointer-events: none;
    z-index: 9999;
}

.firework-burst {
    position: fixed;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    pointer-events: none;
    z-index: 9998;
    animation: fireworkBurst 1s ease-out forwards;
}

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

/* 星星雨 */
.star-rain {
    position: fixed;
    font-size: 24px;
    pointer-events: none;
    z-index: 9997;
    animation: starRain 3s linear forwards;
}

@keyframes starRain {
    0% {
        transform: translateY(-100px) rotate(0deg);
        opacity: 1;
    }
    100% {
        transform: translateY(110vh) rotate(720deg);
        opacity: 0;
    }
}

/* 彩虹出现 */
.rainbow {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 200px;
    z-index: 9996;
    animation: rainbowAppear 2s ease-out forwards;
    pointer-events: none;
}

@keyframes rainbowAppear {
    0% {
        transform: translate(-50%, -50%) scale(0) rotate(-180deg);
        opacity: 0;
    }
    50% {
        transform: translate(-50%, -50%) scale(1.2) rotate(0deg);
        opacity: 1;
    }
    100% {
        transform: translate(-50%, -50%) scale(1) rotate(0deg);
        opacity: 0;
    }
}

/* 超级庆祝覆盖层 */
.celebration-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 9995;
}

/* 彩带飘落 */
.confetti {
    position: fixed;
    width: 12px;
    height: 12px;
    pointer-events: none;
    z-index: 9994;
    animation: confettiFall 3s linear forwards;
}

@keyframes confettiFall {
    0% {
        transform: translateY(-100px) rotate(0deg);
        opacity: 1;
    }
    100% {
        transform: translateY(110vh) rotate(720deg);
        opacity: 0;
    }
}

/* 成功闪光 */
.success-flash {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at center, rgba(255, 217, 61, 0.3), transparent 70%);
    pointer-events: none;
    z-index: 9993;
    animation: successFlash 1s ease-out forwards;
}

@keyframes successFlash {
    0% {
        opacity: 0;
        transform: scale(0.8);
    }
    50% {
        opacity: 1;
        transform: scale(1.1);
    }
    100% {
        opacity: 0;
        transform: scale(1.2);
    }
}

/* 奖励弹出 */
.reward-popup {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: white;
    padding: 40px 60px;
    border-radius: 30px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
    z-index: 10000;
    text-align: center;
    animation: rewardPop 0.6s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

@keyframes rewardPop {
    0% {
        transform: translate(-50%, -50%) scale(0);
        opacity: 0;
    }
    100% {
        transform: translate(-50%, -50%) scale(1);
        opacity: 1;
    }
}

.reward-popup .reward-icon {
    font-size: 80px;
    display: block;
    margin-bottom: 20px;
    animation: bounce 1s ease-in-out infinite;
}

.reward-popup .reward-text {
    font-size: 32px;
    font-weight: bold;
    color: var(--primary);
    margin-bottom: 10px;
}

.reward-popup .reward-subtext {
    font-size: 18px;
    color: var(--text-light);
}

/* 进度完成庆祝 */
.celebration-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 9999;
}

/* 大星星旋转 */
.star-big {
    position: fixed;
    font-size: 100px;
    pointer-events: none;
    z-index: 9998;
    animation: starSpin 2s ease-out forwards;
}

@keyframes starSpin {
    0% {
        transform: translate(-50%, -50%) scale(0) rotate(0deg);
        opacity: 0;
    }
    50% {
        transform: translate(-50%, -50%) scale(1.5) rotate(180deg);
        opacity: 1;
    }
    100% {
        transform: translate(-50%, -50%) scale(2) rotate(360deg);
        opacity: 0;
    }
}

/* 按钮点击波纹 */
.ripple-effect {
    position: absolute;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.6);
    transform: scale(0);
    animation: ripple 0.6s ease-out;
    pointer-events: none;
}

@keyframes ripple {
    to {
        transform: scale(4);
        opacity: 0;
    }
}

/* 页面过渡 */
.page-transition {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--bg-gradient);
    z-index: 10001;
    animation: pageTransition 0.8s ease-in-out forwards;
}

@keyframes pageTransition {
    0% {
        transform: translateY(100%);
        opacity: 1;
    }
    50% {
        transform: translateY(0);
        opacity: 1;
    }
    100% {
        transform: translateY(-100%);
        opacity: 0;
    }
}

/* 分数弹出增强 */
.score-popup-enhanced {
    position: fixed;
    font-size: 36px;
    font-weight: bold;
    color: var(--accent);
    text-shadow: 0 4px 8px rgba(0,0,0,0.3);
    pointer-events: none;
    z-index: 10002;
    animation: scorePopupEnhanced 1.2s ease-out forwards;
}

@keyframes scorePopupEnhanced {
    0% {
        transform: translateY(0) scale(0.5);
        opacity: 0;
    }
    30% {
        transform: translateY(-30px) scale(1.2);
        opacity: 1;
    }
    100% {
        transform: translateY(-80px) scale(0.8);
        opacity: 0;
    }
}

/* 完成动画 */
.completion-animation {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    z-index: 10003;
    animation: completionPop 1s ease-out forwards;
}

@keyframes completionPop {
    0% {
        transform: translate(-50%, -50%) scale(0) rotate(-180deg);
        opacity: 0;
    }
    60% {
        transform: translate(-50%, -50%) scale(1.1) rotate(10deg);
        opacity: 1;
    }
    100% {
        transform: translate(-50%, -50%) scale(1) rotate(0deg);
        opacity: 1;
    }
}

.completion-animation .completion-icon {
    font-size: 120px;
    display: block;
    animation: bounce 1.5s ease-in-out infinite;
}

.completion-animation .completion-text {
    font-size: 48px;
    font-weight: bold;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-top: 20px;
}
