/* =====================================================================
   LBMA — Thème VARIANTE A « Appli de match » (branche test)
   Une seule famille (Archivo, largeur variable) : condensée et grasse
   pour les titres et les scores, normale pour le texte.
   La seule couleur vive vient des équipes ; le rouge LBMA est réservé
   au direct et aux actions.
   Chargé après le style propre à chaque page : il le remplace.
   ===================================================================== */
/* Couleurs du menu et du pied de page : sur toutes les pages qui ont le menu
   (html.ln-site, ajouté par lbma-nav.js), même celles qui gardent leur propre style */
html.lbma-theme, html.ln-site {
  --a-fond: #EEF2F7;
  --a-surface: #FFFFFF;
  --a-encre: #10223A;
  --a-gris: #5B6B80;
  --a-ligne: #D8DFE8;
  --a-rouge: #C8102E;
  --a-or: #B8901C;
  --a-rayon: 14px;
  --a-barre: 60px;
}
/* Le thème complet remplace aussi les couleurs des pages existantes */
html.lbma-theme {
  --primary: #10223A;
  --accent: #C8102E;
  --gold: #B8901C;
  --white: #FFFFFF;
  --cream: #EEF2F7;
}

/* ---------- Base ---------- */
html.lbma-theme body {
  background: var(--a-fond);
  color: var(--a-encre);
  font-family: 'Archivo', system-ui, sans-serif;
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
html.lbma-theme body :where(*:not(svg):not(svg *)) { font-family: 'Archivo', system-ui, sans-serif !important; }
html.lbma-theme :is(h1, h2, h3, .section-title, .month-title, .sidebar-header, .series-header, .standings-header h2, .standings-header h3) {
  font-stretch: 75%;
  font-weight: 800;
  letter-spacing: -.01em;
  text-shadow: none !important;
}
html.lbma-theme :focus-visible { outline: 3px solid #3B82F6; outline-offset: 2px; }
html.lbma-theme a { color: inherit; }

/* ---------- Navigation ---------- */
/* Pas de filtre sur le conteneur : il piégerait la barre d'onglets fixée en bas */
html.ln-site #lbma-nav-root { position: static; background: none; box-shadow: none; padding: 0; }
.ln-barre {
  position: fixed; top: 0; left: 0; right: 0; z-index: 1000;
  background: rgba(255, 255, 255, .94);
  backdrop-filter: saturate(1.4) blur(10px);
  box-shadow: 0 1px 0 var(--a-ligne);
  height: var(--a-barre);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 max(1.25rem, calc((100vw - 1200px) / 2 + 1.25rem));
}
.ln-logo { display: flex; align-items: center; gap: .6rem; text-decoration: none; color: var(--a-encre); }
.ln-logo img { height: 40px; width: auto; border-radius: 8px; }
.ln-logo span { font-stretch: 75%; font-weight: 900; font-size: 1.35rem; letter-spacing: .02em; }
.ln-liens { display: flex; gap: .25rem; align-items: center; }
.ln-lien {
  display: inline-flex; align-items: center; height: 40px; padding: 0 .9rem; border-radius: 999px;
  text-decoration: none; color: var(--a-gris); font-weight: 600; font-size: .95rem;
  background: none; border: 0; cursor: pointer;
}
.ln-lien:hover { color: var(--a-encre); background: var(--a-fond); }
.ln-lien[aria-current="page"], .ln-plus-btn[data-actif] { color: var(--a-encre); background: var(--a-fond); }
.ln-lien[aria-current="page"]::before {
  content: ''; width: 7px; height: 7px; border-radius: 50%; background: var(--a-rouge); margin-right: .45rem;
}
.ln-voile { position: fixed; inset: 0; background: rgba(16, 34, 58, .35); z-index: 1001; }
.ln-panneau {
  position: fixed; z-index: 1002; top: calc(var(--a-barre) + 8px); right: max(1.25rem, calc((100vw - 1200px) / 2 + 1.25rem));
  width: min(880px, calc(100vw - 2.5rem)); max-height: calc(100vh - var(--a-barre) - 24px); overflow: auto;
  background: var(--a-surface); border-radius: 18px; box-shadow: 0 20px 50px rgba(16, 34, 58, .22);
}
.ln-panneau-int { padding: 1.25rem 1.5rem 1.5rem; }
.ln-panneau-tete { display: flex; justify-content: space-between; align-items: center; margin-bottom: .75rem; }
.ln-panneau-tete strong { font-stretch: 75%; font-weight: 800; font-size: 1.3rem; }
.ln-fermer { border: 0; background: var(--a-fond); width: 36px; height: 36px; border-radius: 50%; cursor: pointer; font-size: 1rem; color: var(--a-encre); }
/* Panneau « Plus » : tuiles à icônes (ordi : 2 colonnes, cellulaire : 1) */
.ln-sections { display: grid; grid-template-columns: 1fr 1fr; gap: 1.25rem 2rem; }
.ln-sec-histoire { grid-column: 2; grid-row: 1 / span 2; }
.ln-sec-ligue { grid-column: 1; }
.ln-sec h2 { font-size: .82rem !important; font-stretch: 100% !important; font-weight: 700 !important; color: var(--a-gris); margin: 0 0 .5rem; letter-spacing: 0; }
.ln-grille { display: grid; grid-template-columns: repeat(4, 1fr); gap: .45rem; }
.ln-tuile {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .3rem;
  min-height: 70px; padding: .55rem .2rem; border-radius: 14px; background: var(--a-fond);
  text-decoration: none; color: var(--a-encre); font-size: .78rem; font-weight: 600; text-align: center; line-height: 1.15;
}
.ln-tuile .ln-ico { width: 26px; height: 26px; }
.ln-sec-histoire .ln-tuile .ln-ico { color: var(--a-or); }
.ln-tuile[aria-current="page"] { background: var(--a-encre); color: #fff; }
.ln-tuile[aria-current="page"] .ln-ico { color: #fff; }
.ln-tuile:active { transform: scale(.97); }
.ln-paire { display: grid; grid-template-columns: 1fr auto auto; align-items: center; gap: .4rem; padding: .3rem 0; border-top: 1px solid var(--a-fond); }
.ln-grille + .ln-paire { margin-top: .45rem; }
.ln-paire > span { font-weight: 600; font-size: .95rem; }
.ln-paire a {
  display: inline-flex; align-items: center; min-height: 44px; padding: 0 .95rem; border-radius: 999px;
  border: 1px solid var(--a-ligne); text-decoration: none; color: var(--a-encre); font-size: .88rem; font-weight: 600;
}
.ln-paire a[aria-current="page"] { background: var(--a-encre); color: #fff; border-color: var(--a-encre); }
@media (hover: hover) { .ln-tuile:hover { box-shadow: inset 0 0 0 1px var(--a-encre); } .ln-paire a:hover { border-color: var(--a-encre); } }
.ln-admin { grid-column: 1 / -1; justify-self: start; margin-top: .25rem; font-size: .85rem; color: var(--a-gris) !important; }
.ln-tabs { display: none; }
.ln-retour { display: none; }
html.ln-ouvert { overflow: hidden; }

/* Décalage des en-têtes sous la barre fixe */
html.lbma-theme :is(.hero, .page-header) { margin-top: var(--a-barre) !important; }

@media (max-width: 820px) {
  .ln-liens { display: none; }
  .ln-barre { justify-content: center; height: 52px; }
  html.lbma-theme, html.ln-site { --a-barre: 52px; }
  .ln-logo img { height: 34px; }
  /* Bouton « Retour » à gauche de la barre du haut (le logo reste centré) */
  .ln-retour {
    display: inline-flex; position: absolute; left: 4px; top: 50%; transform: translateY(-50%);
    align-items: center; gap: 1px; min-height: 44px; min-width: 44px; padding: 0 .7rem 0 .35rem;
    border-radius: 12px; color: var(--a-encre) !important; text-decoration: none;
    font-size: .95rem; font-weight: 600;
  }
  .ln-retour svg { width: 22px; height: 22px; flex-shrink: 0; }
  .ln-retour:active { background: var(--a-fond); }
  .ln-tabs {
    display: grid; grid-template-columns: repeat(5, 1fr);
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 1003;
    background: rgba(255, 255, 255, .97); backdrop-filter: blur(10px);
    box-shadow: 0 -1px 0 var(--a-ligne);
    padding: 4px 4px calc(4px + env(safe-area-inset-bottom));
  }
  .ln-tab {
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
    min-height: 54px; text-decoration: none; color: var(--a-gris); font-size: .72rem; font-weight: 600;
    background: none; border: 0; border-radius: 12px; cursor: pointer;
  }
  .ln-tab .ln-ico { width: 24px; height: 24px; }
  .ln-tab[aria-current="page"], .ln-tab[data-actif] { color: var(--a-encre); }
  .ln-tab[aria-current="page"] .ln-ico, .ln-tab[data-actif] .ln-ico { stroke: var(--a-rouge); stroke-width: 2.2; }
  html.ln-site body { padding-bottom: calc(66px + env(safe-area-inset-bottom)) !important; }
  .ln-panneau {
    top: auto; bottom: 0; right: 0; left: 0; width: 100%; max-height: 82vh;
    border-radius: 20px 20px 0 0; padding-bottom: calc(70px + env(safe-area-inset-bottom));
  }
  .ln-panneau { max-height: 90vh; }
  .ln-panneau-int { padding: 1rem 1rem 1.25rem; }
  .ln-sections { grid-template-columns: 1fr; gap: 1.1rem; }
  .ln-sec-histoire, .ln-sec-ligue { grid-column: auto; grid-row: auto; }
}

/* ---------- En-têtes de page ---------- */
html.lbma-theme .page-header {
  background: var(--a-surface) !important; color: var(--a-encre) !important;
  text-align: left !important; padding: 2rem 1.25rem 1.25rem !important;
  border-bottom: 1px solid var(--a-ligne);
}
html.lbma-theme .page-header::before { display: none !important; }
html.lbma-theme .page-header > * { max-width: 1200px; margin-left: auto !important; margin-right: auto !important; }
html.lbma-theme .page-header h1 { font-size: clamp(1.9rem, 6vw, 2.8rem) !important; color: var(--a-encre); text-transform: none; }
html.lbma-theme .page-header p { color: var(--a-gris); font-size: 1rem !important; opacity: 1 !important; margin-top: .25rem; }
html.lbma-theme .container { max-width: 1200px !important; padding: 1.25rem !important; }
@media (max-width: 820px) {
  html.lbma-theme .page-header { padding: 1.25rem 1rem .9rem !important; }
  html.lbma-theme .container { padding: 1rem .85rem !important; }
}

/* ---------- Boîtes, cartes, tableaux ---------- */
html.lbma-theme :is(.info-box, .sidebar-box, .standings-section, .table-wrapper, .series-section, .filter-section, .controls, .stats-summary > div, .stat-card) {
  background: var(--a-surface) !important;
  border: 1px solid var(--a-ligne) !important;
  border-radius: var(--a-rayon) !important;
  box-shadow: none !important;
  overflow: hidden;
}
html.lbma-theme :is(.sidebar-header, .standings-header, .series-header) {
  background: var(--a-surface) !important; color: var(--a-encre) !important;
  text-align: left !important; border-bottom: 1px solid var(--a-ligne);
  font-size: 1.15rem !important;
}
html.lbma-theme table th {
  background: var(--a-surface) !important; color: var(--a-gris) !important;
  font-weight: 700 !important; font-size: .74rem !important; letter-spacing: .02em;
  border-bottom: 1px solid var(--a-ligne) !important;
}
html.lbma-theme table td { border-bottom: 1px solid #EDF1F6 !important; font-variant-numeric: tabular-nums; }
html.lbma-theme table tr:not(.section-header):not(.totals-row):not(.total-row):hover td { background: #F6F8FB; }
/* Bandes de groupe (« Lanceurs partants ») : toujours marine, même au survol de la souris */
html.lbma-theme table tr.section-header td, html.lbma-theme table tr.section-header:hover td { background: var(--a-encre) !important; color: #fff !important; }
html.lbma-theme :is(select, .team-select, .year-select select) {
  border: 1px solid var(--a-ligne) !important; border-radius: 10px !important; background: var(--a-surface) !important;
  height: 42px; padding: 0 .8rem !important; color: var(--a-encre); font-size: .95rem !important;
}
html.lbma-theme :is(.print-btn, .export-btn, .btn) { border-radius: 10px !important; text-transform: none !important; border: 0 !important; }
html.lbma-theme .champion-badge { border-radius: 999px; background: #F6EBC7 !important; color: #6B5310 !important; }

/* Stats sur cellulaire : nom du joueur figé à gauche, colonnes serrées */
@media (max-width: 820px) {
  html.lbma-theme .table-wrapper { max-height: none !important; }
  html.lbma-theme .stats-table { font-size: .82rem !important; }
  html.lbma-theme .stats-table th, html.lbma-theme .stats-table td { padding: .55rem .45rem !important; }
  html.lbma-theme .stats-table :is(th, td):nth-child(2) {
    position: sticky; left: 0; z-index: 2; background: var(--a-surface) !important;
    box-shadow: 1px 0 0 var(--a-ligne);
  }
  html.lbma-theme .stats-table th:nth-child(2) { z-index: 3; }
  html.lbma-theme .stats-table .team-col { font-size: .72rem !important; }
}

/* ---------- Calendrier ---------- */
html.lbma-theme .month-title {
  font-size: 1.4rem !important; color: var(--a-encre) !important; border-bottom: 0 !important;
  position: sticky; top: var(--a-barre); z-index: 5; background: var(--a-fond); padding: .6rem 0 .4rem !important;
}
html.lbma-theme .match-card {
  background: var(--a-surface) !important; border: 1px solid var(--a-ligne) !important;
  border-radius: 12px !important; opacity: 1 !important;
}
html.lbma-theme .match-card.is-next { border: 2px solid var(--a-encre) !important; background: var(--a-surface) !important; }
html.lbma-theme .match-card.is-serie { border-left: 4px solid var(--a-or) !important; }
html.lbma-theme .mc-center .score { color: var(--a-encre) !important; font-stretch: 75%; font-weight: 800; }
html.lbma-theme .mc-center .score .winner { color: var(--a-encre) !important; }
html.lbma-theme .mc-center .score span:not(.winner) { color: var(--a-gris); font-weight: 600; }
html.lbma-theme .mc-team { font-weight: 700 !important; }
html.lbma-theme .badge { border-radius: 999px !important; text-transform: none; font-weight: 700; }
html.lbma-theme .badge-final { background: #E4E9F0 !important; color: var(--a-encre) !important; }
html.lbma-theme .badge-avenir { background: transparent !important; border: 1px solid var(--a-ligne) !important; }
html.lbma-theme .filter-btn {
  border: 1px solid var(--a-ligne) !important; border-radius: 999px !important; background: var(--a-surface) !important;
  font-weight: 600; white-space: nowrap;
}
html.lbma-theme .filter-btn.active { background: var(--a-encre) !important; color: #fff !important; border-color: var(--a-encre) !important; }
html.lbma-theme .cal-saut { background: var(--a-encre); color: #fff; }

/* ---------- Pied de page (discret, construit par lbma-nav.js) ---------- */
html.lbma-theme footer { background: var(--a-encre) !important; padding: 2.5rem 1.25rem !important; }
html.lbma-theme .social-link { border-radius: 999px !important; }
html.ln-site footer.ln-pied { background: transparent !important; color: var(--a-gris); padding: .5rem 1.25rem 1rem !important; margin: 0 !important; }
.ln-pied-int {
  max-width: calc(1200px - 2.5rem); margin: 0 auto; padding-top: .35rem; border-top: 1px solid var(--a-ligne);
  display: grid; justify-items: center; text-align: center;
}
.ln-pied-liens, .ln-pied-bas { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; column-gap: 1.25rem; }
.ln-pied-liens a { display: inline-flex; align-items: center; min-height: 44px; color: var(--a-encre) !important; font-weight: 600; font-size: .9rem; text-decoration: none; }
.ln-pied-bas { font-size: .8rem; }
.ln-pied-bas a { display: inline-flex; align-items: center; min-height: 36px; color: var(--a-gris) !important; }
@media (min-width: 821px) {
  .ln-pied-int { grid-template-columns: 1fr auto; justify-items: stretch; text-align: left; padding-top: .5rem; }
  .ln-pied-liens { justify-content: flex-start; }
  .ln-pied-bas { justify-content: flex-end; }
}

/* ---------- Bannière des témoins (cookies) : discrète ---------- */
html.lbma-theme #lbma-cookie-banner {
  left: .75rem !important; right: .75rem !important; bottom: .75rem !important; width: auto !important;
  border-radius: 14px !important; padding: .6rem .9rem !important; font-size: .8rem !important; gap: .5rem !important;
  box-shadow: 0 10px 30px rgba(16, 34, 58, .25) !important; background: var(--a-encre) !important;
}
@media (max-width: 820px) {
  html.lbma-theme #lbma-cookie-banner { bottom: calc(74px + env(safe-area-inset-bottom)) !important; }
}

@media (prefers-reduced-motion: reduce) {
  html.lbma-theme * { animation: none !important; transition: none !important; }
}
html.lbma-theme #lbma-cookie-banner button { padding: 6px 14px !important; border-radius: 999px !important; }
html.lbma-theme #lbma-cookie-banner > span { min-width: 160px !important; }

/* Les pages ont leurs propres règles « nav a » (majuscules, marges) : on les neutralise */
html.ln-site #lbma-nav-root :is(.ln-tab, .ln-lien, .ln-tuile, .ln-paire a, .ln-logo, .ln-admin, .ln-retour) {
  text-transform: none !important; letter-spacing: 0 !important; border: 0;
}
html.ln-site #lbma-nav-root .ln-tab { padding: 0 !important; font-size: .72rem !important; }
html.ln-site #lbma-nav-root .ln-retour { padding: 0 .7rem 0 .35rem !important; font-size: .95rem !important; background: none; margin: 0 !important; }
html.ln-site #lbma-nav-root .ln-retour:active { background: var(--a-fond); }
html.ln-site #lbma-nav-root .ln-lien { padding: 0 .9rem !important; font-size: .95rem !important; }
html.ln-site #lbma-nav-root .ln-tuile { padding: .55rem .2rem !important; font-size: .78rem !important; }
html.ln-site #lbma-nav-root .ln-admin { padding: 0 !important; font-size: .85rem !important; font-weight: 400 !important; background: none !important; }
html.ln-site #lbma-nav-root .ln-paire a { padding: 0 .95rem !important; font-size: .88rem !important; border: 1px solid var(--a-ligne) !important; }
html.ln-site #lbma-nav-root .ln-paire a[aria-current="page"] { border-color: var(--a-encre) !important; }
html.lbma-theme .badge-special { background: transparent !important; color: var(--a-gris) !important; font-size: .7rem !important; padding: 0 !important; text-align: right; }
html.lbma-theme .a-res .s { text-decoration: none; }
@media (max-width: 820px) {
  html.lbma-theme .cal-barre { flex-direction: column; align-items: stretch !important; gap: .5rem !important; }
  html.lbma-theme .cal-filtres { flex: none !important; width: 100%; }
}

/* ---------- Archives et pages « à vie » sur cellulaire ----------
   (le style mobile de la page était écrasé par sa propre règle de base : tout débordait) */
html.lbma-theme .podium-item { border-width: 1px !important; border-radius: 14px; }
html.lbma-theme .podium-value { font-stretch: 75%; font-weight: 800; }
html.lbma-theme .btn-print { border-radius: 10px !important; text-transform: none !important; border: 0 !important; }
@media (max-width: 820px) {
  html.lbma-theme .tab-content { padding: 1rem .8rem !important; border-width: 1px !important; border-radius: 0 0 14px 14px; }
  html.lbma-theme .main-tab { padding: .6rem .8rem !important; font-size: .9rem !important; border-width: 1px !important; }
  html.lbma-theme .tab-content h2 { font-size: 1.25rem !important; line-height: 1.15; }
  html.lbma-theme .tab-content h3 { font-size: 1.15rem !important; }
  html.lbma-theme .btn-print { padding: .5rem .9rem !important; font-size: .85rem !important; }
  html.lbma-theme .category-select select { width: 100%; font-size: .9rem !important; }
  html.lbma-theme .podium { grid-template-columns: repeat(3, minmax(0, 1fr)) !important; gap: .4rem !important; margin-bottom: 1.25rem !important; }
  html.lbma-theme .podium-item { padding: .65rem .3rem .55rem !important; min-width: 0 !important; }
  html.lbma-theme .podium-medal { font-size: 1.25rem !important; margin-bottom: .15rem !important; }
  html.lbma-theme .podium-rank { font-size: .75rem !important; }
  html.lbma-theme .podium-value { font-size: 1.9rem !important; margin: .1rem 0 !important; }
  html.lbma-theme .podium-name { font-size: .72rem !important; line-height: 1.2; margin-top: .2rem !important; overflow-wrap: anywhere; }
  html.lbma-theme .stats-table { font-size: .82rem !important; }
  html.lbma-theme .stats-table th, html.lbma-theme .stats-table td { padding: .45rem .4rem !important; }
  html.lbma-theme .cat-btn { padding: .45rem .75rem !important; font-size: .82rem !important; border-width: 1px !important; border-radius: 999px; }
}
html.lbma-theme :is(.tab-content, .legend, .main-tab) { border-color: var(--a-ligne) !important; }
html.lbma-theme .legend { border-width: 1px !important; border-radius: 14px; }
@media (max-width: 820px) {
  html.lbma-theme .podium { align-items: stretch !important; }
  html.lbma-theme .legend { padding: .9rem !important; font-size: .85rem; }
  html.lbma-theme .legend-items { gap: .25rem .9rem !important; }
}

/* Imprimer : inutile sur cellulaire (les joueurs consultent seulement) */
@media (max-width: 820px) {
  html.lbma-theme :is(.btn-print, .print-btn) { display: none !important; }
}
html.lbma-theme .cat-btn { color: var(--a-encre) !important; background: var(--a-surface) !important; border-color: var(--a-ligne) !important; }
html.lbma-theme .cat-btn small { color: var(--a-gris); font-size: .75em; }
html.lbma-theme .cat-btn.active { background: var(--a-encre) !important; color: #fff !important; border-color: var(--a-encre) !important; }
html.lbma-theme .cat-btn.active small { color: rgba(255,255,255,.75); }
@media (max-width: 820px) {
  html.lbma-theme .cat-btn { gap: .25rem !important; }
}

/* ---------- Pages Statistiques (frappeurs, lanceurs, séries) sur cellulaire ---------- */
html.lbma-theme .stat-nav a { border: 1px solid var(--a-ligne) !important; text-transform: none !important; }
html.lbma-theme .stat-nav a.active { background: var(--a-encre) !important; color: #fff !important; border-color: var(--a-encre) !important; }
html.lbma-theme .summary-card::before { display: none !important; }
html.lbma-theme .summary-card { border: 1px solid var(--a-ligne) !important; border-radius: 14px; }
html.lbma-theme .summary-card .value { font-stretch: 75%; font-weight: 800; }
html.lbma-theme .controls { border: 1px solid var(--a-ligne) !important; border-radius: 14px; }
html.lbma-theme .control-group select { border: 1px solid var(--a-ligne) !important; border-radius: 10px !important; background: var(--a-surface) !important; }
@media (max-width: 820px) {
  /* Onglets : une rangée compacte, 3 parts égales */
  html.lbma-theme .stat-nav { display: grid !important; grid-template-columns: repeat(3, 1fr); gap: 0 !important; margin-bottom: .75rem !important;
    background: var(--a-surface); border: 1px solid var(--a-ligne); border-radius: 12px; padding: 3px; }
  html.lbma-theme .stat-nav a { padding: .45rem .3rem !important; font-size: .78rem !important; line-height: 1.15; text-align: center;
    border: 0 !important; border-radius: 9px; background: transparent !important; }
  /* Filtres : côte à côte, petits */
  html.lbma-theme .controls { display: grid !important; grid-template-columns: repeat(auto-fit, minmax(0, 1fr)); gap: .5rem !important;
    padding: .6rem !important; margin-bottom: .75rem !important; align-items: end !important; }
  html.lbma-theme .control-group { gap: .2rem !important; min-width: 0; }
  html.lbma-theme .control-group label { font-size: .68rem !important; text-transform: none !important; color: var(--a-gris) !important; }
  html.lbma-theme .control-group select { min-width: 0 !important; width: 100% !important; height: 36px !important; padding: 0 .5rem !important; font-size: .85rem !important; }
  /* Cartes de sommaire : 4 sur une rangée, chiffres plus petits */
  html.lbma-theme .stats-summary { grid-template-columns: repeat(4, minmax(0, 1fr)) !important; gap: .4rem !important; margin-bottom: .9rem !important; }
  html.lbma-theme .summary-card { padding: .5rem .25rem !important; border-radius: 10px; }
  html.lbma-theme .summary-card .value { font-size: 1.25rem !important; line-height: 1.1; }
  html.lbma-theme .summary-card .label { font-size: .6rem !important; line-height: 1.15; text-transform: none !important; }
  html.lbma-theme .page-header h1 { font-size: 1.6rem !important; }
}
@media (max-width: 820px) {
  html.lbma-theme .controls:has(.control-group:nth-of-type(3)) { grid-template-columns: 1.15fr 1.35fr .75fr !important; }
  html.lbma-theme .controls:has(.control-group:nth-of-type(3)) select { font-size: .8rem !important; padding: 0 .35rem !important; }
}
@media (max-width: 820px) { html.lbma-theme .qualif-note { font-size: .75rem !important; margin: 0 0 .5rem !important; } }

/* Légendes des abréviations : cachées sur cellulaire (gardées sur l'ordi) */
@media (max-width: 820px) { html.lbma-theme .legend { display: none !important; } }
@media (max-width: 820px) { html.lbma-theme .stats-table .team-col { font-weight: 700; letter-spacing: .02em; } }

/* ---------- Tableaux de stats : on peut glisser les chiffres, joueur figé à gauche ----------
   (le cadre arrondi coupait le défilement horizontal) */
html.lbma-theme .table-wrapper { overflow-x: auto !important; -webkit-overflow-scrolling: touch; overscroll-behavior-x: contain; }
@media (max-width: 820px) {
  html.lbma-theme .table-wrapper { overflow-y: visible !important; }
  html.lbma-theme .stats-table { width: max-content !important; min-width: 100%; }
  /* rang + nom restent visibles pendant qu'on glisse les colonnes */
  html.lbma-theme .stats-table :is(th, td):first-child {
    position: sticky; left: 0; z-index: 2; background: var(--a-surface) !important;
    width: 2rem; min-width: 2rem; max-width: 2rem; padding-left: .35rem !important; padding-right: .2rem !important;
  }
  html.lbma-theme .stats-table :is(th, td):nth-child(2) {
    left: 2rem; max-width: 11.5rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  }
  html.lbma-theme .stats-table thead :is(th:first-child, th:nth-child(2)) { z-index: 4; }
  /* titres de groupe (« Lanceurs partants ») : texte collé à gauche, toujours lisible */
  html.lbma-theme .stats-table tr.section-header td,
  html.lbma-theme .stats-table tr.section-header td:first-child {
    position: static; width: auto; max-width: none; min-width: 0; text-align: left !important;
    background: var(--a-encre) !important; color: #fff !important;
    font-size: .85rem !important; letter-spacing: .02em !important; padding: .5rem .6rem !important;
  }
}
@media (max-width: 820px) {
  /* La bande marine reste en place : seul son texte est fixé, en petit, à gauche de l'écran */
  html.lbma-theme .stats-table tr.section-header td,
  html.lbma-theme .stats-table tr.section-header td:first-child { font-size: .72rem !important; padding: .45rem 0 !important; overflow: visible !important; }
  html.lbma-theme .stats-table .lbma-collant {
    position: sticky; left: .55rem; display: inline-block;
    max-width: calc(100vw - 3.5rem); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; vertical-align: middle;
  }
}

/* Séries : sous-onglets Frappeurs / Lanceurs / Classement, même format que les onglets du haut */
html.lbma-theme .section-tabs button { border: 1px solid var(--a-ligne) !important; text-transform: none !important; background: var(--a-surface) !important; color: var(--a-encre) !important; }
html.lbma-theme .section-tabs button.active { background: var(--a-encre) !important; color: #fff !important; border-color: var(--a-encre) !important; }
@media (max-width: 820px) {
  html.lbma-theme .section-tabs { display: grid !important; grid-template-columns: repeat(3, 1fr); gap: 0 !important; margin-bottom: .75rem !important;
    background: var(--a-surface); border: 1px solid var(--a-ligne); border-radius: 12px; padding: 3px; }
  html.lbma-theme .section-tabs button { padding: .45rem .3rem !important; font-size: .78rem !important; line-height: 1.15; border: 0 !important;
    border-radius: 9px; margin: 0 !important; background: transparent !important; }
  html.lbma-theme .section-tabs button.active { background: var(--a-encre) !important; }
}
@media (max-width: 820px) {
  html.lbma-theme .stat-nav { grid-template-columns: repeat(4, 1fr) !important; }
  html.lbma-theme .stat-nav a { font-size: .7rem !important; padding: .4rem .15rem !important; }
}

/* Onglets Stats : même rangée sur toutes les pages (frappeurs, lanceurs, classement, séries) */
html.lbma-theme .stat-nav { display: flex; gap: 0; margin-bottom: 2rem; flex-wrap: wrap; }
html.lbma-theme .stat-nav a { padding: 1rem 2.5rem; background: var(--a-surface); color: var(--a-encre); text-decoration: none; font-size: 1.05rem; margin-right: -1px; }
html.lbma-theme .stat-nav a:hover:not(.active) { background: var(--a-fond) !important; color: var(--a-encre) !important; }
html.lbma-theme .classement-hero, html.lbma-theme .year-select { margin-top: 0; }
@media (max-width: 820px) {
  /* Classement : sélecteurs « Année » et « Classement » sur une ligne chacun, compacts */
  html.lbma-theme .year-select { display: flex; align-items: center; gap: .5rem; margin-bottom: .5rem !important; text-align: left; }
  html.lbma-theme .year-select label { font-size: .85rem !important; margin: 0 !important; white-space: nowrap; color: var(--a-gris); }
  html.lbma-theme .year-select select { flex: 1; min-width: 0; height: 38px; padding: 0 .6rem !important; font-size: .9rem !important; }
  /* En-tête du tableau de classement : titre, type et champion sans se chevaucher */
  html.lbma-theme .standings-header { flex-wrap: wrap; gap: .35rem .75rem; padding: .75rem .9rem !important; }
  html.lbma-theme .standings-header h2 { font-size: 1.2rem !important; }
  html.lbma-theme .standings-header > *:not(h2):not(.champion-badge) { font-size: .7rem !important; }
  html.lbma-theme .champion-badge { font-size: .78rem !important; padding: .3rem .7rem !important; }
}

/* ---------- Fiche d'un joueur (fenêtre « vs Adversaires ») ----------
   La bande marine reste en place ; seul le tableau glisse, la date reste figée. */
html.lbma-theme .modal-box { border: 0 !important; border-radius: 16px; overflow: hidden !important; display: flex; flex-direction: column; }
html.lbma-theme .modal-header { background: var(--a-encre) !important; flex: none; position: static !important; }
html.lbma-theme .modal-body { overflow: auto; -webkit-overflow-scrolling: touch; }
html.lbma-theme .modal-table th { background: var(--a-surface) !important; color: var(--a-gris) !important; }
@media (max-width: 820px) {
  html.lbma-theme .modal-box { width: calc(100% - 1rem) !important; max-height: 88vh !important; }
  html.lbma-theme .modal-header { padding: .6rem .8rem !important; gap: .5rem; }
  html.lbma-theme .modal-header h3 { font-size: .95rem !important; line-height: 1.2; letter-spacing: 0 !important; }
  html.lbma-theme .modal-close { font-size: 1.2rem !important; flex: none; }
  html.lbma-theme .modal-body { padding: .4rem 0 .6rem !important; }
  html.lbma-theme .modal-table { width: max-content !important; min-width: 100%; font-size: .78rem !important; }
  html.lbma-theme .modal-table th, html.lbma-theme .modal-table td { padding: .4rem .45rem !important; }
  html.lbma-theme .modal-table :is(th, td):first-child { position: sticky; left: 0; z-index: 2; background: var(--a-surface) !important; box-shadow: 1px 0 0 var(--a-ligne); }
  html.lbma-theme .modal-table .total-row td:first-child { background: #F6EDCF !important; }
  html.lbma-theme .modal-table td:nth-child(2) { font-weight: 700; }
  /* tableaux de stats : rien ne dépasse à gauche des colonnes figées */
  html.lbma-theme .table-wrapper { padding: 0 !important; }
}
/* La date figée était semi-transparente (style de la page) : les chiffres passaient au travers */
html.lbma-theme .modal-table :is(th, td):first-child { opacity: 1 !important; color: var(--a-gris); }
html.lbma-theme .modal-table td:nth-child(2) { font-weight: 700; letter-spacing: .02em; }
/* iPhone : pas d'effet « élastique » quand on tire au-delà du bord (la date et les noms restent en place) */
html.lbma-theme :is(.modal-body, .table-wrapper) { overscroll-behavior-x: none !important; }

/* ---------- Pages qui gardent leur propre style (menu seul) ----------
   <nav id="lbma-nav-root" data-nav-seul> : le menu et le pied de page du site,
   sans appliquer le thème au reste de la page (cartes, pages en direct, etc.). */
html.ln-seul body { padding-top: var(--a-barre) !important; }
html.ln-seul :is(#lbma-nav-root, footer.ln-pied) { font-size: 16px; line-height: 1.5; letter-spacing: normal; text-transform: none; text-align: left; }
html.ln-seul #lbma-nav-root { color: var(--a-encre); }
html.ln-seul :is(#lbma-nav-root, footer.ln-pied) :where(*:not(svg):not(svg *)) { font-family: 'Archivo', system-ui, sans-serif !important; box-sizing: border-box; letter-spacing: normal; text-transform: none; }
html.ln-seul :is(#lbma-nav-root, footer.ln-pied) :is(h2, strong) { font-stretch: 75%; }
html.ln-seul #lbma-nav-root .ln-sec h2 { font-stretch: 100%; }
html.ln-seul footer.ln-pied { display: block; align-self: stretch; width: auto; color: var(--a-gris); }
/* Page à fond foncé (repêchage, cartes) : pied en texte pâle, détecté par lbma-nav.js */
html.ln-seul footer.ln-pied.ln-pied-sombre { color: rgba(255,255,255,.7); }
html.ln-seul footer.ln-pied-sombre .ln-pied-int { border-top-color: rgba(255,255,255,.18); }
html.ln-seul footer.ln-pied-sombre .ln-pied-liens a { color: #fff !important; }
html.ln-seul footer.ln-pied-sombre .ln-pied-bas a { color: rgba(255,255,255,.7) !important; }
