body {
    margin: 0;
    padding: 0;
    background: transparent; /* 100% transparent pour OBS */
    overflow: hidden;
    display: flex;
    align-items: flex-end; 
    justify-content: center;
    height: 100vh;
    font-family: 'Rajdhani', sans-serif;
    user-select: none;
}

/* --- EFFET : GLOW D'ALERTE NUCLÉAIRE SUIVANT LE TUBE --- */
.thermo-glow {
    position: absolute;
    top: -2px; 
    left: -2px;
    width: calc(100% + 4px); 
    height: calc(100% + 2px);
    border-radius: 32px 32px 0 0; 
    pointer-events: none;
    z-index: 10; 
    opacity: 0;
    transition: opacity 0.3s ease;
}
.thermo-glow.nuclear-active {
    opacity: 1;
    animation: nuclearFlashShape 0.5s infinite alternate;
}

/* Conteneur global du thermomètre */
.thermo-wrapper {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 40px;
    cursor: pointer;
}

/* --- SYSTEME DE FUMÉE CSS --- */
.steam-container {
    position: absolute;
    top: -50px;
    width: 30px;
    height: 50px;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 4;
}
.steam-container.active {
    opacity: 0.6;
}
.smoke-particle {
    position: absolute;
    bottom: 0;
    left: 50%;
    width: 8px;
    height: 8px;
    background: rgba(255, 255, 255, 0.4);
    border-radius: 50%;
    filter: blur(2px);
    animation: smokeRise 1.2s infinite ease-out;
}
.smoke-particle:nth-child(2) { animation-delay: 0.4s; left: 40%; }
.smoke-particle:nth-child(3) { animation-delay: 0.8s; left: 60%; }

/* --- CONTENEUR D'ÉCLAIRS NÉON --- */
.lightning-container {
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 140px;
    height: 420px;
    pointer-events: none;
    z-index: 10;
    opacity: 0;
    transition: opacity 0.2s ease;
}
.lightning-container.active {
    opacity: 1;
}
.lightning-bolt {
    position: absolute;
    background: #00ff33;
    box-shadow: 0 0 12px #00ff33, 0 0 25px #ff0055;
    opacity: 0;
}
.bolt-left {
    left: 15px;
    top: 40px;
    width: 3px;
    height: 280px;
    clip-path: polygon(50% 0%, 100% 20%, 0% 40%, 80% 60%, 10% 80%, 100% 100%);
}
.lightning-container.active .bolt-left {
    animation: boltZapping 0.4s infinite steps(2);
}
.bolt-right {
    right: 15px;
    top: 20px;
    width: 3px;
    height: 300px;
    clip-path: polygon(30% 0%, 90% 15%, 10% 35%, 100% 55%, 20% 75%, 85% 100%);
    background: #ff0055;
}
.lightning-container.active .bolt-right {
    animation: boltZapping 0.5s infinite steps(2) reverse;
    animation-delay: 0.1s;
}

/* --- TROLL DE GLACE : CAPSULE VERTICALE --- */
.frost-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border-radius: 30px 30px 0 0;
    background: linear-gradient(135deg, rgba(0, 229, 255, 0.25) 0%, rgba(0, 140, 255, 0.4) 100%);
    box-shadow: inset 0 0 12px rgba(0, 229, 255, 0.8);
    backdrop-filter: blur(1.5px);
    z-index: 9; 
    pointer-events: none;
    opacity: 0;
    transition: opacity 8s cubic-bezier(0.25, 0.1, 0.25, 1);
}
.frost-overlay.frozen {
    opacity: 1;
    transition: opacity 0.05s ease-out; /* Brisure instantanée */
}

/* Le tube vertical - Style Capsule Cyberpunk */
.thermo-tube {
    width: 24px;
    height: 320px;
    background: rgba(20, 20, 20, 0.4);
    backdrop-filter: blur(4px);
    border: 2px solid rgba(255, 255, 255, 0.7);
    border-bottom: none;
    border-radius: 30px 30px 0 0;
    position: relative;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.5);
    z-index: 5;
    transform-origin: bottom center;
    animation: deployTube 0.7s cubic-bezier(0.19, 1, 0.22, 1) both;
}

