/* ===== ROOT VARIABLES ===== */
:root {
  /* ── Backgrounds ── */
  --bg:           #0e0d14;
  --bg-card:      #161522;
  --bg-sidebar:   #161522;
  --bg-input:     #1e1c2e;

  /* ── Surfaces ── */
  --surface:      #161522;
  --surface-2:    #1e1c2e;

  /* ── Borders ── */
  --border:       rgba(255, 255, 255, 0.07);

  /* ── Text ── */
  --text:         #f0f0fa;
  --text-muted:   #7070a8;
  --text-faint:   #44445a;

  /* ── Accent (violet Quest Mode) ── */
  --primary:      #818cf8;
  --primary-dark: #6366f1;
  --accent:       #818cf8;
  --accent-light: #a78bfa;

  /* ── Gamification ── */
  --xp-color:     #a78bfa;
  --xp-glow:      rgba(167, 139, 250, 0.3);
  --streak-color: #f97316;
  --streak-glow:  rgba(249, 115, 22, 0.3);
  --gold-color:   #fbbf24;

  /* ── États ── */
  --success:      #22c97a;
  --danger:       #ef4444;

  /* ── UI ── */
  --radius:       12px;
  --radius-sm:    8px;
  --shadow:       0 4px 24px rgba(0, 0, 0, 0.5);
  --transition:   0.2s ease;
}

/* ===== RESET ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.6;
}
a { color: inherit; text-decoration: none; }
button { cursor: pointer; border: none; background: none; font-family: inherit; }
input, textarea, select {
  font-family: inherit;
  font-size: 0.95rem;
  color: var(--text);
  background: var(--bg-input);
}

/* ===== SCROLLBAR ===== */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }

