/* ── Wrapper ─────────────────────────────────────────────────────────────── */
.avp-poules-wrap {
    width: 100%;
    max-width: 680px;
    margin: 0 auto;
    box-sizing: border-box;
}

.avp-poules-wrap *,
.avp-poules-wrap *::before,
.avp-poules-wrap *::after {
    box-sizing: border-box;
}

.avp-poules-phase {
    margin-bottom: 32px;
}

/* ── Onglets ─────────────────────────────────────────────────────────────── */
.avp-poules-tabbar {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    border-bottom: 2px solid #e0e0e0;
    margin-bottom: 20px;
}

.avp-poules-tab {
    padding: 8px 16px;
    border: none;
    background: transparent;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    color: #666;
    border-bottom: 3px solid transparent;
    margin-bottom: -2px;
    border-radius: 4px 4px 0 0;
    transition: color 0.15s, border-color 0.15s;
    line-height: 1.4;
}

.avp-poules-tab:hover { color: #222; }

.avp-poules-tab.active {
    color: #1d6ae5;
    border-bottom-color: #1d6ae5;
}

.avp-poules-panel         { display: none; }
.avp-poules-panel.active  { display: block; }

/* ── Tableau de classement ───────────────────────────────────────────────── */

/* Wrapper scrollable — le tableau peut défiler horizontalement sur mobile */
.avp-standings-scroll {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin-bottom: 24px;
    border-radius: 8px;
    box-shadow: 0 1px 4px rgba(0,0,0,.07);
}

.avp-standings {
    width: 100%;
    min-width: 400px; /* assure des colonnes lisibles avant que le scroll s'active */
    border-collapse: collapse;
    font-size: 14px;
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
}

.avp-standings thead tr { background: #f5f6f7; }

.avp-standings th {
    text-align: center;
    padding: 9px 6px;
    font-weight: 700;
    color: #555;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: .04em;
    border-bottom: 2px solid #e8e8e8;
    white-space: nowrap;
}

.avp-std-th-team {
    text-align: left !important;
    padding-left: 12px !important;
}

.avp-standings td {
    text-align: center;
    padding: 9px 6px;
    border-bottom: 1px solid #f0f0f0;
    color: #333;
}

.avp-standings tbody tr:last-child td { border-bottom: none; }
.avp-standings tbody tr:hover          { background: #fafbfc; }

.avp-std-rank {
    color: #aaa;
    font-size: 12px;
    font-weight: 600;
    min-width: 20px;
}

.avp-std-team-cell {
    text-align: left !important;
    padding-left: 12px !important;
}

.avp-std-team {
    display: flex;
    align-items: center;
    gap: 8px;
}

.avp-std-flag {
    width: 22px;
    height: 16px;
    object-fit: cover;
    border-radius: 2px;
    flex-shrink: 0;
    display: block;
}

.avp-std-flag-ph {
    width: 22px;
    height: 16px;
    background: #ddd;
    border-radius: 2px;
    flex-shrink: 0;
    display: inline-block;
}

.avp-std-name {
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 130px;
}

.avp-std-gd   { font-weight: 600; }
.avp-std-pos  { color: #2a7d2a; }
.avp-std-neg  { color: #c0392b; }

.avp-std-pts {
    font-weight: 700;
    font-size: 15px;
    color: #1d6ae5;
}

/* ── Matchs dans les onglets ─────────────────────────────────────────────── */
.avp-poules-matches,
.avp-poules-elim {
    display: flex;
    flex-direction: column;
    gap: 8px;
    width: 100%;
}

/* Force les cartes avp-res-* à rester dans les limites du conteneur */
.avp-poules-wrap .avp-res-match {
    width: 100%;
    min-width: 0;
}

.avp-pm-match .avp-res-date-bar { padding: 6px 12px; }

.avp-pm-upcoming .avp-res-body { opacity: 0.65; }

.avp-pm-upcoming-badge {
    display: inline-block;
    background: #f0f4ff;
    color: #1d6ae5;
    font-size: 11px;
    font-weight: 600;
    padding: 2px 7px;
    border-radius: 10px;
    margin-left: auto;
}

.avp-pm-vs {
    font-size: 13px;
    font-weight: 600;
    color: #bbb;
    padding: 0 8px;
}

/* ── Responsive ──────────────────────────────────────────────────────────── */
@media (max-width: 480px) {
    .avp-poules-tab {
        padding: 6px 10px;
        font-size: 13px;
    }

    .avp-std-name {
        max-width: 80px;
    }

    .avp-standings th,
    .avp-standings td {
        padding: 7px 4px;
        font-size: 12px;
    }

    .avp-std-pts {
        font-size: 13px;
    }
}
