
/* =========================================================
   PAGE DES NIVEAUX
   ========================================================= */

.niveaux-page {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 25px 15px 50px;
    box-sizing: border-box;
}


/* =========================================================
   MENU DES NIVEAUX
   ========================================================= */

.niveaux-menu {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;

    margin: 0 auto 28px;
    padding: 6px;

    max-width: 100%;

    background: #f1f5f9;
    border: 1px solid #e2e8f0;
    border-radius: 12px;

    overflow-x: auto;
    scrollbar-width: thin;
}

.niveaux-menu a {
    flex: 0 0 auto;

    padding: 8px 13px;

    border-radius: 8px;

    color: #475569;
    font-size: 13px;
    font-weight: 800;

    text-decoration: none;
    white-space: nowrap;

    transition:
        background .15s ease,
        color .15s ease,
        transform .15s ease,
        box-shadow .15s ease;
}

.niveaux-menu a:hover {
    background: #ffffff;
    color: #2563eb;

    transform: translateY(-1px);
}

.niveaux-menu a.niveau-actif {
    background: #2563eb;
    color: #ffffff;

    box-shadow:
        0 3px 8px rgba(37, 99, 235, .20);
}

.niveaux-menu a.niveau-actif:hover {
    background: #1d4ed8;
    color: #ffffff;
}

.niveau-separateur {
    width: 1px;
    height: 24px;

    flex: 0 0 1px;

    margin: 0 5px;

    background: #cbd5e1;
}


/* =========================================================
   EN-TÊTE DE LA PAGE
   ========================================================= */

.niveaux-header {
    margin: 0 auto 30px;
    text-align: center;
}

.niveaux-header h1 {
    margin: 0 0 8px;

    color: #1e293b;

    font-size: 30px;
    line-height: 1.2;
    font-weight: 800;
}

.niveaux-header p {
    margin: 0;

    color: #64748b;

    font-size: 15px;
    line-height: 1.5;
}


/* =========================================================
   CONTENEUR DES CHAPITRES
   ========================================================= */

.niveaux-chapitres {
    display: flex;
    flex-direction: column;
    gap: 18px;
}


/* =========================================================
   CARTE CHAPITRE
   ========================================================= */

.niveau-chapitre {
    padding: 18px;

    background: #ffffff;

    border: 1px solid #e2e8f0;
    border-radius: 16px;

    box-shadow:
        0 3px 12px rgba(15, 23, 42, .05);

    box-sizing: border-box;
}


/* =========================================================
   EN-TÊTE DU CHAPITRE
   ========================================================= */

.niveau-chapitre-header {
    display: flex;
    align-items: center;

    margin-bottom: 16px;
}

.niveau-chapitre-titre {
    display: flex;
    align-items: center;
    gap: 12px;

    min-width: 0;
}

.niveau-chapitre-icon {
    width: 52px;
    height: 52px;

    flex: 0 0 52px;

    display: flex;
    align-items: center;
    justify-content: center;

    background: #f8fafc;

    border: 1px solid #e2e8f0;
    border-radius: 12px;
}

.niveau-chapitre-icon img {
    width: 42px;
    height: 42px;

    object-fit: contain;
    display: block;
}

.niveau-chapitre-titre h2 {
    margin: 0 0 3px;

    color: #1e293b;

    font-size: 20px;
    line-height: 1.2;
    font-weight: 800;
}

.niveau-chapitre-titre span {
    color: #94a3b8;

    font-size: 12px;
    font-weight: 600;
}


/* =========================================================
   JAUGES
   ========================================================= */

.niveau-jauges {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 20px;

    margin-bottom: 18px;
    padding: 13px 15px;

    background: #f8fafc;

    border: 1px solid #eef2f7;
    border-radius: 11px;
}

.niveau-jauge {
    min-width: 0;
}

.niveau-jauge-top {
    display: flex;
    align-items: center;
    justify-content: space-between;

    margin-bottom: 7px;
}

.niveau-jauge-top span {
    color: #64748b;

    font-size: 12px;
    font-weight: 700;
}

.niveau-jauge-top strong {
    color: #334155;

    font-size: 13px;
    font-weight: 800;
}

.niveau-jauge-bar {
    width: 100%;
    height: 8px;

    overflow: hidden;

    background: #e2e8f0;

    border-radius: 99px;
}

.niveau-jauge-bar div {
    height: 100%;

    min-width: 0;

    background: #3b82f6;

    border-radius: 99px;

    transition: width .4s ease;
}


/* =========================================================
   EXERCICES
   ========================================================= */

.niveau-exercices {
    display: grid;

    grid-template-columns:
        repeat(auto-fill, minmax(190px, 1fr));

    gap: 10px;
}


/* =========================================================
   CARTE EXERCICE
   ========================================================= */

.niveau-exercice {
    display: flex;
    flex-direction: column;

    min-width: 0;

    overflow: hidden;

    background: #f8fafc;

    border: 1px solid #e8edf3;
    border-radius: 11px;

    text-decoration: none;

    color: #334155;

    transition:
        transform .18s ease,
        background .18s ease,
        border-color .18s ease,
        box-shadow .18s ease;
}

.niveau-exercice:hover {
    transform: translateY(-2px);

    background: #ffffff;

    border-color: #93c5fd;

    box-shadow:
        0 5px 14px rgba(37, 99, 235, .10);
}


/* =========================================================
   IMAGE EXERCICE
   ========================================================= */
.niveau-exercice-image {
    width: 100%;
    height: 90px;

    display: flex;
    align-items: center;
    justify-content: center;

    overflow: hidden;

    background: #ffffff;

    border-bottom: 1px solid #edf1f5;
}

