/**
 * Visual Effects & Animations
 */

/* Particle Effects */
.mtg-particle {
    position: fixed;
    pointer-events: none;
    z-index: 9999;
}

.mtg-confetti {
    width: 10px;
    height: 10px;
    animation: confetti-fall 2s ease-out forwards;
}

.mtg-smoke {
    width: 40px;
    height: 40px;
    background: radial-gradient(circle, rgba(0,0,0,0.3), transparent);
    border-radius: 50%;
    animation: smoke-rise 3s ease-out forwards;
}

.mtg-shard {
    position: fixed;
    width: 8px;
    height: 8px;
    background: rgba(255,255,255,0.8);
    animation: shard-fly 1s ease-out forwards;
    transform: rotate(calc(var(--angle) * 57.3deg));
}

@keyframes confetti-fall {
    0% {
        transform: translate(0, 0) rotate(0deg);
        opacity: 1;
    }
    100% {
        transform: translate(calc(var(--vx) * 100px), calc(var(--vy) * 100px + 500px)) rotate(720deg);
        opacity: 0;
    }
}

@keyframes smoke-rise {
    0% {
        transform: translateY(0) scale(1);
        opacity: 0.6;
    }
    100% {
        transform: translateY(-200px) scale(2);
        opacity: 0;
    }
}

@keyframes shard-fly {
    0% {
        transform: translate(0, 0) rotate(0deg);
        opacity: 1;
    }
    100% {
        transform: translate(calc(cos(var(--angle)) * 150px), calc(sin(var(--angle)) * 150px)) rotate(360deg);
        opacity: 0;
    }
}

/* Screen Shake */
.mtg-screen-shake {
    animation: shake 0.5s;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    10%, 30%, 50%, 70%, 90% { transform: translateX(-5px); }
    20%, 40%, 60%, 80% { transform: translateX(5px); }
}

/* Achievement Notification */
.mtg-achievement-unlock {
    position: fixed;
    top: 20px;
    right: 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.3);
    display: flex;
    align-items: center;
    gap: 15px;
    max-width: 350px;
    transform: translateX(400px);
    transition: transform 0.5s ease;
    z-index: 10000;
}

.mtg-achievement-unlock.show {
    transform: translateX(0);
}

.mtg-achievement-icon {
    font-size: 3em;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.3));
}

.mtg-achievement-content h3 {
    margin: 0 0 5px 0;
    font-size: 0.9em;
    text-transform: uppercase;
    letter-spacing: 1px;
    opacity: 0.9;
}

.mtg-achievement-name {
    margin: 0 0 5px 0;
    font-size: 1.3em;
    font-weight: 700;
}

.mtg-achievement-desc {
    margin: 0;
    font-size: 0.9em;
    opacity: 0.8;
}

/* Enhanced Bubble Effects */
.mtg-bubble {
    transition: all 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.mtg-bubble:hover {
    transform: scale(1.1) translateY(-5px);
    filter: brightness(1.1);
}

.mtg-bubble.mtg-bubble-selected {
    animation: pulse 1s infinite;
}

@keyframes pulse {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(52, 152, 219, 0.7);
    }
    50% {
        box-shadow: 0 0 0 20px rgba(52, 152, 219, 0);
    }
}

/* Meter Glow Effects */
.mtg-truth-meter .meter-fill {
    box-shadow: 0 0 10px rgba(39, 174, 96, 0.5);
}

.mtg-chaos-meter .meter-fill {
    box-shadow: 0 0 10px rgba(231, 76, 60, 0.5);
}

/* Loading Animation */
.mtg-loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9998;
}

.mtg-loading-spinner {
    width: 60px;
    height: 60px;
    border: 4px solid rgba(255,255,255,0.3);
    border-top-color: #3498db;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Progress Indicator */
.mtg-progress-bar {
    height: 4px;
    background: #ecf0f1;
    border-radius: 2px;
    overflow: hidden;
    margin: 10px 0;
}

.mtg-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #3498db, #2ecc71);
    transition: width 0.3s ease;
}
