/* Équité — styles. Thème sombre par défaut, clair en option (html[data-theme]). */

:root {
  --fond: #0D0E11; --lateral: #0F1013; --panneau: #15171C; --sureleve: #1C1F26; --survol: #1F232B;
  --filet: #23262E; --filet2: #1F2229; --contour: #2C313B; --champ: #0F1115; --modale: #121418;
  --texte: #ECEEF2; --texte2: #A3A9B5; --texte3: #7E8593; --texte4: #6F7684; --eteint: #4C5260;
  --accent: #F4B740; --accent-h: #FFC657; --accent-txt: #1A1306; --accent-doux: #FFD27A; --accent-texte: #F4B740;
  --accent-fond: #2A2416; --accent-anneau: rgba(244, 183, 64, .18);
  --succes: #6FD9A3; --erreur: #FF8A93; --stop-fond: #2A1A1C; --stop-bord: #5C2A30; --stop-txt: #FF9AA2;
  --g-p: #2C3140; --g-p-t: #C9CDD5; --g-s: #1C2A3A; --g-s-t: #A9B6C8; --g-o: #1A1C21; --g-o-t: #959BA7; --g-o-bord: #24272F;
  --g-part: #4F4020; --g-part-t: #FFE3A3; --g-hors: #17191E; --g-hors-t: #4C5260; --g-retire: #2A2418; --g-retire-t: #C9B27E; --g-retire-bord: #6B5A33;
  --c-s: #474D5C; --c-h: #D93A4A; --c-d: #2F6BDB; --c-c: #1E8650;
  --b-s: #8A92A3; --b-h: #E5484D; --b-d: #3E7BEA; --b-c: #2BA86A;
  --voile: rgba(6, 7, 9, .74); --ombre: 0 30px 80px rgba(0, 0, 0, .55);
  --sur-joueur: #0D0E11;
  color-scheme: dark;
}
html[data-theme="light"] {
  --fond: #F7F7F5; --lateral: #EFEFEC; --panneau: #FFFFFF; --sureleve: #F2F2EF; --survol: #E9E9E5;
  --filet: #E4E4E0; --filet2: #ECECE8; --contour: #D3D3CD; --champ: #FFFFFF; --modale: #FBFBFA;
  --texte: #17181C; --texte2: #4A4F59; --texte3: #646975; --texte4: #767B86; --eteint: #A6AAB2;
  --accent: #F4B740; --accent-h: #E9A92C; --accent-txt: #1A1306; --accent-doux: #8A5A00; --accent-texte: #8A5A00;
  --accent-fond: #FBEFD3; --accent-anneau: rgba(244, 183, 64, .35);
  --succes: #1F7A4D; --erreur: #C22B3A; --stop-fond: #FCE8EA; --stop-bord: #E8A3AA; --stop-txt: #A3202E;
  --g-p: #DFE3EC; --g-p-t: #2F3542; --g-s: #DCE8F6; --g-s-t: #2C4058; --g-o: #F1F1EE; --g-o-t: #555A65; --g-o-bord: #DDDDD8;
  --g-part: #F6DFA6; --g-part-t: #5C3D00; --g-hors: #F1F1EE; --g-hors-t: #B0B3BA; --g-retire: #FBF1DA; --g-retire-t: #8A6A2A; --g-retire-bord: #D9B868;
  --c-s: #3D4250; --c-h: #D02F40; --c-d: #2563D4; --c-c: #18784A;
  --b-s: #6B7385; --b-h: #D9363C; --b-d: #2E6BDB; --b-c: #1F9159;
  --voile: rgba(30, 32, 38, .45); --ombre: 0 24px 60px rgba(20, 22, 28, .22);
  --sur-joueur: #FFFFFF;
  color-scheme: light;
}
/* 2 couleurs : seulement les cartes. Les barres des graphiques gardent 4 couleurs pour rester lisibles. */
html[data-cartes="2"] { --c-d: #D93A4A; --c-c: #474D5C; }
html[data-theme="light"][data-cartes="2"] { --c-d: #D02F40; --c-c: #3D4250; }

* { box-sizing: border-box; }
html, body { margin: 0; background: var(--fond); color: var(--texte); }
body { font: 400 14px/1.4 'IBM Plex Sans', system-ui, -apple-system, 'Segoe UI', sans-serif; -webkit-font-smoothing: antialiased; }
button, input, select { font-family: inherit; }
a { color: var(--accent-texte); }
.num { font-family: 'IBM Plex Mono', ui-monospace, 'Cascadia Mono', Consolas, monospace; font-variant-numeric: tabular-nums; }
.lbl { font-size: 11px; letter-spacing: .06em; text-transform: uppercase; color: var(--texte3); font-weight: 600; }
.discret { color: var(--texte3); }
.cache { display: none !important; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- Boutons, champs, interrupteurs ---------- */
.btn { height: 32px; padding: 0 12px; border-radius: 8px; border: 1px solid var(--contour); background: var(--sureleve); color: var(--texte); font: 500 13px 'IBM Plex Sans', sans-serif; display: inline-flex; align-items: center; justify-content: center; gap: 6px; cursor: pointer; text-decoration: none; white-space: nowrap; flex: none; }
.btn:hover { background: var(--survol); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn:focus-visible, .seg button:focus-visible, .sw:focus-visible, .nav:focus-visible, .slot:focus-visible, .cell:focus-visible, .chip:focus-visible, .tree:focus-visible, .cb:focus-visible, .pc:focus-visible, .bar:focus-visible, .th:focus-visible, .onglet:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.btn-ghost { background: transparent; border-color: transparent; color: var(--texte2); }
.btn-ghost:hover { background: var(--survol); color: var(--texte); }
.btn-sm { height: 28px; padding: 0 8px; font-size: 12px; gap: 5px; }
.btn-icon { width: 32px; padding: 0; }
.btn-sm.btn-icon { width: 28px; }
.btn-primary { background: var(--accent); border-color: var(--accent); color: var(--accent-txt); font-weight: 600; }
.btn-primary:hover { background: var(--accent-h); color: var(--accent-txt); }
.btn-grand { height: 44px; padding: 0 18px; font-size: 14px; gap: 10px; }
.btn-stop { background: var(--stop-fond); border-color: var(--stop-bord); color: var(--stop-txt); font-weight: 600; }
.btn-stop:hover { background: var(--stop-fond); filter: brightness(1.1); }
.btn-danger { color: var(--erreur); }
.kbd { font: 500 11px 'IBM Plex Mono', monospace; padding: 1px 5px; border-radius: 4px; border: 1px solid var(--contour); color: var(--texte2); background: var(--champ); line-height: 16px; white-space: nowrap; }
.btn-primary .kbd { border-color: rgba(26, 19, 6, .35); color: var(--accent-txt); background: rgba(255, 255, 255, .3); }
.btn-stop .kbd { color: var(--stop-txt); border-color: var(--stop-bord); background: transparent; }
.field { height: 40px; width: 100%; min-width: 0; background: var(--champ); border: 1px solid var(--contour); border-radius: 8px; padding: 0 12px; color: var(--texte); font: 500 14px 'IBM Plex Mono', monospace; }
.field::placeholder { color: var(--texte4); }
.field:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-anneau); }
.field.erreur, .field[aria-invalid="true"] { border-color: var(--erreur); }
.field-texte { font-family: 'IBM Plex Sans', sans-serif; }
.sel { height: 36px; border-radius: 8px; border: 1px solid var(--contour); background: var(--champ); color: var(--texte); font: 500 13px 'IBM Plex Sans', sans-serif; padding: 0 10px; max-width: 100%; }
.seg { display: inline-flex; padding: 3px; background: var(--champ); border: 1px solid var(--contour); border-radius: 9px; gap: 2px; flex-wrap: wrap; }
.seg button { height: 28px; padding: 0 12px; border: 0; border-radius: 6px; background: transparent; color: var(--texte2); font: 500 13px 'IBM Plex Sans', sans-serif; cursor: pointer; }
.seg button.on { background: var(--survol); color: var(--texte); box-shadow: inset 0 0 0 1px var(--contour); }
.seg button:disabled { color: var(--eteint); cursor: not-allowed; }
.sw { width: 34px; height: 20px; border-radius: 10px; border: 0; background: var(--contour); position: relative; cursor: pointer; padding: 0; flex: none; }
.sw .knob { position: absolute; top: 3px; left: 3px; width: 14px; height: 14px; border-radius: 7px; background: var(--texte3); transition: left .15s; }
.sw.on, .sw[aria-checked="true"] { background: var(--accent); }
.sw.on .knob, .sw[aria-checked="true"] .knob { left: 17px; background: var(--accent-txt); }
.cb { width: 18px; height: 18px; border-radius: 5px; border: 1.5px solid var(--texte4); background: transparent; padding: 0; display: inline-flex; align-items: center; justify-content: center; cursor: pointer; flex: none; color: transparent; }
.cb[aria-checked="true"] { background: var(--accent); border-color: var(--accent); color: var(--accent-txt); }
.rng { -webkit-appearance: none; appearance: none; width: 100%; height: 6px; border-radius: 3px; outline: none; margin: 0; background: var(--contour); }
.rng::-webkit-slider-thumb { -webkit-appearance: none; width: 16px; height: 16px; border-radius: 50%; background: var(--texte); border: 3px solid var(--accent); cursor: pointer; }
.rng::-moz-range-thumb { width: 11px; height: 11px; border-radius: 50%; background: var(--texte); border: 3px solid var(--accent); cursor: pointer; }
.rng:focus-visible::-webkit-slider-thumb { box-shadow: 0 0 0 3px var(--accent-anneau); }
.panel { background: var(--panneau); border: 1px solid var(--filet); border-radius: 12px; }
.erreur-txt { font-size: 12px; color: var(--erreur); }
.ok-txt { font-size: 12px; color: var(--succes); display: inline-flex; align-items: center; gap: 6px; }

/* ---------- Cartes ---------- */
.pc { display: inline-flex; align-items: center; justify-content: center; flex-direction: column; color: #fff; font-family: 'IBM Plex Sans', sans-serif; font-weight: 600; line-height: 1; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .14); font-variant-emoji: text; border: 0; padding: 0; flex: none; user-select: none; }
.pc.co-s { background: var(--c-s); } .pc.co-h { background: var(--c-h); } .pc.co-d { background: var(--c-d); } .pc.co-c { background: var(--c-c); }
.pc-xl { width: 66px; height: 92px; border-radius: 9px; gap: 4px; font-size: 32px; } .pc-xl .s { font-size: 24px; }
.pc-l { width: 52px; height: 72px; border-radius: 7px; gap: 3px; font-size: 26px; } .pc-l .s { font-size: 20px; }
.pc-m { width: 30px; height: 40px; border-radius: 5px; gap: 1px; font-size: 15px; } .pc-m .s { font-size: 12px; }
.pc-s { width: 24px; height: 32px; border-radius: 4px; gap: 1px; font-size: 13px; } .pc-s .s { font-size: 10px; }
.pc-xs { width: 17px; height: 22px; border-radius: 3px; font-size: 10.5px; gap: 0; } .pc-xs .s { font-size: 8px; }
.pc-xl.dix, .pc-l.dix { letter-spacing: -.06em; }
button.pc { cursor: pointer; }
button.pc:hover { filter: brightness(1.12); }
.slot { width: 52px; height: 72px; border-radius: 7px; border: 1.5px dashed var(--contour); background: transparent; color: var(--texte3); display: inline-flex; align-items: center; justify-content: center; cursor: pointer; padding: 0; flex: none; }
.slot:hover { border-color: var(--accent); color: var(--accent-texte); }
.cartes { display: flex; gap: 6px; flex-wrap: wrap; }

/* ---------- Disposition générale ---------- */
.appli { display: flex; min-height: 100vh; }
.lateral { width: 240px; flex: none; display: flex; flex-direction: column; gap: 20px; padding: 18px 14px; border-right: 1px solid var(--filet); background: var(--lateral); position: sticky; top: 0; height: 100vh; overflow: auto; }
.logo { display: flex; align-items: center; gap: 10px; padding: 0 6px; }
.logo span { font-size: 17px; font-weight: 700; letter-spacing: -.02em; }
.nav { display: flex; align-items: center; gap: 10px; min-height: 34px; padding: 0 10px; border-radius: 7px; color: var(--texte2); text-decoration: none; font-size: 13.5px; font-weight: 500; background: transparent; border: 0; width: 100%; cursor: pointer; text-align: left; }
.nav:hover { background: var(--survol); color: var(--texte); }
.nav.on { background: var(--survol); color: var(--texte); box-shadow: inset 2px 0 0 var(--accent); }
.nav .kbd { margin-left: auto; }
.recent { flex-direction: column; align-items: flex-start; gap: 6px; padding: 8px 10px; }
.recent .ligne { display: flex; gap: 3px; align-items: center; }
.recent .desc { font-size: 12px; color: var(--texte2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%; }
main.page { flex: 1; min-width: 0; padding: 24px 32px 40px; }
.contenu { max-width: 1240px; margin: 0 auto; display: flex; flex-direction: column; gap: 16px; }
.entete { display: flex; flex-wrap: wrap; gap: 16px; align-items: center; justify-content: space-between; }
.entete h1 { margin: 0; font-size: 22px; font-weight: 600; letter-spacing: -.015em; }
.entete p { margin: 4px 0 0; color: var(--texte2); font-size: 13px; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.onglets-mobile { display: none; }
.seul-mobile { display: none !important; }

/* ---------- Calculateur ---------- */
.board { padding: 18px 20px; display: flex; flex-direction: column; gap: 14px; }
.board-haut { display: flex; flex-wrap: wrap; gap: 20px; align-items: flex-end; }
.groupe { display: flex; flex-direction: column; gap: 8px; }
.sep-v { width: 1px; height: 72px; background: var(--filet); }
.board-bas { border-top: 1px solid var(--filet2); padding-top: 10px; display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.joueurs-tete { display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: center; justify-content: space-between; padding: 12px 20px; }
.joueurs-tete h2, .resultat h2 { margin: 0; font-size: 14px; font-weight: 600; }
.joueur { display: grid; grid-template-columns: 40px 76px minmax(0, 1fr) 272px; gap: 14px; align-items: start; padding: 14px 20px; border-top: 1px solid var(--filet2); }
.joueur .sw { margin-top: 10px; }
.joueur .pos { display: flex; align-items: center; gap: 8px; height: 40px; font-weight: 600; }
.pastille { width: 10px; height: 10px; border-radius: 3px; flex: none; display: inline-block; }
.joueur .outils { display: flex; flex-wrap: wrap; gap: 2px; align-items: center; }
.joueur .combos { margin-left: auto; font-size: 12px; color: var(--texte3); }
.joueur .eq { display: flex; flex-direction: column; gap: 8px; padding-top: 2px; }
.joueur .eq-ligne { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.joueur .eq-val { font-size: 26px; font-weight: 600; letter-spacing: -.02em; }
.joueur .eq-det { font-size: 12px; color: var(--texte2); text-align: right; }
.jauge { height: 8px; border-radius: 4px; background: var(--filet); overflow: hidden; }
.jauge > div { height: 100%; border-radius: 4px; transition: width .2s; }
.joueur.compact { align-items: center; padding: 8px 20px; }
.joueur.compact .sw { margin-top: 0; }
.joueur.compact .pos { height: auto; color: var(--texte3); }
.joueur.compact .field { height: 34px; font-size: 13px; background: transparent; border-color: var(--filet); }
.joueur.compact .ligne-compacte { display: flex; gap: 6px; align-items: center; min-width: 0; }
.perime .eq-val, .perime .barre-resultat { opacity: .45; }
.resultat { padding: 18px 20px; display: flex; flex-direction: column; gap: 14px; }
.resultat-tete { display: flex; flex-wrap: wrap; gap: 12px 16px; align-items: center; justify-content: space-between; }
.barre-resultat { display: flex; height: 44px; border-radius: 8px; overflow: hidden; gap: 2px; background: var(--champ); }
.barre-resultat > div { display: flex; align-items: center; padding: 0 12px; color: var(--sur-joueur); font-weight: 600; font-size: 13px; white-space: nowrap; overflow: hidden; transition: width .2s; min-width: 0; }
.barre-resultat .vide { flex: 1; color: var(--texte3); font-weight: 500; justify-content: center; }
.progression { display: flex; gap: 12px; align-items: center; }
.progression .piste { flex: 1; height: 4px; border-radius: 2px; background: var(--filet); overflow: hidden; }
.progression .piste > div { height: 100%; background: var(--accent); }
.raccourcis { display: flex; flex-wrap: wrap; gap: 6px 18px; font-size: 12px; color: var(--texte3); }
.menu { position: absolute; z-index: 60; min-width: 220px; max-height: 360px; overflow: auto; background: var(--modale); border: 1px solid var(--contour); border-radius: 10px; box-shadow: var(--ombre); padding: 6px; display: flex; flex-direction: column; gap: 1px; }
.menu button { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 32px; padding: 6px 10px; border: 0; border-radius: 6px; background: transparent; color: var(--texte); font: 500 13px 'IBM Plex Sans', sans-serif; cursor: pointer; text-align: left; }
.menu button:hover, .menu button:focus-visible { background: var(--survol); outline: none; }
.menu .titre { padding: 8px 10px 4px; }
.menu .meta { margin-left: auto; font: 500 11px 'IBM Plex Mono', monospace; color: var(--texte4); }

/* ---------- Modales ---------- */
.voile { position: fixed; inset: 0; z-index: 40; background: var(--voile); backdrop-filter: blur(2px); display: flex; align-items: center; justify-content: center; padding: 24px; }
.modale { background: var(--modale); border: 1px solid var(--contour); border-radius: 16px; box-shadow: var(--ombre); display: flex; flex-direction: column; max-width: 100%; max-height: 100%; min-height: 0; }
.modale > header { display: flex; align-items: center; gap: 12px; padding: 14px 16px 14px 24px; border-bottom: 1px solid var(--filet); }
.modale > header h2 { margin: 0; font-size: 17px; font-weight: 600; letter-spacing: -.01em; }
.modale > footer { display: flex; align-items: center; flex-wrap: wrap; gap: 12px 12px; padding: 14px 24px; border-top: 1px solid var(--filet); }
.modale .corps { flex: 1; min-height: 0; overflow: auto; }
.pousse { margin-left: auto; }

/* Sélecteur de cartes */
.sel-cartes { width: 640px; }
.paquet { display: grid; grid-template-columns: repeat(13, minmax(0, 1fr)); gap: 6px; padding: 20px 24px; }
.paquet .pc { width: 100%; height: auto; aspect-ratio: 52 / 72; border-radius: 6px; font-size: 18px; gap: 2px; }
.paquet .pc .s { font-size: 14px; }
.paquet .pc.pris { opacity: .18; cursor: not-allowed; filter: none; }
.paquet .pc.choisi { box-shadow: 0 0 0 2px var(--modale), 0 0 0 4px var(--accent); }
.choix-cartes { display: flex; gap: 6px; align-items: center; min-height: 40px; }

/* Éditeur de range */
.editeur { width: 1280px; height: min(860px, 100%); }
.editeur .notation { display: flex; align-items: center; gap: 12px; padding: 14px 24px; border-bottom: 1px solid var(--filet2); flex-wrap: wrap; }
.editeur .zones { flex: 1; min-height: 0; display: grid; grid-template-columns: minmax(380px, 608px) 256px minmax(220px, 1fr); gap: 24px; padding: 18px 24px; overflow: auto; }
.grille { display: grid; grid-template-columns: repeat(13, minmax(0, 1fr)); grid-auto-rows: 36px; gap: 3px; touch-action: none; user-select: none; }
.cell { border: 0; border-radius: 4px; padding: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; font: 600 12px 'IBM Plex Sans', sans-serif; cursor: pointer; user-select: none; line-height: 1.1; min-width: 0; overflow: hidden; }
.cell .cc { font: 500 9.5px 'IBM Plex Mono', monospace; opacity: .75; }
.cell.p { background: var(--g-p); color: var(--g-p-t); } .cell.s { background: var(--g-s); color: var(--g-s-t); } .cell.o { background: var(--g-o); color: var(--g-o-t); box-shadow: inset 0 0 0 1px var(--g-o-bord); }
.cell.on { background: var(--accent); color: var(--accent-txt); box-shadow: none; }
.cell.part { background: var(--g-part); color: var(--g-part-t); box-shadow: inset 0 -3px 0 var(--accent); }
.cell.focus { box-shadow: 0 0 0 2px var(--texte); }
.cell.part.focus { box-shadow: inset 0 -3px 0 var(--accent), 0 0 0 2px var(--texte); }
.curseurs { display: grid; grid-template-columns: 96px minmax(0, 1fr) 96px; gap: 10px 14px; align-items: center; margin-top: 16px; }
.valeur-boite { height: 32px; border: 1px solid var(--contour); border-radius: 7px; display: flex; align-items: center; justify-content: flex-end; padding: 0 10px; font-size: 13px; }
.double { position: relative; height: 20px; }
.double .piste, .double .plage { position: absolute; top: 7px; height: 6px; border-radius: 3px; }
.double .piste { left: 0; right: 0; background: var(--contour); }
.double .plage { background: #41C9E2; }
.double .rng { position: absolute; left: 0; right: 0; top: 7px; pointer-events: none; background: transparent; }
.double .rng::-webkit-slider-thumb { pointer-events: auto; }
.double .rng::-moz-range-thumb { pointer-events: auto; }
.carte-couleurs { display: flex; flex-direction: column; gap: 10px; padding: 14px; border: 1px solid var(--filet); border-radius: 12px; background: var(--panneau); }
.puces { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
.chip { height: 36px; border-radius: 7px; border: 1px solid var(--contour); background: var(--sureleve); display: flex; align-items: center; justify-content: center; gap: 3px; cursor: pointer; padding: 0; }
.chip:hover { border-color: var(--texte4); }
.chip.on { border-color: var(--accent); }
.chip.off { opacity: .28; }
.chip.bloque { opacity: .4; }
.legende { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 12px; font-size: 12px; color: var(--texte2); }
.legende span { display: flex; align-items: center; gap: 8px; }
.legende i { width: 16px; height: 12px; border-radius: 3px; display: inline-block; }
.biblio { display: flex; flex-direction: column; gap: 10px; min-width: 0; min-height: 0; border-left: 1px solid var(--filet); padding-left: 24px; }
.arbre { flex: 1; min-height: 120px; overflow: auto; display: flex; flex-direction: column; gap: 1px; }
.tree { display: flex; align-items: center; gap: 8px; min-height: 30px; width: 100%; border: 0; border-radius: 6px; background: transparent; color: var(--texte2); font: 500 13px 'IBM Plex Sans', sans-serif; cursor: pointer; text-align: left; padding-right: 8px; }
.tree:hover { background: var(--sureleve); color: var(--texte); }
.tree.on { background: var(--accent-fond); color: var(--accent-doux); }
.tree.dossier { color: var(--texte); }
.tree .meta { margin-left: auto; font-size: 11px; color: var(--texte4); }
.tree .lib { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.onglets-editeur { display: none; }
.editeur .zone-grille, .editeur .zone-couleurs { display: flex; flex-direction: column; }
.barre-calcul { display: none; }

/* Répartition */
.repartition { width: 1240px; height: min(828px, 100%); }
.repartition .zones { flex: 1; min-height: 0; display: grid; grid-template-columns: 352px minmax(0, 1fr); }
.mini-grille { display: grid; grid-template-columns: repeat(13, minmax(0, 1fr)); grid-auto-rows: 22px; gap: 2px; }
.mini-grille span { border-radius: 3px; display: flex; align-items: center; justify-content: center; font-size: 8.5px; font-weight: 600; overflow: hidden; }
.mg-on { background: var(--accent); color: var(--accent-txt); }
.mg-retire { background: var(--g-retire); color: var(--g-retire-t); box-shadow: inset 0 0 0 1px var(--g-retire-bord); }
.mg-hors { background: var(--g-hors); color: var(--g-hors-t); }
.cat { display: grid; grid-template-columns: 22px minmax(0, 1fr) 44px 150px; gap: 10px; align-items: center; min-height: 31px; padding: 0 10px; border-radius: 7px; }
.cat:hover { background: var(--sureleve); }
.cat.vide { opacity: .42; }
.cat .barre { flex: 1; height: 10px; border-radius: 3px; background: var(--sureleve); overflow: hidden; }
.cat .barre > div { height: 100%; border-radius: 3px; background: var(--texte4); }
.cat.coche .barre > div { background: var(--accent); }
.cat.coche .n { color: var(--accent-doux); }
.note { padding: 12px 14px; border: 1px solid var(--filet); border-radius: 10px; background: var(--panneau); font-size: 12.5px; line-height: 1.5; color: var(--texte2); }

/* Analyseur */
.chips-stats { display: flex; flex-wrap: wrap; gap: 10px; }
.stat { display: flex; flex-direction: column; gap: 4px; padding: 10px 14px; border-radius: 10px; background: var(--champ); border: 1px solid var(--filet); min-width: 150px; }
.stat .v { font-size: 22px; font-weight: 600; }
.graphique { display: grid; grid-template-columns: 36px minmax(0, 1fr); gap: 8px; }
.axe { position: relative; height: 320px; }
.axe span { position: absolute; right: 0; font-size: 11px; color: var(--texte4); }
.trace { position: relative; height: 320px; border-bottom: 1px solid var(--contour); }
.trace .ligne-h { position: absolute; left: 0; right: 0; border-top: 1px solid var(--filet2); }
.barres { position: absolute; inset: 0; display: flex; gap: 12px; align-items: flex-end; padding: 0 6px; }
.barres .grp { flex: 1; min-width: 0; height: 100%; display: flex; gap: 3px; align-items: flex-end; }
.bar { flex: 1; border: 0; padding: 0; border-radius: 3px 3px 0 0; cursor: pointer; min-width: 0; }
.bar:hover, .bar.survol { filter: brightness(1.25); }
.bar.connue { background: transparent !important; border-top: 1.5px dashed var(--contour); cursor: default; }
.bar.co-s { background: var(--b-s); } .bar.co-h { background: var(--b-h); } .bar.co-d { background: var(--b-d); } .bar.co-c { background: var(--b-c); }
.repere { position: absolute; left: 0; right: 0; border-top: 1.5px dashed var(--accent); pointer-events: none; }
.repere span { position: absolute; right: 6px; bottom: 2px; font-size: 11px; color: var(--accent-texte); background: var(--panneau); padding: 0 4px; }
.rangs { display: flex; gap: 12px; padding: 0 6px; }
.rangs span { flex: 1; text-align: center; font-weight: 600; font-size: 13px; color: var(--texte2); }
.th { background: transparent; border: 0; padding: 0; font: 600 11px 'IBM Plex Sans', sans-serif; letter-spacing: .06em; text-transform: uppercase; color: var(--texte3); cursor: pointer; display: inline-flex; align-items: center; gap: 4px; }
.th.on { color: var(--texte); }
.liste-cartes .ligne { display: grid; grid-template-columns: 64px 1fr 72px; gap: 8px; align-items: center; height: 32px; padding: 0 10px; border-radius: 6px; }
.liste-cartes .ligne.survol { background: var(--survol); }
.mini-jauge { width: 70px; height: 5px; border-radius: 3px; background: var(--filet); overflow: hidden; }
.mini-jauge > div { height: 100%; }
.legende-couleurs { margin-left: auto; display: flex; flex-wrap: wrap; gap: 12px; align-items: center; font-size: 12px; color: var(--texte2); }
.legende-couleurs i { width: 10px; height: 10px; border-radius: 2px; display: inline-block; margin-right: 6px; }

/* Entraîneur */
.boite-range { padding: 12px 14px; border-radius: 10px; background: var(--champ); border: 1px solid var(--filet); display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.boite-range p { margin: 0; font-size: 12px; color: var(--texte2); line-height: 1.5; word-break: break-word; }
.estimation { display: flex; flex-direction: column; gap: 14px; padding: 18px 20px; border-radius: 12px; background: var(--champ); border: 1px solid var(--filet); }
.champ-estim { height: 44px; width: 86px; font-size: 20px; font-weight: 600; text-align: right; }
.repere-reponse { position: relative; height: 34px; }
.slots { display: grid; grid-template-columns: repeat(10, minmax(0, 1fr)); gap: 3px; }
.slots span { height: 6px; border-radius: 3px; background: var(--filet); }
.slots span.fait { background: var(--accent); } .slots span.cours { background: var(--g-retire-bord); }

/* Équité minimum : carte de chaleur */
.chaleur { display: grid; grid-template-columns: repeat(13, minmax(0, 1fr)); grid-auto-rows: 40px; gap: 3px; }
.chaleur span { border-radius: 4px; display: flex; flex-direction: column; align-items: center; justify-content: center; font-size: 11.5px; font-weight: 600; line-height: 1.15; overflow: hidden; }
.chaleur span small { font: 500 10px 'IBM Plex Mono', monospace; opacity: .85; }

/* Historique */
.histo { display: grid; grid-template-columns: 110px 150px minmax(0, 1fr) auto; gap: 14px; align-items: center; padding: 12px 20px; border-top: 1px solid var(--filet2); }
.histo:first-child { border-top: 0; }
.histo .joueurs-h { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.histo .jh { display: flex; gap: 8px; align-items: baseline; font-size: 13px; min-width: 0; }
.histo .jh .t { color: var(--texte2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }

/* Réglages */
.reglage { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 16px 20px; border-top: 1px solid var(--filet2); flex-wrap: wrap; }
.reglage:first-child { border-top: 0; }
.reglage .txt { display: flex; flex-direction: column; gap: 2px; }
.reglage .txt span { font-size: 12.5px; color: var(--texte3); }

/* Aide raccourcis, toast */
.toast { position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%); z-index: 80; background: var(--texte); color: var(--fond); padding: 10px 16px; border-radius: 10px; font-size: 13px; font-weight: 500; box-shadow: var(--ombre); opacity: 0; pointer-events: none; transition: opacity .2s; max-width: calc(100vw - 32px); }
.toast.vu { opacity: 1; }
.toast.avec-action { pointer-events: auto; display: flex; align-items: center; gap: 14px; padding: 8px 8px 8px 16px; }
.toast button { height: 32px; padding: 0 12px; border: 0; border-radius: 7px; background: var(--accent); color: var(--accent-txt); font: 600 13px 'IBM Plex Sans', sans-serif; cursor: pointer; }
.aide-grille { display: grid; grid-template-columns: auto 1fr; gap: 10px 18px; padding: 20px 24px; font-size: 13px; align-items: center; }

/* Tuto du premier lancement */
.tuto-voile { position: fixed; inset: 0; z-index: 90; background: var(--voile); }
.tuto-trou { position: fixed; z-index: 90; border-radius: 12px; box-shadow: 0 0 0 9999px var(--voile), 0 0 0 2px var(--accent); pointer-events: none; transition: left .2s, top .2s, width .2s, height .2s; }
.tuto-bulle { position: fixed; z-index: 91; width: 380px; max-width: calc(100vw - 24px); background: var(--modale); border: 1px solid var(--contour); border-radius: 14px; box-shadow: var(--ombre); padding: 18px 20px; display: flex; flex-direction: column; gap: 8px; }
.tuto-bulle.centre { left: 50% !important; top: 50% !important; transform: translate(-50%, -50%); width: 460px; }
.tuto-bulle h2 { margin: 0; font-size: 18px; font-weight: 600; letter-spacing: -.01em; }
.tuto-bulle p { margin: 0; color: var(--texte2); font-size: 14px; line-height: 1.55; }
.tuto-bulle code { font-family: 'IBM Plex Mono', monospace; font-size: 13px; color: var(--accent-doux); background: var(--champ); border: 1px solid var(--filet); border-radius: 4px; padding: 0 4px; }
.tuto-tete { display: flex; align-items: center; justify-content: space-between; font-size: 12px; }
.tuto-points { display: flex; gap: 4px; }
.tuto-points i { width: 16px; height: 4px; border-radius: 2px; background: var(--filet); }
.tuto-points i.fait { background: var(--g-retire-bord); } .tuto-points i.on { background: var(--accent); }
.tuto-pied { display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end; margin-top: 8px; }
.tuto-pied .btn { height: 36px; }
.tuto-pied [data-t="passer"] { margin-right: auto; }
[hidden].tuto-voile, [hidden].tuto-trou, [hidden].tuto-bulle { display: none !important; }
@media (max-width: 760px) { .tuto-bulle { width: calc(100vw - 24px); } .tuto-bulle.centre { width: calc(100vw - 24px); } }

/* ---------- Main du jour ---------- */
.pastille { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); flex: none; }
.onglet { position: relative; }
.onglet .pastille { position: absolute; top: 8px; left: calc(50% + 8px); }
.lien { background: none; border: 0; padding: 0; font: inherit; color: var(--accent-texte); text-decoration: underline; text-underline-offset: 2px; cursor: pointer; }
.jr-progres { display: flex; align-items: center; gap: 12px; flex: 0 1 260px; min-width: 180px; }
.jr-slots { grid-template-columns: repeat(5, minmax(0, 1fr)); flex: 1; gap: 4px; }
.jr-slots span { height: 8px; border-radius: 4px; }
.jr-slots span.cours { box-shadow: 0 0 0 1.5px var(--accent); }
.jr-slots span.v, .jr-carre.v { background: var(--succes); }
.jr-slots span.j, .jr-carre.j { background: var(--accent); }
.jr-slots span.r, .jr-carre.r { background: var(--erreur); }
.jr-carre { display: inline-block; width: 14px; height: 14px; border-radius: 3px; vertical-align: -2px; margin-right: 8px; flex: none; }
.jr-question { padding: 22px 24px; display: flex; flex-direction: column; gap: 22px; }
.jr-tete { display: flex; flex-direction: column; gap: 4px; }
.jr-tete h2 { margin: 0; font-size: 18px; font-weight: 600; letter-spacing: -.01em; }
.jr-table { display: flex; flex-wrap: wrap; gap: 24px 48px; align-items: flex-end; justify-content: center; padding: 6px 0; }
.jr-bloc { align-items: center; gap: 10px; }
.jr-cartes { gap: 8px; flex-wrap: nowrap; }
.jr-cartes.hero { padding: 6px; border-radius: 13px; box-shadow: 0 0 0 1.5px var(--accent); }
.jr-contre { align-self: center; color: var(--texte3); font-size: 14px; padding-top: 22px; }
.jr-contexte { margin: 0; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; color: var(--texte2); font-size: 15px; }
.jr-puce { padding: 3px 10px; border-radius: 999px; background: var(--sureleve); border: 1px solid var(--contour); color: var(--texte); font-size: 13px; font-weight: 600; }
.jr-choix { display: flex; flex-wrap: wrap; gap: 10px; align-self: center; }
.jr-btn { min-width: 116px; justify-content: center; font-size: 16px; height: 52px; }
.jr-btn:disabled { opacity: 1; cursor: default; }
.jr-btn.bon { background: var(--succes); border-color: var(--succes); color: var(--fond); }
.jr-btn.faux { background: var(--stop-fond); border-color: var(--erreur); color: var(--erreur); }
.jr-btn.attendu { border-color: var(--succes); box-shadow: inset 0 0 0 1px var(--succes); }
.jr-btn:disabled:not(.bon):not(.faux):not(.attendu) { opacity: .45; }
.jr-verdict { display: flex; flex-direction: column; gap: 14px; padding: 18px 20px; border-radius: 12px; background: var(--champ); border: 1px solid var(--filet); }
.jr-verdict > p { margin: 0; font-size: 15px; font-weight: 500; }
.jr-grille-bloc { display: flex; flex-direction: column; gap: 10px; }
.jr-grille { display: grid; grid-template-columns: repeat(13, minmax(0, 1fr)); gap: 2px; max-width: 480px; }
.jr-c { aspect-ratio: 1.3; display: flex; align-items: center; justify-content: center; font: 500 9.5px 'IBM Plex Mono', monospace; letter-spacing: -.03em; border-radius: 3px; background: var(--g-o); color: var(--texte4); }
.jr-c.o { background: #1E8650; color: #fff; }
.jr-c.a { background: #C7404E; color: #fff; }
.jr-c.p { background: #A27A2A; color: #fff; }
.jr-c.ici { outline: 2px solid var(--texte); outline-offset: 1px; position: relative; z-index: 1; font-weight: 700; }
.jr-legende { display: flex; flex-wrap: wrap; gap: 14px; font-size: 12px; color: var(--texte2); }
.jr-legende > span { display: inline-flex; align-items: center; gap: 6px; }
.jr-legende .jr-c { width: 14px; height: 11px; aspect-ratio: auto; }
.jr-pied { display: flex; justify-content: flex-end; }
.jr-bilan { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.3fr); gap: 16px; align-items: start; }
.jr-score { padding: 24px; display: flex; flex-direction: column; align-items: center; gap: 12px; text-align: center; grid-row: span 2; }
.jr-note { font-size: 64px; font-weight: 600; letter-spacing: -.04em; line-height: 1; }
.jr-note span { font-size: 26px; color: var(--texte3); }
.jr-carres { display: flex; gap: 6px; }
.jr-carres .jr-carre { width: 34px; height: 34px; border-radius: 7px; margin: 0; }
.jr-mot { margin: 0; font-size: 16px; font-weight: 500; }
.jr-stats { padding: 16px; }
.jr-recap { padding: 18px 20px; display: flex; flex-direction: column; gap: 4px; }
.jr-recap h2 { margin: 0 0 8px; font-size: 15px; font-weight: 600; }
.jr-ligne { display: flex; align-items: center; gap: 4px 6px; padding: 10px 0; border-top: 1px solid var(--filet); }
.jr-ligne-txt { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 5px; }
.jr-ligne-titre { font-size: 13px; font-weight: 600; }
.jr-ligne-cartes { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font-size: 12px; }
.jr-ligne-actions { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }

/* ---------- Tablette et téléphone ---------- */
@media (max-width: 1100px) {
  .editeur .zones { grid-template-columns: minmax(0, 1fr) 240px; }
  .editeur .biblio { grid-column: 1 / -1; border-left: 0; padding-left: 0; border-top: 1px solid var(--filet); padding-top: 14px; min-height: 260px; }
  .repartition .zones { grid-template-columns: 300px minmax(0, 1fr); }
  .jr-bilan { grid-template-columns: 1fr; }
  .jr-score { grid-row: auto; }
}
@media (max-width: 900px) {
  .joueur { grid-template-columns: 34px 64px minmax(0, 1fr); }
  .joueur .eq { grid-column: 2 / -1; }
  .joueur.compact { grid-template-columns: 34px 64px minmax(0, 1fr); }
  .joueur.compact > .num { display: none; }
  .repartition .zones { grid-template-columns: 1fr; overflow: auto; }
  .repartition .gauche { border-right: 0 !important; border-bottom: 1px solid var(--filet); }
  .cats { grid-template-columns: 1fr !important; }
}
@media (max-width: 760px) {
  .appli { display: block; }
  .lateral { display: none; }
  main.page { padding: 12px 16px 150px; }
  .entete h1 { font-size: 19px; }
  .onglets-mobile { display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; border-top: 1px solid var(--filet); background: var(--lateral); padding-bottom: env(safe-area-inset-bottom, 8px); }
  .onglet { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; color: var(--texte3); background: transparent; border: 0; font: 500 11px 'IBM Plex Sans', sans-serif; height: 56px; cursor: pointer; }
  .onglet.on { color: var(--accent-texte); }
  .board { padding: 14px; }
  .board .pc-l, .board .slot { width: 38px; height: 52px; font-size: 19px; }
  .board .pc-l .s { font-size: 14px; }
  .sep-v { display: none; }
  .joueur { grid-template-columns: 34px minmax(0, 1fr); padding: 12px 14px; gap: 10px; }
  .joueur .pos { height: 34px; }
  .joueur > div:nth-child(3) { grid-column: 1 / -1; }
  .joueur .eq { grid-column: 1 / -1; }
  .joueur .eq-val { font-size: 22px; }
  .joueur.compact { grid-template-columns: 34px 52px minmax(0, 1fr); padding: 8px 14px; }
  .joueur.compact > div:nth-child(3) { grid-column: auto; }
  .joueur .outils .btn-sm .lib-btn { display: none; }
  .joueurs-tete { padding: 12px 14px; }
  .resultat { padding: 14px; }
  .barre-calcul { position: fixed; left: 0; right: 0; bottom: calc(56px + env(safe-area-inset-bottom, 8px)); z-index: 29; padding: 10px 16px; display: flex; gap: 8px; background: var(--lateral); border-top: 1px solid var(--filet); }
  .barre-calcul .btn { height: 48px; }
  .barre-calcul .btn-primary, .barre-calcul .btn-stop { flex: 1; }
  .resultat .btn-calc-bureau { display: none; }
  .raccourcis, .kbd-bureau, .cache-mobile { display: none !important; }
  .seul-mobile { display: inline-flex !important; }
  .toast { bottom: calc(140px + env(safe-area-inset-bottom, 8px)); left: 16px; right: 16px; transform: none; max-width: none; }
  .toast.avec-action { justify-content: space-between; }
  .entete [data-action="nouvelle"] { display: none; }
  .voile { padding: 0; align-items: stretch; }
  .modale { border-radius: 0; width: 100% !important; height: 100% !important; border: 0; }
  .modale > header { padding: 10px 10px 10px 16px; }
  .modale > footer { padding: 10px 16px 16px; }
  .modale > footer .btn { height: 44px; }
  .sel-cartes .paquet { padding: 16px; gap: 4px; }
  .sel-cartes .paquet .pc { font-size: 14px; } .sel-cartes .paquet .pc .s { font-size: 11px; }
  .editeur .notation { padding: 10px 16px; }
  .modale .sous-titre { display: none; }
  .repartition > header .cartes, .repartition #rp-cond-txt { display: none; }
  .repartition > header h2 { font-size: 15px; }
  .editeur > footer > div:first-child, .repartition > footer > div:first-child, .sel-cartes > footer > div:first-child { flex-basis: 100%; }
  .editeur > footer .pousse, .repartition > footer .pousse, .sel-cartes > footer .pousse { display: none; }
  .editeur > footer .btn, .repartition > footer .btn, .sel-cartes > footer .btn { flex: 1 1 auto; }
  .joueur.compact [data-action="cartes-joueur"] { display: none; }
  .editeur > footer .kbd { display: none; }
  .editeur .notation .lbl, .editeur .aide-peindre { display: none; }
  .onglets-editeur { display: flex; margin: 10px 16px 0; }
  .onglets-editeur button { flex: 1; height: 34px; }
  .editeur .zones { display: block; padding: 12px 16px; }
  .editeur .zones > :not(.vu) { display: none !important; }
  .editeur .zones > .vu { display: flex; }
  .editeur .biblio { border: 0; padding: 0; min-height: 60vh; }
  .grille { grid-auto-rows: 25.5px; gap: 2px; }
  .cell { font-size: 8.6px; letter-spacing: -.02em; border-radius: 3px; }
  .cell .cc { display: none; }
  .curseurs { grid-template-columns: 70px minmax(0, 1fr) 70px; }
  .histo { grid-template-columns: 1fr auto; }
  .histo .joueurs-h { grid-column: 1 / -1; }
  .graphique { grid-template-columns: 26px minmax(0, 1fr); }
  .barres, .rangs { gap: 4px; padding: 0 2px; }
  .barres .grp { gap: 1px; }
  .chaleur { grid-auto-rows: 30px; gap: 2px; }
  .chaleur span { font-size: 8.5px; } .chaleur span small { font-size: 8px; }
  .pc-xl { width: 52px; height: 72px; font-size: 26px; } .pc-xl .s { font-size: 19px; }
  .stat { min-width: 0; flex: 1 1 140px; }
  .jr-question { padding: 16px; gap: 18px; }
  .jr-table { gap: 18px 24px; }
  .jr-contre { padding-top: 0; flex-basis: 100%; text-align: center; margin: -8px 0; }
  .jr-choix { width: 100%; }
  .jr-btn { flex: 1; min-width: 0; }
  .jr-bilan { grid-template-columns: 1fr; }
  .jr-score { grid-row: auto; }
  .jr-progres { flex-basis: 100%; }
  .jr-pied .btn { flex: 1; justify-content: center; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