.niveau-exercice-image img {
    width: 100%;
    height: 100%;

    object-fit: contain;

    display: block;

    transition: transform .2s ease;
}

.niveau-exercice:hover .niveau-exercice-image img {
    transform: scale(1.02);
}


/* =========================================================
   INFOS EXERCICE
   ========================================================= */

.niveau-exercice-info {
    display: flex;
    align-items: center;
    gap: 8px;

    min-width: 0;

    padding: 9px 10px;
}

.niveau-exercice-nom {
    flex: 1;
    min-width: 0;

    color: #334155;

    font-size: 12px;
    line-height: 1.3;
    font-weight: 700;

    overflow-wrap: break-word;
}

.niveau-exercice-score {
    width: 36px;
    height: 36px;

    flex: 0 0 36px;

    box-sizing: border-box;

    display: flex;
    align-items: center;
    justify-content: center;

    border-radius: 50%;

    font-size: 10px;
    line-height: 1;
    font-weight: 800;

    background: #f1f5f9;
    border: 3px solid #cbd5e1;
    color: #64748b;
}


/* =========================================================
   COULEURS DES SCORES
   ========================================================= */

.niveau-exercice-score.score-vide {
    background: #f1f5f9;
    border-color: #cbd5e1;
    color: #94a3b8;
}

.niveau-exercice-score.score-faible {
    background: #fff7ed;
    border-color: #fb923c;
    color: #c2410c;
}

.niveau-exercice-score.score-moyen {
    background: #fefce8;
    border-color: #facc15;
    color: #a16207;
}

.niveau-exercice-score.score-bon {
    background: #f0fdf4;
    border-color: #84cc16;
    color: #4d7c0f;
}

.niveau-exercice-score.score-tres-bon {
    background: #ecfdf5;
    border-color: #22c55e;
    color: #15803d;
}

.niveau-exercice-score.score-excellent {
    background: #fffbeb;
    border-color: #eab308;
    color: #a16207;

    box-shadow:
        0 0 0 2px rgba(234, 179, 8, .10);
}


/* =========================================================
   CHAPITRE VIDE
   ========================================================= */

.niveau-vide {
    max-width: 600px;

    margin: 30px auto;
    padding: 25px;

    text-align: center;

    color: #64748b;

    background: #f8fafc;

    border: 1px solid #e2e8f0;
    border-radius: 14px;

    font-size: 15px;
    font-weight: 600;
}


/* =========================================================
   MOBILE
   ========================================================= */

@media (max-width: 700px) {

    .niveaux-page {
        padding: 18px 8px 35px;
    }


    /* Menu niveaux */

    .niveaux-menu {
        justify-content: flex-start;

        margin-bottom: 22px;

        border-radius: 10px;
    }

    .niveaux-menu a {
        padding: 7px 10px;

        font-size: 12px;
    }


    /* Titre */

    .niveaux-header {
        margin-bottom: 22px;
    }

    .niveaux-header h1 {
        font-size: 25px;
    }

    .niveaux-header p {
        font-size: 13px;
    }


    /* Chapitre */

    .niveau-chapitre {
        padding: 13px;

        border-radius: 14px;
    }

    .niveau-chapitre-header {
        margin-bottom: 13px;
    }

    .niveau-chapitre-icon {
        width: 46px;
        height: 46px;

        flex-basis: 46px;

        border-radius: 11px;
    }

    .niveau-chapitre-icon img {
        width: 37px;
        height: 37px;
    }

    .niveau-chapitre-titre {
        gap: 10px;
    }

    .niveau-chapitre-titre h2 {
        font-size: 18px;
    }


    /* Jauges */

    .niveau-jauges {
        grid-template-columns: 1fr;

        gap: 11px;

        margin-bottom: 14px;
        padding: 11px 12px;
    }

    .niveau-jauge-top {
        margin-bottom: 5px;
    }


    /* Exercices */

    .niveau-exercices {
        grid-template-columns:
            repeat(2, minmax(0, 1fr));

        gap: 8px;
    }

    
    .niveau-exercice-info {
        padding: 7px;
        gap: 6px;
    }

    .niveau-exercice-nom {
        font-size: 11px;
    }

    .niveau-exercice-score {
        width: 34px;
        height: 34px;

        flex-basis: 34px;

        font-size: 9px;
        border-width: 3px;
    }
}


/* =========================================================
   TRÈS PETITS ÉCRANS
   ========================================================= */

@media (max-width: 420px) {

    .niveau-exercices {
        grid-template-columns: 1fr;
    }

    .niveau-exercice {
        flex-direction: row;
        align-items: center;
    }

    @media (max-width: 420px) {

    .niveau-exercice-image {
        width: 105px;
        height: 79px;
        aspect-ratio: 267 / 200;

        flex: 0 0 105px;

        border-bottom: none;
        border-right: 1px solid #edf1f5;
    }

}

    .niveau-exercice-info {
        flex: 1;

        padding: 8px;
    }
}
.niveau-chapitre-titre h2 a {
    color: #1e293b;
    text-decoration: none;
    transition: color .15s ease;
}

.niveau-chapitre-titre h2 a:hover {
    color: #2563eb;
}

.connexion-resultats {
    margin: 0 auto 22px;
    padding: 10px 16px;

    text-align: center;

    font-size: 14px;
    font-weight: 600;

    color: #64748b;
}

.connexion-resultats a {
    color: #2563eb;
    font-weight: 800;
    text-decoration: none;
}

.connexion-resultats a:hover {
    text-decoration: underline;
}