/* ===== BUTTONS ===== */
.btn-primary {
  display: inline-block;
  padding: 12px 24px;
  border-radius: var(--radius);
  font-weight: 600;
  font-size: 0.95rem;
  background: var(--primary);
  color: #0F172A;
  transition: var(--transition);
  cursor: pointer;
  border: none;
  text-align: center;
}
.btn-primary:hover { background: var(--primary-dark); transform: translateY(-1px); }
.btn-done-active { background: #22c55e !important; color: #fff !important; }
.btn-done-active:hover { background: #16a34a !important; }

.btn-download {
  display: inline-flex;
  align-items: center;
  align-self: flex-start;
  gap: 12px;
  padding: 12px 20px;
  border-radius: 12px;
  background: linear-gradient(135deg, #12239E 0%, #1a35c8 100%);
  color: #fff;
  text-decoration: none;
  border: 2px solid rgba(255,255,255,0.2);
  cursor: pointer;
  position: relative;
  overflow: hidden;
  box-shadow: 0 4px 18px rgba(18, 35, 158, 0.45);
  transition: box-shadow 0.2s ease, transform 0.2s ease;
  white-space: nowrap;
  flex-shrink: 0;
}
.btn-download::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, #0d1b7a 0%, #12239E 100%);
  opacity: 0;
  transition: opacity 0.2s ease;
}
.btn-download:hover {
  color: #fff;
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(18, 35, 158, 0.6);
}
.btn-download:hover::before { opacity: 1; }
.btn-download:active { transform: translateY(0); }
.btn-download-nav {
  padding: 6px 14px !important;
  border-radius: 8px !important;
  font-size: 0.85rem !important;
  gap: 6px !important;
  box-shadow: none !important;
}
.btn-download .btn-download-icon {
  font-size: 1.8rem;
  position: relative;
  z-index: 1;
  animation: bounce-down 1.6s ease infinite;
  line-height: 1;
}
.btn-download .btn-download-content {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  position: relative;
  z-index: 1;
}
.btn-download .btn-download-label {
  font-weight: 700;
  font-size: 1rem;
  line-height: 1.2;
}
.btn-download .btn-download-sub {
  font-size: 0.75rem;
  font-weight: 400;
  opacity: 0.8;
  line-height: 1;
}
@keyframes bounce-down {
  0%, 100% { transform: translateY(0); }
  50%       { transform: translateY(4px); }
}

.chapter-actions-left {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
}

.btn-secondary {
  display: inline-block;
  padding: 12px 24px;
  border-radius: var(--radius);
  font-weight: 600;
  background: var(--bg-card);
  color: var(--text);
  border: 1px solid var(--border);
  transition: var(--transition);
  cursor: pointer;
}
.btn-secondary:hover { background: #2D3F55; }

.btn-outline {
  display: inline-block;
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  color: var(--text-muted);
  border: 1px solid var(--border);
  transition: var(--transition);
}
.btn-outline:hover { color: var(--text); border-color: var(--primary); }

.btn-sm {
  display: inline-block;
  padding: 6px 14px;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  font-weight: 500;
  background: var(--bg-card);
  color: var(--text-muted);
  border: 1px solid var(--border);
  transition: var(--transition);
}
.btn-sm:hover { color: var(--text); border-color: var(--primary); }

.card-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: auto;
}

.card-actions .btn-download {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  background: linear-gradient(135deg, #12239E 0%, #1a35c8 100%);
  color: #fff;
  font-weight: 600;
  font-size: 0.82rem;
  text-decoration: none;
  transition: var(--transition);
  width: 100%;
  box-sizing: border-box;
  white-space: normal;
  flex-shrink: 1;
  align-self: stretch;
  position: relative;
  overflow: hidden;
  box-shadow: 0 3px 12px rgba(18, 35, 158, 0.35);
  border: none;
  cursor: pointer;
}
.card-actions .btn-download .btn-download-text {
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.card-actions .btn-download:hover {
  background: linear-gradient(135deg, #0d1b7a 0%, #12239E 100%);
  color: #fff;
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(18, 35, 158, 0.5);
}
.card-actions .btn-download:active { transform: translateY(0); }
.card-actions .btn-download small {
  display: block;
  font-size: 0.68rem;
  font-weight: 400;
  opacity: 0.8;
  white-space: normal;
}

.btn-full { width: 100%; }

/* ===== NAVBAR ===== */
.navbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 40px;
  height: 60px;
  background: rgba(15,23,42,0.95);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 100;
}
.nav-brand a {
  font-weight: 700; font-size: 1.1rem; color: var(--primary);
}
.navbar-logo {
  height: 48px;
  width: auto;
  display: block;
}
.nav-links { display: flex; align-items: center; gap: 12px; }
.nav-links a {
  padding: 6px 12px;
  border-radius: 8px;
  font-size: 0.9rem;
  color: var(--text-muted);
  transition: var(--transition);
}
.nav-links a:hover { color: var(--text); background: var(--border); }
.nav-user { font-size: 0.8rem !important; }

/* ===== MESSAGES / ALERTS ===== */
.messages { padding: 0 40px; margin: 12px 0; }
.alert {
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  margin-bottom: 8px;
}
.alert-success { background: rgba(16,185,129,0.15); border: 1px solid rgba(16,185,129,0.3); color: var(--success); }
.alert-error, .alert-danger { background: rgba(239,68,68,0.15); border: 1px solid rgba(239,68,68,0.3); color: var(--danger); }
.alert-info { background: rgba(37,99,235,0.15); border: 1px solid rgba(37,99,235,0.3); color: var(--accent-light); }

/* ===== MAIN CONTENT ===== */
.main-content { min-height: calc(100vh - 120px); }

/* ===== FOOTER ===== */
.footer {
  text-align: center; padding: 24px;
  border-top: 1px solid var(--border);
  color: var(--text-faint); font-size: 0.85rem;
}
.footer a { color: var(--primary); }

/* ===== HERO ===== */
.hero {
  text-align: center;
  padding: 80px 40px 60px;
  max-width: 800px;
  margin: 0 auto;
}
.hero-cover {
  max-width: 420px;
  width: 100%;
  height: auto;
  border-radius: 12px;
  box-shadow: 0 8px 40px rgba(0,0,0,0.4);
  margin-bottom: 32px;
  display: block;
  margin-left: auto;
  margin-right: auto;
}
.hero-actions { display: flex; flex-direction: column; align-items: center; gap: 24px; }
.hero-quote {
  max-width: 520px;
  margin: 0;
  padding: 20px 24px;
  background: linear-gradient(135deg, rgba(242,201,76,0.04) 0%, rgba(37,99,235,0.06) 100%);
  border: 1px solid rgba(242,201,76,0.2);
  border-left: 3px solid var(--primary);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  position: relative;
  box-shadow: 0 0 24px rgba(242,201,76,0.06), 0 2px 12px rgba(0,0,0,0.3);
  text-align: left;
}
.hero-quote::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 1px;
  background: linear-gradient(90deg, var(--primary), transparent);
  opacity: 0.5;
}
.hero-quote em {
  display: block;
  font-size: 1.05rem;
  font-style: italic;
  font-weight: 700;
  color: var(--primary);
  text-shadow: 0 0 18px rgba(242,201,76,0.35);
  letter-spacing: 0.015em;
  line-height: 1.5;
  margin-bottom: 12px;
  text-align: center;
}
.hero-quote span {
  display: block;
  font-size: 0.8rem;
  font-weight: 400;
  color: var(--text-muted);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  line-height: 1.75;
  border-top: 1px solid rgba(255,255,255,0.06);
  padding-top: 10px;
}
.hero-quote span strong { color: var(--accent-light); font-weight: 600; text-transform: none; letter-spacing: 0; }

/* =====================================================================
   ===== JOURNEY HOME — Direction visuelle, parcours en 5 étapes =====
   ===================================================================== */

/* ---------- HERO ---------- */
.journey-hero {
  position: relative;
  overflow: hidden;
  padding: 110px 24px 90px;
  isolation: isolate;
}
.journey-hero-bg {
  position: absolute; inset: 0;
  pointer-events: none;
  z-index: -1;
}
.hero-gradient {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.55;
  mix-blend-mode: screen;
}
.hero-gradient-1 {
  width: 520px; height: 520px;
  top: -120px; left: -80px;
  background: radial-gradient(circle, #22D3EE 0%, transparent 65%);
}
.hero-gradient-2 {
  width: 600px; height: 600px;
  top: 40px; right: -160px;
  background: radial-gradient(circle, #A855F7 0%, transparent 65%);
}
.hero-gradient-3 {
  width: 480px; height: 480px;
  bottom: -180px; left: 35%;
  background: radial-gradient(circle, #EC4899 0%, transparent 60%);
  opacity: 0.4;
}
.hero-grid {
  position: absolute; inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.03) 1px, transparent 1px);
  background-size: 56px 56px;
  mask-image: radial-gradient(ellipse 80% 60% at 50% 40%, #000 30%, transparent 80%);
  -webkit-mask-image: radial-gradient(ellipse 80% 60% at 50% 40%, #000 30%, transparent 80%);
}
.floating-piece {
  position: absolute;
  width: 88px; height: 88px;
  filter: drop-shadow(0 8px 24px rgba(0,0,0,0.35));
  animation: float-piece 9s ease-in-out infinite;
}
.piece-1 { top: 12%;  left: 6%;   animation-delay: 0s;   transform: rotate(-12deg); }
.piece-2 { top: 22%;  right: 8%;  animation-delay: 1.2s; transform: rotate(18deg); }
.piece-3 { bottom: 18%; left: 12%; animation-delay: 2.4s; transform: rotate(8deg); }
.piece-4 { bottom: 28%; right: 14%; animation-delay: 0.6s; transform: rotate(-22deg); width: 72px; height: 72px; }
.piece-5 { top: 48%;  left: 50%;  animation-delay: 1.8s; transform: rotate(35deg); width: 64px; height: 64px; opacity: 0.9; }

@keyframes float-piece {
  0%, 100% { transform: translateY(0) rotate(var(--r, 0deg)); }
  50%       { transform: translateY(-22px) rotate(var(--r, 0deg)); }
}
.piece-1 { --r: -12deg; }
.piece-2 { --r: 18deg; }
.piece-3 { --r: 8deg; }
.piece-4 { --r: -22deg; }
.piece-5 { --r: 35deg; }

.journey-hero-content {
  max-width: 880px;
  margin: 0 auto;
  text-align: center;
  position: relative;
}
.journey-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 14px 7px 12px;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: #E2E8F0;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 999px;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  margin-bottom: 28px;
}
.badge-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: #22D3EE;
  box-shadow: 0 0 0 4px rgba(34,211,238,0.18), 0 0 12px #22D3EE;
  animation: pulse 2.4s ease-in-out infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.45; }
}
.journey-title {
  font-size: clamp(2rem, 5vw, 3.6rem);
  font-weight: 800;
  line-height: 1.08;
  letter-spacing: -0.02em;
  margin: 0 auto 22px;
  max-width: 800px;
  color: #F8FAFC;
}
.journey-title-accent {
  display: block;
  background: linear-gradient(120deg, #22D3EE 0%, #A855F7 45%, #EC4899 90%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  margin-top: 4px;
}
.journey-subtitle {
  max-width: 620px;
  margin: 0 auto 36px;
  color: var(--text-muted);
  font-size: 1.05rem;
  line-height: 1.65;
}
.journey-cta {
  display: flex;
  justify-content: center;
  gap: 14px;
  flex-wrap: wrap;
  margin-bottom: 56px;
}
.btn-journey-primary {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 14px 26px;
  font-size: 0.95rem;
  font-weight: 600;
  color: #0F172A;
  background: linear-gradient(120deg, #F2C94C 0%, #F97316 100%);
  border-radius: 999px;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  box-shadow: 0 8px 28px rgba(249,115,22,0.35);
}
.btn-journey-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 36px rgba(249,115,22,0.5);
}
.btn-journey-primary .btn-arrow { transition: transform 0.2s ease; }
.btn-journey-primary:hover .btn-arrow { transform: translateX(4px); }

.btn-journey-ghost {
  display: inline-flex;
  align-items: center;
  padding: 14px 24px;
  font-size: 0.95rem;
  font-weight: 600;
  color: #F1F5F9;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.14);
  border-radius: 999px;
  transition: var(--transition);
  backdrop-filter: blur(10px);
}
.btn-journey-ghost:hover {
  background: rgba(255,255,255,0.08);
  border-color: rgba(255,255,255,0.25);
}

/* ---------- STATS ---------- */
.journey-stats {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 16px 28px;
  background: rgba(15,23,42,0.55);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 18px;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}
.stat-item {
  display: flex; flex-direction: column; align-items: center;
  padding: 0 14px;
  min-width: 78px;
}
.stat-num {
  font-size: 1.75rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  background: linear-gradient(120deg, #F8FAFC 0%, #94A3B8 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  line-height: 1.1;
}
.stat-label {
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-faint);
  margin-top: 4px;
}
.stat-divider {
  width: 1px; height: 28px;
  background: rgba(255,255,255,0.12);
}

/* ---------- PARCOURS ---------- */
.journey-path {
  max-width: 1180px;
  margin: 0 auto;
  padding: 80px 24px 100px;
  position: relative;
}
.journey-path-header {
  text-align: center;
  margin-bottom: 64px;
}
.journey-eyebrow {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: #F2C94C;
  margin-bottom: 14px;
}
.journey-path-header h2 {
  font-size: clamp(1.6rem, 3vw, 2.4rem);
  font-weight: 800;
  letter-spacing: -0.015em;
  margin-bottom: 12px;
}
.journey-path-header p {
  color: var(--text-muted);
  font-size: 1rem;
  max-width: 540px;
  margin: 0 auto;
}

.journey-track {
  position: relative;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 24px;
  align-items: stretch;
}
.journey-line {
  position: absolute;
  top: 38px;
  left: 8%;
  right: 8%;
  height: 2px;
  background-image: linear-gradient(
    90deg,
    #22D3EE 0%, #22D3EE 18%,
    #F97316 22%, #F97316 38%,
    #A855F7 42%, #A855F7 58%,
    #3B82F6 62%, #3B82F6 78%,
    #EC4899 82%, #EC4899 100%
  );
  -webkit-mask-image: linear-gradient(90deg, #000 50%, transparent 50%);
          mask-image: linear-gradient(90deg, #000 50%, transparent 50%);
  -webkit-mask-size: 14px 100%;
          mask-size: 14px 100%;
  opacity: 0.55;
  z-index: 0;
}

/* ---------- PUZZLE CARDS ---------- */
.puzzle-card {
  position: relative;
  display: flex;
  flex-direction: column;
  z-index: 1;
}
.puzzle-step {
  width: 76px; height: 76px;
  margin: 0 auto -28px;
  border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, var(--accent-soft), transparent 70%), #0F172A;
  border: 2px solid var(--accent);
  display: flex; align-items: center; justify-content: center;
  font-weight: 800;
  font-size: 1.5rem;
  color: var(--accent);
  box-shadow:
    0 0 0 6px rgba(15,23,42,1),
    0 0 0 7px rgba(255,255,255,0.04),
    0 12px 32px rgba(0,0,0,0.35);
  position: relative;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.puzzle-step-num {
  font-variant-numeric: tabular-nums;
  text-shadow: 0 0 18px var(--accent);
}
.puzzle-card-inner {
  position: relative;
  flex: 1;
  background: linear-gradient(160deg, rgba(30,41,59,0.7) 0%, rgba(15,23,42,0.55) 100%);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 18px;
  padding: 44px 22px 22px;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  transition: transform 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
  overflow: hidden;
}
.puzzle-card-inner::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(160deg, var(--accent-soft) 0%, transparent 55%);
  opacity: 0.6;
  pointer-events: none;
}
.puzzle-card-inner::after {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
  opacity: 0.7;
}
.puzzle-card:hover .puzzle-card-inner {
  transform: translateY(-6px);
  border-color: var(--accent);
  box-shadow:
    0 20px 48px rgba(0,0,0,0.4),
    0 0 0 1px var(--accent),
    0 0 40px var(--accent-soft);
}
.puzzle-card:hover .puzzle-step {
  transform: scale(1.08);
  box-shadow:
    0 0 0 6px rgba(15,23,42,1),
    0 0 0 7px var(--accent),
    0 0 36px var(--accent),
    0 12px 32px rgba(0,0,0,0.4);
}

.puzzle-card-head {
  display: flex; align-items: center; gap: 10px;
  margin-bottom: 14px;
  position: relative;
}
.puzzle-icon {
  display: inline-flex; align-items: center; justify-content: center;
  width: 32px; height: 32px;
  border-radius: 10px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 1rem;
  font-weight: 700;
}
.puzzle-verb {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent);
}
.puzzle-card-title {
  font-size: 0.98rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  margin-bottom: 10px;
  color: #F1F5F9;
  position: relative;
  line-height: 1.35;
}
.puzzle-card-summary {
  font-size: 0.82rem;
  color: var(--text-muted);
  line-height: 1.55;
  margin-bottom: 16px;
  position: relative;
}
.puzzle-pills {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 18px;
  padding: 0;
  position: relative;
}
.puzzle-pill {
  font-size: 0.7rem;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  color: #CBD5E1;
}
.puzzle-card-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 14px;
  border-top: 1px dashed rgba(255,255,255,0.08);
  position: relative;
}
.puzzle-difficulty {
  display: flex; align-items: center; gap: 8px;
}
.diff-label {
  font-size: 0.7rem;
  letter-spacing: 0.06em;
  color: var(--text-faint);
  text-transform: uppercase;
}
.diff-dots { display: inline-flex; gap: 3px; }
.diff-dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: rgba(255,255,255,0.1);
}
.diff-dot-on {
  background: var(--accent);
  box-shadow: 0 0 8px var(--accent);
}
.puzzle-meta {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-muted);
}

/* ---------- PUZZLE THUMB ---------- */
.puzzle-thumb {
  position: relative;
  margin: -34px -22px 18px;
  height: 130px;
  overflow: hidden;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}
.puzzle-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: saturate(1.05) contrast(1.02);
  transition: transform 0.6s ease;
}
.puzzle-card:hover .puzzle-thumb img {
  transform: scale(1.06);
}
.puzzle-thumb::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, transparent 30%, rgba(15,23,42,0.85) 100%),
    linear-gradient(140deg, var(--accent-soft) 0%, transparent 60%);
  pointer-events: none;
}
.puzzle-thumb-tag {
  position: absolute;
  top: 10px; left: 10px;
  z-index: 1;
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(15,23,42,0.7);
  color: var(--accent);
  border: 1px solid var(--accent);
  backdrop-filter: blur(6px);
}

