/* Page des matchs du week-end */

.section-matchs {
    margin: 30px 0;
}

.section-matchs > h2 {
    margin-bottom: 20px;
    padding: 12px 15px;
    background: #17365d;
    color: #fff;
    border-radius: 5px;
}

.bloc-championnat-matchs {
    margin: 22px 0;
}

.titre-championnat-matchs {
    margin: 18px 0 10px;
    padding-bottom: 8px;
    border-bottom: 2px solid #17365d;
}

.bloc-groupe-matchs {
    margin: 16px 0 24px;
}

.bloc-groupe-matchs h3 {
    margin: 10px 0;
    font-size: 1.05rem;
}

.lien-championnat {
    margin: 8px 0;
    font-size: 0.9rem;
}

.lien-championnat a {
    color: #245b93;
    text-decoration: none;
}

.lien-championnat a:hover {
    text-decoration: underline;
}

.table-matchs-wrapper {
    width: 100%;
    overflow-x: auto;
}

.table-matchs {
    width: 100%;
    border-collapse: collapse;
    margin: 10px 0;
    font-size: 0.95rem;
}

.table-matchs th,
.table-matchs td {
    padding: 10px 8px;
    border: 1px solid #ddd;
    text-align: center;
}

.table-matchs thead th {
    background: #f0f2f5;
    font-weight: 600;
}

.table-matchs .equipe-domicile {
    text-align: right;
}

.table-matchs .equipe-exterieur {
    text-align: left;
}

.table-matchs td a {
    color: inherit;
    text-decoration: none;
}

.table-matchs td a:hover {
    text-decoration: underline;
}

.score-match {
    display: inline-block;
    min-width: 48px;
    padding: 5px 8px;
    border-radius: 4px;
    font-weight: 700;
    white-space: nowrap;
}

.score-victoire {
    background: #d8f0dc;
    color: #176b35;
}

.score-nul {
    background: #ffedcc;
    color: #8a5200;
}

.score-defaite {
    background: #f8d7da;
    color: #842029;
}

.score-neutre {
    background: #eee;
    color: #333;
}

.club-qualifie {
    background: #d8f0dc;
    font-weight: 700;
}

@media (max-width: 650px) {
    .table-matchs {
        font-size: 0.82rem;
    }

    .table-matchs th,
    .table-matchs td {
        padding: 7px 4px;
    }

    .table-matchs td:first-child {
        white-space: nowrap;
    }

    .score-match {
        min-width: 38px;
        padding: 4px;
    }
}

.niveau-club {
    display: inline-block;
    margin-left: 3px;
    font-size: 0.85em;
    color: #666;
    font-weight: normal;
}

/* Alignement identique de tous les tableaux de matchs */

.table-matchs-wrapper {
    width: 100%;
    overflow-x: auto;
}

.table-matchs {
    width: 100%;
    table-layout: fixed;
    border-collapse: collapse;
}

/* Largeur commune des cinq colonnes */
.table-matchs th:nth-child(1),
.table-matchs td:nth-child(1) {
    width: 100px;
}

.table-matchs th:nth-child(2),
.table-matchs td:nth-child(2) {
    width: 75px;
}

/* Colonne Domicile */
.table-matchs th:nth-child(3),
.table-matchs td:nth-child(3) {
    width: calc((100% - 285px) / 2);
}

/* Colonne Score : largeur augmentée */
.table-matchs th:nth-child(4),
.table-matchs td:nth-child(4) {
    width: 110px;
    text-align: center;
    white-space: nowrap;
    font-size: 0.85em;
}

/* Colonne Extérieur */
.table-matchs th:nth-child(5),
.table-matchs td:nth-child(5) {
    width: calc((100% - 285px) / 2);
}

/* Éviter que les noms longs déforment les colonnes */
.table-matchs td.equipe-domicile,
.table-matchs td.equipe-exterieur {
    overflow-wrap: anywhere;
    word-wrap: break-word;
}

/* Les niveaux des clubs dans les coupes */
.niveau-club {
    display: inline;
    font-size: 0.85em;
    color: #666;
    font-weight: normal;
}

/* Version mobile : conserver des colonnes lisibles */
@media screen and (max-width: 768px) {

    .table-matchs-wrapper {
        width: 100%;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .table-matchs {
        width: 700px;
        min-width: 700px;
        table-layout: fixed;
    }

    /* Date */
    .table-matchs th:nth-child(1),
    .table-matchs td:nth-child(1) {
        width: 85px;
    }

    /* Heure */
    .table-matchs th:nth-child(2),
    .table-matchs td:nth-child(2) {
        width: 65px;
    }

    /* Club à domicile */
    .table-matchs th:nth-child(3),
    .table-matchs td:nth-child(3) {
        width: 200px;
    }

    /* Score */
    .table-matchs th:nth-child(4),
    .table-matchs td:nth-child(4) {
        width: 110px;
        text-align: center;
        white-space: nowrap;
        font-size: 12px;
    }

    /* Club à l'extérieur */
    .table-matchs th:nth-child(5),
    .table-matchs td:nth-child(5) {
        width: 240px;
    }

    /* Lisibilité des noms et niveaux */
    .table-matchs td.equipe-domicile,
    .table-matchs td.equipe-exterieur {
        overflow-wrap: break-word;
        word-break: normal;
        white-space: normal;
        line-height: 1.5;
    }

    .table-matchs .niveau-club {
        font-size: 11px;
    }
}