@font-face { font-family: "Bricolage"; src: url("../fonts/Bricolage.ttf") format("truetype"); font-weight: 200 800; font-stretch: 75% 100%; font-display: swap; }
@font-face { font-family: "Figtree"; src: url("../fonts/Figtree.ttf") format("truetype"); font-weight: 300 900; font-display: swap; }

/* Indigo du ndop le soir, toile claire en plein jour. Les perles ne changent jamais. */
:root {
  --ground: #0B0E20;
  --raised: #161B37;
  --raised-2: #1F2649;
  --seam: rgba(214, 205, 255, 0.10);
  --seam-strong: rgba(214, 205, 255, 0.18);
  --ink: #F1EADB;
  --ink-soft: #BCB9D3;
  --ink-faint: #8C8BAD;
  --thread: rgba(241, 234, 219, 0.36);
  --brass-hi: #F6DC97;
  --brass: #CF9C45;
  --brass-lo: #8A5E22;
  --on-brass: #1A1405;
  --ok: #1E9E6A;
  --ko: #D2392C;
  --fire: #F08A3C;
  --shadow-sm: 0 10px 22px -14px rgba(3, 4, 15, 0.8);
  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
  --ease-drawer: cubic-bezier(0.32, 0.72, 0, 1);
  --display: "Bricolage", system-ui, sans-serif;
  --body: "Figtree", system-ui, sans-serif;
  --r-shell: 30px;
  --r-core: 24px;
  --photo-ink: #F4EDDF;
  color-scheme: dark;
}
@media (prefers-color-scheme: light) {
  /* Toile blanche du ndop teintée d'indigo, encre indigo */
  :root {
    --ground: #E4E6F1;
    --raised: #F5F6FB;
    --raised-2: #E9EBF5;
    --seam: rgba(18, 22, 51, 0.09);
    --seam-strong: rgba(18, 22, 51, 0.16);
    --ink: #121633;
    --ink-soft: #3F4469;
    --ink-faint: #575C80;
    --thread: rgba(18, 22, 51, 0.40);
    --shadow-sm: 0 10px 22px -16px rgba(18, 22, 51, 0.45);
    color-scheme: light;
  }
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html {
  -webkit-tap-highlight-color: transparent;
  -webkit-text-size-adjust: 100%;
  overscroll-behavior: none;
  background: var(--ground);
}
body {
  min-height: 100dvh;
  overflow-x: clip;
  color: var(--ink);
  font: 450 17px/1.5 var(--body);
  -webkit-font-smoothing: antialiased;
  background:
    radial-gradient(60vw 50vh at 85% -10%, rgba(207, 156, 69, 0.13), transparent 70%),
    radial-gradient(70vw 60vh at -10% 20%, rgba(47, 111, 214, 0.14), transparent 70%),
    var(--ground);
  background-attachment: fixed;
}
@media (prefers-color-scheme: light) {
  body {
    background:
      radial-gradient(60vw 50vh at 85% -10%, rgba(207, 156, 69, 0.22), transparent 70%),
      radial-gradient(70vw 60vh at -10% 20%, rgba(47, 111, 214, 0.12), transparent 70%),
      var(--ground);
    background-attachment: fixed;
  }
}
/* Grain fixe, jamais sur un conteneur qui défile */
body::after {
  content: ""; position: fixed; inset: 0; z-index: 50; pointer-events: none; opacity: 0.05;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
::selection { background: var(--brass); color: var(--on-brass); }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; touch-action: manipulation; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; }
:focus-visible { outline: 2px solid var(--brass); outline-offset: 3px; border-radius: 8px; }
@media (prefers-color-scheme: light) { :focus-visible { outline-color: var(--ink); } }
svg.i { width: 22px; height: 22px; flex: none; stroke-width: 1.75; }
.num { font-variant-numeric: tabular-nums; }
img { display: block; max-width: 100%; }

#app {
  max-width: 1240px;
  margin: 0 auto;
  min-height: 100dvh;
  padding: calc(14px + env(safe-area-inset-top, 0px)) 16px calc(32px + env(safe-area-inset-bottom, 0px));
}
@media (min-width: 760px) { #app { padding-left: 32px; padding-right: 32px; } }
.view { animation: enter 420ms var(--ease-out) both; }
@keyframes enter { from { opacity: 0; transform: translateY(14px); filter: blur(4px); } }
.rise { animation: enter 600ms var(--ease-out) both; animation-delay: calc(var(--d, 0) * 60ms); }

/* ---------- Double bordure : coque + noyau ---------- */
.shell {
  padding: 6px;
  border-radius: var(--r-shell);
  background: color-mix(in oklab, var(--raised), transparent 55%);
  box-shadow: inset 0 0 0 1px var(--seam), var(--shadow-sm);
}
.core {
  position: relative;
  height: 100%;
  border-radius: var(--r-core);
  background: var(--raised);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06), inset 0 0 0 1px var(--seam);
  overflow: hidden;
}
@media (prefers-color-scheme: light) { .core { box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9), inset 0 0 0 1px var(--seam); } }

