/* ═══════════════════════════════════════════════════════════════
   CLAUDE VERSE APP — Styles complets
   Mobile-first · RPG/Grimoire theme · Hatsu Codex DA
   ═══════════════════════════════════════════════════════════════ */

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

/* Background universel — assure le fond sombre sur tous les écrans */
html, body {
  background: #08070F;
  color: #F2EBDA;
  font-family: 'Inter', sans-serif;
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}
img, svg { display: block; max-width: 100%; }
button, input, select, textarea { font-family: inherit; }
a { color: inherit; text-decoration: none; }
ul, ol { list-style: none; }

/* ── BASE ───────────────────────────────────────────────────── */
.app-body {
  background: var(--bg);
  color: var(--cv-parchment);
  font-family: var(--font-body);
  font-size: var(--text-base);
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
  /* Prevents content from going under iOS status bar */
  padding-env: env(safe-area-inset-top) env(safe-area-inset-right) 0 env(safe-area-inset-left);
}

/* Simulated iOS status bar spacer */
.status-bar {
  height: var(--status-bar-h);
  background: var(--bg);
  position: relative;
  z-index: var(--z-nav);
}

/* Pseudo status bar content (time + icons) */
.status-bar::after {
  content: '9:41';
  position: absolute;
  top: 14px;
  left: 50%;
  transform: translateX(-50%);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--cv-parchment);
  letter-spacing: 0.06em;
}

/* ── SCREEN LAYOUTS ─────────────────────────────────────────── */
.screen {
  max-width: var(--app-max-width);
  margin: 0 auto;
  min-height: calc(100vh - var(--status-bar-h) - var(--bottom-nav-h));
  padding: 0 0 var(--space-8);
  position: relative;
}

.screen-full {
  max-width: var(--app-max-width);
  margin: 0 auto;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  position: relative;
}

.screen-no-nav {
  padding-bottom: 0;
}

.screen-pad {
  padding-left: var(--space-6);
  padding-right: var(--space-6);
}

/* ── CONTAINER ──────────────────────────────────────────────── */
.container {
  max-width: var(--app-max-width);
  margin: 0 auto;
  padding: 0 var(--space-6);
}

/* ── BOTTOM NAVIGATION ──────────────────────────────────────── */
.bottom-nav {
  position: fixed;
  bottom: 0;
  /* Centrage correct d'un élément fixed avec max-width */
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: var(--app-max-width);
  /* Hauteur = barre + safe-area iOS, intégrée dans la box */
  height: calc(var(--bottom-nav-h) + env(safe-area-inset-bottom, 0px));
  /* Fond TOTALEMENT opaque (ne dépend pas de backdrop-filter sur mobile) */
  background: #0C0A1A;
  border-top: 1px solid rgba(255, 255, 255, 0.10);
  display: flex;
  align-items: stretch;
  justify-content: space-around;
  z-index: var(--z-nav);
  padding-bottom: env(safe-area-inset-bottom, 0px);
  /* Ombre vers le haut pour bien détacher la barre du contenu */
  box-shadow: 0 -10px 30px rgba(0, 0, 0, 0.55);
}

@media (min-width: 431px) {
  .bottom-nav {
    border-left: 1px solid var(--border-subtle);
    border-right: 1px solid var(--border-subtle);
  }
}

.nav-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--space-1);
  cursor: pointer;
  padding: var(--space-2) 0;
  position: relative;
  border: none;
  background: none;
  transition: color var(--ease-base);
  color: var(--cv-ash-light);
}

.nav-item.active {
  color: var(--gold);
}

.nav-item.active::before {
  content: '';
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 20px;
  height: 2px;
  background: var(--gold);
  border-radius: 0 0 var(--radius-sm) var(--radius-sm);
}

.nav-icon {
  font-size: 1.25rem;
  line-height: 1;
  transition: transform var(--ease-bounce);
}

.nav-item.active .nav-icon {
  transform: translateY(-1px);
}

.nav-label {
  font-family: var(--font-mono);
  font-size: 0.5rem;
  letter-spacing: var(--tracking-label);
  text-transform: uppercase;
}

/* ── APP HEADER ─────────────────────────────────────────────── */
.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-4) var(--space-6);
  position: relative;
}

.header-logo img {
  height: 36px;
  width: auto;
  opacity: 0.85;
}