/* Le liquide qui monte dynamiquement */
#thermo-fluid {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 0%;
    background: linear-gradient(0deg, #00ff33 0%, #ffea00 50%, #ff0055 100%);
    box-shadow: 0 0 15px rgba(0, 255, 51, 0.5), 0 0 30px rgba(255, 0, 85, 0.2);
    border-radius: 30px 30px 0 0;
    z-index: 6;
}

/* La bulle/réservoir propre */
.thermo-bulb {
    width: 76px;
    height: 76px;
    background: rgba(20, 20, 20, 0.6);
    backdrop-filter: blur(4px);
    border-radius: 50%;
    margin-top: -15px;
    z-index: 7; 
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    border: 2px solid #00ff33;
    box-shadow: 0 0 20px rgba(0, 255, 51, 0.3);
    transition: border-color 0.2s, box-shadow 0.2s; 
    animation: popBulb 0.5s cubic-bezier(0.19, 1, 0.22, 1) both;
}

/* ÉTAT RECRUTEMENT DE GLACE FORCE SUR LA BULLE */
.thermo-bulb.frozen-bulb {
    border-color: #00e5ff !important; 
    box-shadow: 0 0 25px #00e5ff, inset 0 0 10px #00e5ff !important;
    transition: border-color 0.05s ease-out, box-shadow 0.05s ease-out; 
}

/* Effet de filtre givré appliqué sur l'avatar actif */
.frost-avatar-layer {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0, 229, 255, 0.15);
    backdrop-filter: blur(1px);
    box-shadow: inset 0 0 10px rgba(0, 229, 255, 0.6);
    z-index: 5;
    pointer-events: none;
    opacity: 0;
    transition: opacity 8s ease;
}
.thermo-bulb.frozen-bulb .frost-avatar-layer {
    opacity: 1;
    transition: opacity 0.05s ease-out;
}

