:root {
  color-scheme: dark;
  --bg: #0d1117; --panel: #161b24; --panel2: #1d2430; --line: #2a3342; --text: #e6e9ef; --muted: #8b95a7;
  --blue: #3b82f6; --blue-soft: rgba(59,130,246,.15); --red: #ef4444; --red-soft: rgba(239,68,68,.15);
  --accent: #f5c542; --radius: 10px;
  --blue-text: #60a5fa; --red-text: #f87171; --accent-text: #f5c542; --win-text: #22c55e;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text); font: 15px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
a { color: var(--muted); }
.hidden { display: none !important; }

.top { display: flex; align-items: center; justify-content: space-between; padding: 14px 24px; border-bottom: 1px solid var(--line); flex-wrap: wrap; gap: 10px; }
.brand { display: flex; align-items: baseline; gap: 12px; }
.logo { font-size: 26px; font-weight: 800; letter-spacing: -.5px; }
.logo b { color: var(--accent-text); }
.tag { color: var(--muted); }
nav { display: flex; gap: 18px; align-items: center; }
nav a { text-decoration: none; color: var(--text); font-weight: 600; }
nav a.on { border-bottom: 2px solid var(--accent); padding-bottom: 2px; }
nav .soon { color: var(--muted); }
nav .soon i { font-size: 11px; background: var(--panel2); padding: 1px 6px; border-radius: 8px; font-style: normal; margin-left: 4px; }

.layout { display: grid; grid-template-columns: 160px minmax(0, 1fr) 160px; gap: 20px; max-width: 1500px; margin: 0 auto; padding: 20px; }
.ad { min-height: 600px; }            /* emplacements réservés aux pubs (vides pour l'instant) */
@media (max-width: 1200px) { .layout { grid-template-columns: 1fr; } .ad { display: none; } }

.intro { color: var(--muted); margin: 0 0 16px; }

.draft { display: grid; grid-template-columns: 220px minmax(0, 1fr) 220px; gap: 16px; align-items: start; }
@media (max-width: 900px) { .draft { grid-template-columns: 1fr 1fr; } .picker { grid-column: 1 / -1; order: 3; } }

.team { display: flex; flex-direction: column; gap: 8px; }
.slot { display: flex; align-items: center; gap: 10px; padding: 8px; border-radius: var(--radius); background: var(--panel); border: 2px solid transparent; cursor: pointer; min-height: 64px; }
.team.blue .slot { border-left: 4px solid var(--blue); }
.team.red .slot { border-right: 4px solid var(--red); flex-direction: row-reverse; text-align: right; }
.slot.active { border-color: var(--accent); }
.slot img, .slot .empty { width: 48px; height: 48px; border-radius: 8px; background: var(--panel2); flex: none; }
.slot .role { font-size: 12px; color: var(--muted); }
.slot .name { font-weight: 600; }
.slot .x { margin-left: auto; color: var(--muted); padding: 0 4px; }
.team.red .slot .x { margin-left: 0; margin-right: auto; }

.picker { background: var(--panel); border-radius: var(--radius); padding: 12px; }
.filters { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 10px; }
#search { flex: 1; min-width: 180px; padding: 9px 12px; border-radius: 8px; border: 1px solid var(--line); background: var(--panel2); color: var(--text); font-size: 15px; }
.roles { display: flex; gap: 4px; flex-wrap: wrap; }
.roles button { background: var(--panel2); color: var(--muted); border: 1px solid var(--line); padding: 7px 10px; border-radius: 8px; cursor: pointer; font-size: 13px; }
.roles button.on { color: var(--text); border-color: var(--accent); }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(64px, 1fr)); gap: 8px; max-height: 420px; overflow-y: auto; padding-right: 4px; }
.champ { background: none; border: 0; padding: 0; cursor: pointer; color: var(--text); text-align: center; font-size: 11px; }
.champ img { width: 100%; aspect-ratio: 1; border-radius: 8px; display: block; border: 2px solid transparent; }
.champ:hover img { border-color: var(--accent); }
.champ.taken { opacity: .25; cursor: default; }
.champ span { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 2px; }

.actions { display: flex; justify-content: center; gap: 12px; margin: 18px 0; }
button#go, button.ghost { font-size: 16px; font-weight: 700; padding: 12px 34px; border-radius: 10px; cursor: pointer; border: 0; }
button#go { background: var(--accent); color: #111; }
button#go:disabled { opacity: .35; cursor: default; }
button.ghost { background: none; color: var(--muted); border: 1px solid var(--line); font-weight: 600; }

