/* Classement des jeux par équipes — charte graphique LBCVL (Roboto, bleu #1864af) */
:root {
  --primary: #1864af;
  --primary-dark: #124a82;
  --primary-darker: #0e3863;
  --primary-hover: #2d92cb;
  --accent: #1864af;          /* couleur de la discipline de l'onglet actif */
  --red: #e10a19;
  --green: #2e9e5b;
  --text: #333;
  --muted: #909090;
  --bg: #f5f7fa;
  --card: #fff;
  --border: #e5e5e5;
  --sep: #efefef;
  --head: #f0f4f9;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: 'Roboto', sans-serif; font-size: 15px; line-height: 1.45; color: var(--text); background: var(--bg); }
a { color: var(--primary); text-decoration: none; }
a:hover { color: var(--primary-hover); }
button { font-family: inherit; }
[hidden] { display: none !important; }

/* ---------- En-tête ---------- */
.banner-wrap { background: #fff; text-align: center; }
.banner { display: block; max-width: 100%; height: auto; margin: 0 auto; }
.site-header { background: #fff; border-bottom: 4px solid var(--primary); position: sticky; top: 0; z-index: 5; box-shadow: 0 2px 6px rgba(0,0,0,.04); }
.header-inner { max-width: 1300px; margin: 0 auto; padding: 12px 20px 6px; }
.header-inner h1 { margin: 0; font-size: 24px; line-height: 1.2; color: #000; font-weight: 700; }
.subtitle { margin: 3px 0 0; color: var(--muted); font-size: 14px; }

.onglets { max-width: 1300px; margin: 0 auto; padding: 6px 20px 0; display: flex; gap: 4px; overflow-x: auto; scrollbar-width: thin; }
.onglets button {
  flex: 0 0 auto; border: 1px solid #d6e2ef; border-bottom: 0; background: #f7f9fc; color: var(--primary-darker);
  padding: 9px 14px 8px; font-size: 14px; font-weight: 500; cursor: pointer; border-radius: 6px 6px 0 0;
  border-top: 3px solid var(--c, var(--primary)); transition: background .15s;
}
.onglets button:hover { background: #eef5fc; }
.onglets button.active { background: var(--primary); color: #fff; border-color: var(--primary); border-top-color: var(--c, var(--primary)); }
.onglets button .pastille { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--c); margin-right: 6px; vertical-align: 1px; }
.onglets button.active .pastille { box-shadow: 0 0 0 2px #fff; }

/* ---------- Contenu ---------- */
main { max-width: 1300px; margin: 0 auto; padding: 20px; }
.chargement { color: var(--muted); padding: 40px 0; text-align: center; }
.alert { background: #fde4e6; color: #a5070f; border: 1px solid #f5b5ba; border-radius: 6px; padding: 10px 14px; margin-bottom: 16px; font-size: 14px; }
.alert.info { background: #e3effa; color: var(--primary-darker); border-color: #b9cde3; }

.entete-comp { display: flex; align-items: flex-end; gap: 16px; flex-wrap: wrap; margin-bottom: 18px; padding-bottom: 12px; border-bottom: 2px solid var(--sep); }
.entete-comp h2 { margin: 0; font-size: 26px; color: #000; font-weight: 700; line-height: 1.15; }
.entete-comp h2::before { content: ''; display: inline-block; width: 6px; height: 22px; background: var(--accent); border-radius: 3px; margin-right: 10px; vertical-align: -2px; }
.entete-comp .meta { color: var(--muted); font-size: 13px; margin-top: 4px; }
.entete-comp .actions { margin-left: auto; display: flex; gap: 8px; align-items: center; }
.btn { border: 1px solid var(--primary-darker); background: var(--primary); color: #fff; padding: 7px 14px; border-radius: 4px; cursor: pointer; font-size: 14px; font-weight: 500; white-space: nowrap; }
.btn:hover { background: var(--primary-dark); }
.btn:disabled { opacity: .55; cursor: default; }
.btn.ghost { background: #fff; color: var(--primary); border-color: #b9cde3; }
.btn.ghost:hover { background: #eef5fc; }

/* Résumé (prochaine journée, nombres) */
.resume { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 12px; margin-bottom: 20px; }
.resume .tuile { background: #fff; border: 1px solid var(--border); border-radius: 6px; padding: 12px 14px; }
.resume .tuile .v { font-size: 22px; font-weight: 700; color: #000; line-height: 1.2; }
.resume .tuile .l { font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; font-weight: 500; }

/* Phase */
.phase { margin-bottom: 28px; }
.phase > h3 { margin: 0 0 4px; font-size: 19px; color: var(--primary-darker); font-weight: 700; }
.phase > .meta { color: var(--muted); font-size: 13px; margin-bottom: 12px; }
.vide { background: #fff; border: 1px dashed #cfd8e3; border-radius: 6px; padding: 18px; color: #777; text-align: center; font-size: 14px; }

.poules { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 560px), 1fr)); gap: 18px; }
.poule { background: var(--card); border: 1px solid var(--border); border-radius: 8px; overflow: hidden; }
.poule-tete { padding: 12px 16px; border-bottom: 1px solid var(--sep); border-left: 5px solid var(--accent); }
.poule-tete h4 { margin: 0; font-size: 17px; color: #000; }
.poule-tete .infos { font-size: 13px; color: #777; margin-top: 3px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.chip { background: #eef3f9; color: var(--primary-darker); border-radius: 12px; padding: 2px 10px; font-size: 12px; font-weight: 500; }
.poule-corps { padding: 12px 16px 16px; }
.poule-corps h5 { margin: 16px 0 8px; font-size: 13px; text-transform: uppercase; letter-spacing: .05em; color: var(--primary); font-weight: 700; }
.poule-corps h5:first-child { margin-top: 2px; }
.poule-corps h5 .nb { color: var(--muted); font-weight: 500; }

/* Tableaux */
.tableau-wrap { overflow-x: auto; }
table.clt { width: 100%; border-collapse: collapse; font-size: 14px; }
table.clt th { background: var(--head); color: var(--primary-darker); font-weight: 500; padding: 6px 8px; border-bottom: 2px solid #d6e2ef; text-align: right; white-space: nowrap; font-size: 13px; }
table.clt td { padding: 7px 8px; border-bottom: 1px solid var(--sep); text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
table.clt th.g, table.clt td.g { text-align: left; }
table.clt th.c, table.clt td.c { text-align: center; }
table.clt td.eq { font-weight: 700; color: #000; white-space: normal; }
table.clt td.eq small { display: block; font-weight: 400; color: var(--muted); font-size: 12px; }
table.clt td.pr { font-weight: 700; color: var(--primary-darker); }
table.clt tr.r1 td.rang span { background: #f2c94c; color: #5a4500; }
table.clt tr.r2 td.rang span { background: #d5dbe2; color: #3c4650; }
table.clt tr.r3 td.rang span { background: #e3b48c; color: #5c3415; }
td.rang span { display: inline-block; min-width: 26px; height: 26px; line-height: 26px; border-radius: 13px; text-align: center; font-weight: 700; background: #eef3f9; color: var(--primary-darker); }
.legende { font-size: 12px; color: var(--muted); margin-top: 6px; }

/* Rencontres */
.journee { margin-bottom: 10px; }
.journee .date { font-size: 13px; font-weight: 700; color: #555; margin: 8px 0 4px; display: flex; align-items: center; gap: 8px; }
.journee .date .badge { font-size: 11px; font-weight: 500; padding: 1px 8px; border-radius: 10px; background: var(--accent); color: #fff; }
.rencontre { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 10px; padding: 8px 10px; border: 1px solid var(--sep); border-radius: 6px; margin-bottom: 6px; background: #fff; }
.rencontre .e1 { text-align: right; }
.rencontre .nom { font-weight: 500; color: #222; }
.rencontre .gagnant .nom { font-weight: 700; color: #000; }
.rencontre .mce { display: block; font-size: 12px; color: var(--muted); }
.score { display: flex; align-items: center; gap: 4px; font-variant-numeric: tabular-nums; }
.score b { display: inline-block; min-width: 30px; text-align: center; padding: 3px 6px; border-radius: 4px; background: #eef3f9; color: var(--primary-darker); font-size: 16px; }
.score b.g { background: var(--primary); color: #fff; }
.score i { color: #aaa; font-style: normal; }
.rencontre.avenir .score { color: #aaa; font-size: 13px; font-weight: 500; }
.rencontre.cliquable { cursor: pointer; }
.rencontre.cliquable:hover { border-color: #b9cde3; background: #fafcff; }
.rencontre .pr { font-size: 11px; color: var(--muted); display: block; text-align: center; }
.detail { grid-column: 1 / -1; margin-top: 6px; }
table.matchs { width: 100%; border-collapse: collapse; font-size: 13px; }
table.matchs th { background: var(--head); color: var(--primary-darker); font-weight: 500; padding: 4px 6px; text-align: right; white-space: nowrap; }
table.matchs td { padding: 5px 6px; border-bottom: 1px solid var(--sep); text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
table.matchs th.g, table.matchs td.g { text-align: left; }
table.matchs td.j { white-space: normal; }
table.matchs td.gagne { font-weight: 700; color: #000; }
.fleche { font-size: 11px; color: var(--muted); margin-left: 4px; }

.site-footer { max-width: 1300px; margin: 10px auto 0; padding: 18px 20px 30px; font-size: 13px; color: #555; border-top: 1px solid var(--border); }
.site-footer .muted { color: var(--muted); margin-top: 3px; }

/* ---------- Mobile ---------- */
@media (max-width: 640px) {
  .header-inner { padding: 10px 16px 4px; }
  .header-inner h1 { font-size: 20px; }
  .subtitle { font-size: 13px; }
  .onglets { padding: 4px 16px 0; }
  .onglets button { padding: 8px 11px 7px; font-size: 13px; }
  main { padding: 16px; }
  .entete-comp h2 { font-size: 21px; }
  .entete-comp .actions { margin-left: 0; }
  .poule-corps, .poule-tete { padding-left: 12px; padding-right: 12px; }
  table.clt .opt { display: none; }
  .rencontre { gap: 6px; padding: 8px; }
  .rencontre .nom { font-size: 14px; }
  .score b { min-width: 26px; font-size: 15px; }
}

/* ---------- Impression ---------- */
@media print {
  body { background: #fff; font-size: 12px; }
  .site-header { position: static; box-shadow: none; }
  .onglets, .entete-comp .actions, .banner-wrap { display: none; }
  main { padding: 0; }
  .poule { break-inside: avoid; }
  .poules { grid-template-columns: 1fr 1fr; }
}
