body {
    margin: 0;
    padding: 0;
    font-family: 'Poppins', sans-serif;
}

/* Animation des lucioles */
.firefly {
    position: absolute;
    width: 3px;
    height: 3px;
    background-color: #fff;
    border-radius: 50%;
    box-shadow: 0 0 15px 2px rgba(255, 255, 255, 0.8);
    animation: float 20s infinite;
    opacity: 0;
}

.firefly:nth-child(1) { animation-delay: 0s; left: 10%; }
.firefly:nth-child(2) { animation-delay: 2s; left: 20%; }
.firefly:nth-child(3) { animation-delay: 4s; left: 50%; }
.firefly:nth-child(4) { animation-delay: 6s; left: 70%; }
.firefly:nth-child(5) { animation-delay: 8s; left: 80%; }
.firefly:nth-child(6) { animation-delay: 10s; left: 90%; }

@keyframes float {
    0% {
        transform: translateY(100vh) scale(0);
        opacity: 0;
    }
    10% {
        opacity: 1;
    }
    90% {
        opacity: 1;
    }
    100% {
        transform: translateY(-100px) scale(0.8);
        opacity: 0;
    }
}

/* Animation de la bougie */
.candle-container {
    position: relative;
    width: 100%;
    height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
}

@media (min-width: 640px) {
    .candle-container {
        height: 300px;
    }
}

.candle {
    width: 30px;
    height: 80px;
    background: linear-gradient(180deg, #ff9d76 0%, #ffd89e 100%);
    border-radius: 4px;
    position: relative;
}

@media (min-width: 640px) {
    .candle {
        width: 40px;
        height: 100px;
    }
}

.flame {
    position: absolute;
    top: -25px;
    left: 50%;
    transform: translateX(-50%);
    width: 20px;
    height: 40px;
    animation: flameFlicker 4s infinite;
    transform-origin: center bottom;
}

.flame-core {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    width: 10px;
    height: 20px;
    background: #fff;
    border-radius: 50% 50% 50% 50% / 60% 60% 40% 40%;
    animation: flameDance 3s infinite;
    filter: blur(0.5px);
    transform-origin: center bottom;
}

.flame-main {
    position: absolute;
    width: 100%;
    height: 100%;
    background: linear-gradient(to top, #ff6b2b, #ff9d00);
    border-radius: 50% 50% 50% 50% / 60% 60% 40% 40%;
    transform-origin: center bottom;
    animation: flameSwirl 3s infinite;
    filter: blur(0.5px);
}

.flame-halo {
    position: absolute;
    width: 200%;
    height: 200%;
    left: -50%;
    top: -50%;
    background: radial-gradient(ellipse at center, rgba(255, 147, 43, 0.7) 0%, rgba(255, 147, 43, 0) 80%);
    transform-origin: center bottom;
    animation: flameHalo 3s infinite;
    filter: blur(1px);
}

.flame-glow {
    position: absolute;
    width: 300%;
    height: 300%;
    left: -100%;
    top: -100%;
    background: radial-gradient(ellipse at center, rgba(255, 157, 43, 0.4) 0%, rgba(255, 147, 43, 0) 100%);
    transform-origin: center bottom;
    animation: flameGlow 4s infinite;
    filter: blur(2px);
}

.shadows {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border-radius: 50% 50% 50% 50% / 60% 60% 40% 40%;
    background: radial-gradient(ellipse at center, rgba(255, 107, 43, 0.5) 0%, rgba(255, 107, 43, 0) 90%);
}

.wick {
    position: absolute;
    top: -1px;
    left: 50%;
    transform: translateX(-50%);
    width: 4px;
    height: 10px;
    background: #23191f;
    border-radius: 2px;
}

.wax {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(180deg, #ff9d76 0%, #ffd89e 100%);
    border-radius: 4px;
    overflow: hidden;
}

.wax::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, rgba(255, 255, 255, 0.1) 0%, rgba(255, 255, 255, 0) 50%, rgba(255, 255, 255, 0.1) 100%);
}

@keyframes flameFlicker {
    0%, 100% {
        transform: translateX(-50%) scale(1) rotate(-1deg);
    }
    10% {
        transform: translateX(-51%) scale(1.1) rotate(1deg);
    }
    20% {
        transform: translateX(-49%) scale(0.95) rotate(-2deg);
    }
    30% {
        transform: translateX(-52%) scale(1.15) rotate(3deg);
    }
    40% {
        transform: translateX(-50%) scale(0.98) rotate(-1deg);
    }
    50% {
        transform: translateX(-51%) scale(1.05) rotate(2deg);
    }
    60% {
        transform: translateX(-49%) scale(0.96) rotate(-2deg);
    }
    70% {
        transform: translateX(-52%) scale(1.12) rotate(1deg);
    }
    80% {
        transform: translateX(-50%) scale(0.99) rotate(-1deg);
    }
    90% {
        transform: translateX(-51%) scale(1.08) rotate(2deg);
    }
}

@keyframes flameDance {
    0%, 100% {
        transform: translate(-50%, -50%) scale(1) skewX(0deg);
    }
    25% {
        transform: translate(-52%, -55%) scale(1.05) skewX(-2deg);
    }
    50% {
        transform: translate(-48%, -45%) scale(0.95) skewX(2deg);
    }
    75% {
        transform: translate(-51%, -50%) scale(1.02) skewX(-1deg);
    }
}

@keyframes flameSwirl {
    0%, 100% {
        transform: rotate(-2deg) scale(1) translate(0, 0);
    }
    25% {
        transform: rotate(4deg) scale(1.15) translate(-2px, -2px);
    }
    50% {
        transform: rotate(-1deg) scale(0.98) translate(2px, 2px);
    }
    75% {
        transform: rotate(3deg) scale(1.1) translate(-1px, -1px);
    }
}

@keyframes flameHalo {
    0%, 100% {
        transform: rotate(-2deg) scale(1) translate(0, 0);
        opacity: 0.6;
    }
    33% {
        transform: rotate(3deg) scale(1.1) translate(-2px, -1px);
        opacity: 0.5;
    }
    66% {
        transform: rotate(-1deg) scale(1.15) translate(1px, -2px);
        opacity: 0.4;
    }
}

@keyframes flameGlow {
    0%, 100% {
        transform: scale(1) rotate(0deg);
        opacity: 0.3;
    }
    33% {
        transform: scale(1.1) rotate(2deg);
        opacity: 0.25;
    }
    66% {
        transform: scale(1.15) rotate(-1deg);
        opacity: 0.2;
    }
}

/* Ajustements responsifs pour la flamme */
@media (max-width: 640px) {
    .flame {
        width: 16px;
        height: 32px;
        top: -20px;
    }

    .flame-core {
        width: 8px;
        height: 16px;
    }
}

@media (max-width: 375px) {
    .flame {
        width: 14px;
        height: 28px;
        top: -18px;
    }

    .flame-core {
        width: 7px;
        height: 14px;
    }
}

/* Optimisations pour les petits écrans */
@media (max-width: 640px) {
    .firefly {
        width: 2px;
        height: 2px;
        box-shadow: 0 0 10px 1px rgba(255, 255, 255, 0.8);
    }
}

/* Amélioration de la performance sur mobile */
@media (max-width: 768px) {
    .firefly {
        animation-duration: 15s;
    }
}

/* Styles généraux et transitions */
.transition-all {
    transition-property: all;
    transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
    transition-duration: 300ms;
}

/* Optimisations pour le scroll */
html {
    scroll-behavior: smooth;
}