.result { background: var(--panel); border-radius: var(--radius); padding: 20px; }
.bar { display: grid; grid-template-columns: auto 1fr auto; gap: 16px; align-items: center; }
.side { display: flex; flex-direction: column; }
.side.r { text-align: right; }
.side .label { color: var(--muted); font-size: 13px; }
.side .pct { font-size: 36px; font-weight: 800; }
.side.b .pct { color: var(--blue-text); }
.side.r .pct { color: var(--red-text); }
.meter { height: 14px; border-radius: 7px; background: var(--red); overflow: hidden; }
#fill, .fill { height: 100%; background: var(--blue); width: 50%; transition: width .6s; }
.note { text-align: center; color: var(--muted); margin: 10px 0 0; }
.cols { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 16px; }
@media (max-width: 800px) { .cols { grid-template-columns: 1fr; } }
.box { background: var(--panel2); border-radius: var(--radius); padding: 14px 16px; }
.box h2 { font-size: 16px; margin: 0 0 10px; }
.reasons { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.reasons li { padding: 8px 10px; border-radius: 8px; display: flex; gap: 10px; align-items: baseline; }
.reasons li.bleu { background: var(--blue-soft); }
.reasons li.rouge { background: var(--red-soft); }
.reasons .pts { font-weight: 800; white-space: nowrap; }
.reasons li.bleu .pts { color: var(--blue-text); }
.reasons li.rouge .pts { color: var(--red-text); }
.lanes { width: 100%; border-collapse: collapse; }
.lanes td { padding: 6px 4px; border-bottom: 1px solid var(--line); }
.lanes td.mid { text-align: center; color: var(--muted); font-size: 13px; }
.lanes td.r { text-align: right; }
.lanes .win { font-weight: 700; }
.box.plan.bleu { border-left: 4px solid var(--blue); }
.box.plan.rouge { border-left: 4px solid var(--red); }
.box.plan p { margin: 6px 0 0; color: var(--muted); }
.fine { color: var(--muted); font-size: 13px; margin: 16px 0 0; }

footer { border-top: 1px solid var(--line); padding: 18px 24px; color: var(--muted); font-size: 12px; text-align: center; }
footer p { max-width: 900px; margin: 6px auto; }

.actions { align-items: center; flex-wrap: wrap; }
.rank { display: flex; flex-direction: column; font-size: 12px; color: var(--muted); gap: 4px; }
.rank select { background: var(--panel2); color: var(--text); border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; font-size: 15px; }

/* barre d'outils au-dessus de la draft : rang en haut à gauche */
.toolbar { display: flex; align-items: center; gap: 20px; margin: 0 0 14px; }
.toolbar .intro { margin: 0; }
@media (max-width: 700px) { .toolbar { flex-direction: column; align-items: stretch; } }
.toolbar .rank select { min-width: 180px; }

/* barres de défilement discrètes, aux couleurs du site */
* { scrollbar-width: thin; scrollbar-color: var(--line) transparent; }
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--line); border-radius: 8px; }
::-webkit-scrollbar-thumb:hover { background: var(--muted); }

