/* ==========================================================================
   PAGE CLASSEMENT - PROFIL DE COMPÉTITION
   ========================================================================== */

   .ranking-container {
    padding-top: 50px;
    padding-bottom: 70px;
}

.ranking-card {
    background: var(--bg-translucent);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border-radius: var(--border-radius);
    padding: 35px;
    box-shadow: var(--box-shadow);
    max-width: 800px;
    margin: 0 auto;
}

.ranking-card h2 {
    font-size: 1.4rem;
    font-weight: 800;
    margin: 0 0 5px 0;
}

.ranking-card .subtitle {
    color: var(--text-light);
    font-size: 0.95rem;
    margin: 0 0 35px 0;
}

/* --- STRUCTURE DU PODIUM --- */
.podium-zone {
    display: flex;
    justify-content: center;
    align-items: flex-end;
    gap: 15px;
    margin-bottom: 40px;
    padding-top: 20px;
}

.podium-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 120px;
}

.podium-avatar {
    font-size: 1.8rem;
    margin-bottom: 8px;
}

.podium-pseudo {
    font-weight: 700;
    font-size: 0.95rem;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    width: 100%;
}

.podium-points {
    font-size: 0.85rem;
    color: var(--accent-color);
    font-weight: 800;
    margin-bottom: 8px;
}

.podium-block {
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    color: #ffffff;
    font-weight: 800;
    font-size: 0.9rem;
    border-radius: 8px 8px 0 0;
}

.step-1 .podium-block { height: 90px; background: linear-gradient(135deg, #00b050 0%, #005c30 100%); }
.step-2 .podium-block { height: 65px; background-color: #94a3b8; }
.step-3 .podium-block { height: 45px; background-color: #cbd5e1; }

/* --- TABLEAU DES CLASSEMENTS --- */
.ranking-table-wrapper {
    overflow-x: auto;
}

.ranking-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
}

.ranking-table th {
    padding: 12px 16px;
    font-size: 0.8rem;
    font-weight: 700;
    color: #475569;
    text-transform: uppercase;
    border-bottom: 2px solid #e2e8f0;
}

.ranking-table td {
    padding: 14px 16px;
    border-bottom: 1px solid #edf2f7;
    font-size: 0.95rem;
}

/* Ligne d'affichage utilisateur courant */
.ranking-table tr.row-highlight td {
    background-color: #f0fdf4;
}

.badge-me {
    font-size: 0.75rem;
    background-color: var(--accent-color);
    color: #ffffff;
    padding: 2px 6px;
    border-radius: 4px;
    margin-left: 5px;
}

/* Positions et numéros */
.rank-number {
    display: inline-flex;
    width: 28px;
    height: 28px;
    justify-content: center;
    align-items: center;
    border-radius: 50%;
    font-weight: 700;
    font-size: 0.85rem;
    background-color: #f1f5f9;
    color: #475569;
}

.rank-number.pos-1 { background-color: #fef08a; color: #854d0e; }
.rank-number.pos-2 { background-color: #e2e8f0; color: #334155; }
.rank-number.pos-3 { background-color: #ffedd5; color: #9a3412; }

.col-rank, .col-bets, .col-points { text-align: center; width: 100px; }

/* ==========================================================================
   OPTIMISATIONS RESPONSIVE ÉCRANS MOBILES (< 580px)
   ========================================================================== */

/* ==========================================================================
   REFONTE RESPONSIVE COMPLÈTE - ÉCRANS MOBILES (< 600px)
   ========================================================================== */

@media (max-width: 400px) {
    /* ... tes styles précédents pour le conteneur et le podium ... */
    .ranking-card{
        padding: 8px;
    }

    .ranking-table-wrapper {
        overflow-x: hidden;
        padding: 0;
        width: 100%;
    }

    .ranking-table {
        display: block;
        width: 100%;
        border-collapse: collapse;
    }

    /* On force TOUTES les lignes à se comporter en Flexbox */
    .ranking-table thead {
        display: none;
    }
    .ranking-table tbody,
    .ranking-table tr {
        display: flex;
        width: 100%;
        box-sizing: border-box;
    }

    /* Alignement vertical et padding minimal */
    .ranking-table th, 
    .ranking-table td {
        padding: 12px 4px;
        font-size: 0.8rem;
        box-sizing: border-box;
        display: flex;
        align-items: center;
        border-bottom: 1px solid #edf2f7;
    }

    .ranking-table th {
        border-bottom: 2px solid #e2e8f0;
        color: #475569;
        font-weight: 700;
    }

    /* 🎯 DISTRIBUTION ALIGNÉE ET PROPORTIONNELLE (Total = 100%) */
    
    /* 1. Position / Rang (15%) */
    .col-rank,
    .ranking-table th:nth-child(1),
    .ranking-table td:nth-child(1) {
        width: 15% !important;
        justify-content: center;
        text-align: center;
    }

    /* 2. Joueur / Pseudo (45%) */
    .col-pseudo,
    .ranking-table th:nth-child(2),
    .ranking-table td:nth-child(2) {
        width: 45% !important;
        justify-content: flex-start;
        text-align: left;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    /* 3. Matchs Joués (20%) */
    .col-bets,
    .ranking-table th:nth-child(3),
    .ranking-table td:nth-child(3) {
        width: 20% !important;
        justify-content: center;
        text-align: center;
    }

    /* 4. Points (20%) */
    .col-points,
    .ranking-table th:nth-child(4),
    .ranking-table td:nth-child(4) {
        width: 20% !important;
        justify-content: center;
        text-align: center;
    }

    /* Ajustement des éléments internes */
    .rank-number {
        width: 22px;
        height: 22px;
        font-size: 0.75rem;
    }

    .badge-me {
        display: none;
    }
}