/* ========================================
   אפקטים ויזואליים
   ======================================== */

/* ========================================
   קונפטי
   ======================================== */
#confetti-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1000;
    overflow: hidden;
}

.confetti {
    position: absolute;
    top: -10px;
    width: 10px;
    height: 10px;
    opacity: 0;
    animation: confettiFall 3s ease-out forwards;
}

.confetti-circle {
    border-radius: 50%;
}

.confetti-square {
    border-radius: 2px;
}

.confetti-triangle {
    width: 0;
    height: 0;
    border-left: 6px solid transparent;
    border-right: 6px solid transparent;
    border-bottom: 10px solid currentColor;
    background: none !important;
}

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

/* ========================================
   כוכבים מעופפים
   ======================================== */
#stars-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 999;
    overflow: hidden;
}

.flying-star {
    position: absolute;
    font-size: 2em;
    animation: starFly 1s ease-out forwards;
    pointer-events: none;
}

@keyframes starFly {
    0% {
        opacity: 1;
        transform: translate(0, 0) scale(0.5) rotate(0deg);
    }
    50% {
        opacity: 1;
        transform: translate(var(--star-x, 50px), var(--star-y, -80px)) scale(1.2) rotate(180deg);
    }
    100% {
        opacity: 0;
        transform: translate(var(--star-end-x, 100px), var(--star-end-y, -150px)) scale(0) rotate(360deg);
    }
}

/* ========================================
   אפקט נכון - ירוק מהבהב
   ======================================== */
.correct-flash {
    animation: correctFlash 0.5s ease;
}

@keyframes correctFlash {
    0%, 100% { box-shadow: none; }
    50% { box-shadow: 0 0 30px rgba(67, 233, 123, 0.6), 0 0 60px rgba(67, 233, 123, 0.3); }
}

/* ========================================
   אפקט +1 כוכב צף
   ======================================== */
.float-plus {
    position: fixed;
    font-size: 1.8em;
    font-weight: bold;
    color: #FFD700;
    pointer-events: none;
    z-index: 1001;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
    animation: floatUp 1s ease-out forwards;
}

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

/* ========================================
   אפקט רעידה (תשובה שגויה)
   ======================================== */
.shake-screen {
    animation: shakeScreen 0.4s ease;
}

@keyframes shakeScreen {
    0%, 100% { transform: translateX(0); }
    20% { transform: translateX(-5px); }
    40% { transform: translateX(5px); }
    60% { transform: translateX(-3px); }
    80% { transform: translateX(3px); }
}

/* ========================================
   אפקט רצף (streak)
   ======================================== */
.streak-fire {
    animation: fireGlow 0.5s ease infinite alternate;
}

@keyframes fireGlow {
    from { text-shadow: 0 0 10px #FFD700, 0 0 20px #FFA500; }
    to { text-shadow: 0 0 15px #FFD700, 0 0 30px #FFA500, 0 0 40px #FF6347; }
}

/* ========================================
   אפקט שיא חדש
   ======================================== */
.new-record {
    animation: recordPulse 1s ease infinite;
}

@keyframes recordPulse {
    0%, 100% { 
        transform: scale(1);
        text-shadow: 0 0 10px rgba(255,215,0,0.5);
    }
    50% { 
        transform: scale(1.1);
        text-shadow: 0 0 20px rgba(255,215,0,0.8), 0 0 40px rgba(255,215,0,0.4);
    }
}

/* ========================================
   אפקט הופעה למספרים
   ======================================== */
.num-appear {
    animation: numAppear 0.3s ease;
}

@keyframes numAppear {
    from { 
        opacity: 0;
        transform: scale(0.5) translateY(10px);
    }
    to { 
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

/* ========================================
   אפקט pulse לכפתורים
   ======================================== */
.btn-pulse {
    animation: btnPulse 0.3s ease;
}

@keyframes btnPulse {
    0% { transform: scale(1); }
    50% { transform: scale(0.95); }
    100% { transform: scale(1); }
}

/* ========================================
   אפקט זוהר לשלב שהושלם
   ======================================== */
.level-completed {
    background: linear-gradient(135deg, #FFD700 0%, #FFA500 100%) !important;
    color: white !important;
    border-color: #FFD700 !important;
}

.level-current {
    border-color: #43e97b !important;
    box-shadow: 0 0 15px rgba(67,233,123,0.5);
    animation: currentLevelPulse 2s ease infinite;
}

@keyframes currentLevelPulse {
    0%, 100% { box-shadow: 0 0 15px rgba(67,233,123,0.3); }
    50% { box-shadow: 0 0 25px rgba(67,233,123,0.6); }
}
