/* ============================================================
   Brainizy — style « jeu vidéo » coloré
   ============================================================ */
:root {
  --bg1: #6d5ef3;
  --bg2: #a24ff0;
  --ink: #2d2a4a;
  --muted: #7a76a0;
  --card: #ffffff;
  --accent: #ffc83d;
  --accent-dark: #e09a00;
  --accent2: #ff8a3d;
  --green: #2ec46e;
  --green-dark: #1d9350;
  --red: #f45b69;
  --red-dark: #c73a48;
  --blue: #4fa3f7;
  --blue-dark: #2f7fd0;
  --radius: 22px;
  --shadow: 0 10px 30px rgba(30, 20, 90, 0.25);
  /* NzEmoji en tête : fournit les emojis absents de Windows 10 (dont 🪙),
     voir css/emoji13.css. unicode-range : aucun effet sur le texte normal. */
  --font: "NzEmoji", "Baloo 2", "Segoe UI Rounded", "Comic Sans MS", system-ui, sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }

html { height: 100%; }

body {
  font-family: var(--font);
  color: var(--ink);
  background: linear-gradient(160deg, var(--bg1) 0%, var(--bg2) 60%, #c14ff0 100%);
  background-attachment: fixed;
  min-height: 100vh;
  overflow-x: clip; /* (et non hidden : un overflow scrollable casserait le header sticky) */
}

/* Petits emojis flottants en fond */
#bg-deco { position: fixed; inset: 0; pointer-events: none; z-index: 0; overflow: hidden; }
/* Fond « connexions neuronales » (js/bg-neural.js) : un canvas discret
   derrière tout le contenu — nœuds qui dérivent lentement, liens par
   proximité qui apparaissent et se défont. Remplace les anciens emojis. */
#bg-deco canvas { display: block; width: 100%; height: 100%; }
@keyframes floaty {
  0%, 100% { transform: translateY(0) rotate(-8deg); }
  50% { transform: translateY(-24px) rotate(10deg); }
}

/* ============================ Écrans ============================ */
.screen {
  position: relative;
  z-index: 1;
  max-width: 980px;
  margin: 0 auto;
  padding: 22px 18px 60px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
.hidden { display: none !important; }

/* ============================ Logo / profils ============================ */
.logo-wrap { text-align: center; margin: 26px 0 8px; }
.logo {
  font-size: clamp(44px, 8vw, 64px);
  font-weight: 800;
  color: #fff;
  text-shadow: 0 5px 0 rgba(0,0,0,0.18), 0 12px 30px rgba(0,0,0,0.25);
  letter-spacing: 1px;
}
.tagline {
  color: rgba(255,255,255,0.9);
  font-size: 20px;
  font-weight: 600;
  margin-bottom: 26px;
}
.foot-note { text-align: center; color: rgba(255,255,255,0.65); margin-top: 28px; font-size: 14px; }

.profile-grid { display: flex; flex-direction: column; gap: 14px; max-width: 460px; margin: 0 auto; width: 100%; }

.profile-card {
  display: flex;
  align-items: center;
  gap: 16px;
  background: var(--card);
  border-radius: var(--radius);
  padding: 16px 20px;
  box-shadow: var(--shadow);
  cursor: pointer;
  border: 4px solid transparent;
  transition: transform 0.15s, border-color 0.15s;
  font-family: var(--font);
  font-size: 18px;
}
.profile-card:hover { transform: translateY(-3px) scale(1.01); border-color: var(--accent); }
.profile-emoji {
  width: 64px; height: 64px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 36px; flex-shrink: 0;
  box-shadow: inset 0 -4px 0 rgba(0,0,0,0.12);
}
.profile-meta { flex: 1; text-align: left; }
.profile-meta b { font-size: 22px; display: block; }
.profile-meta small { color: var(--muted); font-weight: 600; }
.profile-xp { text-align: right; font-weight: 700; color: var(--muted); font-size: 14px; }
.profile-xp b { color: var(--accent-dark); font-size: 18px; }
.profile-del {
  background: #ffe9ec; color: var(--red); border: none; border-radius: 12px;
  width: 38px; height: 38px; font-size: 17px; cursor: pointer; font-family: var(--font);
  transition: background 0.15s;
}
.profile-del:hover { background: var(--red); color: #fff; }

.add-profile-card {
  max-width: 460px; width: 100%; margin: 16px auto 0;
  background: rgba(255,255,255,0.16);
  border: 3px dashed rgba(255,255,255,0.6);
  border-radius: var(--radius);
  color: #fff;
  padding: 20px;
  text-align: center;
  font-size: 19px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.15s, transform 0.15s;
  font-family: var(--font);
}
.add-profile-card:hover { background: rgba(255,255,255,0.26); transform: translateY(-2px); }
.add-plus { font-size: 34px; line-height: 1; }

/* ============================ Création profil ============================ */
.btn-back {
  align-self: flex-start;
  background: rgba(255,255,255,0.2); color: #fff; border: none;
  font-family: var(--font); font-size: 17px; font-weight: 700;
  padding: 10px 18px; border-radius: 14px; cursor: pointer; margin-bottom: 14px;
}
.btn-back:hover { background: rgba(255,255,255,0.3); }

.create-card { max-width: 520px; width: 100%; margin: 0 auto; padding: 26px 28px 30px; border-radius: var(--radius); box-shadow: var(--shadow); }
.create-card h2 { text-align: center; font-size: 28px; margin-bottom: 18px; }
.field-label { display: block; font-weight: 700; color: var(--muted); margin: 16px 0 8px; font-size: 15px; text-transform: uppercase; letter-spacing: 0.5px; }
#create-name, #input-name {
  width: 100%; font-family: var(--font); font-size: 22px; font-weight: 700;
  padding: 12px 16px; border: 3px solid #e4e1f5; border-radius: 16px; color: var(--ink);
  outline: none; transition: border-color 0.15s;
}
#input-name:focus { border-color: var(--bg1); }

.seg { display: flex; gap: 10px; }
.seg button {
  flex: 1; font-family: var(--font); font-size: 19px; font-weight: 800;
  padding: 12px; border-radius: 16px; border: 3px solid #e4e1f5;
  background: #fff; color: var(--muted); cursor: pointer; transition: all 0.15s;
}
.seg button.active { background: var(--bg1); border-color: var(--bg1); color: #fff; box-shadow: 0 5px 0 var(--blue-dark); }
.field-help { color: var(--muted); font-size: 13px; font-weight: 600; margin-top: 6px; }

.avatar-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 8px; }
.avatar-grid button {
  font-size: 30px; padding: 8px 0; border-radius: 14px; border: 3px solid #e4e1f5;
  background: #fff; cursor: pointer; transition: all 0.12s; font-family: var(--font);
}
.avatar-grid button:hover { transform: scale(1.1); }
.avatar-grid button.active { border-color: var(--accent); background: #fff7e0; }

.color-grid { display: flex; gap: 10px; flex-wrap: wrap; }
.color-grid button {
  width: 42px; height: 42px; border-radius: 50%; border: 4px solid transparent;
  cursor: pointer; transition: transform 0.12s; box-shadow: inset 0 -4px 0 rgba(0,0,0,0.15);
}
.color-grid button:hover { transform: scale(1.15); }
.color-grid button.active { border-color: var(--ink); }

/* ============================ Boutons « jeu » ============================ */
.btn {
  font-family: var(--font);
  border: none;
  border-radius: 18px;
  font-weight: 800;
  cursor: pointer;
  color: #fff;
  background: var(--green);
  box-shadow: 0 6px 0 var(--green-dark);
  transition: transform 0.08s, box-shadow 0.08s;
}
.btn:active { transform: translateY(5px); box-shadow: 0 1px 0 var(--green-dark); }
.btn-big { font-size: 24px; padding: 16px 34px; align-self: center; margin-top: 18px; }
.btn-blue { background: var(--blue); box-shadow: 0 6px 0 var(--blue-dark); }
.btn-blue:active { box-shadow: 0 1px 0 var(--blue-dark); }
.btn-red { background: var(--red); box-shadow: 0 6px 0 var(--red-dark); }
.btn-red:active { box-shadow: 0 1px 0 var(--red-dark); }
.btn-yellow { background: var(--accent); box-shadow: 0 6px 0 var(--accent-dark); color: var(--ink); }
.btn-yellow:active { box-shadow: 0 1px 0 var(--accent-dark); }
.btn-ghost { background: rgba(255,255,255,0.18); box-shadow: none; }
.btn-ghost:active { box-shadow: none; }
/* sur les cartes blanches (popups), le fantôme translucide disparaît :
   ici il prend un fond grisé lisible, texte foncé */
.modal .btn-ghost:not(.shop-btn) {
  background: #eceafb; color: var(--ink);
}
.modal .btn-ghost:not(.shop-btn):active { transform: translateY(2px); }

/* ============================ Cartes génériques ============================ */
.card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); }

/* ============================ HUD accueil ============================ */
.topbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 18px; }
.chip {
  display: inline-flex; align-items: center; gap: 7px;
  background: rgba(255,255,255,0.18); color: #fff;
  font-family: var(--font); font-weight: 700; font-size: 16px;
  border: none; border-radius: 16px; padding: 9px 14px; cursor: pointer;
}
.chip b { font-size: 18px; }
.chip small { opacity: 0.8; font-weight: 600; }
.chip:hover { background: rgba(255,255,255,0.28); }
.avatar-chip { padding: 6px 14px 6px 8px; }
/* le compagnon déborde de l'avatar (right: -8px) : il ne doit pas
   recouvrir le prénom à côté — surtout sur mobile où la place est comptée */
.avatar-chip .avatar-meta { padding-left: 7px; }
#hud-avatar {
  width: 42px; height: 42px; border-radius: 50%;
  background: var(--accent); display: flex; align-items: center; justify-content: center;
  font-size: 24px; box-shadow: inset 0 -3px 0 rgba(0,0,0,0.15);
}
.avatar-meta { text-align: left; line-height: 1.05; display: flex; flex-direction: column; }
.avatar-meta b { font-size: 16px; }
.avatar-meta small { font-size: 12px; opacity: 0.85; }
.nz-chip { background: rgba(255,200,61,0.25); }
.streak-chip { background: rgba(255,138,61,0.3); }
.shop-chip { background: rgba(79,163,247,0.35); }
.xp-chip { background: rgba(255,200,61,0.25); position: relative; }

/* « +15 ⚡ » qui s'envole depuis le compteur d'XP du quiz */
.xp-float {
  position: absolute; left: 50%; top: -2px; z-index: 3;
  font-size: 15px; font-weight: 800; color: var(--accent);
  text-shadow: 0 2px 6px rgba(0, 0, 0, 0.5);
  pointer-events: none; white-space: nowrap;
  animation: xpFloat 1.05s ease-out forwards;
}
@keyframes xpFloat {
  0% { transform: translate(-50%, 0) scale(0.7); opacity: 0; }
  25% { transform: translate(-50%, -10px) scale(1.15); opacity: 1; }
  100% { transform: translate(-50%, -40px) scale(1); opacity: 0; }
}

.xp-wrap { flex: 1; min-width: 160px; display: flex; align-items: center; gap: 10px; }
.lvl-badge {
  background: var(--accent); color: var(--ink); font-weight: 800; font-size: 15px;
  border-radius: 12px; padding: 6px 12px; white-space: nowrap;
  box-shadow: 0 4px 0 var(--accent-dark);
}
.xp-bar {
  flex: 1; height: 20px; border-radius: 12px;
  background: rgba(0,0,0,0.25); overflow: hidden;
  box-shadow: inset 0 2px 5px rgba(0,0,0,0.3);
}
.xp-fill {
  height: 100%; width: 0%;
  background: linear-gradient(90deg, #ffe07a, var(--accent));
  border-radius: 12px;
  transition: width 0.6s cubic-bezier(0.22, 1, 0.36, 1);
}
.hud-right { display: flex; gap: 8px; flex-wrap: wrap; }

/* Le « ? » du HUD : le Guide du jeu s'ouvre dans un NOUVEL onglet
   (on ne quitte jamais la partie). */
.help-chip {
  text-decoration: none; justify-content: center;
  min-width: 34px; padding: 9px 12px;
  background: rgba(156, 106, 255, 0.32);
}
.help-chip b { font-size: 17px; }

/* ============================ Grille chapitres ============================ */
.chapter-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); gap: 14px; }
.chapter-card {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 18px;
  cursor: pointer;
  border: 4px solid transparent;
  transition: transform 0.14s, border-color 0.14s;
  display: flex; flex-direction: column; gap: 6px;
  text-align: left; font-family: var(--font);
}
.chapter-card:hover { transform: translateY(-4px); border-color: var(--accent); }
.chapter-head { display: flex; align-items: center; gap: 12px; }
.chapter-icon {
  width: 52px; height: 52px; border-radius: 16px;
  display: flex; align-items: center; justify-content: center;
  font-size: 28px; flex-shrink: 0;
  box-shadow: inset 0 -4px 0 rgba(0,0,0,0.1);
}
.chapter-card h3 { font-size: 19px; line-height: 1.15; }
.chapter-desc { color: var(--muted); font-size: 14px; font-weight: 600; flex: 1; }
.chapter-stats { display: flex; gap: 8px; flex-wrap: wrap; font-size: 13px; font-weight: 700; }

/* ---------- progression du sujet (étoiles) ----------
   Remplace les badges cryptiques : étoiles + séries réussies / total
   du palier, barre vers la prochaine étoile, et ce qui reste à faire.
   Même barre que le rang et les matières ; verte une fois 3★. */
