/* ════════════════════════════════════════
   QUIZARITHM — main.css
   Structure :
   1. Variables & Reset
   2. Base
   3. Navigation
   4. Système de pages
   5. Composants partagés (boutons, inputs, tags…)
   6. Page Accueil
   7. Page Jeux & cartes
   8. Jeu — Devine le nombre
   9. Page Paramètres
   10. Page CGU
   11. Page À propos
   12. Scores / Leaderboard
   13. Effets globaux (Toast, Confetti)
   14. Responsive
════════════════════════════════════════ */

/* ── 1. VARIABLES & RESET ── */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  /* Couleurs */
  --bg:         #ffffff;
  --surface:    #f7f7f5;
  --border:     #e8e8e4;
  --text:       #111111;
  --text-muted: #888880;
  --accent:     #2563eb;
  --accent-2:   #f97316;
  --accent-3:   #10b981;
  --accent-4:   #8b5cf6;
  --danger:     #ef4444;

  /* Formes */
  --radius:    14px;
  --radius-sm: 8px;

  /* Ombres */
  --shadow:    0 2px 16px rgba(0,0,0,0.07);
  --shadow-lg: 0 8px 40px rgba(0,0,0,0.12);

  /* Animation */
  --transition: 0.22s cubic-bezier(.4,0,.2,1);

  /* Typographie */
  --font-display: 'Syne', sans-serif;
  --font-body:    'DM Sans', sans-serif;
  --font-mono:    'DM Mono', monospace;
}

[data-theme="dark"] {
  --bg:         #0f0f0f;
  --surface:    #1a1a1a;
  --border:     #2a2a2a;
  --text:       #f0f0f0;
  --text-muted: #666660;
  --shadow:     0 2px 16px rgba(0,0,0,0.4);
  --shadow-lg:  0 8px 40px rgba(0,0,0,0.5);
}

/* ── 2. BASE ── */
html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  overflow-x: hidden;
  transition: background var(--transition), color var(--transition);
}

::-webkit-scrollbar       { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 99px; }

/* ── 3. NAVIGATION ── */
nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  height: 64px;
  background: rgba(255,255,255,0.92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 32px;
  transition: background var(--transition), border-color var(--transition);
}

[data-theme="dark"] nav {
  background: rgba(15,15,15,0.92);
}

.nav-logo {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.25rem;
  letter-spacing: -0.03em;
  color: var(--text);
  cursor: pointer;
  margin-right: auto;
  display: flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
}

.nav-logo span {
  width: 28px; height: 28px;
  background: var(--accent);
  border-radius: 7px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 0.75rem;
  font-family: var(--font-mono);
  font-weight: 500;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 4px;
}

.nav-link {
  font-family: var(--font-body);
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-muted);
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  border: none;
  background: none;
  transition: color var(--transition), background var(--transition);
}
.nav-link:hover  { color: var(--text); background: var(--surface); }
.nav-link.active { color: var(--accent); background: rgba(37,99,235,0.08); }

.nav-version {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--text-muted);
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 3px 8px;
  border-radius: 99px;
  margin-left: 12px;
}

/* ── Widget XP dans la nav ── */
.nav-xp-widget {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 5px 10px;
  cursor: pointer;
  margin-left: 12px;
  transition: background var(--transition), border-color var(--transition);
  min-width: 130px;
}
.nav-xp-widget:hover { background: var(--border); border-color: var(--text-muted); }

.nav-xp-badge { font-size: 1rem; line-height: 1; flex-shrink: 0; }

.nav-xp-body  { flex: 1; min-width: 0; }

.nav-xp-top {
  display: flex;
  align-items: baseline;
  gap: 5px;
  margin-bottom: 4px;
}
.nav-xp-level {
  font-family: var(--font-display);
  font-size: 0.78rem;
  font-weight: 800;
  color: var(--text);
  letter-spacing: -0.02em;
}
.nav-xp-title {
  font-family: var(--font-mono);
  font-size: 0.62rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.nav-xp-bar {
  height: 4px;
  background: var(--border);
  border-radius: 99px;
  overflow: hidden;
}
.nav-xp-fill {
  height: 100%;
  border-radius: 99px;
  background: var(--accent);
  width: 0%;
  transition: width 0.8s cubic-bezier(.4,0,.2,1);
}

/* ── 4. SYSTÈME DE PAGES ── */
.page {
  display: none;
  padding-top: 64px;
  min-height: 100vh;
}
.page.active { display: block; }

/* ── PAGE PROFIL ── */
.profile-inner {
  max-width: 680px;
  margin: 0 auto;
  padding: 48px 32px 80px;
}

/* Bandeau pseudo (couleur personnalisable) */
.prof-header {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 24px 28px;
  background: linear-gradient(135deg, color-mix(in srgb, var(--card-bg, #1e293b) 70%, #fff 30%) 0%, var(--card-bg, #1e293b) 60%, color-mix(in srgb, var(--card-bg, #1e293b) 60%, #000 40%) 100%);
  border-radius: var(--radius);
  margin-bottom: 14px;
  position: relative;
  overflow: hidden;
}
.prof-header::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0; height: 45%;
  background: linear-gradient(180deg, rgba(255,255,255,0.09) 0%, transparent 100%);
  pointer-events: none;
}

.prof-avatar-display {
  font-size: 3rem;
  line-height: 1;
  flex-shrink: 0;
  position: relative;
  z-index: 1;
  filter: drop-shadow(0 2px 8px rgba(0,0,0,0.3));
}

.prof-info {
  flex: 1;
  min-width: 0;
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.prof-pseudo-display {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: #fff;
  text-shadow: 0 1px 8px rgba(0,0,0,0.3);
  line-height: 1;
}

.prof-bio-display {
  font-size: 0.8rem;
  color: rgba(255,255,255,0.6);
  font-style: italic;
  line-height: 1.4;
}

.prof-xp-total {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: rgba(255,255,255,0.45);
}

/* Carte niveau — même style que prof-badge-card */
.prof-rank-card {
  display: flex;
  align-items: center;
  gap: 22px;
  padding: 28px 32px;
  background: var(--surface);
  border: 1px solid color-mix(in srgb, var(--card-bg, #10b981) 40%, var(--border));
  border-radius: var(--radius);
  margin-bottom: 16px;
  position: relative;
  overflow: hidden;
}
.prof-rank-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, var(--card-bg, #10b981) 0%, transparent 60%);
  opacity: 0.08;
  pointer-events: none;
}

.prof-rank-badge {
  font-size: 3.4rem;
  line-height: 1;
  flex-shrink: 0;
  position: relative; z-index: 1;
}
.prof-rank-info { position: relative; z-index: 1; }
.prof-rank-title {
  font-family: var(--font-display);
  font-size: 2.2rem;
  font-weight: 800;
  letter-spacing: -0.04em;
  color: var(--text);
  line-height: 1;
  margin-bottom: 6px;
}
.prof-rank-level {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

/* ── Personnalisation ── */
.prof-custom-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 0;
  border-bottom: 1px solid var(--border);
}
.prof-custom-row:last-child { border-bottom: none; }
.prof-custom-col { flex-direction: column; align-items: flex-start; gap: 12px; }

.prof-custom-label {
  font-size: 0.88rem;
  font-weight: 500;
  flex-shrink: 0;
  white-space: nowrap;
}

/* Picker avatar */
.prof-avatar-picker {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: flex-end;
}
.prof-avatar-btn {
  font-size: 1.4rem;
  width: 40px; height: 40px;
  border-radius: var(--radius-sm);
  border: 2px solid var(--border);
  background: var(--surface);
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: border-color var(--transition), transform var(--transition);
  line-height: 1;
}
.prof-avatar-btn:hover:not(:disabled) { border-color: var(--accent); transform: scale(1.08); }
.prof-avatar-btn.active  { border-color: var(--accent); background: rgba(37,99,235,0.08); }
.prof-avatar-btn.locked  { opacity: 0.38; cursor: not-allowed; font-size: 1rem; }

/* Picker couleur bandeau — petits ronds minimalistes */
.prof-color-picker {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}
.prof-color-btn {
  width: 24px; height: 24px;
  border-radius: 99px;
  border: 2px solid transparent;
  cursor: pointer;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
  flex-shrink: 0;
  padding: 0;
}
.prof-color-btn:hover {
  border-color: var(--text-muted);
}
.prof-color-btn.active {
  border-color: var(--text);
  box-shadow: 0 0 0 1px var(--bg), 0 0 0 3px var(--text);
}
.prof-color-swatch { display: none; }
.prof-color-name   { display: none; }

/* Barre XP */
.prof-xp-section {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 24px;
  margin-bottom: 20px;
}
.prof-xp-labels {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}
.prof-xp-cur-label {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
}
.prof-xp-pct {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--accent);
}
.prof-xp-track {
  height: 10px;
  background: var(--border);
  border-radius: 99px;
  overflow: hidden;
  margin-bottom: 8px;
}
.prof-xp-fill {
  height: 100%;
  border-radius: 99px;
  background: var(--accent);
  width: 0%;
  box-shadow: 0 0 10px rgba(37,99,235,0.35);
}
.prof-xp-numbers {
  display: flex;
  justify-content: space-between;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--text-muted);
}

/* Prochain rang */
.prof-next-rank {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 20px;
  margin-bottom: 32px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.prof-next-label {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--text-muted);
}
.prof-next-content {
  display: flex;
  align-items: center;
  gap: 14px;
}
.prof-next-badge-icon { font-size: 1.8rem; line-height: 1; }
.prof-next-title {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 3px;
}
.prof-next-xp {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* Sections profil */
.prof-section { margin-bottom: 32px; }
.prof-section-title {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  margin-bottom: 14px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
}

/* Grille badges */
.prof-badges-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
}
.prof-badge-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 10px 14px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  transition: transform var(--transition), box-shadow var(--transition);
  position: relative;
  overflow: hidden;
}
.prof-badge-card.unlocked::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, var(--rank-color) 0%, transparent 60%);
  opacity: 0.08;
}
.prof-badge-card.unlocked {
  border-color: color-mix(in srgb, var(--rank-color) 40%, var(--border));
}
.prof-badge-card.unlocked:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.prof-badge-card.locked { opacity: 0.38; }

.prof-badge-icon  { font-size: 1.8rem; line-height: 1; }
.prof-badge-title {
  font-family: var(--font-display);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--text);
}
.prof-badge-req {
  font-family: var(--font-mono);
  font-size: 0.6rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

/* Log XP */
.prof-log-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
.prof-log-row {
  display: grid;
  grid-template-columns: 1fr auto auto;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  transition: background var(--transition);
}
.prof-log-row:last-child { border-bottom: none; }
.prof-log-row:hover      { background: var(--bg); }
.prof-log-reason {
  font-size: 0.82rem;
  color: var(--text);
}
.prof-log-meta {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--text-muted);
  white-space: nowrap;
}
.prof-log-amount {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--accent-3);
  white-space: nowrap;
}