/* ---------- Perles ---------- */
.bead {
  --c: #888;
  width: var(--s, 22px);
  height: var(--s, 22px);
  border-radius: 50%;
  flex: none;
  background:
    radial-gradient(circle at 34% 30%, rgba(255, 255, 255, 0.85) 0 9%, rgba(255, 255, 255, 0) 16%),
    radial-gradient(circle at 42% 38%, color-mix(in oklab, var(--c), white 28%) 0%, var(--c) 52%, color-mix(in oklab, var(--c), black 45%) 100%);
  box-shadow: 0 2px 3px rgba(0, 0, 0, 0.35), inset 0 -2px 3px rgba(0, 0, 0, 0.25);
  position: relative;
}
.bead.p-stripe:not(.seat):not(.hollow):not(.miss) {
  background:
    radial-gradient(circle at 34% 30%, rgba(255, 255, 255, 0.85) 0 9%, rgba(255, 255, 255, 0) 16%),
    radial-gradient(circle at 50% 50%, transparent 40%, rgba(0, 0, 0, 0.35) 100%),
    linear-gradient(90deg, transparent 38%, var(--c2) 38% 62%, transparent 62%),
    radial-gradient(circle at 42% 38%, color-mix(in oklab, var(--c), white 28%) 0%, var(--c) 52%, color-mix(in oklab, var(--c), black 45%) 100%);
}
.bead.p-eye:not(.seat):not(.hollow):not(.miss) {
  background:
    radial-gradient(circle at 34% 30%, rgba(255, 255, 255, 0.85) 0 9%, rgba(255, 255, 255, 0) 16%),
    radial-gradient(circle at 52% 55%, var(--c2) 0 22%, transparent 23%),
    radial-gradient(circle at 42% 38%, color-mix(in oklab, var(--c), white 28%) 0%, var(--c) 52%, color-mix(in oklab, var(--c), black 45%) 100%);
}
.bead.big::after {
  content: ""; position: absolute; left: 50%; top: 50%; width: 18%; height: 18%;
  transform: translate(-50%, -50%); border-radius: 50%;
  background: color-mix(in oklab, var(--c), black 55%); opacity: 0.55;
}
.bead.hollow { background: transparent; box-shadow: inset 0 0 0 2.5px var(--c); opacity: 0.9; }
.bead.seat { background: transparent; box-shadow: none; }
.bead.seat::before { content: ""; position: absolute; inset: 34%; border-radius: 50%; background: var(--ink-faint); opacity: 0.8; }
.bead.miss { background: transparent; box-shadow: inset 0 0 0 2px var(--ko); }
.bead.miss::before { content: ""; position: absolute; left: 22%; right: 22%; top: 50%; height: 2px; background: var(--ko); transform: rotate(-35deg); }

.strand { position: relative; display: flex; align-items: center; justify-content: space-between; gap: 2px; }
.strand::before { content: ""; position: absolute; left: -6px; right: -6px; top: 50%; height: 1.5px; background: var(--thread); transform: translateY(-50%); }
.strand > .bead { z-index: 1; }
/* Sur photo, le fil et les sièges passent en ivoire */
.on-photo .strand::before { background: rgba(244, 237, 223, 0.42); }
.on-photo .bead.seat::before { background: rgba(244, 237, 223, 0.62); }

