/* Balloons */
#balloons-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    pointer-events: none; /* Désactive les événements de souris sur le conteneur */
}

.balloon {
    position: absolute;
    width: 120px;
    height: 150px;
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    cursor: pointer;
    z-index: 1000; /* Augmenté pour s'assurer qu'il est au-dessus des autres éléments */
    opacity: 1;
    pointer-events: auto !important; /* Forcer les événements de souris */
    transition: transform 0.2s ease, opacity 0.3s ease;
    -webkit-tap-highlight-color: transparent; /* Enlève le surlignage au clic sur mobile */
    touch-action: manipulation; /* Améliore la réactivité sur mobile */
}

/* S'assurer que le conteneur des ballons ne bloque pas les clics */
#balloons-container > * {
    pointer-events: auto !important;
}

/* Animation d'éclatement avec effet de gonflement */
@keyframes pop {
    0% {
        transform: translate(var(--x, 0), var(--y, 0)) scale(1) rotate(0deg);
        opacity: 1;
    }
    30% {
        transform: translate(var(--x, 0), var(--y, 0)) scale(1.4) rotate(5deg);
    }
    60% {
        transform: translate(var(--x, 0), var(--y, 0)) scale(1.6) rotate(-3deg);
        opacity: 0.9;
    }
    100% {
        transform: translate(var(--x, 0), var(--y, 0)) scale(0.3) rotate(0deg);
        opacity: 0;
    }
}

.balloon.popping {
    animation: pop 0.3s ease-out forwards;
    pointer-events: none;
    position: absolute;
    top: 0;
    left: 0;
    will-change: transform, opacity;
}

.balloon-counter .fa-birthday-cake { color: #ff9ff3 !important; }
.balloon-counter .fa-trophy { color: #feca57 !important; }
.balloon-counter .fa-crown { color: #ffd700 !important; }


/* Animation de perte de vie */
@keyframes loseLife {
    0% { transform: scale(1); }
    50% { transform: scale(1.3); }
    100% { transform: scale(1); }
}

.lose-life .lives-container i:not(.lost) {
    animation: loseLife 0.5s ease;
}