/* MARGE 3.0 — fiche de match (maquette validée le 2026-11-23, consigne du 2026-11-25).
   Chargée par les seules fiches /pronostic/… (classe fiche-match, voir
   api/pronostic.js). Tout est sous html.m3 : sans la coquille, la fiche garde
   sa mise en page d'avant. Les blocs m3f-* créés côté navigateur viennent de
   /m3/fiche.js et ne font que remettre en forme des chiffres déjà dans la page.

   PALETTE. Comme sur l'accueil (/m3/accueil.css), l'émeraude remplace le
   citron comme couleur d'action en thème sombre ; le thème clair prend le vert
   foncé de la coquille (#087A51, contraste vérifié). */
html.m3:not([data-theme="light"]) body.fiche-match{
  --bg:#050807; --card:rgba(255,255,255,.035); --line:rgba(52,232,163,.12); --text:#E8F2ED; --text-dim:#93A69D;
  --accent:#34E8A3; --on-accent:#03170E; --panel:#0B1411; --other:#5E7A6E; --btn-line:rgba(52,232,163,.22);
}
html.m3[data-theme="light"] body.fiche-match{--accent:#087A51; --on-accent:#FFFFFF}

/* ---- Mise en page : une colonne de lecture, la colonne latérale en bas ---- */
html.m3 .fiche-match .f-grid{display:block}
html.m3 .fiche-match .f-side{display:grid; grid-template-columns:repeat(auto-fit,minmax(260px,1fr)); gap:12px; align-items:start; margin-top:4px}
html.m3 .fiche-match .f-side .card, html.m3 .fiche-match .f-side .btn{margin:0}
html.m3 .fiche-match .card{border-radius:16px; border-color:var(--m3-line); background:linear-gradient(180deg,var(--m3-panel),var(--m3-bg-1))}
html.m3 .fiche-match .card h2{font:700 17px/1.3 var(--m3-display); letter-spacing:-.01em}

/* ---- En-tête du match ---- */
html.m3 .fiche-match .m3f-hero{display:block; padding:22px; margin-bottom:16px; border-radius:18px; border:1px solid var(--m3-line);
  background:radial-gradient(500px 200px at 50% -20%,rgba(52,232,163,.16),transparent 70%),linear-gradient(180deg,#0B1712,#07100C)}
html.m3[data-theme="light"] .fiche-match .m3f-hero{background:radial-gradient(500px 200px at 50% -20%,rgba(8,122,81,.10),transparent 70%),var(--m3-panel)}
.m3f-row{display:flex; align-items:center; justify-content:space-between; gap:10px}
.m3f-row .m3f-lg{font:600 11px/1.4 var(--m3-mono); letter-spacing:.14em; text-transform:uppercase}
html.m3 .fiche-match .m3f-row .m3f-lg a{color:var(--m3-em)}
.m3f-row .m3f-etat{margin-left:auto; padding:3px 9px; border-radius:999px; border:1px solid var(--m3-line-2); font:600 10.5px/1.4 var(--m3-mono);
  letter-spacing:.08em; text-transform:uppercase; color:var(--m3-muted); background:var(--m3-panel-2)}
html.m3 .fiche-match .m3f-row .btn[data-share]{min-height:36px; padding:6px 12px; font-size:13px}
html.m3 .fiche-match .m3f-hero .teams{grid-template-columns:minmax(0,1fr) auto minmax(0,1fr); gap:14px; margin:16px 0 6px}
html.m3 .fiche-match .m3f-hero .teams{align-items:start}
html.m3 .fiche-match .m3f-hero .ko{align-self:center}
html.m3 .fiche-match .m3f-hero .team{gap:6px}
html.m3 .fiche-match .m3f-hero .crest{width:56px; height:56px; font:700 14px var(--m3-mono); background:var(--m3-panel-2); border-color:var(--m3-line-2)}
html.m3 .fiche-match .m3f-hero .team b{font:700 20px/1.2 var(--m3-display)}
.m3f-hero .ko{display:flex; flex-direction:column; align-items:center; text-align:center; font:600 13px/1.4 var(--m3-mono); color:var(--m3-muted)}
/* « contre » reste dans le texte de la page, lu par les lecteurs d'écran. */
.m3f-hero .ko .vs{position:absolute; width:1px; height:1px; overflow:hidden; clip:rect(0 0 0 0); white-space:nowrap}
html.m3 .fiche-match .m3f-hero .ko .tag{display:flex; flex-direction:column; align-items:center; letter-spacing:0; font:600 13px/1.4 var(--m3-mono)}
html.m3 .fiche-match .m3f-hero .ko .tag b{color:var(--m3-muted); font-weight:600}
html.m3 .fiche-match .m3f-hero .ko .tag b.h{font:700 22px/1.2 var(--m3-mono); color:var(--m3-text)}
.m3f-tz{font:500 11.5px var(--m3-mono); color:var(--m3-muted)}
.m3f-st{font-size:12px; color:var(--m3-muted)}
.m3f-form{display:flex; gap:4px}
.m3f-form i{width:18px; height:18px; border-radius:5px; display:grid; place-items:center; font:700 9.5px var(--m3-mono); font-style:normal}
.m3f-form .fV{background:var(--m3-em-dim); color:var(--m3-em)}
.m3f-form .fN{background:var(--m3-panel-3); color:var(--m3-muted)}
.m3f-form .fD{background:rgba(255,107,107,.12); color:var(--m3-loss)}
html.m3 .fiche-match .m3f-hero h1{margin:6px 0 0; font:500 13px/1.4 var(--m3-sans); color:var(--m3-muted); text-align:center}
/* Onglets : dans l'en-tête, en segment, comme sur la maquette. */
html.m3 .fiche-match .m3f-hero .toc.tabs{position:static; display:flex; gap:4px; margin:16px 0 0; padding:4px; border-radius:12px;
  background:rgba(0,0,0,.25); border:1px solid var(--m3-soft); overflow-x:auto}
html.m3[data-theme="light"] .fiche-match .m3f-hero .toc.tabs{background:var(--m3-panel-2)}
html.m3 .fiche-match .m3f-hero .toc.tabs a{flex:0 0 auto; min-height:40px; margin:0; padding:0 14px; border:0; border-radius:9px;
  font:600 13px var(--m3-sans); color:var(--m3-muted)}
html.m3 .fiche-match .m3f-hero .toc.tabs a{text-decoration:none}
html.m3 .fiche-match .m3f-hero .toc.tabs a:hover{color:var(--m3-text)}
html.m3 .fiche-match .m3f-hero .toc.tabs a.on{background:var(--m3-panel-3); color:var(--m3-text); box-shadow:inset 0 -2px 0 var(--m3-em)}
html.m3 .fiche-match .m3f-hero .toc.tabs a.tab-out{color:var(--m3-muted)}

/* ---- Onglet Pronostic ---- */
html.m3 .fiche-match .card.pick{border-color:var(--m3-line-2); box-shadow:0 0 0 1px rgba(52,232,163,.08), 0 20px 60px -30px rgba(52,232,163,.35);
  background:radial-gradient(400px 160px at 0 0,rgba(52,232,163,.10),transparent 70%),linear-gradient(180deg,var(--m3-panel),var(--m3-bg-1))}
html.m3[data-theme="light"] .fiche-match .card.pick{box-shadow:none; background:var(--m3-panel)}
html.m3 .fiche-match .card.pick > h2{display:inline-block; margin-right:10px}
html.m3 .fiche-match .card.pick > .mkt{display:inline-block; vertical-align:3px; padding:3px 9px; border-radius:999px; background:var(--m3-em-dim);
  color:var(--m3-em); font:600 10.5px/1.4 var(--m3-mono); letter-spacing:.06em; text-transform:uppercase}
.m3f-sel{display:flex; align-items:center; gap:18px; margin:14px 0 4px}
.m3f-selt{flex:1; min-width:0}
.m3f-lab{display:block; font-size:12px; color:var(--m3-muted)}
html.m3 .fiche-match .m3f-selt .pick-main{font:700 26px/1.15 var(--m3-display); margin:2px 0 6px}
html.m3 .fiche-match .m3f-selt p{font-size:13px}
html.m3 .fiche-match .card.pick.m3f-ok > .bar{display:none}
.m3f-ring{position:relative; flex:0 0 auto; width:130px; height:130px}
.m3f-ring svg{width:100%; height:100%; display:block}
.m3f-ring .tr{fill:none; stroke:var(--m3-panel-3); stroke-width:10}
.m3f-ring .vl{fill:none; stroke:var(--m3-em); stroke-width:10; stroke-linecap:round; filter:drop-shadow(0 0 6px rgba(52,232,163,.45))}
.m3f-rv{position:absolute; inset:0; display:flex; flex-direction:column; align-items:center; justify-content:center}
.m3f-rv b{font:600 24px var(--m3-mono); color:var(--m3-text)}
.m3f-rv small{font-size:11.5px; color:var(--m3-muted)}
.m3f-stk-w{margin:14px 0 4px}
.m3f-stk{display:flex; gap:2px; height:34px; margin-top:6px; border-radius:10px; overflow:hidden}
.m3f-stk span{display:flex; align-items:center; min-width:0; padding:0 10px; overflow:hidden; white-space:nowrap; text-overflow:ellipsis;
  font:600 12px var(--m3-mono); color:var(--m3-text); background:#2C4A3E}
.m3f-stk .s1{background:#5E7A6E}
.m3f-stk span.top{background:var(--m3-em); color:#03170E}
html.m3[data-theme="light"] .m3f-stk span{background:#CFE3DA; color:#0B1411}
html.m3[data-theme="light"] .m3f-stk .s1{background:#E3EEE9}
html.m3[data-theme="light"] .m3f-stk span.top{background:var(--m3-em); color:#fff}
html.m3 .fiche-match .card.pick .kv{grid-template-columns:repeat(3,minmax(0,1fr)); gap:10px; margin:14px 0 6px}
html.m3 .fiche-match .card.pick .kv > div{padding:12px; border-radius:10px; background:var(--m3-panel-2); border:1px solid var(--m3-soft); min-width:0}
html.m3 .fiche-match .card.pick .kv .n{font:600 19px var(--m3-mono); margin-top:4px}
html.m3 .fiche-match .card.pick .kv > div:nth-child(2) .n{color:var(--m3-em)}
html.m3 .fiche-match .formula{background:var(--m3-panel-2); border-color:var(--m3-soft)}
/* La marge sur ce match (fiche.js, d'après le comparateur). */
.m3f-ch{display:flex; align-items:center; justify-content:space-between; gap:10px; margin-bottom:14px}
html.m3 .fiche-match .m3f-ch h2{margin:0}
.m3f-pill{padding:3px 9px; border-radius:999px; font:600 11px/1.4 var(--m3-mono); color:var(--m3-warn); background:rgba(255,184,77,.12); border:1px solid rgba(255,184,77,.25)}
.m3f-ops{display:flex; flex-direction:column; gap:12px}
.m3f-op{display:grid; grid-template-columns:minmax(64px,90px) minmax(0,1fr) 62px; gap:10px; align-items:center; font-size:13.5px}
.m3f-op > span{overflow:hidden; text-overflow:ellipsis; white-space:nowrap}
.m3f-op b{font:600 13.5px var(--m3-mono); text-align:right; color:var(--m3-text)}
.m3f-op b.em{color:var(--m3-em)} .m3f-op b.w{color:var(--m3-warn)}
.m3f-b{display:block; height:6px; border-radius:99px; background:var(--m3-panel-3); overflow:hidden}
.m3f-b > i{display:block; height:100%; border-radius:99px; background:linear-gradient(90deg,var(--m3-em-deep),var(--m3-em))}
.m3f-b.w > i{background:linear-gradient(90deg,#8a6a2a,var(--m3-warn))}
.m3f-dix{margin-top:16px; padding-top:14px; border-top:1px solid var(--m3-soft)}
.m3f-dix > div{display:flex; justify-content:space-between; gap:10px; margin-top:8px; font-size:13.5px}
.m3f-dix b{font:600 14px var(--m3-mono)} .m3f-dix b.em{color:var(--m3-em)}
html.m3 .fiche-match .m3f-marge .src{margin-top:12px; font-size:12px}
/* Nos estimations */
html.m3 .fiche-match .est > div{background:var(--m3-panel-2); border-color:var(--m3-soft)}
html.m3 .fiche-match .est .top-p{border-color:var(--m3-line-2); background:var(--m3-em-dim)}
html.m3 .fiche-match .agree .dots i.on{background:var(--m3-em); box-shadow:0 0 8px var(--m3-em-glow)}

/* ---- Analyse, Stats, Cotes ---- */
html.m3 .fiche-match .ki-line{color:#C9D8D1}
html.m3[data-theme="light"] .fiche-match .ki-line{color:var(--m3-text)}
html.m3 .fiche-match ol.kp{list-style:none; margin:0; padding:0}
html.m3 .fiche-match ol.kp li{display:flex; gap:10px; padding:9px 0; border-bottom:1px solid var(--m3-soft); color:var(--m3-text)}
html.m3 .fiche-match ol.kp li b{font:600 11px var(--m3-mono); color:var(--m3-em); padding-top:3px}
/* Les deux équipes en chiffres : barres en miroir, comme sur la maquette. */
html.m3 .fiche-match .duel{display:grid; grid-template-columns:44px minmax(0,1fr) minmax(90px,130px) minmax(0,1fr) 44px; gap:8px; align-items:center; margin:0 0 10px}
html.m3 .fiche-match .duel .t, html.m3 .fiche-match .duel .b{display:contents}
html.m3 .fiche-match .duel .t span{font:600 13px var(--m3-mono); color:var(--m3-text)}
html.m3 .fiche-match .duel .t span:first-child{grid-column:1; grid-row:1}
html.m3 .fiche-match .duel .t em{grid-column:3; grid-row:1; text-align:center; font-style:normal; font-size:11.5px; color:var(--m3-muted)}
html.m3 .fiche-match .duel .t span:last-child{grid-column:5; grid-row:1; text-align:right}
html.m3 .fiche-match .duel .b i{display:block; height:6px; border-radius:99px; grid-row:1}
html.m3 .fiche-match .duel .b i:first-child{grid-column:2; justify-self:end; background:linear-gradient(270deg,var(--m3-em),var(--m3-em-deep))}
html.m3 .fiche-match .duel .b i:last-child{grid-column:4; justify-self:start; background:linear-gradient(90deg,#2a5a7a,#7CC4FF)}
html.m3 .fiche-match i.fm{border-radius:5px; font-family:var(--m3-mono)}
html.m3 .fiche-match .fm-w{background:var(--m3-em-dim); color:var(--m3-em)}
html.m3 .fiche-match .fm-d{background:var(--m3-panel-3); border:0; color:var(--m3-muted)}
html.m3 .fiche-match .fm-l{background:rgba(255,107,107,.12); color:var(--m3-loss)}
/* L'équipe à l'extérieur en bleu, partout où les deux sont comparées. */
html.m3 .fiche-match .leg b{color:var(--m3-em)}
html.m3 .fiche-match .leg .o{color:#7CC4FF}
html.m3[data-theme="light"] .fiche-match .leg .o{color:#1F6FA8}
html.m3 .fiche-match .h2h .g i:first-child{background:var(--m3-em)}
html.m3 .fiche-match .h2h .g i:last-child{background:#7CC4FF}
html.m3 .fiche-match .h2h-l b{font-family:var(--m3-mono)}
/* Comparateur : la meilleure cote encadrée en vert. */
html.m3 .fiche-match table.cmp td.best{color:var(--m3-em)}
@media (min-width:600px){
  html.m3 .fiche-match table.cmp td.best{background:var(--m3-em-dim); box-shadow:inset 0 0 0 1px var(--m3-line-2); border-radius:8px; padding-left:8px; padding-right:8px}
  html.m3 .fiche-match table.cmp td.best::after{display:none}
}
html.m3 .fiche-match .lowtag{color:var(--m3-em); background:var(--m3-em-dim); font:600 10px var(--m3-mono); letter-spacing:.06em; text-transform:uppercase}
html.m3 .fiche-match table.yo input{background:var(--m3-bg-1); border-color:var(--m3-line-2)}
/* Mouvement des cotes : trois couleurs franches, traits fins. */
html.m3 .fiche-match .mv .ln{stroke-width:2.5}
/* Le graphique garde l'échelle d'un téléphone : étiré sur 1 100 px, ses
   libellés devenaient énormes. */
html.m3 .fiche-match .mv svg{max-width:720px; margin:0 auto}
html.m3 .fiche-match .mv .s-h{stroke:var(--m3-em)}
html.m3 .fiche-match .mv .s-d{stroke:#8FA39A}
html.m3 .fiche-match .mv .s-a{stroke:#7CC4FF}
html.m3 .fiche-match .mv .key span:last-child i{background:#7CC4FF !important}
html.m3 .fiche-match .mv .key span:nth-child(2):not(:last-child) i{background:#8FA39A !important}
html.m3 .fiche-match .mv .key{color:var(--m3-muted)}

/* ---- Ordinateur : les cartes d'un onglet deux par deux ---- */
@media (min-width:1100px){
  html.m3 .tabs-on.fiche-match .f-main > .tab.on{display:grid; grid-template-columns:minmax(0,1.45fr) minmax(0,1fr); gap:16px; align-items:stretch}
  html.m3 .fiche-match .f-main > .tab > *{margin:0; min-width:0}
  /* Pronostic : l'analyse et la marge côte à côte, puis les estimations et
     MARGE+, la lettre sur toute la largeur. */
  html.m3 .fiche-match .f-main > .tab[data-tab="pronostic"] > .card.pick{grid-column:1}
  html.m3 .fiche-match .f-main > .tab[data-tab="pronostic"] > .m3f-marge{grid-column:2}
  html.m3 .fiche-match .f-main > .tab[data-tab="pronostic"] > .lettre{grid-column:1 / -1}
  html.m3 .tabs-on.fiche-match .f-main > .tab[data-tab="analyse"].on, html.m3 .tabs-on.fiche-match .f-main > .tab[data-tab="chiffres"].on{grid-template-columns:repeat(2,minmax(0,1fr)); align-items:start}
  html.m3 .fiche-match .f-main > .tab[data-tab="chiffres"] > #chiffres{grid-row:span 3}
  html.m3 .fiche-match .f-main > .tab[data-tab="cotes"] > #calcul, html.m3 .fiche-match .f-main > .tab[data-tab="cotes"] > .pro-line{grid-column:1 / -1}
  html.m3 .tabs-on.fiche-match .f-main > .tab[data-tab="mouvement"].on{grid-template-columns:minmax(0,1fr)}
  html.m3 .fiche-match .f-main{margin-bottom:16px}
}
@media (max-width:860px){
  html.m3 .fiche-match .m3f-hero{padding:16px}
  html.m3 .fiche-match .m3f-hero .crest{width:46px; height:46px; font-size:12px}
  html.m3 .fiche-match .m3f-hero .team b{font-size:17px}
  html.m3 .fiche-match .m3f-hero .toc.tabs a{padding:0 12px}
  .m3f-ring{width:92px; height:92px}
  .m3f-rv b{font-size:18px}
  html.m3 .fiche-match .m3f-selt .pick-main{font-size:22px}
  html.m3 .fiche-match .card.pick .kv{gap:6px}
  html.m3 .fiche-match .card.pick .kv > div{padding:10px 8px}
  html.m3 .fiche-match .card.pick .kv .n{font-size:16px}
  html.m3 .fiche-match .duel{grid-template-columns:34px minmax(0,1fr) 88px minmax(0,1fr) 34px; gap:6px}
}
@media (max-width:400px){
  .m3f-stk span{padding:0 6px; font-size:11px}
  .m3f-form i{width:16px; height:16px}
}
/* Thème clair : l'orange de la coquille manque de contraste sur fond blanc. */
html.m3[data-theme="light"] .m3f-pill, html.m3[data-theme="light"] .m3f-op b.w{color:#8A5200}