.header-back {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  letter-spacing: var(--tracking-label);
  text-transform: uppercase;
  color: var(--cv-ash-light);
  background: none;
  border: none;
  cursor: pointer;
  padding: var(--space-2);
  transition: color var(--ease-base);
}

.header-back:hover { color: var(--cv-parchment); }

.header-title {
  font-family: var(--font-display);
  font-size: var(--text-sm);
  font-weight: 600;
  letter-spacing: var(--tracking-display);
  color: var(--cv-parchment);
  text-transform: uppercase;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

/* ── AVATAR ─────────────────────────────────────────────────── */
.avatar {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-full);
  background: linear-gradient(135deg, var(--purple), var(--purple-dim));
  border: 1.5px solid var(--border-default);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-size: var(--text-sm);
  font-weight: 700;
  color: var(--cv-parchment);
  flex-shrink: 0;
}

.avatar-lg {
  width: 72px;
  height: 72px;
  font-size: var(--text-xl);
}

/* ── RANG BADGES ────────────────────────────────────────────── */
.rang-badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  padding: 3px var(--space-3);
  border-radius: var(--radius-full);
  font-family: var(--font-mono);
  font-size: var(--text-2xs);
  font-weight: 600;
  letter-spacing: var(--tracking-label);
  text-transform: uppercase;
  border: 1px solid;
}

.rang-badge.rang-e { color: var(--rang-e); border-color: var(--rang-e); background: rgba(90,90,112,0.15); }
.rang-badge.rang-d { color: var(--rang-d); border-color: var(--rang-d); background: rgba(75,137,220,0.12); }
.rang-badge.rang-c { color: var(--rang-c); border-color: var(--rang-c); background: rgba(124,58,237,0.15); }
.rang-badge.rang-b { color: var(--rang-b); border-color: var(--rang-b); background: rgba(0,229,255,0.10); }
.rang-badge.rang-a { color: var(--rang-a); border-color: var(--rang-a); background: rgba(255,176,32,0.12); }
.rang-badge.rang-s { color: var(--rang-s); border-color: var(--rang-s); background: rgba(255,176,32,0.15); box-shadow: var(--shadow-glow-gold); }

/* ── RANG RINGS ─────────────────────────────────────────────── */
.rang-ring {
  width: 64px;
  height: 64px;
  border-radius: var(--radius-full);
  border: 2.5px solid;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-size: var(--text-xl);
  font-weight: 700;
  flex-shrink: 0;
  position: relative;
}

.rang-ring.rang-e { color: var(--rang-e); border-color: var(--rang-e); }
.rang-ring.rang-d { color: var(--rang-d); border-color: var(--rang-d); }
.rang-ring.rang-c { color: var(--rang-c); border-color: var(--rang-c); }
.rang-ring.rang-b { color: var(--rang-b); border-color: var(--rang-b); }
.rang-ring.rang-a { color: var(--rang-a); border-color: var(--rang-a); }
.rang-ring.rang-s {
  color: var(--rang-s);
  border-color: var(--rang-s);
  box-shadow: var(--shadow-glow-gold), inset 0 0 20px rgba(255,176,32,0.1);
  animation: goldPulse 2.5s ease-in-out infinite;
}

.rang-ring-lg {
  width: 100px;
  height: 100px;
  font-size: 2.25rem;
  border-width: 3px;
}

@keyframes goldPulse {
  0%, 100% { box-shadow: var(--shadow-glow-gold); }
  50%       { box-shadow: 0 0 40px rgba(255,176,32,0.6); }
}

/* ── CARDS ──────────────────────────────────────────────────── */
.card {
  background: var(--surface-1);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: var(--space-5);
  position: relative;
  overflow: hidden;
}

.card-lg {
  padding: var(--space-6);
  border-radius: var(--radius-lg);
}

.card-elevated {
  background: var(--surface-2);
  border-color: var(--border-default);
}

.card-gold {
  background: var(--surface-2);
  border-color: var(--border-gold);
}

.card-active {
  background: var(--surface-2);
  border-color: var(--border-active);
  box-shadow: 0 0 16px rgba(0, 229, 255, 0.12);
}

/* Gradient glow card */
.card-glow-purple::before {
  content: '';
  position: absolute;
  top: -40px; left: 50%;
  transform: translateX(-50%);
  width: 200px; height: 200px;
  background: radial-gradient(circle, rgba(124,58,237,0.2) 0%, transparent 65%);
  pointer-events: none;
}