/* À venir */
.prof-coming-soon {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  padding: 20px;
  background: var(--surface);
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  opacity: 0.7;
}
.prof-coming-icon  { font-size: 1.5rem; flex-shrink: 0; margin-top: 2px; }
.prof-coming-title {
  font-size: 0.9rem;
  font-weight: 600;
  margin-bottom: 4px;
}
.prof-coming-desc  { font-size: 0.8rem; color: var(--text-muted); line-height: 1.6; }

/* Toast level-up spécial */
.toast-levelup {
  background: linear-gradient(135deg, #f59e0b, #f97316);
  color: white;
  font-size: 0.9rem;
  padding: 14px 20px;
}

/* ── 5. COMPOSANTS PARTAGÉS ── */

/* Titres de section */
.section-title {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  margin-bottom: 8px;
}
.section-sub {
  font-size: 0.875rem;
  color: var(--text-muted);
  margin-bottom: 28px;
}
.section-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  margin-bottom: 24px;
}

/* Boutons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: var(--font-body);
  font-size: 0.9rem;
  font-weight: 500;
  padding: 12px 22px;
  border-radius: var(--radius-sm);
  border: none;
  cursor: pointer;
  transition: transform var(--transition), box-shadow var(--transition),
              background var(--transition), opacity var(--transition);
}
.btn:active   { transform: scale(0.97); }
.btn:disabled { opacity: 0.4; pointer-events: none; }

.btn-primary {
  background: var(--accent);
  color: white;
  box-shadow: 0 2px 12px rgba(37,99,235,0.25);
}
.btn-primary:hover {
  box-shadow: 0 4px 20px rgba(37,99,235,0.35);
  transform: translateY(-1px);
}

.btn-ghost {
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
}
.btn-ghost:hover { background: var(--border); }

.btn-danger {
  background: rgba(239,68,68,0.1);
  color: var(--danger);
  border: 1px solid rgba(239,68,68,0.2);
}

.btn-sm { padding: 8px 14px; font-size: 0.8rem; }

/* Inputs */
.input-field {
  background: var(--bg);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  font-size: 1.1rem;
  font-family: var(--font-mono);
  color: var(--text);
  outline: none;
  transition: border-color var(--transition), box-shadow var(--transition);
  width: 100%;
}
.input-field:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(37,99,235,0.12);
}
.input-pseudo {
  font-size: 1rem;
  font-family: var(--font-body);
  width: 140px;
}

/* Select */
.select-field {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  color: var(--text);
  outline: none;
  cursor: pointer;
  transition: border-color var(--transition);
}
.select-field:focus { border-color: var(--accent); }

/* Toggle */
.toggle {
  width: 44px; height: 24px;
  background: var(--border);
  border-radius: 99px;
  position: relative;
  cursor: pointer;
  border: none;
  transition: background var(--transition);
  flex-shrink: 0;
}
.toggle::after {
  content: '';
  position: absolute;
  top: 3px; left: 3px;
  width: 18px; height: 18px;
  border-radius: 99px;
  background: white;
  transition: transform var(--transition), box-shadow var(--transition);
  box-shadow: 0 1px 4px rgba(0,0,0,0.2);
}
.toggle.on { background: var(--accent); }
.toggle.on::after { transform: translateX(20px); }

/* Tags */
.tag {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  padding: 3px 8px;
  border-radius: 99px;
  border: 1px solid var(--border);
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.tag.difficulty-easy   { color: var(--accent-3); border-color: rgba(16,185,129,0.3);  background: rgba(16,185,129,0.07);  }
.tag.difficulty-medium { color: var(--accent-2); border-color: rgba(249,115,22,0.3);  background: rgba(249,115,22,0.07);  }
.tag.difficulty-hard   { color: var(--danger);   border-color: rgba(239,68,68,0.3);   background: rgba(239,68,68,0.07);   }
.tag.new               { color: var(--accent-4); border-color: rgba(139,92,246,0.3);  background: rgba(139,92,246,0.07);  }

/* Texte coloré utilitaire */
.text-green { color: var(--accent-3); }

/* ── 6. PAGE ACCUEIL ── */
.hero {
  padding: 80px 32px 48px;
  max-width: 780px;
  margin: 0 auto;
  text-align: center;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--accent);
  background: rgba(37,99,235,0.08);
  border: 1px solid rgba(37,99,235,0.2);
  padding: 5px 12px;
  border-radius: 99px;
  margin-bottom: 28px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.hero-badge::before { content: '◆'; font-size: 0.6rem; }

.hero h1 {
  font-family: var(--font-display);
  font-size: clamp(2.8rem, 7vw, 5rem);
  font-weight: 800;
  line-height: 1.05;
  letter-spacing: -0.04em;
  margin-bottom: 20px;
}
.hero h1 em {
  font-style: normal;
  color: var(--accent);
}

.hero-sub {
  font-size: 1.05rem;
  color: var(--text-muted);
  line-height: 1.65;
  max-width: 480px;
  margin: 0 auto 40px;
  font-weight: 300;
}

.hero-cta {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: var(--accent);
  color: white;
  font-family: var(--font-body);
  font-weight: 500;
  font-size: 0.95rem;
  padding: 14px 28px;
  border-radius: var(--radius);
  border: none;
  cursor: pointer;
  box-shadow: 0 4px 20px rgba(37,99,235,0.3);
  transition: transform var(--transition), box-shadow var(--transition);
}
.hero-cta:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 30px rgba(37,99,235,0.4);
}
.hero-cta svg { width: 18px; height: 18px; }

