/* Palette Accenture : violet #A100FF, #7500C0, #460073, accents #BE82FF / #DCAFFF, noir. */
:root {
  --purple: #a100ff;
  --purple-2: #7500c0;
  --purple-3: #460073;
  --lilac: #be82ff;
  --lilac-2: #dcafff;
  --bg: #07000d;
  --panel: rgba(255, 255, 255, 0.045);
  --panel-2: rgba(255, 255, 255, 0.08);
  --line: rgba(220, 175, 255, 0.16);
  --text: #f6f0ff;
  --muted: #b9a8cc;
  --ok: #2fd99a;
  --ko: #ff4f7b;
  --warn: #ffb547;
  --radius: 18px;
  --font: "Graphik", "Inter", "Segoe UI", system-ui, -apple-system, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  font-family: var(--font);
  color: var(--text);
  background:
    radial-gradient(1100px 600px at 85% -10%, rgba(161, 0, 255, 0.35), transparent 60%),
    radial-gradient(900px 500px at -10% 110%, rgba(117, 0, 192, 0.35), transparent 60%),
    var(--bg);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--lilac); }
a:hover { color: var(--lilac-2); }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.small { font-size: 13px; }

/* ---------- marque ---------- */
.brand { display: flex; align-items: center; gap: 12px; font-weight: 700; letter-spacing: 0.02em; }
.chevron {
  font-weight: 800; color: var(--purple); line-height: 1;
  text-shadow: 0 0 24px rgba(161, 0, 255, 0.7);
}
.brand .chevron { font-size: 34px; }
.brand small { display: block; font-weight: 500; color: var(--muted); font-size: 12px; letter-spacing: 0.08em; text-transform: uppercase; }