.card-glow-gold::before {
  content: '';
  position: absolute;
  top: -40px; left: 50%;
  transform: translateX(-50%);
  width: 200px; height: 200px;
  background: radial-gradient(circle, rgba(255,176,32,0.15) 0%, transparent 65%);
  pointer-events: none;
}

/* ── PROGRESS BARS ──────────────────────────────────────────── */
.progress-track {
  height: 4px;
  background: rgba(58, 58, 69, 0.6);
  border-radius: var(--radius-full);
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--gold), var(--gold-bright));
  border-radius: var(--radius-full);
  transition: width 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.progress-fill.cyan {
  background: linear-gradient(90deg, var(--cyan-dim), var(--cyan));
}

.progress-fill.purple {
  background: linear-gradient(90deg, var(--purple), #9B5CF6);
}

.progress-track-lg {
  height: 8px;
  border-radius: var(--radius-full);
  background: rgba(58, 58, 69, 0.5);
  overflow: hidden;
}

/* XP label */
.xp-label {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--gold);
  letter-spacing: var(--tracking-label);
}

.xp-label-cyan {
  color: var(--cyan);
}

/* ── BUTTONS ────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  border: none;
  border-radius: var(--radius-full);
  cursor: pointer;
  font-family: var(--font-display);
  font-weight: 600;
  letter-spacing: var(--tracking-display);
  text-transform: uppercase;
  transition: all var(--ease-base);
  text-decoration: none;
  white-space: nowrap;
  position: relative;
  overflow: hidden;
}

.btn-full { width: 100%; }

.btn-lg {
  height: 54px;
  font-size: var(--text-sm);
  padding: 0 var(--space-8);
}

.btn-md {
  height: 44px;
  font-size: var(--text-xs);
  padding: 0 var(--space-6);
}

.btn-sm {
  height: 36px;
  font-size: var(--text-2xs);
  letter-spacing: var(--tracking-mono);
  padding: 0 var(--space-4);
}

/* Primary — gold gradient */
.btn-primary {
  background: linear-gradient(135deg, var(--gold), var(--gold-bright));
  color: #080708;
  box-shadow: 0 4px 16px rgba(255, 176, 32, 0.30);
}

.btn-primary:hover {
  box-shadow: 0 6px 24px rgba(255, 176, 32, 0.50);
  transform: translateY(-1px);
}

.btn-primary:active { transform: translateY(0); }

/* Secondary — outline gold */
.btn-secondary {
  background: transparent;
  color: var(--gold);
  border: 1.5px solid var(--gold);
}

.btn-secondary:hover {
  background: rgba(255, 176, 32, 0.08);
}

/* Ghost cyan */
.btn-ghost {
  background: transparent;
  color: var(--cyan);
  border: 1.5px solid rgba(0, 229, 255, 0.35);
}

.btn-ghost:hover {
  background: rgba(0, 229, 255, 0.06);
  border-color: var(--cyan);
}

/* Dark — surface button */
.btn-dark {
  background: var(--surface-2);
  color: var(--cv-parchment);
  border: 1px solid var(--border-default);
}

.btn-dark:hover {
  border-color: var(--border-active);
  color: var(--cyan);
}

/* ── CHAPTER NODES (carte) ──────────────────────────────────── */
.chapter-map {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0;
  padding: var(--space-8) 0;
}

.chapter-node-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
}

.chapter-connector {
  width: 2px;
  height: 48px;
  background: linear-gradient(180deg, var(--border-default), var(--border-subtle));
}

.chapter-connector.done {
  background: linear-gradient(180deg, var(--gold), var(--gold-dim));
}

.chapter-node {
  width: 72px;
  height: 72px;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-size: 1.375rem;
  font-weight: 700;
  position: relative;
  cursor: pointer;
  transition: transform var(--ease-bounce);
}

.chapter-node:hover { transform: scale(1.08); }

.chapter-node.done {
  background: linear-gradient(135deg, var(--gold), var(--gold-dim));
  color: #080708;
  box-shadow: 0 4px 16px rgba(255, 176, 32, 0.35);
}

.chapter-node.current {
  background: var(--surface-2);
  color: var(--gold);
  border: 2.5px solid var(--gold);
  box-shadow: var(--shadow-glow-gold);
  animation: currentPulse 2.5s ease-in-out infinite;
}

.chapter-node.locked {
  background: var(--surface-1);
  color: var(--cv-ash-grey);
  border: 1.5px solid rgba(58, 58, 69, 0.5);
  cursor: not-allowed;
}

