:root {
  --red: #c41a27;
  --blue: #1f325c;
  --accent: #1f325c;        /* bleu IHCB : boutons, accents */
  --accent-deep: #142140;
  --accent-2: #c41a27;      /* rouge IHCB */
  --live: #c41a27;
  --bg: #f8f7ef;            /* fond crème */
  --panel: #ffffff;
  --panel-2: #f6f5ec;
  --ink: #f8f7ef;           /* fonds de champs / cases de score */
  --line: #e8e6da;
  --text: #1c1c1c;
  --muted: #7a7a72;
  --ok: #1f9d5a;
  --gold: #b8860b;
  --radius: 24px;
  --shadow: 0 10px 30px rgba(31, 50, 92, .06);
  --font-head: 'Plus Jakarta Sans', system-ui, sans-serif;
  --font-body: 'Plus Jakarta Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--bg); color: var(--text); font-family: var(--font-body); font-size: 15px; line-height: 1.45; min-height: 100vh; -webkit-font-smoothing: antialiased; }
a { color: inherit; }
.wrap { max-width: 1160px; margin: 0 auto; padding: 0 16px; }
.num { font-variant-numeric: tabular-nums; }
h1, h2, h3 { font-family: var(--font-head); margin: 0; letter-spacing: -.01em; }
.kicker { font-size: 12px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; }

/* ---------- Hero ---------- */
.hero { padding: 34px 0 10px; }
.hero .wrap { display: flex; align-items: center; gap: 22px; }
.hero img.logo { width: 104px; height: 104px; object-fit: contain; flex: none; }
.hero .kicker { color: var(--red); }
.hero h1 { font-size: clamp(32px, 5.4vw, 54px); line-height: 1.02; font-weight: 800; color: var(--blue); margin-top: 4px; }
.hero .meta { color: var(--muted); margin-top: 8px; display: flex; gap: 10px; flex-wrap: wrap; font-weight: 500; text-transform: uppercase; letter-spacing: .06em; font-size: 13px; }
.hero .meta span + span::before { content: '·'; margin-right: 10px; }
.conn { margin-left: auto; align-self: flex-start; display: inline-flex; align-items: center; gap: 8px; font-size: 12px; font-weight: 600; color: var(--muted); background: var(--panel); border: 1px solid var(--line); padding: 7px 12px; border-radius: 999px; white-space: nowrap; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: #c9c7bb; }
.conn.on .dot { background: var(--ok); animation: pulse 2s infinite; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(31,157,90,.5);} 70% { box-shadow: 0 0 0 8px rgba(31,157,90,0);} 100% { box-shadow: 0 0 0 0 rgba(31,157,90,0);} }
@keyframes pulseRed { 0% { box-shadow: 0 0 0 0 rgba(196,26,39,.55);} 70% { box-shadow: 0 0 0 9px rgba(196,26,39,0);} 100% { box-shadow: 0 0 0 0 rgba(196,26,39,0);} }

/* ---------- Navigation en pilule ---------- */
.tabs { position: sticky; top: 0; z-index: 10; padding: 12px 0; background: rgba(248,247,239,.92); backdrop-filter: blur(10px); }
.tabs .wrap { display: flex; justify-content: center; }
.pillbar { display: inline-flex; gap: 2px; padding: 5px; background: var(--panel); border: 1px solid var(--line); border-radius: 999px; overflow-x: auto; scrollbar-width: none; max-width: 100%; }
.tabs a { padding: 9px 18px; border-radius: 999px; text-decoration: none; font-weight: 600; font-size: 15px; color: var(--text); white-space: nowrap; }
.tabs a:hover { background: var(--panel-2); }
.tabs a.active { background: var(--blue); color: #fff; }

section { padding: 30px 0 6px; scroll-margin-top: 80px; }
.sec-title { display: flex; flex-wrap: wrap; align-items: baseline; gap: 10px; margin-bottom: 16px; }
.sec-title .idx { font-weight: 800; font-size: 26px; color: var(--red); }
.sec-title h2 { font-size: 26px; font-weight: 800; color: var(--blue); }
.sec-title .hint { color: var(--muted); font-size: 13px; }

/* ---------- Cartes "En direct" ---------- */
.spot { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr)); gap: 18px; }
.spot-card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 26px 22px 22px; text-align: center; box-shadow: var(--shadow); display: flex; flex-direction: column; align-items: center; }
.spot-card.live { border-color: rgba(196,26,39,.45); box-shadow: 0 10px 30px rgba(196,26,39,.10); }
.spot-card .tag { font-size: 12px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); display: inline-flex; align-items: center; gap: 8px; }
.spot-card.live .tag { color: var(--red); }
.spot-card .when { font-size: 24px; font-weight: 800; margin-top: 8px; color: var(--text); }
.spot-card .where { font-size: 12px; color: var(--muted); letter-spacing: .08em; text-transform: uppercase; margin-top: 4px; }
.spot-card .face { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 12px; margin-top: 20px; width: 100%; }
.spot-card .tm { font-weight: 800; font-size: 14px; text-transform: uppercase; letter-spacing: .02em; line-height: 1.25; overflow-wrap: break-word; min-width: 0; }
.spot-card .tm.l { color: var(--muted); }
.sq { display: flex; gap: 6px; }
.sq span { display: grid; place-items: center; min-width: 46px; height: 52px; padding: 0 8px; border-radius: 12px; background: var(--ink); font-weight: 800; font-size: 26px; color: var(--text); }
.sq span.l { color: #a09f96; }
.sq span.e { color: #c9c7bb; font-size: 18px; }
.chip-res { margin-top: 18px; display: inline-block; padding: 9px 16px; border-radius: 999px; background: var(--ink); color: var(--blue); font-weight: 700; font-size: 13px; letter-spacing: .06em; text-transform: uppercase; }
.chip-res.live { color: var(--red); }
.live-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--live); animation: pulseRed 1.6s infinite; display: inline-block; }