/* ---------- PUZZLE PREVIEW LIST ---------- */
.puzzle-preview {
  position: relative;
  margin-bottom: 16px;
  padding: 12px 14px;
  background: rgba(255,255,255,0.025);
  border: 1px dashed rgba(255,255,255,0.08);
  border-radius: 12px;
}
.puzzle-preview-label {
  display: block;
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 6px;
}
.puzzle-preview-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.puzzle-preview-list li {
  font-size: 0.78rem;
  line-height: 1.45;
  color: #CBD5E1;
  display: flex;
  align-items: flex-start;
  gap: 6px;
}
.puzzle-preview-bullet {
  color: var(--accent);
  font-weight: 700;
  flex-shrink: 0;
  margin-top: 1px;
}

/* ---------- SHOWCASE ---------- */
.journey-showcase {
  max-width: 1280px;
  margin: 0 auto;
  padding: 40px 24px 80px;
}
.showcase-grid {
  display: grid;
  grid-template-columns: 1.1fr 1fr 1fr;
  gap: 22px;
  margin-top: 36px;
}
.showcase-card {
  position: relative;
  display: flex;
  flex-direction: column;
  background: linear-gradient(160deg, rgba(30,41,59,0.7) 0%, rgba(15,23,42,0.55) 100%);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 18px;
  padding: 22px 22px 0;
  backdrop-filter: blur(14px);
  overflow: hidden;
  transition: transform 0.3s ease, border-color 0.3s ease;
}
.showcase-card:hover {
  transform: translateY(-4px);
  border-color: rgba(242,201,76,0.35);
}
.showcase-tag {
  align-self: flex-start;
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--primary);
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(242,201,76,0.08);
  border: 1px solid rgba(242,201,76,0.25);
  margin-bottom: 12px;
}
.showcase-card h3 {
  font-size: 1.15rem;
  font-weight: 700;
  margin-bottom: 8px;
  color: #F1F5F9;
}
.showcase-card p {
  font-size: 0.86rem;
  color: var(--text-muted);
  line-height: 1.55;
  margin-bottom: 16px;
}
.showcase-card p code {
  background: rgba(242,201,76,0.1);
  color: var(--primary);
  padding: 1px 6px;
  border-radius: 4px;
  font-size: 0.78rem;
  font-family: 'JetBrains Mono', 'Fira Code', Consolas, monospace;
}
.showcase-card img {
  width: calc(100% + 44px);
  margin: auto -22px 0;
  display: block;
  border-top: 1px solid rgba(255,255,255,0.06);
}
.showcase-code {
  background: #0B1220;
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 12px;
  padding: 14px 16px;
  margin: 0 0 22px;
  font-family: 'JetBrains Mono', 'Fira Code', Consolas, monospace;
  font-size: 0.78rem;
  line-height: 1.6;
  color: #E2E8F0;
  overflow-x: auto;
  white-space: pre;
}
.showcase-code code {
  color: inherit;
  background: none;
  padding: 0;
}
.showcase-card--dax {
  background: linear-gradient(160deg, rgba(168,85,247,0.12) 0%, rgba(15,23,42,0.55) 100%);
  border-color: rgba(168,85,247,0.25);
}
.showcase-card--visual {
  background: linear-gradient(160deg, rgba(34,211,238,0.12) 0%, rgba(15,23,42,0.55) 100%);
  border-color: rgba(34,211,238,0.25);
}
.showcase-card--star {
  background: linear-gradient(160deg, rgba(249,115,22,0.12) 0%, rgba(15,23,42,0.55) 100%);
  border-color: rgba(249,115,22,0.25);
}

/* ---------- FOOT / LOGIN ---------- */
.journey-foot {
  max-width: 520px;
  margin: 0 auto;
  padding: 0 24px 80px;
}
.foot-cta {
  text-align: center;
  padding: 40px;
  background: linear-gradient(160deg, rgba(30,41,59,0.7), rgba(15,23,42,0.5));
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 18px;
  backdrop-filter: blur(14px);
}
.foot-cta h3 {
  font-size: 1.25rem;
  margin-bottom: 18px;
  color: #F1F5F9;
}
.auth-title {
  text-align: center;
  font-size: 1.15rem;
  font-weight: 700;
  margin-bottom: 18px;
  color: #F1F5F9;
}

/* ---------- RESPONSIVE ---------- */
@media (max-width: 1024px) {
  .journey-track { grid-template-columns: repeat(2, 1fr); }
  .journey-line { display: none; }
  .showcase-grid { grid-template-columns: 1fr; }
}
@media (max-width: 768px) {
  .journey-track { grid-template-columns: 1fr; }
  .journey-hero { padding: 80px 20px 60px; }
  .journey-stats { flex-direction: column; align-items: center; }
  .journey-cta { flex-direction: column; align-items: center; }
}

/* ===== CHAPTERS GRID ===== */
.chapters-grid { padding: 40px; }
.chapters-grid h2 { font-size: 1.5rem; font-weight: 700; margin-bottom: 24px; }
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 20px;
}
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  transition: var(--transition);
  display: flex;
  flex-direction: column;
}
.card:hover { border-color: var(--primary); transform: translateY(-3px); }
.card-emoji { font-size: 2.5rem; margin-bottom: 12px; }
.card h3 { font-size: 0.95rem; font-weight: 700; margin-bottom: 8px; }
.card p { font-size: 0.85rem; color: var(--text-muted); margin-bottom: 16px; }