/* Grille de stats 1×3 */
.stats-grid {
  max-width: 700px;
  margin: 0 auto 36px;
  padding: 0 32px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.stat-item {
  background: var(--bg);
  padding: 18px 20px;
  text-align: center;
  transition: background var(--transition);
}
.stat-item:hover { background: var(--surface); }

.stat-value {
  font-family: var(--font-display);
  font-size: 1.55rem;
  font-weight: 800;
  color: var(--text);
  letter-spacing: -0.03em;
  display: block;
  line-height: 1.1;
}
.stat-label {
  font-size: 0.65rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-family: var(--font-mono);
  margin-top: 4px;
  display: block;
}

.games-section {
  max-width: 900px;
  margin: 0 auto;
  padding: 0 32px 80px;
}

/* Streak + Citation */
.home-extras {
  max-width: 700px;
  margin: 0 auto 40px;
  padding: 0 32px;
  display: flex;
  gap: 12px;
  align-items: stretch;
}

/* Streak */
.streak-card {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 20px;
  white-space: nowrap;
  flex-shrink: 0;
  transition: background var(--transition);
}
.streak-card:hover { background: var(--surface); }
.streak-flame { font-size: 1.6rem; line-height: 1; }
.streak-body  { display: flex; flex-direction: column; gap: 1px; }
.streak-num {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 800;
  letter-spacing: -0.04em;
  color: var(--accent-2);
  line-height: 1;
}
.streak-label {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
}

/* Citation */
.quote-card {
  flex: 1;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 20px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 6px;
  min-width: 0;
}
.quote-text {
  font-size: 0.82rem;
  color: var(--text);
  line-height: 1.55;
  font-style: italic;
}
.quote-author {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  color: var(--text-muted);
  letter-spacing: 0.02em;
}

/* ── 7. PAGE JEUX & CARTES ── */
.games-page-inner {
  max-width: 900px;
  margin: 0 auto;
  padding: 48px 32px 80px;
}

.games-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 16px;
}

.game-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  transition: transform var(--transition), box-shadow var(--transition), border-color var(--transition);
}
.game-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, var(--card-color, var(--accent)) 0%, transparent 60%);
  opacity: 0;
  transition: opacity var(--transition);
}
.game-card:hover               { transform: translateY(-4px); box-shadow: var(--shadow-lg); border-color: transparent; }
.game-card:hover::before       { opacity: 0.06; }

.game-card.coming-soon         { opacity: 0.5; pointer-events: none; }
.game-card.coming-soon::after  {
  content: 'Bientôt';
  position: absolute;
  top: 16px; right: 16px;
  font-family: var(--font-mono);
  font-size: 0.65rem;
  color: var(--text-muted);
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 3px 8px;
  border-radius: 99px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.game-card-icon  { font-size: 2rem; margin-bottom: 16px; display: block; }
.game-card-title {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 6px;
}
.game-card-desc {
  font-size: 0.82rem;
  color: var(--text-muted);
  line-height: 1.55;
  margin-bottom: 20px;
}
.game-card-meta {
  display: flex;
  align-items: center;
  gap: 8px;
}
.game-card-play {
  margin-left: auto;
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--accent);
  display: flex;
  align-items: center;
  gap: 4px;
}
.game-card-play::after { content: '→'; }

/* Zone de jeu active */
.game-area {
  display: none;
  max-width: 600px;
  margin: 0 auto;
  padding: 48px 32px 80px;
  animation: fadeUp 0.3s ease;
}
.game-area.active { display: block; }

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}

.game-back-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.82rem;
  color: var(--text-muted);
  background: none;
  border: none;
  cursor: pointer;
  font-family: var(--font-body);
  margin-bottom: 32px;
  padding: 0;
  transition: color var(--transition);
}
.game-back-btn:hover   { color: var(--text); }
.game-back-btn::before { content: '←'; margin-right: 2px; }

.game-header       { margin-bottom: 32px; }
.game-title {
  font-family: var(--font-display);
  font-size: 2rem;
  font-weight: 800;
  letter-spacing: -0.04em;
  margin-bottom: 6px;
}
.game-subtitle { font-size: 0.875rem; color: var(--text-muted); }
.game-actions  { display: flex; gap: 10px; justify-content: center; }

.scores-wrapper {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

/* Classement scrollable */
#tab-leaderboard .scores-wrapper {
  max-height: 480px;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}
#tab-leaderboard .scores-wrapper::-webkit-scrollbar {
  width: 4px;
}
#tab-leaderboard .scores-wrapper::-webkit-scrollbar-track {
  background: transparent;
}
#tab-leaderboard .scores-wrapper::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 99px;
}

/* ── 8. JEU — DEVINE LE NOMBRE ── */
.difficulty-row {
  display: flex;
  gap: 8px;
  margin-bottom: 24px;
}

.diff-btn {
  flex: 1;
  padding: 10px;
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--border);
  background: var(--bg);
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  cursor: pointer;
  transition: all var(--transition);
  text-align: center;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.diff-btn.active {
  border-color: var(--accent);
  color: var(--accent);
  background: rgba(37,99,235,0.07);
}
.diff-range {
  font-size: 0.6rem;
  opacity: 0.7;
  display: block;
  margin-top: 2px;
}

.guess-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 40px;
  text-align: center;
  margin-bottom: 20px;
}

.progress-dots {
  display: flex;
  gap: 6px;
  justify-content: center;
  margin-bottom: 20px;
}
.dot {
  width: 8px; height: 8px;
  border-radius: 99px;
  background: var(--border);
  transition: background var(--transition), width var(--transition);
}
.dot.used   { background: var(--text-muted); }
.dot.active { background: var(--accent); width: 20px; }
.dot.win    { background: var(--accent-3); }
.dot.lose   { background: var(--danger); }

.guess-range-display {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-bottom: 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.range-label { font-size: 0.65rem; }

.guess-range-bar {
  height: 4px;
  background: var(--border);
  border-radius: 99px;
  margin-bottom: 28px;
  position: relative;
  overflow: hidden;
}
.guess-range-fill {
  position: absolute;
  left: 0; top: 0; bottom: 0;
  background: var(--accent);
  border-radius: 99px;
  transition: width 0.4s cubic-bezier(.4,0,.2,1);
}

.guess-attempts-display {
  font-family: var(--font-display);
  font-size: 3.5rem;
  font-weight: 800;
  letter-spacing: -0.04em;
  color: var(--text);
  line-height: 1;
  margin-bottom: 4px;
}
.guess-attempts-label {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-family: var(--font-mono);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.guess-feedback {
  min-height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 20px 0;
}
.guess-feedback-text {
  font-size: 0.95rem;
  font-weight: 500;
  padding: 10px 20px;
  border-radius: var(--radius-sm);
  animation: pop 0.25s ease;
}

.feedback-up   { color: var(--accent-2); background: rgba(249,115,22,0.08); border: 1px solid rgba(249,115,22,0.2); }
.feedback-down { color: var(--accent);   background: rgba(37,99,235,0.08);  border: 1px solid rgba(37,99,235,0.2); }
.feedback-win  { color: var(--accent-3); background: rgba(16,185,129,0.08); border: 1px solid rgba(16,185,129,0.2); }
.feedback-lose { color: var(--danger);   background: rgba(239,68,68,0.08);  border: 1px solid rgba(239,68,68,0.2); }

.guess-input-row { display: flex; gap: 10px; }

.guess-history {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 16px;
}
.guess-chip {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  padding: 5px 10px;
  border-radius: 99px;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text-muted);
  animation: pop 0.2s ease;
}
.guess-chip.high { color: var(--accent-2); border-color: rgba(249,115,22,0.3); background: rgba(249,115,22,0.06); }
.guess-chip.low  { color: var(--accent);   border-color: rgba(37,99,235,0.3);  background: rgba(37,99,235,0.06); }

/* ── 9. JEU — TIC TAC TOE ── */

/* Scoreboard de session */
.ttt-scoreboard {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 20px;
}
.ttt-score-item {
  background: var(--bg);
  padding: 14px 16px;
  text-align: center;
  transition: background var(--transition);
}
.ttt-score-label {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  margin-bottom: 4px;
}
.ttt-score-val {
  display: block;
  font-family: var(--font-display);
  font-size: 1.8rem;
  font-weight: 800;
  letter-spacing: -0.04em;
  line-height: 1;
}
.ttt-score-item.x  .ttt-score-val { color: var(--accent); }
.ttt-score-item.o  .ttt-score-val { color: var(--accent-4); }
.ttt-score-item.draw .ttt-score-val { color: var(--text-muted); }

/* Statut */
.ttt-status {
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 20px;
}
.ttt-status-text {
  font-size: 0.92rem;
  font-weight: 500;
  padding: 8px 20px;
  border-radius: var(--radius-sm);
  animation: pop 0.25s ease;
  transition: all var(--transition);
}
.ttt-neutral { color: var(--text-muted); background: var(--surface); border: 1px solid var(--border); }
.ttt-win     { color: var(--accent-3);   background: rgba(16,185,129,0.08);  border: 1px solid rgba(16,185,129,0.2); }
.ttt-lose    { color: var(--danger);     background: rgba(239,68,68,0.08);   border: 1px solid rgba(239,68,68,0.2); }
.ttt-draw    { color: var(--accent-2);   background: rgba(249,115,22,0.08);  border: 1px solid rgba(249,115,22,0.2); }

/* Grille */
.ttt-board {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-bottom: 24px;
  max-width: 320px;
  margin-left: auto;
  margin-right: auto;
}

.ttt-cell {
  aspect-ratio: 1;
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-size: 2.2rem;
  font-weight: 800;
  cursor: default;
  transition: background var(--transition), border-color var(--transition),
              transform var(--transition), box-shadow var(--transition);
  user-select: none;
  position: relative;
  overflow: hidden;
}

.ttt-cell.empty {
  cursor: pointer;
}
.ttt-cell.empty:hover {
  background: var(--bg);
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(37,99,235,0.1);
  transform: scale(1.04);
}

/* Symboles avec couleur */
.ttt-cell.x {
  color: var(--accent);
  background: rgba(37,99,235,0.05);
  border-color: rgba(37,99,235,0.25);
  animation: cellPop 0.22s cubic-bezier(.4,0,.2,1);
}
.ttt-cell.o {
  color: var(--accent-4);
  background: rgba(139,92,246,0.05);
  border-color: rgba(139,92,246,0.25);
  animation: cellPop 0.22s cubic-bezier(.4,0,.2,1);
}

/* Ligne gagnante */
.ttt-cell.winner {
  background: rgba(16,185,129,0.12) !important;
  border-color: var(--accent-3) !important;
  color: var(--accent-3) !important;
  transform: scale(1.06);
  box-shadow: 0 0 0 3px rgba(16,185,129,0.2);
  animation: winPulse 0.5s ease;
}

@keyframes cellPop {
  0%   { transform: scale(0.7); opacity: 0; }
  60%  { transform: scale(1.12); }
  100% { transform: scale(1);   opacity: 1; }
}
@keyframes winPulse {
  0%   { box-shadow: 0 0 0 0   rgba(16,185,129,0.4); }
  50%  { box-shadow: 0 0 0 8px rgba(16,185,129,0.1); }
  100% { box-shadow: 0 0 0 3px rgba(16,185,129,0.2); }
}

/* ── 10. JEU — DEVINE LA FONCTION ── */

.gf-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 20px 16px;
  margin-bottom: 20px;
}