/* ---------- composants ---------- */
.card {
  background: linear-gradient(180deg, var(--panel-2), var(--panel));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  backdrop-filter: blur(14px);
  box-shadow: 0 30px 80px -40px rgba(161, 0, 255, 0.55);
}
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: 0; border-radius: 999px; padding: 12px 22px;
  font: 600 15px var(--font); color: #fff; cursor: pointer;
  background: linear-gradient(135deg, var(--purple), var(--purple-2));
  box-shadow: 0 10px 30px -10px rgba(161, 0, 255, 0.8);
  transition: transform 0.15s ease, box-shadow 0.15s ease, opacity 0.15s;
}
.btn:hover { transform: translateY(-1px); box-shadow: 0 14px 34px -10px rgba(161, 0, 255, 0.95); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; transform: none; }
.btn.ghost { background: transparent; border: 1px solid var(--line); box-shadow: none; color: var(--text); }
.btn.ghost:hover { border-color: var(--lilac); }
.btn.sm { padding: 7px 14px; font-size: 13px; }
.btn.ok { background: linear-gradient(135deg, #18b57d, #0f8a5f); box-shadow: none; }
.btn.ko { background: transparent; border: 1px solid rgba(255, 79, 123, 0.5); color: #ff9db5; box-shadow: none; }
.btn.on { outline: 2px solid var(--lilac); outline-offset: 2px; }

input, textarea, select {
  width: 100%; font: 15px var(--font); color: var(--text);
  background: rgba(0, 0, 0, 0.35); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px;
  outline: none; transition: border-color 0.15s, box-shadow 0.15s;
}
input:focus, textarea:focus, select:focus { border-color: var(--purple); box-shadow: 0 0 0 3px rgba(161, 0, 255, 0.25); }
textarea { resize: vertical; min-height: 90px; line-height: 1.45; }
select option { background: #1a0a2b; }
label.field { display: block; font-size: 13px; color: var(--muted); margin: 14px 0 6px; }
.check { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; color: var(--muted); font-size: 14px; }
.check input { width: 18px; height: 18px; accent-color: var(--purple); }

.badge {
  display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 600;
  background: rgba(161, 0, 255, 0.18); color: var(--lilac-2); border: 1px solid rgba(190, 130, 255, 0.3);
}
.badge.major { background: rgba(161, 0, 255, 0.45); color: #fff; }
.badge.include { background: rgba(47, 217, 154, 0.18); color: var(--ok); border-color: rgba(47, 217, 154, 0.35); }
.badge.exclude { background: rgba(255, 79, 123, 0.14); color: #ff9db5; border-color: rgba(255, 79, 123, 0.3); }

.toast {
  position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%) translateY(20px);
  padding: 12px 20px; border-radius: 12px; background: #1b0a2e; border: 1px solid var(--line);
  opacity: 0; transition: all 0.25s ease; z-index: 50; pointer-events: none; max-width: 90vw;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast.error { border-color: rgba(255, 79, 123, 0.6); }

.spinner {
  width: 18px; height: 18px; border-radius: 50%; display: inline-block; vertical-align: middle;
  border: 2px solid rgba(255, 255, 255, 0.25); border-top-color: #fff; animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }

/* ---------- quiz public ---------- */
.quiz-shell { max-width: 820px; margin: 0 auto; padding: 32px 20px 80px; }
.quiz-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; }
.hero { position: relative; isolation: isolate; text-align: left; margin: 2vh 0 22px; padding: 10px 0; overflow: hidden; animation: rise 0.5s ease both; }
/* Grand chevron : en fond, très estompé, sans prendre de place ni gêner la lecture du titre */
.hero .chevron { position: absolute; z-index: -1; right: -30px; top: 50%; transform: translateY(-50%); font-size: 380px; line-height: 1; opacity: 0.13; text-shadow: none; pointer-events: none; user-select: none; filter: blur(1.5px); -webkit-mask-image: linear-gradient(90deg, transparent 0%, #000 55%); mask-image: linear-gradient(90deg, transparent 0%, #000 55%); }
.hero h1 { font-size: clamp(34px, 6vw, 58px); line-height: 1.04; margin: 0 0 14px; letter-spacing: -0.02em; }
.hero h1 .hl { background: linear-gradient(90deg, var(--lilac-2), var(--purple)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero p { font-size: 18px; color: var(--muted); margin: 0; max-width: 560px; }
.gate { padding: 26px; display: flex; gap: 12px; flex-wrap: wrap; animation: rise 0.6s 0.1s ease both; }
.gate input { flex: 1 1 280px; font-size: 16px; padding: 15px 18px; border-radius: 999px; }
.gate .hint { flex-basis: 100%; margin: 4px 6px 0; font-size: 13px; color: var(--muted); }
.gate .error { flex-basis: 100%; margin: 2px 6px 0; color: #ff9db5; font-size: 14px; }

.progress { height: 6px; background: rgba(255, 255, 255, 0.08); border-radius: 999px; overflow: hidden; margin-bottom: 16px; }
.progress > div { height: 100%; width: 0; background: linear-gradient(90deg, var(--purple-2), var(--purple), var(--lilac)); transition: width 0.4s ease; }
.q-meta { display: flex; justify-content: space-between; color: var(--muted); font-size: 14px; margin-bottom: 18px; }
.q-card { padding: 30px; animation: rise 0.35s ease both; }
.q-card h2 { font-size: clamp(20px, 3vw, 26px); line-height: 1.3; margin: 0 0 8px; }
.q-hint { color: var(--warn); font-size: 13px; margin-bottom: 18px; }
.answers { display: grid; gap: 12px; margin-top: 18px; }
.answer {
  display: flex; gap: 14px; align-items: flex-start; text-align: left; width: 100%;
  padding: 16px 18px; border-radius: 14px; cursor: pointer; font: 16px/1.4 var(--font); color: var(--text);
  background: rgba(0, 0, 0, 0.3); border: 1px solid var(--line); transition: all 0.15s ease;
}
.answer:hover:not(:disabled) { border-color: var(--lilac); background: rgba(161, 0, 255, 0.12); }
.answer .key {
  flex: none; width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center;
  font-weight: 700; font-size: 14px; background: rgba(161, 0, 255, 0.22); color: var(--lilac-2);
}
.answer.selected { border-color: var(--purple); background: rgba(161, 0, 255, 0.22); box-shadow: 0 0 0 1px var(--purple) inset; }
.answer.selected .key { background: var(--purple); color: #fff; }
.answer.correct { border-color: var(--ok); background: rgba(47, 217, 154, 0.14); }
.answer.correct .key { background: var(--ok); color: #04130d; }
.answer.wrong { border-color: var(--ko); background: rgba(255, 79, 123, 0.12); }
.answer.wrong .key { background: var(--ko); color: #fff; }
.answer:disabled { cursor: default; }
.feedback { margin-top: 20px; padding: 16px 18px; border-radius: 14px; background: rgba(0, 0, 0, 0.3); border-left: 3px solid var(--purple); line-height: 1.5; }
.feedback strong.ok { color: var(--ok); }
.feedback strong.ko { color: var(--ko); }
.q-actions { display: flex; justify-content: flex-end; gap: 12px; margin-top: 22px; }

.result { text-align: center; padding: 44px 30px; animation: rise 0.4s ease both; }
.score-ring {
  width: 190px; height: 190px; margin: 0 auto 22px; border-radius: 50%; display: grid; place-items: center;
  background: conic-gradient(var(--purple) calc(var(--p) * 1%), rgba(255, 255, 255, 0.08) 0);
}
.score-ring > div { width: 154px; height: 154px; border-radius: 50%; background: var(--bg); display: grid; place-items: center; }
.score-ring b { font-size: 44px; }
.score-ring span { display: block; color: var(--muted); font-size: 14px; }
.result h2 { font-size: 30px; margin: 0 0 8px; }
.recap { text-align: left; margin-top: 30px; display: grid; gap: 8px; }
.recap div { padding: 10px 14px; border-radius: 10px; background: rgba(0, 0, 0, 0.25); font-size: 14px; }
.recap .ok::before { content: "✓ "; color: var(--ok); font-weight: 700; }
.recap .ko::before { content: "✗ "; color: var(--ko); font-weight: 700; }
.confetti { position: fixed; top: -12px; width: 9px; height: 14px; border-radius: 2px; z-index: 40; pointer-events: none; animation: fall linear forwards; }
@keyframes fall { to { transform: translateY(110vh) rotate(720deg); opacity: 0.2; } }

/* ---------- console admin ---------- */
.admin-top {
  position: sticky; top: 0; z-index: 20; display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 14px 28px; background: rgba(7, 0, 13, 0.78); backdrop-filter: blur(16px); border-bottom: 1px solid var(--line);
}
.open-bar {
  display: flex; align-items: center; justify-content: space-between; gap: 20px; flex-wrap: wrap;
  max-width: 1180px; margin: 18px auto 0; padding: 18px 24px; border-radius: 16px; border: 1px solid var(--line);
}
.open-bar strong { font-size: 20px; }
.open-bar.open { background: rgba(47, 217, 154, 0.12); border-color: rgba(47, 217, 154, 0.45); }
.open-bar.closed { background: rgba(255, 79, 123, 0.1); border-color: rgba(255, 79, 123, 0.45); }
.btn.big { padding: 18px 34px; font-size: 18px; border-radius: 16px; }
.open-bar.open .btn.big { background: linear-gradient(135deg, #ff4f7b, #c2264f); box-shadow: none; }
.open-bar.closed .btn.big { background: linear-gradient(135deg, #18b57d, #0f8a5f); box-shadow: none; }
.q-group { margin: 0 0 28px; padding: 18px; border-radius: 18px; border: 1px solid var(--line); background: rgba(255, 255, 255, 0.02); }
.q-group.pre { border-color: rgba(161, 0, 255, 0.6); background: rgba(161, 0, 255, 0.08); }
.q-group.live { border-color: rgba(47, 217, 154, 0.45); background: rgba(47, 217, 154, 0.05); }
.q-group-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 14px; }
.q-group-head h3 { margin: 0; font-size: 18px; }
.q-group-head p { margin: 4px 0 0; }
.q-group summary { list-style: none; cursor: pointer; }
.q-group summary::-webkit-details-marker { display: none; }
.q-group summary h3::before { content: "▸ "; color: var(--lilac-2); }
.q-group[open] summary h3::before { content: "▾ "; }
details.q-group:not([open]) .q-group-head { margin-bottom: 0; }
.q-compact { border: 1px solid var(--line); border-radius: 12px; background: rgba(0, 0, 0, 0.25); margin-bottom: 8px; }
.q-compact summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: 14px; padding: 10px 14px; }
.q-compact summary::-webkit-details-marker { display: none; }
.q-compact summary::before { content: "▸"; color: var(--lilac-2); }
.q-compact[open] summary::before { content: "▾"; }
.q-compact-title { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.q-compact[open] .q-compact-title { white-space: normal; }
.q-compact > .q-edit { margin: 0 10px 10px; }
.tabs { display: flex; gap: 6px; flex-wrap: wrap; }
.tab { background: transparent; border: 0; color: var(--muted); font: 600 14px var(--font); padding: 9px 16px; border-radius: 999px; cursor: pointer; }
.tab:hover { color: var(--text); }
.tab.active { background: rgba(161, 0, 255, 0.22); color: #fff; }
.admin-main { max-width: 1180px; margin: 0 auto; padding: 28px 24px 80px; }
.login { max-width: 420px; margin: 12vh auto 0; padding: 34px; }
.login h1 { margin: 18px 0 4px; font-size: 26px; }
.login .btn { width: 100%; margin-top: 22px; }
.login .error { color: #ff9db5; margin-top: 14px; font-size: 14px; }

.section-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 18px; flex-wrap: wrap; }
.section-head h2 { margin: 0; font-size: 24px; }
.section-head p { margin: 4px 0 0; }
.toolbar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; padding: 14px; margin-bottom: 18px; }
.toolbar input[type="search"] { flex: 1 1 220px; width: auto; padding: 9px 14px; }
.toolbar select { width: auto; padding: 9px 12px; }
.toolbar .date-range { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); }
.toolbar .date-range input { width: auto; padding: 8px 10px; color-scheme: dark; }
/* Santé du crawl (console admin) */
.crawl-health { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-top: 8px; }
.badge.warn { background: rgba(255, 176, 32, 0.14); color: #ffc960; border-color: rgba(255, 176, 32, 0.35); }
.ch-feed { font-size: 11px; padding: 2px 8px; border-radius: 999px; border: 1px solid var(--line); color: var(--muted); cursor: help; }
.ch-feed.ok { color: var(--ok); border-color: rgba(47, 217, 154, 0.3); }
.ch-feed.ko { color: #ff9db5; border-color: rgba(255, 79, 123, 0.45); background: rgba(255, 79, 123, 0.1); }
.seg { display: inline-flex; padding: 4px; border-radius: 999px; background: rgba(0, 0, 0, 0.35); border: 1px solid var(--line); }
.seg button { border: 0; background: transparent; color: var(--muted); font: 600 13px var(--font); padding: 7px 14px; border-radius: 999px; cursor: pointer; }
.seg button.active { background: var(--purple); color: #fff; }

.ann-list { display: grid; gap: 12px; }
.ann { padding: 16px 18px; display: grid; grid-template-columns: 1fr auto; gap: 14px; align-items: start; border-left: 4px solid transparent; animation: rise 0.25s ease both; }
.ann.include { border-left-color: var(--ok); }
.ann.exclude { border-left-color: var(--ko); opacity: 0.55; }
.ann h3 { margin: 6px 0; font-size: 16px; line-height: 1.35; }
.ann h3 a { color: var(--text); text-decoration: none; }
.ann h3 a:hover { color: var(--lilac-2); }
.ann .meta { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; font-size: 12px; color: var(--muted); }
.ann p { margin: 4px 0 0; color: var(--muted); font-size: 14px; line-height: 1.45; }
.ann .acts { display: flex; flex-direction: column; gap: 6px; }

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
@media (max-width: 880px) { .grid-2 { grid-template-columns: 1fr; } .ann { grid-template-columns: 1fr; } .ann .acts { flex-direction: row; } }
.panel { padding: 22px; }
.panel h3 { margin: 0 0 6px; font-size: 18px; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-top: 14px; }
.row.center { justify-content: center; }
.row.tight { margin-top: 0; }
.check input[type="number"] { width: 72px; height: auto; padding: 8px 10px; }
.chevron.big { font-size: 72px; display: block; margin-bottom: 10px; }
.topic { padding: 18px; margin-top: 12px; }
.topic h4 { margin: 0 0 6px; font-size: 16px; }
.topic ul { margin: 10px 0 0; padding: 0; list-style: none; display: grid; gap: 8px; }
.topic li { display: flex; justify-content: space-between; gap: 10px; align-items: center; font-size: 14px; }

.q-edit { padding: 20px; margin-bottom: 14px; }
.q-edit.published { border-color: rgba(47, 217, 154, 0.45); }
.q-edit .head { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 10px; }
.ans-row { display: grid; grid-template-columns: auto 1fr auto; gap: 10px; align-items: center; margin-top: 8px; }
.ans-row .check { white-space: nowrap; }
.empty { padding: 40px; text-align: center; color: var(--muted); }
.status-line { display: inline-flex; gap: 10px; align-items: center; color: var(--muted); font-size: 14px; }

.spacer { flex: 1; }

/* Résultats (admin) */
.res-user { margin-bottom: 10px; padding: 12px 16px; }
.res-user summary { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; cursor: pointer; }
.res-table { width: 100%; border-collapse: collapse; margin-top: 10px; font-size: 14px; }
.res-table th, .res-table td { text-align: left; padding: 6px 10px; border-top: 1px solid rgba(128,128,128,.25); }

/* ---------- Tableau de bord (dataviz) ---------- */
.res-head { margin-top: 34px; }
.live-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--ok); margin-right: 4px;
  box-shadow: 0 0 0 0 rgba(47, 217, 154, .7); animation: livePulse 2s infinite; vertical-align: middle; }
@keyframes livePulse { 0% { box-shadow: 0 0 0 0 rgba(47,217,154,.6); } 70% { box-shadow: 0 0 0 10px rgba(47,217,154,0); } 100% { box-shadow: 0 0 0 0 rgba(47,217,154,0); } }

.viz-kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 18px; }
.viz-kpi { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 18px 20px; overflow: hidden; position: relative; }
.viz-kpi::after { content: ">"; position: absolute; right: -6px; bottom: -34px; font-size: 120px; font-weight: 800; color: rgba(161, 0, 255, .07); pointer-events: none; }
.kpi-label { font-size: 12px; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); }
.kpi-value { font-size: 38px; font-weight: 800; line-height: 1.1; margin: 4px 0;
  background: linear-gradient(135deg, #fff, var(--lilac-2) 40%, var(--lilac)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.kpi-sub { font-size: 12px; color: var(--muted); }
.viz-ring { width: 74px; height: 74px; flex: none; }
.ring-bg { fill: none; stroke: rgba(255, 255, 255, .07); stroke-width: 11; }
.ring-fg { fill: none; stroke-width: 11; stroke-linecap: round; animation: ringIn 1.2s cubic-bezier(.2,.8,.2,1) both; filter: drop-shadow(0 0 6px rgba(161,0,255,.6)); }
.ring-val { fill: var(--purple); font-size: 34px; font-weight: 800; }
@keyframes ringIn { from { stroke-dasharray: 0 100; } }
.viz-spark { width: 110px; height: 44px; flex: none; }
.spark-line { fill: none; stroke: var(--lilac); stroke-width: 2; stroke-dasharray: 1; animation: draw 1.4s ease-out both; }
.kpi-live { display: flex; flex-direction: column; align-items: center; min-width: 70px; }
.kpi-live b { font-size: 26px; line-height: 1; margin-top: 6px; }
.kpi-live small { color: var(--muted); font-size: 11px; }
.pulse { width: 14px; height: 14px; border-radius: 50%; background: rgba(255,255,255,.18); }
.pulse.on { background: var(--ok); animation: livePulse 1.6s infinite; }

.viz-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.viz-panel { padding: 20px 22px; min-width: 0; }
.viz-panel.wide { grid-column: 1 / -1; }
.viz-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; flex-wrap: wrap; margin-bottom: 10px; }
.viz-head h3 { margin: 0; font-size: 17px; }
.viz-head p { margin: 3px 0 0; }
.viz-legend { display: flex; gap: 14px; font-size: 12px; color: var(--muted); }
.viz-legend span { display: inline-flex; align-items: center; gap: 6px; }
.viz-legend i { display: inline-block; width: 12px; height: 12px; border-radius: 3px; }
.viz-legend .done { background: linear-gradient(180deg, var(--purple), var(--purple-3)); }
.viz-legend .live { background: var(--lilac-2); }
.viz-legend .ln { height: 3px; border-radius: 2px; }
.viz-legend .ok { background: var(--ok); }
.viz-empty { padding: 30px; text-align: center; color: var(--muted); }

svg.viz { width: 100%; height: auto; display: block; overflow: visible; }
.viz .grid { stroke: rgba(220, 175, 255, .09); stroke-dasharray: 3 5; }
.viz .axis { fill: var(--muted); font-size: 11px; font-family: var(--font); }
.viz .axis.ok { fill: rgba(47, 217, 154, .75); }
.viz .axis.strong { fill: var(--text); font-weight: 700; }
.viz .hit { fill: transparent; cursor: crosshair; }
.viz .hit:hover { fill: rgba(220, 175, 255, .06); }
.viz .bar { transform-box: fill-box; transform-origin: bottom; animation: grow .7s cubic-bezier(.2,.8,.2,1) both; }
.viz .line { fill: none; stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; }
.viz .line.ok { stroke: var(--ok); }
.viz .line.lilac { stroke: var(--lilac); }
.viz .draw { stroke-dasharray: 1; animation: draw 1.4s ease-out .2s both; }
.viz .fade { animation: fadeIn 1.2s ease-out .3s both; }
.viz .dot { stroke: var(--bg); stroke-width: 1.5; pointer-events: none; animation: fadeIn .4s 1.2s both; }
.viz .dot.ok { fill: var(--ok); }
.viz .dot.lilac { fill: var(--lilac-2); }
.viz .marker { stroke: var(--lilac-2); stroke-width: 1.5; stroke-dasharray: 4 4; }
.viz .marker-label { fill: var(--lilac-2); font-weight: 600; }
.viz .cell { animation: fadeIn .5s both; transition: transform .15s; transform-box: fill-box; transform-origin: center; }
.viz .cell:hover { transform: scale(1.18); stroke: var(--lilac-2); stroke-width: 1.5; }
@keyframes grow { from { transform: scaleY(0); opacity: 0; } }
@keyframes draw { from { stroke-dashoffset: 1; } to { stroke-dashoffset: 0; } }
@keyframes fadeIn { from { opacity: 0; } }

.viz-tip { position: fixed; z-index: 1000; pointer-events: none; opacity: 0; transform: translateY(4px); transition: opacity .12s, transform .12s;
  background: rgba(20, 0, 36, .92); border: 1px solid var(--line); border-radius: 10px; padding: 8px 12px; font-size: 12px; color: var(--muted);
  box-shadow: 0 12px 40px -10px rgba(161, 0, 255, .6); max-width: 340px; backdrop-filter: blur(8px); }
.viz-tip.show { opacity: 1; transform: none; }
.viz-tip .t { color: var(--text); font-weight: 700; margin-bottom: 3px; }

.viz-board { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.viz-board li { display: grid; grid-template-columns: 30px minmax(0, 1.2fr) 1fr 48px; align-items: center; gap: 12px; padding: 6px 8px; border-radius: 10px; transition: background .15s; }
.viz-board li:hover { background: rgba(255, 255, 255, .04); }
.viz-board .rank { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; font-weight: 800; font-size: 13px; background: rgba(255,255,255,.06); color: var(--muted); }
.viz-board .top1 .rank { background: linear-gradient(135deg, #ffe08a, #ffb547); color: #3a2400; box-shadow: 0 0 16px rgba(255, 181, 71, .6); }
.viz-board .top2 .rank { background: linear-gradient(135deg, #f2f2f7, #a9a9bd); color: #222; }
.viz-board .top3 .rank { background: linear-gradient(135deg, #f0b48a, #b06a3b); color: #2b1300; }
.viz-board .who { display: flex; flex-direction: column; min-width: 0; font-size: 13px; }
.viz-board .who strong, .viz-board .who span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.viz-board .who span { font-size: 11px; }
.track { height: 10px; border-radius: 999px; background: rgba(255, 255, 255, .06); overflow: hidden; }
.track .fill { display: block; height: 100%; width: 0; border-radius: 999px; transition: width 1s cubic-bezier(.2,.8,.2,1); box-shadow: 0 0 12px rgba(161, 0, 255, .5); }
.viz-board .val, .viz-diff .val { text-align: right; font-weight: 700; font-variant-numeric: tabular-nums; }

.viz-rounds { display: grid; gap: 6px; }
#viz > .viz-panel { margin-bottom: 18px; }
.viz-rounds-panel summary { list-style: none; cursor: pointer; margin: 0; }
.viz-rounds-panel summary::-webkit-details-marker { display: none; }
.viz-rounds-panel summary h3::before { content: "▸ "; color: var(--lilac-2); }
.viz-rounds-panel[open] summary h3::before { content: "▾ "; }
.viz-rounds-panel[open] summary { margin-bottom: 12px; }
.ai-status { margin: -6px 0 12px; padding: 8px 12px; border-radius: 10px; background: rgba(161, 0, 255, 0.12); color: var(--lilac-2); }
.ai-status.error { background: rgba(255, 79, 123, 0.12); color: #ff9db5; }
.q-compact summary .badge { flex: none; cursor: help; }
#bulk-bar .q-filter { flex: 1 1 100%; }
.pager { display: flex; align-items: center; justify-content: center; gap: 14px; margin-top: 12px; }
.round-row { display: grid; grid-template-columns: 150px minmax(80px, 1fr) 120px 170px minmax(0, 1.3fr); align-items: center; gap: 14px;
  width: 100%; padding: 8px 10px; border-radius: 10px; border: 1px solid transparent; background: transparent; color: var(--text);
  font: 13px var(--font); text-align: left; cursor: pointer; transition: background .15s, border-color .15s; }
.round-row:hover { background: rgba(255, 255, 255, .04); }
.round-row.active { border-color: var(--purple); background: rgba(161, 0, 255, .14); }
.round-row .champ { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: #ffe08a; }
@media (max-width: 880px) { .round-row { grid-template-columns: 1fr 1fr; } }
#res-round { width: auto; padding: 8px 12px; }
.viz-diff { display: grid; gap: 10px; max-height: 330px; overflow-y: auto; padding-right: 4px; }
.diff-row { display: grid; grid-template-columns: minmax(0, 1.6fr) 1fr 44px; align-items: center; gap: 12px; font-size: 13px; }
.diff-row .q { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

@media (max-width: 1000px) {
  .viz-kpis { grid-template-columns: 1fr 1fr; }
  .viz-grid { grid-template-columns: 1fr; }
}

/* ---------- flux d'annonces (ticker latéral, grands écrans) ---------- */
.news { display: none; }
@media (min-width: 1400px) {
  .news:not(.hidden):not(.empty) {
    display: flex; flex-direction: column; position: fixed; top: 24px; bottom: 24px; right: 24px; width: 270px;
    background: linear-gradient(180deg, var(--panel-2), var(--panel)); border: 1px solid var(--line);
    border-radius: var(--radius); backdrop-filter: blur(14px); overflow: hidden; animation: rise 0.5s ease both;
  }
}
.news-head { padding: 14px 16px; font-weight: 700; display: flex; align-items: center; gap: 8px; border-bottom: 1px solid var(--line); }
.news-head small { margin-left: auto; font-weight: 500; font-size: 11px; color: var(--muted); letter-spacing: .06em; text-transform: uppercase; }
.live-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--purple); box-shadow: 0 0 10px var(--purple); animation: pulse 1.6s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .35; transform: scale(.7); } }
.news-viewport { flex: 1; overflow: hidden; position: relative;
  -webkit-mask-image: linear-gradient(transparent, #000 8%, #000 92%, transparent); mask-image: linear-gradient(transparent, #000 8%, #000 92%, transparent); }
.news-track { animation: news-scroll 60s linear infinite; }
.news-viewport:hover .news-track { animation-play-state: paused; }
@keyframes news-scroll { to { transform: translateY(-50%); } }
.news-item { display: block; padding: 12px 16px; border-bottom: 1px solid var(--line); text-decoration: none; color: var(--text); }
.news-item:hover { background: rgba(161, 0, 255, .12); }
.news-meta { display: block; font-size: 11px; color: var(--lilac); letter-spacing: .04em; text-transform: uppercase; margin-bottom: 4px; }
.news-title { display: block; font-size: 13.5px; line-height: 1.35; }

.news-head { cursor: grab; user-select: none; touch-action: none; }
.news.dragging { opacity: .92; box-shadow: 0 12px 40px rgba(161, 0, 255, .35); }
.news.dragging .news-head { cursor: grabbing; }

/* ---------- sélecteur de langue ---------- */
.top-actions { display: flex; align-items: center; gap: 12px; }
.lang { display: inline-flex; border: 1px solid var(--line); border-radius: 999px; overflow: hidden; }
.lang button { border: 0; background: transparent; color: var(--muted); font: 700 12px var(--font); letter-spacing: .06em; padding: 7px 12px; cursor: pointer; }
.lang button:hover { color: var(--text); }
.lang button.on { background: linear-gradient(135deg, var(--purple), var(--purple-2)); color: #fff; }

/* ---------- flux : orientation ---------- */
.news-orient { margin-left: 8px; border: 1px solid var(--line); background: transparent; color: var(--lilac-2); border-radius: 8px; width: 28px; height: 24px; font-size: 14px; cursor: pointer; }
.news-orient:hover { border-color: var(--lilac); color: #fff; }
.news.horizontal .news-orient span { display: inline-block; transform: rotate(90deg); }
@media (min-width: 1400px) {
  .news.horizontal:not(.hidden):not(.empty) { top: auto; bottom: 24px; left: 24px; right: 24px; width: auto; height: auto; }
}
.news.horizontal .news-viewport { flex: none; height: 92px;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 5%, #000 95%, transparent); mask-image: linear-gradient(90deg, transparent, #000 5%, #000 95%, transparent); }
.news.horizontal .news-track { display: flex; width: max-content; animation-name: news-scroll-x; }
.news.horizontal .news-item { flex: 0 0 280px; border-bottom: 0; border-right: 1px solid var(--line); overflow: hidden; }
.news.horizontal .news-title { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; font-size: 13px; }
@keyframes news-scroll-x { to { transform: translateX(-50%); } }

/* ---------- lien vers l'actu + page "actu en direct" ---------- */
.news-follow { margin: 18px 0 0; }
.news-follow .btn { text-decoration: none; font-size: 12.5px; padding: 6px 14px; opacity: 0.85; }
@media (max-width: 1399px) { .news-follow { text-align: center; } }
a.news-orient { display: inline-flex; align-items: center; justify-content: center; text-decoration: none; }
.np-shell { max-width: 1200px; margin: 0 auto; padding: 28px 24px 60px; }
.np-top { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; margin-bottom: 28px; }
.np-top .btn { text-decoration: none; }
.np-status { display: flex; align-items: center; gap: 8px; font-weight: 700; margin-bottom: 18px; }
.np-updated { margin-left: auto; font-weight: 500; font-size: 13px; color: var(--muted); }
.np-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; }
.np-card {
  display: flex; flex-direction: column; gap: 8px; padding: 18px; text-decoration: none; color: var(--text);
  background: linear-gradient(180deg, var(--panel-2), var(--panel)); border: 1px solid var(--line); border-radius: var(--radius);
  transition: transform .15s ease, border-color .15s ease;
}
a.np-card:hover { transform: translateY(-2px); border-color: var(--lilac); }
.np-card.fresh { animation: rise .6s ease both, flash 2.4s ease-out 1; }
@keyframes flash { 0% { box-shadow: 0 0 0 2px var(--purple), 0 0 30px rgba(161, 0, 255, .7); } 100% { box-shadow: none; } }
.np-title { font-size: 16px; line-height: 1.4; }
.np-empty { text-align: center; margin-top: 12vh; font-size: 18px; }
/* plein écran : on agrandit tout pour une lecture à distance */
.fs .np-shell { max-width: none; padding: 32px 4vw; }
.fs .np-grid { grid-template-columns: repeat(auto-fill, minmax(420px, 1fr)); gap: 20px; }
.fs .np-title { font-size: clamp(20px, 1.7vw, 30px); }
.fs .news-meta { font-size: clamp(12px, 1vw, 16px); }
.fs .np-status { font-size: 20px; }
.news:not(.horizontal) .news-head small { display: none; }
.news:not(.horizontal) a.news-orient { margin-left: auto; }

/* ---------- flux : redimensionnement par les bords ---------- */
.news[data-rz], .news[data-rz] * { cursor: var(--rz-cursor) !important; }
.news.sized .news-viewport { min-height: 0; }
.news.horizontal.sized .news-viewport { flex: 1; height: auto; }
.news.horizontal.sized .news-track { height: 100%; }
.news.horizontal.sized .news-title { -webkit-line-clamp: 12; }

/* Desktop : Valider/Suivante en colonne pleine hauteur sur le bord droit de la carte, hors de la zone du bandeau d'actualités */
@media (min-width: 1400px) {
  .q-card { display: grid; grid-template-columns: minmax(0, 1fr) 130px; column-gap: 30px; overflow: hidden; }
  .q-card > * { grid-column: 1; }
  .q-card > .q-actions { display: contents; }
  .q-actions #validate, .q-actions #next {
    grid-column: 2; grid-row: 1 / -1; align-self: stretch; margin: -30px -30px -30px 0;
    border-radius: 0; box-shadow: none; white-space: normal; text-align: center;
    flex-direction: column; gap: 0; font-size: 0; line-height: 1.25; transition: font-size .18s ease, gap .18s ease, transform .15s ease, box-shadow .15s ease, opacity .15s;
  }
  /* Icône seule ; le libellé apparaît au survol ou au focus clavier */
  .q-actions #validate:hover, .q-actions #next:hover, .q-actions #validate:focus-visible, .q-actions #next:focus-visible { font-size: 15px; gap: 10px; transform: none; }
  .q-actions #validate::before, .q-actions #next::before { width: 40px; height: 40px; }
}
/* Suivante : couleur distincte de Valider pour marquer l'étape suivante */
#next { background: linear-gradient(135deg, var(--ok), #17a374); color: #04130d; }
#next:hover { box-shadow: 0 14px 34px -10px rgba(47, 217, 154, 0.8); }

/* Icônes des boutons Valider / Suivante (masques SVG inline, compatibles CSP : img-src data:) */
#validate::before, #next::before { content: ""; flex: none; width: 20px; height: 20px; background: currentColor; -webkit-mask: var(--ico) center / contain no-repeat; mask: var(--ico) center / contain no-repeat; }
#validate { --ico: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 12.5l5 5L20 6.5'/%3E%3C/svg%3E"); }
#next { --ico: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 12h16M13 5l7 7-7 7'/%3E%3C/svg%3E"); }

#news-link { text-decoration: none; display: inline-flex; align-items: center; }


/* Valider inactif : très atténué pour ne pas distraire ; le libellé reste lisible au survol */
#validate:disabled { opacity: 0.2; filter: saturate(0.3); box-shadow: none; }
#validate:disabled:hover { opacity: 0.5; }

/* Titre cliquable */
a.brand { color: inherit; text-decoration: none; }
a.brand:hover { opacity: .85; }
a.brand:focus-visible { outline: 2px solid var(--purple); outline-offset: 4px; border-radius: 6px; }

/* Fenêtre vidéo flottante */
.video-float { position: fixed; top: 84px; right: 16px; width: 420px; max-width: calc(100vw - 24px); z-index: 60; background: #0b0b10; border: 1px solid rgba(161,0,255,.5); border-radius: 12px; box-shadow: 0 12px 40px rgba(0,0,0,.6); overflow: hidden; min-width: 280px; }
.video-float.hidden { display: none; }
.vf-head { display: flex; align-items: center; gap: 8px; padding: 6px 8px 6px 10px; cursor: grab; user-select: none; touch-action: none; background: rgba(161,0,255,.14); font-size: 13px; font-weight: 600; }
.vf-head:active { cursor: grabbing; }
.vf-title { flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.vf-btn { background: transparent; border: 0; color: inherit; cursor: pointer; padding: 4px 8px; border-radius: 6px; font-size: 14px; text-decoration: none; }
.vf-btn:hover { background: rgba(255,255,255,.12); }
.vf-body { aspect-ratio: 16 / 9; }
.vf-body video { width: 100%; height: 100%; background: #000; display: block; }
.vf-body iframe { width: 100%; height: 100%; border: 0; display: block; }
.video-float.dragging iframe, .video-float.dragging video { pointer-events: none; }
@media (max-width: 700px) { #video-toggle, .video-float { display: none !important; } }

.gate .gate-label { flex-basis: 100%; margin: 0 6px 2px; font-size: 17px; font-weight: 700; color: var(--text); }

.vf-edge { position: absolute; z-index: 3; touch-action: none; }
.vf-edge[data-dir="n"] { top: 0; left: 10px; right: 10px; height: 5px; cursor: ns-resize; }
.vf-edge[data-dir="s"] { bottom: 0; left: 10px; right: 10px; height: 8px; cursor: ns-resize; }
.vf-edge[data-dir="e"] { right: 0; top: 10px; bottom: 10px; width: 8px; cursor: ew-resize; }
.vf-edge[data-dir="w"] { left: 0; top: 10px; bottom: 10px; width: 8px; cursor: ew-resize; }
.vf-edge[data-dir="ne"] { top: 0; right: 0; width: 10px; height: 10px; cursor: nesw-resize; }
.vf-edge[data-dir="nw"] { top: 0; left: 0; width: 10px; height: 10px; cursor: nwse-resize; }
.vf-edge[data-dir="sw"] { bottom: 0; left: 0; width: 18px; height: 18px; cursor: nesw-resize; }
.vf-edge[data-dir="se"] { bottom: 0; right: 0; width: 18px; height: 18px; cursor: nwse-resize; background: linear-gradient(135deg, transparent 55%, rgba(161,0,255,.9) 55%); border-bottom-right-radius: 12px; }

.news-date { display: block; margin-top: 5px; font-size: 10.5px; color: var(--lilac); opacity: .75; }

.gate .hint { font-size: 11.5px; opacity: 0.8; line-height: 1.4; }

/* ---------- flux : mode réduit (bande de texte en bas de page) ---------- */
#news-mini span { display: inline-block; transform: translateY(4px); }
.news.mini #news-mini span { transform: rotate(180deg) translateY(4px); }
@media (min-width: 1400px) {
  .news.mini:not(.hidden):not(.empty) {
    top: auto !important; left: 0 !important; right: 0 !important; bottom: 0 !important; width: auto !important; height: auto !important;
    flex-direction: row; align-items: center; border-radius: 0; border-width: 1px 0 0; animation: none;
  }
}
.news.mini .news-head { padding: 6px 12px; border-bottom: 0; white-space: nowrap; cursor: default; flex: none; }
.news.mini .news-head small, .news.mini .news-head a.news-orient, .news.mini #news-orient { display: none; }
.news.mini .news-viewport { flex: 1; height: 34px; min-width: 0; display: flex; align-items: center;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 3%, #000 97%, transparent); mask-image: linear-gradient(90deg, transparent, #000 3%, #000 97%, transparent); }
.news.mini .news-track { display: flex; width: max-content; animation-name: news-scroll-x; }
.news.mini .news-item { flex: none; display: flex; align-items: baseline; gap: 8px; padding: 0 22px; border: 0; border-right: 1px solid var(--line); white-space: nowrap; }
.news.mini .news-meta { margin: 0; font-size: 10.5px; }
.news.mini .news-title { font-size: 13px; display: inline; -webkit-line-clamp: unset; overflow: visible; }
.news.mini .news-date { display: none; }

/* Crédits : fine bande fixe tout en bas, sous le live feed */
.credit {
  position: fixed; left: 0; right: 0; bottom: 0; height: 18px; z-index: 40; display: flex; align-items: center; justify-content: center;
  padding: 0 12px; font-size: 9px; letter-spacing: 0.03em; color: var(--lilac-2); user-select: none; cursor: default;
  background: linear-gradient(90deg, rgba(70, 0, 115, 0.55), rgba(161, 0, 255, 0.35) 50%, rgba(47, 217, 154, 0.22));
  border-top: 1px solid var(--line);
}
.credit span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.credit a { color: #fff; text-decoration: none; }
.credit a:hover { text-decoration: underline; }
@media (max-width: 700px) { .credit { font-size: 8.5px; } }
/* Le live feed se place au-dessus de la bande de crédits */
@media (min-width: 1400px) {
  .news:not(.hidden):not(.empty) { bottom: 26px; }
  .news.horizontal:not(.hidden):not(.empty) { bottom: 26px; }
  .news.mini:not(.hidden):not(.empty) { bottom: 18px !important; }
}.fireworks { position: fixed; inset: 0; width: 100vw; height: 100vh; pointer-events: none; z-index: 9999; }
/* Logo YouTube sur le bouton vidéo (image data: inline, compatible CSP) */
#video-toggle::before { content: ""; flex: none; width: 22px; height: 16px; background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 28 20'%3E%3Crect width='28' height='20' rx='5' fill='%23ff0000'/%3E%3Cpath d='M11 5.5v9l8-4.5z' fill='%23ffffff'/%3E%3C/svg%3E") center / contain no-repeat; }

/* Flux : angles droits dans tous les modes (design) */
.news, .news.horizontal, .news.mini { border-radius: 0 !important; }
/* Flux : pas de contour, simple fond semi-transparent statique (pas de flou ni d'animation : coût CPU/GPU quasi nul) */
.news, .news.horizontal, .news.mini { border: 0 !important; backdrop-filter: none !important; background: rgba(12, 4, 24, 0.72) !important; }

/* Admin : nombre de questions préparées par l'IA */
.picks-field { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); }
.picks-field .picks-input { width: 64px; padding: 8px 10px; text-align: center; }

/* QR code d'accueil (côté gauche, écrans larges uniquement) */
.qr-card { display: none; }
@media (min-width: 1200px) {
  .qr-card { display: flex; position: fixed; left: 24px; top: 50%; transform: translateY(-50%); width: 190px; flex-direction: column; align-items: center; gap: 8px; padding: 16px; text-align: center; border: 1px solid var(--line); background: rgba(12, 4, 24, 0.72); }
  .qr-card img { width: 160px; height: 160px; background: #fff; padding: 4px; image-rendering: pixelated; }
  .qr-card small { font-size: 12px; color: var(--muted); line-height: 1.35; }
}

.open-btns { display: flex; flex-direction: column; align-items: stretch; gap: 8px; }
.open-btns .btn.sm { font-size: 12.5px; padding: 6px 14px; }

/* Home spacing (desktop): more air between header, title, subtitle, card and news link */
@media (min-width: 761px) {
  #screen-gate .hero { margin: 7vh 0 40px; padding: 18px 0; }
  #screen-gate .hero h1 { margin: 0 0 26px; }
  #screen-gate .gate { padding: 34px 30px; gap: 18px; }
  #screen-gate .gate .gate-label { margin-bottom: 10px; }
  #screen-gate .gate .hint { margin-top: 10px; }
  #screen-gate .news-follow { margin-top: 32px; }
}

/* Background chevron as smooth vector (no pixelated/clipped glyph) */
.hero { overflow: visible; }
.hero .chevron { font-size: 0; color: transparent; width: 440px; height: 440px; right: 0; filter: none; opacity: 0.22; background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='-6 -6 112 112'%3E%3Cdefs%3E%3ClinearGradient id='g' x1='0' y1='0' x2='1' y2='0'%3E%3Cstop offset='0' stop-color='%23c9a2ff'/%3E%3Cstop offset='1' stop-color='%238a00ff'/%3E%3C/linearGradient%3E%3C/defs%3E%3Cpolygon points='2.6,28.8 2.6,0 97.4,38.2 97.4,61.8 2.6,100 2.6,70.6 57.9,50' fill='url(%23g)'/%3E%3C/svg%3E") center / contain no-repeat; -webkit-mask-image: radial-gradient(closest-side, #000 35%, transparent 100%); mask-image: radial-gradient(closest-side, #000 35%, transparent 100%); }
@media (max-width: 760px) { .hero .chevron { width: 260px; height: 260px; right: -40px; } }

/* Bandeau live feed horizontal : la hauteur suit le contenu (méta + 3 lignes + date), plus de texte coupé en bas */
.news.horizontal:not(.sized) .news-viewport { height: auto; min-height: 92px; }
/* Bandeau redimensionné : jamais plus bas que le contenu d'une carte (en-tête + méta + 3 lignes + date) */
.news.horizontal.sized:not(.mini) { min-height: 160px; }
