/* ============================================================
   SYNAPSE — styles de l'application (après style.css)
   ============================================================ */
.wrap-narrow { max-width: 820px; }
.wrap-test { max-width: 760px; padding-top: 14px; padding-bottom: 40px; }
.muted { color: var(--ink-3); }
.small { font-size: 13px; }
.eyebrow { margin: 0 0 6px; font-size: 13px; font-weight: 800; letter-spacing: 0.1em; text-transform: uppercase; color: var(--accent); }
.lead { font-size: 19px; color: var(--ink-2); margin: 12px 0 0; }
.grad { background: var(--grad-text); -webkit-background-clip: text; background-clip: text; color: transparent; }
.btn-lg { min-height: 52px; padding: 0 26px; font-size: 16px; }
.btn:disabled { opacity: 0.45; cursor: default; }
.linkish { background: none; border: 0; padding: 0; color: var(--ink-3); text-decoration: underline; cursor: pointer; font-size: 14px; }
.linkish:hover { color: var(--accent); }
.mono { font-variant-numeric: tabular-nums; }

/* ---------- accueil ---------- */
.hero { padding: 26px 0 34px; }
.hero h1 { font-size: clamp(36px, 6.4vw, 64px); letter-spacing: -0.02em; }
.hero .lead { max-width: 640px; }
.hero-progress {
  display: flex; flex-wrap: wrap; align-items: center; gap: 16px 28px; margin-top: 26px;
  padding: 18px 22px; background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--radius);
}
.hero-progress > div:first-child { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.hero-progress strong { font-family: var(--font-display); font-size: 40px; line-height: 1; }
.dots { display: flex; align-items: center; gap: 6px; font-size: 14px; color: var(--ink-3); }
.dots i { width: 12px; height: 12px; border-radius: 50%; background: var(--bg-3); border: 1px solid var(--line-2); }
.dots i.on { background: var(--accent); border-color: var(--accent); }
.dots span { margin-left: 6px; }

.banner { margin: 6px 0 18px; padding: 16px 20px; border-radius: var(--radius); background: var(--accent-soft); border: 1px solid var(--accent); }
.banner p { margin: 0 0 12px; }
.banner-actions { display: flex; gap: 10px; flex-wrap: wrap; }

.modules { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 14px; }
.mcard {
  display: flex; flex-direction: column; gap: 8px;
  padding: 18px; background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--radius);
}
.mcard h3 { font-size: 22px; }
.mcard p { margin: 0 0 6px; color: var(--ink-2); font-size: 15px; line-height: 1.45; flex: 1; }
.mcard .btn { align-self: flex-start; }
.mcard.is-done { border-color: color-mix(in srgb, var(--accent) 40%, var(--line)); }
.mcard-top { display: flex; justify-content: space-between; align-items: center; }
.mcard-num { font-family: var(--font-display); font-size: 15px; font-weight: 700; color: var(--ink-3); }
.badge { font-size: 12px; font-weight: 800; padding: 3px 10px; border-radius: 99px; background: var(--bg-3); color: var(--ink-2); }
.badge-done { background: var(--accent); color: #fff; }
:root[data-theme="dark"] .badge-done { color: #0b0b13; }

.how { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 22px; margin: 44px 0; }
.how h3 { font-size: 20px; margin-bottom: 6px; }
.how p { margin: 0; color: var(--ink-2); font-size: 15.5px; }

.resume { padding: 26px 0 10px; border-top: 1px solid var(--line); }
.resume h2 { font-size: 24px; margin-bottom: 12px; }
.codebox-row { display: flex; gap: 10px; }
.codebox-row input {
  flex: 1; min-width: 0; min-height: 44px; padding: 0 14px;
  border: 1px solid var(--line-2); border-radius: 12px; background: var(--bg-2); color: var(--ink);
  font: inherit; font-size: 14px;
}
.codebox-row input:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
.form-msg { min-height: 22px; font-size: 14px; color: var(--bad); margin: 8px 0; }
.codebox { margin: 18px 0; padding: 16px 18px; border-radius: var(--radius-sm); background: var(--bg-3); }
.codebox label { display: block; font-weight: 800; margin-bottom: 8px; }
.codebox p { margin: 8px 0 0; font-size: 14px; color: var(--ink-3); }
.panel .codebox { margin: 0; }

/* ---------- présentation d'un module ---------- */
.intro, .done { padding: 12px 0 50px; }
.intro h1, .done h1 { font-size: clamp(34px, 6vw, 52px); }
.notice { margin: 18px 0; padding: 12px 16px; border-radius: var(--radius-sm); background: var(--accent-soft); border-left: 4px solid var(--accent); }
.notice-soft { background: var(--bg-3); border-left-color: var(--line-2); color: var(--ink-2); font-size: 15px; }
.how-list { margin: 20px 0; padding-left: 22px; }
.how-list li { margin: 6px 0; }
.example { margin: 26px 0; padding: 20px; background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--radius); }
.example h3 { font-size: 19px; margin-bottom: 14px; }
.example h3 .muted { font-family: var(--font-body); font-size: 14px; font-weight: 600; }
.ex-why { margin: 16px 0 0; padding: 12px 14px; background: var(--bg-3); border-radius: var(--radius-sm); font-size: 15px; }
.intro-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 26px; }