.thermo-bulb img {
    position: absolute;
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
    z-index: 1;
    opacity: 0;
    transform: scale(0.9) rotate(-5deg);
    transition: opacity 0.3s cubic-bezier(0.4, 0, 0.2, 1), transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.thermo-bulb img.active {
    opacity: 1;
    transform: scale(1) rotate(0deg);
    z-index: 2;
}

/* EFFECT HITMARKER */
.hitmarker {
    position: absolute;
    width: 30px;
    height: 30px;
    z-index: 10;
    opacity: 0;
    pointer-events: none;
    transition: transform 0.05s;
}
.hitmarker::before, .hitmarker::after {
    content: ''; position: absolute; width: 100%; height: 100%; top: 0; left: 0;
}
.hitmarker::before { border-left: 3px solid #ff0055; border-right: 3px solid #ff0055; transform: rotate(45deg); }
.hitmarker::after { border-top: 3px solid #ff0055; border-bottom: 3px solid #ff0055; transform: rotate(45deg); }
.hitmarker.active { animation: hitFlash 0.2s ease-out; }

/* LES TEXTES INDÉPENDANTS GENERES EN JAVASCRIPT */
.dynamic-score {
    position: absolute;
    font-family: 'Rajdhani', sans-serif;
    font-weight: 900;
    font-size: 22px;
    text-shadow: 2px 2px 0px #000, 0 0 8px rgba(0,0,0,0.5);
    z-index: 12;
    pointer-events: none;
    white-space: nowrap;
    animation: floatAndFade 0.6s cubic-bezier(0.1, 0.8, 0.3, 1) forwards;
}

/* LE TITRE EN DESSOUS */
.goulou-title {
    color: #ffffff;
    font-size: 16px;
    font-weight: 700;
    text-transform: uppercase;
    margin-top: 12px;
    letter-spacing: 3px;
    z-index: 7;
    text-shadow: 0 2px 4px rgba(0,0,0,0.8);
    opacity: 0.8;
    transition: color 0.2s;
    animation: fadeIn 0.5s ease-out 0.5s both;
}

/* GRILLE DES GRADUATIONS ALIGNÉES */
.graduations {
    position: absolute;
    left: 45px;
    top: 15px;
    height: 290px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    pointer-events: none;
    z-index: 0;
    animation: fadeIn 0.5s ease-out 0.5s both;
}
.grad { display: flex; align-items: center; gap: 12px; height: 20px; }
.grad::before { content: ''; width: 16px; height: 1px; background: rgba(255, 255, 255, 0.5); box-shadow: 0 0 4px rgba(255,255,255,0.3); }

.grad-badge {
    background: rgba(10, 10, 10, 0.6);
    backdrop-filter: blur(2px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: rgba(255, 255, 255, 0.6);
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.grad.active .grad-badge { color: #ffffff; font-weight: 700; transform: scale(1.05); }
.grad.active.level-dodo .grad-badge { border-color: #00ff33; box-shadow: 0 0 8px rgba(0, 255, 51, 0.3); }
.grad.active.level-chill .grad-badge { border-color: #00ff33; box-shadow: 0 0 8px rgba(0, 255, 51, 0.3); }
.grad.active.level-sueur .grad-badge { border-color: #ffea00; box-shadow: 0 0 8px rgba(255, 234, 0, 0.3); color: #ffea00; }
.grad.active.level-deces .grad-badge { border-color: #ff0055; box-shadow: 0 0 12px rgba(255, 0, 85, 0.5); color: #ff0055; animation: pulseBadge 0.4s infinite alternate; }

#explosion-emoji {
    position: absolute;
    top: -45px;
    font-size: 40px;
    opacity: 0;
    transform: scale(0.5);
    transition: transform 0.2s, opacity 0.2s;
    z-index: 10;
    pointer-events: none;
}

/* ==================== KEYFRAMES ANIMATIONS ==================== */
@keyframes popBulb { 0% { transform: scale(0); opacity: 0; } 100% { transform: scale(1); opacity: 1; } }
@keyframes deployTube { 0% { transform: scaleY(0); opacity: 0; } 100% { transform: scaleY(1); opacity: 1; } }
@keyframes fadeIn { 0% { opacity: 0; transform: translateX(-5px); } 100% { opacity: 1; transform: translateX(0); } }
@keyframes pulseBadge { from { transform: scale(1.05); } to { transform: scale(1.12); } }
@keyframes hitFlash { 0% { opacity: 1; transform: scale(1.4); } 100% { opacity: 0; transform: scale(1.0); } }

@keyframes boltZapping {
    0% { opacity: 0.8; transform: skewX(-5deg) scaleX(1); }
    25% { opacity: 0; transform: skewX(10deg) scaleX(0.5); }
    50% { opacity: 0.9; transform: skewX(-15deg) scaleX(1.3); }
    75% { opacity: 0.1; transform: skewX(5deg) scaleX(0.2); }
    100% { opacity: 1; transform: skewX(-2deg) scaleX(1); }
}
@keyframes nuclearFlashShape {
    0% { background-color: transparent; box-shadow: 0 0 0 transparent, 0 0 0 transparent; }
    100% { background-color: rgba(255, 0, 85, 0.15); box-shadow: 0 0 25px rgba(255, 0, 85, 0.8), 0 0 40px rgba(255, 0, 85, 0.4); }
}
@keyframes smokeRise {
    0% { transform: translateY(0) scale(1); opacity: 0.8; filter: blur(1px); }
    50% { opacity: 0.5; filter: blur(3px); }
    100% { transform: translateY(-40px) scale(2.5); opacity: 0; filter: blur(5px); }
}
@keyframes floatAndFade {
    0% { opacity: 0; transform: translate(0, 0) scale(0.6) rotate(0deg); }
    20% { opacity: 1; transform: translate(var(--x-mid), var(--y-mid)) scale(1.2) rotate(var(--rot-mid)); }
    100% { opacity: 0; transform: translate(var(--x-end), var(--y-end)) scale(0.9) rotate(var(--rot-end)); }
}
@keyframes shake {
    0% { transform: translate(1px, 1px) rotate(0deg); }
    10% { transform: translate(-1px, -1px) rotate(-0.5deg); }
    20% { transform: translate(-2px, 0px) rotate(0.5deg); }
    30% { transform: translate(0px, 1px) rotate(0deg); }
    40% { transform: translate(1px, -1px) rotate(0.5deg); }
    50% { transform: translate(-1px, 1px) rotate(-0.5deg); }
    60% { transform: translate(-2px, 0px) rotate(0deg); }
    70% { transform: translate(1px, 1px) rotate(-0.5deg); }
    100% { transform: translate(1px, -1px) rotate(0deg); }
}