/* ===== READER LAYOUT ===== */
.reader-layout {
  display: flex;
  height: calc(100vh - 60px);
  overflow: hidden;
  position: relative;
}
/* ---------- SIDEBAR FUTURISTE ---------- */
.sidebar {
  width: 280px;
  min-width: 280px;
  background: linear-gradient(180deg, #060C18 0%, #090F1C 100%);
  border-right: 1px solid rgba(255,255,255,0.05);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transition: width 0.28s cubic-bezier(0.4,0,0.2,1), min-width 0.28s cubic-bezier(0.4,0,0.2,1), border 0.28s;
  flex-shrink: 0;
}
.reader-layout.sidebar-closed .sidebar { width: 0; min-width: 0; border-right: none; }
.sidebar-toggle {
  position: fixed;
  left: 280px; top: 80px;
  background: #060C18;
  border: 1px solid rgba(255,255,255,0.07); border-left: none;
  color: var(--text-faint);
  padding: 10px 5px; border-radius: 0 6px 6px 0;
  cursor: pointer; font-size: 0.8rem; line-height: 1;
  transition: left 0.28s cubic-bezier(0.4,0,0.2,1), color 0.15s;
  z-index: 50;
}
.sidebar-toggle:hover { color: var(--text-muted); }
.reader-layout.sidebar-closed .sidebar-toggle { left: 0; border-left: 1px solid rgba(255,255,255,0.07); }

.sidebar-head {
  padding: 16px 16px 14px;
  border-bottom: 1px solid rgba(255,255,255,0.04);
  flex-shrink: 0;
  display: flex; align-items: center; justify-content: space-between;
}
.sidebar-label {
  font-size: 0.6rem; font-weight: 700;
  letter-spacing: 0.24em; text-transform: uppercase;
  color: var(--text-faint);
}
.sidebar-badge {
  font-size: 0.66rem; font-weight: 700;
  padding: 2px 8px; border-radius: 999px;
  background: rgba(242,201,76,0.07);
  color: var(--primary);
  border: 1px solid rgba(242,201,76,0.2);
}

/* rail vertical */
.nav-puzzles {
  flex: 1; overflow-y: auto; overflow-x: hidden;
  padding: 10px 0 8px;
  position: relative;
}
.nav-puzzles::-webkit-scrollbar { width: 2px; }
.nav-puzzles::-webkit-scrollbar-track { background: transparent; }
.nav-puzzles::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.05); }
.nav-puzzles::before {
  content: '';
  position: absolute; top: 18px; bottom: 18px; left: 30px;
  width: 1px;
  background: linear-gradient(180deg, transparent 0%, rgba(255,255,255,0.06) 8%, rgba(255,255,255,0.06) 92%, transparent 100%);
  pointer-events: none; z-index: 0;
}