/* ---------- Boutons ---------- */
/* Pilule laiton avec icône nichée dans son propre cercle */
.cta {
  display: inline-flex; align-items: center; gap: 14px; height: 58px; padding: 0 8px 0 26px;
  border-radius: 999px; font: 720 18px/1 var(--display); letter-spacing: -0.005em;
  color: var(--on-brass);
  background: linear-gradient(170deg, var(--brass-hi), var(--brass) 55%, color-mix(in oklab, var(--brass), var(--brass-lo) 60%));
  box-shadow: 0 14px 28px -14px rgba(3, 4, 15, 0.7), inset 0 1px 0 rgba(255, 255, 255, 0.55);
  transition: transform 160ms var(--ease-out), box-shadow 160ms var(--ease-out);
}
.cta .ring {
  width: 42px; height: 42px; border-radius: 50%; display: grid; place-items: center;
  background: rgba(26, 20, 5, 0.12); transition: transform 260ms var(--ease-out);
}
.cta .ring svg.i { width: 20px; height: 20px; }
.cta:active { transform: scale(0.97); }
.cta.wide { width: 100%; justify-content: space-between; }

.ghost {
  display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 16px; border-radius: 999px;
  font-size: 15px; color: var(--ink-soft); box-shadow: inset 0 0 0 1px var(--seam-strong);
  transition: transform 140ms var(--ease-out), background 200ms var(--ease-out);
}
.ghost svg.i { width: 18px; height: 18px; }
.ghost:active { transform: scale(0.97); }
.icon-btn { display: inline-grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; box-shadow: inset 0 0 0 1px var(--seam-strong); background: color-mix(in oklab, var(--raised), transparent 40%); flex: none; }
.icon-btn:active { transform: scale(0.95); }

/* ---------- Barre du haut ---------- */
.topbar { display: flex; align-items: center; gap: 10px; height: 52px; }
.wordmark { display: inline-flex; align-items: center; gap: 10px; font: 760 25px/1 var(--display); font-stretch: 85%; letter-spacing: -0.02em; margin-right: auto; }
.wordmark .bead { --s: 14px; }
.pill {
  display: inline-flex; align-items: center; gap: 8px; height: 40px; padding: 0 14px;
  border-radius: 999px; background: color-mix(in oklab, var(--raised), transparent 30%);
  box-shadow: inset 0 0 0 1px var(--seam); font: 700 15px/1 var(--display); color: var(--ink-soft);
}
.pill svg.i { width: 19px; height: 19px; }
.pill .bead { --s: 13px; }
.pill.fire { color: var(--fire); box-shadow: inset 0 0 0 1px color-mix(in oklab, var(--fire), transparent 60%); }
.pill.level { display: none; }
@media (min-width: 760px) { .pill.level { display: inline-flex; } }

/* ---------- Accueil ---------- */
.home { display: grid; gap: 14px; margin-top: 12px; grid-template-columns: 1fr; }
@media (min-width: 960px) {
  .home { grid-template-columns: repeat(12, 1fr); gap: 20px; margin-top: 22px; }
  .home .hero { grid-column: span 8; grid-row: span 2; }
  .home .side { grid-column: span 4; }
}

