/* ==========================================
    STYLE CLASSEMENT - VERSION FINALE STABLE
   ========================================== */

/* ANIMATIONS */
@keyframes blinker-chrono { 
    0% { opacity: 1; } 50% { opacity: 0.3; } 100% { opacity: 1; }
}

@keyframes flash-goal-row {
    0% { background-color: #161616; }
    25% { background-color: #ffca28 !important; }
    50% { background-color: #ffd54f !important; }
    75% { background-color: #ffca28 !important; }
    100% { background-color: #161616; }
}

@keyframes score-pulse-grow {
    0% { transform: scale(1); }
    50% { transform: scale(1.2); }
    100% { transform: scale(1); }
}

/* HEADER & HORLOGE */
.header-classement {
    background: linear-gradient(180deg, #1a1a1a 0%, #0f0f0f 100%) !important; 
    border-bottom: 2px solid #00ff88 !important;
    padding: 12px 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

#clock-time {
    font-family: 'DS-Digital', sans-serif;
    color: #00ff00;
    font-size: 26px; 
    font-weight: bold;
    display: inline-block;
    width: 6.5ch; 
    text-align: center;
    letter-spacing: 2px;
    white-space: nowrap;
    text-shadow: 0 0 8px rgba(0, 255, 0, 0.7);
    background: rgba(0, 0, 0, 0.5); 
    padding: 4px 20px 4px 10px; /* Padding à droite comme demandé */
    border-radius: 6px;
    border: 1px solid rgba(0, 255, 0, 0.3);
    font-variant-numeric: tabular-nums;
}

/* FIXATION DU HAUT DU TABLEAU */
#classement-container { 
    background: #0f0f0f !important;
    border-radius: 12px;
    border: 1px solid #222;
    width: 100% !important;
    max-width: 1100px;
    margin: 15px auto; 
    display: flex;
    flex-direction: column;
}

.table-wrapper {
    width: 100%;
    max-height: 70vh; 
    overflow-y: auto !important; 
    position: relative;
    scrollbar-gutter: stable; 
}

.table-mini { width: 100% !important; border-collapse: collapse !important; }

.table-header-row th {
    background: linear-gradient(to bottom, #222 0%, #0a0a0a 100%) !important;
    color: #ffffff !important;
    font-size: 11px; 
    font-weight: 800;
    padding: 12px 5px !important;
    position: sticky !important;
    top: 0; 
    z-index: 1000;
    transform: translateZ(0); 
}

/* CELLULES & SCORE */
.table-mini tr:not(.table-header-row) { height: 38px; background: #222222; border-bottom:3px solid #0f0f0f}
.table-mini td { padding: 5px !important; color: #ffffaa !important; text-align: center; vertical-align: middle; }

.score-badge-live {
    color: #fff !important; /* Texte blanc pour le contraste */
    font-weight: 900;
    font-size: 19px !important;  /* Augmenté pour la lisibilité */
    padding: 3px 3px !important; /* Plus d'espace interne */
    min-width: 50px;
    height: 18px;
    border-radius: 5px;
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    font-family: 'DS-Digital', sans-serif;
    font-weight: bold;
    display: inline-block;
    width: 6.5ch; 
    text-align: center;
    letter-spacing: 2px;
    white-space: nowrap;
    text-shadow: 0 0 8px rgba(0, 255, 0, 0.7);
    border: 1px solid rgba(0, 0, 0, 0.8);
    font-variant-numeric: tabular-nums;
    font-weight: bold;
}

.score-win { background-color: #00ff88 !important; }
.score-loss { background-color: #ff4d4d !important; }
.score-draw { background-color: #aaaaaa !important; }

/* Le vert pour le chrono en cours (clignotant) */
.chrono-live.active { 
    color: #45ff00 !important; 
    font-weight: 900 !important; 
    animation: blinker-chrono 1s linear infinite !important;
}

/* Le vert pour la Mi-temps (FIXE, sans clignotement) */
.chrono-mt-fixe {
    color: #45ff00 !important;
    font-weight: 900 !important;
    animation: none !important; /* On s'assure qu'aucune animation ne passe */
}


/* L'effet de flash sur la ligne entière */
.score-flashi {
    /* On appelle l'animation définie juste en dessous */
    animation: flash-animation 1s infinite alternate !important; 
    transition: background-color 0.5s ease;
    z-index: 5;
    position: relative;
}

/* Animation corrigée avec des couleurs bien visibles */
@keyframes flash-animatio.score-badge-live {
    0% { 
        background-color: #161616 !important; 
    }
    100% { 
        background-color: rgba(255, 202, 40, 0.6) !important; /* Jaune ambre plus prononcé */
    }
}



/* L'animation de pulsation */
@keyframes pulse-score {
    0% { transform: scale(1); }
    30% { transform: scale(1.3); }
    60% { transform: scale(0.95); }
    100% { transform: scale(1); }
}

/* La classe corrigée */
.score-animate {
    display: inline-flex !important; /* On garde le flex pour le centrage du texte */
    animation: pulse-score 0.8s ease-in-out !important; /* On force l'exécution */
    z-index: 10;
    position: relative; /* Aide parfois à sortir du flux pour le scale */
}

/* Masquer sur les petits écrans */
@media screen and (max-width: 768px) {
    .hide-mobile {
        display: none !important;
    }
}

/* Réduction du nom des équipes */
.team-cell span, 
.team-row td span.truncate {
    font-size: 13px !important;    /* Taille réduite */
    font-weight: 600 !important;
    max-width: 100px;              /* Limite la largeur pour éviter les décalages */
    display: inline-block;
    vertical-align: middle;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;       /* Ajoute "..." si le nom est trop long */
}

/* Ajustement pour mobile */
@media screen and (max-width: 480px) {
    .team-cell span, 
    .team-row td span.truncate {
        font-size: 10px !important;
        max-width: 75px;           /* Encore plus petit sur téléphone */
    }
}
/* On garde les Points et le Rang plus gros pour la lisibilité */
.team-row td.pts-cell, 
.team-row td.rank-cell {
    font-size: 12px !important;
    color: #fff !important;
    font-weight: bold !important;
}

.team-row td.hide-mobile {
    font-size: 10px !important;
    font-weight: 400 !important;
    color: #bdc3c7 !important;
}