/* groupe puzzle */
.npg { position: relative; margin: 1px 0; --c: #94A3B8; --cs: rgba(148,163,184,0.1); }
.npg-row {
  display: flex; align-items: center;
  padding: 0 8px 0 0;
  position: relative; z-index: 1;
}
.npg-link {
  flex: 1; min-width: 0;
  display: flex; align-items: center;
  text-decoration: none;
  border-radius: 10px;
  color: var(--text-faint);
  padding: 7px 4px 7px 0;
  transition: color 0.15s;
}
.npg-link:hover { color: var(--text-muted); }
.npg.is-active > .npg-row > .npg-link { color: #E2E8F0; }
.npg.is-done > .npg-row > .npg-link { color: var(--success); }

/* dot sur le rail */
.npg-dot {
  flex-shrink: 0;
  width: 44px;
  display: flex; align-items: center; justify-content: center;
  position: relative;
}
.npg-dot::after {
  content: '';
  width: 7px; height: 7px; border-radius: 50%;
  background: rgba(255,255,255,0.07);
  border: 1.5px solid rgba(255,255,255,0.1);
  display: block; position: relative; z-index: 1;
  transition: all 0.22s ease;
}
.npg.is-active .npg-dot::after {
  width: 9px; height: 9px;
  background: var(--c); border-color: var(--c);
  box-shadow: 0 0 0 3px var(--cs), 0 0 10px var(--c);
}
.npg.is-done .npg-dot::after {
  background: var(--success); border-color: var(--success);
  box-shadow: 0 0 0 2px rgba(16,185,129,0.15);
}

.npg-info {
  flex: 1; min-width: 0;
  display: flex; align-items: center; gap: 6px;
}
.npg-num {
  flex-shrink: 0;
  width: 16px; height: 16px; border-radius: 5px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  display: flex; align-items: center; justify-content: center;
  font-size: 0.59rem; font-weight: 800; color: var(--text-faint);
  transition: all 0.18s ease;
}
.npg.is-active .npg-num { background: var(--cs); border-color: var(--c); color: var(--c); }
.npg.is-done .npg-num {
  background: rgba(16,185,129,0.08);
  border-color: rgba(16,185,129,0.2);
  color: var(--success);
}
.npg-emoji { flex-shrink: 0; font-size: 0.85rem; line-height: 1; }
.npg-title {
  flex: 1; min-width: 0;
  font-size: 0.79rem; font-weight: 500;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.npg-check { flex-shrink: 0; font-size: 0.62rem; color: var(--success); margin-left: 2px; }

/* chevron */
.npg-toggle {
  flex-shrink: 0;
  width: 24px; height: 24px; border-radius: 6px;
  display: flex; align-items: center; justify-content: center;
  color: var(--text-faint);
  background: none; border: none; cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
.npg-toggle:hover { background: rgba(255,255,255,0.05); color: var(--text-muted); }
.npg-toggle svg { transition: transform 0.25s cubic-bezier(0.4,0,0.2,1); }
.npg.is-open > .npg-row .npg-toggle svg { transform: rotate(180deg); }
.npg.is-active .npg-toggle { color: var(--c); opacity: 0.7; }

/* sections (accordéon) */
.npg-sections {
  list-style: none; margin: 0; padding: 0 0 2px;
  overflow: hidden; max-height: 0;
  transition: max-height 0.32s cubic-bezier(0.4,0,0.2,1);
}
.npg.is-open .npg-sections { max-height: 800px; }

.nps-link {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 12px 4px 52px;
  font-size: 0.72rem; line-height: 1.4;
  color: var(--text-faint);
  text-decoration: none;
  border-radius: 6px;
  margin: 1px 8px 1px 0;
  transition: background 0.12s, color 0.12s;
  position: relative;
}
.nps-check {
  display: inline-flex;
  align-items: center; justify-content: center;
  width: 14px; height: 14px;
  border-radius: 50%;
  background: rgba(255,255,255,0.05);
  color: transparent;
  font-size: 0.62rem;
  font-weight: 700;
  flex-shrink: 0;
  transition: all 0.18s ease;
}
.nps-title { flex: 1; min-width: 0; }
.nps-item.is-seen .nps-link { color: #CBD5E1; }
.nps-item.is-seen .nps-check {
  background: rgba(16,185,129,0.18);
  color: var(--success);
  box-shadow: 0 0 8px rgba(16,185,129,0.3);
}
.nps-item.is-seen .nps-link::before { background: var(--success); width: 9px; }
.nps-link::before {
  content: '';
  position: absolute;
  left: 36px; top: 50%;
  width: 6px; height: 1px;
  background: rgba(255,255,255,0.1);
  transform: translateY(-50%);
  transition: background 0.15s, width 0.15s;
}
.nps-link:hover { background: rgba(255,255,255,0.03); color: #CBD5E1; }
.nps-link:hover::before { background: var(--c); width: 9px; }

/* pied sidebar */
.sidebar-foot {
  padding: 12px 14px;
  border-top: 1px solid rgba(255,255,255,0.04);
  flex-shrink: 0;
}
.sidebar-prog-bar {
  height: 2px;
  background: rgba(255,255,255,0.05);
  border-radius: 2px; overflow: hidden;
  margin-bottom: 7px;
}
.sidebar-prog-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--primary), #F97316);
  border-radius: 2px; transition: width 0.5s ease;
}
.sidebar-prog-label {
  font-size: 0.62rem; color: var(--text-faint); letter-spacing: 0.05em;
}

/* legacy classes conservées */
.check { margin-left: auto; font-size: 0.8rem; }
.progress-wrap { margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--border); font-size: 0.82rem; color: var(--text-muted); }
.progress-bar { height: 6px; background: var(--border); border-radius: 3px; margin-top: 8px; overflow: hidden; }
.progress-fill { height: 100%; background: var(--primary); border-radius: 3px; transition: width 0.4s ease; }
.reader-main { flex: 1; overflow-y: auto; padding: 40px; }
.reader-welcome {
  max-width: 560px;
  margin: 40px auto;
  text-align: center;
}
.reader-intro {
  margin-bottom: 28px;
  text-align: left;
}
.reader-intro-quote {
  font-size: 1.15rem;
  font-weight: 700;
  font-style: italic;
  color: var(--text);
  border-left: 3px solid var(--primary);
  padding-left: 14px;
  margin-bottom: 14px;
  line-height: 1.5;
}
.reader-intro-text {
  font-size: 0.92rem;
  color: var(--text-muted);
  line-height: 1.7;
}
.reader-welcome-img {
  width: 100%; height: auto; display: block; border-radius: 16px;
}
.reader-welcome-text {
  padding: 0 0 20px 0;
  color: #e2e8f0;
}
.reader-welcome-text h1 { font-size: 1.3rem; font-weight: 700; margin-bottom: 6px; }
.reader-welcome-text p { font-size: 0.9rem; color: var(--text-muted); margin: 0; }

.navbar-chapter-nav { display: flex; align-items: center; gap: 8px; }
.navbar-nav-btn {
  padding: 5px 12px; border-radius: 20px; font-size: 0.78rem; font-weight: 600;
  color: var(--text-muted); background: var(--bg-card); border: 1px solid var(--border);
  text-decoration: none; white-space: nowrap; max-width: 180px;
  overflow: hidden; text-overflow: ellipsis;
  transition: var(--transition);
}
.navbar-nav-btn:hover { color: var(--text); border-color: var(--primary); background: rgba(37,99,235,0.1); }
.navbar-nav-btn-next { color: var(--text); background: rgba(37,99,235,0.15); border-color: rgba(37,99,235,0.4); }
.navbar-nav-btn-next:hover { background: rgba(37,99,235,0.28); }

/* ===== CHAPTER CONTENT ===== */
.chapter-content { max-width: 860px; margin: 0 auto; overflow-y: auto; padding: 40px; }
.chapter-header { margin-bottom: 32px; padding-bottom: 24px; border-bottom: 1px solid var(--border); }
.chapter-header-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 8px;
  flex-wrap: wrap;
}
.chapter-header-titles { display: flex; flex-direction: column; }
.chapter-emoji { font-size: 3rem; display: block; margin-bottom: 12px; }
.chapter-header h1 { font-size: 1.8rem; font-weight: 800; margin-bottom: 8px; }
.chapter-summary {
  color: var(--text-muted);
  font-size: 1.05rem;
  font-style: italic;
  background: rgba(242,201,76,0.08);
  border: 1px solid rgba(242,201,76,0.12);
  border-radius: var(--radius-sm);
  padding: 14px 18px;
  margin-top: 12px;
}
.chapter-section { margin-bottom: 32px; }
.chapter-section h2 { font-size: 1.2rem; font-weight: 700; margin-bottom: 16px; color: var(--primary); }
.section-content {
  background: linear-gradient(135deg, var(--bg-card) 0%, rgba(37,99,235,0.06) 100%);
  border: 1px solid rgba(242,201,76,0.18);
  border-left: 4px solid var(--primary);
  border-radius: var(--radius);
  padding: 28px 28px 28px 24px;
  color: var(--text);
  line-height: 1.8;
  font-size: 1.1rem;
  box-shadow: 0 2px 16px rgba(0,0,0,0.25), inset 0 1px 0 rgba(255,255,255,0.04);
  transition: var(--transition);
}
.section-content:hover {
  border-left-color: var(--accent-light);
  box-shadow: 0 4px 24px rgba(0,0,0,0.35), inset 0 1px 0 rgba(255,255,255,0.06);
  transform: translateY(-1px);
}
.section-content a {
  color: var(--accent-light);
  text-decoration: underline;
  text-underline-offset: 3px;
  transition: color var(--transition);
}
.section-content a:hover {
  color: var(--primary);
}
.block-heading {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--primary);
  margin: 28px 0 10px;
  padding-bottom: 6px;
  border-bottom: 2px solid var(--primary);
}

/* ===== DAX CODE BLOCKS ===== */
.dax-code {
  background: #0b1120;
  color: #e2e8f0;
  padding: 14px 18px;
  border-radius: 8px;
  border: 1px solid rgba(242,201,76,0.25);
  border-left: 3px solid var(--primary);
  font-family: 'Consolas', 'Monaco', monospace;
  font-size: 0.88rem;
  line-height: 1.55;
  margin: 16px 0;
  overflow-x: auto;
  white-space: pre;
}
.dax-code code { background: transparent; padding: 0; }

/* ===== CALLOUTS (info / tip / warning / success) ===== */
.callout {
  margin: 18px 0;
  padding: 14px 16px 14px 18px;
  border-radius: 8px;
  border-left: 4px solid var(--accent);
  background: rgba(37,99,235,0.08);
  font-size: 0.92rem;
  line-height: 1.55;
}
.callout-title {
  font-weight: 700;
  color: var(--accent-light);
  margin-bottom: 6px;
  font-size: 0.95rem;
}
.callout-tip    { border-left-color: var(--primary); background: rgba(242,201,76,0.08); }
.callout-tip    .callout-title { color: var(--primary); }
.callout-warn   { border-left-color: #f97316; background: rgba(249,115,22,0.08); }
.callout-warn   .callout-title { color: #fdba74; }
.callout-success{ border-left-color: var(--success); background: rgba(16,185,129,0.08); }
.callout-success .callout-title { color: #6ee7b7; }
.callout-danger { border-left-color: var(--danger); background: rgba(239,68,68,0.08); }
.callout-danger .callout-title { color: #fca5a5; }

/* ===== CHAPTER & SECTION IMAGES ===== */
.chapter-image { margin-top: 20px; }
.chapter-image img,
.puzzle-img img {
  width: 100%;
  height: auto;
  border-radius: var(--radius);
  object-fit: contain;
}
.puzzle-img { margin-top: 16px; }
.puzzle-img-25 { max-width: 25%; }
.puzzle-img-50 { max-width: 50%; }
.puzzle-img-60 { max-width: 60%; }
.puzzle-img-75 { max-width: 75%; }
.puzzle-img-xl { width: calc(100% + 80px); margin-left: -40px; max-width: none; }

.chapter-actions { margin-top: 40px; padding-top: 24px; border-top: 1px solid var(--border); display: flex; flex-direction: row; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.chapter-nav { display: flex; gap: 16px; flex-wrap: wrap; margin-top: 0; }

/* ===== CHAT PAGE ===== */
.chat-layout { max-width: 860px; margin: 0 auto; padding: 32px; display: flex; flex-direction: column; height: calc(100vh - 60px); }
.chat-header { margin-bottom: 16px; }
.chat-header h1 { font-size: 1.5rem; font-weight: 700; }
.chat-header p { color: var(--text-muted); font-size: 0.9rem; }
.chat-messages { flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 12px; padding: 16px 0; }
.message { display: flex; }
.message.user { justify-content: flex-end; }
.bubble {
  max-width: 75%;
  padding: 12px 16px;
  border-radius: 12px;
  font-size: 0.9rem;
  line-height: 1.6;
  white-space: pre-wrap;
}
.message.user .bubble { background: var(--primary); color: #0F172A; font-weight: 500; }
.message.assistant .bubble { background: var(--bg-card); border: 1px solid var(--border); }
.engine-badge { display: block; font-size: 0.7rem; color: var(--text-faint); margin-top: 6px; }
.suggestions { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.suggestion-btn {
  padding: 6px 12px; border-radius: 20px;
  font-size: 0.78rem; cursor: pointer;
  background: rgba(37,99,235,0.15); border: 1px solid rgba(37,99,235,0.3);
  color: var(--accent-light); transition: var(--transition);
}
.suggestion-btn:hover { background: rgba(37,99,235,0.3); }
.chat-form { display: flex; gap: 10px; padding-top: 12px; border-top: 1px solid var(--border); }
#chat-input {
  flex: 1; padding: 12px 16px; border-radius: var(--radius); border: 1px solid var(--border);
  background: var(--bg-card); color: var(--text); outline: none; transition: var(--transition);
}
#chat-input:focus { border-color: var(--primary); }
#send-btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* ===== AUTH PAGE ===== */
.auth-page { display: flex; align-items: center; justify-content: center; min-height: calc(100vh - 120px); padding: 24px; }
.auth-card {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 40px; width: 100%; max-width: 420px;
}
.auth-card h1 { font-size: 1.5rem; font-weight: 700; margin-bottom: 16px; text-align: center; }
.auth-logo {
  display: block;
  margin: 0 auto 20px;
  width: 160px !important;
  height: 160px !important;
  max-width: 160px;
  object-fit: contain;
  border-radius: 14px;
}

/* Bannière logo en bas de l'accueil */
.home-brand {
  display: flex;
  justify-content: center;
  padding: 40px 24px 24px;
}
.home-brand-logo {
  width: 100%;
  max-width: 260px;
  height: auto;
  opacity: 0.85;
  border-radius: 16px;
  transition: opacity 0.2s;
}
.home-brand-logo:hover { opacity: 1; }
.form-group { margin-bottom: 20px; }
.form-group label { display: block; font-size: 0.85rem; color: var(--text-muted); margin-bottom: 6px; }
.form-group input, .form-control {
  width: 100%; padding: 10px 14px;
  border-radius: var(--radius-sm); border: 1px solid var(--border);
  background: var(--bg-input); color: var(--text); outline: none;
  transition: var(--transition);
}
.form-group input:focus, .form-control:focus { border-color: var(--primary); }
.form-error { font-size: 0.8rem; color: var(--danger); margin-top: 4px; }
.form-success { font-size: 0.95rem; color: #16a34a; background: #f0fdf4; border: 1px solid #bbf7d0; border-radius: 8px; padding: 12px 16px; margin-top: 8px; }
.auth-divider { display: flex; align-items: center; gap: 12px; margin: 20px 0; color: #9ca3af; font-size: 0.85rem; }
.auth-divider::before, .auth-divider::after { content: ''; flex: 1; height: 1px; background: #e5e7eb; }
.auth-link { text-align: center; margin-top: 20px; font-size: 0.85rem; color: var(--text-muted); }
.auth-link a { color: var(--primary); }

/* SSO buttons */
.sso-buttons { display: flex; flex-direction: column; gap: 12px; margin-bottom: 8px; }
.btn-sso {
  display: flex; align-items: center; justify-content: center; gap: 12px;
  padding: 12px 20px; border-radius: var(--radius-sm); border: 1px solid var(--border);
  font-size: 0.95rem; font-weight: 500; text-decoration: none;
  transition: var(--transition); cursor: pointer;
}
.btn-google { background: #fff; color: #3c4043; }
.btn-google:hover { background: #f8f9fa; border-color: #dadce0; box-shadow: 0 1px 3px rgba(0,0,0,.2); }
.btn-microsoft { background: #2f2f2f; color: #fff; border-color: #444; }
.btn-microsoft:hover { background: #3a3a3a; border-color: #555; }
.sso-hint { text-align: center; font-size: 0.78rem; color: var(--text-muted); margin: 4px 0 0; }

/* Admin login collapsible */
.admin-login summary {
  cursor: pointer; font-size: 0.78rem; font-weight: 500;
  color: var(--text-muted); text-align: center; list-style: none;
  display: inline-block;
  padding: 5px 16px;
  border: 1px solid var(--border);
  border-radius: 20px;
  background: transparent;
  transition: var(--transition);
  margin: 0 auto;
  width: fit-content;
}
.admin-login { text-align: center; }
.admin-login summary:hover { color: var(--text); border-color: var(--text-muted); background: rgba(255,255,255,0.04); }
.admin-login summary::-webkit-details-marker { display: none; }

/* ===== DASHBOARD ===== */
.dashboard { max-width: 1000px; margin: 0 auto; padding: 40px; }
.dashboard h1 { font-size: 1.8rem; font-weight: 700; margin-bottom: 32px; }
.dashboard-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 20px; }
.dash-card { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); padding: 28px; }
.dash-card h3 { font-size: 1rem; font-weight: 700; margin-bottom: 16px; }
.dash-card p { font-size: 0.88rem; color: var(--text-muted); margin-bottom: 8px; }
.badge-green { background: rgba(16,185,129,0.15); border: 1px solid rgba(16,185,129,0.3); color: var(--success); padding: 2px 8px; border-radius: 4px; font-size: 0.8rem; }
.badge-red { background: rgba(239,68,68,0.15); border: 1px solid rgba(239,68,68,0.3); color: var(--danger); padding: 2px 8px; border-radius: 4px; font-size: 0.8rem; }
.progress-pct { font-size: 0.78rem; color: var(--text-faint); margin-top: 4px; }

/* ===== SEARCH PAGE ===== */
.search-page { max-width: 800px; margin: 0 auto; padding: 40px; }
.search-page h1 { font-size: 1.5rem; margin-bottom: 24px; }
.search-form { display: flex; gap: 10px; margin-bottom: 24px; }
.search-input { flex: 1; padding: 10px 16px; border-radius: var(--radius-sm); border: 1px solid var(--border); background: var(--bg-card); color: var(--text); outline: none; }
.search-input:focus { border-color: var(--primary); }
.search-meta { color: var(--text-muted); font-size: 0.85rem; margin-bottom: 16px; }
.search-results { list-style: none; display: flex; flex-direction: column; gap: 12px; }
.search-results li { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 16px; transition: var(--transition); }
.search-results li:hover { border-color: var(--primary); }
.excerpt { font-size: 0.82rem; color: var(--text-faint); margin-top: 6px; }

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
  .navbar { padding: 0 16px; }
  .sidebar { display: none; }
  .sidebar-toggle { display: none; }
  .messages { padding: 0 16px; }
  .chat-layout { padding: 16px; }
  .dashboard { padding: 20px 16px; }
  .chapters-grid { padding: 20px 16px; }
  .hero { padding: 40px 20px; }
}

/* ============================================================ */
/* ===== READER PRO FEATURES (breadcrumb, TOC, focus, etc) ===== */
/* ============================================================ */

/* Breadcrumb */
.chapter-breadcrumb {
  font-size: 0.74rem;
  color: var(--text-faint);
  margin: 0 0 14px 0;
  display: flex; align-items: center; gap: 8px;
  letter-spacing: 0.02em;
}
.chapter-breadcrumb a {
  color: var(--text-faint);
  text-decoration: none;
  transition: color 0.15s;
}
.chapter-breadcrumb a:hover { color: var(--chapter-c, var(--primary)); }
.bc-sep { color: var(--text-faint); opacity: 0.4; }
.bc-current { color: var(--text-muted); font-weight: 600; }
.bc-section { color: var(--chapter-c, var(--primary)); font-weight: 500; }

/* Bouton Focus */
.focus-toggle {
  position: absolute;
  top: 16px; right: 16px;
  width: 32px; height: 32px;
  display: flex; align-items: center; justify-content: center;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 8px;
  color: var(--text-faint);
  cursor: pointer;
  transition: all 0.18s ease;
  z-index: 5;
}
.focus-toggle:hover {
  color: var(--chapter-c, var(--primary));
  border-color: var(--chapter-c, var(--primary));
  background: rgba(255,255,255,0.06);
}
.chapter-content { position: relative; }

/* Mode Focus actif : masque sidebar + TOC + bannière ; centre la lecture */
body.focus-mode .sidebar,
body.focus-mode .sidebar-toggle,
body.focus-mode .chapter-toc,
body.focus-mode .navbar { display: none !important; }
body.focus-mode .chapter-content {
  max-width: 740px !important;
  margin: 0 auto !important;
  padding: 60px 30px !important;
}
body.focus-mode .reader-layout { padding: 0; }
body.focus-mode .focus-toggle {
  position: fixed;
  top: 12px; right: 12px;
  background: rgba(0,0,0,0.6);
  backdrop-filter: blur(8px);
}

/* Mini-progression chapitre */
.chapter-section-progress {
  display: flex; align-items: center; gap: 12px;
  margin-bottom: 24px;
  padding: 10px 14px;
  background: rgba(255,255,255,0.02);
  border: 1px solid rgba(255,255,255,0.05);
  border-radius: 10px;
}
.chapter-section-progress-bar {
  flex: 1;
  height: 4px;
  background: rgba(255,255,255,0.06);
  border-radius: 4px;
  overflow: hidden;
}
.chapter-section-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--chapter-c, var(--primary)), color-mix(in srgb, var(--chapter-c, var(--primary)) 60%, white));
  box-shadow: 0 0 8px var(--chapter-c, var(--primary));
  border-radius: 4px;
  transition: width 0.5s cubic-bezier(0.4,0,0.2,1);
}
.chapter-section-progress-label {
  font-size: 0.7rem;
  color: var(--text-faint);
  letter-spacing: 0.04em;
  white-space: nowrap;
}

/* Section vue (check) */
.chapter-section.is-seen > h2::before {
  content: '✓';
  display: inline-flex;
  align-items: center; justify-content: center;
  width: 22px; height: 22px;
  margin-right: 10px;
  background: rgba(16,185,129,0.15);
  color: var(--success);
  border-radius: 50%;
  font-size: 0.75rem;
  vertical-align: middle;
  border: 1px solid rgba(16,185,129,0.4);
}

/* Carte de transition entre sections */
.section-transition {
  display: flex; align-items: center; gap: 16px;
  margin: 36px 0 8px;
  padding: 14px 18px;
  background: linear-gradient(135deg, rgba(255,255,255,0.03), rgba(255,255,255,0.01));
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 14px;
  text-decoration: none;
  color: var(--text-muted);
  transition: all 0.2s ease;
  position: relative;
  overflow: hidden;
}
.section-transition::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, var(--chapter-c, var(--primary)) 50%, transparent);
  opacity: 0;
  transition: opacity 0.3s;
  pointer-events: none;
}
.section-transition:hover {
  border-color: var(--chapter-c, var(--primary));
  background: linear-gradient(135deg, var(--chapter-cs, rgba(255,255,255,0.04)), rgba(255,255,255,0.01));
  transform: translateX(2px);
}
.section-transition:hover::before { opacity: 0.06; }
.section-transition-status {
  flex-shrink: 0;
  font-size: 0.72rem;
  color: var(--success);
  background: rgba(16,185,129,0.1);
  border: 1px solid rgba(16,185,129,0.25);
  padding: 4px 10px;
  border-radius: 999px;
  font-weight: 600;
}
.section-transition-next {
  flex: 1;
  display: flex; flex-direction: column;
  gap: 2px;
}
.section-transition-label {
  font-size: 0.65rem;
  color: var(--text-faint);
  text-transform: uppercase;
  letter-spacing: 0.16em;
}
.section-transition-title {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text);
}
.section-transition-arrow {
  flex-shrink: 0;
  font-size: 1.3rem;
  color: var(--chapter-c, var(--primary));
  transition: transform 0.2s ease;
}
.section-transition:hover .section-transition-arrow { transform: translateX(4px); }

/* Mini-TOC (scroll-spy) */
.chapter-toc {
  position: sticky;
  top: 80px;
  align-self: flex-start;
  width: 220px;
  flex-shrink: 0;
  padding: 18px 14px 14px;
  margin: 24px 24px 24px 0;
  font-size: 0.78rem;
  border-left: 1px solid rgba(255,255,255,0.05);
  max-height: calc(100vh - 100px);
  overflow-y: auto;
}
.chapter-toc::-webkit-scrollbar { width: 2px; }
.chapter-toc::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.08); }
.chapter-toc-label {
  display: block;
  font-size: 0.6rem;
  font-weight: 700;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--text-faint);
  margin-bottom: 12px;
  padding-left: 12px;
}
.chapter-toc-list { list-style: none; padding: 0; margin: 0; }
.chapter-toc-list a {
  display: flex; align-items: center; gap: 10px;
  padding: 6px 12px;
  color: var(--text-faint);
  text-decoration: none;
  border-radius: 6px;
  font-size: 0.74rem;
  line-height: 1.4;
  transition: all 0.15s ease;
  position: relative;
}
.toc-marker {
  flex-shrink: 0;
  width: 5px; height: 5px;
  border-radius: 50%;
  background: rgba(255,255,255,0.12);
  transition: all 0.2s ease;
}
.chapter-toc-list a:hover { color: var(--text-muted); }
.chapter-toc-list a:hover .toc-marker { background: var(--text-faint); }
.chapter-toc-list a.is-active {
  color: var(--chapter-c, var(--primary));
  background: var(--chapter-cs, rgba(242,201,76,0.05));
}
.chapter-toc-list a.is-active .toc-marker {
  background: var(--chapter-c, var(--primary));
  box-shadow: 0 0 8px var(--chapter-c, var(--primary));
  transform: scale(1.4);
}
.chapter-toc-list a.is-seen .toc-marker {
  background: var(--success);
}

/* Lightbox */
#lightbox {
  position: fixed; inset: 0;
  background: rgba(3, 7, 18, 0.94);
  backdrop-filter: blur(8px);
  z-index: 9999;
  display: flex; align-items: center; justify-content: center;
  flex-direction: column;
  padding: 40px;
  animation: lb-fade 0.2s ease;
}
.lightbox-hidden { display: none !important; }
@keyframes lb-fade { from { opacity: 0; } to { opacity: 1; } }
#lightbox-img {
  max-width: 100%;
  max-height: calc(100% - 40px);
  border-radius: 8px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.6);
}
.lightbox-caption {
  margin-top: 14px;
  color: var(--text-muted);
  font-size: 0.85rem;
  text-align: center;
  max-width: 600px;
}
.lightbox-close {
  position: absolute;
  top: 20px; right: 20px;
  width: 44px; height: 44px;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.1);
  color: white;
  border-radius: 50%;
  font-size: 1.6rem;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  line-height: 1;
}
.lightbox-close:hover { background: rgba(255,255,255,0.12); }