@keyframes currentPulse {
  0%, 100% { box-shadow: var(--shadow-glow-gold); }
  50%       { box-shadow: 0 0 32px rgba(255, 176, 32, 0.6); }
}

.chapter-node-label {
  margin-top: var(--space-2);
  font-family: var(--font-mono);
  font-size: var(--text-2xs);
  letter-spacing: var(--tracking-label);
  text-transform: uppercase;
  color: var(--cv-ash-light);
  text-align: center;
  max-width: 90px;
}

.chapter-node.current + .chapter-node-label { color: var(--gold); }
.chapter-node.done + .chapter-node-label { color: var(--gold-dim); }

/* ── STAT BARS (profil) ─────────────────────────────────────── */
.stat-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.stat-row {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.stat-name {
  font-family: var(--font-mono);
  font-size: var(--text-2xs);
  letter-spacing: var(--tracking-label);
  text-transform: uppercase;
  color: var(--cv-ash-light);
  min-width: 100px;
}

.stat-bar-wrap {
  flex: 1;
  height: 6px;
  background: rgba(58, 58, 69, 0.5);
  border-radius: var(--radius-full);
  overflow: hidden;
}

.stat-bar {
  height: 100%;
  border-radius: var(--radius-full);
  transition: width 1s cubic-bezier(0.4, 0, 0.2, 1);
}

.stat-bar.gold   { background: linear-gradient(90deg, var(--gold-dim), var(--gold)); }
.stat-bar.cyan   { background: linear-gradient(90deg, var(--cyan-dim), var(--cyan)); }
.stat-bar.purple { background: linear-gradient(90deg, var(--purple), #9B5CF6); }
.stat-bar.crimson { background: linear-gradient(90deg, #C02B36, var(--crimson)); }
.stat-bar.green  { background: linear-gradient(90deg, #0D9668, var(--green-ok)); }

.stat-value {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--cv-parchment-muted);
  min-width: 28px;
  text-align: right;
}

/* ── SCEAUX (badges) ────────────────────────────────────────── */
.sceau-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-4);
}

.sceau-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-2);
}

.sceau-ring {
  width: 64px;
  height: 64px;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  position: relative;
}

.sceau-ring.earned {
  background: var(--surface-2);
  border: 1.5px solid var(--border-gold);
  box-shadow: 0 0 12px rgba(255,176,32,0.2);
}

.sceau-ring.earned.cyan {
  border-color: var(--border-active);
  box-shadow: var(--shadow-glow-cyan);
}

.sceau-ring.earned.purple {
  border-color: rgba(124,58,237,0.5);
  box-shadow: var(--shadow-glow-purple);
}

.sceau-ring.locked {
  background: var(--surface-1);
  border: 1.5px solid rgba(58,58,69,0.4);
  filter: grayscale(1) opacity(0.35);
}

.sceau-name {
  font-family: var(--font-mono);
  font-size: 0.5rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--cv-ash-light);
  text-align: center;
  line-height: 1.3;
}

/* ── RANG LADDER (rangs.html) ───────────────────────────────── */
.rang-ladder {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.rang-step {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  padding: var(--space-4) var(--space-5);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
  background: var(--surface-1);
  transition: all var(--ease-base);
  position: relative;
}

.rang-step.current-rang {
  border-color: var(--border-gold);
  background: var(--surface-2);
  box-shadow: 0 4px 20px rgba(255,176,32,0.12);
}

.rang-step.current-rang::after {
  content: 'TON RANG';
  position: absolute;
  top: -10px;
  right: var(--space-4);
  font-family: var(--font-mono);
  font-size: 0.5rem;
  letter-spacing: var(--tracking-mono);
  text-transform: uppercase;
  color: var(--gold);
  background: var(--bg);
  padding: 2px 6px;
  border-radius: var(--radius-full);
  border: 1px solid var(--border-gold);
}

.rang-step.locked-rang {
  opacity: 0.45;
}

.rang-info { flex: 1; }

.rang-title {
  font-family: var(--font-display);
  font-size: var(--text-sm);
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--cv-parchment);
  margin-bottom: 2px;
}

.rang-sub {
  font-size: var(--text-xs);
  color: var(--cv-parchment-muted);
  line-height: 1.5;
}

.rang-xp {
  font-family: var(--font-mono);
  font-size: var(--text-2xs);
  letter-spacing: var(--tracking-label);
  color: var(--cv-ash-light);
}

/* ── LEADERBOARD ────────────────────────────────────────────── */
.podium {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: var(--space-3);
  padding: var(--space-6) 0 var(--space-8);
}

.podium-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-2);
}

