/* ==================== REWARD ANIMATIONS - MOBILE OPTIMIERT ==================== */

.reward-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    animation: fadeIn 0.3s ease-out;
}

.reward-content {
    text-align: center;
    animation: scaleIn 0.5s ease-out;
}

.reward-icon {
    font-size: 8rem;
    margin-bottom: 16px;
    animation: bounceIn 0.6s ease-out;
}

.reward-title {
    font-size: 2rem;
    font-weight: 900;
    color: white;
    text-shadow: 0 0 20px rgba(255, 255, 255, 0.5);
    animation: slideUp 0.5s ease-out;
}

/* Medal-specific styles */
.reward-content.bronze .reward-icon {
    filter: drop-shadow(0 0 30px rgba(205, 127, 50, 0.8));
}

.reward-content.silver .reward-icon {
    filter: drop-shadow(0 0 30px rgba(192, 192, 192, 0.8));
}

.reward-content.gold .reward-icon {
    filter: drop-shadow(0 0 30px rgba(255, 215, 0, 0.8));
}

.reward-content.superhero .reward-icon {
    filter: drop-shadow(0 0 40px rgba(46, 204, 113, 0.8));
    animation: spin 0.8s ease-out, bounceIn 0.6s ease-out;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.5);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes bounceIn {
    0% {
        transform: scale(0);
    }
    50% {
        transform: scale(1.2);
    }
    100% {
        transform: scale(1);
    }
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes spin {
    from {
        transform: rotate(0deg) scale(1);
    }
    to {
        transform: rotate(360deg) scale(1);
    }
}

/* ==================== CONFETTI CANVAS ==================== */
#confetti-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 9998;
    display: none;
}

/* ==================== BALL ANIMATIONS ==================== */
.ball-celebration {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 6rem;
    z-index: 9999;
    animation: ballFlyAway 1.5s ease-out forwards;
}

@keyframes ballFlyAway {
    0% {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
    }
    50% {
        transform: translate(-50%, -100vh) scale(1.5);
    }
    100% {
        opacity: 0;
        transform: translate(-50%, -100vh) scale(0.5);
    }
}

/* ==================== LOADING SPINNER ==================== */
.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid rgba(0, 0, 0, 0.1);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

/* ==================== PULSE ANIMATION ==================== */
.pulse {
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
        transform: scale(1);
    }
    50% {
        opacity: 0.8;
        transform: scale(1.05);
    }
}

/* ==================== SHAKE ANIMATION ==================== */
.shake {
    animation: shake 0.5s ease-in-out;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-10px); }
    75% { transform: translateX(10px); }
}

/* ==================== MOBILE OPTIMIERUNGEN ==================== */
@media (max-width: 768px) {
    .reward-icon {
        font-size: 5rem;
    }

    .reward-title {
        font-size: 1.5rem;
    }

    .ball-celebration {
        font-size: 4rem;
    }
}

/* ==================== REDUCED MOTION ==================== */
@media (prefers-reduced-motion: reduce) {
    .reward-overlay,
    .reward-content,
    .ball-celebration,
    .spinner,
    .pulse,
    .shake {
        animation: none !important;
        transition: none !important;
    }
}