/* Graphique */
.gf-graph-wrap {
  display: flex;
  justify-content: center;
  margin-bottom: 16px;
}
.gf-graph {
  width: 100%;
  max-width: 300px;
  height: 300px;
  border-radius: var(--radius-sm);
  background: var(--bg);
  border: 1px solid var(--border);
  overflow: visible;
}

/* Grille de choix 2×2 */
.gf-choices {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 16px;
  position: relative;
  z-index: 1;
}
.gf-choice-btn {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  font-weight: 500;
  padding: 12px 10px;
  background: var(--bg);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  color: var(--text);
  transition: background var(--transition), border-color var(--transition), transform var(--transition);
  text-align: center;
  line-height: 1.3;
}
.gf-choice-btn:hover:not(:disabled) {
  background: var(--surface);
  border-color: var(--accent);
}
.gf-choice-btn:active:not(:disabled) { transform: scale(0.97); }
.gf-choice-btn.correct {
  background: rgba(16,185,129,0.1);
  border-color: var(--accent-3);
  color: var(--accent-3);
}
.gf-choice-btn.wrong {
  background: rgba(239,68,68,0.08);
  border-color: var(--danger);
  color: var(--danger);
}
.gf-choice-btn:disabled { cursor: default; }

/* Animation tracé de courbe */
@keyframes gfDraw {
  from { stroke-dashoffset: 1000; stroke-dasharray: 1000; opacity: 0.3; }
  to   { stroke-dashoffset: 0;    stroke-dasharray: 1000; opacity: 1; }
}

/* ── 10. JEU — SÉQUENCE LOGIQUE ── */

.seq-header-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}
.seq-progress-label,
.seq-score-label {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-muted);
}
.seq-progress-label span,
.seq-score-label span {
  color: var(--text);
  font-weight: 600;
}

/* Dots de progression */
.seq-dots {
  display: flex;
  gap: 5px;
  justify-content: center;
  margin-bottom: 18px;
  flex-wrap: wrap;
}
.seq-dot {
  width: 10px; height: 10px;
  border-radius: 99px;
  background: var(--border);
  transition: background var(--transition), transform var(--transition);
}
.seq-dot.active  { background: var(--accent); transform: scale(1.3); }
.seq-dot.correct { background: var(--accent-3); }
.seq-dot.wrong   { background: var(--danger); }
.seq-dot.done    { background: var(--text-muted); }

/* Carte principale */
.seq-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px 28px 24px;
  margin-bottom: 20px;
}

/* Nom du type + formule */
.seq-type-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}
.seq-type-name {
  font-family: var(--font-display);
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.01em;
  transition: filter 0.3s ease, opacity 0.3s ease;
}
.seq-type-name.blurred {
  filter: blur(5px);
  user-select: none;
  opacity: 0.5;
}
.seq-formula {
  font-family: var(--font-mono);
  font-size: 0.92rem;
  font-weight: 500;
  color: var(--accent);
  background: rgba(37,99,235,0.08);
  border: 1px solid rgba(37,99,235,0.2);
  padding: 5px 14px;
  border-radius: 99px;
  white-space: nowrap;
  transition: filter 0.3s ease, opacity 0.3s ease;
}
.seq-formula.blurred {
  filter: blur(6px);
  user-select: none;
  opacity: 0.6;
}

/* Bouton spoiler (mode expert) */
.seq-spoiler-wrap {
  display: flex;
  justify-content: center;
  margin-bottom: 16px;
}
.seq-spoiler-btn {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  background: none;
  border: 1px dashed var(--border);
  border-radius: 99px;
  padding: 5px 14px;
  cursor: pointer;
  transition: color var(--transition), border-color var(--transition), background var(--transition);
}
.seq-spoiler-btn:hover {
  color: var(--accent);
  border-color: var(--accent);
  background: rgba(37,99,235,0.05);
}

/* Termes de la suite */
.seq-terms {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 20px;
  min-height: 60px;
}
.seq-term {
  font-family: var(--font-display);
  font-size: 1.6rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--text);
  background: var(--bg);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 8px 14px;
  min-width: 52px;
  text-align: center;
  line-height: 1;
  animation: pop 0.2s ease;
}
.seq-term-answer {
  color: var(--accent);
  border-color: rgba(37,99,235,0.4);
  background: rgba(37,99,235,0.05);
}
.seq-term-placeholder {
  color: var(--text-muted);
  border-style: dashed;
  font-size: 1.4rem;
}
.seq-arrow {
  font-family: var(--font-mono);
  font-size: 0.9rem;
  color: var(--text-muted);
  flex-shrink: 0;
}

/* Feedback */
.seq-feedback-wrap {
  min-height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 12px;
}
.seq-feedback-text {
  font-size: 0.88rem;
  font-weight: 500;
  padding: 6px 16px;
  border-radius: var(--radius-sm);
  animation: pop 0.2s ease;
}
.seq-feedback-text.seq-good    { color: var(--accent-3); background: rgba(16,185,129,0.08); border: 1px solid rgba(16,185,129,0.2); }
.seq-feedback-text.seq-bad     { color: var(--danger);   background: rgba(239,68,68,0.08);  border: 1px solid rgba(239,68,68,0.2); }
.seq-feedback-text.seq-neutral { color: var(--text-muted); }

/* Carte explication pédagogique */
.seq-explanation-card {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  background: rgba(37,99,235,0.05);
  border: 1px solid rgba(37,99,235,0.18);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.35s ease, transform 0.35s ease;
  pointer-events: none;
  margin-bottom: 4px;
}
.seq-explanation-card.visible {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}
.seq-explanation-icon { font-size: 1rem; flex-shrink: 0; margin-top: 1px; }
.seq-explanation-text {
  font-size: 0.82rem;
  color: var(--text);
  line-height: 1.65;
}

/* ── 11. JEU — CALCUL RAPIDE ── */