.podium-rank {
  font-family: var(--font-display);
  font-size: var(--text-xl);
  font-weight: 700;
}

.podium-rank.gold { color: var(--gold); }
.podium-rank.silver { color: #B0B0C0; }
.podium-rank.bronze { color: #C87D10; }

.podium-platform {
  border-radius: var(--radius-sm) var(--radius-sm) 0 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.p1 .podium-platform { width: 80px; height: 72px; background: linear-gradient(180deg, rgba(255,176,32,0.25), rgba(255,176,32,0.08)); border: 1px solid var(--border-gold); }
.p2 .podium-platform { width: 68px; height: 52px; background: linear-gradient(180deg, rgba(176,176,192,0.2), rgba(176,176,192,0.06)); border: 1px solid rgba(176,176,192,0.3); }
.p3 .podium-platform { width: 68px; height: 40px; background: linear-gradient(180deg, rgba(200,125,16,0.2), rgba(200,125,16,0.06)); border: 1px solid rgba(200,125,16,0.3); }

.leaderboard-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.leaderboard-item {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-md);
  background: var(--surface-1);
  border: 1px solid var(--border-subtle);
}

.leaderboard-item.is-me {
  border-color: var(--border-gold);
  background: var(--surface-2);
}

.lb-position {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--cv-ash-light);
  min-width: 24px;
}

.lb-name {
  flex: 1;
  font-size: var(--text-sm);
  font-weight: 500;
}

.lb-xp {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--gold);
}

/* ── OPTION CARDS (diagnostic) ──────────────────────────────── */
.option-card {
  display: flex;
  align-items: flex-start;
  gap: var(--space-4);
  padding: var(--space-5);
  border-radius: var(--radius-md);
  border: 1.5px solid var(--border-subtle);
  background: var(--surface-1);
  cursor: pointer;
  text-align: left;
  width: 100%;
  transition: all var(--ease-base);
  position: relative;
  overflow: hidden;
}

.option-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(255,176,32,0.06) 0%, transparent 60%);
  opacity: 0;
  transition: opacity var(--ease-base);
}

.option-card:hover {
  border-color: var(--border-gold);
  transform: translateX(4px);
}

.option-card:hover::before { opacity: 1; }

.option-card.selected {
  border-color: var(--gold);
  background: var(--surface-2);
  box-shadow: 0 4px 16px rgba(255,176,32,0.12);
}

.option-card.selected::before { opacity: 1; }

.option-icon {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  background: var(--surface-3);
  border: 1px solid var(--border-default);
  flex-shrink: 0;
}

.option-card.selected .option-icon {
  background: rgba(255,176,32,0.12);
  border-color: rgba(255,176,32,0.4);
}

.option-text-wrap { flex: 1; }

.option-title {
  font-family: var(--font-body);
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--cv-parchment);
  margin-bottom: var(--space-1);
}

.option-sub {
  font-size: var(--text-xs);
  color: var(--cv-parchment-muted);
  line-height: 1.5;
}

/* ── STREAK CALENDAR ────────────────────────────────────────── */
.streak-calendar {
  display: flex;
  gap: var(--space-2);
  justify-content: center;
}

.streak-day {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  font-size: var(--text-2xs);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.streak-day.done {
  background: rgba(255,176,32,0.15);
  border: 1px solid rgba(255,176,32,0.35);
  color: var(--gold);
}

.streak-day.today {
  background: rgba(255,176,32,0.25);
  border: 1.5px solid var(--gold);
  color: var(--gold);
  box-shadow: 0 0 10px rgba(255,176,32,0.3);
}

.streak-day.missed {
  background: rgba(230,57,70,0.1);
  border: 1px solid rgba(230,57,70,0.25);
  color: var(--crimson);
  opacity: 0.6;
}

.streak-day.future {
  background: var(--surface-1);
  border: 1px solid var(--border-subtle);
  color: var(--cv-ash-grey);
}

/* ── TOGGLE SWITCHES ────────────────────────────────────────── */
.toggle-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
}

.toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-4) var(--space-5);
  border-radius: var(--radius-md);
  background: var(--surface-1);
  border: 1px solid var(--border-subtle);
}

.toggle-info { flex: 1; }