.chapter-progress { display: flex; flex-direction: column; gap: 5px; margin-top: 10px; }
.cp-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.cp-stars { font-size: 15px; letter-spacing: 2px; }
.cp-count { font-size: 12.5px; font-weight: 800; color: var(--muted); white-space: nowrap; }
.cp-bar {
  height: 8px; border-radius: 6px;
  background: rgba(45, 42, 74, 0.12); overflow: hidden;
}
.cp-fill {
  display: block; height: 100%; border-radius: 6px;
  background: linear-gradient(90deg, #ffd75e, #ff9d2e);
  box-shadow: inset 0 -2px 0 rgba(0, 0, 0, 0.12);
  transition: width 0.4s;
}
.chapter-progress.done .cp-fill { background: linear-gradient(90deg, #59e38f, var(--green)); }
.cp-next { font-size: 12.5px; font-weight: 800; color: var(--accent-dark); }
.chapter-progress.done .cp-next { color: var(--green-dark); }
.badge {
  border-radius: 10px; padding: 3px 10px;
  background: #f0eefb; color: var(--muted);
}
.badge.ok { background: #e3f8ec; color: var(--green-dark); }
/* badge classe d'un chapitre (6ème / 4ème) — surligné si c'est la classe du profil */
.badge.lvl { background: #e8e4ff; color: #5b48c9; }
.badge.lvl.mine { background: var(--bg1); color: #fff; }

/* ============================ Quiz ============================ */
.quiz-top { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.btn-quit {
  background: rgba(255,255,255,0.2); color: #fff; border: none;
  font-size: 18px; font-weight: 800; width: 44px; height: 44px;
  border-radius: 14px; cursor: pointer; font-family: var(--font); flex-shrink: 0;
}
.btn-quit:hover { background: var(--red); }
.score-chip { cursor: default; flex-shrink: 0; }

.pips { flex: 1; display: flex; gap: 6px; justify-content: center; }
.pip {
  width: 100%; max-width: 34px; height: 14px; border-radius: 8px;
  background: rgba(255,255,255,0.25);
  transition: background 0.25s, transform 0.25s;
}
.pip.done-good { background: var(--green); }
.pip.done-bad { background: var(--red); }
.pip.current { background: var(--accent); animation: pulse 1s infinite; }
@keyframes pulse { 0%,100% { transform: scaleY(1); } 50% { transform: scaleY(1.5); } }

.quiz-chapter-label { text-align: center; color: rgba(255,255,255,0.85); font-weight: 700; margin-bottom: 12px; font-size: 16px; }

/* Le lien « Voir le cours » de l'écran quiz : discret, ne vole la
   vedette à aucune récompense — une échappatoire pédagogique, pas un
   bouton d'action. Nouvel onglet (rel=noopener) : la partie continue. */
.quiz-cours {
  display: inline-block; margin-left: 8px; padding: 3px 12px;
  background: rgba(255,255,255,0.12); border: 1px solid rgba(255,255,255,0.25);
  border-radius: 999px; color: rgba(255,255,255,0.9);
  font-size: 12.5px; font-weight: 700; text-decoration: none;
  transition: background 0.15s ease, transform 0.15s ease;
}
.quiz-cours:hover { background: rgba(255,255,255,0.22); transform: translateY(-1px); }

.q-card { padding: 24px 26px; margin-bottom: 16px; position: relative; overflow: hidden; }
.q-text { font-size: clamp(20px, 3.4vw, 26px); font-weight: 700; line-height: 1.35; white-space: pre-line; }
.q-card.pop { animation: popIn 0.3s cubic-bezier(0.34, 1.56, 0.64, 1); }
@keyframes popIn { from { transform: scale(0.9); opacity: 0.3; } to { transform: scale(1); opacity: 1; } }

/* Visuel d'une question (carte, schéma, graphique — SVG inline) */
.q-img { margin-top: 12px; }
.q-img svg {
  display: block; width: 100%; max-width: 340px; height: auto;
  margin: 0 auto; padding: 8px; box-sizing: border-box;
  background: #fff; border: 3px solid #e4e1f5; border-radius: 16px;
}
.q-img text { font-family: var(--font); }
/* Visuel image (WebP) : même cadre que le SVG, width/height servis
   par la balise (pas de saut de mise en page), lazy loading sous l'énoncé */
.q-img img {
  display: block; max-width: 340px; height: auto;
  margin: 0 auto; padding: 8px; box-sizing: border-box;
  background: #fff; border: 3px solid #e4e1f5; border-radius: 16px;
}

.answer-area { display: flex; flex-direction: column; gap: 10px; }
.choice-btn {
  font-family: var(--font); font-size: 20px; font-weight: 700; text-align: left;
  background: var(--card); color: var(--ink);
  border: 3px solid #e4e1f5; border-radius: 18px;
  padding: 14px 18px; cursor: pointer; transition: all 0.12s;
}
.choice-btn:hover { border-color: var(--bg1); transform: translateX(4px); }
.choice-btn.correct { background: #e3f8ec; border-color: var(--green); }
.choice-btn.wrong { background: #ffe9ec; border-color: var(--red); }
.choice-btn:disabled { cursor: default; }
.choice-btn .choice-letter {
  display: inline-flex; width: 30px; height: 30px; border-radius: 10px;
  background: #f0eefb; color: var(--muted); align-items: center; justify-content: center;
  font-weight: 800; margin-right: 12px; font-size: 16px;
}

.input-row { display: flex; gap: 10px; }
#answer-input {
  flex: 1; font-family: var(--font); font-size: 24px; font-weight: 700;
  padding: 14px 18px; border: 3px solid #e4e1f5; border-radius: 18px; color: var(--ink);
  outline: none; min-width: 0; text-align: center;
}
#answer-input:focus { border-color: var(--bg1); }
#answer-input.ok { border-color: var(--green); background: #e3f8ec; }
#answer-input.bad { border-color: var(--red); background: #ffe9ec; }
.btn-validate { font-size: 20px; padding: 14px 26px; flex-shrink: 0; }
/* « Je passe » (questions écrites) : discret mais trouvable — secondaire
   face à « Valider », il reste une vraie porte de sortie, pas un aveu. */
.btn-skip {
  align-self: center; margin-top: 8px; font-size: 16px; padding: 10px 22px;
  background: transparent; box-shadow: none; border: 2px dashed rgba(255, 255, 255, 0.45);
  color: rgba(255, 255, 255, 0.85);
}
.btn-skip:hover { border-color: rgba(255, 255, 255, 0.75); color: #fff; }
.btn-skip:active { transform: translateY(2px); box-shadow: none; }
.input-hint { color: rgba(255,255,255,0.75); font-size: 14px; font-weight: 600; text-align: center; }

.vf-row { display: flex; gap: 12px; }
.vf-row .choice-btn { flex: 1; text-align: center; font-size: 24px; font-weight: 800; padding: 18px; }
.vf-true:hover { border-color: var(--green); }
.vf-false:hover { border-color: var(--red); }

/* ---------- Question « ordre » : remettre dans l'ordre ---------- */
.btn-interact { align-self: center; margin-top: 4px; }
.btn-interact:disabled { opacity: 0.45; cursor: default; }
.ordre-slots { display: flex; flex-direction: column; gap: 8px; min-height: 60px; }
.ordre-slot {
  display: flex; align-items: center; gap: 10px; text-align: left;
  font-family: var(--font); font-size: 17px; font-weight: 700; color: var(--ink);
  background: #f0eefb; border: 3px dashed #d5d0ef; border-radius: 16px;
  padding: 10px 14px; min-height: 48px; transition: all 0.12s;
}
.ordre-slot.empty { background: transparent; color: var(--muted); }
.ordre-slot:not(.empty) {
  background: var(--card); border-style: solid; border-color: var(--bg1);
  cursor: pointer; animation: popIn 0.18s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.ordre-slot:not(.empty):hover { border-color: var(--red); background: #ffe9ec; }
.ordre-num {
  display: inline-flex; width: 26px; height: 26px; border-radius: 9px; flex-shrink: 0;
  background: #fff; border: 2px solid #e4e1f5; color: var(--muted);
  align-items: center; justify-content: center; font-weight: 800; font-size: 14px;
}
.ordre-pool { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; justify-content: center; }
.ordre-chip {
  font-family: var(--font); font-size: 16px; font-weight: 700; color: var(--ink);
  background: var(--card); border: 3px solid #e4e1f5; border-radius: 999px;
  padding: 10px 18px; cursor: pointer; transition: all 0.12s;
}
.ordre-chip:hover { border-color: var(--bg1); transform: translateY(-2px) scale(1.04); }

/* ---------- Question « paires » : deux colonnes à relier ---------- */
.paire-zone { display: flex; gap: 10px; align-items: flex-start; }
.paire-col { flex: 1; display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.paire-chip {
  font-family: var(--font); font-size: 16px; font-weight: 700; color: var(--ink);
  text-align: left; background: var(--card);
  border: 3px solid #e4e1f5; border-radius: 16px;
  padding: 12px 14px; cursor: pointer; transition: all 0.12s; min-height: 48px;
}
.paire-chip:hover { border-color: var(--bg1); }
.paire-chip.selected { border-color: var(--accent-dark); background: #fff3d6; transform: scale(1.03); }
/* couleurs d'association : chaque paire liée prend sa teinte — VIVES et
   tranchées (bleu / vert / fuchsia / violet / orange / cyan) pour que les
   liens se lisent d'un coup d'œil, même en fond de classe éclairé */
.paire-chip.linked { cursor: pointer; border-width: 4px; padding: 11px 13px; font-weight: 800; }
.paire-c0 { border-color: #2962ff; background: #d6e4ff; color: #0d47a1; }
.paire-c1 { border-color: #00c853; background: #d2f7dd; color: #1b5e20; }
.paire-c2 { border-color: #ff2d78; background: #ffd9e8; color: #a3114f; }
.paire-c3 { border-color: #9c27f0; background: #ecd9ff; color: #5b1a96; }
.paire-c4 { border-color: #ff8f00; background: #ffe8c2; color: #8f4e00; }
.paire-c5 { border-color: #00bcd4; background: #ccf5ff; color: #006c80; }

.feedback {
  border-radius: 18px; padding: 16px 20px; margin-top: 16px;
  font-size: 18px; font-weight: 700; line-height: 1.4;
  animation: popIn 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.feedback.ok { background: #e3f8ec; color: var(--green-dark); border: 3px solid var(--green); }
.feedback.bad { background: #ffe9ec; color: var(--red-dark); border: 3px solid var(--red); }
.feedback .fb-title { font-size: 21px; margin-bottom: 4px; }
.feedback .fb-xp {
  display: inline-block; margin-top: 8px;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  color: var(--ink); border-radius: 12px; padding: 4px 14px;
  font-size: 17px; font-weight: 800;
  box-shadow: 0 3px 0 var(--accent-dark);
}

/* ============================ Coffre ============================
   La cérémonie : le monde s'éteint (voile nuit), un projecteur
   éclaire le coffre. Il se charge (bonds), vibre, puis craque —
   flash, capot qui s'envole, pièces jaillies ENTRE les deux plans
   du coffre ouvert, et seulement ensuite la révélation (rareté,
   Neuronz, XP). La façade avant masque les pièces retombantes :
   vraie profondeur, et le trésor a une vraie cachette. */
#screen-chest { align-items: center; justify-content: center; gap: 10px; }
/* pendant la cérémonie, l'écran coffre passe devant tout le reste :
   son voile nuit (position:fixed) couvre alors toute la page */
#screen-chest:not(.hidden) { z-index: 60; }

/* — le monde s'éteint — : noir quasi total, seul le halo du projecteur
   laisse deviner la zone du coffre ; le faisceau s'allume APRÈS le
   noir (léger délai), le temps que la salle soit plongée dans l'ombre */
.chest-night {
  position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background: radial-gradient(85% 75% at 50% 58%,
    rgba(8, 5, 24, 0.55) 0%, rgba(6, 4, 20, 0.9) 45%, rgba(3, 2, 12, 0.985) 100%);
  opacity: 0; transition: opacity 0.55s ease;
}
#screen-chest:not(.hidden) .chest-night { opacity: 1; }
/* variante « lumière morte » du coffre verrouillé : plus froid, plus noir */
.chest-coldveil {
  position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background: radial-gradient(120% 95% at 50% 60%,
    rgba(10, 14, 40, 0.5) 0%, rgba(4, 5, 16, 0.96) 62%);
  opacity: 0; transition: opacity 0.8s ease;
}
#screen-chest.cold .chest-coldveil { opacity: 1; }

/* titre seul au-dessus du coffre — les chiffres viennent APRÈS l'ouverture */
.chest-title {
  margin: 0; color: #fff; font-size: 26px; text-align: center;
  position: relative; z-index: 2;
  text-shadow: 0 2px 16px rgba(255, 216, 110, 0.45), 0 2px 6px rgba(0, 0, 0, 0.5);
}

.chest-stage { position: relative; width: min(330px, 82vw); height: 315px; margin-top: 4px; z-index: 2; }

/* — le projecteur : faisceau qui descend + flaque de lumière au sol —
   il s'allume avec un léger retard : le noir tombe D'ABORD, puis la
   lumière trouve le coffre (entrée en théâtre) */
.chest-spot { position: absolute; inset: -80px -70px -26px; z-index: 0; pointer-events: none; }
.chest-spot::before {
  content: ""; position: absolute; left: 50%; top: 0; width: 100%; height: 82%;
  transform: translateX(-50%);
  background: linear-gradient(to bottom, rgba(255, 238, 180, 0.4), rgba(255, 238, 180, 0.07) 60%, transparent 82%);
  clip-path: polygon(44% 0, 56% 0, 92% 100%, 8% 100%);
  opacity: 0; transition: opacity 1s ease 0.45s;
}
.chest-spot::after {
  content: ""; position: absolute; left: 50%; bottom: 0; width: 300px; height: 60px;
  transform: translateX(-50%);
  background: radial-gradient(ellipse at center, rgba(255, 226, 130, 0.55), rgba(255, 226, 130, 0.08) 55%, transparent 78%);
  opacity: 0; transition: opacity 1s ease 0.45s;
}
#screen-chest:not(.hidden) .chest-spot::before,
#screen-chest:not(.hidden) .chest-spot::after { opacity: 1; }

/* les stats du bilan — réutilisées dans la révélation d'après-ouverture */
.recap-stats { display: flex; justify-content: center; gap: 12px; flex-wrap: wrap; margin-top: 14px; }
.recap-stat {
  background: #f0eefb; border-radius: 18px; padding: 10px 22px;
  font-size: 17px; font-weight: 800; color: var(--muted);
}
.recap-stat b { font-size: 26px; color: var(--ink); }
.recap-stat.perfect { background: #e3f8ec; }
.recap-stat.xp b { color: #b8860b; }
.recap-note { margin-top: 10px; font-size: 15px; font-weight: 700; color: var(--muted); }
.recap-note b { color: var(--ink); }

/* — ombre au sol : ancre le coffre, respire pendant les bonds — */
.chest-shadow {
  position: absolute; left: 50%; bottom: 0; width: 220px; height: 26px;
  margin-left: -110px; border-radius: 50%;
  background: radial-gradient(ellipse at center, rgba(5, 3, 16, 0.65), transparent 68%);
}

.chest-glow {
  position: absolute; inset: -46px; border-radius: 50%;
  background: radial-gradient(circle, rgba(255,220,120,0.55), transparent 65%);
  opacity: 0; transition: opacity 0.4s, transform 0.5s; pointer-events: none;
  z-index: 1;
}
.chest-glow.on { opacity: 1; }

/* — le coffre et ses couches —
   #chest-el      : coffre FERMÉ (repos, charge, vibration)
   #chest-chains  : variante enchaînée (coffre verrouillé)
   .chest-open    : coffre OUVERT SANS COUVERCLE en DEUX PLANS —
                    l'arrière (intérieur qui déborde de pièces) est
                    sous les pièces dynamiques, la façade avant
                    au-dessus : elles jaillissent entre les deux et
                    la façade masque celles qui retombent. Les deux
                    plans sont LA MÊME image, coupée au rebord
                    (47,3 %) — alignement parfait garanti. Le capot
                    qui s'envole (#chest-lid) fait le reste. */
.chest-hero, .chest-open, .chest-flash {
  position: absolute; left: 0; right: 0; bottom: 6px; margin: 0;
}
.chest-hero { width: 100%; z-index: 2; transform-origin: 50% 90%; }
.chest-chains { z-index: 4; }
#screen-chest.cold .chest-chains { filter: saturate(0.7) brightness(0.85); }

.chest-open { aspect-ratio: 1334 / 1179; z-index: 2; pointer-events: none; }
.chest-plane { position: absolute; left: 0; bottom: 0; width: 100%; display: block; }
.chest-plane-back { clip-path: inset(0 0 52.7% 0); z-index: 1; }
.chest-plane-front { clip-path: inset(47.3% 0 0 0); z-index: 3; }
#chest-burst { position: absolute; inset: -40% -30%; z-index: 2; pointer-events: none; }
#chest-fx { position: absolute; inset: 0; z-index: 7; pointer-events: none; }

/* lumière qui fuit par l'interstice du couvercle (charge / vibration) */
.chest-seam {
  position: absolute; left: 50%; bottom: 54%; width: 58%; height: 18px;
  transform: translateX(-50%); z-index: 3; pointer-events: none; opacity: 0;
  background: radial-gradient(ellipse at center, rgba(255, 240, 170, 0.95), transparent 70%);
  filter: blur(2px);
}

/* le capot qui s'envole au craquage */
.chest-lid-fly {
  position: absolute; left: 50%; width: 78%; margin-left: -39%;
  bottom: calc(6px + 50%); z-index: 5; opacity: 0; pointer-events: none;
}

/* flash blanc du craquage */
.chest-flash {
  top: -30px; bottom: -30px; z-index: 6; pointer-events: none; opacity: 0;
  background: radial-gradient(circle at 50% 46%, rgba(255, 255, 255, 0.98), rgba(255, 244, 200, 0.5) 42%, transparent 72%);
}

/* ============================================================
   La cérémonie, phase par phase (classes posées sur le stage) :
   .present   repos — le coffre respire sous le projecteur
   .charging  il se CHARGE : bonds, la lumière fuit par l'interstice
   .rattling  il VIBRE de l'intérieur — ça ne tient plus…
   .open      CRAQUAGE : flash, capot qui s'envole, pièces, secousse
   Verrouillé : .deflate (bond raté), .slam (chaînes), .headshake
   (le cadenas dit non), .lights-out (le projecteur meurt).
   ============================================================ */

/* — repos : le coffre respire — */
.chest-stage.present #chest-el { animation: chestIdle 2.8s ease-in-out infinite; }
@keyframes chestIdle {
  0%, 100% { transform: scale(1, 1); }
  50% { transform: scale(1.025, 0.975); }
}
.chest-stage.present .chest-shadow { animation: shadowIdle 2.8s ease-in-out infinite; }
@keyframes shadowIdle {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(0.96); opacity: 0.85; }
}

.chest-stage.charging #chest-el { animation: chestHops 1.15s cubic-bezier(0.36, 0.07, 0.19, 0.97) both; }
@keyframes chestHops {
  0%   { transform: translateY(0) scale(1, 1); }
  10%  { transform: translateY(0) scale(1.08, 0.9); }
  22%  { transform: translateY(-26px) scale(0.96, 1.05); }
  34%  { transform: translateY(0) scale(1.1, 0.88); }
  42%  { transform: translateY(0) scale(1.04, 0.97); }
  52%  { transform: translateY(-40px) scale(0.94, 1.06); }
  64%  { transform: translateY(0) scale(1.12, 0.86); }
  72%  { transform: translateY(0) scale(1.05, 0.96); }
  78%  { transform: translateY(-10px) scale(0.98, 1.03); }
  86%  { transform: translateY(0) scale(1.06, 0.94); }
  100% { transform: translateY(0) scale(1.04, 0.96); }
}
.chest-stage.rattling #chest-el { animation: chestRattle 0.22s linear infinite; }
@keyframes chestRattle {
  0%, 100% { transform: rotate(-2deg) scale(1.04, 0.96); }
  25% { transform: translateX(-4px) rotate(2.5deg) scale(1.03, 0.97); }
  50% { transform: translateX(4px) rotate(-2.5deg) scale(1.04, 0.96); }
  75% { transform: translateX(-3px) rotate(2deg) scale(1.03, 0.97); }
}
/* la lueur monte et l'interstice s'allume pendant la charge */
.chest-stage.charging .chest-glow, .chest-stage.rattling .chest-glow {
  animation: glowBuild 0.55s ease-in-out infinite;
}
@keyframes glowBuild {
  0%, 100% { opacity: 0.4; transform: scale(1); }
  50% { opacity: 0.85; transform: scale(1.14); }
}
.chest-stage.charging .chest-seam { animation: seamBuild 0.5s ease-in-out infinite; }
.chest-stage.rattling .chest-seam { animation: seamBuild 0.16s steps(2, jump-none) infinite; }
@keyframes seamBuild {
  0%, 100% { opacity: 0.25; }
  50% { opacity: 0.9; }
}
/* l'ombre suit les bonds */
.chest-stage.charging .chest-shadow { animation: shadowSquash 1.15s cubic-bezier(0.36, 0.07, 0.19, 0.97) both; }
@keyframes shadowSquash {
  0%   { transform: scale(1); opacity: 1; }
  10%  { transform: scale(1.1); opacity: 1; }
  22%  { transform: scale(0.74); opacity: 0.75; }
  34%  { transform: scale(1.12); opacity: 1; }
  42%  { transform: scale(1.06); opacity: 1; }
  52%  { transform: scale(0.64); opacity: 0.65; }
  64%  { transform: scale(1.16); opacity: 1; }
  72%  { transform: scale(1.07); opacity: 1; }
  78%  { transform: scale(0.92); opacity: 0.9; }
  86%  { transform: scale(1.08); opacity: 1; }
  100% { transform: scale(1.05); opacity: 1; }
}
.chest-stage.rattling .chest-shadow { transform: scale(1.06); }

/* — le craquage : flash, capot qui s'envole, faisceau, onde de choc — */
.chest-stage.open .chest-flash { animation: flashPop 0.55s ease-out forwards; }
@keyframes flashPop {
  0% { opacity: 0; }
  8% { opacity: 1; }
  100% { opacity: 0; }
}
.chest-stage.open .chest-lid-fly { animation: lidFly 1s cubic-bezier(0.22, 0.9, 0.32, 1) forwards; }
@keyframes lidFly {
  0%   { opacity: 1; transform: translate(0, 4%) rotate(0deg); }
  20%  { opacity: 1; transform: translate(-4%, -52%) rotate(-40deg); }
  58%  { opacity: 1; transform: translate(-18%, -116%) rotate(-122deg); }
  100% { opacity: 0; transform: translate(-38%, -158%) rotate(-192deg); }
}
.chest-stage.open .chest-glow { transform: scale(1.3); }

.chest-stage.open::before {
  content: ""; position: absolute; left: 50%; bottom: 45%; width: 150px; height: 180px;
  margin-left: -75px; z-index: 1; pointer-events: none;
  background: radial-gradient(ellipse at 50% 100%, rgba(255, 240, 180, 0.95), rgba(255, 214, 100, 0.4) 45%, transparent 72%);
  transform-origin: 50% 100%;
  animation: beamUp 0.85s cubic-bezier(0.2, 0.7, 0.4, 1) forwards;
}
@keyframes beamUp {
  0% { transform: scaleY(0.12) scaleX(0.7); opacity: 0; }
  22% { opacity: 1; }
  100% { transform: scaleY(1.12) scaleX(1); opacity: 0; }
}
.chest-stage.open::after {
  content: ""; position: absolute; left: 50%; bottom: 43%; width: 56px; height: 56px;
  margin-left: -28px; border-radius: 50%; z-index: 4; pointer-events: none;
  border: 6px solid rgba(255, 214, 100, 0.9);
  box-shadow: 0 0 18px rgba(255, 214, 100, 0.6);
  animation: shockwave 0.65s cubic-bezier(0.2, 0.7, 0.4, 1) forwards;
}
@keyframes shockwave {
  0% { transform: scale(0.35); opacity: 1; }
  100% { transform: scale(3.4); opacity: 0; }
}
/* la caméra tremble */
#screen-chest.quake .chest-stage { animation: quake 0.5s linear; }
@keyframes quake {
  0%, 100% { transform: translate(0, 0); }
  15% { transform: translate(-7px, 4px) rotate(-0.6deg); }
  30% { transform: translate(6px, -5px) rotate(0.5deg); }
  45% { transform: translate(-5px, 3px); }
  60% { transform: translate(4px, -2px); }
  75% { transform: translate(-2px, 1px); }
}

/* — pièces et poussières — */
.coin-particle {
  position: absolute; font-size: 26px; pointer-events: none;
  /* entre les deux plans du coffre ouvert (z posés par le conteneur) :
     elles émergent de l'ouverture et la façade masque les retombées */
  animation: coinFly var(--dur) cubic-bezier(0.2, 0.7, 0.4, 1) both;
}
@keyframes coinFly {
  0% { transform: translate(0, 0) scale(0.4) rotate(0); opacity: 1; }
  70% { opacity: 1; }
  100% { transform: translate(var(--dx), var(--dy)) scale(1.15) rotate(var(--rot)); opacity: 0; }
}

/* — le coffre verrouillé : la cérémonie qui tourne court — */
/* le projecteur peine à rester allumé */
#screen-chest.locked-cine .chest-spot::before { animation: spotFlicker 1.15s steps(1, end) 2 both; }
#screen-chest.locked-cine .chest-spot::after { animation: spotFlicker 1.15s steps(1, end) 2 both; }
@keyframes spotFlicker {
  0% { opacity: 1; }
  16% { opacity: 0.08; }
  24% { opacity: 0.9; }
  45% { opacity: 0.12; }
  56% { opacity: 0.85; }
  78% { opacity: 0.5; }
  100% { opacity: 0.7; }
}
/* le bond raté : il tente… et retombe écrasé */
.chest-stage.deflate #chest-el { animation: chestDeflate 0.6s ease-out both; }
@keyframes chestDeflate {
  0% { transform: translateY(0) scale(1, 1); }
  35% { transform: translateY(-16px) scale(0.97, 1.05); }
  72% { transform: translateY(0) scale(1.14, 0.8); }
  100% { transform: translateY(0) scale(1.05, 0.94); }
}
/* CLANG : chaînes + cadenas s'abattent */
.chest-stage.slam .chest-chains { animation: chainsSlam 0.34s cubic-bezier(0.2, 0.8, 0.3, 1.25) both; }
@keyframes chainsSlam {
  0% { transform: translateY(-40px) scale(1.15); opacity: 0; }
  45% { opacity: 1; }
  62% { transform: translateY(0) scale(0.96, 1.04); }
  100% { transform: translateY(0) scale(1); opacity: 1; }
}
/* le cadenas fait « non » de la tête */
.chest-stage.headshake .chest-chains { animation: headShake 0.5s ease-in-out 2; }
@keyframes headShake {
  0%, 100% { transform: rotate(0); }
  25% { transform: rotate(-3.5deg); }
  75% { transform: rotate(3.5deg); }
}
/* le projecteur meurt */
#screen-chest.lights-out .chest-spot::before,
#screen-chest.lights-out .chest-spot::after { opacity: 0.1; transition: opacity 0.6s ease; }

/* — la révélation d'après-ouverture : les infos popent en cascade — */
.chest-reveal {
  background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 18px 28px 16px; text-align: center; max-width: 460px; width: 100%;
  position: relative; z-index: 2;
}
/* les boutons restent au-dessus du voile nuit (éléments statiques sinon) */
#screen-chest .btn { position: relative; z-index: 2; }
.rv { animation: rvPop 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) backwards; }
@keyframes rvPop { from { transform: scale(0.4) translateY(12px); opacity: 0; } to { transform: scale(1) translateY(0); opacity: 1; } }
.reward-rarity { font-size: 15px; font-weight: 800; letter-spacing: 2px; text-transform: uppercase; }
.reward-name { font-size: 26px; margin: 4px 0; }
.reward-amount { font-size: 36px; font-weight: 800; color: #b8860b; }
.reward-sub { font-weight: 600; color: var(--muted); font-size: 15px; margin-top: 4px; }
.rarity-common { color: #6b7280; }
.rarity-rare { color: var(--blue); }
.rarity-epic { color: #a24ff0; }
.rarity-legendary { color: #f59e0b; }
.chest-reveal.rare-glow { box-shadow: 0 0 0 4px var(--blue), var(--shadow); }
.chest-reveal.epic-glow { box-shadow: 0 0 0 4px #a24ff0, var(--shadow); }
.chest-reveal.legendary-glow { box-shadow: 0 0 0 5px #f59e0b, 0 0 60px rgba(245, 158, 11, 0.6), var(--shadow); }

/* ============================ Modales ============================ */
.modal-overlay {
  position: fixed; inset: 0; z-index: 50;
  background: rgba(20, 10, 60, 0.6);
  display: flex; align-items: center; justify-content: center; padding: 20px;
  animation: fadeIn 0.2s;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.modal {
  background: var(--card); border-radius: 26px; box-shadow: var(--shadow);
  padding: 30px 34px; max-width: 460px; width: 100%; text-align: center;
  animation: rewardPop 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.modal h2 { font-size: 26px; margin-bottom: 10px; }
.modal p { color: var(--muted); font-weight: 600; margin-bottom: 18px; line-height: 1.4; }
/* la popup « Votre avis » ⭐ (partagée carte accueil / page testeurs) */
.avis-modal { max-width: 480px; text-align: left; }
.avis-lead { font-size: 14.5px; margin-bottom: 14px; }
.avis-already {
  background: #efeffd; color: #4a3fae; border-radius: 12px;
  font-size: 13px; font-weight: 700; padding: 9px 13px; margin: 0 0 14px;
}
.avis-stars { display: flex; justify-content: center; gap: 6px; margin-bottom: 16px; }
.avis-star {
  background: none; border: none; cursor: pointer; padding: 2px 4px;
  font-family: var(--font); font-size: 40px; line-height: 1;
  color: #ddd8f2; transition: transform 0.1s, color 0.1s;
}
.avis-star:hover { transform: scale(1.15); }
.avis-star.on { color: var(--accent); text-shadow: 0 3px 0 rgba(224, 154, 0, 0.35); }
.avis-star:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; border-radius: 8px; }
.avis-txt {
  width: 100%; box-sizing: border-box; resize: vertical; min-height: 84px;
  font-family: var(--font); font-size: 14.5px; font-weight: 600; color: var(--ink);
  background: #fff; border: 3px solid #efeaff; border-radius: 14px; padding: 12px 14px;
}
.avis-txt:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.avis-publish {
  display: flex; align-items: flex-start; gap: 9px; margin: 12px 0 4px;
  font-size: 13px; font-weight: 600; color: var(--muted); line-height: 1.45;
  cursor: pointer; text-align: left;
}
.avis-publish input { width: 17px; height: 17px; margin-top: 1px; accent-color: var(--bg1); cursor: pointer; }
.avis-err { color: var(--red-dark); font-weight: 700; font-size: 13.5px; margin: 6px 0 0; }
.avis-row { display: flex; gap: 10px; justify-content: center; margin-top: 12px; }
.avis-send { flex: 1; }
/* Les boutons d'une popup : GROS et faciles à viser (le .btn de base
   n'a ni taille ni marge — hors quiz, il sortait tout petit).
   Exception : .shop-btn, les mini-boutons d'action des cartes boutique. */
.modal .btn:not(.shop-btn) { font-size: 17px; padding: 13px 26px; min-width: 160px; }
.modal .btn-big:not(.shop-btn) { font-size: 21px; padding: 15px 30px; min-width: 200px; }
.modal .btn-ghost:not(.shop-btn) { min-width: 130px; }
/* champs posés directement dans une modale (mot de passe RGPD…) :
   même habillage que les champs d'inscription */
.modal input[type="text"], .modal input[type="email"], .modal input[type="password"] {
  font-family: var(--font); font-size: 17px; font-weight: 700;
  padding: 12px 16px; margin: 2px 0 6px; width: 100%; box-sizing: border-box;
  border: 3px solid #e4e1f5; border-radius: 14px;
  color: var(--ink); background: #fff; outline: none; text-align: center;
}
.modal input[type="text"]:focus, .modal input[type="email"]:focus, .modal input[type="password"]:focus {
  border-color: var(--bg1);
}
@media (max-width: 560px) {
  .modal { padding: 24px 18px; }
  .modal .btn:not(.shop-btn) { min-width: 100%; }
}

.levelup-rays {
  width: 120px; height: 120px; margin: 0 auto 10px; border-radius: 50%;
  background: radial-gradient(circle, var(--accent), var(--accent2));
  display: flex; align-items: center; justify-content: center;
  font-size: 52px; font-weight: 800; color: #fff;
  box-shadow: 0 0 0 10px rgba(255,200,61,0.35), 0 0 70px rgba(255,200,61,0.8);
  animation: rewardPop 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* ============================ Confettis plein écran ============================ */
#modal-root .confetti-piece { position: fixed; font-size: 22px; z-index: 60; pointer-events: none; animation: confettiFall linear forwards; }
@keyframes confettiFall {
  0% { transform: translateY(-40px) rotate(0); opacity: 1; }
  100% { transform: translateY(105vh) rotate(720deg); opacity: 0.6; }
}

/* ============================ Avatar orné : auras & compagnons ============================ */
.avatar-wrap { position: relative; display: inline-flex; flex-shrink: 0; }
.aura-orb {
  position: absolute; font-size: 15px; pointer-events: none;
  animation: auraFloat 2.4s ease-in-out infinite;
  filter: drop-shadow(0 0 4px rgba(255, 255, 255, 0.7));
}
.aura-orb.o1 { top: -10px; left: -11px; }
.aura-orb.o2 { top: 38%; right: -14px; animation-delay: -0.8s; }
.aura-orb.o3 { bottom: -10px; left: 6%; animation-delay: -1.6s; }
.aura-feu { animation-name: auraFlame; }
.aura-glace { animation-name: auraFloat; }
.aura-eclair { animation-name: auraFlash; }
.aura-etoiles { animation-name: auraTwinkle; }
.aura-arcenciel { animation-name: auraRainbow; }
.aura-trefle { animation-name: auraFloat; filter: drop-shadow(0 0 5px #35c46a); }
.aura-demon { animation-name: auraFlash; filter: drop-shadow(0 0 6px rgba(255, 45, 85, 0.95)); }
.aura-galaxie { animation-name: auraGalaxie; animation-duration: 6s; }
@keyframes auraGalaxie {
  0% { filter: hue-rotate(0deg) drop-shadow(0 0 6px rgba(140, 100, 255, 0.95)); transform: translateY(0) scale(1); }
  50% { filter: hue-rotate(120deg) drop-shadow(0 0 8px rgba(80, 200, 255, 0.95)); transform: translateY(-4px) scale(1.15); }
  100% { filter: hue-rotate(240deg) drop-shadow(0 0 6px rgba(255, 100, 220, 0.95)); transform: translateY(0) scale(1); }
}
@keyframes auraFloat {
  0%, 100% { transform: translateY(0) rotate(-6deg); }
  50% { transform: translateY(-5px) rotate(8deg); }
}
@keyframes auraFlame {
  0%, 100% { transform: translateY(0) scale(1) rotate(-4deg); }
  35% { transform: translateY(-4px) scale(1.18) rotate(5deg); }
  70% { transform: translateY(-1px) scale(0.92) rotate(-6deg); }
}
@keyframes auraFlash {
  0%, 62%, 100% { opacity: 0.25; transform: scale(0.9); }
  70% { opacity: 1; transform: scale(1.25); }
  78% { opacity: 0.4; transform: scale(1); }
  86% { opacity: 1; transform: scale(1.2); }
}
@keyframes auraTwinkle {
  0%, 100% { opacity: 0.35; transform: scale(0.75) rotate(0); }
  50% { opacity: 1; transform: scale(1.2) rotate(25deg); }
}
@keyframes auraRainbow {
  0% { filter: hue-rotate(0deg) drop-shadow(0 0 4px #fff); transform: translateY(0); }
  50% { filter: hue-rotate(180deg) drop-shadow(0 0 6px #fff); transform: translateY(-4px); }
  100% { filter: hue-rotate(360deg) drop-shadow(0 0 4px #fff); transform: translateY(0); }
}
.pet-tag {
  position: absolute; right: -8px; bottom: -6px;
  font-size: 17px; line-height: 1; pointer-events: none;
  filter: drop-shadow(0 2px 3px rgba(0, 0, 0, 0.3));
  animation: petBob 1.6s ease-in-out infinite;
}
@keyframes petBob {
  0%, 100% { transform: translateY(0) rotate(-4deg); }
  50% { transform: translateY(-3px) rotate(5deg); }
}

/* Badge d'évolution de l'avatar : étoiles qui « flottent » au-dessus,
     un stade de plus tous les 5 niveaux (idée de Johan) */
.evo-badge {
  position: absolute; top: -12px; left: 50%; transform: translateX(-50%);
  font-size: 12px; line-height: 1; pointer-events: none; z-index: 3;
  background: linear-gradient(135deg, #ffe07a, var(--accent2));
  border-radius: 999px; padding: 3px 7px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3), inset 0 -2px 0 rgba(0, 0, 0, 0.12);
  animation: evoBob 2.2s ease-in-out infinite;
}
.evo-badge.evo-4 { font-size: 14px; padding: 4px 9px; }
@keyframes evoBob {
  0%, 100% { transform: translateX(-50%) translateY(0); }
  50% { transform: translateX(-50%) translateY(-3px); }
}

/* ============================ Collection 🏅 ============================ */
.collection-slot { margin-bottom: 16px; }
.collection-title { color: #fff; font-weight: 800; font-size: 17px; margin-bottom: 8px; }
.collection-title small { font-weight: 600; font-size: 13px; opacity: 0.8; margin-left: 6px; }
.collection-row { display: flex; gap: 10px; flex-wrap: wrap; }
.relic {
  display: inline-flex; align-items: center; gap: 8px;
  background: rgba(255,255,255,0.16); color: rgba(255,255,255,0.8);
  border: 2px dashed rgba(255,255,255,0.45);
  border-radius: 16px; padding: 8px 14px;
  font-weight: 800; font-size: 15px; cursor: default;
}
.relic-emoji { font-size: 22px; filter: grayscale(1); opacity: 0.75; }
.relic.unlocked {
  background: linear-gradient(135deg, #fff7e0, #ffe9b8); color: var(--ink);
  border: 2px solid var(--accent);
  box-shadow: 0 4px 14px rgba(255,200,61,0.4);
}
.relic.unlocked .relic-emoji { filter: none; opacity: 1; }
.collection-done { margin-top: 8px; color: #fff; font-weight: 800; font-size: 15px; text-shadow: 0 2px 8px rgba(0,0,0,0.3); }

/* ============================ Badge calculatrice ============================ */
.badge.calc { background: #e0f2fe; color: #0369a1; }

/* ============================ Fond animé du quiz ============================ */
#quiz-deco { position: absolute; inset: 0; pointer-events: none; z-index: 0; overflow: hidden; }
#quiz-deco span { position: absolute; opacity: 0.4; animation: floaty 9s ease-in-out infinite; }
#screen-quiz > *:not(#quiz-deco) { position: relative; z-index: 1; }

/* Bandeau pédagogique du 1er exercice (champ intro d'un chapitre) */
.quiz-intro {
  background: var(--card); color: var(--ink);
  border: 3px solid var(--accent); border-radius: 16px;
  padding: 12px 18px; margin-bottom: 12px;
  font-size: 16px; font-weight: 700; line-height: 1.45;
  box-shadow: var(--shadow);
  animation: popIn 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* ============================ En-tête question + calculatrice ============================ */
.q-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 8px; }
.btn-calc {
  font-family: var(--font); font-weight: 800; font-size: 14px;
  background: #e0f2fe; color: #0369a1; border: 2px solid #7dd3fc;
  border-radius: 12px; padding: 5px 12px; cursor: pointer; transition: transform 0.12s;
}
.btn-calc:hover { transform: scale(1.06); }

.calc-modal h2 { margin-bottom: 12px; }
.calc-screen {
  background: #1e1b3a; color: #7dffc3; font-family: "Consolas", monospace;
  font-size: 30px; font-weight: 700; text-align: right;
  border-radius: 16px; padding: 12px 16px; margin-bottom: 12px;
  overflow: hidden; white-space: nowrap;
  box-shadow: inset 0 3px 8px rgba(0, 0, 0, 0.5);
}
.calc-pad { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-bottom: 16px; }
.calc-key {
  font-family: var(--font); font-size: 22px; font-weight: 800;
  background: #f0eefb; color: var(--ink); border: none; border-radius: 14px;
  padding: 12px 0; cursor: pointer; transition: transform 0.08s, background 0.12s;
}
.calc-key:hover { background: #e4e0f7; }
.calc-key:active { transform: scale(0.94); }
.calc-key.op { background: #ffe3c2; color: #9a4a00; }
.calc-key.eq { background: var(--green); color: #fff; grid-column: span 2; }
.calc-key.clr { background: #ffe9ec; color: var(--red); }

/* ============================ Feedback : réponse + pas-à-pas ============================ */
.feedback .fb-answer {
  display: inline-flex; align-items: center; gap: 6px; flex-wrap: wrap;
  background: #fff; color: var(--ink);
  border-radius: 12px; padding: 8px 14px; margin: 8px 0;
  font-size: 18px;
}
.feedback .fb-answer b { color: var(--green-dark); font-size: 20px; }
.feedback .fb-how {
  background: #fff; color: var(--ink);
  border-radius: 14px; padding: 12px 16px; margin-top: 8px;
  text-align: left;
}
.feedback .fb-how-title { font-weight: 800; font-size: 17px; margin-bottom: 4px; }
.feedback .fb-how-text {
  font-weight: 600; font-size: 17px; line-height: 1.55;
  white-space: pre-line; color: #44415f;
}

.rarity-mythic { color: #7c3aed; }
.chest-reveal.mythic-glow {
  box-shadow: 0 0 0 5px #7c3aed, 0 0 70px rgba(124, 58, 237, 0.65), var(--shadow);
}

/* ============================ Boutique ============================ */
.modal-shop { max-width: 620px; max-height: 88vh; overflow-y: auto; text-align: center; }
.shop-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 6px; }
.shop-head h2 { margin-bottom: 0; }
.shop-balance { cursor: default; font-size: 15px; }
.shop-intro { color: var(--muted); font-weight: 600; font-size: 15px; margin: 6px 0 10px; }
.shop-tabs { display: flex; gap: 8px; margin-bottom: 12px; }
.shop-tab {
  flex: 1; font-family: var(--font); font-size: 16px; font-weight: 800;
  padding: 10px 4px; border-radius: 14px; border: 3px solid #e4e1f5;
  background: #fff; color: var(--muted); cursor: pointer; transition: all 0.15s;
}
.shop-tab.active { background: var(--bg1); border-color: var(--bg1); color: #fff; box-shadow: 0 4px 0 var(--blue-dark); }
.shop-base { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin-bottom: 12px; }
.shop-base-label { width: 100%; color: var(--muted); font-weight: 700; font-size: 13px; text-transform: uppercase; letter-spacing: 0.5px; }
.shop-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; margin-bottom: 14px; }
.shop-item {
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  background: #faf9ff; border: 3px solid #e4e1f5; border-radius: 18px;
  padding: 12px 8px; font-family: var(--font); transition: transform 0.12s, border-color 0.12s;
}
.shop-item:hover { transform: translateY(-2px); border-color: var(--bg1); }
.shop-item.mini { width: 64px; padding: 8px 4px; }
.shop-item.is-owned { border-color: var(--green); background: #f4fdf8; }
.shop-item.is-equipped { border-color: var(--accent); background: #fffbec; }
.shop-emoji {
  width: 52px; height: 52px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 30px; box-shadow: inset 0 -4px 0 rgba(0, 0, 0, 0.12);
}
.shop-item.mini .shop-emoji { width: 38px; height: 38px; font-size: 22px; }
.shop-name { font-weight: 800; font-size: 14px; }
.shop-btn { font-size: 15px; padding: 7px 14px; border-radius: 12px; }
.btn-locked { background: #b9b5d5; box-shadow: 0 6px 0 #8f8bb0; }
.btn-locked:active { box-shadow: 0 1px 0 #8f8bb0; }
.shop-state { font-weight: 800; font-size: 14px; padding: 6px 10px; border-radius: 12px; }
.shop-state.equipped { background: var(--accent); color: var(--ink); }
.shop-state.owned { background: #e3f8ec; color: var(--green-dark); }
.shop-msg {
  background: #ffe9ec; color: var(--red-dark);
  border-radius: 12px; padding: 10px 14px; margin-bottom: 12px;
  font-weight: 700; font-size: 15px;
}

/* ============================ Responsive ============================ */
@media (max-width: 640px) {
  .screen { padding: 14px 12px 40px; }
  .topbar { gap: 7px; }
  .shop-label { display: none; }
  .streak-chip small { display: none; }
  .avatar-meta small { display: none; }
  .xp-wrap { min-width: 120px; }
  .quiz-top { gap: 7px; }
  .quiz-top .chip { padding: 8px 10px; }
  .collection-title small { display: block; margin: 2px 0 0; }
  .avatar-grid { grid-template-columns: repeat(4, 1fr); }
  .q-card { padding: 18px; }
  .chest-stage { transform: scale(0.85); }
  .paire-chip { font-size: 14px; padding: 10px 10px; }
  .ordre-chip { font-size: 15px; padding: 9px 14px; }
  .ordre-slot { font-size: 15px; }
}
@media (min-width: 900px) {
  .pips { max-width: 420px; }
}
@media (max-width: 400px) {
  .nz-chip small { display: none; }
  .aura-orb { font-size: 12px; }
  .shop-tab { font-size: 13px; }
}

/* ============================ Comptes en ligne ============================ */
.auth-card {
  max-width: 460px;
  width: 100%;
  margin: 0 auto;
  padding: 26px 28px 30px;
  display: flex;
  flex-direction: column;
}
.auth-card.wide { max-width: 540px; }
.auth-card h2 { text-align: center; font-size: 28px; margin-bottom: 14px; }
.auth-card input[type="text"],
.auth-card input[type="email"],
.auth-card input[type="password"],
.auth-card select,
#reset-pass, #reset-pass2 {
  width: 100%;
  font-family: var(--font);
  font-size: 20px;
  font-weight: 700;
  padding: 12px 16px;
  border: 3px solid #e4e1f5;
  border-radius: 16px;
  color: var(--ink);
  outline: none;
  transition: border-color 0.15s;
  background: #fff;
}
.auth-card input:focus, .auth-card select:focus { border-color: var(--bg1); }
/* la modale profil réutilise le style des champs d'inscription */
.modal select {
  font-family: var(--font);
  font-size: 16px;
  font-weight: 700;
  padding: 8px 12px;
  border: 3px solid #e4e1f5;
  border-radius: 12px;
  color: var(--ink);
  background: #fff;
  outline: none;
}
.modal select:focus { border-color: var(--bg1); }

.form-err {
  background: #fdecee;
  color: var(--red-dark);
  border: 2px solid #f8c3ca;
  border-radius: 12px;
  font-size: 15px;
  font-weight: 700;
  padding: 10px 14px;
  margin-top: 14px;
}
/* Note contextuelle de l'écran inscription (ex. arrivée depuis un lien
   « Jouer ce sujet » d'une page ressource) */
.reg-note {
  background: #fff0c9;
  color: #7a5200;
  border-radius: 12px;
  font-size: 15px;
  font-weight: 700;
  padding: 10px 14px;
  margin-top: 14px;
  line-height: 1.5;
}
.auth-links {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-top: 18px;
  color: var(--muted);
  font-weight: 700;
}
.auth-link {
  background: none;
  border: none;
  font-family: var(--font);
  font-size: 15px;
  font-weight: 800;
  color: var(--blue-dark);
  cursor: pointer;
  text-decoration: underline;
  padding: 2px;
}
.auth-link:hover { color: var(--bg1); }

/* code à 6 chiffres */
.code-row { display: flex; gap: 8px; justify-content: center; margin: 18px 0 4px; }
.code-digit {
  width: 52px;
  height: 64px;
  text-align: center;
  font-family: var(--font);
  font-size: 32px;
  font-weight: 800;
  border: 3px solid #e4e1f5;
  border-radius: 14px;
  color: var(--ink);
  outline: none;
  transition: border-color 0.12s, transform 0.12s;
}
.code-digit:focus { border-color: var(--bg1); transform: scale(1.06); }

/* écran de démarrage */
.boot-logo { animation: bootPulse 1.6s ease-in-out infinite; }
@keyframes bootPulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.05); }
}
.boot-note { text-align: center; color: rgba(255,255,255,0.85); font-size: 18px; font-weight: 700; margin-top: 10px; }

/* bandeau réseau (hors-ligne / resynchro) */
.net-banner {
  position: fixed;
  top: 12px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 900;
  background: var(--ink);
  color: #fff;
  font-size: 14px;
  font-weight: 700;
  padding: 10px 18px;
  border-radius: 14px;
  box-shadow: 0 8px 22px rgba(0,0,0,0.3);
  max-width: 92vw;
  text-align: center;
}

/* ============================ Coach du jour 🧠 ============================ */
.coach-slot { margin-bottom: 16px; }
.coach-card {
  background: linear-gradient(135deg, #fffdf4, #fff3d6);
  border: 2px solid var(--accent);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 16px 20px;
}
.coach-head {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 17px;
  color: var(--ink);
  margin-bottom: 6px;
}
.coach-emoji {
  font-size: 24px;
  background: var(--accent);
  border-radius: 12px;
  padding: 4px 7px;
  box-shadow: inset 0 -3px 0 rgba(0,0,0,0.12);
}
.coach-msg {
  font-size: 16px;
  font-weight: 600;
  line-height: 1.45;
  color: var(--ink);
  white-space: pre-wrap;
}
.coach-more {
  margin-top: 8px;
  background: none;
  border: none;
  font-family: var(--font);
  font-size: 13px;
  font-weight: 800;
  color: var(--muted);
  cursor: pointer;
  text-decoration: underline;
}
.coach-hist { display: flex; flex-direction: column; gap: 12px; max-height: 52vh; overflow-y: auto; padding: 4px; }
.coach-hist-item { background: #f6f4ff; border-radius: 14px; padding: 10px 14px; }
.coach-hist-item b { color: var(--muted); font-size: 13px; text-transform: capitalize; }
.coach-hist-item p { font-size: 15px; font-weight: 600; margin-top: 2px; }

@media (max-width: 560px) {
  .code-digit { width: 44px; height: 56px; font-size: 26px; }
  .avatar-grid { grid-template-columns: repeat(4, 1fr); }
}

/* ============================================================
   Rangs 🏆 (Bronze → Unreal Legends), carte profil, accueil 3
   colonnes, machine à sous, quêtes, accompagnement quiz
   ============================================================ */

/* ---------- badges de palier (carte profil) ---------- */
.rank-badge {
  display: inline-block;
  border-radius: 12px;
  padding: 4px 12px;
  color: #fff;
  font-weight: 800;
  font-size: 14px;
  text-shadow: 0 1px 2px rgba(0,0,0,0.25);
  box-shadow: inset 0 -3px 0 rgba(0,0,0,0.18), 0 3px 8px rgba(0,0,0,0.18);
  white-space: nowrap;
}
.rank-badge.big { font-size: 18px; padding: 6px 16px; border-radius: 14px; }
.rank-promo-badge {
  display: inline-block;
  border-radius: 18px;
  padding: 12px 26px;
  color: #fff;
  font-weight: 800;
  font-size: 26px;
  text-shadow: 0 2px 3px rgba(0,0,0,0.3);
  box-shadow: inset 0 -4px 0 rgba(0,0,0,0.2), 0 8px 24px rgba(0,0,0,0.3);
  margin-bottom: 10px;
  animation: popIn 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* ---------- reliques (fiche profil du menu compte) ---------- */
.relic-mini {
  background: #f0eefb; border-radius: 10px; padding: 5px 8px;
  font-size: 15px; filter: grayscale(1); opacity: 0.6; white-space: nowrap;
}
.relic-mini.unlocked { filter: none; opacity: 1; background: #fff3d6; }

.placement-done-msg {
  background: #fff; color: var(--ink);
  border-radius: 12px; padding: 8px 14px; margin-top: 6px;
  font-size: 15px; font-weight: 700;
}

/* ---------- accueil : le jackpot sur 1 colonne, les quêtes sur 2 ---------- */
.home-columns {
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: 14px;
  align-items: stretch;
  margin-bottom: 20px;
}
.home-col { display: flex; }
.home-col > * { flex: 1; }
.home-card {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  border: 4px solid transparent;
  padding: 16px;
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  text-align: center;
  font-family: var(--font);
  cursor: pointer;
  transition: transform 0.14s, border-color 0.14s;
}
.home-card:hover { transform: translateY(-4px); border-color: var(--accent); }
.home-card-icon { font-size: 40px; line-height: 1.1; }
.home-card-title { font-size: 18px; font-weight: 800; }
.home-card-sub { color: var(--muted); font-size: 13.5px; font-weight: 600; line-height: 1.4; }

/* carte machine à sous : légèrement flashy pour attirer l'œil */
.slot-card {
  background: linear-gradient(160deg, #fff, #fff6e0);
  border-color: var(--accent);
}

/* ---------- quêtes journalières ----------
   Même entête que la machine à sous (slot-head) : titre 📋 + compteur
   ✅ réussies/total en haut à droite. La carte est large (2 colonnes
   de la grille d'accueil) : les quêtes se posent en 2×2 sur écran
   large, en liste sur écran réduit. */
.quests-card { cursor: default; align-items: stretch; }
.quests-card:hover { transform: none; border-color: transparent; }
.quests-list {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: 10px; margin-top: 10px;
  flex: 1; grid-auto-rows: minmax(0, 1fr); /* la liste remplit la carte (hauteur du jackpot) */
  align-content: stretch;
}
/* entrée en cascade : au 1er affichage de la journée seulement */
.quests-list.stagger .quest-item { animation: questIn 0.45s cubic-bezier(0.22, 1.4, 0.36, 1) backwards; }
@keyframes questIn {
  from { opacity: 0; transform: translateY(10px) scale(0.96); }
  to { opacity: 1; transform: none; }
}
.quest-item {
  display: flex; align-items: center; gap: 10px;
  background: #faf9ff; border: 2px solid #e4e1f5;
  border-radius: 14px; padding: 8px 10px;
  text-align: left;
}
.quest-item.done { border-color: var(--green); background: #f4fdf8; }
.quest-item.claimed { opacity: 0.6; }
/* la quête qui vient de passer « réussie » : pop unique */
.quest-item.fresh { animation: questFresh 0.7s cubic-bezier(0.34, 1.56, 0.64, 1); }
@keyframes questFresh {
  0% { transform: scale(1); box-shadow: none; }
  35% { transform: scale(1.035); box-shadow: 0 8px 20px rgba(89, 227, 143, 0.35); }
  100% { transform: scale(1); box-shadow: none; }
}
.quest-emoji { font-size: 22px; flex-shrink: 0; }
.quest-body { flex: 1; display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.quest-label { font-size: 13.5px; font-weight: 800; line-height: 1.25; }
.quest-bar {
  height: 8px; border-radius: 6px; background: rgba(0,0,0,0.1); overflow: hidden;
}
.quest-fill {
  display: block; height: 100%; border-radius: 6px;
  background: linear-gradient(90deg, #ffe07a, var(--accent2));
  transition: width 0.4s;
}
.quest-item.done .quest-fill { background: linear-gradient(90deg, #59e38f, var(--green)); }
.quest-progress { font-size: 11.5px; font-weight: 700; color: var(--muted); }
/* la récompense de quête est un COFFRE : rappel du niveau sous la barre */
.quest-chest { font-size: 11.5px; font-weight: 800; color: #8a6d00; }
/* popup « Ouvre ton coffre du jour ! » (1ʳᵉ visite du jour) */
.daily-popup-gift { font-size: 56px; line-height: 1; margin-bottom: 8px; }
.quest-claim {
  flex-shrink: 0; white-space: nowrap;
  font-family: var(--font); font-weight: 800; font-size: 13.5px;
  border: none; border-radius: 12px; padding: 8px 11px; cursor: pointer;
  background: var(--green); color: #fff;
  box-shadow: 0 4px 0 var(--green-dark);
  transition: transform 0.12s;
}
.quest-claim:active { transform: translateY(2px); box-shadow: 0 2px 0 var(--green-dark); }
.quest-claim.waiting { background: #e4e1f5; color: var(--muted); box-shadow: none; cursor: default; }
/* coffre prêt : le bouton respire — c'est LUI qui donne envie de cliquer */
.quest-claim.ready { animation: questReady 1.5s ease-in-out infinite; }
.quest-claim.ready:active { animation: none; }
@keyframes questReady {
  0%, 100% { transform: translateY(0); box-shadow: 0 4px 0 var(--green-dark); }
  50% { transform: translateY(-2px); box-shadow: 0 6px 0 var(--green-dark); }
}
.quest-claimed { font-size: 22px; color: var(--green-dark); flex-shrink: 0; }
.quests-reminder {
  margin: 10px 0 0;
  padding: 8px 12px;
  border-radius: 12px;
  background: #f4fdf8;
  border: 2px dashed var(--green);
  color: var(--green-dark);
  font-size: 13px;
  font-weight: 800;
  text-align: center;
}
/* le mouvement célèbre un changement : rien ne bouge en boucle si
   l'utilisateur demande moins d'animations (la pulsation du bouton
   prêt disparaît, l'info reste) */
@media (prefers-reduced-motion: reduce) {
  .quests-list.stagger .quest-item, .quest-item.fresh, .quest-claim.ready { animation: none !important; }
}

/* ---------- cartes matières de l'accueil (slot · quêtes · Mission · matières) ---------- */
/* Elles font office d'onglets : cliquer une matière affiche ses sujets,
   la carte sélectionnée est mise en valeur. */
.subjects-cards {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px; margin-bottom: 18px;
}

/* ---------- titre de section de l'accueil ----------
   Sépare la ligne « bonus » (slot, quêtes, enchère, Max) du cœur du
   jeu : les matières. Même filet que les têtes d'année des sujets. */
.home-section-head {
  display: flex; align-items: center; gap: 12px;
  margin: 2px 2px 12px;
}
.home-section-head h2 {
  margin: 0; font-family: var(--font);
  font-size: 21px; font-weight: 900; letter-spacing: 0.2px;
  color: #fff; text-shadow: 0 2px 6px rgba(30, 15, 80, 0.35);
  white-space: nowrap;
}
.home-section-head::after {
  content: ""; flex: 1; height: 3px; border-radius: 3px;
  background: rgba(255, 255, 255, 0.25);
}
.subject-home-card {
  display: flex; flex-direction: column; gap: 10px; align-items: stretch;
  font-family: var(--font); text-align: left; cursor: pointer;
}
.subject-home-card:hover { transform: translateY(-4px); border-color: var(--accent); }
.subject-home-card.selected {
  border-color: var(--accent-dark);
  background: linear-gradient(165deg, #ffffff 55%, #efecff 100%);
  box-shadow: 0 10px 26px rgba(48, 35, 150, 0.28);
}
.shc-head { display: flex; align-items: center; gap: 12px; }
/* l'emoji posé sur sa tuile colorée : la matière a SA couleur (iconBg) */
.shc-emoji {
  font-size: 30px; line-height: 1; flex: 0 0 auto;
  width: 54px; height: 54px; border-radius: 15px;
  display: inline-flex; align-items: center; justify-content: center;
  box-shadow: inset 0 -3px 0 rgba(0, 0, 0, 0.08);
}
.shc-title { font-size: 20px; font-weight: 900; color: var(--ink); }
/* les classes concernées (« 6ème à 3ème »), sous le titre de la matière —
   et « hors programme » (l'IA) dans une teinte violette qui la distingue */
.shc-levels {
  align-self: flex-start; margin: -4px 0 0 66px;
  font-size: 12px; font-weight: 800; color: var(--muted);
  background: rgba(45, 42, 74, 0.08); border-radius: 20px; padding: 2px 10px;
}
.shc-levels.hp { color: #5b3df5; background: rgba(91, 61, 245, 0.1); }
/* la progression en étoiles : la même barre que le rang (elle raconte
   d'un coup d'œil où l'élève en est dans la matière) */
.shc-progress { display: flex; flex-direction: column; gap: 4px; }
.shc-bar {
  height: 9px; border-radius: 6px;
  background: rgba(45, 42, 74, 0.12); overflow: hidden;
}
.shc-fill {
  display: block; height: 100%; border-radius: 6px;
  background: linear-gradient(90deg, #ffd75e, #ff9d2e);
  box-shadow: inset 0 -2px 0 rgba(0, 0, 0, 0.12);
  transition: width 0.4s;
}
.shc-progress.done .shc-fill { background: linear-gradient(90deg, #59e38f, var(--green)); }
.shc-cote { font-size: 13px; font-weight: 800; color: var(--muted); white-space: nowrap; }
.shc-cote.ok { color: var(--green-dark); }
.shc-cta { margin-top: auto; align-self: flex-end; font-size: 13.5px; font-weight: 800; color: var(--muted); white-space: nowrap; }
.subject-home-card:hover .shc-cta { color: var(--accent-dark); }
.subject-home-card.selected .shc-cta { color: var(--accent-dark); }

/* ---------- bouton « retour en haut » ----------
   La page d'accueil est longue (sujets ouverts surtout) : une pastille
   dorée en bas à droite, qui n'apparaît qu'au-delà du premier écran
   et disparaît hors de l'accueil (quiz, compte…). */
.to-top {
  position: fixed; right: 18px; bottom: 18px; z-index: 40;
  width: 52px; height: 52px; border-radius: 50%;
  border: none; cursor: pointer;
  font-family: var(--font); font-size: 24px; font-weight: 900; line-height: 1;
  color: #5a4200;
  background: linear-gradient(160deg, #ffe07a, #ffb521);
  box-shadow: 0 6px 0 #c98a12, 0 14px 26px rgba(40, 20, 90, 0.35);
  opacity: 0; transform: translateY(14px); pointer-events: none;
  transition: opacity 0.25s, transform 0.25s;
}
.to-top.show { opacity: 1; transform: none; pointer-events: auto; }
.to-top:active { transform: translateY(3px); box-shadow: 0 3px 0 #c98a12, 0 8px 16px rgba(40, 20, 90, 0.35); }
@media (prefers-reduced-motion: reduce) {
  .to-top { transition: none; }
}
.subjects-panel.hidden { display: none; }
.subjects-panel { margin-bottom: 18px; }

/* ---------- sections par année scolaire (révision libre, la classe de l'élève en avant) ---------- */
.lvl-head { grid-column: 1 / -1; display: flex; align-items: baseline; gap: 10px; margin: 8px 0 2px; }
.year-pill {
  padding: 3px 14px; border-radius: 999px; color: #fff;
  font-weight: 800; font-size: 14px; letter-spacing: 0.5px;
  background: linear-gradient(135deg, #8f9bb3, #5d6885);
  text-shadow: 0 1px 2px rgba(30, 20, 90, 0.25);
  white-space: nowrap;
}
.year-tag {
  font-size: 13px; font-weight: 800; color: #fff;
  text-shadow: 0 2px 6px rgba(30, 15, 80, 0.35);
  white-space: nowrap;
}
.lvl-head::after { content: ""; flex: 1; height: 2px; border-radius: 2px; background: rgba(255,255,255,0.25); }
/* la classe de l'élève : pill dorée + point pulsant (le repère « ta classe ») */
.lvl-head.year-current { position: relative; }
.lvl-head.year-current .year-pill {
  background: linear-gradient(135deg, #ffd75e, #d9a021);
  color: #5a4200; text-shadow: none;
}
.lvl-head.year-current::before {
  content: ""; width: 8px; height: 8px; border-radius: 50%;
  background: #ffd75e; align-self: center; flex: none;
  box-shadow: 0 0 8px 2px rgba(255, 215, 94, 0.8);
  animation: yearGlow 2.4s ease-in-out infinite;
}
@keyframes yearGlow { 0%, 100% { opacity: 0.2; } 50% { opacity: 1; } }
@media (prefers-reduced-motion: reduce) {
  .lvl-head.year-current::before { animation: none; }
}

/* ---------- carte « bientôt disponible » ---------- */
.chapter-card.soon-card { border-style: dashed; border-color: rgba(122, 118, 160, 0.35); cursor: default; }
.chapter-card.soon-card:hover { transform: none; border-color: rgba(122, 118, 160, 0.35); }
.btn-gold { background: linear-gradient(180deg, #ffe07a, #ffb42e); color: #5a4500; box-shadow: 0 6px 0 #d99414; }
.btn-gold:active { box-shadow: 0 1px 0 #d99414; }

/* ---------- quiz : étiquette « matière · sujet » ---------- */
.q-meta { display: flex; align-items: center; gap: 10px; min-width: 0; flex: 1; }
.q-topic {
  display: inline-block; max-width: 100%;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  background: #eef2ff; color: #4b45b5;
  font-size: 13px; font-weight: 800; padding: 3px 12px; border-radius: 999px;
}

/* ---------- quiz : « Un problème avec cette question ? » ----------
   Un lien TEXTE discret sous la carte (une action rare, jamais un
   appel constant à l'écran) : un libellé qu'on comprend, aucune
   icône cryptique dans l'entête. Blanc translucide comme les autres
   textes secondaires du quiz (input-hint) — sur le fond violet, le
   gris « muted » des cartes blanches devient illisible — et il se
   réveille au survol. */
.btn-qreport {
  display: block; margin: -10px auto 6px;
  background: none; border: none; cursor: pointer;
  font-family: var(--font); font-size: 13px; font-weight: 700;
  color: rgba(255, 255, 255, 0.72); padding: 6px 14px; border-radius: 10px;
  text-decoration: underline; text-decoration-color: transparent;
  text-underline-offset: 3px;
  transition: color 0.15s ease, text-decoration-color 0.15s ease;
}
.btn-qreport:hover { color: #fff; text-decoration-color: currentColor; }
.report-quote {
  font-size: 14px; color: var(--muted); background: #f4f2fb;
  border-radius: 10px; padding: 10px 12px; margin-bottom: 14px;
  text-align: left; line-height: 1.45;
}
.report-comment {
  width: 100%; min-height: 96px; resize: vertical; font-family: inherit;
  font-size: 15px; font-weight: 600; color: var(--ink);
  padding: 10px 12px; border: 2px solid #e6e3f2; border-radius: 10px; outline: none;
}
.report-comment:focus { border-color: var(--bg1); }
.report-comment::placeholder { color: var(--muted); font-weight: 500; }

/* rappel doux « écris ta réponse » */
.feedback.warn {
  background: #fffbea; color: var(--accent-dark); border: 3px solid var(--accent);
}

/* champ vide refusé : petite secousse */
.shake { animation: shake 0.4s; }
@keyframes shake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-7px); }
  40% { transform: translateX(7px); }
  60% { transform: translateX(-5px); }
  80% { transform: translateX(5px); }
}

/* ---------- machine à sous 🎰 (intégrée à la colonne accueil) ---------- */
.slot-card {
  padding: 14px 14px 16px;
  gap: 10px;
  cursor: default;
}
.slot-card:hover { transform: none; border-color: var(--accent); }
.slot-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 8px; width: 100%;
}
.slot-title {
  display: flex; align-items: center; gap: 7px;
  font-size: 16.5px; font-weight: 800; line-height: 1.15; text-align: left;
}
.slot-ico { font-size: 22px; }
.slot-balance {
  display: inline-flex; align-items: center; gap: 5px;
  background: #f0eefb; border-radius: 12px; padding: 5px 11px;
  font-size: 14px; font-weight: 800; color: var(--ink); white-space: nowrap;
}
.slot-balance b { font-size: 16px; color: var(--accent-dark); }
.slot-balance.bump { animation: balanceBump 0.55s cubic-bezier(0.34, 1.56, 0.64, 1); }
@keyframes balanceBump { 0% { transform: scale(1); } 40% { transform: scale(1.15); } 100% { transform: scale(1); } }

/* le cabinet : panneau sombre façon borne, à l'intérieur de la carte */
.slot-cabinet {
  width: 100%;
  background: linear-gradient(180deg, #2d2a4a, #201d3d);
  border-radius: 18px;
  padding: 12px 10px 11px;
  box-shadow: inset 0 2px 0 rgba(255,255,255,0.09), inset 0 -3px 0 rgba(0,0,0,0.4), 0 4px 14px rgba(25,15,70,0.35);
}
.slot-cabinet.jackpot { animation: cabinetGlow 1.1s ease-in-out infinite; }
@keyframes cabinetGlow {
  0%, 100% {
    box-shadow: inset 0 2px 0 rgba(255,255,255,0.09), inset 0 -3px 0 rgba(0,0,0,0.4),
      0 4px 14px rgba(25,15,70,0.35), 0 0 16px rgba(255,200,61,0.55);
  }
  50% {
    box-shadow: inset 0 2px 0 rgba(255,255,255,0.09), inset 0 -3px 0 rgba(0,0,0,0.4),
      0 4px 14px rgba(25,15,70,0.35), 0 0 42px rgba(255,200,61,0.95);
  }
}

/* anticipation : le 3e rouleau prolonge — la payline et le cabinet
   pulsent en attendant le verdict */
.slot-cabinet.anticipation { animation: cabinetAnticipate 0.9s ease-in-out infinite; }
@keyframes cabinetAnticipate {
  0%, 100% {
    box-shadow: inset 0 2px 0 rgba(255,255,255,0.09), inset 0 -3px 0 rgba(0,0,0,0.4),
      0 4px 14px rgba(25,15,70,0.35), 0 0 10px rgba(255,200,61,0.3);
  }
  50% {
    box-shadow: inset 0 2px 0 rgba(255,255,255,0.09), inset 0 -3px 0 rgba(0,0,0,0.4),
      0 4px 14px rgba(25,15,70,0.35), 0 0 26px rgba(255,200,61,0.65);
  }
}
.slot-cabinet.anticipation .slot-payline {
  opacity: 0.95;
  box-shadow: 0 0 12px rgba(255,200,61,0.8);
  animation: paylineBlink 0.55s ease-in-out infinite;
}
@keyframes paylineBlink { 0%, 100% { opacity: 0.15; } 50% { opacity: 0.95; } }

.slot-reels { position: relative; display: flex; gap: 8px; }
.slot-reel {
  position: relative; flex: 1; height: 116px;
  background: linear-gradient(180deg, #4a4478, #37325e);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: inset 0 5px 12px rgba(0,0,0,0.5), inset 0 -5px 12px rgba(0,0,0,0.5), inset 0 0 0 1px rgba(255,255,255,0.07);
}
.slot-reel.landed { animation: reelLand 0.3s cubic-bezier(0.34, 1.56, 0.64, 1); }
@keyframes reelLand { 0% { transform: scale(1.06); } 100% { transform: scale(1); } }
.slot-strip { will-change: transform; }
.slot-strip span {
  display: flex; align-items: center; justify-content: center;
  height: 80px; font-size: 44px; line-height: 1;
}
.slot-strip span:nth-child(even) { background: rgba(255,255,255,0.04); }
/* incurvation du rouleau : ombre en haut et en bas de la fenêtre */
.slot-reel::after {
  content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none;
  background: linear-gradient(180deg, rgba(12,9,34,0.62), rgba(12,9,34,0) 34%, rgba(12,9,34,0) 66%, rgba(12,9,34,0.62));
}

/* ligne de paiement : encoches dorées + trait lumineux quand on gagne */
.slot-payline {
  position: absolute; left: 3px; right: 3px; top: 50%; height: 3px; z-index: 2;
  transform: translateY(-50%);
  background: linear-gradient(90deg, transparent, var(--accent) 16%, #fff3c4 50%, var(--accent) 84%, transparent);
  border-radius: 2px; opacity: 0; pointer-events: none;
  transition: opacity 0.18s;
}
.slot-cabinet.win .slot-payline { opacity: 0.95; box-shadow: 0 0 14px rgba(255,200,61,0.9); }
.slot-pay-notch {
  position: absolute; top: 50%; transform: translateY(-50%); z-index: 3;
  width: 0; height: 0;
  border-top: 7px solid transparent; border-bottom: 7px solid transparent;
  filter: drop-shadow(0 1px 2px rgba(0,0,0,0.65));
}
.slot-pay-notch.left { left: -3px; border-right: 9px solid var(--accent); }
.slot-pay-notch.right { right: -3px; border-left: 9px solid var(--accent); }

/* tableau des gains : seuls les brelans paient */
.slot-paytable {
  display: flex; align-items: center; justify-content: center; flex-wrap: wrap;
  gap: 5px; margin-top: 10px;
}
.pt-label { color: rgba(255,255,255,0.6); font-size: 11.5px; font-weight: 800; margin-right: 2px; }
.pt-chip {
  display: inline-flex; align-items: center; gap: 3px;
  background: #3a3562; color: #fff;
  border-radius: 9px; padding: 3px 8px;
  font-size: 12px; font-weight: 800;
  transition: transform 0.15s, background 0.15s;
}
.pt-chip b { color: var(--accent); }
.pt-chip.hit { background: var(--accent); color: var(--ink); transform: scale(1.12); }
.pt-chip.hit b { color: var(--ink); }

/* ligne « 2 identiques = relance gratuite » (la paire offre du jeu) */
.slot-pairline {
  display: flex; align-items: center; justify-content: center; gap: 5px;
  margin-top: 6px;
}
.pt-chip.pt-pair { background: #2e2a55; }
.pt-chip.pt-pair b { color: #c9b8ff; }

/* écran d'affichage façon LED, en bas du cabinet */
.slot-display {
  margin-top: 9px;
  background: #16132e;
  border-radius: 10px;
  padding: 8px 10px;
  min-height: 36px;
  display: flex; align-items: center; justify-content: center;
  text-align: center;
  font-size: 13.5px; font-weight: 800; line-height: 1.3;
  color: #e8e5ff;
  box-shadow: inset 0 2px 6px rgba(0,0,0,0.55);
}
.slot-display.win { color: #ffd76e; }
.slot-display.big { color: #ffd76e; animation: popIn 0.45s cubic-bezier(0.34, 1.56, 0.64, 1); }
.slot-display.jackpot {
  color: #ffd76e; font-size: 14.5px;
  animation: popIn 0.45s cubic-bezier(0.34, 1.56, 0.64, 1), msgPulse 1.1s 0.45s ease-in-out infinite;
}
@keyframes msgPulse { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.05); } }

.slot-btn {
  width: 100%;
  font-size: 19px; padding: 13px 18px;
  background: var(--accent); box-shadow: 0 6px 0 var(--accent-dark);
  color: var(--ink);
  margin-top: auto;
}
.slot-btn:active:not(:disabled) { transform: translateY(5px); box-shadow: 0 1px 0 var(--accent-dark); }
.slot-btn:disabled { background: #b9b5d5; box-shadow: 0 6px 0 #8f8bb0; cursor: default; transform: none; }
/* gain à récupérer : le bouton appelle le clic */
.slot-btn.collect { animation: collectPulse 1.1s ease-in-out infinite; }
@keyframes collectPulse { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.035); } }

/* voile doré clignotant sur tout l'écran (brelans 💎 et 👑) */
.slot-bg-flash {
  position: fixed; inset: 0; z-index: 55; pointer-events: none;
  background: radial-gradient(circle at 50% 28%, rgba(255,210,90,0.42), rgba(255,138,61,0.18) 55%, transparent 78%);
  animation: bgBlink 0.5s ease-in-out infinite;
}
@keyframes bgBlink { 0%, 100% { opacity: 0; } 50% { opacity: 1; } }

@media (prefers-reduced-motion: reduce) {
  .slot-reel.landed, .slot-balance.bump, .slot-cabinet.jackpot,
  .slot-cabinet.anticipation, .slot-cabinet.anticipation .slot-payline,
  .slot-btn.collect, .slot-display.big, .slot-display.jackpot,
  .chest-stage.charging #chest-el, .chest-stage.rattling #chest-el,
  .chest-stage.charging .chest-shadow, .chest-stage.rattling .chest-shadow,
  .chest-stage.charging .chest-glow, .chest-stage.rattling .chest-glow,
  .chest-stage.charging .chest-seam, .chest-stage.rattling .chest-seam,
  .chest-stage.open::before, .chest-stage.open::after,
  .chest-stage.open .chest-lid-fly, .chest-stage.open .chest-flash,
  #screen-chest.quake .chest-stage,
  .chest-stage.present #chest-el, .chest-stage.present .chest-shadow,
  .chest-stage.deflate #chest-el, .chest-stage.slam .chest-chains,
  .chest-stage.headshake .chest-chains,
  .rv, .reward-reveal,
  .pet-sprite.alive, .pet-sprite.egg, .pet-sprite.yay, .pet-sprite.evolve,
  .pet-deco, .pet-cabinet.glow, .pet-meter.low .pet-meter-fill { animation: none !important; }
  .chest-stage.open::before, .chest-stage.open::after { display: none; }
  .pet-fx { display: none; }
  .pet-screen.flash::after { display: none; }
}

/* ---------- responsive accueil ---------- */
@media (max-width: 1080px) {
  .home-columns { grid-template-columns: 1fr 1fr; }
  .quests-list { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
  .home-columns { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .placement-title { font-size: 20px; }
  .slot-reel { height: 100px; }
  .slot-strip span { height: 68px; font-size: 38px; }
  .quest-claim { padding: 7px 9px; font-size: 12.5px; }
}

/* ============================ Suppression RGPD ============================ */
/* Popup d'avertissement : la case à cocher porte le double-check, le
   bouton rouge ne s'allume qu'ensuite (et le mot de passe reste requis). */
.del-warn {
  background: #fdeef0; color: #8f1f31; border-radius: 12px;
  padding: 10px 14px; font-size: 14px; font-weight: 600; line-height: 1.45;
  text-align: left;
}
.del-check {
  display: flex; gap: 9px; align-items: center; text-align: left;
  font-size: 14px; font-weight: 700; margin: 0 0 14px; cursor: pointer;
}
.del-check input { width: 17px; height: 17px; accent-color: var(--red); flex-shrink: 0; }
.del-actions { display: flex; gap: 10px; justify-content: center; margin-top: 8px; flex-wrap: wrap; }
.del-actions .btn:disabled {
  opacity: 0.5; cursor: not-allowed; transform: none;
  box-shadow: 0 2px 0 var(--red-dark);
}

/* ==================== Rangs & étoiles de maîtrise ==================== */
/* L'ancre « ta classe » atterrit en douceur SOUS le header collé du site
   (position: sticky — mesuré : 67 px de haut, 95 px sur mobile où il passe
   sur 2 lignes) : sans cette marge, la ligne d'année passe derrière lui. */
.lvl-head.year-current { scroll-margin-top: 78px; }
@media (max-width: 760px) {
  .lvl-head.year-current { scroll-margin-top: 108px; }
}

/* Badge étoiles d'un sujet (identité permanente) */
.star-badge { letter-spacing: 1px; font-size: 13px; }

/* ==================== La Grande Enchère 🏛️ ==================== */
/* Aveugle & all-pay : compte à rebours façon borne, billet secret,
   révélation rituelle le soir de la clôture. */
.auction-slot { margin: 0 0 22px; }

/* ---------- accueil : le lot (2 col.) + l'encart Brainizy Max (1 col.) ----------
   Abonné : l'encart disparaît et le lot reprend toute la largeur (.full). */
.top-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 14px;
  align-items: stretch;
  margin: 0 0 22px;
}
.top-grid.full { grid-template-columns: 1fr; }
.top-grid.full .top-max { display: none; }
.top-auction, .top-max { display: flex; min-width: 0; }
.top-auction > *, .top-max > * { flex: 1; }

/* l'encart Max : sobre, informatif — jamais de compte à rebours ni de pression */
.max-card {
  cursor: default; align-items: flex-start; text-align: left; gap: 4px;
  background: linear-gradient(160deg, #fff 40%, #fff3d2);
  border-color: var(--accent);
}
.max-card:hover { transform: none; border-color: var(--accent); }
.max-card .slot-title { margin-bottom: 6px; }
.max-body { display: flex; flex-direction: column; gap: 7px; align-items: center; width: 100%; text-align: center; }
.max-name { font-size: 19px; font-weight: 800; }
.max-pitch { color: var(--muted); font-size: 13.5px; font-weight: 600; line-height: 1.4; }
/* le quota du jour : une pastille informative, jamais un avertissement */
.max-left {
  display: inline-block;
  border-radius: 12px; padding: 5px 12px;
  font-size: 12.5px; font-weight: 800; line-height: 1.35;
}
.max-left.ok { background: #eafaf0; color: #1c6b3c; }
.max-left.done { background: #fdeeef; color: #b0243a; }
.max-price { font-size: 13px; color: var(--muted); font-weight: 700; }
.max-price b { color: var(--ink); font-size: 15.5px; }
.max-cta { margin-top: 4px; font-size: 14px; width: 100%; }
/* l'encart est étiré à la hauteur du lot : le contenu se centre
   verticalement dans l'espace restant (pas de grand vide en bas) */
.max-split { display: flex; flex-direction: column; align-items: center; gap: 8px; width: 100%; margin: auto 0; }
.max-illu {
  width: 104px; height: auto; flex: 0 0 auto;
  filter: drop-shadow(0 12px 20px rgba(133, 88, 2, 0.28));
  animation: maxBreath 4.5s ease-in-out infinite;
  transform-origin: 50% 80%;
}
@keyframes maxBreath {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.04); }
}
@media (prefers-reduced-motion: reduce) {
  .max-illu { animation: none; }
}

/* l'encart testeur : la même carcasse que Max, teintée du violet du
   site — on ne vend rien ici, c'est une carte de remerciement */
.tester-card {
  background: linear-gradient(160deg, #fff 40%, #efeefe);
  border-color: var(--bg1);
}
.tester-card:hover { border-color: var(--bg1); }
/* deux boutons côte à côte sous le message (avis = action principale) ;
   le fantôme translucide du jeu est invisible sur carte blanche :
   ici il prend le fond lavande du site */
.tester-ctas { display: flex; gap: 8px; width: 100%; margin-top: 4px; }
.tester-ctas .btn { flex: 1; font-size: 13.5px; padding: 11px 6px; white-space: nowrap; }
.tester-card .btn-ghost { background: #efeaff; box-shadow: 0 6px 0 #d9d2f6; color: var(--ink); }
.tester-card .btn-ghost:active { box-shadow: 0 1px 0 #d9d2f6; }

/* ==================== Page « Mon compte » ==================== */
/* La fiche joueur sur un écran dédié : en-tête identité, bande de
   rang, puis des sections qui respirent. Le langage visuel vient du
   HUD (pastilles, dégradé de rang, gros boutons à appuyer). */
.account-card {
  max-width: 600px;
  width: 100%;
  margin: 0 auto;
  padding: 26px 28px 28px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  cursor: default;
}
.account-card h2 { margin: 0; }

/* en-tête : avatar orné (aura, compagnon, badge) + prénom + email */
.acc-hero { display: flex; align-items: center; gap: 14px; }
.acc-id { min-width: 0; }
.acc-id h2 { font-size: 30px; line-height: 1.1; }
.acc-mail { margin: 3px 0 0; color: var(--muted); font-weight: 600; font-size: 14px; word-break: break-all; }
.acc-avatar-face {
  width: 64px; height: 64px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 36px;
  box-shadow: inset 0 -4px 0 rgba(0, 0, 0, 0.15);
}

/* bande de rang : badge + étoiles + barre qui se remplit vers le
   palier suivant (le petit moment de fierté à l'ouverture) */
.acc-rank {
  background: #f0eefb; border-radius: 16px; padding: 14px 16px 12px;
  display: flex; flex-direction: column; gap: 9px;
}
.acc-rank-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.acc-stars { font-size: 15px; font-weight: 800; color: #6d6a92; }
.acc-rank-bar {
  height: 12px; border-radius: 8px; overflow: hidden;
  background: rgba(45, 42, 74, 0.12);
}
.acc-rank-fill {
  height: 100%; width: 0; border-radius: 8px;
  background: linear-gradient(90deg, #ffd75e, #ff9d2e);
  box-shadow: inset 0 -2px 0 rgba(0, 0, 0, 0.15);
  transition: width 0.9s cubic-bezier(0.22, 1, 0.36, 1);
}
.acc-rank-next { margin: 0; text-align: center; font-size: 13.5px; font-weight: 700; color: #6d6a92; }

/* niveau, Neuronz, série : les mêmes pastilles que le HUD */
.acc-totals { display: flex; gap: 8px; flex-wrap: wrap; }
.acc-total {
  font-weight: 800; font-size: 14px; border-radius: 12px; padding: 7px 13px;
}
.tot-lvl { background: var(--accent); box-shadow: 0 3px 0 var(--accent-dark); }
.tot-nz { background: rgba(255, 200, 61, 0.22); }
.tot-streak { background: rgba(255, 138, 61, 0.25); }

/* sections simples : positionnement scolaire */
.acc-sec { display: flex; flex-direction: column; gap: 8px; }
.acc-sec .field-label { margin: 0; }
.account-card select {
  width: 100%; font-family: var(--font); font-size: 17px; font-weight: 700;
  padding: 10px 14px; border: 3px solid #e4e1f5; border-radius: 14px;
  background: #fff; color: var(--ink); cursor: pointer; outline: none;
  transition: border-color 0.15s;
}
.account-card select:focus { border-color: var(--bg1); }

/* abonnement Max : le bloc doré — une invitation, jamais de pression */
.acc-max {
  display: flex; align-items: center; flex-wrap: wrap; gap: 6px 12px;
  background: #fff7e0; border-radius: 16px; padding: 13px 16px;
}
.acc-max-emoji { font-size: 30px; flex-shrink: 0; }
.acc-max-body { flex: 1; min-width: 150px; display: flex; flex-direction: column; gap: 2px; }
.acc-max-body b { font-size: 16px; }
.acc-max-body p { margin: 0; font-size: 13px; font-weight: 600; color: #6d6a92; }

/* rapports parents : le bloc calme du parent */
.acc-parents { background: #f4f2ec; border-radius: 16px; padding: 14px 16px; }
.acc-parents-title { font-size: 15px; }
.acc-parents .parents-hint { font-size: 12.5px; color: #6d6a92; font-weight: 600; }
.acc-parents input[type="email"] {
  width: 100%; font-family: var(--font); font-size: 15px; font-weight: 600;
  padding: 10px 12px; border: 3px solid #e6e1d2; border-radius: 12px;
  background: #fff; color: var(--ink); outline: none;
  transition: border-color 0.15s;
}
.acc-parents input[type="email"]:focus { border-color: var(--bg1); }
.acc-parents .parents-check { display: flex; gap: 9px; align-items: center; font-size: 14.5px; font-weight: 700; }
.acc-parents .parents-check input { width: 17px; height: 17px; accent-color: var(--bg1); }
.acc-parents .parents-check.locked { color: var(--muted); }

/* stats d'entraînement */
.acc-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.acc-stat {
  background: #f8f7fc; border-radius: 14px; padding: 10px 6px 9px;
  display: flex; flex-direction: column; align-items: center; gap: 2px;
}
.acc-stat b { font-size: 17px; }
.acc-stat span { font-size: 11.5px; font-weight: 700; color: #6d6a92; white-space: nowrap; }

/* collection de reliques + compagnon */
.acc-relics { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.acc-pet { margin: 2px 0 0; text-align: center; font-size: 14px; font-weight: 600; }

/* actions : le retour au jeu (vert) d'abord, déconnexion neutre ;
   import et suppression RGPD en liens discrets tout en bas */
.acc-actions { display: flex; flex-direction: column; gap: 10px; }
.account-card .btn { font-size: 16px; padding: 13px 18px; }
.acc-max .btn { font-size: 14px; padding: 10px 16px; text-decoration: none; }
.account-card .acc-save { align-self: flex-start; font-size: 14px; padding: 10px 18px; margin-top: 2px; }
.acc-btn-grey { background: #eceafb; color: var(--ink); box-shadow: 0 4px 0 #d5d2ee; }
.acc-btn-grey:active { transform: translateY(3px); box-shadow: 0 1px 0 #d5d2ee; }
.acc-minor { display: flex; justify-content: center; flex-wrap: wrap; gap: 4px 8px; margin-top: 2px; }
.acc-minor-link {
  background: none; border: none; cursor: pointer;
  font-family: var(--font); font-size: 13px; font-weight: 700;
  color: var(--muted); padding: 6px 9px; border-radius: 10px;
  transition: background 0.15s, color 0.15s;
}
.acc-minor-link:hover { background: #f0eefb; color: var(--ink); }
.acc-minor-link.danger { color: #b0243a; }
.acc-minor-link.danger:hover { background: #fdeef0; color: #b0243a; }

@media (max-width: 640px) {
  .account-card { padding: 20px 16px 22px; gap: 16px; }
  .acc-id h2 { font-size: 25px; }
  .acc-avatar-face { width: 54px; height: 54px; font-size: 30px; }
  .acc-stats { grid-template-columns: repeat(2, 1fr); }
}
@media (prefers-reduced-motion: reduce) {
  .acc-rank-fill { transition: none; }
}
@media (max-width: 640px) {
  .top-grid { grid-template-columns: 1fr; }
}

/* Le Lot Max 🚀 : bordure dorée pour le distinguer du lot de tous */
.auction-card.max-auction { border: 2px solid var(--accent); }
/* ==================== À gagner cette semaine 🎁 ==================== */
/* La seule carte sombre de l'accueil : l'événement de la semaine a sa
   vitrine — projecteur doré sur le lot (à gauche), actions à droite,
   compte à rebours façon borne. Une seule animation : le lot flotte. */
.auction-card {
  cursor: default;
  text-align: left;
  align-items: stretch;
  gap: 14px;
  padding: 18px 20px 16px;
  background:
    radial-gradient(120% 90% at 16% 0%, rgba(255, 200, 61, 0.15), transparent 55%),
    linear-gradient(170deg, #3a3173 0%, #2b2459 48%, #221c49 100%);
  border-color: rgba(255, 200, 61, 0.9);
  box-shadow: 0 18px 44px rgba(20, 10, 60, 0.5), inset 0 2px 0 rgba(255, 255, 255, 0.09);
  color: #fff;
}
.auction-card:hover { transform: none; border-color: rgba(255, 200, 61, 0.9); }
.auction-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 8px; flex-wrap: wrap;
}
.auction-head .slot-title { font-size: 18.5px; color: #fff; }
.auction-head .slot-ico { font-size: 26px; }
/* participants et « Ta mise » : mêmes puces claires que le solde de la
   machine à sous et le compteur de quêtes — elles ressortent sur le fond
   sombre de la carte */
.auction-head .slot-balance { box-shadow: 0 3px 0 rgba(0, 0, 0, 0.3); }

/* le corps : vitrine à gauche, actions à droite */
.auction-body {
  display: grid; grid-template-columns: minmax(200px, 222px) 1fr;
  gap: 16px; align-items: stretch;
}

/* ---- la scène : projecteur, lot posé sur un socle lumineux ---- */
.auction-stage {
  position: relative; overflow: hidden;
  display: flex; align-items: center; justify-content: center;
  min-height: 250px;
  border-radius: 18px;
  background:
    radial-gradient(90% 70% at 50% 36%, rgba(255, 210, 90, 0.5), rgba(255, 200, 61, 0.14) 55%, transparent 78%),
    linear-gradient(180deg, rgba(12, 8, 38, 0.18), rgba(12, 8, 38, 0.42));
  box-shadow: inset 0 0 0 1px rgba(255, 220, 120, 0.22), inset 0 14px 34px rgba(0, 0, 0, 0.28);
}
.stage-frame {
  position: relative; z-index: 1;
  background: #fff; border-radius: 16px; padding: 10px;
  max-width: 88%;
  box-shadow: 0 0 0 3px var(--accent), 0 24px 46px rgba(8, 4, 30, 0.6);
  animation: prize-float 5s ease-in-out infinite;
}
.auction-lot-img {
  display: block; max-width: 196px; max-height: 190px;
  object-fit: contain; margin: 0 auto;
}
.stage-floor {
  position: absolute; left: 50%; bottom: 16px;
  width: 60%; height: 24px; transform: translateX(-50%);
  background: radial-gradient(closest-side, rgba(5, 2, 20, 0.65), transparent);
  animation: floor-breathe 5s ease-in-out infinite;
}
.stage-spark {
  position: absolute; z-index: 2; font-size: 22px; line-height: 1;
  filter: drop-shadow(0 2px 6px rgba(255, 200, 61, 0.65));
  animation: spark-twinkle 2.8s ease-in-out infinite;
}
.stage-spark.s1 { top: 5%; left: 4%; font-size: 24px; }
.stage-spark.s2 { top: 8%; right: 3.5%; font-size: 17px; animation-delay: 0.9s; }
.stage-spark.s3 { bottom: 5%; right: 8%; font-size: 14px; animation-delay: 1.7s; }
/* sans visuel reconnu : l'emoji prend la scène */
.auction-stage.no-img .auction-emoji {
  position: relative; z-index: 1; font-size: 110px; line-height: 1;
  filter: drop-shadow(0 14px 22px rgba(8, 4, 30, 0.6));
  animation: prize-float 5s ease-in-out infinite;
}
@keyframes prize-float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-9px); }
}
@keyframes floor-breathe {
  0%, 100% { transform: translateX(-50%) scale(1); opacity: 0.9; }
  50% { transform: translateX(-50%) scale(0.84); opacity: 0.55; }
}
@keyframes spark-twinkle {
  0%, 100% { opacity: 0.25; transform: scale(0.7) rotate(-10deg); }
  50% { opacity: 1; transform: scale(1.12) rotate(8deg); }
}

/* ---- ❤️ le cœur du lot : posé en haut de la vitrine ----
   Un toggle (pose/retire, le serveur fait foi) avec le total des
   cœurs du LOT — le compteur reste caché tant que personne n'a aimé. */
.lot-heart {
  position: absolute; z-index: 3; top: 10px; right: 10px;
  display: flex; align-items: center; gap: 5px;
  background: rgba(255, 252, 244, 0.94); color: var(--muted);
  border: none; border-radius: 999px; cursor: pointer;
  font-family: var(--font); font-size: 14px; font-weight: 800;
  padding: 6px 12px 6px 9px; line-height: 1;
  box-shadow: 0 4px 14px rgba(8, 4, 30, 0.35);
  transition: transform 0.15s ease, background 0.15s ease;
}
.lot-heart:hover { transform: scale(1.08); }
.lot-heart:disabled { cursor: default; transform: none; opacity: 0.75; }
.lot-heart.liked { background: #ffeef2; color: #d6335d; }
.lot-heart-count:empty { display: none; }
.lot-heart.pop { animation: heart-pop 0.45s ease; }
@keyframes heart-pop {
  0% { transform: scale(1); }
  35% { transform: scale(1.3) rotate(-7deg); }
  70% { transform: scale(0.94); }
  100% { transform: scale(1); }
}

/* ---- la colonne d'action ---- */
.auction-act { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.auction-prize { display: flex; flex-direction: column; gap: 4px; }
.auction-lot-title {
  font-size: 23px; font-weight: 800; color: #fff; line-height: 1.14;
  text-shadow: 0 2px 0 rgba(0, 0, 0, 0.28);
}
.auction-lot-desc { color: #c9c5e8; font-size: 14px; font-weight: 600; line-height: 1.4; }

/* le compte à rebours : encastré dans la carte sombre */
.auction-cabinet {
  background: rgba(12, 8, 38, 0.5);
  border-radius: 14px;
  padding: 9px 12px 11px;
  box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.4);
}
.auction-cd-label {
  color: #b8b4d9; font-size: 11px; font-weight: 800;
  text-transform: uppercase; letter-spacing: 0.8px;
  margin-bottom: 6px; text-align: center;
}
.cd-row { display: flex; justify-content: center; gap: 6px; }
.cd-box {
  min-width: 46px; text-align: center;
  background: linear-gradient(180deg, #4a4478, #37325e);
  border-radius: 10px; padding: 5px 6px 4px;
  box-shadow: inset 0 3px 8px rgba(0, 0, 0, 0.45), inset 0 0 0 1px rgba(255, 255, 255, 0.07);
}
.cd-box b {
  display: block; color: #ffd968; font-size: 17px;
  font-variant-numeric: tabular-nums;
  text-shadow: 0 0 8px rgba(255, 200, 61, 0.55);
}
.cd-box small {
  display: block; color: #b8b4d9; font-size: 9px; font-weight: 800;
  text-transform: uppercase; letter-spacing: 0.5px;
}
.cd-now { color: #ffd968; font-weight: 800; font-size: 15px; }

/* la mise du joueur : puce en évidence à gauche des boutons —
   légèrement teintée en vert quand elle existe (on a participé) */
.auction-bidrow {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
}
.auction-mine-chip { font-size: 14px; padding: 7px 13px; }
.auction-mine-chip b { font-size: 15.5px; }
.auction-mine-chip.has-bid { background: #eafaf0; }
.auction-mine-chip.has-bid b { color: var(--green-dark); }

.auction-spendable { color: #c9c5e8; font-weight: 700; font-size: 12.5px; }
.auction-spendable b { color: #fff; font-size: 13.5px; }
.auction-rule { color: #b3aed6; font-size: 11.5px; font-weight: 600; text-align: center; }

@media (max-width: 760px) {
  .auction-body { grid-template-columns: 1fr; gap: 14px; }
  .auction-stage { min-height: 240px; }
  .auction-lot-img { max-height: 190px; max-width: 250px; }
  .auction-lot-title { font-size: 20px; }
}
@media (prefers-reduced-motion: reduce) {
  .stage-frame, .stage-floor, .stage-spark, .auction-stage.no-img .auction-emoji { animation: none; }
  .lot-heart.pop { animation: none; }
  .lot-heart:hover { transform: none; }
}

/* boutons « Miser +X » : trois clics directs, grisés si le solde est trop court.
   Le groupe ne se coupe JAMAIS en deux : à l'étroit, il passe entier
   sous la puce « Ta mise » plutôt que d'empiler les boutons. */
.bid-buttons { display: flex; gap: 7px; justify-content: flex-start; flex-wrap: nowrap; flex: 1 1 auto; min-width: 0; }
.bid-direct {
  flex: 1 1 auto; white-space: nowrap;
  font-family: var(--font); font-weight: 800; font-size: 14.5px;
  padding: 10px 16px; border: none; border-radius: 12px; cursor: pointer;
  background: var(--green); color: #fff;
  box-shadow: 0 4px 0 var(--green-dark);
  transition: transform 0.12s, box-shadow 0.12s;
}
.bid-direct:active { transform: translateY(2px); box-shadow: 0 2px 0 var(--green-dark); }
.bid-direct:disabled {
  background: rgba(255, 255, 255, 0.12); color: #918cba;
  box-shadow: none; cursor: default; transform: none;
}
.modal-actions { display: flex; gap: 10px; justify-content: center; margin-top: 8px; flex-wrap: wrap; }

/* révélation (page des gagnants) */
.auction-result { text-align: center; }
.res-hero { font-size: 64px; line-height: 1.1; }
.res-hero .auction-lot-img {
  background: #fff; border-radius: 14px; padding: 8px 12px;
  max-width: 220px; max-height: 130px;
  box-shadow: 0 0 0 3px var(--accent), 0 10px 24px rgba(30, 20, 90, 0.25);
}
.res-lesson {
  background: #fff8e6; border-radius: 12px; padding: 8px 12px;
  font-size: 13.5px; font-weight: 700;
}
.res-burn {
  background: #fdecee; border-radius: 12px; padding: 8px 12px;
  font-size: 13.5px; font-weight: 700; color: var(--red-dark);
}
.res-podium { display: flex; flex-direction: column; gap: 6px; margin: 6px 0; }
.res-row {
  display: flex; align-items: center; gap: 8px;
  background: #faf9ff; border: 2px solid transparent;
  border-radius: 10px; padding: 7px 12px;
  font-size: 14px; font-weight: 700;
}
.res-row.me { background: #fff8e6; border-color: var(--accent); }
.res-row .rank { width: 28px; text-align: center; }
.res-row .res-name { flex: 1; text-align: left; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ============================================================
   La relance « façon Duolingo » 🔥 — carte série, flamme en
   danger, pastilles des 7 derniers jours, modale d'extinction
   ============================================================ */
/* la flamme du HUD pulse quand le jour n'est pas encore joué */
.streak-chip.risk { background: rgba(244, 91, 105, 0.42); animation: chip-risk 1.4s ease-in-out infinite; }
@keyframes chip-risk {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.08); }
}

/* modale d'extinction 😢 : sobre, triste, avec la porte ouverte */
.rip-modal { text-align: center; display: flex; flex-direction: column; gap: 10px; }
.rip-emoji { font-size: 52px; line-height: 1; }
.rip-sad { color: var(--muted); font-size: 13.5px; font-weight: 600; }
.rip-hope {
  background: #fff6dc; border-radius: 12px; padding: 10px 12px;
  font-size: 14px; font-weight: 700;
}
.rip-later { color: var(--muted); font-size: 13px; }