.qm-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 32px 32px 28px;
  margin-bottom: 20px;
}

/* Chrono */
.qm-timer-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
}
.qm-timer-label {
  font-family: var(--font-mono);
  font-size: 1rem;
  font-weight: 500;
  color: var(--accent);
  min-width: 36px;
  transition: color var(--transition);
}
.qm-timer-bar {
  flex: 1;
  height: 6px;
  background: var(--border);
  border-radius: 99px;
  overflow: hidden;
}
.qm-timer-fill {
  height: 100%;
  width: 100%;
  background: var(--accent);
  border-radius: 99px;
  transition: width 1s linear, background var(--transition);
}
.qm-timer-fill.urgent { background: var(--danger); }

/* Stats live */
.qm-stats-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
  margin-bottom: 28px;
}
.qm-stat {
  background: var(--bg);
  padding: 10px 8px;
  text-align: center;
}
.qm-stat-val {
  display: block;
  font-family: var(--font-display);
  font-size: 1.4rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--text);
  line-height: 1;
}
.qm-stat-label {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.6rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  margin-top: 4px;
}

/* Question */
.qm-question-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-bottom: 12px;
  min-height: 72px;
}
.qm-question-display {
  font-family: var(--font-display);
  font-size: 2.8rem;
  font-weight: 800;
  letter-spacing: -0.04em;
  color: var(--text);
  line-height: 1;
  text-align: center;
}

/* Combo badge */
.qm-combo-badge {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--accent-2);
  background: rgba(249,115,22,0.1);
  border: 1px solid rgba(249,115,22,0.25);
  padding: 4px 10px;
  border-radius: 99px;
  opacity: 0;
  transform: scale(0.8);
  transition: opacity 0.2s ease, transform 0.2s ease;
  white-space: nowrap;
}
.qm-combo-badge.active {
  opacity: 1;
  transform: scale(1);
}

/* Feedback */
.qm-feedback-wrap {
  min-height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 16px;
}
.qm-feedback-text {
  font-size: 0.88rem;
  font-weight: 500;
  padding: 5px 14px;
  border-radius: var(--radius-sm);
  animation: pop 0.2s ease;
}
.qm-feedback-text.qm-good {
  color: var(--accent-3);
  background: rgba(16,185,129,0.08);
  border: 1px solid rgba(16,185,129,0.2);
}
.qm-feedback-text.qm-bad {
  color: var(--danger);
  background: rgba(239,68,68,0.08);
  border: 1px solid rgba(239,68,68,0.2);
}

/* Statut fin */
.qm-status-wrap {
  min-height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 14px;
}
.qm-status-text {
  font-size: 0.88rem;
  font-weight: 500;
  text-align: center;
}
.qm-status-text.qm-win {
  color: var(--accent-3);
}

/* Animation question */
@keyframes question-pop {
  0%   { transform: scale(0.85) translateY(6px); opacity: 0; }
  70%  { transform: scale(1.04); }
  100% { transform: scale(1) translateY(0); opacity: 1; }
}
.question-pop { animation: question-pop 0.25s cubic-bezier(.4,0,.2,1); }

.question-pop { animation: question-pop 0.25s cubic-bezier(.4,0,.2,1); }

/* ── 11. JEU — MÉMOIRE DE SUITE ── */

/* Barre de record */
.mem-record-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 16px;
  margin-bottom: 16px;
}
.mem-record-label {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
}
.mem-record-val {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 700;
  color: var(--accent);
  letter-spacing: -0.02em;
}

/* Carte principale */
.mem-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 32px 28px 28px;
  margin-bottom: 20px;
  text-align: center;
}

/* Affichage du chiffre */
.mem-display-wrap {
  margin-bottom: 20px;
  min-height: 110px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.mem-display {
  font-family: var(--font-display);
  font-size: 5rem;
  font-weight: 800;
  letter-spacing: -0.04em;
  color: var(--text);
  line-height: 1;
  min-width: 90px;
  transition: color var(--transition), transform 0.15s ease;
}
.mem-display.highlight {
  color: var(--accent);
  transform: scale(1.08);
  animation: mem-flash 0.15s ease;
}
@keyframes mem-flash {
  0%   { transform: scale(0.85); opacity: 0.4; }
  60%  { transform: scale(1.12); }
  100% { transform: scale(1.08); opacity: 1; }
}

/* Points de progression */
.mem-progress {
  display: flex;
  gap: 6px;
  justify-content: center;
  flex-wrap: wrap;
  min-height: 14px;
  margin-bottom: 18px;
}
.mem-dot {
  width: 10px; height: 10px;
  border-radius: 99px;
  background: var(--border);
  transition: background var(--transition), transform var(--transition);
}
.mem-dot.done    { background: var(--accent-3); }
.mem-dot.correct { background: var(--accent-3); }
.mem-dot.wrong   { background: var(--danger); }
.mem-dot.active  { background: var(--accent); transform: scale(1.3); }
.mem-dot.active.showing {
  background: var(--accent);
  transform: scale(1.3);
  animation: mem-dot-pulse 0.5s ease-in-out infinite alternate;
}
@keyframes mem-dot-pulse {
  from { opacity: 1;   transform: scale(1.3); }
  to   { opacity: 0.5; transform: scale(1.1); }
}

/* Statut */
.mem-status-wrap {
  min-height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 8px;
}
.mem-status-text {
  font-size: 0.9rem;
  font-weight: 500;
  padding: 6px 16px;
  border-radius: var(--radius-sm);
}
.mem-neutral { color: var(--text-muted); background: var(--bg); border: 1px solid var(--border); }
.mem-lose    { color: var(--danger);     background: rgba(239,68,68,0.08); border: 1px solid rgba(239,68,68,0.2); }

/* Feedback */
.mem-feedback-wrap {
  min-height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 20px;
}
.mem-feedback-text {
  font-size: 0.85rem;
  font-weight: 500;
  padding: 5px 14px;
  border-radius: var(--radius-sm);
  animation: pop 0.2s ease;
}
.mem-feedback-text.mem-good   { color: var(--accent-3); background: rgba(16,185,129,0.08);  border: 1px solid rgba(16,185,129,0.2); }
.mem-feedback-text.mem-bad    { color: var(--danger);   background: rgba(239,68,68,0.08);   border: 1px solid rgba(239,68,68,0.2); }
.mem-feedback-text.mem-record { color: #d97706;         background: rgba(251,191,36,0.1);   border: 1px solid rgba(251,191,36,0.3); }

/* Pavé numérique */
.mem-pad {
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: center;
  margin-top: 4px;
}
.mem-pad-row {
  display: flex;
  gap: 10px;
  justify-content: center;
}
.mem-key {
  width: 64px; height: 64px;
  font-family: var(--font-display);
  font-size: 1.4rem;
  font-weight: 700;
  background: var(--bg);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  color: var(--text);
  transition: background var(--transition), border-color var(--transition),
              transform var(--transition), box-shadow var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
}
.mem-key:hover  {
  background: var(--surface);
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(37,99,235,0.1);
}
.mem-key:active { transform: scale(0.93); }
.mem-key-wide   { width: 138px; }

/* ── 12. PAGE PARAMÈTRES ── */
.settings-inner {
  max-width: 600px;
  margin: 0 auto;
  padding: 48px 32px 80px;
}
.settings-group { margin-bottom: 36px; }

.settings-group-title {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  margin-bottom: 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
}

.settings-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 0;
  border-bottom: 1px solid var(--border);
}
.settings-row:last-child { border-bottom: none; }

.settings-label { font-size: 0.9rem; font-weight: 500; }
.settings-desc  { font-size: 0.78rem; color: var(--text-muted); margin-top: 2px; }

.settings-footer {
  margin-top: 16px;
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

/* ── 10. PAGE CGU ── */
.legal-inner {
  max-width: 680px;
  margin: 0 auto;
  padding: 48px 32px 80px;
}
.legal-inner h2 {
  font-family: var(--font-display);
  font-size: 1.8rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  margin-bottom: 8px;
}
.legal-inner .meta {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-bottom: 40px;
}
.legal-section        { margin-bottom: 32px; }
.legal-section h3     { font-family: var(--font-display); font-size: 1rem; font-weight: 700; margin-bottom: 10px; }
.legal-section p      { font-size: 0.875rem; color: var(--text-muted); line-height: 1.75; }

/* ── 11. PAGE À PROPOS ── */
.about-inner {
  max-width: 680px;
  margin: 0 auto;
  padding: 48px 32px 80px;
}
.about-inner h2 {
  font-family: var(--font-display);
  font-size: 2.5rem;
  font-weight: 800;
  letter-spacing: -0.04em;
  margin-bottom: 12px;
}
.about-intro {
  font-size: 0.95rem;
  color: var(--text-muted);
  line-height: 1.75;
  margin-bottom: 40px;
  max-width: 520px;
}

.changelog-section { margin-bottom: 48px; }

.changelog-item {
  display: flex;
  gap: 20px;
  margin-bottom: 24px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--border);
}
.changelog-item:last-child { border-bottom: none; }
.changelog-item.muted .changelog-ver,
.changelog-item.muted .changelog-title { color: var(--text-muted); }

.changelog-ver {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--accent);
  white-space: nowrap;
  padding-top: 2px;
  min-width: 56px;
}
.changelog-title { font-weight: 600; font-size: 0.9rem; margin-bottom: 4px; }
.changelog-desc  { font-size: 0.82rem; color: var(--text-muted); line-height: 1.6; }