img.zoomable {
  cursor: zoom-in;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
img.zoomable:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0,0,0,0.3);
}

/* Bouton copier sur les blocs de code */
pre.dax-code, pre.showcase-code { position: relative; }
.copy-btn {
  position: absolute;
  top: 8px; right: 8px;
  width: 28px; height: 28px;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 6px;
  color: var(--text-faint);
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  opacity: 0; transition: opacity 0.18s, all 0.18s;
  font-size: 0.85rem;
}
pre:hover .copy-btn { opacity: 1; }
.copy-btn:hover {
  color: var(--text);
  background: rgba(255,255,255,0.1);
  border-color: rgba(255,255,255,0.18);
}
.copy-btn.copied {
  color: var(--success);
  border-color: rgba(16,185,129,0.4);
  background: rgba(16,185,129,0.12);
}

/* Glossaire — termes interactifs */
.gloss {
  border-bottom: 1px dotted var(--chapter-c, var(--primary));
  cursor: help;
  position: relative;
  color: inherit;
}
.gloss:hover { color: var(--chapter-c, var(--primary)); }
.gloss::after {
  content: attr(data-tip);
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%) translateY(4px);
  background: #0F172A;
  border: 1px solid rgba(255,255,255,0.12);
  color: var(--text);
  font-size: 0.78rem;
  font-weight: 400;
  line-height: 1.5;
  padding: 8px 12px;
  border-radius: 8px;
  width: max-content;
  max-width: 280px;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.18s, transform 0.18s;
  z-index: 100;
  box-shadow: 0 8px 28px rgba(0,0,0,0.4);
  white-space: normal;
  text-align: left;
}
.gloss:hover::after {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* Toast badge débloqué */
.badge-toast {
  position: fixed;
  bottom: 30px; right: 30px;
  background: linear-gradient(135deg, #0F172A, #0A0F1F);
  border: 1px solid rgba(242,201,76,0.4);
  border-radius: 12px;
  padding: 14px 18px;
  display: flex; align-items: center; gap: 14px;
  color: var(--text);
  box-shadow: 0 12px 40px rgba(0,0,0,0.5), 0 0 24px rgba(242,201,76,0.15);
  transform: translateY(120%);
  opacity: 0;
  transition: all 0.4s cubic-bezier(0.4,0,0.2,1);
  z-index: 9999;
}
.badge-toast.show {
  transform: translateY(0);
  opacity: 1;
}
.badge-toast-icon { font-size: 1.6rem; }
.badge-toast strong { font-size: 0.92rem; color: var(--primary); }
.badge-toast-sub { font-size: 0.74rem; color: var(--text-muted); margin-top: 2px; }

/* ===== HOME : RESUME + GAMIFICATION BAND ===== */
.journey-resume-band {
  max-width: 1100px;
  margin: 0 auto 40px;
  padding: 0 24px;
  display: grid;
  grid-template-columns: 1.2fr 2fr;
  gap: 16px;
}
@media (max-width: 800px) {
  .journey-resume-band { grid-template-columns: 1fr; }
}

.resume-card {
  --c: #22D3EE;
  display: flex; align-items: center; gap: 16px;
  padding: 18px 22px;
  background: linear-gradient(135deg, rgba(255,255,255,0.04), rgba(255,255,255,0.01));
  border: 1px solid rgba(255,255,255,0.08);
  border-left: 3px solid var(--c);
  border-radius: 14px;
  text-decoration: none;
  color: var(--text);
  transition: all 0.2s ease;
}
.resume-card:hover {
  background: linear-gradient(135deg, rgba(255,255,255,0.07), rgba(255,255,255,0.02));
  transform: translateX(2px);
  box-shadow: 0 8px 24px color-mix(in srgb, var(--c) 18%, transparent);
}
.resume-icon {
  flex-shrink: 0;
  width: 38px; height: 38px;
  display: flex; align-items: center; justify-content: center;
  background: var(--c);
  color: #07101F;
  border-radius: 50%;
  font-size: 0.9rem;
  font-weight: 800;
  box-shadow: 0 0 16px var(--c);
}
.resume-text { flex: 1; display: flex; flex-direction: column; gap: 4px; }
.resume-label {
  font-size: 0.66rem;
  color: var(--text-faint);
  letter-spacing: 0.18em;
  text-transform: uppercase;
}
.resume-title {
  font-size: 0.94rem;
  font-weight: 600;
  color: var(--text);
}
.resume-sep { color: var(--text-faint); margin: 0 4px; }
.resume-arrow {
  font-size: 1.4rem;
  color: var(--c);
  transition: transform 0.2s;
}
.resume-card:hover .resume-arrow { transform: translateX(4px); }

.gamification-card {
  padding: 18px 22px;
  background: linear-gradient(135deg, rgba(255,255,255,0.03), rgba(255,255,255,0.01));
  border: 1px solid rgba(255,255,255,0.07);
  border-radius: 14px;
}
.gam-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 18px;
  align-items: end;
}
@media (max-width: 700px) {
  .gam-row { grid-template-columns: repeat(2, 1fr); }
}
.gam-col { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.gam-col--badges { grid-column: span 1; }
@media (min-width: 701px) {
  .gam-col--badges { grid-column: span 1; }
}
.gam-label {
  font-size: 0.6rem;
  color: var(--text-faint);
  text-transform: uppercase;
  letter-spacing: 0.16em;
}
.gam-value {
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--text);
  line-height: 1;
}
.gam-unit {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-faint);
  margin-left: 2px;
}
.gam-bar {
  height: 4px;
  background: rgba(255,255,255,0.05);
  border-radius: 2px;
  margin-top: 6px;
  overflow: hidden;
}
.gam-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--primary), #F97316);
  border-radius: 2px;
  box-shadow: 0 0 8px var(--primary);
  transition: width 0.6s cubic-bezier(0.4,0,0.2,1);
}
.gam-badges {
  display: flex; flex-wrap: wrap; gap: 6px;
  margin-top: 4px;
}
.gam-badge {
  --c: rgba(255,255,255,0.1);
  font-size: 0.7rem;
  font-weight: 700;
  padding: 4px 8px;
  border-radius: 6px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  color: var(--text-faint);
}
.gam-badge--earned {
  background: color-mix(in srgb, var(--c) 12%, transparent);
  border-color: var(--c);
  color: var(--c);
  box-shadow: 0 0 12px color-mix(in srgb, var(--c) 25%, transparent);
}