/* ---------- pendant le test ---------- */
.test-bar { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin-bottom: 10px; }
.test-mod { font-family: var(--font-display); font-weight: 700; font-size: 20px; }
.test-count { color: var(--ink-3); font-size: 14px; font-variant-numeric: tabular-nums; }
.timer { height: 6px; border-radius: 99px; background: var(--bg-3); overflow: hidden; margin-bottom: 22px; }
.timer i { display: block; height: 100%; width: 100%; background: var(--accent); border-radius: 99px; }
.timer.low i { background: var(--bad); }
.test { background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; box-shadow: var(--shadow); }
.q-stem { margin-bottom: 20px; }
.q-prompt { text-align: center; color: var(--ink-2); margin: 0 0 14px; font-weight: 700; }
.q-verbal { font-family: var(--font-display); font-size: clamp(22px, 3.6vw, 28px); line-height: 1.3; text-align: center; margin: 10px 0 6px; }
.test .matrix, .example .matrix { max-width: 360px; }

.seq { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.seq span {
  min-width: 58px; height: 58px; padding: 0 10px; display: inline-flex; align-items: center; justify-content: center;
  background: var(--paper); color: #17161f; border: 1.5px solid var(--paper-line); border-radius: 12px;
  font-family: var(--font-display); font-size: 24px; font-weight: 700; font-variant-numeric: tabular-nums;
}
.seq .seq-q { border-style: dashed; border-color: var(--accent); background: var(--accent-soft); color: var(--accent); }

.spatial-stem { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 18px 26px; }
.model { margin: 0; text-align: center; }
.model .fig { width: 150px; }
.model figcaption { font-size: 13px; color: var(--ink-3); margin-top: 6px; font-weight: 700; }
.fig { aspect-ratio: 1; background: var(--paper); border: 1.5px solid var(--paper-line); border-radius: 12px; }
.fig svg { width: 100%; height: 100%; display: block; }
.steps { margin: 0; padding: 0; list-style: none; counter-reset: s; }
.steps li { counter-increment: s; display: flex; align-items: center; gap: 10px; margin: 8px 0; font-weight: 600; }
.steps li::before { content: counter(s) "."; color: var(--ink-3); min-width: 18px; }
.step-icon { display: inline-flex; align-items: center; justify-content: center; width: 34px; height: 34px; border-radius: 10px; background: var(--accent-soft); color: var(--accent); font-size: 20px; }

.opts { display: grid; gap: 10px; margin: 0 auto; }
.opts-fig8 { grid-template-columns: repeat(4, 1fr); max-width: 520px; }
.opts-fig5 { grid-template-columns: repeat(5, 1fr); max-width: 620px; }
.opts-text6 { grid-template-columns: repeat(3, 1fr); max-width: 480px; }
.opts-text5 { grid-template-columns: 1fr; max-width: 420px; }
.opt {
  position: relative; cursor: pointer; overflow: hidden;
  background: var(--paper); color: #17161f; border: 2px solid var(--paper-line); border-radius: 12px;
  transition: transform 0.16s var(--ease), border-color 0.16s, box-shadow 0.16s;
}
.opt-fig { aspect-ratio: 1; padding: 0; }
.opt-fig svg { width: 100%; height: 100%; display: block; }
.opt-text { min-height: 54px; padding: 8px 14px 8px 34px; font-size: 19px; font-weight: 700; font-variant-numeric: tabular-nums; }
.opts-text5 .opt-text { text-align: left; font-size: 18px; }
.opt .num { position: absolute; top: 4px; left: 8px; font-size: 12px; font-weight: 800; color: #9a958b; }
.opt-text .num { top: 50%; transform: translateY(-50%); left: 12px; }
.opt:hover:not(:disabled) { border-color: var(--accent); transform: translateY(-2px); }
.opt:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.opt:disabled { cursor: default; }
.opt.is-picked { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.opt.is-right { border-color: var(--good); box-shadow: 0 0 0 3px color-mix(in srgb, var(--good) 30%, transparent); }
.opt.is-wrong { border-color: var(--bad); opacity: 0.7; }

/* mémoire */
.span-show { min-height: 300px; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.span-digit { font-family: var(--font-display); font-size: 120px; font-weight: 700; line-height: 1; min-height: 130px; opacity: 0.25; }
.span-digit.on { opacity: 1; }
.span-input { text-align: center; }
.slots { display: flex; justify-content: center; flex-wrap: wrap; gap: 8px; margin: 10px 0 22px; }
.slots span { width: 44px; height: 54px; border-radius: 10px; border: 2px dashed var(--line-2); display: inline-flex; align-items: center; justify-content: center; font-family: var(--font-display); font-size: 28px; font-weight: 700; }
.slots span.full { border-style: solid; border-color: var(--accent); background: var(--accent-soft); }
.keypad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; max-width: 320px; margin: 0 auto; }
.keypad button {
  min-height: 58px; border-radius: 14px; border: 1px solid var(--line-2); background: var(--bg);
  font-size: 24px; font-weight: 800; cursor: pointer; transition: transform 0.1s, border-color 0.15s;
}
.keypad button:active { transform: scale(0.95); }
.keypad button:hover:not(:disabled) { border-color: var(--accent); }
.keypad .ok { background: var(--accent); border-color: var(--accent); color: #fff; font-size: 16px; }
:root[data-theme="dark"] .keypad .ok { color: #0b0b13; }
.keypad button:disabled { opacity: 0.4; cursor: default; }

/* vitesse */
.speed { text-align: center; }
.legend { display: grid; grid-template-columns: repeat(9, 1fr); gap: 4px; padding: 10px; background: var(--paper); color: #17161f; border: 1.5px solid var(--paper-line); border-radius: 12px; }
.legend > div { display: flex; flex-direction: column; align-items: center; gap: 2px; }
.legend .g svg { width: 34px; height: 34px; display: block; }
.legend .d { font-weight: 800; font-size: 18px; border-top: 1.5px solid var(--paper-line); width: 100%; }
.speed-target { width: 150px; height: 150px; margin: 22px auto 8px; background: var(--paper); color: #17161f; border: 2px solid var(--paper-line); border-radius: 18px; padding: 22px; }
.speed-target svg { width: 100%; height: 100%; display: block; }
.speed-target.flash-good { border-color: var(--good); }
.speed-target.flash-bad { border-color: var(--bad); animation: shake 0.25s; }
@keyframes shake { 25% { transform: translateX(-5px); } 75% { transform: translateX(5px); } }
.speed-msg { min-height: 26px; color: var(--ink-3); margin: 0 0 14px; font-size: 15px; }

/* ---------- scores ---------- */
.score-card {
  display: flex; flex-direction: column; align-items: center; gap: 4px; text-align: center;
  margin: 22px 0; padding: 26px 20px; background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow);
}
.score-card .big { font-family: var(--font-display); font-size: 76px; line-height: 1; background: var(--grad-text); -webkit-background-clip: text; background-clip: text; color: transparent; }
.score-card .range { font-weight: 700; color: var(--ink-2); }
.score-card .pct { font-size: 15px; color: var(--ink-2); }
.score-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.score-pair .score-card { margin: 22px 0 0; }
@media (max-width: 560px) { .score-pair { grid-template-columns: 1fr; } }
.precision { font-size: 14px; color: var(--ink-3); }
.progress-line { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 10px 20px; margin: 18px 0; padding: 14px 18px; border: 1px solid var(--line); border-radius: var(--radius-sm); }
.progress-line strong { font-family: var(--font-display); font-size: 22px; }

.review { margin-top: 32px; border-top: 1px solid var(--line); padding-top: 18px; }
.review summary { cursor: pointer; font-weight: 800; }
.review ol { list-style: none; padding: 0; margin: 12px 0 0; }
.review li { padding: 14px 0; border-bottom: 1px solid var(--line); font-size: 15px; }
.review li p { margin: 8px 0 0; }
.review-head { font-weight: 700; }
.review .mark { display: inline-flex; width: 22px; height: 22px; border-radius: 50%; align-items: center; justify-content: center; font-size: 13px; color: #fff; background: var(--good); margin-right: 4px; }
.review .ko .mark { background: var(--bad); }
.review-fig { margin-top: 10px; max-width: 220px; }
.review-fig .matrix { gap: 3px; }
.review-fig .cell { border-radius: 4px; border-width: 1px; }
.review-fig-sm { display: flex; align-items: center; gap: 12px; max-width: 260px; }
.review-fig-sm .fig { width: 90px; }
.review-fig-sm .arrow { font-size: 22px; color: var(--ink-3); }

/* ---------- résultats ---------- */
.panel { margin: 0 0 18px; padding: 24px; background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--radius); }
.panel h2 { font-size: 26px; margin-bottom: 8px; }
.panel h3 { font-size: 18px; margin: 18px 0 6px; }
.result-main { text-align: center; box-shadow: var(--shadow); }
.result-number { display: flex; flex-direction: column; align-items: center; gap: 4px; margin: 6px 0 4px; }
.result-number strong { font-family: var(--font-display); font-size: clamp(76px, 14vw, 120px); line-height: 1; background: var(--grad-text); -webkit-background-clip: text; background-clip: text; color: transparent; }
.result-number span { font-weight: 700; color: var(--ink-2); font-size: 18px; }
.bell { width: 100%; max-width: 640px; margin: 18px auto 6px; display: block; }
.bell .curve { fill: none; stroke: var(--ink-2); stroke-width: 2; }
.bell .under { fill: var(--accent-soft); }
.bell .band { fill: var(--accent); opacity: 0.12; }
.bell .ax { stroke: var(--line-2); stroke-width: 1; }
.bell .tick { fill: var(--ink-3); font-size: 12px; text-anchor: middle; font-family: var(--font-body); }
.bell .mark { stroke: var(--accent); stroke-width: 2.5; }
.bell .mark-dot { fill: var(--accent); }
.result-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.result-grid .panel { margin: 0 0 18px; }
@media (max-width: 860px) { .result-grid { grid-template-columns: 1fr; } }

.dbars { margin-top: 16px; }
.dbar { display: grid; grid-template-columns: 130px 1fr 48px; align-items: center; gap: 12px; padding: 10px 0; }
.dname { font-weight: 700; font-size: 15px; }
.dtrack { position: relative; height: 10px; border-radius: 99px; background: var(--bg-3); }
.dtrack i { position: absolute; top: 0; height: 100%; }
.dtrack .d100 { width: 2px; margin-left: -1px; background: var(--line-2); }
.dtrack .drange { background: var(--accent); opacity: 0.25; border-radius: 99px; }
.dtrack .ddot { width: 16px; height: 16px; top: -3px; margin-left: -8px; border-radius: 50%; background: var(--accent); border: 2px solid var(--bg-2); }
.dval { font-family: var(--font-display); font-size: 20px; text-align: right; }
.dbar.is-empty .dname { color: var(--ink-3); }
.dbar.is-empty .linkish { justify-self: end; }
.dscale { display: grid; grid-template-columns: 130px 1fr 48px; gap: 12px; font-size: 12px; color: var(--ink-3); }
.dscale span { grid-column: 2; grid-row: 1; }
.dscale span:nth-child(1) { justify-self: start; }
.dscale span:nth-child(2) { justify-self: center; }
.dscale span:nth-child(3) { justify-self: end; }

.profile h2 { font-size: 34px; }
.profile.is-locked { opacity: 0.8; }
.forces { margin: 0; padding-left: 20px; }
.forces li { margin: 4px 0; }
.method p { color: var(--ink-2); }

@media (max-width: 560px) {
  .test { padding: 14px; }
  .opts-fig5 { grid-template-columns: repeat(3, 1fr); }
  .opts-text6 { grid-template-columns: repeat(2, 1fr); }
  .seq span { min-width: 46px; height: 50px; font-size: 20px; }
  .legend { gap: 1px; padding: 6px; }
  .legend .g svg { width: 26px; height: 26px; }
  .legend .d { font-size: 15px; }
  .span-digit { font-size: 96px; }
  .codebox-row { flex-direction: column; }
  .dbar, .dscale { grid-template-columns: 96px 1fr 40px; gap: 8px; }
  .dname { font-size: 13px; }
}

/* envoi anonyme */
.share-opt { display: flex; gap: 10px; align-items: flex-start; margin: 18px 0 0; font-size: 14px; color: var(--ink-3); cursor: pointer; }
.share-opt input { width: 18px; height: 18px; margin-top: 2px; flex: none; accent-color: var(--accent); }

/* code court de reprise */
.short { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; padding-bottom: 16px; margin-bottom: 16px; border-bottom: 1px solid var(--line-2); }
.short-label { font-weight: 800; flex-basis: 100%; }
.short-code { font-family: var(--font-display); font-size: 38px; letter-spacing: 0.08em; line-height: 1; font-variant-numeric: tabular-nums; }
.short p { flex-basis: 100%; margin: 0; }