/* ── Carte Discord ── */
.discord-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  background: #5865f2;
  border-radius: var(--radius);
  padding: 20px 24px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}
.discord-card-left {
  display: flex;
  align-items: center;
  gap: 14px;
  flex: 1;
  min-width: 0;
}
.discord-logo {
  width: 32px;
  height: 32px;
  color: #fff;
  flex-shrink: 0;
  opacity: 0.95;
}
.discord-card-text { min-width: 0; }
.discord-card-title {
  font-family: var(--font-display);
  font-size: 0.95rem;
  font-weight: 800;
  color: #fff;
  letter-spacing: -0.01em;
  margin-bottom: 2px;
}
.discord-card-sub {
  font-size: 0.78rem;
  color: rgba(255,255,255,0.75);
  line-height: 1.4;
}
.discord-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #fff;
  color: #5865f2;
  font-family: var(--font-display);
  font-size: 0.82rem;
  font-weight: 800;
  padding: 9px 18px;
  border-radius: 99px;
  text-decoration: none;
  white-space: nowrap;
  transition: opacity 0.18s ease, transform 0.18s ease;
  flex-shrink: 0;
}
.discord-btn:hover {
  opacity: 0.92;
  transform: translateY(-1px);
}

.tech-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
}
.tech-card-title {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  margin-bottom: 12px;
}
.tech-card-body {
  font-size: 0.82rem;
  color: var(--text-muted);
  line-height: 2;
}
.tech-card-body strong { color: var(--text); }

/* ── 12. SCORES / LEADERBOARD ── */
.scores-table {
  width: 100%;
  border-collapse: collapse;
}
.scores-table th {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  padding: 10px 14px;
  text-align: left;
  border-bottom: 1px solid var(--border);
}
.scores-table td {
  padding: 12px 14px;
  font-size: 0.85rem;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
.scores-table tr:last-child td { border-bottom: none; }
.scores-table tr:hover td      { background: var(--surface); }

.rank-badge {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 500;
  width: 28px; height: 28px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--surface);
  border: 1px solid var(--border);
}
.rank-1 { background: rgba(251,191,36,0.15); border-color: rgba(251,191,36,0.4); color: #d97706; }
.rank-2 { background: rgba(148,163,184,0.15); border-color: rgba(148,163,184,0.4); color: #64748b; }
.rank-3 { background: rgba(180,83,9,0.1);     border-color: rgba(180,83,9,0.3);   color: #b45309; }

.score-win  { color: var(--accent-3); }
.score-lose { color: var(--danger); }
.score-draw { color: var(--accent-2); }

.empty-state {
  text-align: center;
  padding: 48px 24px;
  color: var(--text-muted);
}
.empty-state-icon { font-size: 2.5rem; margin-bottom: 12px; display: block; }
.empty-state-text { font-size: 0.875rem; }

/* ── CLASSEMENT PAR JEU ── */

.lb-game-section {
  border-bottom: 1px solid var(--border);
  padding: 20px 20px 18px;
}
.lb-game-section:last-child { border-bottom: none; }

/* Jeu non encore joué — légèrement atténué */
.lb-game-unplayed {
  opacity: 0.72;
  transition: opacity var(--transition);
}
.lb-game-unplayed:hover { opacity: 1; }

/* Bouton jouer inline dans le header */
.lb-play-btn {
  margin-left: auto;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--accent);
  background: rgba(37,99,235,0.07);
  border: 1px solid rgba(37,99,235,0.22);
  border-radius: 99px;
  padding: 4px 12px;
  cursor: pointer;
  letter-spacing: 0.02em;
  transition: background var(--transition), color var(--transition);
  white-space: nowrap;
}
.lb-play-btn:hover {
  background: rgba(37,99,235,0.14);
  color: var(--accent);
}

.lb-game-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 14px;
}
.lb-game-icon  { font-size: 1.1rem; }
.lb-game-title {
  font-family: var(--font-display);
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.lb-slots {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.lb-slot {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 5px;
  transition: background var(--transition);
}
.lb-slot:hover { background: var(--bg); }

.lb-slot-empty { opacity: 0.5; }

.lb-slot-label { align-self: flex-start; }

.lb-slot-score {
  font-family: var(--font-mono);
  font-size: 1rem;
  font-weight: 500;
  color: var(--text);
  line-height: 1;
}
.lb-slot-empty .lb-slot-score { color: var(--text-muted); }

.lb-slot-meta {
  font-size: 0.7rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ── TABS ── */
.tabs-header {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 0;
  border-bottom: 1px solid var(--border);
  padding-bottom: 0;
}

.tab-btn {
  font-family: var(--font-body);
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-muted);
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  cursor: pointer;
  padding: 10px 16px;
  margin-bottom: -1px;
  transition: color var(--transition), border-color var(--transition);
}
.tab-btn:hover  { color: var(--text); }
.tab-btn.active { color: var(--accent); border-bottom-color: var(--accent); }

.tab-panel        { display: none; }
.tab-panel.active { display: block; }

/* ── PAGINATION ── */
.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 16px 0 8px;
}

.page-btn {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  font-weight: 500;
  width: 32px; height: 32px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text-muted);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background var(--transition), color var(--transition), border-color var(--transition);
}
.page-btn:hover    { background: var(--surface); color: var(--text); }
.page-btn.active   { background: var(--accent); color: white; border-color: var(--accent); }
.page-btn.disabled { opacity: 0.35; pointer-events: none; }

/* ── 13. EFFETS GLOBAUX ── */

/* Confettis */
.confetti-container {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 999;
}
.confetti-piece {
  position: absolute;
  width: 8px; height: 8px;
  border-radius: 2px;
  animation: confettiFall 1.2s ease-in forwards;
}

/* ── Bloc Discord — page d'accueil ── */
.home-discord {
  max-width: 900px;
  margin: 0 auto;
  padding: 0 32px 72px;
}
.home-discord-inner {
  display: flex;
  align-items: center;
  gap: 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 24px;
  transition: border-color var(--transition);
}
.home-discord-inner:hover { border-color: #5865f2; }
.home-discord-icon {
  width: 28px;
  height: 28px;
  color: #5865f2;
  flex-shrink: 0;
}
.home-discord-text {
  flex: 1;
  min-width: 0;
}
.home-discord-title {
  font-family: var(--font-display);
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.01em;
  margin-bottom: 2px;
}
.home-discord-sub {
  font-size: 0.78rem;
  color: var(--text-muted);
  line-height: 1.4;
}
.home-discord-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #5865f2;
  color: #fff;
  font-family: var(--font-display);
  font-size: 0.78rem;
  font-weight: 700;
  padding: 9px 16px;
  border-radius: 99px;
  text-decoration: none;
  white-space: nowrap;
  flex-shrink: 0;
  transition: opacity 0.18s ease, transform 0.18s ease;
}
.home-discord-btn:hover {
  opacity: 0.88;
  transform: translateY(-1px);
}

/* Toast */
.toast-container {
  position: fixed;
  bottom: 24px; right: 24px;
  z-index: 200;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.toast {
  font-size: 0.85rem;
  font-weight: 500;
  padding: 12px 18px;
  border-radius: var(--radius-sm);
  background: var(--text);
  color: var(--bg);
  box-shadow: var(--shadow-lg);
  animation: slideIn 0.25s ease;
  max-width: 280px;
}

/* ── KEYFRAMES ── */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes pop {
  0%   { transform: scale(0.9); opacity: 0; }
  70%  { transform: scale(1.03); }
  100% { transform: scale(1); opacity: 1; }
}
@keyframes slideIn {
  from { transform: translateX(30px); opacity: 0; }
  to   { transform: translateX(0);    opacity: 1; }
}
@keyframes confettiFall {
  0%   { transform: translateY(-20px) rotate(0deg);   opacity: 1; }
  100% { transform: translateY(100vh) rotate(720deg); opacity: 0; }
}

/* ── TUTORIEL ── */

#tut-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.55);
  backdrop-filter: blur(4px);
  z-index: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}
#tut-overlay.active {
  opacity: 1;
  pointer-events: all;
}