/* ===== HOME : Puzzle card progress mini-bar ===== */
.puzzle-card-progress {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid rgba(255,255,255,0.05);
  display: flex; align-items: center; gap: 10px;
}
.puzzle-card-progress-bar {
  flex: 1;
  height: 3px;
  background: rgba(255,255,255,0.06);
  border-radius: 3px;
  overflow: hidden;
}
.puzzle-card-progress-fill {
  height: 100%;
  background: var(--accent);
  box-shadow: 0 0 6px var(--accent);
  border-radius: 3px;
  transition: width 0.5s ease;
}
.puzzle-card-progress-label {
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--accent);
  letter-spacing: 0.04em;
  white-space: nowrap;
}

/* ===== Layout override pour TOC à droite ===== */
.reader-layout > .chapter-content {
  flex: 1;
  min-width: 0;
  max-width: none;
  margin: 0;
  padding: 40px max(28px, calc((100% - 220px - 860px) / 2)) 40px max(40px, calc((100% - 220px - 860px) / 2));
}
@media (max-width: 1100px) {
  .chapter-toc { display: none; }
  .reader-layout > .chapter-content {
    padding: 40px max(24px, calc((100% - 860px) / 2));
  }
}

/* ===== Zoom wrap : indicateur clair que l'image (GIF) est cliquable ===== */
.zoom-wrap {
  position: relative;
  display: inline-block;
  cursor: zoom-in;
  border-radius: 10px;
  overflow: hidden;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  isolation: isolate;
}
.zoom-wrap > img {
  display: block;
  width: 100%;
  height: auto;
  transition: transform 0.3s ease, filter 0.2s ease;
}

