:root { color-scheme: dark; --bg:#0d1117; --panel:#161b22; --line:#2a323d; --fg:#e6edf3; --muted:#8b949e; --accent:#f97316; }
* { box-sizing: border-box; }
body { margin:0; min-height:100vh; background:var(--bg); color:var(--fg); font:16px/1.45 system-ui,-apple-system,"Segoe UI",sans-serif; display:flex; align-items:center; justify-content:center; padding:16px; }
h1 { margin:0 0 12px; font-size:1.5rem; } h1 small { font-size:.8rem; color:var(--muted); font-weight:400; margin-left:6px; }
.card { background:var(--panel); border:1px solid var(--line); border-radius:12px; padding:24px; width:min(440px,100%); display:flex; flex-direction:column; gap:12px; }
label { display:flex; flex-direction:column; gap:4px; font-size:.9rem; color:var(--muted); }
select, button { font:inherit; padding:8px 10px; border-radius:8px; border:1px solid var(--line); background:#0d1117; color:var(--fg); }
button { cursor:pointer; } button:hover { border-color:var(--accent); }
button.primary { background:var(--accent); border-color:var(--accent); color:#111; font-weight:600; padding:10px; }
.muted { color:var(--muted); font-size:.85rem; margin:0; }
[hidden] { display:none !important; }

#stage { display:flex; gap:16px; align-items:flex-start; width:100%; max-width:1100px; justify-content:center; flex-wrap:wrap; }
.board { position:relative; flex:0 1 720px; min-width:0; }
canvas { display:block; width:100%; height:auto; border:1px solid var(--line); border-radius:8px; background:#000; }
#overlay { position:absolute; inset:0; display:flex; flex-direction:column; align-items:center; justify-content:center; background:rgba(0,0,0,.6); border-radius:8px; text-align:center; }
#overlay h2 { margin:0 0 8px; font-size:2rem; }
aside { width:230px; display:flex; flex-direction:column; gap:12px; }
#hud { background:var(--panel); border:1px solid var(--line); border-radius:12px; padding:12px; display:flex; flex-direction:column; gap:6px; font-size:.9rem; }
.hud-title { color:var(--accent); font-weight:600; min-height:1.4em; }
.hud-row { display:flex; align-items:center; gap:8px; } .hud-row i { width:12px; height:12px; border-radius:50%; flex:none; }
.hud-row b { font-weight:500; flex:1; } .hud-stats { color:var(--muted); font-size:.8rem; white-space:nowrap; }
.hud-row.dead { opacity:.4; text-decoration:line-through; }
.hud-help { margin-top:8px; padding-top:8px; border-top:1px solid var(--line); color:var(--muted); font-size:.78rem; }

label.check { flex-direction:row; align-items:center; gap:8px; color:var(--fg); cursor:pointer; }
label.check input { width:16px; height:16px; accent-color:var(--accent); }
#legend { background:var(--panel); border:1px solid var(--line); border-radius:12px; padding:12px; font-size:.82rem; display:flex; flex-direction:column; gap:8px; }
#legend h3 { margin:0; font-size:.85rem; font-weight:600; color:var(--muted); }
.lg-row { display:flex; align-items:center; gap:10px; }
.lg-row canvas { width:30px; height:30px; flex:none; border:0; border-radius:6px; background:none; }
.lg-row b { display:block; font-weight:600; } .lg-row span { color:var(--muted); font-size:.76rem; line-height:1.25; display:block; }
.lg-note { color:var(--muted); font-size:.74rem; border-top:1px solid var(--line); padding-top:8px; }

.card.wide { width:min(760px,100%); }
.card h2 { margin:0 0 4px; font-size:1.05rem; }
.split { display:grid; grid-template-columns:1fr 1fr; gap:24px; }
.split section { display:flex; flex-direction:column; gap:12px; }
@media (max-width:640px) { .split { grid-template-columns:1fr; } }
input[type=text], input:not([type]) { font:inherit; padding:8px 10px; border-radius:8px; border:1px solid var(--line); background:#0d1117; color:var(--fg); }
#code { text-transform:uppercase; letter-spacing:.3em; font-weight:600; text-align:center; }
.error { background:#3b1219; border:1px solid #7f1d1d; color:#fecaca; border-radius:8px; padding:8px 12px; font-size:.9rem; }
.codebox { display:flex; flex-direction:column; align-items:center; gap:6px; padding:12px; border:1px dashed var(--line); border-radius:10px; }
.codebox strong { font-size:2.4rem; letter-spacing:.3em; padding-left:.3em; color:var(--accent); }
.slots { list-style:none; margin:0; padding:0; display:grid; grid-template-columns:1fr 1fr; gap:6px; }
.slots li { background:#0d1117; border:1px solid var(--line); border-radius:8px; padding:6px 10px; font-size:.9rem; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.slots li.empty { color:var(--muted); border-style:dashed; }
#overlay button { margin-top:8px; min-width:220px; }
button:disabled { opacity:.5; cursor:not-allowed; }

/* ---------- liste des parties ---------- */
.row-between { display:flex; align-items:center; justify-content:space-between; gap:8px; }
button.small { padding:4px 10px; font-size:.8rem; }
#sessions { display:flex; flex-direction:column; gap:8px; }
.sessions { list-style:none; margin:0; padding:0; display:flex; flex-direction:column; gap:6px; max-height:260px; overflow-y:auto; }
.sessions li { display:flex; align-items:center; gap:12px; background:#0d1117; border:1px solid var(--line); border-radius:10px; padding:8px 12px; }
.sessions .info { flex:1; min-width:0; }
.sessions .title { font-weight:600; }
.sessions .sub { color:var(--muted); font-size:.8rem; }
.sessions .count { font-variant-numeric:tabular-nums; color:var(--fg); white-space:nowrap; }
.badge { font-size:.72rem; padding:2px 8px; border-radius:999px; border:1px solid var(--line); color:var(--muted); white-space:nowrap; }
.badge.warn { color:#fbbf24; border-color:#78561a; }