.tut-modal {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  width: 100%;
  max-width: 420px;
  overflow: hidden;
  transform: translateY(16px) scale(0.97);
  transition: transform 0.25s cubic-bezier(.4,0,.2,1);
}
#tut-overlay.active .tut-modal {
  transform: translateY(0) scale(1);
}

.tut-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 20px 16px;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
}
.tut-title {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}
.tut-close {
  width: 28px; height: 28px;
  background: none;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 0.8rem;
  color: var(--text-muted);
  display: flex; align-items: center; justify-content: center;
  transition: background var(--transition), color var(--transition);
}
.tut-close:hover { background: var(--border); color: var(--text); }

.tut-body {
  padding: 28px 24px 20px;
  text-align: center;
  animation: fadeUp 0.2s ease;
}
.tut-step-icon {
  font-size: 2.4rem;
  margin-bottom: 14px;
  display: block;
  line-height: 1;
}
.tut-step-title {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 10px;
}
.tut-step-text {
  font-size: 0.88rem;
  color: var(--text-muted);
  line-height: 1.7;
}
.tut-step-text strong { color: var(--text); font-weight: 600; }
.tut-step-text kbd {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 1px 6px;
  color: var(--text);
}

.tut-footer {
  padding: 16px 20px 20px;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.tut-dots {
  display: flex;
  gap: 6px;
  align-items: center;
}
.tut-dot {
  width: 7px; height: 7px;
  border-radius: 99px;
  background: var(--border);
  transition: background var(--transition), width var(--transition);
}
.tut-dot.active { background: var(--accent); width: 18px; }

.tut-actions { display: flex; gap: 8px; }

/* Bouton ? sur les pages de jeu */
.game-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 32px;
  gap: 12px;
}
.tut-help-btn {
  flex-shrink: 0;
  width: 30px; height: 30px;
  border-radius: 99px;
  border: 1.5px solid var(--border);
  background: var(--surface);
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: border-color var(--transition), color var(--transition), background var(--transition);
  margin-top: 4px;
}
.tut-help-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: rgba(37,99,235,0.07);
}

/* ── 15. RESPONSIVE ── */
@media (max-width: 640px) {
  nav { padding: 0 16px; }

  .nav-link    { padding: 8px 10px; font-size: 0.8rem; }
  .nav-links   { gap: 0; }
  .nav-version { display: none; }

  .hero           { padding: 48px 20px 32px; }
  .stats-grid     { margin: 0 20px 28px; grid-template-columns: repeat(2, 1fr); }
  .games-section  { padding: 0 20px 60px; }
  .home-extras    { padding: 0 20px; flex-direction: column; margin-bottom: 32px; }
  .home-discord   { padding: 0 20px 52px; }
  .home-discord-inner { flex-wrap: wrap; gap: 14px; }
  .home-discord-btn   { width: 100%; justify-content: center; }
  .profile-inner  { padding-left: 20px; padding-right: 20px; }
  .prof-badges-grid { grid-template-columns: repeat(2, 1fr); }
  .nav-xp-widget  { display: none; }

  .game-area,
  .games-page-inner,
  .settings-inner,
  .legal-inner,
  .about-inner    { padding-left: 20px; padding-right: 20px; }

  .lb-slots { grid-template-columns: 1fr; }
}

/* ── JEU — PROBABILITÉS ── */

.proba-question {
  font-family: var(--font-body);
  font-size: 0.95rem;
  font-weight: 400;
  color: var(--text);
  text-align: center;
  margin-bottom: 18px;
  line-height: 1.7;
  letter-spacing: 0em;
  pointer-events: none;
  position: relative;
  z-index: 0;
}
.proba-question strong {
  font-weight: 700;
  color: var(--text);
}
/* Quand la question contient une formule (élément <br> = 2 lignes) */
.proba-question br + em,
.proba-question em {
  display: inline-block;
  font-style: normal;
  font-family: var(--font-mono);
  font-size: 0.82rem;
  color: var(--accent);
  background: rgba(37,99,235,0.07);
  border: 1px solid rgba(37,99,235,0.18);
  padding: 2px 10px;
  border-radius: 99px;
  margin-top: 4px;
}

.proba-visual-wrap {
  display: flex;
  justify-content: center;
  align-items: center;
  margin-bottom: 16px;
  min-height: 80px;
}

.proba-svg {
  width: 100%;
  max-width: 300px;
  height: auto;
  display: block;
}

/* Mode row — 3 boutons sur une ligne */
.proba-mode-row .diff-btn { flex: 1; }

/* Question en deux parties (principale + sous-ligne formule/contexte) */
.proba-q-main {
  display: block;
  font-weight: 500;
  margin-bottom: 8px;
}
.proba-q-sub {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.82rem;
  color: var(--text-muted);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 6px 14px;
  margin: 0 auto;
  max-width: 95%;
  line-height: 1.5;
}

/* ── JEU — TRIGONOMÉTRIE ── */

.trigo-question {
  font-family: var(--font-body);
  font-size: 0.95rem;
  font-weight: 400;
  color: var(--text);
  text-align: center;
  margin-bottom: 16px;
  line-height: 1.7;
}
.trigo-question strong { font-weight: 700; }

.trigo-visual-wrap {
  display: flex;
  justify-content: center;
  margin-bottom: 14px;
}

.trigo-svg {
  width: 100%;
  max-width: 280px;
  height: auto;
  display: block;
  border-radius: var(--radius-sm);
  background: var(--bg);
  border: 1px solid var(--border);
}

/* Boutons de choix trigo — plus grands pour les fractions */
.trigo-choices {
  grid-template-columns: 1fr 1fr;
}
.trigo-choice {
  font-family: var(--font-mono);
  font-size: 0.9rem;
  font-weight: 600;
  padding: 14px 10px;
  min-height: 52px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.trigo-choice-val {
  letter-spacing: 0.01em;
}

/* Mode row — 3 boutons */
.trigo-mode-row .diff-btn { flex: 1; }

/* ── Outils partagés (Calculatrice + Brouillon) ── */
@keyframes panelIn {
  from { opacity: 0; transform: translateY(-6px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* Barre d'outils */
.proba-toolbar {
  display: flex;
  gap: 8px;
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}
.proba-tool-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-family: var(--font-body);
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--text-muted);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 99px;
  padding: 6px 14px;
  cursor: pointer;
  transition: color var(--transition), border-color var(--transition), background var(--transition);
}
.proba-tool-btn:hover,
.proba-tool-btn.active {
  color: var(--accent);
  border-color: rgba(37,99,235,0.35);
  background: rgba(37,99,235,0.06);
}
.proba-tool-btn svg { opacity: 0.7; }
.proba-tool-btn.active svg { opacity: 1; }

/* Panneau */
.proba-panel {
  display: none;
  margin-top: 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  animation: panelIn 0.22s cubic-bezier(.4,0,.2,1);
}
.proba-panel.open { display: block; }
.proba-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px;
  border-bottom: 1px solid var(--border);
  background: var(--bg);
}
.proba-panel-title {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
}
.proba-panel-close {
  width: 24px; height: 24px;
  border-radius: 99px;
  border: none;
  background: none;
  color: var(--text-muted);
  font-size: 1.1rem;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: color var(--transition), background var(--transition);
}
.proba-panel-close:hover { color: var(--text); background: var(--border); }

/* Calculatrice */
.proba-calc { padding: 14px; }
.proba-calc-screen {
  font-family: var(--font-mono);
  font-size: 1.6rem;
  font-weight: 500;
  color: var(--text);
  text-align: right;
  padding: 8px 4px 2px;
  letter-spacing: -0.02em;
  line-height: 1;
  min-height: 2rem;
  word-break: break-all;
}
.proba-calc-expr {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--text-muted);
  text-align: right;
  padding: 0 4px 10px;
  min-height: 1.2rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.proba-calc-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 5px;
}
/* Séparateur entre fonctions et chiffres */
.calc-sep {
  grid-column: span 5;
  height: 1px;
  background: var(--border);
  margin: 2px 0;
}
/* Bouton qui prend 2 colonnes */
.calc-btn.calc-span2 { grid-column: span 2; }
/* Bouton = sur 2 lignes */
.calc-btn.calc-eq-tall {
  grid-row: span 2;
}

