/* ============================================
   女巫的毒药 - 动画样式表
   ============================================ */

/* ===== 按钮发光 ===== */
@keyframes btnGlow {
    0%, 100% { box-shadow: 0 4px 20px rgba(139, 92, 246, 0.4); }
    50% { box-shadow: 0 4px 35px rgba(139, 92, 246, 0.7); }
}

/* ===== 药锅浮动 ===== */
@keyframes cauldronBob {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-12px); }
}

/* ===== 泡泡上浮 ===== */
@keyframes bubbleFloat {
    0% { transform: translateY(0) scale(1); opacity: 0.7; }
    50% { transform: translateY(-30px) scale(1.2); opacity: 1; }
    100% { transform: translateY(-60px) scale(0.5); opacity: 0; }
}

/* ===== 毒药脉冲 ===== */
@keyframes poisonPulse {
    0%, 100% { box-shadow: 0 0 20px rgba(239, 68, 68, 0.4); }
    50% { box-shadow: 0 0 35px rgba(239, 68, 68, 0.7); }
}

/* ===== 收集弹出 ===== */
@keyframes collectPop {
    0% { transform: scale(0); opacity: 0; }
    60% { transform: scale(1.3); }
    100% { transform: scale(1); opacity: 1; }
}

/* ===== 结果标题弹跳 ===== */
@keyframes resultTitleBounce {
    0% { transform: scale(0); opacity: 0; }
    50% { transform: scale(1.15); }
    70% { transform: scale(0.95); }
    100% { transform: scale(1); opacity: 1; }
}

/* ===== 失败者摇晃 ===== */
@keyframes loserShake {
    0%, 100% { transform: rotate(0); }
    10% { transform: rotate(-10deg); }
    20% { transform: rotate(10deg); }
    30% { transform: rotate(-10deg); }
    40% { transform: rotate(10deg); }
    50% { transform: rotate(-5deg); }
    60% { transform: rotate(5deg); }
    70% { transform: rotate(-2deg); }
    80% { transform: rotate(2deg); }
    90% { transform: rotate(0); }
}

/* ===== 安全图标飞行 ===== */
@keyframes flyToCollector {
    0% {
        transform: translate(var(--fly-x), var(--fly-y)) scale(1);
        opacity: 1;
    }
    100% {
        transform: translate(0, 0) scale(0.4);
        opacity: 0;
    }
}

.fly-animation {
    position: fixed;
    z-index: 500;
    pointer-events: none;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    border-radius: 8px;
}

@keyframes flyToTarget {
    0% {
        transform: scale(1);
        opacity: 1;
    }
    80% {
        opacity: 1;
    }
    100% {
        transform: scale(0.4);
        opacity: 0;
    }
}

/* ===== 中毒爆炸效果 ===== */
@keyframes poisonExplode {
    0% { transform: scale(1); }
    20% { transform: scale(1.4); }
    40% { transform: scale(0.9); filter: hue-rotate(90deg); }
    60% { transform: scale(1.2); filter: hue-rotate(180deg); }
    80% { transform: scale(0.95); filter: hue-rotate(270deg); }
    100% { transform: scale(1); filter: hue-rotate(0deg); }
}

.cell-poisoned {
    animation: poisonExplode 0.6s ease !important;
    border-color: var(--danger) !important;
    box-shadow: 0 0 40px rgba(239, 68, 68, 0.8) !important;
    background: rgba(239, 68, 68, 0.2) !important;
}

/* ===== 全屏红色闪烁 ===== */
.screen-flash {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(239, 68, 68, 0.4);
    z-index: 200;
    animation: flashRed 0.8s ease forwards;
    pointer-events: none;
}

@keyframes flashRed {
    0%, 20%, 40%, 60%, 80% { opacity: 1; }
    10%, 30%, 50%, 70% { opacity: 0; }
    100% { opacity: 0; }
}

/* ===== 格子安全选中绿光 ===== */
@keyframes safeGlow {
    0% { box-shadow: 0 0 0 rgba(16, 185, 129, 0); }
    50% { box-shadow: 0 0 30px rgba(16, 185, 129, 0.6); }
    100% { box-shadow: 0 0 0 rgba(16, 185, 129, 0); }
}

.cell-safe-flash {
    animation: safeGlow 0.5s ease;
    border-color: var(--success) !important;
}

/* ===== 淡入 ===== */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(16px); }
    to { opacity: 1; transform: translateY(0); }
}

.fade-in {
    animation: fadeIn 0.4s ease forwards;
}

/* ===== 缩放弹入 ===== */
@keyframes scaleIn {
    from { opacity: 0; transform: scale(0.8); }
    to { opacity: 1; transform: scale(1); }
}

.scale-in {
    animation: scaleIn 0.35s ease forwards;
}

/* ===== 旋转消失 ===== */
@keyframes spinOut {
    to {
        transform: rotate(360deg) scale(0);
        opacity: 0;
    }
}

/* ===== 悬浮提示动画 ===== */
@keyframes hintPulse {
    0%, 100% { opacity: 0.6; }
    50% { opacity: 1; }
}

.hint-pulse {
    animation: hintPulse 2s ease-in-out infinite;
}

/* ===== 禁用状态 ===== */
.pointer-none {
    pointer-events: none !important;
}