.toggle-title {
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--cv-parchment);
}

.toggle-sub {
  font-size: var(--text-xs);
  color: var(--cv-parchment-muted);
  margin-top: 2px;
}

.toggle-switch {
  position: relative;
  width: 44px;
  height: 24px;
  flex-shrink: 0;
}

.toggle-switch input {
  opacity: 0;
  width: 0; height: 0;
  position: absolute;
}

.toggle-track {
  position: absolute;
  inset: 0;
  border-radius: var(--radius-full);
  background: var(--cv-ash-grey);
  cursor: pointer;
  transition: background var(--ease-base);
}

.toggle-track::after {
  content: '';
  position: absolute;
  width: 18px; height: 18px;
  border-radius: var(--radius-full);
  background: white;
  top: 3px; left: 3px;
  transition: transform var(--ease-base);
}

.toggle-switch input:checked + .toggle-track {
  background: var(--cyan);
}

.toggle-switch input:checked + .toggle-track::after {
  transform: translateX(20px);
}

/* ── QUIZ CONTENT (donjon/combat) ───────────────────────────── */
.lesson-content {
  font-size: var(--text-sm);
  color: var(--cv-parchment-muted);
  line-height: 1.8;
}

.lesson-content strong {
  color: var(--cv-parchment);
  font-weight: 600;
}

.lesson-content em {
  color: var(--cyan);
  font-style: normal;
}

.lesson-highlight {
  background: rgba(0, 229, 255, 0.06);
  border-left: 2px solid var(--cyan);
  padding: var(--space-3) var(--space-4);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  margin: var(--space-4) 0;
  font-size: var(--text-sm);
  color: var(--cv-parchment);
  line-height: 1.7;
}

.combat-question {
  font-family: var(--font-display);
  font-size: var(--text-lg);
  font-weight: 600;
  letter-spacing: 0.01em;
  color: var(--cv-parchment);
  line-height: 1.35;
  margin-bottom: var(--space-6);
}

/* ── CHAPTER HERO ───────────────────────────────────────────── */
.chapter-hero {
  text-align: center;
  padding: var(--space-8) var(--space-6);
  position: relative;
}

.chapter-orb {
  width: 96px;
  height: 96px;
  border-radius: var(--radius-full);
  margin: 0 auto var(--space-5);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.5rem;
  background: radial-gradient(circle, rgba(255,176,32,0.15) 0%, rgba(255,176,32,0.04) 60%, transparent 100%);
  border: 1.5px solid rgba(255,176,32,0.3);
  box-shadow: 0 0 32px rgba(255,176,32,0.2);
  animation: orbFloat 4s ease-in-out infinite;
}

.chapter-orb.cyan {
  background: radial-gradient(circle, rgba(0,229,255,0.15) 0%, rgba(0,229,255,0.04) 60%, transparent 100%);
  border-color: rgba(0,229,255,0.3);
  box-shadow: var(--shadow-glow-cyan);
}

.chapter-orb.purple {
  background: radial-gradient(circle, rgba(124,58,237,0.2) 0%, rgba(124,58,237,0.05) 60%, transparent 100%);
  border-color: rgba(124,58,237,0.4);
  box-shadow: var(--shadow-glow-purple);
}

@keyframes orbFloat {
  0%, 100% { transform: translateY(0); }
  50%       { transform: translateY(-8px); }
}

/* ── STATS ROW ──────────────────────────────────────────────── */
.stats-row {
  display: flex;
  gap: var(--space-3);
}

.stat-chip {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-1);
  padding: var(--space-3) var(--space-2);
  background: var(--surface-1);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
}

.stat-chip-value {
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--cv-parchment);
}

.stat-chip-label {
  font-family: var(--font-mono);
  font-size: 0.5rem;
  letter-spacing: var(--tracking-label);
  text-transform: uppercase;
  color: var(--cv-ash-light);
}

/* ── EYEBROW / LABELS ───────────────────────────────────────── */
.eyebrow {
  font-family: var(--font-mono);
  font-size: var(--text-2xs);
  letter-spacing: var(--tracking-mono);
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: var(--space-2);
}

.eyebrow.cyan { color: var(--cyan); }
.eyebrow.purple { color: var(--purple); }

/* ── TYPOGRAPHY UTILITIES ───────────────────────────────────── */
.display-title {
  font-family: var(--font-display);
  font-size: var(--text-2xl);
  font-weight: 700;
  letter-spacing: var(--tracking-display);
  color: var(--cv-parchment);
  line-height: 1.15;
}