/* Boutons communs (partagés calc + proba) */
.calc-btn {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  font-weight: 500;
  padding: 11px 6px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  cursor: pointer;
  transition: background var(--transition), transform 0.1s ease;
  text-align: center;
  line-height: 1;
}
.calc-btn:hover  { background: var(--surface); }
.calc-btn:active { transform: scale(0.95); }
/* Chiffres — fond blanc/bg, texte normal */
.calc-btn.calc-num { background: var(--bg); color: var(--text); font-weight: 600; }
.calc-btn.calc-num:hover { background: var(--surface); }
/* Fonctions spéciales — teinte bleue */
.calc-btn.calc-fn  { font-size: 0.75rem; color: var(--accent); border-color: rgba(37,99,235,0.2); background: rgba(37,99,235,0.04); }
.calc-btn.calc-fn:hover { background: rgba(37,99,235,0.12); }
/* Opérateurs — fond surface, texte muted */
.calc-btn.calc-op  { background: var(--surface); color: var(--text-muted); border-color: var(--border); font-weight: 600; }
.calc-btn.calc-op:hover { background: var(--border); color: var(--text); }
/* C (effacer) — rouge discret */
.calc-btn.calc-ac  { color: var(--danger); background: var(--surface); }
.calc-btn.calc-ac:hover { background: rgba(239,68,68,0.07); }
/* ⌫ (suppr) */
.calc-btn.calc-del { color: var(--text-muted); background: var(--surface); }
/* = — bleu accent */
.calc-btn.calc-eq  { background: var(--accent); color: #fff; border-color: var(--accent); font-size: 1.1rem; font-weight: 600; }
.calc-btn.calc-eq:hover { background: #1d4ed8; }

/* Ligne C(n,k) */
.proba-cnk-row {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 10px;
  padding: 10px 0 4px;
  border-top: 1px solid var(--border);
  flex-wrap: nowrap;
}
.proba-cnk-label {
  font-family: var(--font-mono);
  font-size: 0.9rem;
  color: var(--text-muted);
  flex-shrink: 0;
}
.proba-cnk-input {
  width: 52px;
  padding: 6px 8px;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--text);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  text-align: center;
  outline: none;
}
.proba-cnk-input:focus { border-color: var(--accent); }

/* Brouillon */
.proba-notes-area {
  display: block;
  width: 100%;
  min-height: 150px;
  padding: 14px 16px;
  font-family: var(--font-mono);
  font-size: 0.82rem;
  color: var(--text);
  background: var(--bg);
  border: none;
  resize: vertical;
  line-height: 1.7;
  outline: none;
}
.proba-notes-area::placeholder { color: var(--text-muted); opacity: 0.55; }
.proba-notes-clear {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  background: none;
  border: 1px dashed var(--border);
  border-radius: 99px;
  padding: 3px 10px;
  cursor: pointer;
  transition: color var(--transition), border-color var(--transition);
}
.proba-notes-clear:hover { color: var(--danger); border-color: var(--danger); }

/* ── JEU — GÉOMÉTRIE ── */

.geo-question-text {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 700;
  color: var(--text);
  text-align: center;
  margin-bottom: 20px;
  letter-spacing: -0.02em;
  line-height: 1.5;
}

/* Zone SVG */
.geo-svg-wrap {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}

.geo-single-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0;
}

.geo-svg {
  width: 200px;
  height: 160px;
  border-radius: var(--radius-sm);
  background: var(--bg);
  border: 1px solid var(--border);
}

/* Mode Compare */
.geo-compare-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  justify-content: center;
  flex-wrap: wrap;
}
.geo-compare-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
}
.geo-compare-label {
  font-family: var(--font-display);
  font-size: 0.88rem;
  font-weight: 800;
  letter-spacing: -0.01em;
}
.geo-compare-dims {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  color: var(--text-muted);
  text-align: center;
}
.geo-compare-vs {
  font-family: var(--font-display);
  font-size: 0.75rem;
  font-weight: 800;
  color: var(--text-muted);
  letter-spacing: 0.05em;
  flex-shrink: 0;
}

/* 3 boutons de mode sur une ligne */
.geo-mode-row .diff-btn { flex: 1; }

/* ── Badge formule dans la question (mode calculate) ── */
.geo-formula-badge {
  display: inline-flex;
  align-items: center;
  font-family: var(--font-mono);
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--accent);
  background: rgba(37,99,235,0.08);
  border: 1.5px solid rgba(37,99,235,0.22);
  padding: 3px 12px;
  border-radius: 99px;
  margin-left: 8px;
  vertical-align: middle;
  letter-spacing: 0.01em;
  white-space: nowrap;
}

/* ── Bloc formule + légende sous la figure ── */
.geo-formula-block {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  margin-top: 6px;
  padding: 10px 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  width: 100%;
  max-width: 300px;
}
.geo-formula-line {
  font-family: var(--font-mono);
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
  letter-spacing: 0.02em;
}
/* Variable cliquable dans la formule */
.geo-var {
  color: var(--accent);
  cursor: pointer;
  border-bottom: 1.5px dotted var(--accent);
  padding: 0 1px;
  transition: background var(--transition), border-radius var(--transition);
}
.geo-var:hover,
.geo-var.active {
  background: rgba(37,99,235,0.10);
  border-radius: 3px;
}
/* Légende des lettres */
.geo-legend-list {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  justify-content: center;
}
.geo-legend-item {
  font-family: var(--font-body);
  font-size: 0.72rem;
  color: var(--text-muted);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 99px;
  padding: 2px 10px;
  cursor: pointer;
  transition: color var(--transition), border-color var(--transition), background var(--transition);
  white-space: nowrap;
}
.geo-legend-item em {
  font-style: normal;
  font-weight: 700;
  color: var(--accent);
}
.geo-legend-item:hover,
.geo-legend-item.active {
  color: var(--text);
  border-color: var(--accent);
  background: rgba(37,99,235,0.06);
}




/* ══════════════════════════════════════
   MODAL DE RÉVISION
══════════════════════════════════════ */
.review-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.45);
  z-index: 500;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.review-modal-overlay.open {
  display: flex;
  animation: reviewFadeIn 0.2s ease;
}
@keyframes reviewFadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}
.review-modal-box {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  width: 100%;
  max-width: 460px;
  max-height: 85vh;
  overflow-y: auto;
  animation: reviewSlideIn 0.2s ease;
}
@keyframes reviewSlideIn {
  from { transform: translateY(10px); opacity: 0; }
  to   { transform: translateY(0);    opacity: 1; }
}
.review-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  background: var(--bg);
  z-index: 1;
}
.review-modal-title {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--text-muted);
}
.review-modal-close {
  width: 28px; height: 28px;
  border-radius: 99px;
  border: none;
  background: none;
  color: var(--text-muted);
  font-size: 1.2rem;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: color var(--transition), background var(--transition);
}
.review-modal-close:hover { color: var(--text); background: var(--surface); }
.review-modal-body {
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.review-question {
  font-family: var(--font-body);
  font-size: 0.9rem;
  color: var(--text);
  line-height: 1.6;
  text-align: center;
}
.review-svg {
  display: flex;
  justify-content: center;
}
.review-svg svg {
  max-width: 220px;
  height: auto;
}
.review-given {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  font-family: var(--font-mono);
  font-size: 0.9rem;
  padding: 10px 14px;
  background: var(--surface);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
}
.review-answer-correct {
  font-weight: 700;
  color: var(--accent-3);
}
.review-answer-wrong {
  font-weight: 700;
  color: var(--danger);
  text-decoration: line-through;
  opacity: 0.8;
}
.review-answer-correct-label {
  color: var(--accent-3);
  font-weight: 600;
}
.review-expl-card {
  margin-bottom: 0 !important;
}
/* Dots cliquables sur questions passées */
.seq-dot.correct,
.seq-dot.wrong {
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.seq-dot.correct:hover,
.seq-dot.wrong:hover {
  transform: scale(1.35);
  box-shadow: 0 0 0 3px rgba(37,99,235,0.25);
}