.hero .core { min-height: 470px; display: flex; flex-direction: column; justify-content: flex-end; color: var(--photo-ink); background: #0B0E20; }
@media (min-width: 960px) { .hero .core { min-height: 560px; } }
.hero .photo { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 50% 30%; animation: drift 18s var(--ease-out) both; }
@keyframes drift { from { transform: scale(1.1); } }
.hero .scrim { position: absolute; inset: 0; background: linear-gradient(180deg, rgba(8, 10, 26, 0) 0%, rgba(8, 10, 26, 0.3) 30%, rgba(8, 10, 26, 0.88) 60%, #080A1A 100%); }
.hero .body { position: relative; padding: 24px 20px 20px; }
@media (min-width: 760px) { .hero .body { padding: 40px 40px 36px; } }
.hero .today { display: flex; align-items: center; justify-content: space-between; gap: 12px; max-width: 540px; margin: 26px 0 12px; font-size: 14px; color: rgba(244, 237, 223, 0.78); }
.hero .strand { --s: 18px; max-width: 540px; }
.hero h1 { text-shadow: 0 2px 22px rgba(8, 10, 26, 0.55); font: 780 clamp(40px, 10vw, 68px)/0.96 var(--display); font-stretch: 78%; letter-spacing: -0.03em; max-width: 12ch; text-wrap: balance; }
.hero p { margin-top: 12px; font-size: 17px; line-height: 1.45; max-width: 40ch; color: rgba(244, 237, 223, 0.84); }
.hero .actions { margin-top: 24px; }

.side .core { padding: 22px; display: flex; flex-direction: column; justify-content: space-between; gap: 6px; }
.side h2 { font: 740 20px/1.15 var(--display); font-stretch: 90%; letter-spacing: -0.01em; }
.side .sub { margin-top: 4px; font-size: 14.5px; color: var(--ink-soft); }
.level-card .rank { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin-top: 6px; }
.level-card .rank strong { font: 780 34px/1 var(--display); font-stretch: 80%; letter-spacing: -0.025em; }
.level-card .rank span { font: 700 14px/1 var(--display); color: var(--ink-faint); white-space: nowrap; }
.lvl-thread { position: relative; height: 18px; margin-top: 16px; }
.lvl-thread::before { content: ""; position: absolute; left: 0; right: 0; top: 50%; height: 1.5px; background: var(--thread); }
.lvl-thread i { position: absolute; left: 0; top: 50%; height: 3px; transform: translateY(-50%); background: var(--brass); border-radius: 3px; }
.lvl-thread .bead { position: absolute; top: 50%; --s: 16px; transform: translate(-50%, -50%); }
.level-card .next { margin-top: 10px; display: flex; justify-content: space-between; gap: 10px; font-size: 13.5px; color: var(--ink-faint); }
.figures { margin-top: 18px; display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.figures div { padding: 12px 12px 10px; border-radius: 16px; background: var(--raised-2); }
.figures b { display: block; font: 760 24px/1.05 var(--display); font-stretch: 88%; }
.figures span { font-size: 12.5px; color: var(--ink-faint); }

.streak-head { display: flex; align-items: center; gap: 14px; }
.streak-head .flame { width: 48px; height: 48px; border-radius: 16px; display: grid; place-items: center; color: var(--fire); background: color-mix(in oklab, var(--fire), transparent 86%); flex: none; }
.streak-head .flame svg.i { width: 24px; height: 24px; }
.streak-head strong { display: block; font: 780 28px/1 var(--display); font-stretch: 82%; }
.streak-head span { font-size: 14px; color: var(--ink-soft); }
.week { margin-top: 18px; display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.week .d { display: flex; flex-direction: column; align-items: center; gap: 8px; font-size: 12px; color: var(--ink-faint); }
.week .d .bead { --s: 22px; }
.week .d.today span { color: var(--ink); font-weight: 750; }

.section-head { margin: 46px 0 18px; display: flex; flex-wrap: wrap; align-items: end; justify-content: space-between; gap: 8px 16px; }
.section-head h2 { font: 780 clamp(32px, 6vw, 48px)/0.98 var(--display); font-stretch: 80%; letter-spacing: -0.03em; }
.section-head p { font-size: 15px; color: var(--ink-soft); max-width: 36ch; }

/* Tuiles des thèmes : grille asymétrique */
.tiles { display: grid; gap: 12px; grid-template-columns: repeat(2, 1fr); }
.tile { grid-column: span 1; min-width: 0; display: block; text-align: left; transition: transform 260ms var(--ease-out); }
.tile.lead { grid-column: span 2; }
.tile:not(.lead) .pct { display: none; }
@media (min-width: 760px) {
  .tile .pct { display: inline; }
  .tiles { grid-template-columns: repeat(6, 1fr); gap: 16px; }
  .tile { grid-column: span 2; }
  .tile.wide { grid-column: span 4; }
}
.tile:active { transform: scale(0.985); }
.tile .core { min-height: 210px; display: flex; flex-direction: column; justify-content: flex-end; color: var(--photo-ink); background: #0B0E20; }
.tile.lead .core { min-height: 250px; }
@media (min-width: 760px) { .tile .core { min-height: 270px; } .tile.wide .core { min-height: 270px; } }
.tile img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: transform 700ms var(--ease-out); }
.tile .scrim { position: absolute; inset: 0; background: linear-gradient(180deg, rgba(8, 10, 26, 0) 20%, rgba(8, 10, 26, 0.55) 52%, rgba(8, 10, 26, 0.95) 100%); }
.tile .tbody { position: relative; padding: 14px 14px 16px; }
@media (min-width: 760px) { .tile .tbody { padding: 20px 22px 22px; } }
.tile .tname { display: flex; align-items: center; gap: 9px; font: 760 19px/1.1 var(--display); font-stretch: 86%; letter-spacing: -0.01em; }
.tile.lead .tname { font-size: clamp(24px, 4vw, 32px); }
@media (min-width: 760px) { .tile.wide .tname { font-size: clamp(24px, 4vw, 32px); } .tile.wide .tname .bead { --s: 20px; } }
.tile .tname .bead { --s: 15px; }
.tile.lead .tname .bead { --s: 20px; }
.tile .tsub { margin-top: 4px; font-size: 13.5px; line-height: 1.35; color: rgba(244, 237, 223, 0.76); display: none; }
@media (min-width: 760px) { .tile .tsub { display: block; } }
.tile.lead .tsub { display: block; }
.tile .tfoot { margin-top: 12px; display: flex; align-items: center; gap: 12px; }
.tile .tfoot .strand { flex: 1; --s: 10px; }
.tile .pct { font: 720 13px/1 var(--display); color: rgba(244, 237, 223, 0.86); }

.foot { margin-top: 40px; padding-top: 20px; border-top: 1px solid var(--seam); display: flex; flex-wrap: wrap; gap: 10px; }

/* ---------- Thème ---------- */
.banner { margin-top: 12px; }
.banner .core { min-height: 300px; display: flex; flex-direction: column; justify-content: flex-end; color: var(--photo-ink); background: #0B0E20; }
@media (min-width: 760px) { .banner .core { min-height: 400px; } }
.banner img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.banner .scrim { position: absolute; inset: 0; background: linear-gradient(180deg, rgba(8, 10, 26, 0.1) 25%, rgba(8, 10, 26, 0.92) 100%); }
.banner .body { position: relative; padding: 24px 22px 26px; display: flex; align-items: end; gap: 18px; }
@media (min-width: 760px) { .banner .body { padding: 36px 40px; } }
.banner .body > .bead { --s: 54px; }
.banner h1 { font: 780 clamp(38px, 8vw, 64px)/0.96 var(--display); font-stretch: 78%; letter-spacing: -0.03em; }
.banner p { margin-top: 6px; color: rgba(244, 237, 223, 0.82); font-size: 16px; }
.banner .stat { margin-top: 14px; display: flex; align-items: center; gap: 12px; max-width: 420px; }
.banner .stat .strand { flex: 1; --s: 12px; }
.banner .stat span { font: 720 14px/1 var(--display); }
.banner .icon-btn { position: absolute; top: 14px; left: 14px; z-index: 2; color: var(--photo-ink); background: rgba(8, 10, 26, 0.45); box-shadow: inset 0 0 0 1px rgba(244, 237, 223, 0.22); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); }

.chapters { margin-top: 16px; display: grid; gap: 12px; grid-template-columns: 1fr; }
@media (min-width: 760px) { .chapters { grid-template-columns: repeat(2, 1fr); gap: 16px; } }
.chapter { display: block; width: 100%; text-align: left; transition: transform 220ms var(--ease-out); }
.chapter:active { transform: scale(0.985); }
.chapter .core { padding: 20px 20px 22px; }
.chapter .h { display: flex; align-items: center; gap: 14px; }
.chapter .n { flex: none; width: 40px; height: 40px; border-radius: 14px; display: grid; place-items: center; font: 780 18px/1 var(--display); color: var(--ink-soft); background: var(--raised-2); }
.chapter .t { flex: 1; font: 720 18px/1.25 var(--display); font-stretch: 92%; }
.chapter .c { font-size: 13px; color: var(--ink-faint); }
.chapter .strand { margin: 20px 4px 0; --s: 20px; }
.chapter.locked { opacity: 0.5; }
.chapter.locked .n svg.i { width: 18px; height: 18px; }

/* ---------- Quiz ---------- */
.ambient { position: fixed; inset: 0; z-index: -1; background-size: cover; background-position: center; filter: blur(48px) saturate(1.2); opacity: 0.2; }
@media (prefers-color-scheme: light) { .ambient { opacity: 0.14; } }
.quiz { min-height: calc(100dvh - 46px - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px)); display: flex; flex-direction: column; max-width: 1120px; margin: 0 auto; }
.qbar { display: flex; align-items: center; gap: 12px; height: 52px; }
.qbar .strand { flex: 1; min-width: 0; }
.combo { display: inline-flex; align-items: center; gap: 2px; min-width: 48px; justify-content: flex-end; font: 760 16px/1 var(--display); color: var(--fire); opacity: 0; transform: scale(0.85); transition: opacity 180ms var(--ease-out), transform 180ms var(--ease-out); }
.combo.on { opacity: 1; transform: none; }
.combo svg.i { width: 18px; height: 18px; }
.combo.pop { animation: pop 320ms var(--ease-out); }
@keyframes pop { 40% { transform: scale(1.3); } }

.qgrid { flex: 1; display: grid; gap: 24px; padding-top: 22px; align-content: start; }
@media (min-width: 960px) { .qgrid { grid-template-columns: 1.05fr 1fr; gap: 64px; padding-top: 8vh; } }
.tag { display: inline-flex; align-items: center; gap: 8px; height: 32px; padding: 0 12px 0 9px; border-radius: 999px; font-size: 13.5px; color: var(--ink-soft); box-shadow: inset 0 0 0 1px var(--seam-strong); }
.tag .bead { --s: 14px; }
.tag em { font-style: normal; color: var(--ink-faint); }
.question { margin-top: 18px; font: 700 clamp(27px, 6.8vw, 46px)/1.08 var(--display); font-stretch: 86%; letter-spacing: -0.022em; text-wrap: pretty; }
.qthumb { display: none; }
@media (min-width: 960px) {
  .qthumb { display: block; margin-top: 32px; max-width: 440px; }
  .qthumb .core { aspect-ratio: 16 / 10; }
  .qthumb img { width: 100%; height: 100%; object-fit: cover; }
}
.answers { display: flex; flex-direction: column; gap: 10px; padding-bottom: 24px; }
.answer {
  display: flex; align-items: center; gap: 14px; width: 100%; min-height: 64px; padding: 12px 16px 12px 12px;
  text-align: left; font-size: 17px; line-height: 1.3; font-weight: 650;
  background: color-mix(in oklab, var(--raised), transparent 8%); border-radius: 20px;
  box-shadow: inset 0 0 0 1px var(--seam-strong), var(--shadow-sm);
  transition: transform 160ms var(--ease-out), box-shadow 200ms var(--ease-out), background 200ms var(--ease-out), opacity 220ms;
}
@media (min-width: 960px) { .answer { min-height: 74px; font-size: 18px; padding-left: 14px; } }
.answer .k {
  flex: none; width: 38px; height: 38px; border-radius: 13px; display: grid; place-items: center;
  font: 760 14px/1 var(--display); color: var(--ink-soft); background: var(--raised-2);
}
.answer .k svg.i { width: 20px; height: 20px; }
.answer:active:not([disabled]) { transform: scale(0.985); }
.answer[disabled] { cursor: default; }
.answer.dim { opacity: 0.38; }
.answer.ok { background: color-mix(in oklab, var(--ok), var(--raised) 80%); box-shadow: inset 0 0 0 2px var(--ok), var(--shadow-sm); }
.answer.ok .k { background: var(--ok); color: #fff; }
.answer.ko { background: color-mix(in oklab, var(--ko), var(--raised) 84%); box-shadow: inset 0 0 0 2px var(--ko), var(--shadow-sm); animation: shake 380ms var(--ease-out); }
.answer.ko .k { background: var(--ko); color: #fff; }
@keyframes shake { 20% { transform: translateX(-7px); } 45% { transform: translateX(6px); } 70% { transform: translateX(-3px); } }

/* Feuille d'explication : en bas sur mobile, flottante sur ordinateur */
.sheet {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 20;
  max-width: 720px; margin: 0 auto; max-height: 74dvh; display: flex; flex-direction: column;
  padding: 22px 20px calc(18px + env(safe-area-inset-bottom, 0px));
  background: var(--raised); border-radius: 28px 28px 0 0;
  box-shadow: 0 -24px 50px -16px rgba(3, 4, 15, 0.6), inset 0 0 0 1px var(--seam);
  transform: translateY(105%); transition: transform 380ms var(--ease-drawer);
}
@media (min-width: 960px) { .sheet { bottom: 24px; border-radius: 28px; padding: 26px 28px 24px; transform: translateY(calc(100% + 40px)); } }
.sheet.open { transform: none; }
.sheet::before { content: ""; position: absolute; left: 24px; right: 24px; top: 0; height: 3px; border-radius: 0 0 3px 3px; background: var(--state, var(--ok)); }
.sheet .sh { display: flex; align-items: center; gap: 10px; }
.sheet .sh h3 { flex: 1; font: 780 28px/1 var(--display); color: var(--state); font-stretch: 84%; letter-spacing: -0.02em; }
.sheet .xp { font: 720 15px/1 var(--display); color: var(--brass); }
.sheet .ans { margin-top: 10px; font-size: 15.5px; color: var(--ink-soft); }
.sheet .ans b { color: var(--ink); }
.sheet .expl { margin-top: 10px; overflow-y: auto; overscroll-behavior: contain; font-size: 16.5px; line-height: 1.6; color: var(--ink); max-width: 64ch; }
.sheet .cta { margin-top: 18px; flex: none; }

.flying { position: fixed; z-index: 30; pointer-events: none; left: 0; top: 0; }

/* ---------- Résultat ---------- */
.result { display: grid; gap: 20px; padding-top: 10px; }
@media (min-width: 960px) { .result { grid-template-columns: 1fr 1fr; gap: 28px; align-items: start; padding-top: 24px; } }
.result .summary .core { padding: 28px 22px 24px; text-align: center; }
.necklace { position: relative; width: 100%; aspect-ratio: 1.6; max-width: 420px; margin: 0 auto; }
.necklace svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.necklace .bead { position: absolute; transform: translate(-50%, -50%) scale(0.6); opacity: 0; animation: thread 420ms var(--ease-out) forwards; }
@keyframes thread { to { transform: translate(-50%, -50%) scale(1); opacity: 1; } }
.necklace .score { position: absolute; left: 22%; right: 22%; top: 22%; font: 780 56px/1 var(--display); font-stretch: 80%; letter-spacing: -0.03em; }
.necklace .score small { display: block; margin-top: 6px; font: 450 14px/1.3 var(--body); color: var(--ink-faint); letter-spacing: 0; }
.verdict { margin-top: 6px; font: 780 34px/1.04 var(--display); font-stretch: 82%; letter-spacing: -0.025em; text-wrap: balance; }
.gains { margin: 22px auto 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; max-width: 420px; }
.gains div { padding: 14px 8px 12px; border-radius: 18px; background: var(--raised-2); }
.gains strong { display: block; font: 760 26px/1.05 var(--display); font-stretch: 86%; }
.gains span { font-size: 12.5px; color: var(--ink-faint); }
.gains .hot strong { color: var(--fire); }
.result .summary .cta { margin-top: 24px; }
.retain h2 { font: 780 32px/1 var(--display); font-stretch: 80%; letter-spacing: -0.025em; }
.retain > p { margin-top: 6px; font-size: 15px; color: var(--ink-soft); }
.retain-list { margin-top: 16px; display: grid; gap: 10px; }
.card-miss .core { padding: 18px; display: grid; grid-template-columns: auto 1fr; gap: 4px 12px; }
.card-miss .bead { --s: 14px; margin-top: 4px; grid-row: 1 / span 3; }
.card-miss .q { font-size: 14.5px; color: var(--ink-soft); }
.card-miss .a { font: 720 18px/1.25 var(--display); font-stretch: 92%; }
.card-miss .e { font-size: 14.5px; color: var(--ink-soft); line-height: 1.55; }
.all-good .core { padding: 26px 22px; }
.all-good p { color: var(--ink-soft); margin-top: 6px; }

/* ---------- Crédits ---------- */
.credits { max-width: 760px; margin: 0 auto; }
.credits h1 { margin-top: 18px; font: 780 40px/1 var(--display); font-stretch: 80%; letter-spacing: -0.03em; }
.credits > p { margin-top: 8px; color: var(--ink-soft); }
.credits ul { margin-top: 20px; list-style: none; display: grid; gap: 10px; }
.credits li .core { display: grid; grid-template-columns: 72px 1fr; gap: 14px; padding: 10px; align-items: center; }
.credits li img { width: 72px; height: 72px; border-radius: 16px; object-fit: cover; }
.credits li b { display: block; font-size: 15px; }
.credits li span { display: block; font-size: 13.5px; color: var(--ink-soft); overflow-wrap: anywhere; }
.credits a { color: var(--ink); text-underline-offset: 3px; }

.toast {
  position: fixed; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom, 0px)); z-index: 40;
  transform: translate(-50%, 20px); opacity: 0; padding: 12px 18px; border-radius: 999px;
  background: var(--ink); color: var(--ground); font-size: 15px; max-width: calc(100% - 40px);
  transition: transform 240ms var(--ease-out), opacity 240ms var(--ease-out);
}
.toast.on { transform: translate(-50%, 0); opacity: 1; }

@media (hover: hover) and (pointer: fine) {
  .cta:hover .ring { transform: translateX(3px) scale(1.06); }
  .tile:hover img { transform: scale(1.05); }
  .tile:hover { transform: translateY(-3px); }
  .chapter:not(.locked):hover { transform: translateY(-2px); }
  .answer:not([disabled]):hover { box-shadow: inset 0 0 0 1.5px var(--ink-faint), var(--shadow-sm); transform: translateX(3px); }
  .ghost:hover { background: color-mix(in oklab, var(--raised), transparent 30%); color: var(--ink); }
}

@media (prefers-reduced-motion: reduce) {
  .view, .rise, .necklace .bead, .answer.ko, .combo.pop, .hero .photo { animation: none; opacity: 1; filter: none; }
  .necklace .bead { transform: translate(-50%, -50%); }
  .sheet { transition-duration: 1ms; }
}

/* ---------- Onglets (Aujourd'hui / Explorer / Profil) ---------- */
:root { --pub: 0px; --tabbar: 64px; }
body.avec-banniere { --pub: 62px; }
.tab-view { padding-bottom: calc(var(--tabbar) + var(--pub) + 24px + env(safe-area-inset-bottom, 0px)); animation: enter 360ms var(--ease-out) both; }
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
  display: grid; grid-template-columns: repeat(3, 1fr);
  padding: 6px 8px calc(6px + env(safe-area-inset-bottom, 0px));
  background: color-mix(in oklab, var(--raised), transparent 4%);
  backdrop-filter: blur(18px) saturate(1.4); -webkit-backdrop-filter: blur(18px) saturate(1.4);
  box-shadow: inset 0 1px 0 var(--seam-strong);
}
.tab {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  height: 52px; border-radius: 16px; color: var(--ink-faint); font-size: 12px; font-weight: 600; letter-spacing: 0.01em;
  transition: color 160ms var(--ease-out), transform 120ms var(--ease-out);
}
.tab svg.i { width: 24px; height: 24px; transition: transform 220ms var(--ease-out); }
.tab:active { transform: scale(0.94); }
.tab.on { color: var(--brass-hi); }
.tab.on svg.i { transform: translateY(-1px) scale(1.06); stroke-width: 2.1; }
@media (min-width: 760px) {
  .tabbar { left: 50%; right: auto; transform: translateX(-50%); width: 420px; bottom: 16px; border-radius: 24px; box-shadow: inset 0 0 0 1px var(--seam-strong), 0 20px 40px -20px rgba(0,0,0,.6); }
}

/* Suggestion « À explorer » sur l'onglet Aujourd'hui */
.tile.suggest { width: 100%; }
.tile.suggest .core { min-height: 150px; }
.tile .kicker { display: block; margin-bottom: 6px; font-size: 11.5px; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase; color: var(--brass-hi); }

/* Profil : cartes + listes de réglages façon appli */
.profile { display: grid; gap: 14px; margin-top: 12px; }
.rows { display: flex; flex-direction: column; border-radius: 22px; overflow: hidden; background: var(--raised); box-shadow: inset 0 0 0 1px var(--seam); }
.rows h2 { padding: 16px 18px 6px; font-size: 12px; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase; color: var(--ink-faint); }
.row { display: flex; align-items: center; gap: 14px; min-height: 64px; padding: 10px 14px 10px 16px; text-align: left; transition: background 160ms var(--ease-out); }
.row + .row { box-shadow: inset 0 1px 0 var(--seam); }
.row:active { background: var(--raised-2); }
.row-ic { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 12px; background: var(--raised-2); color: var(--brass-hi); flex: none; }
.row-ic svg.i { width: 20px; height: 20px; }
.row-t { display: flex; flex-direction: column; gap: 2px; flex: 1; min-width: 0; }
.row-t b { font-size: 16px; font-weight: 600; color: var(--ink); }
.row-t small { font-size: 13.5px; color: var(--ink-soft); }
.row-go { width: 18px; height: 18px; color: var(--ink-faint); }
@media (min-width: 760px) { .profile { grid-template-columns: 1fr 1fr; } .profile .rows { grid-column: span 1; } }
.ghost.bonus { width: 100%; justify-content: center; min-height: 50px; margin-bottom: 10px; color: var(--ink); }
.ghost.bonus:disabled { opacity: .5; }
