/* ── MFP Classement – Styles v2.1 ─────────────────────────────────────────── */

#mfp-classement-wrapper {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Arial, sans-serif;
    font-size: var(--mfp-font-size, 14px);   /* ← contrôlé depuis l'admin */
    max-width: 1060px;
    margin: 0 auto;
    color: #1a1a2e;
    box-sizing: border-box;
}

/* ── Titre ── */
.mfp-titre {
    text-align: center;
    font-size: calc(var(--mfp-font-size, 14px) + 12px);
    font-weight: 700;
    margin: 0 0 18px;
    color: #111;
}

/* ── Onglets ── */
.mfp-tabs {
    display: flex; justify-content: center;
    gap: 6px; margin-bottom: 12px; flex-wrap: wrap;
}
.mfp-tab {
    border: 2px solid transparent; border-radius: 6px;
    padding: 10px 22px;
    font-size: calc(var(--mfp-font-size, 14px) - 1px);
    font-weight: 700; letter-spacing: .3px; cursor: pointer;
    transition: opacity .2s, transform .15s, box-shadow .15s;
    opacity: .6; white-space: nowrap;
}
.mfp-tab:hover  { opacity: .82; }
.mfp-tab.active { opacity: 1; transform: translateY(-2px); box-shadow: 0 4px 12px rgba(0,0,0,.2); }
.mfp-tab-general { background: #002395; color: #fff; border-color: #002395; }
.mfp-tab-course  { background: #ffffff; color: #002395; border-color: #002395; }
.mfp-tab-marche  { background: #ED2939; color: #fff; border-color: #ED2939; }

/* ── Header live ── */
.mfp-header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 6px 0 10px; font-size: calc(var(--mfp-font-size, 14px) - 2px); color: #888;
    border-bottom: 1px solid #eee; margin-bottom: 8px; flex-wrap: wrap; gap: 6px;
}
.mfp-header-right { display: flex; align-items: center; gap: 8px; }
.mfp-badge {
    display: inline-flex; align-items: center; gap: 4px;
    padding: 2px 8px; border-radius: 20px;
    font-size: calc(var(--mfp-font-size, 14px) - 3px); font-weight: 700;
}
.mfp-live { background: var(--mfp-live-bg, #ED2939); color: #fff; animation: mfp-pulse 1.5s infinite; }
@keyframes mfp-pulse { 0%,100%{opacity:1} 50%{opacity:.55} }
.mfp-countdown-info { font-size: calc(var(--mfp-font-size, 14px) - 3px); color: #ccc; }
.mfp-btn-refresh {
    background: var(--mfp-btn-bg, #1a3a6b); color: var(--mfp-btn-text, #fff);
    border: none; border-radius: 50%; width: 26px; height: 26px; font-size: 14px;
    cursor: pointer; display: flex; align-items: center; justify-content: center;
    transition: filter .2s; flex-shrink: 0;
}
.mfp-btn-refresh:hover { filter: brightness(1.2); }

/* ── Chargement ── */
.mfp-loading { text-align: center; padding: 40px 20px; color: #aaa; }
.mfp-spinner {
    width: 36px; height: 36px; border: 3px solid #eee;
    border-top-color: #002395; border-radius: 50%;
    animation: mfp-spin .8s linear infinite; margin: 0 auto 12px;
}
@keyframes mfp-spin { to { transform: rotate(360deg); } }
.mfp-error {
    background: #fff0f0; border: 1px solid #ffcccc; color: #cc0000;
    padding: 12px 16px; border-radius: 8px; margin: 12px 0;
    font-size: var(--mfp-font-size, 14px);
}
.mfp-stats-bar { text-align: right; font-size: calc(var(--mfp-font-size, 14px) - 3px); color: #ccc; padding-bottom: 6px; }

/* ── Éléments communs ── */
.mfp-rank-num {
    display: inline-flex; align-items: center; justify-content: center;
    font-weight: 800; font-size: var(--mfp-font-size, 14px);
    width: 28px; height: 28px; border-radius: 50%; background: #e0e0e0; color: #555;
}
.mfp-dossard {
    display: inline-block;
    /* background et color injectés en style="" inline par le JS selon le type (Course/Marche) */
    border-radius: 4px; padding: 2px 7px;
    font-weight: 700; font-size: calc(var(--mfp-font-size, 14px) - 1px);
}
.mfp-nom    { font-weight: 700; display: block; font-size: var(--mfp-font-size, 14px); }
.mfp-prenom { color: #666; font-size: calc(var(--mfp-font-size, 14px) - 1px); }
.mfp-sexe-F { color: #c0185b !important; }
.mfp-sexe-M { color: #1a6fd4 !important; }
.mfp-flag   { line-height: 1; }

.mfp-type-name  { color: #999; font-weight: 500; font-size: calc(var(--mfp-font-size, 14px) - 3px); }
.mfp-rank-sexe  { font-weight: 700; color: #1a3a6b; font-size: calc(var(--mfp-font-size, 14px) - 1px); }
.mfp-rank-cat   { font-weight: 600; color: #666; font-size: calc(var(--mfp-font-size, 14px) - 2px); }

.mfp-km-val    { font-weight: 700; color: #111; display: block; font-size: var(--mfp-font-size, 14px); }
.mfp-mi-val    { color: #888; display: block; font-size: calc(var(--mfp-font-size, 14px) - 2px); }
.mfp-tours-val { font-weight: 700; color: var(--mfp-tours, #1a3a6b); display: block; font-size: calc(var(--mfp-font-size, 14px) - 1px); }
.mfp-tours-lbl { font-weight: 400; color: #aaa; font-size: calc(var(--mfp-font-size, 14px) - 2px); }

/* ══════════════════════════════════════════════════════════
   VUE DESKTOP
══════════════════════════════════════════════════════════ */

.mfp-view-desktop .mfp-table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.mfp-view-desktop .mfp-cards { display: none; }

.mfp-view-desktop .mfp-table { width: 100%; border-collapse: collapse; min-width: 600px; }
.mfp-view-desktop .mfp-table thead tr {
    background: var(--mfp-header-bg, #1a3a6b); color: var(--mfp-header-text, #fff);
}
.mfp-view-desktop .mfp-table th {
    padding: 12px 14px; text-align: left; font-weight: 600;
    font-size: calc(var(--mfp-font-size, 14px) - 1px); white-space: nowrap;
}
.mfp-view-desktop .mfp-table td {
    padding: 10px 14px; vertical-align: middle; border-bottom: 1px solid #eee;
}
.mfp-view-desktop .mfp-table tbody tr:nth-child(even) { background: #f9f9f9; }
.mfp-view-desktop .mfp-table tbody tr:hover { background: #eef4ff !important; }

.mfp-view-desktop .mfp-col-rank    { width: 50px; text-align: center !important; }
.mfp-view-desktop .mfp-col-dossard { width: 78px; text-align: center !important; }
.mfp-view-desktop .mfp-col-nom     { min-width: 155px; }
.mfp-view-desktop .mfp-col-type    { width: 130px; text-align: center !important; }
.mfp-view-desktop .mfp-col-dist    { width: 155px; text-align: center !important; }
.mfp-view-desktop .mfp-col-flag    { width: 50px; text-align: center !important; }

/* Nom + Prénom empilés en desktop */
.mfp-view-desktop .mfp-col-nom .mfp-nom    { display: block; }
.mfp-view-desktop .mfp-col-nom .mfp-prenom { display: block; margin-top: 1px; }

.mfp-view-desktop .mfp-type-block {
    text-align: center; display: flex; flex-direction: column; gap: 1px;
}
.mfp-view-desktop .mfp-dist-block { text-align: center; }
.mfp-view-desktop .mfp-flag { font-size: calc(var(--mfp-font-size, 14px) + 6px); }
.mfp-view-desktop .mfp-rank-num { width: 30px; height: 30px; }

/* ══════════════════════════════════════════════════════════
   VUE MOBILE (cartes)
══════════════════════════════════════════════════════════ */

.mfp-view-mobile { padding: 0 4px; }
.mfp-view-mobile .mfp-table-scroll { display: none; }
.mfp-view-mobile .mfp-titre  { font-size: calc(var(--mfp-font-size, 13px) + 6px); margin-bottom: 12px; }
.mfp-view-mobile .mfp-tab    { font-size: calc(var(--mfp-font-size, 13px) - 1px); padding: 8px 11px; }
.mfp-view-mobile .mfp-header { font-size: calc(var(--mfp-font-size, 13px) - 2px); }

.mfp-view-mobile .mfp-cards { display: flex; flex-direction: column; gap: 6px; }

.mfp-view-mobile .mfp-card {
    background: #fff;
    border: 1px solid #e8e8e8;
    border-radius: 10px;
    padding: 9px 10px;
    display: grid;
    /* rang | dossard | info(nom+prenom+type) | distance */
    grid-template-columns: 32px 44px 1fr auto;
    column-gap: 8px;
    align-items: center;
    box-shadow: 0 1px 3px rgba(0,0,0,.05);
}

.mfp-view-mobile .mfp-card-rank    { display: flex; align-items: center; justify-content: center; }
.mfp-view-mobile .mfp-card-dossard { display: flex; align-items: center; justify-content: center; }

/* Info : 3 lignes empilées */
.mfp-view-mobile .mfp-card-info {
    display: flex; flex-direction: column; gap: 1px; min-width: 0;
}
.mfp-view-mobile .mfp-card-info .mfp-nom {
    font-size: var(--mfp-font-size, 13px);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.mfp-view-mobile .mfp-card-prenom-flag {
    display: flex; align-items: center; gap: 4px;
}
.mfp-view-mobile .mfp-card-prenom-flag .mfp-prenom {
    font-size: calc(var(--mfp-font-size, 13px) - 1px);
}
.mfp-view-mobile .mfp-card-prenom-flag .mfp-flag {
    font-size: calc(var(--mfp-font-size, 13px) + 1px);
}
.mfp-view-mobile .mfp-card-type-row {
    display: flex; align-items: center; gap: 3px; flex-wrap: wrap;
}
.mfp-view-mobile .mfp-card-type-row .mfp-type-name { font-size: calc(var(--mfp-font-size, 13px) - 3px); }
.mfp-view-mobile .mfp-card-type-row .mfp-rank-sexe { font-size: calc(var(--mfp-font-size, 13px) - 1px); }
.mfp-view-mobile .mfp-card-type-row .mfp-rank-cat  { font-size: calc(var(--mfp-font-size, 13px) - 2px); }

.mfp-view-mobile .mfp-card-dist { text-align: right; }
.mfp-view-mobile .mfp-card-dist .mfp-km-val    { font-size: var(--mfp-font-size, 13px); white-space: nowrap; }
.mfp-view-mobile .mfp-card-dist .mfp-mi-val    { font-size: calc(var(--mfp-font-size, 13px) - 2px); white-space: nowrap; }
.mfp-view-mobile .mfp-card-dist .mfp-tours-val { font-size: calc(var(--mfp-font-size, 13px) - 1px); white-space: nowrap; }
.mfp-view-mobile .mfp-card-dist .mfp-tours-lbl { font-size: calc(var(--mfp-font-size, 13px) - 3px); }

.mfp-view-mobile .mfp-rank-num { font-size: calc(var(--mfp-font-size, 13px) - 1px); width: 26px; height: 26px; }
.mfp-view-mobile .mfp-dossard  { font-size: calc(var(--mfp-font-size, 13px) - 2px); padding: 2px 5px; }
