/* Révision S1 : système visuel
   Monochrome profond + une couleur par matière (--sc). Rayons : 22px cartes, 14px éléments, pilules pour les actions. */

:root {
  --bg: #eeeeec;
  --bg-soft: #e6e6e3;
  --surface: #f9f9f8;
  --surface-2: #ffffff;
  --ink: #141519;
  --ink-2: #2b2d33;
  --muted: #676a73;
  --faint: #9a9ca4;
  --line: rgba(20, 22, 28, 0.08);
  --line-2: rgba(20, 22, 28, 0.14);
  --shadow: 0 1px 1px rgba(20, 22, 28, 0.04), 0 8px 24px -12px rgba(20, 22, 28, 0.16);
  --shadow-lg: 0 2px 4px rgba(20, 22, 28, 0.04), 0 30px 60px -30px rgba(20, 22, 28, 0.35);
  --hl: inset 0 1px 0 rgba(255, 255, 255, 0.9);
  --accent: #2b2d33;
  --accent-2: #676a73;
  --sc-bg: #2b2d33;
  --good: #12a06e;
  --bad: #e2445c;
  --warn: #d48a0b;
  --r-xl: 28px;
  --r-lg: 22px;
  --r-md: 14px;
  --r-sm: 10px;
  --ease: cubic-bezier(0.32, 0.72, 0, 1);
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --font: "Geist", ui-sans-serif, system-ui, -apple-system, "SF Pro Text", sans-serif;
  --mono: "Geist Mono", ui-monospace, "SF Mono", Menlo, monospace;
  --side: 272px;
  color-scheme: light;

  --c-mic: #0f9f7a;
  --c-acc: #2e67e6;
  --c-geo: #d45f2a;
  --c-org: #b03f8c;
  --c-pm: #c98b0c;
  --c-math: #0d93ad;
  --c-eng: #df3f5b;
  --c-esp: #8a7a12;
}

:root[data-theme="dark"] {
  --bg: #0a0b0e;
  --bg-soft: #14161b;
  --surface: #111317;
  --surface-2: #171a1f;
  --ink: #ededef;
  --ink-2: #d2d3d8;
  --muted: #9b9ea8;
  --faint: #6c6f78;
  --line: rgba(255, 255, 255, 0.07);
  --line-2: rgba(255, 255, 255, 0.13);
  --shadow: 0 1px 1px rgba(0, 0, 0, 0.3), 0 10px 30px -14px rgba(0, 0, 0, 0.7);
  --shadow-lg: 0 2px 4px rgba(0, 0, 0, 0.3), 0 40px 80px -30px rgba(0, 0, 0, 0.9);
  --hl: inset 0 1px 0 rgba(255, 255, 255, 0.06);
  --accent: #d2d3d8;
  --accent-2: #9b9ea8;
  --sc-bg: #2b2d33;
  --c-mic: #2fc79b;
  --c-acc: #5f8dff;
  --c-geo: #f07a43;
  --c-org: #e264b8;
  --c-pm: #f0b232;
  --c-math: #32b9d3;
  --c-eng: #ff6680;
  --c-esp: #c9b43a;
  color-scheme: dark;
}

/* La couleur de matière (--sc) est posée en style inline : les dérivées doivent être recalculées au même niveau. */
[style*="--sc"] {
  --accent: var(--sc);
  --accent-2: color-mix(in oklab, var(--sc) 55%, var(--ink));
  --sc-bg: color-mix(in oklab, var(--sc) 84%, #000);
}
:root[data-theme="dark"] [style*="--sc"] { --sc-bg: color-mix(in oklab, var(--sc) 62%, #000); }

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 24px; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 15.5px;
  line-height: 1.6;
  letter-spacing: -0.006em;
  -webkit-font-smoothing: antialiased;
  font-feature-settings: "ss01", "cv11";
  min-height: 100dvh;
  transition: background 0.5s var(--ease), color 0.5s var(--ease);
}
::selection { background: color-mix(in oklab, var(--accent) 30%, transparent); }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; padding: 0; }
input, textarea, select { font: inherit; color: inherit; }
img { max-width: 100%; display: block; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 8px; }
.mono { font-family: var(--mono); font-feature-settings: "zero"; }

/* Grain fixe, très léger */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 90;
  opacity: 0.035;
  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");
}

/* ───────── Structure ───────── */
.shell { display: grid; grid-template-columns: var(--side) minmax(0, 1fr); min-height: 100dvh; }
/* Mode plein écran : menu de gauche masqué. */
.focus-btn {
  position: fixed; bottom: 18px; left: 18px; z-index: 40;
  width: 40px; height: 40px; border-radius: 50%; border: 0; cursor: pointer;
  display: grid; place-items: center; font-size: 20px;
  background: var(--surface); color: var(--ink-2); outline: 1px solid var(--line); box-shadow: var(--shadow);
}
.focus-btn:hover { color: var(--ink); }
body.focus .shell { grid-template-columns: minmax(0, 1fr); }
body.focus .side { display: none; }
@media (max-width: 860px) { .focus-btn { display: none; } }
.side {
  position: sticky;
  top: 0;
  height: 100dvh;
  padding: 14px 0 14px 14px;
  z-index: 20;
}
.side-in {
  height: 100%;
  display: flex;
  flex-direction: column;
  gap: 6px;
  background: var(--surface);
  border-radius: var(--r-xl);
  box-shadow: var(--shadow), var(--hl);
  outline: 1px solid var(--line);
  padding: 18px 12px 12px;
  overflow-y: auto;
  scrollbar-width: none;
}
.brand { display: flex; align-items: center; gap: 10px; padding: 2px 8px 14px; }
.brand-mark {
  width: 34px; height: 34px; border-radius: 11px;
  display: grid; place-items: center;
  background: var(--ink); color: var(--bg);
  font-weight: 700; font-size: 13px; letter-spacing: -0.02em;
}
.brand-name { font-weight: 650; letter-spacing: -0.02em; line-height: 1.15; }
.brand-name small { display: block; font-weight: 450; color: var(--muted); font-size: 12px; letter-spacing: 0; }

.search-btn {
  display: flex; align-items: center; gap: 10px;
  margin: 0 2px 10px; padding: 9px 12px;
  border-radius: 12px; background: var(--bg-soft);
  color: var(--muted); font-size: 13.5px;
  transition: background 0.3s var(--ease);
}
.search-btn:hover { background: color-mix(in oklab, var(--bg-soft) 70%, var(--line-2)); }
.search-btn kbd { margin-left: auto; font-family: var(--mono); font-size: 11px; padding: 1px 6px; border-radius: 6px; outline: 1px solid var(--line-2); }

.nav-group { padding: 10px 8px 4px; font-size: 11.5px; color: var(--faint); font-weight: 500; }
.nav a {
  display: flex; align-items: center; gap: 11px;
  padding: 8px 10px; border-radius: 12px;
  color: var(--ink-2); font-size: 14px; font-weight: 450;
  transition: background 0.35s var(--ease), color 0.35s var(--ease), transform 0.35s var(--ease);
}
.nav a i { font-size: 18px; color: var(--muted); transition: color 0.3s var(--ease); }
.nav a:hover { background: var(--bg-soft); }
.nav a:active { transform: scale(0.98); }
.nav a.on { background: var(--ink); color: var(--bg); }
.nav a.on i { color: var(--bg); }
.nav .dot { width: 9px; height: 9px; border-radius: 3px; background: var(--sc); flex: none; margin: 0 4px 0 4px; }
.nav .pct { margin-left: auto; font-family: var(--mono); font-size: 11.5px; color: var(--faint); }
.nav a.on .pct { color: color-mix(in oklab, var(--bg) 70%, transparent); }
.side-foot { margin-top: auto; display: flex; gap: 6px; padding-top: 10px; }
.icon-btn {
  width: 38px; height: 38px; border-radius: 12px;
  display: grid; place-items: center; font-size: 18px; color: var(--muted);
  transition: background 0.3s var(--ease), color 0.3s var(--ease), transform 0.3s var(--ease);
}
.icon-btn:hover { background: var(--bg-soft); color: var(--ink); }
.icon-btn:active { transform: scale(0.94); }

main { min-width: 0; padding: 14px 14px 80px; }
.page { max-width: 1120px; margin: 0 auto; padding: 26px 30px 40px; }
.page.wide { max-width: 1320px; }

/* Barre mobile */
.topbar, .tabbar { display: none; }

/* ───────── Typo ───────── */
h1, h2, h3, h4 { margin: 0; letter-spacing: -0.03em; line-height: 1.08; font-weight: 640; }
.display { font-size: clamp(34px, 4.2vw, 54px); letter-spacing: -0.045em; line-height: 1.02; font-weight: 650; }
.h-xl { font-size: clamp(30px, 3.6vw, 44px); }
.h-lg { font-size: clamp(24px, 2.6vw, 32px); }
.h-md { font-size: 21px; letter-spacing: -0.025em; }
.lead { font-size: 17.5px; color: var(--muted); line-height: 1.55; max-width: 62ch; letter-spacing: -0.012em; }
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.fr { color: var(--muted); font-weight: 420; }
.tag {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 10px; border-radius: 999px;
  font-size: 12px; font-weight: 520; letter-spacing: 0;
  background: color-mix(in oklab, var(--sc, var(--ink)) 11%, transparent);
  color: color-mix(in oklab, var(--sc, var(--ink)) 82%, var(--ink));
}
.tag i { font-size: 14px; }
.tag.plain { background: var(--bg-soft); color: var(--muted); }
.kbd { font-family: var(--mono); font-size: 11.5px; padding: 1px 6px; border-radius: 6px; outline: 1px solid var(--line-2); color: var(--muted); }

/* ───────── Coques (double bezel) ───────── */
.shell-card {
  padding: 6px;
  border-radius: var(--r-xl);
  background: color-mix(in oklab, var(--ink) 4%, transparent);
  outline: 1px solid var(--line);
}
.core {
  border-radius: calc(var(--r-xl) - 6px);
  background: var(--surface-2);
  box-shadow: var(--shadow), var(--hl);
  padding: 24px;
  height: 100%;
  position: relative;
  overflow: hidden;
}
.card {
  border-radius: var(--r-lg);
  background: var(--surface-2);
  box-shadow: var(--shadow), var(--hl);
  outline: 1px solid var(--line);
  padding: 22px;
  position: relative;
}
.lift { transition: transform 0.6s var(--ease), box-shadow 0.6s var(--ease); }
.lift:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg), var(--hl); }
.lift:active { transform: translateY(-1px) scale(0.995); }

/* ───────── Boutons ───────── */
.btn {
  display: inline-flex; align-items: center; gap: 10px;
  height: 44px; padding: 0 8px 0 18px;
  border-radius: 999px;
  background: var(--ink); color: var(--bg);
  font-weight: 550; font-size: 14.5px; white-space: nowrap;
  transition: transform 0.45s var(--ease), background 0.3s var(--ease), box-shadow 0.45s var(--ease);
  box-shadow: 0 8px 20px -10px color-mix(in oklab, var(--ink) 70%, transparent);
}
.btn .bi {
  width: 30px; height: 30px; border-radius: 999px;
  display: grid; place-items: center;
  background: color-mix(in oklab, var(--bg) 16%, transparent);
  transition: transform 0.45s var(--ease);
  font-size: 15px;
}
.btn:hover .bi { transform: translateX(2px) translateY(-1px) scale(1.06); }
.btn:active { transform: scale(0.97); }
.btn.sc { background: var(--sc-bg); color: #fff; box-shadow: 0 10px 24px -12px var(--sc); }
.btn.ghost { background: transparent; color: var(--ink); outline: 1px solid var(--line-2); box-shadow: none; }
.btn.ghost .bi { background: var(--bg-soft); }
.btn.soft { background: var(--bg-soft); color: var(--ink); box-shadow: none; }
.btn.soft .bi { background: var(--surface-2); }
.btn.sm { height: 36px; font-size: 13.5px; padding: 0 6px 0 14px; }
.btn.sm .bi { width: 24px; height: 24px; font-size: 13px; }
.btn.only { padding: 0 18px; }
.btn[disabled] { opacity: 0.4; pointer-events: none; }
.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }

.chip {
  display: inline-flex; align-items: center; gap: 7px;
  height: 34px; padding: 0 14px; border-radius: 999px;
  font-size: 13.5px; font-weight: 500; color: var(--ink-2);
  background: var(--surface-2); outline: 1px solid var(--line);
  transition: background 0.3s var(--ease), color 0.3s var(--ease), transform 0.3s var(--ease);
}
.chip:hover { background: var(--bg-soft); }
.chip:active { transform: scale(0.97); }
.chip.on { background: var(--ink); color: var(--bg); outline-color: transparent; }
.chip .dot { width: 8px; height: 8px; border-radius: 3px; background: var(--sc); }
.chip.on .dot { box-shadow: 0 0 0 2px var(--bg); }
.chips { display: flex; gap: 8px; flex-wrap: wrap; }

.seg { display: inline-flex; padding: 4px; border-radius: 999px; background: var(--bg-soft); gap: 2px; }
.seg button { height: 32px; padding: 0 14px; border-radius: 999px; font-size: 13.5px; font-weight: 500; color: var(--muted); transition: all 0.35s var(--ease); }
.seg button.on { background: var(--surface-2); color: var(--ink); box-shadow: var(--shadow); }

/* ───────── Entrées animées ───────── */
@media (prefers-reduced-motion: no-preference) {
  .enter > * { animation: up 0.7s var(--ease-out) both; animation-delay: calc(var(--i, 0) * 45ms); }
  /* Pas de flou sur les grandes sections : il coûte cher au défilement. */
  .rv { opacity: 0; transform: translateY(16px); transition: opacity 0.7s var(--ease-out), transform 0.7s var(--ease-out); }
  .rv.in { opacity: 1; transform: none; }
}
@keyframes up { from { opacity: 0; transform: translateY(14px); filter: blur(3px); } to { opacity: 1; transform: none; filter: none; } }
@keyframes pop { from { opacity: 0; transform: scale(0.96); } to { opacity: 1; transform: none; } }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }

/* ───────── Accueil ───────── */
.hero { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 18px; align-items: stretch; margin-bottom: 18px; }
.hero-main { padding: 36px 36px 30px; display: flex; flex-direction: column; justify-content: space-between; gap: 30px; min-height: 330px; }
.hero-main .display span { color: var(--muted); }
.countdown {
  position: relative; overflow: hidden;
  padding: 26px; border-radius: calc(var(--r-xl) - 6px);
  background: linear-gradient(155deg, color-mix(in oklab, var(--sc-bg) 92%, #fff) 0%, var(--sc-bg) 60%, color-mix(in oklab, var(--sc-bg) 80%, #000) 100%); color: #fff;
  display: flex; flex-direction: column; justify-content: space-between; gap: 18px;
  min-height: 330px;
}
.countdown::before {
  content: ""; position: absolute; inset: -40% -20% auto auto; width: 120%; aspect-ratio: 1;
  background: radial-gradient(closest-side, rgba(255,255,255,0.28), transparent 70%);
  pointer-events: none;
}
.countdown .big { font-size: clamp(64px, 9vw, 112px); font-weight: 650; letter-spacing: -0.06em; line-height: 0.9; font-feature-settings: "tnum"; }
.countdown { container-type: inline-size; }
.countdown .big.today { font-size: min(clamp(64px, 9vw, 112px), 19cqi); }
.countdown .big small { font-size: 0.32em; letter-spacing: -0.02em; font-weight: 520; margin-left: 8px; opacity: 0.85; }
.countdown .lbl { font-size: 13px; opacity: 0.85; font-weight: 500; }
.countdown h3 { font-size: 24px; letter-spacing: -0.03em; }
.countdown .btn { background: rgba(255,255,255,0.18); color: #fff; box-shadow: none; backdrop-filter: none; }
.countdown .btn .bi { background: rgba(255,255,255,0.22); }
.countdown .next { display: flex; gap: 8px; flex-wrap: wrap; }
.countdown .next span { font-size: 12.5px; padding: 4px 10px; border-radius: 999px; background: rgba(255,255,255,0.16); }

.stat-row { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.stat { padding: 14px 16px; border-radius: 16px; background: var(--bg-soft); }
.stat b { display: block; font-size: 26px; letter-spacing: -0.04em; font-weight: 620; line-height: 1.1; font-feature-settings: "tnum"; }
.stat span { font-size: 12.5px; color: var(--muted); }

.section-head { display: flex; align-items: end; justify-content: space-between; gap: 16px; margin: 54px 0 18px; }
.section-head p { margin: 6px 0 0; color: var(--muted); }

/* Bento des matières */
.bento { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 14px; }
.subj {
  grid-column: span 3;
  display: flex; flex-direction: column; justify-content: space-between; gap: 22px;
  min-height: 210px; padding: 20px;
  border-radius: var(--r-lg);
  background: var(--surface-2);
  outline: 1px solid var(--line);
  box-shadow: var(--shadow), var(--hl);
  position: relative; overflow: hidden; isolation: isolate;
}
.subj.big { grid-column: span 6; min-height: 250px; }
.subj::before {
  content: ""; position: absolute; inset: auto -30% -60% auto; width: 90%; aspect-ratio: 1; z-index: -1;
  background: radial-gradient(closest-side, color-mix(in oklab, var(--sc) 26%, transparent), transparent 72%);
  transition: transform 0.9s var(--ease);
}
.subj:hover::before { transform: scale(1.15) translate(-6%, -6%); }
.subj .code { font-family: var(--mono); font-size: 11.5px; color: var(--faint); }
.subj h3 { font-size: 21px; letter-spacing: -0.03em; margin-top: 10px; }
.subj.big h3 { font-size: 28px; }
.subj .fr { font-size: 13.5px; margin-top: 4px; display: block; }
.subj-foot { display: flex; align-items: end; justify-content: space-between; gap: 10px; }
.subj-foot .meta { font-size: 12.5px; color: var(--muted); line-height: 1.45; }
.subj-icon {
  width: 42px; height: 42px; border-radius: 13px; display: grid; place-items: center;
  background: color-mix(in oklab, var(--sc) 14%, transparent); color: var(--sc); font-size: 21px;
}
.subj.pending { opacity: 0.6; }

/* Anneau de maîtrise */
.ring { --p: 0; --size: 54px; --w: 5px; width: var(--size); height: var(--size); position: relative; flex: none; }
.ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.ring circle { fill: none; stroke-width: var(--w); stroke-linecap: round; }
.ring .tr { stroke: color-mix(in oklab, var(--sc, var(--ink)) 13%, transparent); }
.ring .fg { stroke: var(--sc, var(--ink)); transition: stroke-dashoffset 1.4s var(--ease-out); }
.ring b { position: absolute; inset: 0; display: grid; place-items: center; font-size: calc(var(--size) * 0.26); font-weight: 600; letter-spacing: -0.03em; font-feature-settings: "tnum"; }
.ring.xl { --size: 168px; --w: 10px; }
.ring.xl b { font-size: 38px; }
.ring.xl b small { font-size: 14px; color: var(--muted); font-weight: 500; display: block; margin-top: -4px; letter-spacing: 0; text-align: center; }

/* Frise d'examens */
.timeline { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(220px, 1fr); gap: 12px; overflow-x: auto; scroll-snap-type: x mandatory; padding-bottom: 6px; scrollbar-width: thin; }
.tl-item { scroll-snap-align: start; padding: 18px; border-radius: var(--r-lg); background: var(--surface-2); outline: 1px solid var(--line); box-shadow: var(--shadow), var(--hl); border-top: 3px solid var(--sc); }
.tl-item .when { font-family: var(--mono); font-size: 12px; color: var(--muted); }
.tl-item h4 { font-size: 17px; margin: 8px 0 4px; letter-spacing: -0.02em; }
.tl-item .d { font-size: 30px; font-weight: 650; letter-spacing: -0.05em; color: var(--sc); font-feature-settings: "tnum"; }

.todo { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.todo-item { display: flex; align-items: center; gap: 16px; padding: 16px 18px; }
.todo-item .ti { width: 46px; height: 46px; border-radius: 14px; display: grid; place-items: center; background: color-mix(in oklab, var(--sc, var(--ink)) 12%, transparent); color: var(--sc, var(--ink)); font-size: 22px; flex: none; }
.todo-item h4 { font-size: 15.5px; letter-spacing: -0.015em; }
.todo-item p { margin: 2px 0 0; font-size: 13px; color: var(--muted); }
.todo-item .go { margin-left: auto; font-size: 18px; color: var(--faint); transition: transform 0.4s var(--ease); }
.todo-item:hover .go { transform: translateX(3px); color: var(--ink); }

/* ───────── Page matière ───────── */
.s-hero {
  position: relative; overflow: hidden; isolation: isolate;
  border-radius: var(--r-xl); padding: 40px 40px 30px;
  background: var(--surface-2); outline: 1px solid var(--line); box-shadow: var(--shadow), var(--hl);
}
.s-hero::before {
  content: ""; position: absolute; z-index: -1; inset: -50% -10% auto 35%; aspect-ratio: 1;
  background: radial-gradient(closest-side, color-mix(in oklab, var(--sc) 30%, transparent), transparent 70%);
}
.s-hero::after {
  content: ""; position: absolute; z-index: -1; left: 0; top: 0; bottom: 0; width: 6px; background: var(--sc);
}
.s-hero-grid { display: grid; grid-template-columns: 1fr auto; gap: 30px; align-items: end; }
.s-hero .h-xl { margin: 14px 0 8px; }
.s-tabs { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 28px; }
.s-tabs a { display: inline-flex; align-items: center; gap: 8px; height: 38px; padding: 0 15px; border-radius: 999px; font-size: 14px; font-weight: 500; color: var(--ink-2); background: var(--bg-soft); transition: all 0.35s var(--ease); }
.s-tabs a i { font-size: 16px; }
.s-tabs a:hover { background: color-mix(in oklab, var(--sc) 14%, var(--bg-soft)); }
.s-tabs a.on { background: var(--sc-bg); color: #fff; }

.chapters { margin-top: 26px; display: grid; gap: 12px; }
.part-label { display: flex; align-items: center; gap: 14px; margin: 26px 4px 4px; color: var(--muted); font-size: 13px; font-weight: 500; }
.part-label::after { content: ""; flex: 1; height: 1px; background: var(--line-2); }
.ch-row {
  display: grid; grid-template-columns: 92px minmax(0, 1fr) auto; gap: 22px; align-items: center;
  padding: 18px 22px 18px 18px; border-radius: var(--r-lg);
  background: var(--surface-2); outline: 1px solid var(--line); box-shadow: var(--shadow), var(--hl);
}
.ch-num { font-size: 58px; font-weight: 650; letter-spacing: -0.06em; line-height: 0.9; color: color-mix(in oklab, var(--sc) 88%, var(--ink)); font-feature-settings: "tnum"; text-align: center; }
.ch-row h3 { font-size: 20px; letter-spacing: -0.025em; }
.ch-row .fr { font-size: 14px; display: block; margin-top: 2px; }
.ch-row .tl { margin: 8px 0 0; font-size: 14px; color: var(--muted); max-width: 70ch; }
.ch-meta { display: flex; gap: 14px; margin-top: 10px; font-size: 12.5px; color: var(--faint); flex-wrap: wrap; }
.ch-meta span { display: inline-flex; align-items: center; gap: 5px; }
.ch-side { display: flex; align-items: center; gap: 16px; }

/* ───────── Fiche ───────── */
.ch-open {
  position: relative; overflow: hidden; isolation: isolate;
  border-radius: var(--r-xl); padding: 44px 44px 36px; color: #fff;
  background: radial-gradient(120% 140% at 100% 0%, color-mix(in oklab, var(--sc) 80%, #fff) 0%, transparent 55%), linear-gradient(140deg, color-mix(in oklab, var(--sc) 55%, #05060a) 0%, color-mix(in oklab, var(--sc) 82%, #05060a) 60%, var(--sc) 120%);
  box-shadow: 0 30px 70px -40px var(--sc);
}
.ch-open::before {
  content: attr(data-num); position: absolute; right: -10px; bottom: -64px; z-index: -1;
  font-size: 300px; font-weight: 700; letter-spacing: -0.08em; line-height: 1; color: rgba(255,255,255,0.13);
  font-feature-settings: "tnum";
}
.ch-open .crumbs { display: flex; gap: 8px; align-items: center; font-size: 13px; opacity: 0.85; flex-wrap: wrap; }
.ch-open .crumbs a:hover { text-decoration: underline; }
.ch-open h1 { font-size: clamp(32px, 4.2vw, 52px); letter-spacing: -0.045em; margin: 22px 0 10px; max-width: 18ch; line-height: 1.04; }
.ch-open .fr { color: rgba(255,255,255,0.78); font-size: 18px; }
.ch-open .tagline { margin: 18px 0 0; max-width: 58ch; font-size: 16px; color: rgba(255,255,255,0.92); }
.ch-open .row { margin-top: 26px; }
.ch-open .btn { background: #fff; color: #111; box-shadow: none; }
.ch-open .btn .bi { background: rgba(0,0,0,0.07); }
.ch-open .btn.ghost { background: rgba(255,255,255,0.14); color: #fff; outline: 0; }
.ch-open .btn.ghost .bi { background: rgba(255,255,255,0.18); }

.fiche-grid { display: grid; grid-template-columns: minmax(0, 1fr) 250px; gap: 40px; margin-top: 34px; align-items: start; }
.toc { position: sticky; top: 24px; font-size: 13.5px; }
.toc h5 { margin: 0 0 10px; font-size: 12px; color: var(--faint); font-weight: 500; }
.toc a:not(.btn) { display: block; padding: 6px 12px; border-left: 2px solid var(--line-2); color: var(--muted); transition: all 0.3s var(--ease); line-height: 1.35; }
.toc a:not(.btn):hover { color: var(--ink); }
.toc a.on { color: var(--ink); border-left-color: var(--sc); font-weight: 520; }
.toc .toc-actions { margin-top: 18px; display: grid; gap: 8px; justify-items: start; }

.objectives { padding: 22px 24px; border-radius: var(--r-lg); background: color-mix(in oklab, var(--sc) 7%, var(--surface-2)); outline: 1px solid color-mix(in oklab, var(--sc) 18%, transparent); }
.objectives h4 { font-size: 14px; letter-spacing: -0.01em; color: color-mix(in oklab, var(--sc) 80%, var(--ink)); display: flex; gap: 8px; align-items: center; }
.objectives ul { margin: 10px 0 0; padding: 0; list-style: none; display: grid; gap: 7px; }
.objectives li { display: flex; gap: 10px; font-size: 14.5px; }
.objectives li i { color: var(--sc); font-size: 17px; margin-top: 2px; }

.prose { font-size: 16px; line-height: 1.72; min-width: 0; overflow-wrap: break-word; }
.prose > * + * { margin-top: 16px; }
.prose p { max-width: 70ch; }
.prose p:first-child { margin-top: 0; }
.prose > p { margin-bottom: 0; }
.prose h2.bh {
  font-size: 26px; letter-spacing: -0.035em; margin-top: 52px; padding-top: 30px;
  border-top: 1px solid var(--line-2); display: flex; gap: 14px; align-items: baseline;
}
.prose h2.bh .n { font-family: var(--mono); font-size: 13px; color: var(--sc); font-weight: 500; letter-spacing: 0; }
.prose h2.bh:first-child { margin-top: 10px; border-top: 0; padding-top: 0; }
.prose ul, .prose ol { margin: 0; padding-left: 22px; max-width: 70ch; }
.prose li + li { margin-top: 6px; }
b.en, .en-term { font-weight: 620; color: var(--ink); background: linear-gradient(transparent 62%, color-mix(in oklab, var(--sc) 22%, transparent) 62%); padding: 0 1px; }
i.tr { color: var(--muted); font-style: italic; font-weight: 420; }

.blk { border-radius: var(--r-lg); padding: 20px 22px; position: relative; }
.blk-def { background: var(--surface-2); outline: 1px solid var(--line); box-shadow: var(--shadow), var(--hl); }
.blk-def .term { display: flex; gap: 10px; align-items: baseline; flex-wrap: wrap; }
.blk-def .term b { font-size: 19px; letter-spacing: -0.02em; font-weight: 640; }
.blk-def .term span { color: var(--muted); font-size: 14px; font-style: italic; }
.blk-def .en-def { margin: 10px 0 0; font-size: 15px; color: var(--ink-2); padding-left: 14px; border-left: 2px solid var(--sc); font-style: italic; }
.blk-def .fr-def { margin: 10px 0 0; font-size: 15px; color: var(--muted); }
.blk-def .say { position: absolute; top: 14px; right: 14px; }

.blk-ex { background: color-mix(in oklab, var(--sc) 6%, var(--surface)); outline: 1px dashed color-mix(in oklab, var(--sc) 35%, transparent); }
.blk-ex.course { outline-style: solid; background: var(--surface-2); }
.blk-ex .bt { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; flex-wrap: wrap; }
.blk-ex .bt strong { font-size: 15.5px; letter-spacing: -0.015em; }

.blk-warn { background: color-mix(in oklab, var(--bad) 7%, var(--surface)); outline: 1px solid color-mix(in oklab, var(--bad) 22%, transparent); padding-left: 52px; }
.blk-tip { background: color-mix(in oklab, var(--good) 7%, var(--surface)); outline: 1px solid color-mix(in oklab, var(--good) 22%, transparent); padding-left: 52px; }
.blk-warn > i, .blk-tip > i { position: absolute; left: 18px; top: 19px; font-size: 21px; }
.blk-warn > i { color: var(--bad); }
.blk-tip > i { color: var(--good); }

.blk-formula { background: var(--surface-2); outline: 1px solid var(--line); box-shadow: var(--shadow), var(--hl); display: grid; gap: 10px; }
.blk-formula .fname { font-size: 13px; color: var(--muted); font-weight: 500; }
.blk-formula .ftex { font-size: 20px; overflow-x: auto; padding: 6px 0; }
.blk-formula .fexp { font-size: 14.5px; color: var(--muted); }

.blk-diagram, .blk-figure { background: var(--surface-2); outline: 1px solid var(--line); box-shadow: var(--shadow), var(--hl); padding: 18px; }
.blk-diagram svg { width: 100%; height: auto; max-height: 460px; color: var(--ink); font-family: var(--font); display: block; }
.blk-figure img { border-radius: 12px; outline: 1px solid var(--line); cursor: zoom-in; width: 100%; }
figcaption { margin-top: 12px; font-size: 13.5px; color: var(--muted); display: grid; gap: 2px; }
figcaption b { color: var(--ink); font-weight: 560; }

.blk-table { overflow-x: auto; padding: 0; background: var(--surface-2); outline: 1px solid var(--line); box-shadow: var(--shadow), var(--hl); }
.blk-table table { width: 100%; border-collapse: collapse; font-size: 14.5px; }
.blk-table th { text-align: left; font-weight: 580; font-size: 13px; color: var(--muted); background: var(--bg-soft); padding: 12px 16px; }
.blk-table td { padding: 12px 16px; vertical-align: top; border-top: 1px solid var(--line); }
.blk-table caption { caption-side: bottom; text-align: left; padding: 10px 16px; font-size: 13px; color: var(--muted); }

.blk-compare { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; padding: 0; }
.blk-compare > div { padding: 18px 20px; border-radius: var(--r-lg); background: var(--surface-2); outline: 1px solid var(--line); box-shadow: var(--shadow), var(--hl); }
.blk-compare h4 { font-size: 16px; margin-bottom: 10px; letter-spacing: -0.02em; }
.blk-compare ul { padding-left: 18px; margin: 0; font-size: 14.5px; }

.blk-steps { counter-reset: s; list-style: none; padding: 0 !important; display: grid; gap: 10px; }
.blk-steps li { counter-increment: s; display: grid; grid-template-columns: 32px 1fr; gap: 12px; align-items: start; margin: 0 !important; }
.blk-steps li::before { content: counter(s); width: 28px; height: 28px; border-radius: 9px; display: grid; place-items: center; font-family: var(--mono); font-size: 12.5px; background: color-mix(in oklab, var(--sc) 14%, transparent); color: var(--sc); font-weight: 600; }

.blk-recap { background: var(--ink); color: var(--bg); padding: 26px 28px; }
.blk-recap h4 { font-size: 18px; letter-spacing: -0.02em; display: flex; gap: 10px; align-items: center; }
.blk-recap ul { margin: 14px 0 0; padding: 0; list-style: none; display: grid; gap: 10px; }
.blk-recap li { display: grid; grid-template-columns: 22px 1fr; gap: 10px; font-size: 15px; }
.blk-recap li i { color: var(--sc); font-size: 18px; margin-top: 2px; }
.blk-recap b.en { color: var(--bg); background: none; text-decoration: underline; text-decoration-color: var(--sc); text-underline-offset: 3px; }

.accounts { width: 100%; border-collapse: collapse; font-size: 14.5px; font-family: var(--mono); }
.accounts th { font-family: var(--font); text-align: left; font-size: 12.5px; color: var(--muted); font-weight: 520; padding: 8px 12px; border-bottom: 1px solid var(--line-2); }
.accounts td { padding: 8px 12px; border-bottom: 1px solid var(--line); }
.accounts td.num { text-align: right; }
.accounts tr.cr td:first-child { padding-left: 36px; }

.unverified::after { content: "à confirmer"; position: absolute; top: -9px; right: 16px; font-size: 11px; padding: 2px 8px; border-radius: 999px; background: var(--warn); color: #fff; font-weight: 560; }

.chapter-end { margin-top: 56px; display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.next-card { padding: 22px; display: flex; flex-direction: column; gap: 10px; min-height: 140px; justify-content: space-between; }
.next-card .lbl { font-size: 12.5px; color: var(--muted); display: flex; gap: 6px; align-items: center; }
.next-card h4 { font-size: 19px; letter-spacing: -0.025em; }
.next-card.right { text-align: right; align-items: end; }
.subject-break { grid-column: 1 / -1; display: flex; align-items: center; gap: 14px; color: var(--muted); font-size: 13px; }
.subject-break::before, .subject-break::after { content: ""; flex: 1; height: 1px; background: var(--line-2); }

.test-yourself { margin-top: 40px; padding: 28px; display: grid; grid-template-columns: 1fr auto; gap: 20px; align-items: center; }

/* ───────── Flashcards ───────── */
.flash-stage { display: grid; place-items: center; padding: 20px 0 10px; perspective: 1600px; }
.flash {
  width: min(680px, 100%); aspect-ratio: 1.6; position: relative; cursor: pointer;
  transform-style: preserve-3d; transition: transform 0.85s var(--ease);
}
.flash.flip { transform: rotateY(180deg); }
.flash .face {
  position: absolute; inset: 0; backface-visibility: hidden; -webkit-backface-visibility: hidden;
  border-radius: var(--r-xl); padding: 36px; display: flex; flex-direction: column; justify-content: center; gap: 14px;
  background: var(--surface-2); outline: 1px solid var(--line); box-shadow: var(--shadow-lg), var(--hl);
  text-align: center; align-items: center;
}
.flash .face.back { transform: rotateY(180deg); background: linear-gradient(160deg, color-mix(in oklab, var(--sc) 9%, var(--surface-2)), var(--surface-2)); }
.flash .q { font-size: clamp(22px, 2.8vw, 30px); letter-spacing: -0.03em; font-weight: 600; line-height: 1.2; max-width: 22ch; }
.flash .a { font-size: clamp(18px, 2.2vw, 23px); letter-spacing: -0.02em; font-weight: 560; line-height: 1.35; max-width: 34ch; }
.flash .afr { font-size: 15px; color: var(--muted); max-width: 46ch; }
.flash .corner { position: absolute; top: 18px; left: 22px; right: 22px; display: flex; justify-content: space-between; font-size: 12px; color: var(--faint); }
.flash .hint { position: absolute; bottom: 18px; font-size: 12.5px; color: var(--faint); }
.grade { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; width: min(680px, 100%); margin: 22px auto 0; }
.grade button { padding: 12px 10px; border-radius: 16px; background: var(--surface-2); outline: 1px solid var(--line); box-shadow: var(--shadow); font-weight: 560; font-size: 14.5px; transition: transform 0.35s var(--ease), background 0.3s var(--ease); display: grid; gap: 2px; }
.grade button small { font-weight: 450; font-size: 11.5px; color: var(--muted); font-family: var(--mono); }
.grade button:hover { transform: translateY(-2px); }
.grade button:active { transform: scale(0.97); }
.grade .g1 { color: var(--bad); } .grade .g2 { color: var(--warn); } .grade .g3 { color: var(--good); } .grade .g4 { color: var(--c-acc); }
.progress-line { height: 4px; border-radius: 4px; overflow: hidden; width: min(680px, 100%); margin: 0 auto 16px; position: relative; }
.progress-line i { position: absolute; inset: 0 auto 0 0; background: var(--sc, var(--ink)); border-radius: 4px; transition: width 0.6s var(--ease); }

/* ───────── Quiz ───────── */
.quiz-card { max-width: 760px; margin: 0 auto; }
.quiz-q { font-size: clamp(20px, 2.3vw, 25px); letter-spacing: -0.025em; font-weight: 600; line-height: 1.3; margin: 14px 0 22px; }
.choices { display: grid; gap: 10px; }
.choice {
  display: grid; grid-template-columns: 34px 1fr auto; gap: 14px; align-items: center; text-align: left;
  padding: 14px 16px; border-radius: 16px; background: var(--surface-2); outline: 1px solid var(--line-2);
  transition: transform 0.35s var(--ease), background 0.3s var(--ease), outline-color 0.3s var(--ease);
  font-size: 15.5px; line-height: 1.4;
}
.choice:hover:not([disabled]) { transform: translateX(3px); outline-color: color-mix(in oklab, var(--sc, var(--ink)) 45%, transparent); }
.choice .k { width: 30px; height: 30px; border-radius: 10px; display: grid; place-items: center; font-family: var(--mono); font-size: 13px; background: var(--bg-soft); color: var(--muted); font-weight: 600; }
.choice.ok { background: color-mix(in oklab, var(--good) 10%, var(--surface-2)); outline-color: var(--good); }
.choice.ok .k { background: var(--good); color: #fff; }
.choice.ko { background: color-mix(in oklab, var(--bad) 9%, var(--surface-2)); outline-color: var(--bad); }
.choice.ko .k { background: var(--bad); color: #fff; }
.choice[disabled] { cursor: default; }
.explain { margin-top: 18px; padding: 18px 20px; border-radius: 16px; background: var(--bg-soft); font-size: 15px; animation: pop 0.5s var(--ease-out); }
.explain h5 { margin: 0 0 6px; font-size: 13px; display: flex; gap: 8px; align-items: center; }
.qbar { display: flex; justify-content: space-between; align-items: center; gap: 10px; font-size: 13px; color: var(--muted); }
.lvl { display: inline-flex; gap: 3px; }
.lvl i { width: 6px; height: 14px; border-radius: 2px; background: var(--line-2); display: block; }
.lvl i.on { background: var(--sc, var(--ink)); }
.score-big { font-size: clamp(70px, 10vw, 120px); font-weight: 650; letter-spacing: -0.06em; line-height: 0.95; font-feature-settings: "tnum"; }
.result-list { display: grid; gap: 8px; margin-top: 18px; }
.result-row { display: grid; grid-template-columns: 1fr 120px 60px; gap: 14px; align-items: center; padding: 12px 16px; border-radius: 14px; background: var(--surface-2); outline: 1px solid var(--line); font-size: 14px; }
.bar { height: 6px; border-radius: 6px; background: var(--sc, var(--ink)); }
.timer { font-family: var(--mono); font-size: 14px; padding: 6px 12px; border-radius: 999px; background: var(--bg-soft); }
.timer.low { background: color-mix(in oklab, var(--bad) 15%, transparent); color: var(--bad); }

/* ───────── Configurateur (setup) ───────── */
.setup { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 18px; align-items: start; }
.setup .field { display: grid; gap: 10px; margin-bottom: 22px; }
.setup .field > label { font-size: 13px; font-weight: 560; color: var(--ink-2); }
.scope-list { display: grid; gap: 6px; max-height: 420px; overflow-y: auto; padding: 2px; }
.scope-item { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 12px; font-size: 14px; cursor: pointer; transition: background 0.3s var(--ease); }
.scope-item:hover { background: var(--bg-soft); }
.scope-item input { accent-color: var(--ink); width: 17px; height: 17px; }
.scope-item .dot { width: 9px; height: 9px; border-radius: 3px; background: var(--sc); flex: none; }
.scope-item small { margin-left: auto; color: var(--faint); font-family: var(--mono); font-size: 11.5px; }

/* ───────── Glossaire ───────── */
.toolbar { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; margin: 26px 0 18px; }
.input {
  height: 44px; padding: 0 16px 0 42px; border-radius: 999px; border: 0; outline: 1px solid var(--line-2);
  background: var(--surface-2) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 256 256'%3E%3Cpath fill='%23888' d='M228 220l-49-49a92 92 0 1 0-8 8l49 49a6 6 0 0 0 8-8ZM34 108a74 74 0 1 1 74 74 74 74 0 0 1-74-74Z'/%3E%3C/svg%3E") 16px center / 17px no-repeat;
  min-width: 280px; font-size: 14.5px; transition: outline-color 0.3s var(--ease), box-shadow 0.3s var(--ease);
}
.input:focus { outline: 2px solid var(--ink); }
.input::placeholder { color: var(--faint); }
.gloss { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 12px; }
.g-item { padding: 18px 20px; border-radius: var(--r-lg); background: var(--surface-2); outline: 1px solid var(--line); box-shadow: var(--shadow), var(--hl); display: grid; gap: 6px; align-content: start; position: relative; }
.g-item .en { font-size: 17px; font-weight: 620; letter-spacing: -0.02em; padding-right: 36px; }
.g-item .frt { font-size: 14px; color: var(--sc); font-weight: 500; }
.g-item p { margin: 0; font-size: 14px; color: var(--muted); line-height: 1.5; }
.g-item .src { font-size: 12px; color: var(--faint); display: flex; align-items: center; gap: 6px; }
.g-item .src .dot { width: 7px; height: 7px; border-radius: 2px; background: var(--sc); }
.g-item .say { position: absolute; top: 12px; right: 12px; }
.hide-fr .g-item .frt, .hide-fr .g-item p { filter: blur(7px); transition: filter 0.4s var(--ease); }
.hide-fr .g-item:hover .frt, .hide-fr .g-item:hover p { filter: none; }
.letter { grid-column: 1 / -1; font-size: 30px; font-weight: 650; letter-spacing: -0.04em; margin: 18px 0 2px; color: var(--faint); }

/* ───────── Catalogue ───────── */
.masonry { columns: 3 300px; column-gap: 14px; }
.fig {
  break-inside: avoid; margin: 0 0 14px; padding: 6px; border-radius: var(--r-lg);
  background: color-mix(in oklab, var(--ink) 4%, transparent); outline: 1px solid var(--line); cursor: zoom-in; display: block; width: 100%; text-align: left;
}
.fig-in { border-radius: calc(var(--r-lg) - 6px); overflow: hidden; background: var(--surface-2); box-shadow: var(--shadow), var(--hl); }
.fig img { width: 100%; transition: transform 0.9s var(--ease); background: #fff; }
.fig:hover img { transform: scale(1.03); }
.fig .svgwrap { padding: 16px; color: var(--ink); }
.fig .svgwrap svg { width: 100%; height: auto; display: block; font-family: var(--font); }
.fig .cap { padding: 12px 14px 14px; display: grid; gap: 4px; }
.fig .cap b { font-size: 14px; letter-spacing: -0.01em; font-weight: 580; }
.fig .cap span { font-size: 12.5px; color: var(--muted); }
.fig .cap .src { display: flex; align-items: center; gap: 6px; font-size: 11.5px; color: var(--faint); }
.fig .cap .src .dot { width: 7px; height: 7px; border-radius: 2px; background: var(--sc); }

.lightbox {
  position: fixed; inset: 0; z-index: 70; display: grid; grid-template-rows: 1fr auto; gap: 16px; padding: 30px;
  background: color-mix(in oklab, var(--bg) 82%, transparent); backdrop-filter: blur(24px) saturate(140%); -webkit-backdrop-filter: blur(24px) saturate(140%);
  animation: fade 0.4s var(--ease);
}
.lightbox .stage { display: grid; place-items: center; min-height: 0; }
.lightbox img, .lightbox .svgwrap { max-width: min(1200px, 100%); max-height: 100%; border-radius: 16px; box-shadow: var(--shadow-lg); background: var(--surface-2); animation: pop 0.6s var(--ease-out); object-fit: contain; }
.lightbox .svgwrap { padding: 24px; width: min(900px, 100%); color: var(--ink); }
.lightbox .svgwrap svg { width: 100%; height: auto; max-height: 70vh; font-family: var(--font); }
.lightbox .lb-cap { max-width: 900px; margin: 0 auto; text-align: center; display: grid; gap: 6px; }
.lightbox .lb-cap b { font-size: 17px; letter-spacing: -0.02em; }
.lightbox .lb-cap span { color: var(--muted); font-size: 14px; }
.lightbox .close { position: absolute; top: 18px; right: 18px; }
.lightbox .nav-l, .lightbox .nav-r { position: absolute; top: 50%; transform: translateY(-50%); }
.lightbox .nav-l { left: 18px; } .lightbox .nav-r { right: 18px; }
.lightbox .icon-btn { background: var(--surface-2); box-shadow: var(--shadow); color: var(--ink); }

/* ───────── Exercices ───────── */
.ex-card { padding: 26px; display: grid; gap: 14px; }
.ex-card h4 { font-size: 19px; letter-spacing: -0.025em; }
.ex-statement { font-size: 15.5px; line-height: 1.65; }
.ex-statement table { border-collapse: collapse; margin: 10px 0; font-size: 14px; }
.ex-statement td, .ex-statement th { border: 1px solid var(--line-2); padding: 6px 10px; }
.reveal { border-radius: 16px; background: var(--bg-soft); padding: 16px 18px; font-size: 15px; animation: pop 0.5s var(--ease-out); }
.reveal h5 { margin: 0 0 8px; font-size: 13px; display: flex; gap: 8px; align-items: center; color: var(--muted); }
.reveal ol { margin: 0; padding-left: 20px; display: grid; gap: 8px; }
.answer-pill { display: inline-flex; gap: 8px; align-items: center; padding: 8px 14px; border-radius: 999px; background: var(--ink); color: var(--bg); font-weight: 560; font-size: 14px; }

/* ───────── Vocab trainer ───────── */
.vocab-card { max-width: 720px; margin: 10px auto 0; text-align: center; padding: 44px 36px; }
.vocab-card .def { font-size: clamp(19px, 2.2vw, 24px); letter-spacing: -0.02em; line-height: 1.4; font-weight: 520; margin: 12px auto 4px; max-width: 36ch; }
.vocab-card .frhint { color: var(--muted); font-size: 15px; }
.vocab-input { margin: 26px auto 0; width: min(440px, 100%); height: 58px; border-radius: 18px; border: 0; outline: 1px solid var(--line-2); background: var(--surface); text-align: center; font-size: 21px; letter-spacing: -0.02em; font-weight: 560; transition: outline 0.3s var(--ease); }
.vocab-input:focus { outline: 2px solid var(--sc, var(--ink)); }
.vocab-input.ok { outline: 2px solid var(--good); }
.vocab-input.ko { outline: 2px solid var(--bad); animation: shake 0.4s var(--ease); }
@keyframes shake { 20%, 60% { transform: translateX(-6px); } 40%, 80% { transform: translateX(6px); } }
.streak { font-family: var(--mono); font-size: 13px; color: var(--muted); }

/* ───────── Ressources en ligne ───────── */
.res-list { display: grid; gap: 14px; }
.res { display: grid; grid-template-columns: 260px minmax(0, 1fr); gap: 20px; padding: 14px; border-radius: var(--r-lg); background: var(--surface-2); outline: 1px solid var(--line); box-shadow: var(--shadow), var(--hl); }
.res:not(:has(.res-thumb)) { grid-template-columns: minmax(0, 1fr); padding: 18px 20px; }
.res-thumb { position: relative; border-radius: 14px; overflow: hidden; aspect-ratio: 16 / 9; background: var(--bg-soft); align-self: start; }
.res-thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.8s var(--ease); }
.res-thumb:hover img { transform: scale(1.05); }
.res-thumb .play { position: absolute; inset: 0; margin: auto; width: 54px; height: 54px; border-radius: 999px; display: grid; place-items: center; background: rgba(10, 11, 14, 0.62); color: #fff; font-size: 22px; backdrop-filter: blur(6px); transition: transform 0.45s var(--ease); }
.res-thumb:hover .play { transform: scale(1.08); }
.res-thumb .dur { position: absolute; right: 8px; bottom: 8px; font-family: var(--mono); font-size: 11.5px; padding: 2px 7px; border-radius: 6px; background: rgba(10, 11, 14, 0.75); color: #fff; }
.res-body { display: grid; gap: 8px; align-content: start; min-width: 0; padding-top: 2px; }
.res-meta { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; font-size: 12.5px; color: var(--muted); }
.res h4 { font-size: 17px; letter-spacing: -0.02em; line-height: 1.3; }
.res h4 a:hover, .res .linkish:hover { color: var(--sc, var(--ink)); }
.linkish { text-align: left; font-weight: inherit; letter-spacing: inherit; }
.res p { margin: 0; font-size: 14.5px; color: var(--ink-2); }
.res details { font-size: 14.5px; }
.res summary { cursor: pointer; color: color-mix(in oklab, var(--sc, var(--ink)) 80%, var(--ink)); font-weight: 540; display: inline-flex; gap: 6px; align-items: center; list-style: none; }
.res summary::-webkit-details-marker { display: none; }
.res details div { margin-top: 8px; padding: 12px 14px; border-radius: 12px; background: var(--bg-soft); color: var(--ink-2); }
.res-diff { display: grid; grid-template-columns: 20px 1fr; gap: 8px; font-size: 13.5px; padding: 10px 12px; border-radius: 12px; background: color-mix(in oklab, var(--warn) 10%, transparent); color: var(--ink-2); }
.res-diff i { color: var(--warn); font-size: 18px; }
.lightbox .yt { width: min(1100px, 100%); aspect-ratio: 16 / 9; border-radius: 18px; overflow: hidden; box-shadow: var(--shadow-lg); background: #000; animation: pop 0.6s var(--ease-out); }
.lightbox .yt iframe { width: 100%; height: 100%; border: 0; display: block; }

/* ───────── L'essentiel ───────── */
.ess-ch { margin-top: 34px; padding-top: 26px; border-top: 1px solid var(--line-2); }
.ess-head { display: grid; grid-template-columns: 70px 1fr auto; gap: 16px; align-items: center; }
.ess-head h3 { font-size: 22px; letter-spacing: -0.03em; }
.ess-head .fr { font-size: 14px; }
.ess-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 12px; margin-top: 18px; }
.ess-box { padding: 18px 20px; border-radius: var(--r-lg); background: var(--surface-2); outline: 1px solid var(--line); box-shadow: var(--shadow), var(--hl); font-size: 14.5px; }
.ess-box h5 { margin: 0 0 10px; font-size: 13px; display: flex; gap: 8px; align-items: center; color: color-mix(in oklab, var(--sc) 80%, var(--ink)); }
.ess-box.warn h5 { color: var(--bad); }
.ess-box ul { margin: 0; padding-left: 18px; display: grid; gap: 6px; }
.ess-box dl { margin: 0; display: grid; gap: 8px; }
.ess-box dt { font-weight: 620; letter-spacing: -0.01em; }
.ess-box dd { margin: 0; color: var(--muted); font-style: italic; }
.ess-f { display: grid; gap: 2px; }
.ess-f > span:not(.katex-display) { font-size: 12.5px; color: var(--muted); }
.ess-f .katex-display { font-size: 15px; color: var(--ink); }
.ess-f .katex-display { margin: 4px 0; text-align: left; }
.ess-f .katex-display > .katex { text-align: left; }
.ess-f + .ess-f { margin-top: 10px; }
.katex-display { overflow-x: auto; overflow-y: hidden; padding: 2px 0; }
.ess-terms { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 14px; }
.ess-terms span { font-size: 12.5px; padding: 4px 10px; border-radius: 999px; background: color-mix(in oklab, var(--sc) 10%, transparent); color: color-mix(in oklab, var(--sc) 75%, var(--ink)); cursor: help; }

/* ───────── Progression ───────── */
.heat { display: grid; gap: 18px; }
.heat-row h4 { font-size: 16px; display: flex; gap: 10px; align-items: center; margin-bottom: 10px; }
.cells { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.cell { padding: 12px 14px; border-radius: 14px; font-size: 13px; line-height: 1.35; min-height: 82px; display: flex; flex-direction: column; justify-content: space-between; gap: 8px; outline: 1px solid var(--line); transition: transform 0.4s var(--ease); }
.cell:hover { transform: translateY(-2px); }
.cell b { font-size: 20px; letter-spacing: -0.04em; font-feature-settings: "tnum"; }

/* ───────── Palette de recherche ───────── */
.palette { position: fixed; inset: 0; z-index: 80; display: grid; justify-items: center; align-items: start; padding-top: 12vh; background: color-mix(in oklab, var(--bg) 55%, transparent); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); animation: fade 0.3s var(--ease); }
.pal-box { width: min(680px, calc(100% - 32px)); border-radius: 24px; background: var(--surface-2); box-shadow: var(--shadow-lg); outline: 1px solid var(--line-2); overflow: hidden; animation: pop 0.45s var(--ease-out); }
.pal-box input { width: 100%; height: 62px; border: 0; outline: 0; padding: 0 22px; font-size: 18px; background: transparent; letter-spacing: -0.015em; border-bottom: 1px solid var(--line); }
.pal-res { max-height: 56vh; overflow-y: auto; padding: 8px; }
.pal-res a { display: grid; grid-template-columns: 26px 1fr auto; gap: 12px; align-items: center; padding: 10px 12px; border-radius: 12px; font-size: 14.5px; }
.pal-res a i { color: var(--sc, var(--muted)); font-size: 18px; }
.pal-res a small { color: var(--faint); font-size: 12px; }
.pal-res a span em { color: var(--muted); font-style: normal; font-size: 13px; display: block; }
.pal-res a.sel, .pal-res a:hover { background: var(--bg-soft); }
.pal-empty { padding: 26px; text-align: center; color: var(--muted); font-size: 14px; }

/* ───────── États vides ───────── */
.empty { padding: 60px 30px; text-align: center; display: grid; justify-items: center; gap: 12px; }
.empty > i { font-size: 42px; color: var(--faint); }
.empty h3 { font-size: 21px; }
.empty p { color: var(--muted); max-width: 46ch; margin: 0; }

.toast { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%); z-index: 85; padding: 12px 18px; border-radius: 999px; background: var(--ink); color: var(--bg); font-size: 14px; font-weight: 520; box-shadow: var(--shadow-lg); animation: pop 0.45s var(--ease-out); }

/* KaTeX */
.katex { font-size: 1.05em; }
.blk-formula .katex { font-size: 1.25em; }

/* ───────── Responsive ───────── */
@media (max-width: 1100px) {
  .fiche-grid { grid-template-columns: minmax(0, 1fr); }
  .toc { display: none; }
  .subj { grid-column: span 6; }
  .subj.big { grid-column: span 12; }
  .setup { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 860px) {
  :root { --side: 0px; }
  body { font-size: 15px; }
  .shell { grid-template-columns: 1fr; }
  .side { display: none; }
  .side.open { display: block; position: fixed; inset: 0; padding: 10px; z-index: 75; background: color-mix(in oklab, var(--bg) 60%, transparent); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px); animation: fade 0.3s var(--ease); }
  .side.open .side-in { max-width: 340px; }
  main { padding: 0 0 96px; }
  .page { padding: 12px 16px 30px; }
  .topbar { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 16px; position: sticky; top: 0; z-index: 30; background: color-mix(in oklab, var(--bg) 80%, transparent); backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px); }
  .tabbar { display: grid; grid-template-columns: repeat(5, 1fr); position: fixed; left: 12px; right: 12px; bottom: calc(12px + env(safe-area-inset-bottom)); z-index: 30; padding: 6px; border-radius: 22px; background: color-mix(in oklab, var(--surface-2) 82%, transparent); backdrop-filter: blur(22px) saturate(160%); -webkit-backdrop-filter: blur(22px) saturate(160%); box-shadow: var(--shadow-lg); outline: 1px solid var(--line); }
  .tabbar a { display: grid; justify-items: center; gap: 2px; padding: 6px 0; border-radius: 16px; font-size: 10.5px; color: var(--muted); }
  .tabbar a i { font-size: 21px; }
  .tabbar a.on { color: var(--ink); background: var(--bg-soft); }
  .hero { grid-template-columns: minmax(0, 1fr); }
  .display { font-size: clamp(30px, 9vw, 44px); }
  .stat { padding: 12px; }
  .stat b { font-size: 22px; }
  .btn { white-space: normal; }
  .hero-main { padding: 24px; min-height: 0; }
  .countdown { min-height: 260px; }
  .bento { grid-template-columns: minmax(0, 1fr); }
  .subj, .subj.big { grid-column: span 1; min-height: 170px; }
  .todo { grid-template-columns: 1fr; }
  .s-hero { padding: 26px 22px 22px; }
  .s-hero-grid { grid-template-columns: 1fr; }
  .ch-row { grid-template-columns: minmax(0, 1fr); gap: 10px; padding: 18px; }
  .ch-num { text-align: left; font-size: 42px; }
  .ch-side { justify-content: space-between; }
  .ch-open { padding: 28px 22px 26px; }
  .ch-open::before { font-size: 200px; bottom: -40px; }
  .blk-compare { grid-template-columns: 1fr; }
  .res { grid-template-columns: minmax(0, 1fr); }
  .chapter-end { grid-template-columns: minmax(0, 1fr); }
  .test-yourself { grid-template-columns: minmax(0, 1fr); }
  .grade { grid-template-columns: repeat(2, 1fr); }
  .flash { aspect-ratio: 0.95; }
  .flash .face { padding: 26px 20px; }
  .result-row { grid-template-columns: 1fr 70px 46px; }
  .input { min-width: 0; width: 100%; }
  .masonry { columns: 2 160px; }
  .stat-row { grid-template-columns: repeat(3, 1fr); }
  .section-head { margin-top: 40px; flex-direction: column; align-items: start; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.001ms !important; transition-duration: 0.001ms !important; }
  .flash { transition: none; }
}
@media print {
  body { background: #fff; color: #111; }
  .side, .topbar, .tabbar, .toc, .chapter-end, .test-yourself, .chips, .row, body::after { display: none !important; }
  .rv { opacity: 1 !important; transform: none !important; filter: none !important; }
  .ess-ch { break-inside: avoid-page; }
  .shell { display: block; }
  .ch-open { color: #000; background: none; box-shadow: none; outline: 1px solid #ccc; }
}

/* ───────── Finitions : fluidité, lecture, tactile ───────── */
html { -webkit-tap-highlight-color: transparent; }
h1, h2, h3, h4, .display { text-wrap: balance; }
p, li, dd, .blk p { text-wrap: pretty; }
@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }
/* Transition entre pages (View Transitions, Safari 18+ / Chrome) : la page sortante s'efface vite, l'entrante joue ses propres entrées. */
main { view-transition-name: page; }
::view-transition-old(page) { animation: vt-out 0.18s var(--ease) both; }
::view-transition-new(page) { animation: vt-in 0.32s var(--ease-out) both; }
::view-transition-old(root), ::view-transition-new(root) { animation: none; }
@keyframes vt-out { to { opacity: 0; transform: translateY(-6px); } }
@keyframes vt-in { from { opacity: 0; } }
/* Barre de défilement discrète */
* { scrollbar-color: var(--line-2) transparent; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: var(--line-2); border-radius: 99px; border: 3px solid transparent; background-clip: padding-box; }
::-webkit-scrollbar-track { background: transparent; }
/* Sur écran tactile, pas d'effet de survol qui reste collé après un tap. */
@media (hover: none) {
  .lift:hover { transform: none; box-shadow: var(--shadow), var(--hl); }
  .btn:hover .bi { transform: none; }
  .chip:hover { background: var(--surface-2); }
}
/* Retour de pression partout où l'on clique */
.s-tabs a:active, .nav a:active, .todo-item:active { transform: scale(0.98); }
@media (prefers-reduced-motion: reduce) {
  ::view-transition-old(page), ::view-transition-new(page) { animation: none; }
}
.who { font-size: 12.5px; margin-top: 10px; text-decoration: underline; text-underline-offset: 3px; text-decoration-color: var(--line-2); }
.who:hover { color: var(--ink); }

/* ───────── Motif de fond : grille de points, fondue vers les bords ───────── */
:root { --pat: color-mix(in oklab, var(--ink) 13%, transparent); --pat-glow: color-mix(in oklab, var(--accent) 7%, transparent); }
:root[data-theme="dark"] { --pat: color-mix(in oklab, var(--ink) 11%, transparent); --pat-glow: color-mix(in oklab, var(--accent) 9%, transparent); }
body::before {
  content: ""; position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background:
    radial-gradient(circle at 1px 1px, var(--pat) 1px, transparent 1.4px) 0 0 / 22px 22px,
    radial-gradient(60% 50% at 85% 0%, var(--pat-glow), transparent 70%),
    radial-gradient(50% 45% at 10% 100%, var(--pat-glow), transparent 70%);
  -webkit-mask-image: radial-gradient(120% 90% at 50% 0%, #000 35%, rgba(0, 0, 0, 0.35) 100%);
          mask-image: radial-gradient(120% 90% at 50% 0%, #000 35%, rgba(0, 0, 0, 0.35) 100%);
}
.shell { position: relative; z-index: 1; }
@media print { body::before { display: none; } }

/* L'essentiel : chaque encadré en bande pleine largeur, contenu réparti en colonnes */
.ess-grid { grid-template-columns: minmax(0, 1fr); gap: 12px; }
.ess-box { padding: 20px 24px; }
.ess-box h5 { margin-bottom: 14px; }
.ess-box ul { display: block; columns: 300px 3; column-gap: 34px; }
.ess-box ul li { break-inside: avoid; margin-bottom: 8px; }
.ess-box dl { grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 10px; }
.ess-box dl > div { padding: 12px 14px; border-radius: 14px; background: var(--bg-soft); }
.ess-box dd { font-size: 13.5px; line-height: 1.5; margin-top: 3px; }
.ess-fs { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 10px; }
.ess-fs .ess-f { margin: 0; padding: 12px 14px; border-radius: 14px; background: var(--bg-soft); min-width: 0; }

/* Flashcards et quiz : choix des chapitres en tuiles */
.back-link { display: inline-flex; align-items: center; gap: 8px; font-size: 13.5px; color: var(--muted); margin-bottom: 14px; transition: color 0.3s var(--ease); }
.back-link:hover { color: var(--ink); }
.subj.all { --sc: var(--ink); grid-column: 1 / -1; min-height: 0; flex-direction: row; align-items: center; justify-content: flex-start; gap: 18px; }
.subj.all h3 { margin-top: 2px; }
.ch-tools { gap: 8px; align-items: center; margin-bottom: 14px; }
.ch-tools [data-count] { margin-right: auto; font-size: 13px; }
.ch-group { display: flex; align-items: center; gap: 10px; font-size: 16px; margin: 22px 0 10px; }
.ch-group:first-of-type { margin-top: 4px; }
.ch-group .dot { width: 10px; height: 10px; border-radius: 3px; background: var(--sc); }
.ch-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; }
.ch-tile {
  position: relative; display: flex; flex-direction: column; gap: 10px; min-height: 150px; padding: 16px 16px 14px;
  border-radius: var(--r-lg); background: var(--surface-2); outline: 1px solid var(--line); box-shadow: var(--shadow), var(--hl);
  cursor: pointer; transition: transform 0.45s var(--ease), outline-color 0.3s var(--ease), background 0.3s var(--ease), opacity 0.3s var(--ease);
}
.ch-tile:hover { transform: translateY(-2px); }
.ch-tile:active { transform: scale(0.98); }
.ch-tile input { position: absolute; opacity: 0; pointer-events: none; }
.ch-tile-num { font-family: var(--mono); font-size: 13px; font-weight: 600; color: var(--sc); }
.ch-tile-t { font-weight: 600; font-size: 14.5px; line-height: 1.35; letter-spacing: -0.01em; }
.ch-tile-t small { display: block; font-weight: 400; font-size: 12.5px; color: var(--muted); margin-top: 3px; }
.ch-tile-foot { margin-top: auto; display: flex; justify-content: space-between; font-size: 12px; color: var(--faint); font-family: var(--mono); }
.ch-tile-check {
  position: absolute; top: 14px; right: 14px; width: 24px; height: 24px; border-radius: 8px; display: grid; place-items: center; font-size: 14px;
  outline: 1.5px solid var(--line-2); color: transparent; transition: all 0.3s var(--ease);
}
.ch-tile:has(input:checked) { outline: 1.5px solid color-mix(in oklab, var(--sc) 70%, transparent); background: color-mix(in oklab, var(--sc) 6%, var(--surface-2)); }
.ch-tile:has(input:checked) .ch-tile-check { background: var(--sc); outline-color: var(--sc); color: #fff; }
.ch-tile:has(input:not(:checked)) { opacity: 0.62; }
.ch-tile:has(input:focus-visible) { outline: 2px solid var(--accent); }
@media (max-width: 900px) { .ch-tiles { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); } }
.ess-subj { display: flex; align-items: center; gap: 12px; font-size: 26px; letter-spacing: -0.03em; margin: 48px 0 -6px; }
.ess-subj .dot { width: 12px; height: 12px; border-radius: 4px; background: var(--sc); }
a.ch-tile { color: inherit; }
.ch-tile-go { position: absolute; top: 14px; right: 14px; color: var(--faint); font-size: 16px; transition: color 0.3s var(--ease), transform 0.4s var(--ease); }
a.ch-tile:hover .ch-tile-go { color: var(--sc); transform: translate(2px, -2px); }
.ess-nav { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 36px; }
.ess-next { display: grid; grid-template-columns: 1fr auto; grid-template-rows: auto auto; column-gap: 14px; align-items: center; padding: 18px 20px; border-radius: var(--r-lg); background: var(--surface-2); outline: 1px solid var(--line); box-shadow: var(--shadow), var(--hl); }
.ess-next .faint { font-size: 12.5px; }
.ess-next b { grid-row: 2; font-weight: 600; letter-spacing: -0.01em; }
.ess-next .bi { grid-row: 1 / 3; grid-column: 2; width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; background: color-mix(in oklab, var(--sc) 14%, transparent); color: var(--sc); font-size: 18px; }
.ess-nav > .ess-next:only-child:last-child { grid-column: 2; }
.ess-nav > .ess-next:first-child:not(:only-child), .ess-nav > .ess-next:first-child:has(.ph-arrow-left) { grid-column: 1; }
@media (max-width: 700px) { .ess-nav { grid-template-columns: 1fr; } .ess-nav > .ess-next { grid-column: 1 !important; } }
@media print { .ess-nav, .back-link { display: none; } }
img.brand-mark { background: none; box-shadow: 0 0 0 1px var(--line-2), var(--shadow); }

/* Page matière : présentation en trois cartes */
.s-intro { margin-top: 16px; font-size: 17px; max-width: 46ch; }
.s-about { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 14px; margin-top: 14px; align-items: start; }
.s-about h4 { display: flex; gap: 9px; align-items: center; font-size: 15px; margin: 0 0 14px; }
.s-about h4 i { color: var(--sc); font-size: 18px; }
.s-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.s-chips span { font-size: 13.5px; padding: 5px 11px; border-radius: 999px; background: color-mix(in oklab, var(--sc) 11%, transparent); color: color-mix(in oklab, var(--sc) 70%, var(--ink)); }
.s-bar { display: flex; gap: 3px; height: 10px; border-radius: 6px; overflow: hidden; margin-bottom: 14px; }
.s-bar i { display: block; min-width: 6px; }
.s-grade { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.s-grade li { display: grid; grid-template-columns: 10px 1fr auto; gap: 10px; align-items: start; font-size: 14px; }
.s-grade .sw { width: 10px; height: 10px; border-radius: 3px; margin-top: 6px; }
.s-grade b { font-weight: 600; }
.s-grade small { display: block; color: var(--muted); font-size: 12.5px; line-height: 1.4; }
.s-grade .mono { font-size: 13px; font-weight: 600; }
.s-tips { margin: 0; padding-left: 18px; display: grid; gap: 8px; font-size: 14px; color: var(--ink-2); }

/* Mes évaluations */
.inp { width: 100%; height: 44px; padding: 0 14px; border-radius: 12px; border: 0; outline: 1px solid var(--line-2); background: var(--bg-soft); font-size: 15px; transition: outline-color 0.3s var(--ease); color-scheme: light dark; }
.inp:focus { outline: 2px solid var(--accent); }
.ev-form .field { display: grid; gap: 8px; margin-top: 18px; }
.ev-form .field > label { font-size: 13px; font-weight: 560; color: var(--ink-2); }
.ev-form .row { margin-top: 22px; }
.ev-subj { display: flex; flex-wrap: wrap; gap: 6px; }
.ev-row { display: grid; grid-template-columns: 1fr 240px; gap: 14px; }
.ev-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); gap: 14px; margin-top: 22px; }
.ev-card { display: flex; flex-direction: column; gap: 6px; border-top: 3px solid var(--sc); }
.ev-card.old { opacity: 0.6; }
.ev-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; }
.ev-card h3 { font-size: 20px; letter-spacing: -0.02em; }
.ev-note { margin: 4px 0 0; font-size: 14px; color: var(--ink-2); }
.ev-chs { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.ev-chs a { font-size: 12.5px; padding: 4px 10px; border-radius: 999px; background: color-mix(in oklab, var(--sc) 11%, transparent); color: color-mix(in oklab, var(--sc) 70%, var(--ink)); }
.ev-act { margin-top: 14px; gap: 8px; align-items: center; flex-wrap: wrap; }
.ev-past { margin-top: 26px; }
.ev-past summary { cursor: pointer; font-weight: 600; color: var(--muted); }
@media (max-width: 700px) { .ev-row { grid-template-columns: 1fr; } .ev-list { grid-template-columns: 1fr; } }

/* ───── Version en ligne : accueil, points, classement (js/online.js) ───── */
body.is-welcome .side, body.is-welcome .tabbar, body.is-welcome .topbar, body.is-welcome .focus-btn { display: none; }
body.is-welcome .shell { display: block; }
.welcome { min-height: 100svh; display: grid; place-items: center; padding: 24px 16px; }
.welcome-card { width: 100%; max-width: 420px; display: grid; gap: 14px; padding: 30px 26px; }
.welcome-card .seg { justify-self: start; }
.wf { display: grid; gap: 6px; }
.wf > span { font-size: 13px; font-weight: 560; color: var(--ink-2); }
.wf input { height: 46px; padding: 0 14px; border-radius: var(--r-sm); border: 1px solid var(--line); background: var(--bg-soft); font-size: 16px; }
.wf input:focus { outline: 2px solid var(--ink); outline-offset: 1px; }
.wf-err { color: var(--bad); font-size: 14px; min-height: 20px; }
.pt-badge { display: inline-flex; align-items: center; margin-left: 10px; padding: 2px 9px; border-radius: 999px; font-size: 12.5px; font-weight: 560; background: var(--bg-soft); color: var(--muted); vertical-align: middle; }
.pt-badge.ok { background: color-mix(in srgb, var(--good) 16%, transparent); color: var(--good); }
div.pt-badge { margin-left: 0; }
.lb { padding: 8px 6px; overflow-x: auto; }
.lb table { width: 100%; border-collapse: collapse; font-size: 15px; }
.lb th { text-align: left; font-size: 12.5px; font-weight: 560; color: var(--muted); padding: 10px 12px; }
.lb td { padding: 12px; border-top: 1px solid var(--line); }
.lb .n { text-align: right; white-space: nowrap; }
.lb .rk { width: 36px; font-size: 18px; text-align: center; color: var(--muted); }
.lb tr.me td { background: var(--bg-soft); }
/* téléphone : une formule trop large défile dans sa carte au lieu d'élargir la page */
.ex-card { min-width: 0; }
.ex-card > * { min-width: 0; max-width: 100%; overflow-x: auto; overflow-y: hidden; }

/* ───── Devoirs ───── */
.hw-when { margin: 30px 0 12px; text-transform: none; }
.hw-when:first-of-type { margin-top: 22px; }
.hw-list { display: grid; gap: 12px; }
.hw { display: grid; grid-template-columns: auto 1fr; gap: 14px; align-items: start; padding: 18px 20px; cursor: pointer; }
.hw input { width: 20px; height: 20px; margin-top: 3px; accent-color: var(--sc, var(--ink)); }
.hw-top { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }
.hw-link { font-size: 13px; display: inline-flex; gap: 4px; align-items: center; }
.hw-title { font-weight: 600; letter-spacing: -0.01em; margin: 10px 0 4px; }
.hw ul { margin: 6px 0 0; padding-left: 18px; color: var(--ink-2); font-size: 14.5px; display: grid; gap: 4px; }
.hw.done { opacity: 0.55; }
.hw.done .hw-title { text-decoration: line-through; }
.hw-when { display: flex; align-items: center; gap: 10px; }
.hw-when .dot { width: 10px; height: 10px; border-radius: 50%; background: var(--sc, var(--ink)); flex: none; }
.hw-widget { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); gap: 14px; }
.hw-subj { display: grid; gap: 12px; padding: 20px; color: inherit; text-decoration: none; }
.hw-subj-head { display: flex; align-items: center; gap: 12px; }
.hw-subj-head h4 { margin: 0; font-size: 16px; letter-spacing: -0.01em; }
.hw-subj ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; font-size: 14.5px; }
.hw-subj li { display: grid; gap: 1px; padding-top: 8px; border-top: 1px solid var(--line); }
.hw-subj li .faint { font-size: 12.5px; }

/* ───── Mode créatif : effets affichés chez les joueurs ───── */
#fxl { position: fixed; inset: 0; z-index: 9999; pointer-events: none; overflow: hidden; }
#fxl .fx-img, #fxl .fx-text { position: fixed; transition: left .5s var(--ease), top .5s var(--ease), width .4s var(--ease), font-size .4s var(--ease), transform .4s var(--ease), opacity .4s; animation: fx-pop .45s var(--ease); }
#fxl .fx-img { height: auto; filter: drop-shadow(0 10px 24px rgba(0,0,0,.35)); }
#fxl .fx-text { font-weight: 800; line-height: 1.05; text-align: center; white-space: pre-wrap; max-width: 90vw; text-shadow: 0 2px 0 rgba(0,0,0,.25), 0 6px 22px rgba(0,0,0,.3); }
#fxl .fx-banner { position: fixed; left: 50%; top: 50%; width: min(92vw, 900px); padding: 28px 30px; border-radius: 26px; background: #111; color: #fff; font: 800 clamp(26px, 5vw, 56px)/1.1 Geist, system-ui, sans-serif; text-align: center; box-shadow: 0 30px 80px rgba(0,0,0,.5); animation: fx-pop .5s var(--ease); }
#fxl .out { opacity: 0 !important; }
#fxl .fx-p { position: fixed; top: -40px; border-radius: 2px; animation: fx-fall linear forwards; }
@keyframes fx-pop { from { opacity: 0; scale: .4; } }
@keyframes fx-fall { to { transform: translateY(110vh) rotate(720deg); } }
body[class*="fx-"] > *:not(#fxl) { transition: transform .6s var(--ease), filter .6s var(--ease); }
body.fx-flip > *:not(#fxl) { transform: rotate(180deg); }
body.fx-mirror > *:not(#fxl) { transform: scaleX(-1); }
body.fx-zoom > *:not(#fxl) { transform: scale(1.7); }
body.fx-tiny > *:not(#fxl) { transform: scale(.45); }
body.fx-invert > *:not(#fxl) { filter: invert(1) hue-rotate(180deg); }
body.fx-blur > *:not(#fxl) { filter: blur(6px); }
body.fx-dark > *:not(#fxl) { filter: brightness(.08); }
body.fx-rainbow > *:not(#fxl) { animation: fx-hue 1.2s linear infinite; }
body.fx-spin > *:not(#fxl) { animation: fx-spin 2.4s linear infinite; }
body.fx-shake > *:not(#fxl) { animation: fx-shake .35s linear infinite; }
body.fx-comic, body.fx-comic * { font-family: "Comic Sans MS", "Comic Neue", "Chalkboard SE", cursive !important; }
@keyframes fx-hue { to { filter: hue-rotate(360deg) saturate(2); } }
@keyframes fx-spin { to { transform: rotate(360deg); } }
@keyframes fx-shake { 0%,100% { transform: translate(0,0) rotate(0); } 20% { transform: translate(-9px,5px) rotate(-1.5deg); } 40% { transform: translate(8px,-6px) rotate(1deg); } 60% { transform: translate(-6px,-4px) rotate(-.5deg); } 80% { transform: translate(7px,6px) rotate(1.5deg); } }

/* ───── Mode créatif : page admin ───── */
.adm-grid { display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: 18px; margin-top: 22px; align-items: start; }
.adm-who { padding: 14px; display: grid; gap: 4px; position: sticky; top: 16px; }
.adm-who h4 { margin: 2px 6px 8px; font-size: 13px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.adm-p { display: flex; gap: 10px; align-items: center; width: 100%; text-align: left; padding: 9px 10px; border-radius: 12px; background: none; border: 0; color: var(--ink); cursor: pointer; font: inherit; }
.adm-p:hover { background: var(--bg-soft); }
.adm-p.on { background: var(--ink); color: var(--bg); }
.adm-p span:last-child { display: grid; min-width: 0; }
.adm-p small { opacity: .65; font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.adm-p .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--line-2); flex: none; }
.adm-p .dot.live { background: #34c759; box-shadow: 0 0 0 4px color-mix(in oklab, #34c759 25%, transparent); }
.adm-main { display: grid; gap: 12px; min-width: 0; }
.adm-bar { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 10px 14px; flex-wrap: wrap; }
.adm-f { display: inline-flex; align-items: center; gap: 8px; font-size: 13.5px; color: var(--muted); }
.adm-f b { color: var(--ink); min-width: 42px; font-variant-numeric: tabular-nums; }
.adm-stage-wrap { display: grid; place-items: center; }
.adm-stage { position: relative; width: 100%; aspect-ratio: 16 / 10; border-radius: 16px; overflow: hidden; background: repeating-conic-gradient(var(--bg-soft) 0 25%, var(--bg) 0 50%) 0 0 / 22px 22px; outline: 1px solid var(--line-2); touch-action: none; user-select: none; }
.adm-stage::before { content: attr(data-label); position: absolute; left: 10px; top: 8px; font-size: 12px; color: var(--muted); z-index: 1; pointer-events: none; }
.adm-stage.over { outline: 2px dashed var(--accent, #0a84ff); }
.adm-stage.aim { cursor: crosshair; }
.adm-hint { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; color: var(--muted); font-weight: 600; pointer-events: none; }
.adm-hint span { font-weight: 400; font-size: 13px; }
.adm-stage .st-item { position: absolute; cursor: grab; height: auto; z-index: 2; }
.adm-stage .st-item.sel { outline: 2px solid #0a84ff; outline-offset: 3px; }
.adm-stage .st-text { font-weight: 800; line-height: 1.05; white-space: pre-wrap; text-align: center; }
.adm-tip { margin: -4px 4px 0; font-size: 12.5px; }
.adm-tools { padding: 14px; display: grid; gap: 12px; }
.adm-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.adm-in { font: inherit; font-size: 14px; padding: 8px 12px; border-radius: 10px; border: 1px solid var(--line-2); background: var(--bg); color: var(--ink); min-width: 0; flex: 1 1 180px; }
.adm-row input[type=color] { width: 36px; height: 34px; border: 0; background: none; padding: 0; }
.adm-emo { display: inline-flex; gap: 6px; align-items: center; }
.ab { display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 13px; border-radius: 999px; border: 0; background: var(--ink); color: var(--bg); font: inherit; font-size: 13.5px; font-weight: 550; cursor: pointer; white-space: nowrap; }
.ab.ghost { background: transparent; color: var(--ink); outline: 1px solid var(--line-2); }
.ab:hover { transform: translateY(-1px); }
.ab:active { transform: scale(.97); }
@media (max-width: 760px) { .adm-grid { grid-template-columns: 1fr; } .adm-who { position: static; } }
.adm-stk { display: grid; grid-template-columns: repeat(auto-fill, minmax(78px, 1fr)); gap: 8px; }
.adm-stk .stk { position: relative; aspect-ratio: 1; border-radius: 12px; background: var(--bg-soft); display: grid; place-items: center; cursor: pointer; overflow: hidden; outline: 1px solid var(--line); }
.adm-stk .stk:hover { outline-color: var(--ink); }
.adm-stk img { max-width: 88%; max-height: 88%; object-fit: contain; pointer-events: none; }
.adm-stk button { position: absolute; top: 3px; right: 3px; width: 20px; height: 20px; border-radius: 50%; border: 0; background: rgba(0,0,0,.6); color: #fff; font-size: 13px; line-height: 1; cursor: pointer; opacity: 0; }
.adm-stk .stk:hover button { opacity: 1; }
@media (hover: none) { .adm-stk button { opacity: 1; } }

/* ───── Espace admin : onglets et panneaux ───── */
.adm-head { margin: 6px 0 4px; }
.adm-kicker { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.adm-head h1 { margin: 6px 0 0; }
.adm-tabs { display: flex; gap: 4px; margin: 18px 0 20px; padding: 4px; border-radius: 16px; background: var(--bg-soft); outline: 1px solid var(--line); overflow-x: auto; scrollbar-width: none; }
.adm-tabs::-webkit-scrollbar { display: none; }
.adm-tab { flex: 1 0 auto; display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 10px 14px; border-radius: 12px; color: var(--muted); font-weight: 550; font-size: 14px; white-space: nowrap; transition: background .3s var(--ease), color .3s var(--ease); }
.adm-tab:hover { color: var(--ink); }
.adm-tab.on { background: var(--card, var(--bg)); color: var(--ink); box-shadow: 0 4px 14px -8px rgba(0,0,0,.35); }
.adm-tab em { font-style: normal; font-size: 11.5px; min-width: 18px; padding: 1px 6px; border-radius: 999px; background: #ff3b30; color: #fff; text-align: center; }
.adm-tab em:empty { display: none; }
.adm .adm-grid { margin-top: 0; }
.adm-panel { display: grid; gap: 16px; }
.adm-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; }
.adm-kpi { padding: 16px 18px; display: grid; gap: 2px; }
.adm-kpi i { font-size: 20px; color: var(--muted); margin-bottom: 6px; }
.adm-kpi b { font-size: 28px; letter-spacing: -.02em; line-height: 1.1; font-variant-numeric: tabular-nums; }
.adm-kpi span { color: var(--muted); font-size: 13px; }
.adm-card { padding: 18px 20px; }
.adm-card-h { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.adm-card-h h3 { margin: 0; font-size: 17px; }
.adm-card-h .faint { font-size: 12.5px; }
.adm-cats { display: grid; gap: 8px; }
.adm-cat { display: grid; grid-template-columns: minmax(120px, 260px) 1fr 70px; gap: 12px; align-items: center; font-size: 14px; }
.adm-cat span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.adm-cat > div { height: 10px; border-radius: 999px; background: var(--bg-soft); overflow: hidden; }
.adm-cat > div i { display: block; height: 100%; border-radius: 999px; }
.adm-cat b { text-align: right; font-weight: 600; font-size: 13px; }
.adm-table-wrap { overflow-x: auto; margin: 0 -6px; }
.adm-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.adm-table th { text-align: left; font-size: 12px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; padding: 8px 8px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.adm-table td { padding: 10px 8px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.adm-table tr:last-child td { border-bottom: 0; }
.adm-table .n { text-align: right; }
.adm-live-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: #34c759; margin-right: 7px; box-shadow: 0 0 0 4px color-mix(in oklab, #34c759 25%, transparent); }
.adm-bar-t { display: flex; height: 8px; border-radius: 999px; overflow: hidden; gap: 2px; background: var(--bg-soft); }
.adm-bar-t i { display: block; min-width: 3px; }
.adm-q { display: grid; grid-template-columns: 64px minmax(0, 1fr) auto; gap: 14px; align-items: start; padding: 14px 0; border-top: 1px solid var(--line); }
.adm-q:first-of-type { border-top: 0; padding-top: 2px; }
.adm-q-rate { width: 60px; height: 60px; border-radius: 50%; display: grid; place-content: center; text-align: center; background: conic-gradient(#ff3b30 calc(var(--p) * 1%), var(--bg-soft) 0); position: relative; }
.adm-q-rate::before { content: ""; position: absolute; inset: 6px; border-radius: 50%; background: var(--card, var(--bg)); }
.adm-q-rate b, .adm-q-rate small { position: relative; line-height: 1.1; }
.adm-q-rate b { font-size: 14px; }
.adm-q-rate small { font-size: 10px; color: var(--muted); }
.adm-q-src { font-size: 12px; }
.adm-q-txt { margin: 4px 0 8px; font-weight: 550; }
.adm-q-ans { display: flex; flex-wrap: wrap; gap: 6px 14px; margin: 0; font-size: 13.5px; }
.adm-q-ans span { display: inline-flex; align-items: center; gap: 5px; }
.adm-q-ans .ok { color: #1f9d55; }
.adm-q-ans .ko { color: #e5484d; }
.adm-q-ans em { font-style: normal; opacity: .7; }
.adm-q-n { font-size: 12.5px; font-variant-numeric: tabular-nums; }
.adm-reps { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); }
.adm-rep { padding: 16px 18px; display: grid; gap: 8px; align-content: start; }
.adm-rep-h { display: flex; justify-content: space-between; gap: 10px; font-size: 14px; }
.adm-rep-h .faint { font-size: 12.5px; }
.adm-rep-txt { margin: 0; white-space: pre-wrap; }
.adm-rep-f { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: center; justify-content: space-between; font-size: 13px; padding-top: 8px; border-top: 1px solid var(--line); }
.adm-rep-f a { display: inline-flex; align-items: center; gap: 5px; text-decoration: underline; text-underline-offset: 3px; }
.adm-empty { padding: 40px 20px; display: grid; place-items: center; gap: 6px; color: var(--muted); }
.adm-empty i { font-size: 34px; }
.adm-empty p { margin: 0; }
.adm-ann-grid { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.adm-form { display: grid; gap: 12px; }
.adm-form textarea, .adm-form select { font: inherit; font-size: 15px; padding: 11px 13px; border-radius: 12px; border: 1px solid var(--line-2); background: var(--bg); color: var(--ink); width: 100%; resize: vertical; }
.adm-accts { display: grid; gap: 10px; }
.adm-acct { padding: 0; overflow: hidden; }
.adm-acct summary { list-style: none; display: flex; align-items: center; gap: 12px; padding: 14px 16px; cursor: pointer; }
.adm-acct summary::-webkit-details-marker { display: none; }
.adm-acct summary > i { color: var(--muted); transition: transform .3s var(--ease); }
.adm-acct[open] summary > i { transform: rotate(180deg); }
.adm-av { width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; background: var(--ink); color: var(--bg); font-weight: 700; flex: none; }
.adm-acct-n { display: grid; min-width: 0; flex: 1; }
.adm-acct-n small { font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.adm-acct-p { font-weight: 600; font-size: 14px; }
.adm-acct-b { display: grid; gap: 10px; padding: 4px 16px 16px; border-top: 1px solid var(--line); padding-top: 14px; }
.ab.danger { background: #e5484d; color: #fff; }

/* Annonce en haut des pages */
.annonce { display: flex; align-items: center; gap: 12px; margin: 0 0 18px; padding: 13px 14px 13px 16px; border-radius: 16px; background: color-mix(in oklab, #0a84ff 12%, var(--bg)); outline: 1px solid color-mix(in oklab, #0a84ff 35%, transparent); color: var(--ink); animation: fx-pop .5s var(--ease); }
.annonce.warn { background: color-mix(in oklab, #ff9500 16%, var(--bg)); outline-color: color-mix(in oklab, #ff9500 45%, transparent); }
.annonce > i { font-size: 20px; color: #0a84ff; flex: none; }
.annonce.warn > i { color: #ff9500; }
.annonce p { margin: 0; flex: 1; font-weight: 550; white-space: pre-wrap; }
.annonce button { border: 0; background: none; color: var(--muted); cursor: pointer; font-size: 16px; padding: 4px; flex: none; }
@media (max-width: 760px) { .adm-ann-grid { grid-template-columns: 1fr; } .adm-cat { grid-template-columns: 110px 1fr 60px; } .adm-tab span { display: none; } .adm-tab.on span { display: inline; } }

/* ───── Mini-jeux ───── */
.g-head { margin: 6px 0 14px; }
.g-head .lead { margin: 8px 0 0; }
.g-back { display: inline-flex; align-items: center; gap: 6px; font-size: 13.5px; color: var(--muted); margin-bottom: 8px; }
.g-back:hover { color: var(--ink); }
.g-hub { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 14px; margin-top: 22px; }
.g-tile { padding: 22px; display: grid; gap: 8px; align-content: start; position: relative; overflow: hidden; }
.g-tile::after { content: ""; position: absolute; right: -40px; top: -40px; width: 140px; height: 140px; border-radius: 50%; background: radial-gradient(closest-side, color-mix(in oklab, var(--g) 30%, transparent), transparent); pointer-events: none; }
.g-tile h3 { margin: 6px 0 0; font-size: 20px; }
.g-tile p { margin: 0; color: var(--muted); font-size: 14px; }
.g-ic { width: 46px; height: 46px; border-radius: 14px; display: grid; place-items: center; font-size: 24px; color: #fff; background: var(--g); box-shadow: 0 10px 24px -12px var(--g); flex: none; }
.g-best { justify-self: start; margin-top: 6px; font-size: 12.5px; font-weight: 600; padding: 4px 10px; border-radius: 999px; background: var(--bg-soft); }
.g-chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 18px; }
.g-chip { padding: 7px 13px; border-radius: 999px; font-size: 13.5px; font-weight: 550; outline: 1px solid var(--line-2); color: var(--muted); background: none; border: 0; cursor: pointer; font-family: inherit; }
.g-chip:hover { color: var(--ink); }
.g-chip.on { background: var(--ink); color: var(--bg); outline-color: var(--ink); }
.g-intro { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.g-start { padding: 28px 24px; text-align: center; display: grid; justify-items: center; gap: 4px; }
.g-big { font-size: 64px; font-weight: 800; letter-spacing: -.04em; line-height: 1; font-variant-numeric: tabular-nums; }
.g-end { display: grid; gap: 4px; font-size: 26px; font-weight: 800; letter-spacing: -.02em; margin-bottom: 14px; text-align: center; }
.g-end span { font-size: 15px; font-weight: 500; color: var(--muted); letter-spacing: 0; }
.g-lb { padding: 20px 22px; }
.g-lb-h { display: flex; align-items: center; gap: 8px; margin: 0 0 12px; font-size: 16px; }
.g-lb ol { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.g-lb li { display: grid; grid-template-columns: 30px 1fr auto; gap: 8px; align-items: center; padding: 8px 10px; border-radius: 10px; }
.g-lb li.me { background: var(--bg-soft); outline: 1px solid var(--line-2); }
.g-lb li em { font-style: normal; font-weight: 700; }
.g-play { display: grid; gap: 14px; max-width: 760px; }
.g-hud { display: flex; align-items: center; gap: 14px; transition: transform .2s; }
.g-hud.hit { animation: fx-shake .3s linear 1; }
.g-timer { flex: 1; height: 10px; border-radius: 999px; background: var(--bg-soft); overflow: hidden; }
.g-timer i { display: block; height: 100%; width: 100%; border-radius: 999px; background: linear-gradient(90deg, #ff3b30, #ff9500 30%, #34c759); }
.g-score { display: inline-flex; align-items: center; gap: 6px; font-size: 20px; }
.g-sec { min-width: 40px; text-align: right; color: var(--muted); }
.g-q { padding: 22px 24px; }
.g-src { font-size: 12px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }
.g-qt { font-size: 21px; font-weight: 650; line-height: 1.3; margin-top: 8px; letter-spacing: -.01em; }
.g-choices { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.g-c { display: flex; align-items: center; gap: 12px; text-align: left; padding: 14px 16px; min-height: 64px; border-radius: 16px; border: 0; outline: 1px solid var(--line-2); background: var(--card, var(--bg)); color: var(--ink); font: inherit; font-size: 15px; cursor: pointer; transition: transform .15s, background .2s, outline-color .2s; }
.g-c:hover { outline-color: var(--ink); transform: translateY(-1px); }
.g-c:active { transform: scale(.98); }
.g-c b { width: 28px; height: 28px; border-radius: 9px; display: grid; place-items: center; background: var(--bg-soft); font-size: 13px; flex: none; }
.g-c.ok { background: color-mix(in oklab, #34c759 22%, var(--bg)); outline: 2px solid #34c759; }
.g-c.ko { background: color-mix(in oklab, #ff3b30 18%, var(--bg)); outline: 2px solid #ff3b30; animation: fx-shake .3s linear 1; }
.g-pendu { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 16px; align-items: start; }
.g-hang { padding: 18px; display: grid; justify-items: center; gap: 6px; }
.g-hang svg { width: 100%; max-width: 180px; }
.g-hang path { fill: none; stroke: var(--line-2); stroke-width: 4; stroke-linecap: round; stroke-linejoin: round; transition: stroke .3s; }
.g-hang path.on { stroke: var(--ink); }
.g-word { padding: 22px 24px; display: grid; gap: 10px; }
.g-hint { margin: 0; font-size: 22px; font-weight: 700; letter-spacing: -.01em; }
.g-def { margin: -4px 0 0; font-size: 14px; }
.g-slots { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0; align-items: flex-end; }
.g-slots span { width: 30px; height: 40px; border-bottom: 3px solid var(--line-2); display: grid; place-items: center; font-size: 22px; font-weight: 750; text-transform: uppercase; }
.g-slots span.on { border-color: var(--ink); animation: fx-pop .3s var(--ease); }
.g-slots span.miss { color: #ff3b30; }
.g-slots i { width: 16px; }
.g-slots em { font-style: normal; font-size: 22px; font-weight: 700; padding-bottom: 6px; }
.g-keys { display: grid; grid-template-columns: repeat(auto-fill, minmax(38px, 1fr)); gap: 6px; }
.g-keys button { height: 42px; border-radius: 10px; border: 0; outline: 1px solid var(--line-2); background: var(--card, var(--bg)); color: var(--ink); font: inherit; font-weight: 700; cursor: pointer; }
.g-keys button:hover:not(:disabled) { outline-color: var(--ink); }
.g-keys button.ok { background: #34c759; color: #fff; outline: 0; }
.g-keys button.ko { opacity: .3; text-decoration: line-through; }
.g-mots { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.g-grid-card { padding: 14px; }
.g-grid { display: grid; grid-template-columns: repeat(var(--n), 1fr); gap: 3px; touch-action: none; user-select: none; -webkit-user-select: none; }
.g-grid span { aspect-ratio: 1; display: grid; place-items: center; border-radius: 8px; font-weight: 700; font-size: clamp(12px, 2.4vw, 19px); cursor: pointer; transition: background .15s, color .15s; }
.g-grid span.sel { background: var(--ink); color: var(--bg); }
.g-grid span.hit { color: #fff; }
.g-grid span.h0 { background: #ff2d55; } .g-grid span.h1 { background: #0a84ff; } .g-grid span.h2 { background: #34c759; }
.g-grid span.h3 { background: #ff9500; } .g-grid span.h4 { background: #af52de; } .g-grid span.h5 { background: #00b8a9; }
.g-list { padding: 20px 22px; }
.g-list ol { margin: 0; padding-left: 20px; display: grid; gap: 8px; }
.g-list li { display: flex; justify-content: space-between; gap: 10px; }
.g-list li em { font-style: normal; font-size: 13px; }
.g-list li.done span { text-decoration: line-through; opacity: .55; }
.g-list li.done em { color: #34c759; font-weight: 700; opacity: 1; }
.g-list [data-end] { margin-top: 16px; display: grid; justify-items: center; }
.g-who { display: flex; align-items: center; gap: 10px; padding: 10px 4px; border-top: 1px solid var(--line); }
.g-who:first-child { border-top: 0; }
.g-who .ab { margin-left: auto; }
.g-duel-hud { display: grid; grid-template-columns: 1fr auto 1fr; gap: 14px; align-items: center; width: 100%; text-align: left; }
.g-duel-hud > div { display: grid; gap: 6px; }
.g-duel-hud > div:last-child { text-align: right; }
.g-vs { font-weight: 900; font-size: 18px; color: #ff2d55; }
.g-prog { height: 8px; border-radius: 999px; background: var(--bg-soft); overflow: hidden; }
.g-prog i { display: block; height: 100%; background: #0a84ff; border-radius: 999px; transition: width .4s var(--ease); }
.g-prog.opp i { background: #ff2d55; margin-left: auto; }
.g-count { font-size: 90px; font-weight: 900; line-height: 1; margin: 18px 0 4px; animation: fx-pop .5s var(--ease); }
.g-pulse { width: 64px; height: 64px; border-radius: 50%; display: grid; place-items: center; font-size: 30px; color: #fff; background: #ff2d55; margin-bottom: 12px; animation: g-pulse 1.4s ease-in-out infinite; }
@keyframes g-pulse { 50% { box-shadow: 0 0 0 16px color-mix(in oklab, #ff2d55 0%, transparent); transform: scale(1.06); } 0%, 100% { box-shadow: 0 0 0 0 color-mix(in oklab, #ff2d55 45%, transparent); } }
.g-invite { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 10000; display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 20px; box-shadow: 0 24px 60px rgba(0,0,0,.35); width: min(440px, calc(100vw - 24px)); animation: fx-pop .4s var(--ease); }
.g-invite > div { display: grid; flex: 1; min-width: 0; }
.g-invite .faint { font-size: 13px; }
@media (max-width: 760px) {
  .g-intro, .g-pendu, .g-mots { grid-template-columns: 1fr; }
  .g-choices { grid-template-columns: 1fr; }
  .g-qt { font-size: 18px; }
  .g-hang svg { max-width: 120px; }
  .g-invite { bottom: 90px; }
}

/* Menu : rubriques repliables */
.nav-fold { display: flex; align-items: center; justify-content: space-between; width: 100%; margin-top: 6px; background: none; border: 0; cursor: pointer; font-family: inherit; text-align: left; border-radius: 8px; letter-spacing: .02em; }
.nav-fold:hover { color: var(--ink); }
.nav-fold i { font-size: 12px; transition: transform .35s var(--ease); transform: rotate(-90deg); }
.nav-fold.open i { transform: none; }
.nav-sec { display: grid; grid-template-rows: 0fr; transition: grid-template-rows .35s var(--ease); }
.nav-sec.open { grid-template-rows: 1fr; }
.nav-sec > div { overflow: hidden; min-height: 0; display: grid; gap: inherit; }
.nav-sep { height: 1px; background: var(--line); margin: 10px 8px; }

/* Bouton de thème : toujours visible en bas du menu, à droite (le bouton « masquer le menu » occupe le coin gauche) */
.side-foot { position: sticky; bottom: -12px; margin: auto -12px -12px; padding: 10px 14px 14px; justify-content: flex-end; background: linear-gradient(to bottom, transparent, var(--surface) 30%); z-index: 2; }

/* ───── Écrans de fin de duel ───── */
.g-ranked { grid-column: 1 / -1; }
.g-rank-me { display: flex; align-items: center; gap: 14px; padding: 14px; margin: -4px -4px 16px; border-radius: 16px; background: color-mix(in oklab, var(--t) 14%, transparent); outline: 1px solid color-mix(in oklab, var(--t) 40%, transparent); }
.g-tier { width: 52px; height: 52px; border-radius: 16px; display: grid; place-items: center; font-size: 28px; color: #fff; background: var(--t); box-shadow: 0 10px 26px -10px var(--t); }
.g-rank-me > div { display: grid; }
.g-rank-me small { font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }
.g-rank-me b { font-size: 26px; letter-spacing: -.02em; }
.g-rank-me b em { font-style: normal; font-size: 14px; color: var(--t); margin-left: 4px; }
.g-elo { font-weight: 800; font-size: 20px; margin: 0 0 14px; }
.g-elo span { font-weight: 500; font-size: 14px; color: var(--muted); margin-left: 6px; }
.g-elo.up, .es b.up { color: #34c759; } .g-elo.down, .es b.down { color: #ff3b30; }

.es { position: fixed; inset: 0; z-index: 10001; display: grid; place-items: center; overflow: hidden; color: #fff; font-family: Geist, system-ui, sans-serif; animation: es-in .5s ease both; cursor: pointer; }
.es.es-out { animation: es-in .45s ease reverse both; }
@keyframes es-in { from { opacity: 0; } }
.es-c { position: relative; text-align: center; display: grid; justify-items: center; gap: 6px; padding: 20px; z-index: 2; }
.es h1, .es h2 { margin: 0; line-height: .95; }
.es-sub { margin: 18px 0 0; font-size: 16px; opacity: 0; animation: es-up .6s 1.2s ease forwards; position: relative; z-index: 3; }
.es-low { position: absolute; bottom: 22%; left: 0; right: 0; text-align: center; }
.es-go { position: absolute; bottom: 36px; left: 50%; transform: translateX(-50%); z-index: 4; font: inherit; font-weight: 650; padding: 12px 26px; border-radius: 999px; border: 1px solid rgba(255,255,255,.35); background: rgba(255,255,255,.12); color: #fff; backdrop-filter: blur(8px); cursor: pointer; opacity: 0; animation: es-up .5s 2s ease forwards; }
@keyframes es-up { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
.es-go { transform: translateX(-50%); } @keyframes es-up-go { from { opacity: 0; } to { opacity: 1; } } .es-go { animation-name: es-up-go; }
.es-l { display: inline-block; opacity: 0; animation: es-letter .5s calc(var(--i) * 55ms + .2s) cubic-bezier(.2,1.6,.4,1) forwards; }
@keyframes es-letter { from { opacity: 0; transform: translateY(40px) scale(.4) rotate(-8deg); } to { opacity: 1; transform: none; } }
.es-scan { position: absolute; inset: 0; background: repeating-linear-gradient(0deg, rgba(0,0,0,.25) 0 2px, transparent 2px 4px); pointer-events: none; z-index: 3; animation: es-flick .15s steps(2) infinite; }
@keyframes es-flick { 50% { opacity: .8; } }
.es-flash { position: absolute; inset: 0; background: #fff; animation: es-flashk .6s ease-out forwards; z-index: 1; }
@keyframes es-flashk { from { opacity: 1; } to { opacity: 0; } }
.es-cf { position: absolute; top: -20px; left: var(--x); width: 9px; height: 15px; background: var(--c); border-radius: 2px; animation: es-fall var(--t) var(--d) linear forwards; z-index: 1; }
@keyframes es-fall { to { transform: translateY(110vh) rotate(calc(var(--r) + 720deg)); } }
.es-rays { position: absolute; width: 250vmax; height: 250vmax; background: repeating-conic-gradient(rgba(255,255,255,.09) 0 8deg, transparent 8deg 22deg); animation: es-spin 18s linear infinite; }
@keyframes es-spin { to { transform: rotate(360deg); } }
.es-rank { font: 900 clamp(80px, 18vw, 170px)/1 Anton, Impact, sans-serif; background: linear-gradient(#fff, #ffd60a); -webkit-background-clip: text; background-clip: text; color: transparent; animation: es-slam .7s .1s cubic-bezier(.2,1.5,.4,1) both; filter: drop-shadow(0 8px 0 rgba(0,0,0,.35)); }
@keyframes es-slam { from { transform: scale(3); opacity: 0; } }

/* victoires */
.es-royale { background: radial-gradient(circle at 50% 40%, #5b6cff, #2a1b7a 55%, #0b0626); }
.es-royale h1 { font: 400 clamp(46px, 10vw, 110px)/.92 Anton, Impact, sans-serif; letter-spacing: .02em; color: #ffd60a; text-shadow: 0 6px 0 #b8620a, 0 10px 30px rgba(0,0,0,.5); }
.es-passed { background: radial-gradient(ellipse at center, rgba(0,0,0,.35), rgba(0,0,0,.85)); backdrop-filter: blur(3px); }
.es-passed h1 { font: 400 clamp(44px, 9vw, 100px)/1 Anton, Impact, sans-serif; color: #f2c230; text-transform: uppercase; -webkit-text-stroke: 2px #000; text-shadow: 4px 4px 0 #000; }
.es-passed h2 { font: 400 clamp(22px, 4vw, 36px) Anton, sans-serif; text-transform: uppercase; color: #fff; -webkit-text-stroke: 1px #000; animation: es-up .5s 1s ease both; }
.es-money { font: 700 clamp(28px, 5vw, 44px) Geist, sans-serif; color: #7fd36f; text-shadow: 2px 2px 0 #000; margin: 4px 0 0; animation: es-up .5s .8s ease both; }
.es-felled, .es-died { background: rgba(0,0,0,.7); backdrop-filter: blur(2px) grayscale(.6); }
.es-band { position: absolute; left: 0; right: 0; top: 50%; transform: translateY(-50%); padding: 34px 0; text-align: center; background: linear-gradient(90deg, transparent, rgba(0,0,0,.92) 18%, rgba(0,0,0,.92) 82%, transparent); animation: es-band 1.2s ease both; }
@keyframes es-band { from { opacity: 0; transform: translateY(-50%) scaleY(.2); } }
.es-felled h1 { font: 500 clamp(34px, 7vw, 76px) Cinzel, Georgia, serif; color: #f3d48a; letter-spacing: .12em; text-shadow: 0 0 24px rgba(243,212,138,.65); animation: es-track 3s ease-out both; }
.es-felled .es-l { animation-name: es-fade; animation-duration: 1s; }
@keyframes es-fade { from { opacity: 0; filter: blur(8px); } to { opacity: 1; filter: none; } }
@keyframes es-track { from { letter-spacing: .02em; } to { letter-spacing: .16em; } }
.es-chicken { background: radial-gradient(circle, #3a2a00, #0d0a00 70%); }
.es-chicken h1 { font: 400 clamp(40px, 8.5vw, 96px)/1 Anton, Impact, sans-serif; color: #ffcf2e; text-shadow: 0 5px 0 #8a5a00; animation: es-slam .6s .3s cubic-bezier(.2,1.5,.4,1) both; }
.es-chicken .es-2 { animation-delay: .6s; color: #fff; text-shadow: 0 5px 0 #8a5a00; }
.es-leg { font-size: clamp(70px, 14vw, 130px); animation: es-bob 1.2s ease-in-out infinite, es-slam .6s both; }
@keyframes es-bob { 50% { transform: translateY(-14px) rotate(-8deg); } }
.es-flawless { background: radial-gradient(circle, #4a0d00, #000 75%); }
.es-flawless h1, .es-ko h1, .es-double h1 { font: 400 clamp(54px, 12vw, 140px)/.95 Bangers, Impact, sans-serif; letter-spacing: .04em; background: linear-gradient(#fff6b0, #ffb300 45%, #ff3d00); -webkit-background-clip: text; background-clip: text; color: transparent; filter: drop-shadow(0 6px 0 #5a1400) drop-shadow(0 0 30px rgba(255,90,0,.6)); animation: es-slam .5s .25s cubic-bezier(.2,1.5,.4,1) both, es-shake .4s .75s 2; }
.es-flawless .es-2 { animation-delay: .7s, 1.2s; }
@keyframes es-shake { 25% { transform: translate(-6px, 3px); } 50% { transform: translate(5px, -4px); } 75% { transform: translate(-3px, -2px); } }
.es-levelup { background: radial-gradient(circle at 50% 45%, #0f5132, #04140c 70%); }
.es-levelup h1 { font: 400 clamp(52px, 11vw, 120px) Anton, Impact, sans-serif; color: #b9ff66; text-shadow: 0 0 30px rgba(185,255,102,.6); }
.es-spark { font-size: 54px; color: #b9ff66; animation: es-spin 3s linear infinite, es-slam .6s both; }
.es-xp { width: min(420px, 76vw); height: 14px; border-radius: 999px; background: rgba(255,255,255,.15); overflow: hidden; margin-top: 10px; }
.es-xp i { display: block; height: 100%; width: 0; border-radius: 999px; background: linear-gradient(90deg, #34c759, #b9ff66); animation: es-xp 1.4s .9s cubic-bezier(.3,.8,.3,1) forwards; box-shadow: 0 0 18px #b9ff66; }
@keyframes es-xp { to { width: 100%; } }
.es-num { font: 700 28px Geist, sans-serif; margin: 6px 0 0; }
.es-achievement { background: rgba(0,0,0,.6); backdrop-filter: blur(4px); }
.es-toast { display: flex; align-items: center; gap: 16px; padding: 12px 28px 12px 12px; border-radius: 999px; background: #1d1d1d; box-shadow: 0 20px 60px rgba(0,0,0,.6); overflow: hidden; animation: es-toast 1s cubic-bezier(.3,1.4,.4,1) both; max-width: 90vw; }
@keyframes es-toast { 0% { max-width: 80px; transform: scale(.3); opacity: 0; } 40% { max-width: 80px; transform: none; opacity: 1; } 100% { max-width: 90vw; } }
.es-x { width: 64px; height: 64px; border-radius: 50%; flex: none; display: grid; place-items: center; font-size: 32px; background: radial-gradient(#3fd13f, #0e7a0e); box-shadow: 0 0 0 3px #fff inset; }
.es-toast div { display: grid; white-space: nowrap; }
.es-toast small { opacity: .75; font-size: 13px; }
.es-toast b { font-size: clamp(15px, 2.4vw, 20px); }
.es-arcade, .es-gameover { background: #000; }
.es-arcade h1, .es-gameover h1 { font: 400 clamp(30px, 7vw, 72px)/1.2 "Press Start 2P", monospace; }
.es-arcade h1 { color: #ffd60a; text-shadow: 4px 4px 0 #ff2d55; animation: es-slam .5s .3s steps(4) both; }
.es-stars { font-size: 34px; color: #ffd60a; letter-spacing: .3em; animation: es-blinkk .5s steps(2) infinite; margin: 0; }
.es-p1, .es-hi, .es-cont, .es-blink { font: 400 clamp(11px, 2vw, 16px)/1.8 "Press Start 2P", monospace; margin: 8px 0 0; }
.es-hi { color: #34c759; }
@keyframes es-blinkk { 50% { opacity: 0; } }
/* défaites */
.es-lose.es-failed, .es-lose.es-wasted { backdrop-filter: grayscale(1) brightness(.55) blur(1px); background: rgba(0,0,0,.35); }
.es-failed h1 { font: 400 clamp(46px, 9vw, 104px)/1 Anton, Impact, sans-serif; text-transform: uppercase; color: #c8102e; -webkit-text-stroke: 2px #000; text-shadow: 4px 4px 0 #000; }
.es-failed h2 { font: 400 clamp(18px, 3vw, 26px) Geist, sans-serif; animation: es-up .5s 1s both; }
.es-wasted h1 { font: 400 clamp(70px, 15vw, 170px)/1 Anton, Impact, sans-serif; color: #b30000; text-transform: lowercase; text-shadow: 0 0 2px #000, 4px 4px 0 rgba(0,0,0,.6); animation: es-zoom 4s ease-out both; }
@keyframes es-zoom { from { transform: scale(1.6); opacity: 0; } 20% { opacity: 1; } to { transform: scale(1); } }
.es-died h1 { font: 500 clamp(50px, 10vw, 120px) Cinzel, Georgia, serif; color: #a50d0d; letter-spacing: .06em; animation: es-died 3.5s ease-out both; }
@keyframes es-died { from { opacity: 0; transform: scale(.9); } 40% { opacity: 1; } to { transform: scale(1.06); } }
.es-gameover h1 { color: #ff2d55; animation: es-blinkk 1s steps(2) 3; }
.es-cont { color: #fff; } .es-blink { color: #ffd60a; animation: es-blinkk .8s steps(2) infinite; }
.es-ko { background: radial-gradient(circle, #3a0000, #000 75%); }
.es-ko h1 { font-size: clamp(110px, 26vw, 280px); }
.es-bsod { background: #0078d7; cursor: default; place-items: start center; }
.es-bs { width: min(760px, 88vw); margin-top: 14vh; font: 300 clamp(16px, 2.3vw, 24px)/1.45 "Segoe UI", Geist, sans-serif; animation: es-in .1s steps(1) both; }
.es-bs p { margin: 0 0 22px; }
.es-face { font-size: clamp(80px, 14vw, 150px); line-height: 1; margin-bottom: 30px !important; }
.es-small { font-size: 14px; opacity: .85; }
.es-glitch { background: #050505; }
.es-glitch h1 { position: relative; font: 400 clamp(56px, 12vw, 130px) Anton, Impact, sans-serif; letter-spacing: .04em; animation: es-gl 2.2s steps(1) infinite; }
.es-glitch h1::before, .es-glitch h1::after { content: attr(data-t); position: absolute; inset: 0; }
.es-glitch h1::before { color: #0ff; transform: translate(-4px, 0); clip-path: inset(0 0 55% 0); animation: es-gl1 .9s steps(2) infinite; mix-blend-mode: screen; }
.es-glitch h1::after { color: #f0f; transform: translate(4px, 0); clip-path: inset(50% 0 0 0); animation: es-gl1 .7s steps(2) infinite reverse; mix-blend-mode: screen; }
@keyframes es-gl1 { 0% { clip-path: inset(10% 0 60% 0); transform: translate(-6px, 0); } 50% { clip-path: inset(60% 0 5% 0); transform: translate(6px, 2px); } 100% { clip-path: inset(30% 0 40% 0); transform: translate(-3px, -2px); } }
@keyframes es-gl { 0%, 92% { transform: none; } 94% { transform: skewX(14deg); } 96% { transform: translate(8px) skewX(-10deg); } }
.es-glitch h2 { font: 500 clamp(16px, 3vw, 24px) "Press Start 2P", monospace; color: #ff2d55; text-transform: uppercase; font-size: clamp(11px, 2vw, 16px); }
.es-eliminated { background: radial-gradient(circle at 50% 40%, #4a0b1a, #12030a 70%); }
.es-eliminated .es-rank { background: linear-gradient(#fff, #ff6b81); -webkit-background-clip: text; background-clip: text; }
.es-bar { font: 400 clamp(22px, 4.5vw, 44px) Anton, Impact, sans-serif; letter-spacing: .03em; padding: 10px 28px; background: #e0002b; transform: skewX(-12deg); animation: es-slide .6s .6s cubic-bezier(.2,1.2,.4,1) both; }
.es-bar b { color: #ffd60a; font-weight: 400; }
@keyframes es-slide { from { transform: skewX(-12deg) translateX(-120vw); } }
/* égalité */
.es-double { background: radial-gradient(circle, #222, #000 75%); }
.es-draw { background: linear-gradient(135deg, #1b2a49, #0b0f1a); }
.es-draw h1 { font: 400 clamp(60px, 12vw, 130px) Anton, Impact, sans-serif; color: #c9d6ff; }
.es-draw h2 { font: 400 clamp(16px, 3vw, 22px) Geist, sans-serif; opacity: .8; }
@media (prefers-reduced-motion: reduce) { .es *, .es { animation-duration: .01s !important; animation-iteration-count: 1 !important; } }
.g-neg { color: #ff3b30; font-weight: 700; }
/* Revizo : écran de chargement */
.boot{padding:18vh 16px 0;text-align:center;color:var(--faint,#888);font-size:15px}
.flag-btn{display:flex;width:fit-content;align-items:center;gap:6px;margin-top:12px;background:none;border:0;color:var(--faint,#888);font:inherit;font-size:13px;cursor:pointer;padding:4px 0}
.flag-btn:hover{color:var(--bad,#d33)}
.flag-btn:disabled{opacity:.5;cursor:default}

/* ───── La Bulle (mascotte) dans le site ───── */
img.brand-mark { border-radius: 50%; box-shadow: none; background: none; }
.hero-main { position: relative; }
.hero-main .home-bulle { position: absolute; top: 18px; right: 18px; width: 64px; height: 64px; z-index: 2; }
@media (max-width: 640px) { .hero-main .home-bulle { width: 48px; height: 48px; top: 14px; right: 14px; } }
.quiz-card { position: relative; }
.quiz-card .q-bulle { width: 32px; height: 32px; margin: -6px 0; }
.flash-stage { position: relative; }
.f-count { display: inline-flex; align-items: center; gap: 10px; }
.f-count .f-bulle { width: 30px; height: 30px; margin: -6px 0; }
.end-bulle { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.end-bulle .bulle { width: 46px; height: 46px; }
.end-say { font-weight: 600; font-size: 14px; }
.card.empty .empty-bulle { width: 72px; height: 72px; margin-bottom: 6px; }
/* Classement entre amis */
.amis-board { padding: 8px 18px; }
.amis-row { display: grid; grid-template-columns: 28px 1fr auto auto; gap: 12px; align-items: center; padding: 12px 0; border-top: 1px solid var(--line); }
.amis-row:first-child { border-top: 0; }
.amis-row.me .amis-who b { color: var(--acc, #4A47FF); }
.amis-rk { font-family: var(--mono, monospace); color: var(--muted); }
.amis-who { display: flex; flex-direction: column; min-width: 0; }
.amis-who small, .amis-duel-t small { color: var(--muted); font-size: 12px; }
.amis-pts { font-weight: 650; font-size: 18px; }
.amis-pts small { font-weight: 400; color: var(--muted); font-size: 12px; }
.amis-duel { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; padding: 12px 0; border-top: 1px solid var(--line); }
.amis-duel:first-child { border-top: 0; }
.amis-duel-t { display: flex; flex-direction: column; }
@media (max-width: 520px) { .amis-row { grid-template-columns: 22px 1fr auto; } .amis-row .btn { grid-column: 2 / -1; justify-self: start; } }