.zoom-wrap:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 30px rgba(0,0,0,0.45), 0 0 0 1px rgba(242,201,76,0.35);
}
.zoom-wrap:hover > img { transform: scale(1.02); filter: brightness(1.05); }

/* Badge loupe permanent */
.zoom-wrap::after {
  content: '🔍';
  position: absolute;
  top: 10px;
  right: 10px;
  width: 30px; height: 30px;
  display: flex; align-items: center; justify-content: center;
  background: rgba(15,23,42,0.78);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 50%;
  font-size: 0.85rem;
  z-index: 2;
  pointer-events: none;
  transition: all 0.2s ease;
  box-shadow: 0 2px 10px rgba(0,0,0,0.3);
}
.zoom-wrap:hover::after {
  background: var(--primary);
  border-color: var(--primary);
  transform: scale(1.1) rotate(-8deg);
}

/* ===== V3 QUEST MODE — nouvelles classes ===== */

/* Pills XP + Streak dans la navbar */
.nav-xp-pill {
  display: flex;
  align-items: center;
  gap: 5px;
  background: rgba(167, 139, 250, 0.1);
  border: 1px solid rgba(167, 139, 250, 0.25);
  border-radius: 20px;
  padding: 4px 12px;
  font-size: 11px;
  font-weight: 700;
  color: var(--xp-color);
  white-space: nowrap;
}

.nav-streak-pill {
  display: flex;
  align-items: center;
  gap: 5px;
  background: rgba(249, 115, 22, 0.1);
  border: 1px solid rgba(249, 115, 22, 0.25);
  border-radius: 20px;
  padding: 4px 12px;
  font-size: 11px;
  font-weight: 700;
  color: var(--streak-color);
  white-space: nowrap;
}

/* Barre XP niveau */
.xp-level-block { display: flex; flex-direction: column; gap: 5px; }

.xp-level-header {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
}
.xp-level-title { font-weight: 700; color: var(--text); }
.xp-count       { color: var(--xp-color); font-weight: 700; }

.xp-bar {
  height: 8px;
  background: var(--surface-2, #1e1c2e);
  border-radius: 999px;
  overflow: hidden;
  box-shadow: 0 0 10px var(--xp-glow);
}
.xp-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, #818cf8, #a78bfa);
  border-radius: 999px;
  box-shadow: 0 0 6px rgba(167, 139, 250, 0.6);
  transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}
.xp-hint { font-size: 10px; color: var(--text-muted); }

/* Sidebar Quest Mode — surcharges */
.npg-link {
  transition: background var(--transition), color var(--transition);
  border-radius: 8px;
}
.npg.is-active .npg-link {
  background: rgba(129, 140, 248, 0.1);
  border-left: 2px solid var(--accent);
}
.npg.is-done .npg-dot::after {
  background: var(--success);
  box-shadow: 0 0 6px rgba(34, 201, 122, 0.5);
}
.npg.is-active .npg-dot::after {
  background: var(--accent);
  box-shadow: 0 0 8px var(--xp-glow);
}
.npg.is-done .npg-title::after {
  content: ' +100XP';
  font-size: 9px;
  color: var(--xp-color);
  font-weight: 700;
  opacity: 0.8;
}
.nps-item.is-seen .nps-link { color: var(--success); }
.nps-item.is-seen .nps-check { color: var(--success); }

/* Carte quest-transition */
.quest-transition {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 36px 0 8px;
  background: linear-gradient(135deg,
    rgba(34, 201, 122, 0.12),
    rgba(34, 201, 122, 0.05));
  border: 1px solid rgba(34, 201, 122, 0.4);
  border-radius: 12px;
  padding: 14px 18px;
  text-decoration: none;
  color: inherit;
  transition: transform 0.2s, box-shadow 0.2s;
}
.quest-transition:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(34, 201, 122, 0.2);
}
.qt-check {
  width: 36px; height: 36px; border-radius: 50%;
  background: rgba(34, 201, 122, 0.15);
  border: 2px solid #22c97a;
  display: grid; place-items: center;
  font-size: 16px; flex-shrink: 0;
  color: var(--success);
}
.qt-body { flex: 1; }
.qt-status { font-weight: 800; font-size: 12px; color: var(--success); }
.qt-next   { font-size: 11px; margin-top: 2px; color: var(--text-muted); }
.qt-xp {
  margin-left: auto;
  text-align: center;
  background: rgba(167, 139, 250, 0.12);
  border-radius: 8px;
  padding: 8px 14px;
  border: 1px solid rgba(167, 139, 250, 0.25);
  flex-shrink: 0;
}
.qt-xp-num   { font-size: 20px; font-weight: 900; color: var(--xp-color); }
.qt-xp-label { font-size: 8px; text-transform: uppercase; letter-spacing: .1em; color: var(--text-muted); }
