/* Style « Clay » sombre : surfaces en pâte à modeler (reflet en haut à gauche, ombre en bas à droite),
   nuit violette, accent violet + or. Pas de backdrop-filter (coûteux sur mobile). */
:root {
  color-scheme: dark;
  --fond: #0c0a1d;
  --surface: #17142e;
  --encre: #f4f2ff;
  --texte: #d9d5f2;
  --doux: #a7a2c9;
  --bordure: rgba(255, 255, 255, 0.07);
  --accent: #8b7bff;
  --accent-texte: #c4bbff;
  --accent-doux: #241e5c;
  --or: #ffc233;
  --direct: #ff5d6c;
  --bleu: #5aa9ff;
  --rouge: #ff6b7a;
  --ok: #4ade80;

  --clay-dedans: inset 4px 6px 12px rgba(255, 255, 255, 0.06), inset -6px -8px 16px rgba(0, 0, 0, 0.4);
  --clay-dehors: 14px 18px 36px -14px rgba(0, 0, 0, 0.75), -6px -6px 20px -12px rgba(122, 98, 255, 0.25);
  --clay-creux: inset 4px 4px 10px rgba(0, 0, 0, 0.6), inset -3px -3px 8px rgba(255, 255, 255, 0.04);
  --ombre-hausse: 18px 26px 48px -16px rgba(0, 0, 0, 0.8), 0 0 0 1px rgba(122, 98, 255, 0.28);
  --coussin: linear-gradient(150deg, rgba(46, 41, 88, 0.94) 0%, rgba(25, 22, 50, 0.92) 100%);
  --pilule: linear-gradient(150deg, #2f2a5a 0%, #1e1a3e 100%);
  --pilule-on: linear-gradient(150deg, #9d8fff 0%, #6a4dff 100%);
  --creux-fond: #120f28;

  --r-champ: 14px;
  --r-carte: 22px;
  --r-grande: 28px;
  --police: ui-rounded, "SF Pro Rounded", "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
  --chiffres: ui-rounded, "SF Pro Rounded", system-ui, sans-serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  font-family: var(--police);
  font-size: 15px;
  line-height: 1.5;
  color: var(--texte);
  background-color: var(--fond);
  background-image:
    radial-gradient(900px 620px at 8% -12%, rgba(122, 98, 255, 0.28) 0%, transparent 62%),
    radial-gradient(760px 560px at 102% 8%, rgba(90, 169, 255, 0.16) 0%, transparent 60%),
    radial-gradient(720px 520px at 88% 104%, rgba(255, 194, 51, 0.10) 0%, transparent 62%),
    linear-gradient(160deg, #0f0c24 0%, #0c0a1d 50%, #0a0818 100%);
  background-attachment: fixed;
}
img { max-width: 100%; }
a { color: var(--accent-texte); text-decoration: none; }
a:hover { text-decoration: underline; }
:focus-visible { outline: 3px solid var(--or); outline-offset: 2px; border-radius: 8px; }
h1, h2, h3 { color: var(--encre); line-height: 1.2; margin: 0; }
h1 { font-size: clamp(1.4rem, 3.5vw, 1.9rem); letter-spacing: -0.01em; }
h2 { font-size: 1.15rem; }
h3 { font-size: 1rem; }
.num { font-variant-numeric: tabular-nums; font-family: var(--chiffres); }
.muted { color: var(--doux); }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: -999px; top: 8px; z-index: 50; background: var(--or); color: #111; padding: 8px 14px; border-radius: 999px; }
.skip:focus { left: 12px; }

/* ---------- En-tête ---------- */
.top {
  position: sticky; top: 0; z-index: 20;
  background: rgba(12, 10, 29, 0.94);
  border-bottom: 1px solid var(--bordure);
  box-shadow: 0 10px 28px -12px rgba(0, 0, 0, 0.7);
}
.top-in { max-width: 1180px; margin: 0 auto; padding: 10px 16px; display: flex; align-items: center; gap: 16px; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--encre); font-weight: 800; flex-shrink: 0; }
.brand:hover { text-decoration: none; }
.brand-mark {
  width: 38px; height: 38px; border-radius: 13px; display: grid; place-items: center;
  background: var(--pilule-on); color: #fff; font-size: 1.15rem;
  box-shadow: var(--clay-dedans), 0 10px 22px -8px rgba(106, 77, 255, 0.7);
}
.brand-txt { display: flex; flex-direction: column; line-height: 1.05; font-size: 1rem; }
.brand-txt small { font-weight: 600; color: var(--doux); font-size: 0.72rem; }
.tabs {
  display: flex; gap: 6px; padding: 5px; margin-left: auto; overflow-x: auto; scrollbar-width: none;
  border-radius: 999px; background: var(--creux-fond); box-shadow: var(--clay-creux);
}
.tabs::-webkit-scrollbar { display: none; }
.tabs a {
  padding: 8px 16px; border-radius: 999px; color: var(--doux); font-weight: 700; white-space: nowrap; font-size: 0.92rem;
}
.tabs a:hover { color: var(--encre); text-decoration: none; }
.tabs a[aria-current="page"] { background: var(--pilule-on); color: #fff; box-shadow: var(--clay-dedans), 0 8px 18px -8px rgba(106, 77, 255, 0.8); }
@media (max-width: 620px) {
  .top-in { flex-wrap: wrap; gap: 8px; padding: 8px 12px 10px; }
  .tabs { margin-left: 0; width: 100%; justify-content: space-between; }
  .tabs a { padding: 8px 10px; flex: 1 1 auto; text-align: center; font-size: 0.82rem; }
  .controls, .controls > .field, .controls select, .controls input { width: 100%; }
  .seg { width: 100%; flex-wrap: nowrap; }
  .seg button { flex: 1 1 0; min-width: 0; padding: 8px 4px; font-size: 0.8rem; }
  .versus .side .logo { width: 32px; height: 32px; }
  .side .tn b { font-size: 0.9rem; }
  .big-score { flex-wrap: nowrap; gap: 10px; }
  .big-score .side { flex: 1 1 0; min-width: 0; }
  .big-score .side .tn b { white-space: normal; }
  .big-score .logo.lg { width: 56px; height: 56px; }
  .big-score .score { font-size: 1.35rem; padding: 8px 12px; min-width: 0; }
  .hero { padding: 16px; }
}

/* ---------- Bandeau « données non à jour » ---------- */
.stale {
  max-width: 1180px; margin: 14px auto 0; padding: 10px 16px; border-radius: 18px; width: calc(100% - 32px);
  background: linear-gradient(150deg, #3a2f12 0%, #2a210b 100%); color: #ffe4a0; font-weight: 600; font-size: 0.9rem;
  box-shadow: var(--clay-dedans), var(--clay-dehors);
}

/* ---------- Mise en page ---------- */
main:focus-visible { outline: none; }
main { flex: 1; width: 100%; max-width: 1180px; margin: 0 auto; padding: 22px 16px 40px; outline: none; }
.page-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 12px 20px; margin-bottom: 18px; }
.page-head p { margin: 4px 0 0; color: var(--doux); }
.stack > * + * { margin-top: 14px; }
.section-title { display: flex; align-items: center; gap: 10px; margin: 26px 0 12px; }
.section-title .count { color: var(--doux); font-weight: 600; font-size: 0.9rem; }
.foot { max-width: 1180px; margin: 0 auto; padding: 18px 16px 30px; color: var(--doux); font-size: 0.8rem; text-align: center; }
.foot p { margin: 4px 0; }
.back { display: inline-flex; align-items: center; gap: 6px; margin-bottom: 12px; font-weight: 700; }

/* ---------- Matière clay ---------- */
.card {
  background: var(--coussin);
  border: 1px solid var(--bordure);
  border-radius: var(--r-carte);
  box-shadow: var(--clay-dedans), var(--clay-dehors);
  padding: 16px;
}
a.card { display: block; color: inherit; transition: transform .18s ease, box-shadow .18s ease; }
a.card:hover { text-decoration: none; transform: translateY(-3px); box-shadow: var(--clay-dedans), var(--ombre-hausse); }
.msg { text-align: center; padding: 34px 20px; color: var(--doux); }
.msg strong { display: block; color: var(--encre); font-size: 1.05rem; margin-bottom: 4px; }
.msg.err strong { color: var(--rouge); }

/* ---------- Contrôles ---------- */
.controls { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; min-width: 0; max-width: 100%; }
.field { min-width: 0; }
select { text-overflow: ellipsis; }
.field { display: flex; flex-direction: column; gap: 4px; font-size: 0.78rem; font-weight: 700; color: var(--doux); }
select, input[type="search"] {
  font: inherit; font-size: 0.95rem; color: var(--encre);
  background: var(--creux-fond); border: 1px solid var(--bordure); border-radius: var(--r-champ);
  padding: 10px 14px; min-height: 44px; box-shadow: var(--clay-creux); max-width: 100%;
}
select { padding-right: 36px; appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--doux) 50%), linear-gradient(135deg, var(--doux) 50%, transparent 50%); background-position: calc(100% - 18px) 52%, calc(100% - 13px) 52%; background-size: 5px 5px; background-repeat: no-repeat; }
input[type="search"] { min-width: min(320px, 100%); }
select:focus, input:focus { outline: none; border-color: var(--accent); box-shadow: var(--clay-creux), 0 0 0 4px rgba(169, 155, 255, 0.25); }
.seg { display: inline-flex; gap: 4px; padding: 4px; border-radius: 999px; background: var(--creux-fond); box-shadow: var(--clay-creux); flex-wrap: wrap; }
.seg button, .btn {
  font: inherit; font-weight: 700; font-size: 0.88rem; cursor: pointer; border: 0; color: var(--doux);
  background: transparent; border-radius: 999px; padding: 8px 14px; min-height: 38px;
}
.seg button[aria-pressed="true"] { background: var(--pilule-on); color: #fff; box-shadow: var(--clay-dedans), 0 8px 18px -8px rgba(106, 77, 255, 0.8); }
.seg button:hover:not([aria-pressed="true"]) { color: var(--encre); }
.btn { background: var(--pilule); color: var(--encre); box-shadow: var(--clay-dedans), var(--clay-dehors); padding: 10px 20px; }
.btn:hover { transform: translateY(-1px); }
.btn[disabled] { opacity: .6; cursor: progress; }
.center { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; margin-top: 18px; }

/* ---------- Badges ---------- */
.badge { display: inline-flex; align-items: center; gap: 6px; font-size: 0.72rem; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; padding: 4px 10px; border-radius: 999px; background: var(--accent-doux); color: var(--accent-texte); white-space: nowrap; }
.badge.live { background: linear-gradient(150deg, #ff7a86 0%, #e3344a 100%); color: #fff; box-shadow: 0 6px 16px -6px rgba(255, 93, 108, 0.8); }
.badge.live::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: #fff; animation: pulse 1.4s ease-in-out infinite; }
.badge.done { background: rgba(255, 255, 255, 0.06); color: var(--doux); }
.badge.soon { background: rgba(255, 194, 51, 0.14); color: var(--or); }
@keyframes pulse { 50% { opacity: .25; } }
@media (prefers-reduced-motion: reduce) { .badge.live::before { animation: none; } a.card, .btn { transition: none; } }

/* ---------- Logos / avatars ---------- */
.logo { width: 40px; height: 40px; object-fit: contain; flex-shrink: 0; filter: drop-shadow(0 4px 6px rgba(0,0,0,.5)); }
.logo.sm { width: 26px; height: 26px; }
.logo.lg { width: 84px; height: 84px; }
.logo-ph { display: grid; place-items: center; border-radius: 12px; background: var(--pilule); color: var(--doux); font-weight: 800; font-size: 0.7rem; box-shadow: var(--clay-dedans); }
.avatar { width: 64px; height: 64px; border-radius: 20px; object-fit: cover; object-position: top; background: var(--creux-fond); box-shadow: var(--clay-creux); flex-shrink: 0; }
.avatar.ph { display: grid; place-items: center; font-weight: 800; color: var(--accent-texte); font-size: 1.3rem; }
.avatar.xl { width: 120px; height: 120px; border-radius: 30px; }

/* ---------- Matchs ---------- */
.day { margin: 22px 0 10px; color: var(--doux); font-size: 0.85rem; font-weight: 800; letter-spacing: .02em; }
.day::first-letter { text-transform: uppercase; }
.matches { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 440px), 1fr)); }
.match { display: grid; gap: 10px; }
.match-meta { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 0.8rem; color: var(--doux); }
.match-meta .when { font-weight: 800; color: var(--encre); }
.match-meta .lg { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.versus { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 10px; }
.side { display: flex; align-items: center; gap: 10px; min-width: 0; }
.side.right { flex-direction: row-reverse; text-align: right; }
.side .tn { min-width: 0; }
.side .tn b { display: block; color: var(--encre); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.side .tn span { font-size: 0.78rem; color: var(--doux); }
.side.loser { opacity: .55; }
.score {
  display: flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 14px; background: var(--creux-fond); box-shadow: var(--clay-creux);
  font-weight: 900; font-size: 1.15rem; color: var(--encre); min-width: 64px; justify-content: center;
}
.score .w { color: var(--or); }
.score.vs { font-size: 0.8rem; color: var(--doux); font-weight: 800; }

/* ---------- Tableaux ---------- */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; margin: 0 -4px; padding: 0 4px; }
table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 0.9rem; }
th { text-align: left; font-size: 0.72rem; text-transform: uppercase; letter-spacing: .05em; color: var(--doux); font-weight: 800; padding: 8px 10px; white-space: nowrap; }
td { padding: 9px 10px; border-top: 1px solid var(--bordure); vertical-align: middle; white-space: nowrap; }
td.r, th.r { text-align: right; }
tr.hl td { background: rgba(139, 123, 255, 0.08); }
.team-cell { display: flex; align-items: center; gap: 10px; color: var(--encre); font-weight: 700; }
.rank { display: inline-grid; place-items: center; width: 30px; height: 30px; border-radius: 10px; background: var(--pilule); font-weight: 900; color: var(--encre); box-shadow: var(--clay-dedans); }
.rank.top { background: linear-gradient(150deg, #ffd56b 0%, #e5a300 100%); color: #2a1d00; }

/* ---------- Grilles ---------- */
.grid { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 230px), 1fr)); }
a.card.tile, .tile { display: flex; align-items: center; gap: 12px; }
.tile .t { min-width: 0; }
.tile b { display: block; color: var(--encre); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tile span { font-size: 0.8rem; color: var(--doux); }

/* ---------- En-têtes de fiche ---------- */
.hero { display: flex; flex-wrap: wrap; align-items: center; gap: 18px; padding: 22px; border-radius: var(--r-grande); }
.hero .meta { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.hero .sub { color: var(--doux); margin-top: 2px; }

/* ---------- Stats ---------- */
.kpis { display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 140px), 1fr)); }
.kpi { padding: 14px; border-radius: 18px; background: var(--creux-fond); box-shadow: var(--clay-creux); }
.kpi span { display: block; font-size: 0.72rem; font-weight: 800; text-transform: uppercase; letter-spacing: .05em; color: var(--doux); }
.kpi b { font-size: 1.35rem; color: var(--encre); font-family: var(--chiffres); font-variant-numeric: tabular-nums; }
.kpi b.na { font-size: 0.95rem; color: var(--doux); font-weight: 600; }
.note { font-size: 0.82rem; color: var(--doux); margin: 10px 0 0; }
.champ { display: flex; align-items: center; gap: 8px; }
.champ img { width: 30px; height: 30px; border-radius: 9px; box-shadow: var(--clay-dedans); }
.items { display: flex; gap: 3px; }
.items img { width: 22px; height: 22px; border-radius: 6px; }
.sidebar-blue { border-left: 4px solid var(--bleu); }
.sidebar-red { border-left: 4px solid var(--rouge); }
.side-tag { font-size: 0.72rem; font-weight: 800; text-transform: uppercase; letter-spacing: .05em; padding: 3px 9px; border-radius: 999px; }
.side-tag.blue { background: rgba(90, 169, 255, 0.15); color: var(--bleu); }
.side-tag.red { background: rgba(255, 107, 122, 0.15); color: var(--rouge); }
.team-sum { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 0.86rem; color: var(--doux); margin: 8px 0 4px; }
.team-sum b { color: var(--encre); }
.game-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; }
.big-score { display: flex; align-items: center; justify-content: center; gap: 18px; flex-wrap: wrap; }
.big-score .side { flex-direction: column; text-align: center; gap: 6px; }
.big-score .side.right { flex-direction: column; text-align: center; }
.big-score .score { font-size: 1.8rem; padding: 10px 20px; }

/* ---------- Squelettes de chargement ---------- */
.skel { position: relative; overflow: hidden; border-radius: var(--r-carte); background: var(--surface); min-height: 96px; box-shadow: var(--clay-dedans); }
.skel::after { content: ""; position: absolute; inset: 0; transform: translateX(-100%); background: linear-gradient(90deg, transparent, rgba(255,255,255,.05), transparent); animation: shimmer 1.3s infinite; }
@keyframes shimmer { to { transform: translateX(100%); } }
@media (prefers-reduced-motion: reduce) { .skel::after { animation: none; } }
.loading-txt { color: var(--doux); font-size: 0.85rem; margin-bottom: 10px; }

/* ---------- Utilitaires (pas d'attribut style : la CSP les bloque) ---------- */
.w100 { width: 100%; }
.mt { margin-top: 14px; }
.mb { margin-bottom: 8px; }
.small { font-size: 0.75rem; }
.block { display: block; }
