/* =========================================================
   MOBILE ONLY
========================================================= */
@media (max-width: 768px) {

    /* =========================================================
       HEADER / HAMBURGER
    ========================================================= */

    .header {
        height: 64px !important;
        padding: 12px 20px !important;
    }

    .header-left {
        display: flex;
        justify-content: space-between;
        align-items: center;
        width: 100%;
        padding: 0 20px;
        box-sizing: border-box;
    }

    .hamburger {
        display: flex !important;
        flex-direction: column;
        gap: 5px;
        width: 32px;
        cursor: pointer;
        z-index: 2000;
    }

    .hamburger span {
        height: 3px;
        width: 100%;
        background: #9b1c1c;
        border-radius: 3px;
    }

    .nav-left {
        display: none !important;
    }

    .nav-left.open,
    .nav-left.open-mobile {
        display: flex !important;
        flex-direction: column;
        position: absolute;
        top: 64px;
        left: 0;
        width: 100vw;
        padding: 14px;
        gap: 10px;
        background: #ffffffee;
        text-align: center;
        z-index: 1500;
    }

    .nav-left a.active {
        color: #9b1c1c !important;
        text-decoration: none !important;
    }

    /* =========================================================
       FOOTER
    ========================================================= */

    .footer {
        height: 30px !important;
        font-size: 12px !important;
    }

    /* =========================================================
       PAGE D’ACCUEIL (HOME) — RESTAURÉE À L’IDENTIQUE
    ========================================================= */

    body.home-page {
        overflow-y: hidden;
    }

    body.home-page main.main-content {
        padding-top: 40px !important;
        padding-bottom: 0 !important;
    }

    body.home-page .hero {
        margin-bottom: 20px !important;
        padding-top: 0 !important;
        padding-bottom: 0 !important;
    }

    body.home-page .hero h2 {
        font-size: 28px !important;
        margin-top: 12px !important;
        margin-bottom: 6px !important;
    }

    body.home-page .hero p {
        font-size: 16px !important;
        margin-top: 0 !important;
        margin-bottom: 30px !important;
    }

    body.home-page .card {
        width: 90% !important;
        max-width: 270px !important;
        padding: 18px !important;
        height: auto !important;
    }

    body.home-page .card h3 {
        font-size: 22px !important;
        margin-bottom: 8px !important;
    }

    body.home-page .card p {
        font-size: 14px !important;
        line-height: 1.4 !important;
    }

    body.home-page .cards {
        flex-direction: column !important;
        align-items: center !important;
        gap: 18px !important;
    }

    .empty-card {
        display: none !important;
    }

    /* =========================================================
       PAGE ÉQUIPE — AJUSTEMENTS MOBILE UNIQUEMENT
    ========================================================= */

    body.team-page main.main-content {
        padding-top: 10px !important;
        padding-bottom: 60px !important;
    }

    body.team-page .team-section {
        margin-top: 32px !important;
    }

    body.team-page .team-section h3 {
        font-size: 1.35rem !important;
        margin-bottom: 30px !important;
    }

    body.team-page .team-section h3::after {
        width: 46px;
        height: 3px;
        bottom: -8px;
    }

    body.team-page .players-grid {
        display: grid !important;
        grid-template-columns: repeat(2, calc((100vw - 32px) / 2));
        gap: 8px;
        width: 100vw;
        padding: 0 16px;
        margin: 0;
        box-sizing: border-box;
        justify-content: center;
    }

    body.team-page .player-card {
        width: 100% !important;
        min-width: 100%;
        max-width: 100%;
        height: 80px;
        padding: 10px 8px !important;
        box-sizing: border-box;
        display: flex;
        flex-direction: column;
        justify-content: center;
        align-items: center;
        text-align: center;
        overflow: hidden;
    }

    body.team-page .player-card h4 {
        font-size: 0.95rem !important;
        line-height: 1.1;
        margin-bottom: 2px;
        width: 100%;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    body.team-page .player-card p {
        font-size: 1.6rem !important;
        margin: 0;
        line-height: 1;
    }

    /* =========================================================
       PAGE RÉSULTATS — AJUSTEMENTS MOBILE UNIQUEMENT
    ========================================================= */

    body.results-page main.main-content {
        padding-top: 40px !important;
        padding-bottom: 60px !important;
    }

    body.results-page .results-title {
        font-size: 2rem !important; 
        margin-bottom: 30px !important;
    }

    body.results-page .results-pair {
        display: flex !important;
        flex-direction: column !important;
        gap: 16px !important;
    }

    body.results-page .results-list {
        width: 95% !important;
        max-width: 95% !important;
        margin: 0 auto;
    }

    body.results-page .match-card {
        width: 100% !important;
        padding: 10px !important;
        box-sizing: border-box;
        display: flex;
        justify-content: space-between;
        align-items: center;
    }

    body.results-page .match-card .match-teams {
        font-size: 0.9rem !important;
        text-align: left;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        flex: 1;
    }

    body.results-page .match-card .match-score {
        font-size: 1.2rem !important;
        font-weight: 700;
        text-align: right;
        margin-left: 12px;
        flex-shrink: 0;
    }

    /* =========================================================
       PAGES STATS ET PLAYER — MOBILE ONLY
    ========================================================= */

    /* Conteneur des filtres sur une ligne */
    .stats-filters {
        display: flex !important;
        flex-direction: row !important;
        gap: 12px !important;
        justify-content: space-between;
        margin-bottom: 20px;
        padding: 0 16px;
    }

    /* Chaque groupe de filtre prend 50% */
    .stats-filters .filter-group {
        flex: 1 1 48%;
        display: flex;
        flex-direction: column;
    }

    /* Label des filtres */
    .stats-filters .filter-group label {
        font-size: 0.95rem !important; 
        margin-bottom: 6px;
        font-weight: 600;
        color: #fff;
        text-shadow: 0 1px 2px rgba(0,0,0,0.3);
    }

    /* Select — style “bouton” avec flèche fixe */
    .stats-filters .filter-group select {
        width: 100% !important;
        padding: 12px 16px !important;
        font-size: 0.95rem !important;
        border-radius: 12px;
        border: 1px solid rgba(255,255,255,0.4);
        background: rgba(255,255,255,0.08);
        color: #fff;
        appearance: none;
        -webkit-appearance: none;
        -moz-appearance: none;
        cursor: pointer;
        position: relative;
        background-image: url("data:image/svg+xml,%3Csvg width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3' stroke-linecap='round' stroke-linejoin='round' xmlns='http://www.w3.org/2000/svg'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
        background-repeat: no-repeat;
        background-position: right 12px center;
        background-size: 12px 12px;
        transition: background 0.2s ease;
    }

    /* Flèche visible même au focus / hover / active */
    .stats-filters .filter-group select:focus,
    .stats-filters .filter-group select:hover,
    .stats-filters .filter-group select:active {
        background: rgba(255,255,255,0.12);
        border-color: #fff;
        outline: none;
        background-image: url("data:image/svg+xml,%3Csvg width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3' stroke-linecap='round' stroke-linejoin='round' xmlns='http://www.w3.org/2000/svg'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
        background-repeat: no-repeat;
        background-position: right 12px center;
        background-size: 12px 12px;
    }

    /* =========================================================
       Stats / Player — Grille de cartes 2 par 2
    ========================================================= */

    body.stats-page .stats-summary,
    body.stats-page #player-summary {
        display: grid !important;
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 12px !important;
        padding: 0 16px !important;
        margin: 0 auto !important;
    }

    /* Cartes de statistiques — réduire hauteur et texte */
    body.stats-page .stats-summary .stat-card,
    body.stats-page #player-summary .stat-card {
        padding: 8px !important;
        min-height: auto !important;
        height: auto !important;
        font-size: 0.85rem !important; /* texte principal réduit */
    }

    /* Cartes personnelles restent 1 par ligne */
    body.stats-page #players-stats-grid {
        display: grid !important;
        grid-template-columns: 1fr !important;
        gap: 12px !important;
        padding: 0 16px !important;
        margin: 0 auto !important;
    }

    body.stats-page .stat-card,
    body.stats-page .player-stat-card {
        width: 100% !important;
    }

    /* Titre principal réduit */
    body.stats-page .results-title {
        font-size: 2rem !important; /* réduit taille du titre */
        margin-top: 2px !important;       /* espace réduit avec le header */
        margin-bottom: 35px !important;    /* espace avec filtres */
    }

    /* Réduction espace entre dernière carte et footer */
    body.stats-page main.main-content {
       padding-top: 30px !important;
       padding-bottom: 2px !important;
    }

   .charts-podium-container {
        flex-direction: column !important;
        gap: 16px !important;
        margin-top: 10px !important;
        margin-bottom: 10px !important;
        padding: 0 12px !important; /* espace des côtés */
    }

    .charts-panel,
    .podium-panel {
        width: 100% !important;
        max-width: 100% !important;
        box-sizing: border-box; /* s'assure que padding ne déborde pas */
    }

    .charts-panel canvas {
        width: 100% !important;  /* pleine largeur du conteneur */
        height: auto !important;  /* laisse Chart.js gérer la hauteur */
        max-height: 260px;        /* optionnel : limite la hauteur si besoin */
    }

    .podium-panel > div {
        padding: 12px !important;      /* réduit légèrement le padding interne */
        border-radius: 10px !important;
    }
}