.section-title {
  font-family: var(--font-display);
  font-size: var(--text-xl);
  font-weight: 600;
  letter-spacing: var(--tracking-display);
  color: var(--cv-parchment);
  line-height: 1.2;
}

.card-title {
  font-family: var(--font-display);
  font-size: var(--text-base);
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--cv-parchment);
}

.body-text {
  font-size: var(--text-sm);
  color: var(--cv-parchment-muted);
  line-height: 1.7;
}

.mono-label {
  font-family: var(--font-mono);
  font-size: var(--text-2xs);
  letter-spacing: var(--tracking-label);
  text-transform: uppercase;
  color: var(--cv-ash-light);
}

/* ── DIVIDERS ───────────────────────────────────────────────── */
.divider {
  height: 1px;
  background: var(--border-subtle);
  margin: var(--space-5) 0;
}

/* ── NOTIFICATION BADGE ─────────────────────────────────────── */
.notif-dot {
  width: 8px;
  height: 8px;
  border-radius: var(--radius-full);
  background: var(--crimson);
  position: absolute;
  top: 2px;
  right: 2px;
}

/* ── FLOATING BACKGROUNDS ───────────────────────────────────── */
.bg-glow-purple {
  position: fixed;
  width: 300px; height: 300px;
  border-radius: var(--radius-full);
  background: radial-gradient(circle, rgba(124,58,237,0.12) 0%, transparent 65%);
  pointer-events: none;
  z-index: 0;
}

.bg-glow-gold {
  position: fixed;
  width: 250px; height: 250px;
  border-radius: var(--radius-full);
  background: radial-gradient(circle, rgba(255,176,32,0.10) 0%, transparent 65%);
  pointer-events: none;
  z-index: 0;
}