/* synergies */
.box.syn { margin-top: 16px; }
.box .hint { font-size: 12px; font-weight: 400; color: var(--muted); }
.cols.tight { margin-top: 0; }
.synside h3 { font-size: 13px; margin: 0 0 6px; color: var(--muted); font-weight: 600; }
.synside.bleu h3 { color: var(--blue-text); }
.synside.rouge h3 { color: var(--red-text); }
.synside ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.synside li { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 6px 8px; border-radius: 8px; background: var(--panel); }
.synside .duo { display: flex; align-items: center; gap: 4px; }
.synside .duo img { width: 28px; height: 28px; border-radius: 6px; }
.synside .duo > span { margin-left: 6px; line-height: 1.2; }
.synside small { color: var(--muted); font-size: 11px; }
.synside b { white-space: nowrap; }
.synside b.good { color: #4ade80; }
.synside b.bad { color: #f87171; }
.synside b.flat { color: var(--muted); font-weight: 400; }

/* ---------- draft en direct ---------- */
a.logo { text-decoration: none; color: var(--text); }
.muted { color: var(--muted); margin: 0 0 8px; }
b.b, span.b { color: var(--blue-text); } b.r, span.r { color: var(--red-text); }
.steps { display: flex; gap: 4px; flex-wrap: wrap; justify-content: center; margin: 4px 0 8px; }
.step { width: 26px; height: 26px; border-radius: 6px; display: grid; place-items: center; font-size: 12px; background: var(--panel); border: 1px solid var(--line); color: var(--muted); }
.step.b { border-bottom: 3px solid var(--blue); } .step.r { border-bottom: 3px solid var(--red); }
.step.past { opacity: .35; }
.step.cur { border-color: var(--accent); color: var(--text); transform: scale(1.15); }
.now { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin: 6px 0 12px; flex-wrap: wrap; }
.now-actions { display: flex; gap: 8px; }
button.ghost.small { font-size: 13px; padding: 6px 12px; }
button.ghost:disabled { opacity: .35; cursor: default; }
.bar.live { background: var(--panel); border-radius: var(--radius); padding: 10px 16px; margin-bottom: 14px; }
.bar.live .pct { font-size: 26px; }
.bans { display: flex; gap: 6px; margin-bottom: 8px; }
.bans.r { justify-content: flex-end; }
.ban { width: 36px; height: 36px; border-radius: 6px; background: var(--panel); border: 1px dashed var(--line); overflow: hidden; }
.ban img { width: 100%; height: 100%; filter: grayscale(1); opacity: .7; }
.advice { margin-top: 16px; }
.advice h2 .b { color: var(--blue-text); } .advice h2 .r { color: var(--red-text); }
.role-block { margin-bottom: 12px; }
.role-block h3 { font-size: 13px; color: var(--muted); margin: 0 0 6px; text-transform: uppercase; letter-spacing: .5px; }
.tips { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 8px; }
.tip { display: flex; gap: 10px; align-items: flex-start; text-align: left; background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 8px; color: var(--text); cursor: pointer; font: inherit; }
.tip:hover { border-color: var(--accent); }
.tip img { width: 42px; height: 42px; border-radius: 6px; flex: none; }
.tip-txt { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.tip small { color: var(--muted); font-size: 12px; }
.tip .fear { color: #f0a0a0; }
.badge { font-style: normal; font-size: 11px; padding: 1px 6px; border-radius: 6px; width: fit-content; }
.badge.safe { background: rgba(74,222,128,.15); color: #4ade80; }
.badge.late { background: rgba(245,197,66,.15); color: var(--accent-text); }
a.btn { display: inline-block; background: var(--accent); color: #111; font-weight: 700; padding: 12px 28px; border-radius: 10px; text-decoration: none; }

.rolepick { margin-top: 2px; background: var(--panel2); color: var(--muted); border: 1px solid var(--line); border-radius: 6px; font-size: 11px; padding: 1px 4px; }
.team.red .rolepick { margin-left: auto; }
.tip .pos { color: var(--accent-text); font-weight: 600; }

/* ---------- thème clair ---------- */
[data-theme="light"] {
  color-scheme: light;
  --bg: #f4f5f8; --panel: #ffffff; --panel2: #eceff4; --line: #d5dae3; --text: #141922; --muted: #5b6474;
  --blue: #2563eb; --blue-soft: rgba(37,99,235,.10); --red: #dc2626; --red-soft: rgba(220,38,38,.10); --accent: #d39400;
  --blue-text: #1d4ed8; --red-text: #b91c1c; --accent-text: #8a5a00; --win-text: #15803d;
}
[data-theme="light"] .synside b.good { color: #15803d; }
[data-theme="light"] .synside b.bad { color: #b91c1c; }
[data-theme="light"] .tip .fear { color: #b91c1c; }
[data-theme="light"] .slot img, [data-theme="light"] .champ img { box-shadow: 0 1px 2px rgba(0,0,0,.12); }

/* ---------- en-tête : langue et thème ---------- */
.tools { display: flex; gap: 6px; margin-left: 6px; }
.tool { background: var(--panel2); color: var(--text); border: 1px solid var(--line); border-radius: 8px; padding: 4px 9px; cursor: pointer; font-weight: 700; font-size: 13px; min-width: 36px; }
.tool:hover { border-color: var(--accent); }

/* ---------- Match ---------- */
.page-title { margin: 0 0 6px; font-size: 26px; }
.center { text-align: center; }
.modes { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; margin-top: 14px; }
@media (max-width: 900px) { .modes { grid-template-columns: 1fr; } }
.mode { display: flex; flex-direction: column; gap: 10px; }
.mode h2 { font-size: 19px; margin: 0; }
.mode.off { border: 1px dashed var(--line); }
.soon-tag { font-size: 11px; background: var(--panel); padding: 1px 7px; border-radius: 8px; font-style: normal; color: var(--muted); vertical-align: middle; }
.field { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--muted); }
.field input { background: var(--panel); color: var(--text); border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; font-size: 15px; }
.mode .rank select { width: 100%; }
.sep { border-top: 1px solid var(--line); margin: 6px 0; }
button.btn, a.btn { display: inline-block; background: var(--accent); color: #111; font-weight: 700; padding: 11px 24px; border-radius: 10px; text-decoration: none; border: 0; cursor: pointer; font-size: 15px; text-align: center; }
button.btn.ghost, a.btn.ghost { background: none; color: var(--text); border: 1px solid var(--line); }
button.btn:disabled { opacity: .4; cursor: default; }
.center-box { max-width: 520px; margin: 30px auto; text-align: center; display: flex; flex-direction: column; gap: 12px; align-items: center; }
.center-box.wide { max-width: 900px; }
.center-box .field { width: 100%; text-align: left; }
.code-big { font-size: 44px; font-weight: 800; letter-spacing: 8px; color: var(--accent-text); }
.link-line code { background: var(--panel); padding: 4px 8px; border-radius: 6px; font-size: 13px; }
.match-head { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 12px; margin-bottom: 6px; }
.match-head .who { font-size: 20px; font-weight: 800; }
.match-head .who.b { color: var(--blue-text); }
.match-head .who.r { color: var(--red-text); text-align: right; }
.match-head .who small { color: var(--muted); font-weight: 400; font-size: 13px; }
.clock { font-size: 30px; font-weight: 800; min-width: 80px; text-align: center; font-variant-numeric: tabular-nums; }
.clock.hurry { color: var(--red-text); }
.turn { text-align: center; margin: 4px 0 12px; color: var(--muted); }
.turn.b b { color: var(--blue-text); } .turn.r b { color: var(--red-text); }
.flash { text-align: center; color: var(--red-text); min-height: 0; margin: 0; opacity: 0; transition: opacity .3s; }
.flash.on, #flash2:not(:empty) { opacity: 1; margin-bottom: 8px; }
.grid.locked .champ { cursor: not-allowed; }
.grid.locked .champ:hover img { border-color: transparent; }
.roles-box { text-align: left; }
.roles-box h3.b { color: var(--blue-text); } .roles-box h3.r { color: var(--red-text); }
.role-row { display: flex; align-items: center; gap: 10px; padding: 5px 0; border-bottom: 1px solid var(--line); }
.role-row img { width: 36px; height: 36px; border-radius: 6px; }
.role-row b { flex: 1; }
.role-row select { background: var(--panel); color: var(--text); border: 1px solid var(--line); border-radius: 6px; padding: 5px 8px; }
.end { text-align: center; margin: 10px 0 18px; }
.end h1 { font-size: 40px; margin: 0; }
.end.won h1 { color: var(--win-text); } .end.lost h1 { color: var(--red-text); }
.pulse { animation: pulse 1s infinite alternate; }
@keyframes pulse { from { box-shadow: 0 0 0 0 rgba(245,197,66,.6); } to { box-shadow: 0 0 0 8px rgba(245,197,66,0); } }
.center-box .cols { width: 100%; }
.center-box .cols.one { grid-template-columns: minmax(0, 420px); justify-content: center; }

/* ---------- accessibilité ---------- */
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip { position: absolute; left: 12px; top: -60px; background: var(--accent); color: #111; padding: 8px 14px; border-radius: 8px; font-weight: 700; z-index: 10; text-decoration: none; }
.skip:focus { top: 10px; }
:focus-visible { outline: 3px solid var(--accent-text); outline-offset: 2px; border-radius: 6px; }
.slot:focus-visible { outline-offset: 0; }
::placeholder { color: var(--muted); opacity: 1; }
button.x { background: none; border: 0; color: var(--muted); cursor: pointer; font-size: 15px; padding: 2px 6px; margin-left: auto; }
.team.red button.x { margin-left: 0; margin-right: auto; }
[data-theme="light"] .badge.safe { color: #15803d; }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}

/* ---------- pages légales ---------- */
html[lang="fr"] [data-only="en"], html[lang="en"] [data-only="fr"] { display: none; }
main.legal { max-width: 860px; margin: 0 auto; padding: 24px 20px 40px; }
main.legal h1 { font-size: 28px; margin: 0 0 4px; }
main.legal h2 { font-size: 19px; margin: 26px 0 8px; }
main.legal p, main.legal li { line-height: 1.6; }
main.legal a { color: var(--blue-text); }
main.legal mark { background: #fde68a; color: #111; padding: 0 4px; border-radius: 4px; }
.legal-table { width: 100%; border-collapse: collapse; font-size: 14px; margin: 8px 0; }
.legal-table th, .legal-table td { border: 1px solid var(--line); padding: 8px; text-align: left; vertical-align: top; }
.legal-table th { background: var(--panel2); }
@media (max-width: 700px) { .legal-table { display: block; overflow-x: auto; } }
footer .legal-links a { color: var(--muted); }

.slot { padding: 0; }
.slot-btn { display: flex; align-items: center; gap: 10px; flex: 1; min-width: 0; background: none; border: 0; color: inherit; font: inherit; text-align: inherit; padding: 8px; cursor: pointer; border-radius: var(--radius); }
.team.red .slot-btn { flex-direction: row-reverse; }
.slot-btn img, .slot-btn .empty { width: 48px; height: 48px; border-radius: 8px; background: var(--panel2); flex: none; display: block; }
.slot-txt { display: flex; flex-direction: column; }
.slot-txt .role { font-size: 12px; color: var(--muted); }
.slot-txt .name { font-weight: 600; }
footer nav.legal-links { display: block; text-align: center; margin: 6px auto; }
footer nav.legal-links a { font-weight: 400; margin: 0 4px; }
