/* =====================================================
   🎆 ANIMATION COUNTDOWN EXCENTRIQUE 🎆
   ===================================================== */

.countdown-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: linear-gradient(135deg, #0a0f1a 0%, #1a3a47 50%, #2A5F71 100%);
    z-index: 99999;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.5s ease;
}

.countdown-overlay.active {
    opacity: 1;
    pointer-events: all;
}

/* Particules de fond animées */
.countdown-overlay::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background:
        radial-gradient(circle at 20% 80%, rgba(251, 192, 93, 0.3) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(147, 51, 234, 0.3) 0%, transparent 50%),
        radial-gradient(circle at 50% 50%, rgba(42, 95, 113, 0.2) 0%, transparent 70%);
    animation: particlesPulse 3s ease-in-out infinite;
    pointer-events: none;
}

@keyframes particlesPulse {

    0%,
    100% {
        transform: scale(1) rotate(0deg);
        opacity: 0.8;
    }

    50% {
        transform: scale(1.2) rotate(180deg);
        opacity: 1;
    }
}

/* Message principal */
.countdown-message {
    font-family: 'Orbitron', sans-serif;
    font-size: clamp(2rem, 5vw, 4rem);
    font-weight: 900;
    text-align: center;
    margin-bottom: 4rem;
    opacity: 0;
    transform: scale(0.5) rotate(-10deg);
    background: linear-gradient(135deg, #FBC05D 0%, #9333ea 50%, #3d8099 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-shadow: 0 0 80px rgba(251, 192, 93, 0.8);
    animation: messageAppear 1s cubic-bezier(0.68, -0.55, 0.265, 1.55) forwards;
}

@keyframes messageAppear {
    0% {
        opacity: 0;
        transform: scale(0.5) rotate(-10deg);
    }

    100% {
        opacity: 1;
        transform: scale(1) rotate(0deg);
    }
}

/* Nombre du compte à rebours */
.countdown-number {
    font-family: 'Orbitron', sans-serif;
    font-size: clamp(10rem, 25vw, 20rem);
    font-weight: 900;
    color: #FBC05D;
    text-shadow:
        0 0 40px rgba(251, 192, 93, 1),
        0 0 80px rgba(251, 192, 93, 0.8),
        0 0 120px rgba(251, 192, 93, 0.6);
    position: relative;
    opacity: 0;
    transform: scale(3) rotate(360deg);
}

/* Animation pour chaque nombre */
.countdown-number.show {
    animation: numberExplode 0.8s cubic-bezier(0.68, -0.55, 0.265, 1.55) forwards;
}

@keyframes numberExplode {
    0% {
        opacity: 0;
        transform: scale(3) rotate(360deg);
    }

    50% {
        opacity: 1;
        transform: scale(1.2) rotate(0deg);
    }

    100% {
        opacity: 1;
        transform: scale(1) rotate(0deg);
    }
}

.countdown-number.hide {
    animation: numberImplode 0.5s ease-in forwards;
}

@keyframes numberImplode {
    0% {
        opacity: 1;
        transform: scale(1) rotate(0deg);
    }

    100% {
        opacity: 0;
        transform: scale(0) rotate(-360deg);
    }
}

/* Effet de cercle qui grandit autour du nombre */
.countdown-number::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border: 5px solid rgba(251, 192, 93, 0.5);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    animation: circleExpand 0.8s ease-out forwards;
}

@keyframes circleExpand {
    0% {
        width: 0;
        height: 0;
        opacity: 1;
    }

    100% {
        width: 150%;
        height: 150%;
        opacity: 0;
    }
}

/* Message GO! */
.countdown-go {
    font-family: 'Orbitron', sans-serif;
    font-size: clamp(8rem, 20vw, 15rem);
    font-weight: 900;
    background: linear-gradient(135deg, #FBC05D 0%, #9333ea 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    opacity: 0;
    transform: scale(0);
    text-shadow: 0 0 100px rgba(251, 192, 93, 1);
}

.countdown-go.show {
    animation: goExplode 0.6s cubic-bezier(0.68, -0.55, 0.265, 1.55) forwards;
}

@keyframes goExplode {
    0% {
        opacity: 0;
        transform: scale(0) rotate(-180deg);
    }

    50% {
        opacity: 1;
        transform: scale(1.5) rotate(0deg);
    }

    100% {
        opacity: 0;
        transform: scale(3) rotate(180deg);
    }
}

/* Confettis */
.confetti {
    position: absolute;
    width: 10px;
    height: 10px;
    background: #FBC05D;
    opacity: 0;
}

.confetti.burst {
    animation: confettiBurst 1.5s ease-out forwards;
}

@keyframes confettiBurst {
    0% {
        opacity: 1;
        transform: translateY(0) rotate(0deg) scale(1);
    }

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

/* Flash final */
.flash {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle, rgba(251, 192, 93, 0.8) 0%, transparent 70%);
    opacity: 0;
    pointer-events: none;
}

.flash.active {
    animation: flashExplode 0.5s ease-out forwards;
}

@keyframes flashExplode {
    0% {
        opacity: 0;
        transform: scale(0);
    }

    50% {
        opacity: 1;
        transform: scale(1);
    }

    100% {
        opacity: 0;
        transform: scale(2);
    }
}

/* Effet de rayons */
.rays {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 200%;
    height: 200%;
    transform: translate(-50%, -50%);
    opacity: 0;
    pointer-events: none;
}

.rays.active {
    animation: raysRotate 2s linear infinite;
    opacity: 0.3;
}

@keyframes raysRotate {
    from {
        transform: translate(-50%, -50%) rotate(0deg);
    }

    to {
        transform: translate(-50%, -50%) rotate(360deg);
    }
}

.ray {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 4px;
    height: 100%;
    background: linear-gradient(to bottom, transparent 0%, rgba(251, 192, 93, 0.5) 50%, transparent 100%);
    transform-origin: top center;
}

.ray:nth-child(1) {
    transform: rotate(0deg);
}

.ray:nth-child(2) {
    transform: rotate(45deg);
}

.ray:nth-child(3) {
    transform: rotate(90deg);
}

.ray:nth-child(4) {
    transform: rotate(135deg);
}

.ray:nth-child(5) {
    transform: rotate(180deg);
}

.ray:nth-child(6) {
    transform: rotate(225deg);
}

.ray:nth-child(7) {
    transform: rotate(270deg);
}

.ray:nth-child(8) {
    transform: rotate(315deg);
}