.champion { margin-top: 18px; background: var(--blue); color: #fff; border-radius: var(--radius); padding: 22px 26px; display: flex; align-items: center; gap: 18px; box-shadow: var(--shadow); }
.champion .cup { font-size: 42px; }
.champion .k { color: #ffd6d9; font-size: 12px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; }
.champion .n { font-size: 32px; font-weight: 800; }

/* Chiffres clés */
.stats { display: grid; grid-template-columns: repeat(4, 1fr); margin-top: 18px; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.stat { padding: 18px 20px; border-right: 1px solid var(--line); text-align: center; }
.stat:last-child { border-right: none; }
.stat .v { font-weight: 800; font-size: 32px; line-height: 1; color: var(--blue); }
.stat .v small { color: var(--muted); font-size: 18px; }
.stat .l { color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: .1em; font-weight: 700; margin-top: 8px; }

/* ---------- Classements ---------- */
.groups { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 460px), 1fr)); gap: 18px; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
.card-h { display: flex; justify-content: space-between; align-items: center; padding: 18px 20px 12px; }
.card-h h3 { font-size: 20px; font-weight: 800; color: var(--blue); }
.pill { font-size: 11px; text-transform: uppercase; letter-spacing: .08em; padding: 6px 11px; border-radius: 999px; background: var(--ink); color: var(--muted); font-weight: 700; }
.pill.ok { color: var(--ok); }
.pill.red { color: var(--red); }
table.std { width: 100%; border-collapse: collapse; }
.std th { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 700; padding: 8px 6px; text-align: center; border-bottom: 1px solid var(--line); }
.std th:nth-child(2) { text-align: left; }
.std td { padding: 12px 6px; text-align: center; border-bottom: 1px solid var(--line); font-variant-numeric: tabular-nums; }
.std td.team { text-align: left; font-weight: 700; }
.std tr:last-child td { border-bottom: none; }
.std td.pts { font-size: 18px; font-weight: 800; color: var(--blue); }
.std .rk { width: 44px; padding-left: 16px; }
.rk span { display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 8px; background: var(--ink); font-weight: 800; font-size: 13px; }
.std tr.q1 .rk span { background: var(--red); color: #fff; }
.std tr.q2 .rk span { background: var(--blue); color: #fff; }
.std tr.q3 .rk span { background: #dfe3ec; color: var(--blue); }
.legend { font-size: 12px; color: var(--muted); display: flex; gap: 14px; flex-wrap: wrap; }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }

/* ---------- Programme ---------- */
.filters { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; align-items: center; }
.chip { border: 1px solid var(--line); background: var(--panel); color: var(--text); padding: 8px 15px; border-radius: 999px; cursor: pointer; font: inherit; font-size: 14px; font-weight: 600; }
.chip.active { background: var(--blue); border-color: var(--blue); color: #fff; }
.matches { display: grid; gap: 10px; }
.m { display: grid; grid-template-columns: 76px 1fr auto 1fr 108px; align-items: center; gap: 14px; background: var(--panel); border: 1px solid var(--line); border-radius: 18px; padding: 14px 18px; }
.m.live { border-color: rgba(196,26,39,.5); box-shadow: 0 6px 20px rgba(196,26,39,.08); }
.m.cancelled { opacity: .5; }
.m.cancelled .t { text-decoration: line-through; }
.m .when { font-weight: 800; font-size: 18px; line-height: 1; color: var(--blue); }
.m .when small { display: block; color: var(--muted); font-size: 11px; font-weight: 600; margin-top: 5px; text-transform: uppercase; letter-spacing: .06em; }
.m .t { font-weight: 700; }
.m .t.h { text-align: right; }
.m .t.lose { color: var(--muted); font-weight: 600; }
.m .t .src { display: block; font-size: 11px; color: var(--muted); font-weight: 500; }
.m .t .tbd { color: var(--muted); font-style: italic; font-weight: 500; }
.m .t .prov { font-style: italic; }
.score { font-weight: 800; font-size: 22px; min-width: 88px; text-align: center; background: var(--ink); border-radius: 12px; padding: 6px 12px; letter-spacing: .02em; }
.score.empty { color: #a09f96; font-size: 14px; font-weight: 600; padding: 10px 12px; }
.score .pen { display: block; font-size: 10px; font-weight: 700; color: var(--red); letter-spacing: .04em; text-transform: uppercase; margin-top: 1px; }
.m .ph { text-align: right; }
.badge { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; padding: 6px 10px; border-radius: 999px; background: var(--ink); color: var(--muted); white-space: nowrap; }
.badge.ko { color: var(--blue); background: #e9edf5; }
.badge.fin { color: #fff; background: var(--blue); }
.badge.live { background: var(--red); color: #fff; animation: pulseRed 1.6s infinite; }
.note { grid-column: 2 / -1; font-size: 12px; color: var(--red); }

/* ---------- Phase finale ---------- */
.bracket { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(230px, 1fr); gap: 18px; overflow-x: auto; padding-bottom: 10px; }
.round h3 { font-size: 12px; color: var(--muted); margin-bottom: 10px; letter-spacing: .1em; text-transform: uppercase; font-weight: 700; }
.round .col { display: flex; flex-direction: column; justify-content: space-around; gap: 14px; height: calc(100% - 28px); }
.bm { background: var(--panel); border: 1px solid var(--line); border-radius: 16px; overflow: hidden; box-shadow: var(--shadow); }
.bm.live { border-color: rgba(196,26,39,.5); }
.bm.final-match { border: 2px solid var(--blue); }
.bm .bh { display: flex; justify-content: space-between; font-size: 11px; color: var(--muted); padding: 8px 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; border-bottom: 1px solid var(--line); }
.bm .row { display: flex; justify-content: space-between; align-items: center; padding: 9px 12px; gap: 8px; }
.bm .row + .row { border-top: 1px solid var(--line); }
.bm .row .n { font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bm .row .n .src { color: var(--muted); font-weight: 500; font-size: 13px; }
.bm .row .s { font-weight: 800; font-size: 18px; min-width: 22px; text-align: right; }
.bm .row.win { background: #eef1f7; }
.bm .row.win .n { color: var(--blue); }
.bm .row.win .n::after { content: ' ✓'; color: var(--red); }
.bm .row.lose .n, .bm .row.lose .s { color: var(--muted); font-weight: 600; }

/* ---------- Règlement ---------- */
.rules { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 12px; }
.rule { background: var(--panel); border: 1px solid var(--line); border-radius: 18px; padding: 16px 18px 16px 22px; position: relative; }
.rule::before { content: ''; position: absolute; left: 0; top: 18px; bottom: 18px; width: 4px; border-radius: 0 4px 4px 0; background: var(--red); }

footer { color: var(--muted); font-size: 12px; text-align: center; padding: 40px 16px 44px; }
footer a { color: var(--muted); }
footer .slogan { font-weight: 800; font-size: 18px; letter-spacing: .14em; color: var(--blue); margin-bottom: 6px; }
footer .slogan b { color: var(--red); }

.flash { animation: flash 1.4s ease-out; }
@keyframes flash { 0% { background: #fde7e9; } 100% { background: var(--panel); } }

@media (max-width: 680px) {
  .hero { padding-top: 22px; }
  .hero .wrap { gap: 14px; position: relative; }
  .hero img.logo { width: 72px; height: 72px; }
  .hero .meta { font-size: 11px; gap: 8px; }
  .hero .meta span + span::before { margin-right: 8px; }
  .conn { position: absolute; top: -14px; right: 16px; }
  .tabs a { padding: 8px 13px; font-size: 14px; }
  .tabs .wrap { justify-content: flex-start; }
  .m { grid-template-columns: 1fr auto 1fr; gap: 8px 10px; padding: 12px 14px; }
  .m .when { grid-column: 1 / -1; grid-row: 1; justify-self: start; display: flex; align-items: center; gap: 8px; font-size: 15px; }
  .m .when small { margin: 0; }
  .m .ph { grid-column: 1 / -1; grid-row: 1; justify-self: end; }
  .score { min-width: 70px; font-size: 19px; }
  .std .hide-sm { display: none; }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .stat:nth-child(2) { border-right: none; }
  .stat:nth-child(-n+2) { border-bottom: 1px solid var(--line); }
  .stat .v { font-size: 26px; }
  .sq span { min-width: 40px; height: 46px; font-size: 22px; }
}

body.tv { font-size: 17px; }
body.tv .tabs, body.tv footer { display: none; }
