/* --- VARIABLES ET BASE --- */
:root {
    --pp-accent: #00ff88;
    --pp-card: #1e1e1e;
    --pp-border: #333;
    --pp-text-dim: #888;
    --pp-danger: #ff4d4d;
}

.pp-archive-wrapper { 
    max-width: 1000px; 
    margin: 20px auto; 
    color: #fff; 
    font-family: 'Inter', sans-serif; 
}

/* --- NAVIGATION SEMAINE --- */
.pp-week-nav { 
    display: flex; 
    align-items: center; 
    justify-content: center; 
    gap: 20px; 
    margin-bottom: 25px; 
}
.nav-arrow {
    text-decoration: none; 
    color: #fff; 
    width: 32px; 
    height: 32px; 
    display: flex;
    align-items: center; 
    justify-content: center; 
    background: #252525; 
    border-radius: 50%;
    font-size: 1.2rem; 
    border: 1px solid var(--pp-border); 
    transition: 0.2s;
}
.nav-arrow:hover { 
    background: var(--pp-accent); 
    color: #000; 
    border-color: var(--pp-accent); 
}
.current-week-display { 
    font-weight: 700; 
    font-size: 0.95rem; 
    text-transform: uppercase; 
    letter-spacing: 0.5px; 
}
.year-dim { 
    color: var(--pp-text-dim); 
    font-weight: 400; 
    margin-left: 5px; 
}

/* --- BOUTONS LIGUES --- */
.pp-league-buttons { 
    display: flex; 
    flex-wrap: wrap; 
    gap: 8px; 
    margin-bottom: 30px; 
    justify-content: center; 
    padding: 0 10px; 
}
.league-btn {
    text-decoration: none; 
    color: #ccc; 
    background: #1a1a1a; 
    padding: 6px 12px;
    border-radius: 6px; 
    font-size: 0.75rem; 
    font-weight: 600; 
    border: 1px solid var(--pp-border);
    transition: 0.2s; 
    display: inline-flex; 
    align-items: center; 
    justify-content: center;
}
.league-btn.active { 
    background: rgba(0, 255, 136, 0.1); 
    color: var(--pp-accent); 
    border-color: var(--pp-accent); 
}

/* --- LISTE ET LIGNES --- */
.pp-history-list { 
    background: var(--pp-card); 
    border-radius: 10px; 
    border: 1px solid var(--pp-border); 
    overflow: hidden; 
    margin: 0 10px; 
}
.pp-history-row { 
    display: flex; 
    flex-direction: column; 
    padding: 15px; 
    border-bottom: 1px solid var(--pp-border); 
    gap: 15px; 
}
.pp-row-pending { 
    border-left: 3px solid var(--pp-accent); 
    background: rgba(0, 255, 136, 0.01); 
}

/* --- STRUCTURE MATCH (MOBILE PAR DÉFAUT) --- */
.pp-hist-main { 
    display: flex; 
    align-items: center; 
    justify-content: space-between; 
    gap: 10px; 
}

.pp-hist-team { 
    flex: 1; 
    display: flex; 
    flex-direction: column; /* Colonne sur mobile */
    align-items: center; 
    gap: 6px; 
}

/* Forçage de l'ordre sur mobile : Logo (1) puis Nom (2) */
.pp-logo-sm { 
    order: 1; 
    width: 38px; 
    height: 60px; 
    object-fit: contain; 
    flex-shrink: 0; 
}
.team-txt { 
    order: 2; 
    font-weight: 600; 
    font-size: 0.95rem; 
    text-align: center; 
    line-height: 1.2; 
}

/* Zone Score */
.pp-score-wrap { 
    min-width: 70px; 
    display: flex; 
    justify-content: center; 
}
.pp-hist-score { 
    background: var(--pp-accent); 
    color: #000; 
    padding: 4px 10px; 
    border-radius: 5px; 
    font-weight: 800; 
    font-size: 1rem; 
    min-width: 65px; 
    text-align: center; 
}
.pp-upcoming-date { 
    background: #333 !important; 
    color: #eee !important; 
    font-size: 0.75rem !important; 
}

/* --- STATISTIQUES (BADGES) --- */
.pp-hist-analysis { 
    display: flex; 
    gap: 5px; 
    flex-wrap: wrap; 
    justify-content: center; 
}
.pp-analysis-badge { 
    display: flex; 
    flex-direction: column; 
    align-items: center; 
    min-width: 50px; 
    padding: 4px 5px; 
    border-radius: 5px; 
    border: 1px solid #333; 
    background: #161616; 
}
.pp-analysis-badge.pp-win { border-color: var(--pp-accent); color: var(--pp-accent); }
.pp-analysis-badge.pp-loss { border-color: var(--pp-danger); color: var(--pp-danger); }
.an-label { font-size: 0.5rem; font-weight: 800; text-transform: uppercase; opacity: 0.8; }
.an-prob { font-size: 0.7rem; font-weight: 700; }

/* --- VERSION ORDINATEUR (DESKTOP 850px+) --- */
@media (min-width: 850px) { 
    .pp-history-row { 
        flex-direction: row; 
        align-items: center; 
        justify-content: space-between; 
        padding: 10px 20px;
    } 

    .pp-hist-main { flex: 2; }
    .pp-hist-analysis { flex: 1; justify-content: flex-end; }

    .pp-hist-team { 
        flex-direction: row; /* Retour en ligne sur PC */
        gap: 10px; 
    }
    
    /* On annule l'ordre forcé du mobile pour respecter le flux HTML (Nom-Logo ou Logo-Nom) */
    .pp-logo-sm { 
        order: unset; 
        width: 22px; 
        height: 70px; 
    }
    .team-txt { 
        order: unset; 
        font-size: 0.95rem; 
        max-width: none;
    }

    .pp-hist-team.left { justify-content: flex-end; text-align: right; }
    .pp-hist-team.right { justify-content: flex-start; text-align: left; }
}

/* --- PETITS AJUSTEMENTS MOBILE --- */
@media (max-width: 500px) {
    .team-txt { 
        max-width: 85px; 
        overflow: hidden; 
        text-overflow: ellipsis; 
        white-space: nowrap; 
    }
    .pp-hist-analysis { 
        display: grid; 
        grid-template-columns: repeat(2, 1fr); 
        width: 100%; 
    }
}

.pp-empty-state { padding: 40px; text-align: center; color: var(--pp-text-dim); font-size: 0.85rem; }
