/* CAP Loterie 2.0 — feuille de style unique, sans dépendance externe. */
:root {
  --bg: #f3f5fa;
  --surface: #ffffff;
  --surface-2: #f7f8fc;
  --surface-3: #eef1f7;
  --border: #e1e6ef;
  --border-strong: #cdd5e2;
  --text: #0f1a2c;
  --muted: #56647b;
  --subtle: #8692a6;
  --success: #15803d;
  --success-bg: #e7f6ec;
  --warning: #b45309;
  --warning-bg: #fdf3e2;
  --danger: #c62828;
  --danger-bg: #fdecec;
  --info-bg: #eaf1fe;
  --hit: #16a34a;
  --hit-2: #0f7a35;
  --accent: #1f4fd8;
  --accent-2: #0b2a7a;
  --accent-soft: #e9efff;
  --accent-ink: #ffffff;
  --extra: #e11d48;
  --extra-2: #9f1239;
  --radius: 14px;
  --radius-sm: 9px;
  --shadow: 0 1px 2px rgba(15, 26, 44, .05), 0 6px 20px rgba(15, 26, 44, .05);
  --shadow-lg: 0 18px 40px rgba(15, 26, 44, .14);
  --font: "Inter", "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
  color-scheme: light;
}
[data-game="euromillions"] {
  --accent: #4f46e5;
  --accent-2: #241b7a;
  --accent-soft: #eeedfe;
  --extra: #f2a900;
  --extra-2: #b07400;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0c1220;
    --surface: #131b2c;
    --surface-2: #172036;
    --surface-3: #1d2840;
    --border: #26324a;
    --border-strong: #34425f;
    --text: #e8edf6;
    --muted: #a3afc4;
    --subtle: #7d899f;
    --success-bg: #12301f;
    --warning-bg: #33260f;
    --danger-bg: #3a1618;
    --info-bg: #15264a;
    --accent-soft: #1b2a55;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 24px rgba(0, 0, 0, .25);
    color-scheme: dark;
  }
  :root { --accent: #5b82f0; --accent-2: #1a3a9e; }
  [data-game="euromillions"] { --accent: #7c74f2; --accent-2: #352a9c; --accent-soft: #26215a; }
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 80px; }
body { margin: 0; background: var(--bg); color: var(--text); font: 15px/1.5 var(--font); -webkit-font-smoothing: antialiased; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { margin: 0 0 .4em; line-height: 1.2; letter-spacing: -.01em; }
h1 { font-size: 1.75rem; }
h2 { font-size: 1.2rem; }
h3 { font-size: 1.02rem; }
p { margin: 0 0 .8em; }
small, .muted { color: var(--muted); }
.subtle { color: var(--subtle); }
.num, .ball, td.num, .tabular { font-variant-numeric: tabular-nums; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
svg.icon { width: 1.15em; height: 1.15em; vertical-align: -.2em; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: none; }
:focus-visible { outline: 3px solid color-mix(in srgb, var(--accent) 55%, transparent); outline-offset: 2px; border-radius: 6px; }

/* ── Barre d'application ─────────────────────────────────────────────── */
.appbar { position: sticky; top: 0; z-index: 30; display: flex; align-items: center; gap: 18px; height: 60px; padding: 0 24px;
  background: color-mix(in srgb, var(--surface) 88%, transparent); backdrop-filter: blur(10px); border-bottom: 1px solid var(--border); }
.brand { display: flex; align-items: center; gap: 10px; color: var(--text); font-weight: 800; letter-spacing: .02em; }
.brand:hover { text-decoration: none; }
.brand-mark { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 10px; color: #fff;
  background: linear-gradient(135deg, #1f4fd8, #4f46e5 55%, #e11d48); box-shadow: 0 4px 12px rgba(31, 79, 216, .35); font-size: 15px; }
.brand small { display: block; font-size: 10px; font-weight: 600; letter-spacing: .18em; color: var(--subtle); text-transform: uppercase; }
.switcher { display: flex; gap: 4px; padding: 4px; margin-left: 12px; background: var(--surface-3); border-radius: 999px; }
.switcher a { display: flex; align-items: center; gap: 7px; padding: 6px 16px; border-radius: 999px; color: var(--muted); font-weight: 600; font-size: 14px; }
.switcher a:hover { color: var(--text); text-decoration: none; }
.switcher a.active { color: #fff; background: var(--sw, var(--accent)); box-shadow: 0 2px 8px rgba(0, 0, 0, .15); }
.switcher a[data-g="loto"] { --sw: #1f4fd8; }
.switcher a[data-g="euromillions"] { --sw: #4f46e5; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: currentColor; display: inline-block; flex: none; }
.appbar-right { margin-left: auto; display: flex; align-items: center; gap: 12px; }
.icon-button { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--border); background: var(--surface); color: var(--muted);
  border-radius: 999px; padding: 6px 12px; font: 600 13px var(--font); cursor: pointer; }
.icon-button:hover { color: var(--text); border-color: var(--border-strong); }

/* ── Bandeau du jeu et navigation ────────────────────────────────────── */
.game-banner { color: #fff; background: radial-gradient(1200px 300px at 85% -40%, rgba(255, 255, 255, .22), transparent 60%),
  linear-gradient(120deg, var(--accent-2), var(--accent)); }
.game-banner-inner { max-width: 1240px; margin: 0 auto; padding: 22px 24px 0; }
.game-title { display: flex; align-items: center; gap: 14px; }
.game-title h1 { margin: 0; font-size: 1.9rem; letter-spacing: -.02em; }
.game-title p { margin: 0; opacity: .85; }
.game-logo { display: grid; place-items: center; width: 50px; height: 50px; border-radius: 15px; background: rgba(255, 255, 255, .16);
  border: 1px solid rgba(255, 255, 255, .28); font-size: 22px; font-weight: 800; }
.game-tabs { display: flex; gap: 2px; margin-top: 18px; overflow-x: auto; scrollbar-width: none; }
.game-tabs::-webkit-scrollbar { display: none; }
.game-tabs a { display: flex; align-items: center; gap: 8px; padding: 11px 16px; color: rgba(255, 255, 255, .82); font-weight: 600; white-space: nowrap;
  border-radius: 12px 12px 0 0; }
.game-tabs a:hover { color: #fff; background: rgba(255, 255, 255, .1); text-decoration: none; }
.game-tabs a.active { color: var(--text); background: var(--bg); }
.game-tabs a.active svg { color: var(--accent); }

.page { max-width: 1240px; margin: 0 auto; padding: 24px 24px 60px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 18px; flex-wrap: wrap; }
.page-head p { margin: 0; color: var(--muted); }
.eyebrow { display: block; font-size: 11.5px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--subtle); margin-bottom: 4px; }

/* ── Cartes ──────────────────────────────────────────────────────────── */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px; }
.card + .card, .card + section, section + .card, section + section { margin-top: 20px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.card-head h2, .card-head h3 { margin: 0; display: flex; align-items: center; gap: 9px; }
.card-head h2 svg { color: var(--accent); }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.stack > * + * { margin-top: 12px; }
.stat-card { display: flex; flex-direction: column; gap: 10px; min-height: 172px; }
.stat-card .stat-title { display: flex; align-items: center; gap: 8px; font-size: 12px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--subtle); }
.stat-card .stat-title svg { color: var(--accent); }
.big-date { display: inline-block; font-size: 1.35rem; font-weight: 750; letter-spacing: -.01em; }
.big-date::first-letter { text-transform: uppercase; }
.stat-card .foot { margin-top: auto; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }

/* ── Badges ──────────────────────────────────────────────────────────── */
.badge { display: inline-flex; align-items: center; gap: 5px; padding: 3px 9px; border-radius: 999px; font-size: 12px; font-weight: 650;
  background: var(--surface-3); color: var(--muted); white-space: nowrap; }
.badge.accent { background: var(--accent-soft); color: var(--accent); }
.badge.success { background: var(--success-bg); color: var(--success); }
.badge.warning { background: var(--warning-bg); color: var(--warning); }
.badge.danger { background: var(--danger-bg); color: var(--danger); }
.badge.gold { background: color-mix(in srgb, #f2a900 18%, var(--surface)); color: #8a5a00; }
@media (prefers-color-scheme: dark) { .badge.gold { color: #f6c453; } }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 5px 11px; border-radius: 999px; background: var(--surface-2);
  border: 1px solid var(--border); font-size: 13px; font-weight: 600; color: var(--muted); }
.status-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--subtle); box-shadow: 0 0 0 3px color-mix(in srgb, var(--subtle) 20%, transparent); flex: none; }
.tone-ok .status-dot, .status-dot.ok { background: var(--hit); box-shadow: 0 0 0 3px color-mix(in srgb, var(--hit) 22%, transparent); }
.tone-busy .status-dot, .status-dot.busy { background: #f59e0b; animation: pulse 1.2s infinite; }
.tone-error .status-dot, .status-dot.error { background: var(--danger); }
@keyframes pulse { 50% { box-shadow: 0 0 0 6px rgba(245, 158, 11, 0); } 0% { box-shadow: 0 0 0 0 rgba(245, 158, 11, .5); } }

/* ── Boutons et formulaires ──────────────────────────────────────────── */
.button { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 10px 16px; border-radius: 11px;
  border: 1px solid var(--border-strong); background: var(--surface); color: var(--text); font: 650 14px var(--font); cursor: pointer;
  transition: transform .06s, box-shadow .15s, background .15s; text-decoration: none !important; }
.button:hover { border-color: var(--accent); color: var(--accent); }
.button:active { transform: translateY(1px); }
.button.primary { background: linear-gradient(180deg, color-mix(in srgb, var(--accent) 92%, #fff), var(--accent)); color: var(--accent-ink);
  border-color: transparent; box-shadow: 0 6px 16px color-mix(in srgb, var(--accent) 35%, transparent); }
.button.primary:hover { color: #fff; filter: brightness(1.05); }
.button.ghost { background: transparent; border-color: transparent; color: var(--muted); }
.button.ghost:hover { background: var(--surface-3); color: var(--text); }
.button.danger { color: var(--danger); border-color: color-mix(in srgb, var(--danger) 40%, var(--border)); }
.button.small { padding: 6px 11px; font-size: 13px; border-radius: 9px; }
.button.block { width: 100%; }
.button[disabled], .button.is-busy { opacity: .6; pointer-events: none; }
.button-row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
label.field { display: flex; flex-direction: column; gap: 5px; font-size: 13px; font-weight: 650; color: var(--muted); }
label.field .help { font-weight: 450; font-size: 12px; color: var(--subtle); }
input[type=text], input[type=number], input[type=password], input[type=date], input[type=search], select {
  width: 100%; padding: 9px 11px; border: 1px solid var(--border-strong); border-radius: 10px; background: var(--surface); color: var(--text); font: 15px var(--font); }
input:focus, select:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 22%, transparent); }
input[type=range] { width: 100%; accent-color: var(--accent); }
input[type=file] { font: 14px var(--font); color: var(--muted); }
.fields { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 14px 16px; }
.switch { display: flex; align-items: flex-start; gap: 10px; cursor: pointer; font-size: 14px; font-weight: 600; color: var(--text); }
.switch input { position: absolute; opacity: 0; }
.switch .track { position: relative; width: 38px; height: 22px; border-radius: 999px; background: var(--border-strong); flex: none; transition: background .2s; margin-top: 1px; }
.switch .track::after { content: ""; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; transition: transform .2s; box-shadow: 0 1px 3px rgba(0,0,0,.3); }
.switch input:checked + .track { background: var(--accent); }
.switch input:checked + .track::after { transform: translateX(16px); }
.switch input:focus-visible + .track { outline: 3px solid color-mix(in srgb, var(--accent) 55%, transparent); outline-offset: 2px; }
.switch small { display: block; font-weight: 450; }
.range-value { font-weight: 750; color: var(--accent); }
details.drawer { border: 1px solid var(--border); border-radius: 12px; background: var(--surface-2); }
details.drawer > summary { list-style: none; cursor: pointer; padding: 11px 14px; display: flex; align-items: center; gap: 9px; font-weight: 650; color: var(--muted); }
details.drawer > summary::-webkit-details-marker { display: none; }
details.drawer > summary::after { content: "▾"; margin-left: auto; transition: transform .2s; }
details.drawer[open] > summary::after { transform: rotate(180deg); }
details.drawer > .drawer-body { padding: 4px 14px 16px; }

/* ── Boules, Chance, étoiles ─────────────────────────────────────────── */
.balls { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 7px; }
.ball { --size: 40px; position: relative; display: inline-grid; place-items: center; width: var(--size); height: var(--size); border-radius: 50%;
  font-weight: 800; font-size: calc(var(--size) * .4); color: #13213a;
  background: radial-gradient(circle at 32% 28%, #ffffff 0 16%, #f1f4fa 42%, #cdd5e3 100%);
  box-shadow: inset 0 -3px 6px rgba(15, 26, 44, .14), 0 1px 2px rgba(15, 26, 44, .2); }
.ball.extra { color: #fff; background: radial-gradient(circle at 32% 28%, color-mix(in srgb, var(--extra) 55%, #fff) 0 14%, var(--extra) 48%, var(--extra-2) 100%); }
[data-game="euromillions"] .ball.extra, .ball.star { color: #4a2f00; border-radius: 0; background: radial-gradient(circle at 50% 38%, #fff3c4 0 18%, #f6c12e 50%, #d48c00 100%);
  clip-path: polygon(50% 0%, 61.8% 35.5%, 98% 35.5%, 68.5% 57.5%, 79.5% 92%, 50% 70.5%, 20.5% 92%, 31.5% 57.5%, 2% 35.5%, 38.2% 35.5%);
  box-shadow: none; padding-top: calc(var(--size) * .13); font-size: calc(var(--size) * .37); width: calc(var(--size) * 1.2); height: calc(var(--size) * 1.2); }
.ball.sm { --size: 30px; }
.ball.xs { --size: 24px; }
.ball.lg { --size: 52px; }
.ball.hit:not(.extra) { color: #fff; background: radial-gradient(circle at 32% 28%, #8ee6ad 0 14%, var(--hit) 50%, var(--hit-2) 100%);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--hit) 28%, transparent), inset 0 -3px 6px rgba(0, 0, 0, .18); }
.ball.extra.hit { box-shadow: 0 0 0 3px color-mix(in srgb, var(--hit) 45%, transparent); }
[data-game="euromillions"] .ball.extra.hit { background: radial-gradient(circle at 50% 38%, #d9ffe6 0 18%, #3ccf72 50%, #148a3d 100%); color: #fff; }
.ball.hit::after { content: "✓"; position: absolute; right: -4px; top: -4px; width: 15px; height: 15px; border-radius: 50%; display: grid; place-items: center;
  font-size: 9px; background: var(--surface); color: var(--hit); box-shadow: 0 1px 3px rgba(0, 0, 0, .25); }
[data-game="euromillions"] .ball.extra.hit::after { display: none; }
.ball.unknown { color: var(--subtle); background: var(--surface-3); box-shadow: inset 0 0 0 2px var(--border-strong); }
.ball.unknown.extra { background: color-mix(in srgb, var(--extra) 14%, var(--surface)); color: var(--extra); }
.balls .sep { width: 1px; align-self: stretch; margin: 4px 3px; background: var(--border-strong); }
.ball.pop { animation: pop .45s cubic-bezier(.2, 1.4, .4, 1) both; }
@keyframes pop { from { transform: scale(.2) rotate(-40deg); opacity: 0; } to { transform: none; opacity: 1; } }

/* ── Prochain tirage / dernier résultat ──────────────────────────────── */
.countdown { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px; background: var(--accent-soft); color: var(--accent); font-weight: 700; font-size: 13px; }
.alert { display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; border-radius: 12px; border: 1px solid transparent; font-size: 14px; }
.alert svg { margin-top: 2px; }
.alert.warning { background: var(--warning-bg); color: var(--warning); border-color: color-mix(in srgb, var(--warning) 25%, transparent); }
.alert.info { background: var(--info-bg); color: var(--accent); }
.alert.danger { background: var(--danger-bg); color: var(--danger); }
.alert.success { background: var(--success-bg); color: var(--success); }
.alert .alert-body { flex: 1; }
.alert p { margin: 0; }

/* ── Génération ──────────────────────────────────────────────────────── */
.strategy-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; }
.strategy { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; padding: 14px; border-radius: 13px; text-align: left; cursor: pointer;
  border: 1px solid var(--border); background: var(--surface-2); color: var(--text); font: inherit; transition: border-color .15s, box-shadow .15s, transform .1s; }
.strategy:hover { border-color: var(--accent); box-shadow: 0 6px 18px color-mix(in srgb, var(--accent) 16%, transparent); transform: translateY(-1px); }
.strategy .s-icon { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 11px; color: #fff; background: var(--sc, var(--accent)); }
.strategy strong { font-size: 15px; }
.strategy span.s-desc { font-size: 12.5px; color: var(--muted); line-height: 1.35; }
.s-hybrid { --sc: #2563eb; } .s-overdue { --sc: #dc2626; } .s-dl { --sc: #7c3aed; } .s-consensus { --sc: #0d9488; } .s-exploratory { --sc: #64748b; } .s-legacy { --sc: #94a3b8; }
.generate-all { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-top: 14px; flex-wrap: wrap; }
.strategy-chip { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px 3px 4px; border-radius: 999px; font-size: 12.5px; font-weight: 700;
  background: color-mix(in srgb, var(--sc, var(--accent)) 12%, var(--surface)); color: var(--sc, var(--accent)); white-space: nowrap; }
.strategy-chip .mini { display: grid; place-items: center; width: 20px; height: 20px; border-radius: 50%; color: #fff; background: var(--sc, var(--accent)); }
.strategy-chip .mini svg { width: 12px; height: 12px; }

.job { margin-top: 16px; padding: 16px; border-radius: 13px; background: var(--surface-2); border: 1px solid var(--border); }
.job[hidden] { display: none; }
.job-head { display: flex; align-items: center; gap: 10px; font-weight: 650; }
.job-head .pct { margin-left: auto; font-variant-numeric: tabular-nums; color: var(--accent); font-weight: 800; }
.progress { position: relative; height: 12px; margin: 12px 0 8px; border-radius: 999px; background: var(--surface-3); overflow: hidden; }
.progress-bar { position: absolute; inset: 0 auto 0 0; width: 0; border-radius: inherit; transition: width .4s ease;
  background: linear-gradient(90deg, var(--accent), color-mix(in srgb, var(--accent) 55%, #22d3ee)); }
.progress-bar::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .35), transparent);
  animation: shimmer 1.4s infinite; transform: translateX(-100%); }
.job.done .progress-bar::after, .job.failed .progress-bar::after { display: none; }
.job.failed .progress-bar { background: var(--danger); }
.job.done .progress-bar { background: var(--hit); }
@keyframes shimmer { to { transform: translateX(100%); } }
.job-meta { font-size: 13px; color: var(--muted); display: flex; flex-wrap: wrap; gap: 4px 16px; }
.spinner { width: 18px; height: 18px; border-radius: 50%; border: 2.5px solid var(--border-strong); border-top-color: var(--accent); animation: spin .8s linear infinite; flex: none; }
.job.done .spinner, .job.failed .spinner { display: none; }
@keyframes spin { to { transform: rotate(360deg); } }
.steps { list-style: none; margin: 10px 0 0; padding: 0; display: grid; gap: 6px; font-size: 14px; }
.steps li { display: flex; gap: 8px; align-items: center; }
.steps .ok { color: var(--success); } .steps .ko { color: var(--danger); }
.results { display: grid; gap: 10px; margin-top: 14px; }
.result-row { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; padding: 12px 14px; border-radius: 12px; background: var(--surface);
  border: 1px solid var(--border); animation: slidein .35s ease both; }
@keyframes slidein { from { opacity: 0; transform: translateY(6px); } }

/* ── Frise tirages ↔ prédictions ─────────────────────────────────────── */
.toolbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.segmented { display: inline-flex; padding: 3px; border-radius: 11px; background: var(--surface-3); }
.segmented a { padding: 6px 12px; border-radius: 9px; color: var(--muted); font-weight: 650; font-size: 13.5px; }
.segmented a.active { background: var(--surface); color: var(--text); box-shadow: 0 1px 3px rgba(0, 0, 0, .12); }
.segmented a:hover { text-decoration: none; color: var(--text); }
.draw-group { border: 1px solid var(--border); border-radius: 14px; background: var(--surface); overflow: hidden; }
.draw-group + .draw-group { margin-top: 12px; }
.draw-head { display: grid; grid-template-columns: minmax(170px, 1.1fr) minmax(250px, 2fr) auto; gap: 14px; align-items: center; padding: 14px 16px; background: var(--surface-2); }
.draw-when .dow { display: block; font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--subtle); }
.draw-when strong { font-size: 1.02rem; }
.draw-when .ref { display: block; font-size: 12px; color: var(--subtle); }
.draw-summary { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.kind-upcoming { border-color: color-mix(in srgb, var(--accent) 45%, var(--border)); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 10%, transparent); }
.kind-upcoming .draw-head { background: var(--accent-soft); }
.kind-missing .draw-head, .kind-conflict .draw-head { background: var(--warning-bg); }
.grid-list { list-style: none; margin: 0; padding: 0; }
.grid-row { display: grid; grid-template-columns: 150px minmax(240px, 1fr) 150px 34px; gap: 12px; align-items: center; padding: 10px 16px; border-top: 1px solid var(--border); }
.grid-row:hover { background: color-mix(in srgb, var(--surface-2) 70%, transparent); }
.grid-row .when { font-size: 12.5px; color: var(--muted); display: flex; flex-direction: column; gap: 3px; }
.grid-row .score { display: flex; flex-direction: column; align-items: flex-end; gap: 3px; font-size: 13px; }
.score-main { font-weight: 800; font-size: 15px; }
.score-main.good { color: var(--hit); }
.grid-row.exploratory { opacity: .78; }
.empty-line { padding: 12px 16px; border-top: 1px dashed var(--border); color: var(--subtle); font-size: 14px; display: flex; gap: 8px; align-items: center; }
.delete-form button { border: 0; background: transparent; color: var(--subtle); cursor: pointer; padding: 6px; border-radius: 8px; }
.delete-form button:hover { color: var(--danger); background: var(--danger-bg); }
.pagination { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 16px; flex-wrap: wrap; }
.pagination .pages { color: var(--muted); font-size: 14px; }

/* ── Tableaux ────────────────────────────────────────────────────────── */
.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: 12px; }
table.data { width: 100%; border-collapse: collapse; font-size: 14px; background: var(--surface); }
table.data th { position: sticky; top: 0; text-align: left; font-size: 12px; letter-spacing: .06em; text-transform: uppercase; color: var(--subtle);
  background: var(--surface-2); padding: 10px 12px; border-bottom: 1px solid var(--border); white-space: nowrap; }
table.data td { padding: 9px 12px; border-bottom: 1px solid var(--border); vertical-align: middle; }
table.data tr:last-child td { border-bottom: 0; }
table.data tr:hover td { background: var(--surface-2); }
table.data td.num, table.data th.num { text-align: right; }
.filters { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; }
.filters label.field { min-width: 150px; }

/* ── Signaux ─────────────────────────────────────────────────────────── */
.heat-grid { display: grid; gap: 7px; }
.heat-grid.cols-7 { grid-template-columns: repeat(7, minmax(0, 1fr)); }
.heat-grid.cols-10 { grid-template-columns: repeat(10, minmax(0, 1fr)); }
.heat { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px; aspect-ratio: 1.6; border-radius: 11px;
  font-weight: 800; font-size: 16px; border: 1px solid transparent; color: var(--text); background: var(--surface-3); }
.heat small { font-size: 10.5px; font-weight: 650; opacity: .9; }
.heat .flag { position: absolute; top: 3px; right: 5px; font-size: 11px; }
.heat-0 { background: color-mix(in srgb, var(--accent) 4%, var(--surface)); }
.heat-1 { background: color-mix(in srgb, var(--accent) 9%, var(--surface)); }
.heat-2 { background: color-mix(in srgb, var(--accent) 15%, var(--surface)); }
.heat-3 { background: color-mix(in srgb, var(--accent) 22%, var(--surface)); }
.heat-4 { background: color-mix(in srgb, var(--accent) 30%, var(--surface)); }
.heat-5 { background: color-mix(in srgb, var(--accent) 39%, var(--surface)); }
.heat-6 { background: color-mix(in srgb, var(--accent) 50%, var(--surface)); color: #fff; }
.heat-7 { background: color-mix(in srgb, var(--accent) 62%, var(--surface)); color: #fff; }
.heat-8 { background: color-mix(in srgb, var(--accent) 76%, var(--surface)); color: #fff; }
.heat-9 { background: var(--accent); color: #fff; }
.legend { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--muted); flex-wrap: wrap; }
.legend .scale { display: flex; } .legend .scale span { width: 18px; height: 10px; }
.rank-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.rank-list li { display: grid; grid-template-columns: 34px 1fr 64px; gap: 10px; align-items: center; font-size: 14px; }
svg.bar { width: 100%; height: 9px; display: block; }
svg.bar .track { fill: var(--surface-3); }
svg.bar .fill { fill: var(--accent); }
svg.bar .fill.extra { fill: var(--extra); }
svg.bar .fill.warn { fill: #f59e0b; }
svg.bar .fill.base { fill: var(--subtle); }
.decade-row { display: grid; grid-template-columns: 60px 1fr 40px; gap: 10px; align-items: center; font-size: 14px; }

/* ── Bilan ───────────────────────────────────────────────────────────── */
.kpi { display: flex; flex-direction: column; gap: 6px; }
.kpi .value { font-size: 2rem; font-weight: 800; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.kpi .versus { font-size: 13px; color: var(--muted); }
.compare { display: grid; gap: 6px; margin-top: 6px; font-size: 12px; color: var(--muted); }
.compare div { display: grid; grid-template-columns: 70px 1fr 46px; gap: 8px; align-items: center; }
.verdict { font-weight: 750; }
.verdict.good { color: var(--success); } .verdict.bad { color: var(--danger); } .verdict.neutral { color: var(--muted); }
.histogram { display: flex; align-items: flex-end; gap: 12px; height: 150px; padding-top: 10px; }
.histogram .col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px; height: 100%; justify-content: flex-end; font-size: 12px; color: var(--muted); }
.histogram svg { width: 100%; flex: 1; }
.histogram svg rect { fill: var(--accent); }
.note { font-size: 13.5px; color: var(--muted); border-left: 3px solid var(--accent); padding: 4px 0 4px 12px; }

/* ── Modèle ──────────────────────────────────────────────────────────── */
.model-card { display: grid; grid-template-columns: 1.3fr 1fr; gap: 20px; }
.kv { display: grid; grid-template-columns: max-content 1fr; gap: 6px 16px; font-size: 14px; margin: 0; }
.kv dt { color: var(--subtle); }
.kv dd { margin: 0; font-weight: 600; }
.chart { width: 100%; height: 190px; background: var(--surface-2); border-radius: 12px; border: 1px solid var(--border); }
.chart .axis { stroke: var(--border-strong); stroke-width: 1; }
.chart .grid { stroke: var(--border); stroke-dasharray: 3 4; }
.chart .line-loss { stroke: var(--subtle); fill: none; stroke-width: 2; }
.chart .line-val { stroke: var(--accent); fill: none; stroke-width: 2.5; }
.chart .line-ref { stroke: var(--danger); stroke-dasharray: 6 5; fill: none; stroke-width: 1.5; }
.chart text { fill: var(--subtle); font-size: 11px; font-family: var(--font); }
.chart .best { fill: var(--hit); }
.legend-line { display: inline-flex; align-items: center; gap: 6px; }
.legend-line i { width: 18px; height: 3px; border-radius: 2px; background: var(--subtle); display: inline-block; }
.legend-line i.val { background: var(--accent); } .legend-line i.ref { background: var(--danger); }

/* ── Divers ──────────────────────────────────────────────────────────── */
.flash { display: flex; align-items: center; gap: 12px; max-width: 1240px; margin: 16px auto 0; padding: 12px 16px; border-radius: 12px; font-weight: 600;
  background: var(--success-bg); color: var(--success); border: 1px solid color-mix(in srgb, var(--success) 25%, transparent); }
.flash.error { background: var(--danger-bg); color: var(--danger); border-color: color-mix(in srgb, var(--danger) 25%, transparent); }
.flash button { margin-left: auto; border: 0; background: transparent; color: inherit; font-size: 20px; cursor: pointer; line-height: 1; }
.flash-wrap { padding: 0 24px; }
.toast-zone { position: fixed; right: 20px; bottom: 20px; z-index: 50; display: grid; gap: 10px; }
.toast { min-width: 260px; max-width: 380px; padding: 12px 14px; border-radius: 12px; background: var(--text); color: var(--bg); box-shadow: var(--shadow-lg); font-size: 14px; animation: slidein .25s ease both; }
.toast.error { background: var(--danger); color: #fff; }
.footer { max-width: 1240px; margin: 0 auto; padding: 0 24px 30px; color: var(--subtle); font-size: 12.5px; display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.game-cards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
.game-card { position: relative; overflow: hidden; padding: 0; }
.game-card .gc-top { color: #fff; padding: 22px; background: radial-gradient(600px 200px at 100% -30%, rgba(255, 255, 255, .22), transparent 60%), linear-gradient(120deg, var(--accent-2), var(--accent)); }
.game-card .gc-top h2 { font-size: 1.6rem; margin: 0; }
.game-card .gc-body { padding: 20px 22px 22px; display: grid; gap: 14px; }
.hero { padding: 34px 0 10px; }
.hero h1 { font-size: 2.1rem; }
.login-shell { min-height: 100vh; display: grid; grid-template-columns: 1.1fr 1fr; }
.login-art { color: #fff; padding: 56px; display: flex; flex-direction: column; justify-content: space-between;
  background: radial-gradient(800px 400px at 0% 0%, rgba(255, 255, 255, .16), transparent 60%), linear-gradient(140deg, #0b2a7a, #1f4fd8 45%, #4f46e5 75%, #7c3aed); }
.login-art h1 { font-size: 2.4rem; max-width: 18ch; }
.login-art small { color: rgba(255, 255, 255, .75); }
.login-art .balls { margin-top: 26px; }
.login-panel { display: grid; place-items: center; padding: 40px 24px; background: var(--bg); }
.login-panel form { width: min(380px, 100%); display: grid; gap: 14px; }
.error-page { text-align: center; max-width: 560px; margin: 40px auto; }
.error-page .big { font-size: 3rem; font-weight: 800; color: var(--accent); }
.mt-0 { margin-top: 0 !important; } .mt-1 { margin-top: 8px; } .mt-2 { margin-top: 16px; } .mb-0 { margin-bottom: 0; }
.right { margin-left: auto; }
.hide-mobile { }

/* ── Adaptatif ───────────────────────────────────────────────────────── */
@media (max-width: 1100px) {
  .strategy-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 900px) {
  .grid-3, .grid-2, .model-card, .game-cards { grid-template-columns: 1fr; }
  .draw-head { grid-template-columns: 1fr; }
  .draw-summary { justify-content: flex-start; }
  .grid-row { grid-template-columns: 1fr auto; }
  .grid-row .when { grid-column: 1 / -1; flex-direction: row; flex-wrap: wrap; gap: 8px; align-items: center; }
  .grid-row .score { align-items: flex-start; }
  .login-shell { grid-template-columns: 1fr; }
  .login-art { padding: 32px 24px; }
}
@media (max-width: 640px) {
  body { font-size: 14px; }
  .appbar { padding: 0 14px; gap: 10px; }
  .brand > span:last-child { display: none; }
  .switcher { margin-left: 0; }
  .switcher a { padding: 6px 11px; }
  .appbar-right .label { display: none; }
  .page, .game-banner-inner, .footer { padding-left: 16px; padding-right: 16px; }
  .strategy-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ball { --size: 34px; } .ball.sm { --size: 27px; } .ball.lg { --size: 42px; }
  .heat-grid.cols-10 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
  .hide-mobile { display: none; }
  .card { padding: 16px; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }
.login-art .brand { color: #fff; }
.login-art .brand-mark { background: rgba(255, 255, 255, .18); box-shadow: none; border: 1px solid rgba(255, 255, 255, .3); }
.error-page .button-row { justify-content: center; }
.grid-3 > *, .grid-2 > *, .game-cards > * { margin-top: 0 !important; }
.results > .button { justify-self: start; }
