/* 卡片揭示动画 - 3D翻转效果 */

/* 卡片飞入动画 */
@keyframes cardFlyIn {
    0% {
        transform: translateY(100vh) scale(0.5) rotateY(0deg);
        opacity: 0;
    }
    50% {
        transform: translateY(-10px) scale(1.1) rotateY(90deg);
        opacity: 1;
    }
    100% {
        transform: translateY(0) scale(1) rotateY(180deg);
        opacity: 1;
    }
}

/* 3D翻转动画 */
@keyframes cardFlip {
    0% {
        transform: rotateY(0deg);
    }
    100% {
        transform: rotateY(180deg);
    }
}

/* 5星金光爆发动画 */
@keyframes goldBurst {
    0% {
        transform: scale(0);
        opacity: 0;
    }
    50% {
        transform: scale(1.5);
        opacity: 1;
    }
    100% {
        transform: scale(2);
        opacity: 0;
    }
}

/* 光柱效果 */
@keyframes lightBeam {
    0% {
        transform: scaleY(0);
        opacity: 0;
    }
    30% {
        transform: scaleY(1);
        opacity: 1;
    }
    100% {
        transform: scaleY(1);
        opacity: 0.7;
    }
}

/* 粒子扩散动画 */
@keyframes particleSpread {
    0% {
        transform: translate(0, 0) scale(1);
        opacity: 1;
    }
    100% {
        transform: translate(var(--tx), var(--ty)) scale(0);
        opacity: 0;
    }
}

/* 震屏效果 */
@keyframes screenShake {
    0%, 100% {
        transform: translate(0, 0);
    }
    10%, 30%, 50%, 70%, 90% {
        transform: translate(-5px, 0);
    }
    20%, 40%, 60%, 80% {
        transform: translate(5px, 0);
    }
}

/* 十连抽卡片依次飞入 */
@keyframes cardFlyInStagger {
    0% {
        transform: translateY(150vh) scale(0.3) rotate(15deg);
        opacity: 0;
    }
    60% {
        transform: translateY(-20px) scale(1.05) rotate(0deg);
        opacity: 1;
    }
    100% {
        transform: translateY(0) scale(1) rotate(0deg);
        opacity: 1;
    }
}

/* 卡片翻转后的揭示 */
.gacha-result-item {
    perspective: 1000px;
    transform-style: preserve-3d;
}

.gacha-result-item.animating {
    animation: cardFlyIn 1.5s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

/* 十连抽动画延迟 */
.gacha-result-item.ten-wish-anim:nth-child(1) { animation: cardFlyInStagger 1s ease-out 0.1s forwards; }
.gacha-result-item.ten-wish-anim:nth-child(2) { animation: cardFlyInStagger 1s ease-out 0.2s forwards; }
.gacha-result-item.ten-wish-anim:nth-child(3) { animation: cardFlyInStagger 1s ease-out 0.3s forwards; }
.gacha-result-item.ten-wish-anim:nth-child(4) { animation: cardFlyInStagger 1s ease-out 0.4s forwards; }
.gacha-result-item.ten-wish-anim:nth-child(5) { animation: cardFlyInStagger 1s ease-out 0.5s forwards; }
.gacha-result-item.ten-wish-anim:nth-child(6) { animation: cardFlyInStagger 1s ease-out 0.6s forwards; }
.gacha-result-item.ten-wish-anim:nth-child(7) { animation: cardFlyInStagger 1s ease-out 0.7s forwards; }
.gacha-result-item.ten-wish-anim:nth-child(8) { animation: cardFlyInStagger 1s ease-out 0.8s forwards; }
.gacha-result-item.ten-wish-anim:nth-child(9) { animation: cardFlyInStagger 1s ease-out 0.9s forwards; }
.gacha-result-item.ten-wish-anim:nth-child(10) { animation: cardFlyInStagger 1s ease-out 1.0s forwards; }

/* 5星特效容器 */
.five-star-burst {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 200%;
    height: 200%;
    pointer-events: none;
    z-index: 10;
}

.five-star-burst::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 100px;
    height: 100px;
    background: radial-gradient(circle, rgba(251, 191, 36, 0.8), transparent 70%);
    animation: goldBurst 1s ease-out forwards;
}

/* 光柱容器 */
.light-beams {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    overflow: hidden;
}

.light-beam {
    position: absolute;
    bottom: 0;
    width: 2px;
    height: 100%;
    background: linear-gradient(to top, rgba(251, 191, 36, 0.8), transparent);
    transform-origin: bottom;
    animation: lightBeam 1.5s ease-out forwards;
}

.light-beam:nth-child(1) { left: 10%; animation-delay: 0.2s; }
.light-beam:nth-child(2) { left: 30%; animation-delay: 0.3s; }
.light-beam:nth-child(3) { left: 50%; animation-delay: 0.1s; width: 3px; }
.light-beam:nth-child(4) { left: 70%; animation-delay: 0.4s; }
.light-beam:nth-child(5) { left: 90%; animation-delay: 0.25s; }

/* 震屏效果应用到整个页面 */
body.screen-shake {
    animation: screenShake 0.5s ease;
}