/* ── SCROLL UTILITY ─────────────────────────────────────────── */
.scroll-area {
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

/* Hide scrollbar */
.scroll-area::-webkit-scrollbar { width: 0; }

/* ── REVEAL ANIMATIONS ──────────────────────────────────────── */
[data-reveal] {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.4s ease, transform 0.4s ease;
}

[data-reveal].visible {
  opacity: 1;
  transform: translateY(0);
}

/* Delay helpers */
[data-reveal-delay="1"] { transition-delay: 0.08s; }
[data-reveal-delay="2"] { transition-delay: 0.16s; }
[data-reveal-delay="3"] { transition-delay: 0.24s; }
[data-reveal-delay="4"] { transition-delay: 0.32s; }
[data-reveal-delay="5"] { transition-delay: 0.40s; }

/* ── SPLASH ORBITAL (index.html) ────────────────────────────── */
.orbital-wrap {
  position: relative;
  width: 200px;
  height: 200px;
  margin: 0 auto;
}

.orbital-ring {
  position: absolute;
  border-radius: var(--radius-full);
  border: 1px solid;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
}

.orbital-ring-1 { width: 200px; height: 200px; border-color: rgba(255,176,32,0.15); }
.orbital-ring-2 { width: 160px; height: 160px; border-color: rgba(255,176,32,0.22); animation: orbitSpin 20s linear infinite; }
.orbital-ring-3 { width: 120px; height: 120px; border-color: rgba(255,176,32,0.30); }
.orbital-ring-4 { width: 80px; height: 80px; border-color: rgba(255,176,32,0.45); animation: orbitSpin 15s linear infinite reverse; }

.orbital-core {
  position: absolute;
  width: 48px; height: 48px;
  border-radius: var(--radius-full);
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  background: radial-gradient(circle, rgba(255,176,32,0.8) 0%, rgba(255,176,32,0.3) 50%, transparent 100%);
  box-shadow: 0 0 32px rgba(255,176,32,0.6), 0 0 64px rgba(255,176,32,0.2);
  animation: coreGlow 3s ease-in-out infinite;
}

.orbital-dot {
  position: absolute;
  width: 6px; height: 6px;
  border-radius: var(--radius-full);
  background: var(--gold);
  box-shadow: 0 0 8px var(--gold);
  top: 50%; left: 0;
  transform: translateY(-50%);
}

@keyframes orbitSpin {
  from { transform: translate(-50%, -50%) rotate(0deg); }
  to   { transform: translate(-50%, -50%) rotate(360deg); }
}

@keyframes coreGlow {
  0%, 100% { box-shadow: 0 0 32px rgba(255,176,32,0.6), 0 0 64px rgba(255,176,32,0.2); }
  50%       { box-shadow: 0 0 48px rgba(255,176,32,0.9), 0 0 96px rgba(255,176,32,0.35); }
}

/* ── RESPONSIVE — desktop centering ────────────────────────── */
@media (min-width: 431px) {
  .screen, .screen-full, .container {
    max-width: var(--app-max-width);
    margin: 0 auto;
  }

  body::before {
    content: '';
    position: fixed;
    inset: 0;
    background: #03030A;
    z-index: -1;
  }

  .bottom-nav {
    border-left: 1px solid var(--border-subtle);
    border-right: 1px solid var(--border-subtle);
  }
}

/* ── XP GAIN ANIMATION ──────────────────────────────────────── */
.xp-float {
  position: fixed;
  font-family: var(--font-mono);
  font-size: 1.375rem;
  font-weight: 700;
  color: var(--gold);
  text-shadow: 0 0 16px rgba(255,176,32,0.7);
  pointer-events: none;
  z-index: 9999;
  white-space: nowrap;
  animation: xpFloat 1.4s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

@keyframes xpFloat {
  0%   { opacity: 1; transform: translateY(0) scale(1); }
  20%  { opacity: 1; transform: translateY(-12px) scale(1.15); }
  80%  { opacity: 0.8; transform: translateY(-52px) scale(1); }
  100% { opacity: 0; transform: translateY(-70px) scale(0.85); }
}

/* Feedback correct / wrong en flash sur l'écran */
.flash-correct {
  position: fixed;
  inset: 0;
  background: rgba(0, 229, 100, 0.06);
  pointer-events: none;
  z-index: 998;
  animation: flashFade 0.6s ease forwards;
}

.flash-wrong {
  position: fixed;
  inset: 0;
  background: rgba(230, 57, 70, 0.06);
  pointer-events: none;
  z-index: 998;
  animation: flashFade 0.6s ease forwards;
}

@keyframes flashFade {
  0%   { opacity: 1; }
  100% { opacity: 0; }
}

/* ── TOAST D'OBTENTION DE SCEAU ─────────────────────────────── */
.seal-toast {
  position: fixed;
  top: 16px;
  left: 50%;
  transform: translateX(-50%) translateY(-120%);
  width: calc(100% - 32px);
  max-width: 398px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  background: linear-gradient(135deg, #1A1430, #13112A);
  border: 1px solid rgba(255,176,32,0.4);
  border-radius: 14px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.5), 0 0 24px rgba(255,176,32,0.15);
  z-index: 10000;
  opacity: 0;
  transition: transform 0.4s cubic-bezier(0.2,0.9,0.3,1.2), opacity 0.4s ease;
}
.seal-toast.show { transform: translateX(-50%) translateY(0); opacity: 1; }

.seal-toast__ring {
  width: 42px; height: 42px; border-radius: 50%; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 19px; border: 2px solid;
}
.seal-toast__ring.seal-gold   { border-color: #FFB020; background: rgba(255,176,32,0.12); box-shadow: 0 0 14px rgba(255,176,32,0.35); color: #FFB020; }
.seal-toast__ring.seal-cyan   { border-color: #00E5FF; background: rgba(0,229,255,0.1);  box-shadow: 0 0 14px rgba(0,229,255,0.3);  color: #00E5FF; }
.seal-toast__ring.seal-purple { border-color: #7C3AED; background: rgba(124,58,237,0.14); box-shadow: 0 0 14px rgba(124,58,237,0.35); color: #C4B5F4; }

.seal-toast__label {
  font-family: var(--font-mono, 'JetBrains Mono', monospace);
  font-size: 0.58rem; letter-spacing: 0.16em; text-transform: uppercase;
  color: #FFB020; margin-bottom: 2px;
}
.seal-toast__name {
  font-family: var(--font-display, 'Cinzel', serif);
  font-size: 0.95rem; font-weight: 700; color: #F2EBDA;
}

/* Barre XP globale (header) */
.xp-bar-global {
  height: 3px;
  width: 100%;
  background: rgba(58,58,69,0.5);
  overflow: hidden;
}

.xp-bar-global-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--gold-dim), var(--gold), var(--gold-bright));
  transition: width 0.9s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ── REDUCED MOTION ─────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
  [data-reveal] { opacity: 1; transform: none; }
}
