* { margin: 0; padding: 0; box-sizing: border-box; }

:root {
  --bleu: #2155ce;
  --rouge: #e63946;
  --blanc: #ffffff;
  --bg1: #eef4ff;
  --bg2: #fdeef0;
  --ink: #1d2440;
  --ink-soft: #5a6486;
  --ok: #16a34a;
  --ko: #dc2626;
  --card: #ffffff;
  --radius: 22px;
  --shadow: 0 10px 30px rgba(29, 36, 64, 0.12);
}

html { -webkit-text-size-adjust: 100%; }

body {
  font-family: "Fredoka", "Nunito", sans-serif;
  color: var(--ink);
  min-height: 100vh;
  background: linear-gradient(160deg, var(--bg1) 0%, #ffffff 45%, var(--bg2) 100%);
  overflow-x: hidden;
}

/* Bouton hymne 8-bit (🔊/🔇) */
#anthem-btn {
  position: fixed; left: 12px; bottom: 12px; z-index: 60;
  width: 40px; height: 40px; padding: 0; line-height: 1;
  border-radius: 50%; border: 2px solid #e6ebf7; background: #fff;
  box-shadow: 0 4px 12px rgba(29,36,64,.14); font-size: 18px; cursor: pointer;
  transition: transform .15s, opacity .15s;
}
#anthem-btn:hover { transform: translateY(-2px); }
#anthem-btn.off { opacity: .55; }

/* Bandeau tricolore */
.tricolore {
  position: fixed; top: 0; left: 0; right: 0; height: 8px;
  display: flex; z-index: 50;
}
.tricolore span { flex: 1; }
.tricolore span:nth-child(1) { background: var(--bleu); }
.tricolore span:nth-child(2) { background: var(--blanc); }
.tricolore span:nth-child(3) { background: var(--rouge); }

/* Emojis flottants */
#floaters { position: fixed; inset: 0; pointer-events: none; z-index: 0; overflow: hidden; }
.floater {
  position: absolute; bottom: -60px;
  font-size: 34px; opacity: 0.16;
  animation: floatUp linear infinite;
}
@keyframes floatUp {
  0%   { transform: translateY(0) rotate(0deg); }
  100% { transform: translateY(-115vh) rotate(360deg); }
}

#app {
  position: relative; z-index: 1;
  max-width: 640px; margin: 0 auto;
  padding: 40px 20px 60px;
  min-height: 100vh;
  display: flex; flex-direction: column;
}

.screen { display: none; animation: pop .35s ease; flex: 1; }
.screen.active { display: flex; flex-direction: column; }
@keyframes pop {
  from { opacity: 0; transform: translateY(14px) scale(.98); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

/* ======== ACCUEIL ======== */
#screen-home { align-items: center; justify-content: center; text-align: center; gap: 10px; }

.mascot { font-size: 96px; filter: drop-shadow(0 8px 16px rgba(0,0,0,.15)); }
.bounce { animation: bounce 2.2s ease-in-out infinite; }
@keyframes bounce {
  0%, 100% { transform: translateY(0) rotate(-4deg); }
  50%      { transform: translateY(-14px) rotate(4deg); }
}

.title {
  font-size: clamp(42px, 9vw, 64px);
  font-weight: 700; letter-spacing: -1px; line-height: 1.05;
}
.grad {
  background: linear-gradient(90deg, var(--bleu), var(--rouge));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.subtitle { font-size: 19px; color: var(--ink-soft); font-weight: 500; line-height: 1.45; }
.based-on {
  margin-top: 6px; font-size: 14px; color: var(--ink-soft);
  background: #fff; border: 2px dashed #c7d4f5;
  padding: 8px 16px; border-radius: 999px;
}

.based-on-btn {
  cursor: pointer; font-family: inherit; line-height: 1.35;
  transition: transform .15s, border-color .15s, box-shadow .15s;
}
.based-on-btn:hover { transform: translateY(-2px); border-color: var(--bleu); box-shadow: 0 6px 16px rgba(33,85,206,.15); }
.based-cta { color: var(--bleu); font-weight: 700; white-space: nowrap; }

.mode-buttons { display: flex; flex-direction: column; gap: 14px; margin-top: 26px; width: 100%; max-width: 380px; }

.btn {
  font-family: inherit; border: none; cursor: pointer;
  border-radius: var(--radius);
  font-size: 17px; font-weight: 600;
  padding: 14px 22px;
  transition: transform .15s ease, box-shadow .15s ease, filter .15s;
  display: flex; align-items: center; justify-content: center; gap: 12px;
}
.btn:active { transform: scale(.96); }
.btn.big { padding: 18px 24px; font-size: 19px; }
.btn-primary {
  background: linear-gradient(135deg, var(--bleu), #4f7df8);
  color: #fff; box-shadow: 0 8px 22px rgba(33, 85, 206, .35);
}
.btn-primary:hover { filter: brightness(1.07); transform: translateY(-2px); }
.btn-secondary {
  background: #fff; color: var(--ink);
  box-shadow: var(--shadow); border: 2px solid #e6ebf7;
}
.btn-secondary:hover { transform: translateY(-2px); border-color: #c9d6f3; }
.btn-gold {
  position: relative;
  background: linear-gradient(135deg, #b8860b, #f5c542 45%, #ffe89a 55%, #d4a017);
  color: #3a2c00; box-shadow: 0 8px 24px rgba(197, 152, 20, .45);
  border: 2px solid #ffe89a;
}
.btn-gold:hover { filter: brightness(1.05); transform: translateY(-2px); }
.btn-gold .btn-text small { color: #5a4600; opacity: .85; }
.btn-badge {
  position: absolute; top: -9px; right: -8px;
  background: var(--rouge); color: #fff;
  font-size: 12px; font-weight: 700;
  padding: 3px 9px; border-radius: 999px;
  box-shadow: 0 4px 10px rgba(230, 57, 70, .4);
  transform: rotate(6deg);
}
.btn-icon { font-size: 30px; }
.btn-text { display: flex; flex-direction: column; align-items: flex-start; line-height: 1.15; }
.btn-text small { font-weight: 500; font-size: 13px; opacity: .78; }

.best-score { margin-top: 22px; font-size: 15px; color: var(--ink-soft); min-height: 22px; }

.tip-link {
  margin-top: 16px; font-size: 14.5px; font-weight: 600;
  color: var(--ink-soft); text-decoration: none;
  background: #fff; border: 2px solid #f0e2c0;
  padding: 8px 16px; border-radius: 999px;
  box-shadow: 0 4px 12px rgba(29,36,64,.07);
  transition: transform .15s;
}
.tip-link:hover { transform: translateY(-2px); color: var(--ink); }

/* Bouton pourboire mis en avant (écran résultats) */
.btn-tip {
  width: 100%; margin-top: 16px; text-decoration: none;
  background: linear-gradient(135deg, #b5651d, #e8a04d);
  color: #fff; font-size: 16px; font-weight: 700; text-align: center;
  padding: 15px 18px; border-radius: var(--radius);
  box-shadow: 0 8px 22px rgba(181, 101, 29, .38);
  animation: tipPulse 2.4s ease-in-out infinite;
}
.btn-tip:hover { filter: brightness(1.06); transform: translateY(-2px); animation: none; }
@keyframes tipPulse {
  0%, 100% { box-shadow: 0 8px 22px rgba(181, 101, 29, .38); }
  50% { box-shadow: 0 8px 30px rgba(181, 101, 29, .6); transform: translateY(-1px); }
}

/* Bloc SEO — Livret du Citoyen 2026 (contenu indexable + FAQ) */
.seo-livret {
  margin: 30px auto 4px; max-width: 460px; width: 100%;
  text-align: left; background: var(--card);
  border: 1px solid #e7ebf6; border-radius: var(--radius);
  padding: 22px 20px; box-shadow: 0 8px 22px rgba(29,36,64,.06);
}
.seo-livret h2 {
  font-family: "Fredoka", sans-serif; font-size: 19px; line-height: 1.25;
  color: var(--ink); margin: 0 0 10px;
}
.seo-livret > p { font-size: 14.5px; line-height: 1.55; color: var(--ink-soft); margin: 0 0 16px; }
.seo-livret-cta { width: 100%; font-size: 15px; }
.seo-faq { margin-top: 18px; display: flex; flex-direction: column; gap: 8px; }
.seo-faq details {
  border: 1px solid #e7ebf6; border-radius: 12px;
  background: #f7f9ff; padding: 2px 4px;
}
.seo-faq summary {
  cursor: pointer; list-style: none; padding: 11px 12px;
  font-family: "Nunito", sans-serif; font-weight: 700; font-size: 14px;
  color: var(--ink); position: relative;
}
.seo-faq summary::-webkit-details-marker { display: none; }
.seo-faq summary::after {
  content: "+"; position: absolute; right: 12px; top: 50%;
  transform: translateY(-50%); color: var(--bleu); font-weight: 800; font-size: 18px;
}
.seo-faq details[open] summary::after { content: "–"; }
.seo-faq details p { margin: 0; padding: 0 12px 12px; font-size: 13.5px; line-height: 1.5; color: var(--ink-soft); }

.disclaimer { margin-top: 18px; font-size: 11.5px; color: #9aa2bd; max-width: 360px; line-height: 1.4; }
.legal-links { margin-top: 8px; font-size: 11.5px; color: #9aa2bd; }
.legal-links a { color: #9aa2bd; text-decoration: none; }
.legal-links a:hover { color: var(--bleu); text-decoration: underline; }

/* Raccourcis accueil (défi + classement) */
.home-secondary { display: flex; gap: 10px; margin-top: 14px; width: 100%; max-width: 380px; }
.btn-duel-home, .btn-board-home {
  flex: 1; background: #fff; box-shadow: var(--shadow);
  font-size: 15.5px; padding: 13px 12px; gap: 6px;
}
.btn-duel-home { color: var(--rouge); border: 2px solid #f3b0b0; }
.btn-board-home { color: #b8860b; border: 2px solid #f0dca0; }
.btn-duel-home:hover, .btn-board-home:hover { transform: translateY(-2px); }

/* Carte "50 questions bonus" */
.btn-bonus-home {
  margin-top: 12px; width: 100%; max-width: 380px; justify-content: flex-start;
  background: linear-gradient(135deg, #7c3aed, #a855f7);
  color: #fff; box-shadow: 0 8px 22px rgba(124, 58, 237, .35);
  padding: 15px 20px; gap: 12px;
}
.btn-bonus-home:hover { filter: brightness(1.07); transform: translateY(-2px); }
.btn-bonus-home .btn-text small { color: #fff; opacity: .9; }
.btn-bonus-home.unlocked { background: linear-gradient(135deg, #16a34a, #22c55e); box-shadow: 0 8px 22px rgba(22,163,74,.35); }

/* Carte "500 questions premium" */
.btn-premium-home {
  margin-top: 10px; width: 100%; max-width: 380px; justify-content: flex-start;
  background: linear-gradient(135deg, #111827, #1f2937 55%, #b8860b);
  color: #fff; box-shadow: 0 8px 22px rgba(17, 24, 39, .38);
  padding: 15px 20px; gap: 12px; border: 1.5px solid #d4af37;
}
.btn-premium-home:hover { filter: brightness(1.08); transform: translateY(-2px); }
.btn-premium-home .btn-text small { color: #ffe89a; opacity: .95; }
.btn-premium-home.unlocked { background: linear-gradient(135deg, #16a34a, #22c55e); border-color: #9be7b4; }

/* Bouton "Commencer" de l'écran intro premium */
.btn-premium-start {
  background: linear-gradient(135deg, #111827, #1f2937 55%, #b8860b);
  color: #fff; box-shadow: 0 8px 24px rgba(17, 24, 39, .4);
  border: 1.5px solid #d4af37;
}
.btn-premium-start:hover { filter: brightness(1.08); transform: translateY(-2px); }
.btn-premium-start .btn-text small { color: #ffe89a; opacity: .95; }

.btn-entretien-home {
  margin-top: 10px; width: 100%; max-width: 380px; justify-content: flex-start;
  background: linear-gradient(135deg, #4c1d95, #7c3aed); color: #fff;
  box-shadow: 0 8px 22px rgba(76, 29, 149, .32); padding: 15px 20px; gap: 12px; border: 1.5px solid #a855f7;
}
.btn-entretien-home:hover { filter: brightness(1.08); transform: translateY(-2px); }
.btn-entretien-home .btn-text small { color: #e9d5ff; opacity: .95; }
.btn-entretien-home.unlocked { background: linear-gradient(135deg, #16a34a, #22c55e); border-color: #9be7b4; }

/* Nudge premium sur l'écran de résultats */
.premium-nudge {
  display: none; align-items: center; gap: 12px; text-align: left;
  width: 100%; margin-top: 16px; padding: 14px 16px; border-radius: var(--radius);
  background: linear-gradient(135deg, #fff8e1, #fde6c9); border: 2px solid #f0dca0;
  box-shadow: var(--shadow); animation: pop .35s ease;
}
.premium-nudge.show { display: flex; }
.pn-emoji { font-size: 30px; }
.pn-text { flex: 1; display: flex; flex-direction: column; line-height: 1.25; }
.pn-text strong { font-size: 14.5px; }
.pn-text span { font-size: 13px; color: var(--ink-soft); }
.pn-btn { background: linear-gradient(135deg, #b8860b, #d4a017); color: #fff; font-size: 13.5px; font-weight: 700; padding: 10px 14px; border-radius: 12px; white-space: nowrap; }
.pn-btn:hover { filter: brightness(1.06); }
@media (max-width: 480px) { .premium-nudge { flex-wrap: wrap; } .pn-btn { width: 100%; } }

/* Nudge upgrade (modal) */
.upgrade-cta {
  width: 100%; text-decoration: none;
  background: linear-gradient(135deg, #b8860b, #f5c542 45%, #ffe89a 55%, #d4a017); color: #3a2c00;
  box-shadow: 0 8px 22px rgba(197, 152, 20, .4);
}
.upgrade-cta:hover { transform: translateY(-2px); filter: brightness(1.04); }
.upgrade-later { display: block; margin: 12px auto 0; background: none; border: none; color: var(--ink-soft); font-family: inherit; font-weight: 600; font-size: 14px; cursor: pointer; }
.upgrade-later:hover { color: var(--ink); }

.premium-perks { list-style: none; padding: 0; margin: 4px 0 16px; text-align: left; }
.premium-perks li { font-size: 14.5px; color: var(--ink-soft); font-weight: 600; padding: 4px 0; }
.cmp { width: 100%; border-collapse: collapse; margin: 6px 0 18px; font-size: 13.5px; }
.cmp th, .cmp td { padding: 8px 8px; border-bottom: 1px solid #eef2fb; text-align: center; }
.cmp td:first-child, .cmp th:first-child { text-align: left; color: var(--ink-soft); font-weight: 600; }
.cmp th { font-size: 12.5px; color: var(--ink-soft); text-transform: uppercase; letter-spacing: .3px; }
.cmp .cmp-prem { background: #fff8e1; color: #3a2c00; font-weight: 700; }
.cmp tr:last-child td { border-bottom: none; }
.premium-buy { width: 100%; text-decoration: none; font-size: 17px;
  background: linear-gradient(135deg, #b8860b, #f5c542 45%, #ffe89a 55%, #d4a017); color: #3a2c00;
  box-shadow: 0 8px 22px rgba(197,152,20,.4); }
.premium-buy:hover { transform: translateY(-2px); filter: brightness(1.04); }
.premium-redeem { margin-top: 16px; border-top: 1px dashed #e0e0e0; padding-top: 14px; }
.premium-redeem-head { font-size: 13.5px; font-weight: 700; color: var(--ink-soft); margin-bottom: 8px; text-align: center; }
.premium-redeem-row { display: flex; gap: 8px; }
.premium-redeem-row input {
  flex: 1; min-width: 0; font-family: inherit; font-size: 15px; letter-spacing: 1px; text-transform: uppercase;
  padding: 11px 12px; border: 2px solid #e6ebf7; border-radius: 12px; background: #f7f9ff;
}
.premium-redeem-row input:focus { outline: none; border-color: var(--bleu); background: #fff; }
.premium-redeem-row button { background: var(--bleu); color: #fff; font-weight: 700; font-size: 14.5px; border: none; border-radius: 12px; padding: 11px 16px; white-space: nowrap; cursor: pointer; }
.premium-redeem-row button:disabled { opacity: .5; }
/* Puce "Mon compte" en haut de l'accueil */
.home-account { width: 100%; max-width: 380px; display: flex; justify-content: flex-end; margin-bottom: 2px; }
.account-chip {
  font-family: inherit; cursor: pointer;
  font-size: 13.5px; font-weight: 700; color: var(--ink-soft);
  background: #fff; border: 2px solid #e6ebf7; border-radius: 999px;
  padding: 7px 15px; box-shadow: 0 4px 12px rgba(29,36,64,.07);
  transition: transform .15s, border-color .15s;
}
.account-chip:hover { transform: translateY(-2px); border-color: #c9d6f3; }
.account-chip.premium { color: #7a5b00; border-color: #f0dca0; background: linear-gradient(135deg, #fff9e8, #fff); }

/* Badges dans la popup "Mon compte" */
.account-badge { margin-top: 10px; font-size: 14px; font-weight: 700; padding: 10px 14px; border-radius: 12px; text-align: center; }
#account-premium-badge { background: linear-gradient(135deg, #fff4d6, #fffdf7); color: #7a5b00; border: 1.5px solid #f0dca0; }
#account-free-badge { background: #f4f6fb; color: var(--ink-soft); }
#account-play-premium, #account-signout { width: 100%; margin-top: 12px; }

.premium-auth { margin-top: 16px; border-top: 1px dashed #e0e0e0; padding-top: 14px; }
/* l'e-mail n'est pas en majuscules ni espacé */
#auth-email, #auth-code { text-transform: none; letter-spacing: normal; }
.linklike { background: none; border: none; color: var(--bleu); font-weight: 700; font-size: 13px; cursor: pointer; padding: 6px 2px; text-decoration: underline; }

/* Champ e-mail (et prénom du défi) dans les popups */
.modal-card input[type="email"], .modal-card input.modal-text {
  width: 100%; font-family: inherit; font-size: 16px;
  padding: 13px 14px; margin-bottom: 10px;
  border: 2px solid #e6ebf7; border-radius: 12px; background: #f7f9ff; text-align: left;
}
.modal-card input[type="email"]:focus, .modal-card input.modal-text:focus { outline: none; border-color: var(--bleu); background: #fff; }
.modal-card .lb-consent { text-align: left; }
.modal-card .btn-primary { width: 100%; }

/* ===== Classement ===== */
.board-note { text-align: center; font-size: 14.5px; color: var(--ink-soft); margin: 4px 0 18px; line-height: 1.4; }
.board-tabs { display: flex; gap: 8px; background: #eef2fb; padding: 6px; border-radius: 16px; margin-bottom: 18px; }
.board-tab {
  flex: 1; font-family: inherit; font-size: 14.5px; font-weight: 700;
  border: none; background: transparent; color: var(--ink-soft);
  padding: 11px 8px; border-radius: 11px; cursor: pointer; transition: all .15s;
}
.board-tab.active { background: #fff; color: var(--ink); box-shadow: 0 4px 12px rgba(29,36,64,.1); }

.board-list { display: flex; flex-direction: column; gap: 9px; min-height: 120px; }
.board-row {
  display: flex; align-items: center; gap: 12px;
  background: #fff; border-radius: 14px; padding: 12px 16px;
  box-shadow: 0 4px 12px rgba(29,36,64,.06);
}
.board-rank { font-size: 16px; font-weight: 800; width: 34px; text-align: center; color: var(--ink-soft); }
.board-row.top1 { background: linear-gradient(135deg,#fff8e1,#ffefc2); border: 1.5px solid #f0d27a; }
.board-row.top2 { background: linear-gradient(135deg,#f6f8fb,#eceff5); }
.board-row.top3 { background: linear-gradient(135deg,#fdf1e8,#fbe4d3); }
.board-name { flex: 1; font-weight: 700; font-size: 16px; color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.board-time { font-size: 12.5px; font-weight: 700; color: var(--ink-soft); font-variant-numeric: tabular-nums; margin-right: 4px; }
.board-score { font-weight: 800; font-size: 17px; color: var(--bleu); }
.board-score small { font-weight: 600; font-size: 12px; color: var(--ink-soft); }
.board-empty, .board-loading { text-align: center; color: var(--ink-soft); font-weight: 600; padding: 30px 10px; }
.board-me { outline: 3px solid rgba(33,85,206,.35); }

/* ===== Micro-sondage "prêt à payer ?" ===== */
.poll-card {
  display: none; margin-top: 22px; width: 100%;
  background: #fff; border-radius: var(--radius); box-shadow: var(--shadow);
  border: 2px solid #d8c4f5; padding: 20px 18px; text-align: left;
}
.poll-card.show { display: block; animation: pop .3s ease; }
.poll-q { font-size: 16.5px; font-weight: 700; line-height: 1.4; margin-bottom: 14px; text-align: center; }
.poll-options { display: flex; flex-direction: column; gap: 9px; }
.poll-opt {
  font-family: inherit; cursor: pointer; text-align: left;
  background: #faf7ff; border: 2px solid #e9ddfb;
  border-radius: 13px; padding: 13px 15px; font-size: 15.5px; font-weight: 600; color: var(--ink);
  transition: transform .14s, border-color .14s, background .14s;
}
.poll-opt:hover { transform: translateX(4px); border-color: #a855f7; background: #f3ecfe; }
.poll-opt:disabled { cursor: default; }
.poll-opt.chosen { border-color: #7c3aed; background: #efe6fd; }
.poll-opt.dim { opacity: .5; }

.poll-result { margin-top: 6px; }
.poll-thanks { text-align: center; font-weight: 700; font-size: 16px; margin: 4px 0 14px; color: #7c3aed; }
.poll-bar-row { margin-bottom: 9px; }
.poll-bar-top { display: flex; justify-content: space-between; font-size: 13.5px; font-weight: 700; margin-bottom: 4px; }
.poll-bar-top .pct { color: var(--ink-soft); }
.poll-bar { height: 10px; background: #eee6fb; border-radius: 999px; overflow: hidden; }
.poll-bar span { display: block; height: 100%; background: linear-gradient(90deg, #7c3aed, #a855f7); border-radius: 999px; transition: width .8s ease; }
.poll-bar-row.mine .poll-bar span { background: linear-gradient(90deg, #16a34a, #22c55e); }
.poll-comment { display: flex; gap: 8px; margin-top: 14px; }
.poll-comment input {
  flex: 1; min-width: 0; font-family: inherit; font-size: 16px;
  padding: 11px 13px; border: 2px solid #e6ebf7; border-radius: 12px; background: #f7f9ff;
}
.poll-comment input:focus { outline: none; border-color: #7c3aed; background: #fff; }
.poll-comment button {
  font-family: inherit; font-weight: 700; font-size: 14.5px; border: none; cursor: pointer;
  background: #7c3aed; color: #fff; border-radius: 12px; padding: 11px 16px; white-space: nowrap;
}
.poll-comment button:disabled { opacity: .5; }
.poll-comment-done { text-align: center; font-size: 13.5px; color: var(--ok); font-weight: 700; margin-top: 10px; }
.poll-continue { width: 100%; margin-top: 14px; }
.poll-skip { display: block; margin: 12px auto 0; background: none; border: none; color: var(--ink-soft); font-family: inherit; font-weight: 600; font-size: 14px; cursor: pointer; }
.poll-skip:hover { color: var(--ink); }
.modal-card .poll-options { text-align: left; margin-top: 4px; }
.modal-card .poll-opt:hover { transform: none; }

/* ===== Carte publication de score ===== */
.lb-card {
  display: none; margin-top: 22px; width: 100%;
  background: #fff; border-radius: var(--radius); box-shadow: var(--shadow);
  border: 2px solid #f0dca0; padding: 20px 18px; text-align: left;
}
.lb-card.show { display: block; animation: pop .3s ease; }
.lb-head { font-size: 18px; font-weight: 700; text-align: center; margin-bottom: 14px; }
.lb-card input[type="text"], .lb-card input[type="email"] {
  width: 100%; font-family: inherit; font-size: 16px; /* 16px => pas de zoom iOS */
  padding: 13px 14px; margin-bottom: 10px;
  border: 2px solid #e6ebf7; border-radius: 12px; background: #f7f9ff;
}
.lb-card input:focus { outline: none; border-color: var(--bleu); background: #fff; }
.lb-consent { display: flex; gap: 10px; align-items: flex-start; font-size: 13px; color: var(--ink-soft); line-height: 1.4; margin: 4px 0 14px; cursor: pointer; }
.lb-consent input { width: 20px; height: 20px; flex-shrink: 0; margin-top: 1px; accent-color: var(--bleu); }
.turnstile-box { display: flex; justify-content: center; margin-bottom: 12px; }
.turnstile-box:empty { display: none; }
.lb-card .btn { width: 100%; }
.lb-msg { min-height: 18px; text-align: center; font-weight: 700; font-size: 14.5px; margin-top: 12px; }
.lb-msg.ok { color: var(--ok); }
.lb-msg.err { color: var(--ko); }
.lb-privacy { text-align: center; font-size: 11.5px; color: #9aa2bd; margin-top: 10px; }

/* Toast */
.toast {
  position: fixed; left: 50%; bottom: 26px; transform: translate(-50%, 20px);
  background: #1d2440; color: #fff; font-weight: 600; font-size: 14.5px;
  padding: 13px 20px; border-radius: 14px; max-width: 90vw; text-align: center;
  box-shadow: 0 12px 30px rgba(0,0,0,.28); z-index: 200;
  opacity: 0; pointer-events: none; transition: opacity .25s, transform .25s;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* Bouton de défi qui pulse pour attirer l'œil */
.btn-challenge.pulse { animation: attnPulse 1.1s ease-in-out infinite; }
@keyframes attnPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(230,57,70,.45); }
  50% { box-shadow: 0 0 0 12px rgba(230,57,70,0); transform: translateY(-2px); }
}

/* ===== Popup de partage (bottom-sheet sur mobile) ===== */
.modal-overlay {
  position: fixed; inset: 0; z-index: 300;
  background: rgba(20, 26, 48, .55);
  display: none; align-items: flex-end; justify-content: center;
  padding: 0; backdrop-filter: blur(3px);
}
.modal-overlay.show { display: flex; animation: fadeIn .2s ease; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

.modal-card {
  position: relative; background: #fff; width: 100%; max-width: 480px;
  border-radius: 26px 26px 0 0; padding: 26px 22px 30px;
  box-shadow: 0 -12px 40px rgba(0,0,0,.25);
  text-align: center; animation: sheetUp .3s cubic-bezier(.2,.8,.25,1);
}
@keyframes sheetUp { from { transform: translateY(100%); } to { transform: translateY(0); } }
.modal-close {
  position: absolute; top: 14px; right: 14px;
  width: 38px; height: 38px; border-radius: 50%;
  border: none; background: #eef2fb; color: var(--ink-soft);
  font-size: 17px; cursor: pointer; font-family: inherit;
}
.modal-emoji { font-size: 48px; }
.modal-title { font-size: 24px; font-weight: 700; margin: 4px 0 6px; }
.modal-sub { font-size: 15px; color: var(--ink-soft); line-height: 1.45; margin-bottom: 18px; }

.modal-linkrow { display: flex; gap: 8px; margin-bottom: 16px; }
#modal-link {
  flex: 1; min-width: 0; font-family: inherit; font-size: 14px;
  padding: 13px 14px; border: 2px solid #e6ebf7; border-radius: 14px;
  background: #f7f9ff; color: var(--ink-soft);
}
.modal-copy {
  background: linear-gradient(135deg, var(--bleu), #4f7df8); color: #fff;
  font-size: 15px; font-weight: 700; padding: 13px 18px; white-space: nowrap;
  box-shadow: 0 6px 16px rgba(33,85,206,.3);
}
.modal-copy.done { background: var(--ok); box-shadow: 0 6px 16px rgba(22,163,74,.3); }

.modal-share { display: flex; gap: 10px; }
.mshare {
  flex: 1; text-decoration: none; text-align: center;
  padding: 14px 8px; border-radius: 14px; font-weight: 700; font-size: 14.5px;
  color: #fff; transition: transform .15s, filter .15s;
}
.mshare:active { transform: scale(.96); }
.mshare.wa { background: #25d366; }
.mshare.tg { background: #2aabee; }
.mshare.em { background: #6b7280; }
.mshare:hover { filter: brightness(1.05); }

/* Sur grand écran : centrer la popup au lieu de la coller en bas */
@media (min-width: 620px) {
  .modal-overlay { align-items: center; }
  .modal-card { border-radius: 26px; animation: pop .28s ease; }
}

/* Bannière de défi */
.challenge-banner {
  display: none; align-items: center; gap: 12px;
  background: linear-gradient(135deg, #fff3e0, #ffe0e6);
  border: 2px solid #ffcf9e; border-radius: var(--radius);
  padding: 14px 16px; margin-bottom: 22px; width: 100%; max-width: 440px;
  box-shadow: var(--shadow); animation: pop .4s ease;
}
.challenge-banner.show { display: flex; }
.cb-emoji { font-size: 30px; }
.cb-text { flex: 1; font-size: 14.5px; font-weight: 600; line-height: 1.3; text-align: left; }
.cb-btn {
  background: var(--rouge); color: #fff; font-size: 14px; font-weight: 700;
  padding: 10px 14px; border-radius: 12px; white-space: nowrap;
  box-shadow: 0 6px 16px rgba(230,57,70,.35);
}
.cb-btn:hover { filter: brightness(1.06); }

/* ======== ÉCRANS INTRO (défi / examen officiel) ======== */
#screen-duel-intro, #screen-official-intro, #screen-entretien-intro { align-items: center; text-align: center; }
.duel-hero { display: flex; flex-direction: column; align-items: center; gap: 6px; }
#screen-duel-intro .mascot, #screen-official-intro .mascot, #screen-entretien-intro .mascot { font-size: 60px; }
.duel-lead {
  max-width: 420px; font-size: 16px; font-weight: 600;
  color: var(--ink-soft); line-height: 1.4; margin: 4px 0 26px;
}
.duel-steps {
  list-style: none; width: 100%; max-width: 440px;
  display: flex; flex-direction: column; gap: 14px; margin-bottom: 28px;
}
.duel-steps li {
  display: flex; align-items: center; gap: 14px; text-align: left;
  background: var(--card); border: 2px solid #eef1f9; border-radius: var(--radius);
  padding: 16px 18px; box-shadow: var(--shadow);
}
.ds-num {
  flex: none; width: 38px; height: 38px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 19px; font-weight: 800; color: #fff;
  background: linear-gradient(135deg, var(--bleu), var(--rouge));
  box-shadow: 0 6px 16px rgba(33,85,206,.28);
}
.ds-text { display: flex; flex-direction: column; gap: 3px; }
.ds-text strong { font-size: 16px; font-weight: 700; line-height: 1.25; }
.ds-text small { font-size: 13.5px; font-weight: 600; color: var(--ink-soft); line-height: 1.35; }
#btn-duel-start, #btn-official-start, #btn-entretien-start { width: 100%; max-width: 440px; }

/* Nudge Premium sur l'intro Examen officiel (comptes gratuits) */
.official-upsell {
  display: flex; align-items: center; gap: 12px; text-align: left;
  width: 100%; max-width: 440px; margin-top: 16px; cursor: pointer;
  font-family: inherit; border: 1.5px solid #d4af37; border-radius: var(--radius);
  background: linear-gradient(135deg, #fffdf5, #fff6e0);
  padding: 13px 16px; box-shadow: 0 6px 16px rgba(197,152,20,.18);
  transition: transform .15s, box-shadow .15s;
}
.official-upsell:hover { transform: translateY(-2px); box-shadow: 0 10px 22px rgba(197,152,20,.28); }
.ou-emoji { font-size: 26px; flex: none; }
.ou-text { display: flex; flex-direction: column; gap: 2px; flex: 1; }
.ou-text strong { font-size: 14.5px; font-weight: 800; color: #7a5c00; }
.ou-text small { font-size: 12.5px; font-weight: 600; color: var(--ink-soft); line-height: 1.35; }
.ou-cta { flex: none; font-size: 13px; font-weight: 800; color: #b8860b; white-space: nowrap; }

/* ======== SIMULATEUR D'ENTRETIEN ======== */
#screen-entretien.screen.active { display: flex; flex-direction: column; }
.sim-oral { display: none; flex-direction: column; gap: 14px; margin-top: 6px; }
.sim-oral.show { display: flex; }
#sim-reveal { align-self: center; }
.sim-guide {
  display: none; text-align: left;
  background: linear-gradient(135deg, #eef4ff, #f3ecff);
  border: 2px solid #d7def5; border-radius: var(--radius);
  padding: 16px 18px; font-size: 15px; line-height: 1.5; color: var(--ink);
  box-shadow: var(--shadow);
}
.sim-guide.show { display: block; animation: pop .3s ease; }
.sim-guide::before {
  content: "💡 Comment bien répondre"; display: block;
  font-weight: 800; font-size: 14px; color: var(--bleu); margin-bottom: 8px;
}
#sim-exp { margin-top: 4px; }
.sim-end { display: none; flex: 1; flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: 14px; }
.sim-end.show { display: flex; }
#sim-badge { --cat-color: #7c3aed; }

/* Boutons de partage / défi (résultats) */
.share-row { display: flex; gap: 12px; margin-top: 20px; flex-wrap: wrap; justify-content: center; }
.btn-share {
  background: linear-gradient(135deg, #7c3aed, #a855f7); color: #fff;
  box-shadow: 0 8px 20px rgba(124,58,237,.35); font-size: 16px; padding: 13px 20px;
}
.btn-challenge {
  background: #fff; color: var(--rouge); border: 2px solid #f3b0b0;
  box-shadow: var(--shadow); font-size: 16px; padding: 13px 20px;
}
.btn-share:hover, .btn-challenge:hover { transform: translateY(-2px); }
.share-hint { min-height: 20px; margin-top: 10px; font-size: 13.5px; color: var(--ink-soft); font-weight: 600; }
#tip-link-results { margin-top: 20px; }

/* ======== CATÉGORIES ======== */
.btn-back {
  align-self: flex-start;
  background: #fff; border: 2px solid #e6ebf7; color: var(--ink-soft);
  font-family: inherit; font-size: 15px; font-weight: 600;
  padding: 8px 16px; border-radius: 999px; cursor: pointer;
  box-shadow: 0 4px 12px rgba(29,36,64,.08);
  transition: transform .15s;
}
.btn-back:hover { transform: translateX(-3px); }
.btn-back.small { padding: 6px 13px; }

.screen-title { text-align: center; font-size: 30px; font-weight: 700; margin: 18px 0 6px; }
.screen-lead { text-align: center; font-size: 15px; color: var(--ink-soft); font-weight: 500; line-height: 1.5; max-width: 34ch; margin: 0 auto 22px; }

/* La grille d'entraînement est une colonne : sections + cartes "mélanger" pleine largeur,
   et sous-grilles de thèmes à 2 colonnes. */
.cat-grid { display: flex; flex-direction: column; gap: 14px; }
.cat-themes { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }

/* En-tête de section (gratuit / premium) */
.cat-section {
  display: flex; align-items: baseline; justify-content: space-between; gap: 10px;
  flex-wrap: wrap; margin-top: 8px; padding-bottom: 2px;
  border-bottom: 2px solid #eef1f8;
}
.cat-section:first-child { margin-top: 0; }
.cs-title { font-size: 17px; font-weight: 800; color: var(--ink); }
.cs-sub { font-size: 12.5px; color: var(--ink-soft); font-weight: 600; }

/* Carte "Tout mélanger" (action rapide, pleine largeur) */
.cat-mix {
  display: flex; align-items: center; gap: 14px; text-align: left;
  background: var(--card); border: none; cursor: pointer; font-family: inherit;
  padding: 16px 18px; border-radius: var(--radius); box-shadow: var(--shadow);
  border-left: 6px solid #0f766e;
  transition: transform .18s ease, box-shadow .18s ease;
}
.cat-mix:hover { transform: translateY(-3px); box-shadow: 0 16px 36px rgba(29,36,64,.18); }
.cat-mix .mix-icon { font-size: 34px; line-height: 1; }
.cat-mix .mix-body { display: flex; flex-direction: column; gap: 2px; flex: 1; }
.cat-mix .mix-body strong { font-size: 16.5px; font-weight: 800; color: var(--ink); }
.cat-mix .mix-body small { font-size: 12.5px; color: var(--ink-soft); font-weight: 500; }
.cat-mix .mix-go { font-size: 14px; font-weight: 800; color: #0f766e; white-space: nowrap; }
.cat-mix.premium { border-left-color: #7c3aed; }
.cat-mix.premium .mix-go { color: #7c3aed; }
.cat-mix.total { border-left-color: var(--rouge); background: linear-gradient(135deg, #fff, #fff6f2); }
.cat-mix.total .mix-go { color: var(--rouge); }

.cat-card {
  background: var(--card); border-radius: var(--radius);
  border: none; cursor: pointer; font-family: inherit;
  padding: 22px 16px; text-align: center;
  box-shadow: var(--shadow);
  border-bottom: 5px solid var(--cat-color, var(--bleu));
  transition: transform .18s ease, box-shadow .18s ease;
  display: flex; flex-direction: column; align-items: center; gap: 8px;
}
.cat-card:hover { transform: translateY(-5px) rotate(-1deg); box-shadow: 0 16px 36px rgba(29,36,64,.18); }
.cat-icon { font-size: 42px; }
.cat-name { font-size: 16px; font-weight: 600; line-height: 1.25; }
.cat-count { font-size: 12.5px; color: var(--ink-soft); font-weight: 500; }

/* Carte vitrine "Passe en Premium" (utilisateurs gratuits) */
.cat-upsell {
  position: relative; border-radius: var(--radius);
  background: linear-gradient(160deg, #faf7ff, #f3ecff);
  border: 2px solid #e3d5fb; padding: 22px 18px 20px;
  box-shadow: 0 10px 30px rgba(124,58,237,.12);
}
.upsell-badge {
  position: absolute; top: 14px; right: 14px;
  background: #7c3aed; color: #fff; font-size: 11px; font-weight: 800;
  letter-spacing: 1px; padding: 4px 10px; border-radius: 999px;
}
.upsell-title { font-size: 20px; font-weight: 800; color: var(--ink); margin: 0 0 14px; }
.upsell-perks { list-style: none; margin: 0 0 18px; padding: 0; display: flex; flex-direction: column; gap: 9px; }
.upsell-perks li { font-size: 14.5px; color: var(--ink); line-height: 1.35; }
.upsell-perks li span { margin-right: 4px; }
.upsell-cta { width: 100%; }
.upsell-teaser { text-align: center; font-size: 12.5px; color: var(--ink-soft); font-weight: 600; margin: 16px 0 0; }

/* Cartes de thème premium */
.cat-card.premium { position: relative; }
.cat-card.premium .cat-count { color: #7c3aed; font-weight: 700; }
.cat-card.locked {
  cursor: pointer; filter: grayscale(.55); opacity: .72;
  box-shadow: 0 4px 14px rgba(29,36,64,.08);
}
.cat-card.locked:hover { transform: translateY(-3px); opacity: .95; filter: grayscale(0); }
.cat-card.locked .cat-count { color: #9aa2bd; }
.cat-lock {
  position: absolute; top: 8px; right: 10px; font-size: 18px;
  filter: none;
}

/* ======== QUIZ ======== */
.quiz-header { display: flex; align-items: center; gap: 14px; margin-bottom: 20px; }
.progress-wrap { flex: 1; }
.progress-bar { height: 12px; background: #e4eaf7; border-radius: 999px; overflow: hidden; }
.progress-fill {
  height: 100%; width: 0%;
  background: linear-gradient(90deg, var(--bleu), var(--rouge));
  border-radius: 999px; transition: width .4s ease;
}
.progress-label { font-size: 12.5px; color: var(--ink-soft); font-weight: 600; margin-top: 4px; }
.quiz-stats { display: flex; gap: 8px; }
.stat {
  background: #fff; border-radius: 999px; padding: 7px 13px;
  font-size: 14.5px; font-weight: 700; box-shadow: 0 4px 12px rgba(29,36,64,.08);
}
.stat.streak.on { background: #fff3e0; animation: pulse .5s ease; }
.stat.timer { background: #eef2fb; color: #2155ce; font-variant-numeric: tabular-nums; min-width: 78px; text-align: center; transition: background .2s, box-shadow .2s; }
/* Chrono actif : léger halo "vivant" pendant que la question est affichée */
.stat.timer.running { background: #e4ecff; box-shadow: 0 0 0 rgba(33,85,206,.5); animation: timerPulse 1s ease-in-out infinite; }
@keyframes timerPulse { 0%,100% { box-shadow: 0 0 0 0 rgba(33,85,206,.35); } 50% { box-shadow: 0 0 0 5px rgba(33,85,206,0); } }
.result-time { margin-top: -2px; font-size: 15px; font-weight: 700; color: #2155ce; }
@keyframes pulse { 50% { transform: scale(1.18); } }

.q-category {
  align-self: center; font-size: 14px; font-weight: 600;
  color: #fff; background: var(--cat-color, var(--bleu));
  padding: 6px 16px; border-radius: 999px; margin-bottom: 14px;
  box-shadow: 0 4px 12px rgba(29,36,64,.15);
}

.q-card {
  background: var(--card); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 30px 26px 26px;
  text-align: center; position: relative; margin-bottom: 20px;
}
.q-mascot {
  position: absolute; top: -24px; left: 50%; transform: translateX(-50%);
  font-size: 40px; filter: drop-shadow(0 4px 8px rgba(0,0,0,.15));
  transition: transform .3s;
}
.q-text { font-size: clamp(19px, 4.5vw, 23px); font-weight: 600; line-height: 1.35; margin-top: 8px; }

.choices { display: flex; flex-direction: column; gap: 12px; }
.choice {
  font-family: inherit; cursor: pointer;
  background: #fff; border: 2.5px solid #e6ebf7;
  border-radius: 16px; padding: 15px 18px;
  font-size: 16.5px; font-weight: 600; color: var(--ink);
  text-align: left; display: flex; align-items: center; gap: 12px;
  transition: transform .14s, border-color .14s, background .14s;
  box-shadow: 0 4px 12px rgba(29,36,64,.06);
}
.choice:hover:not(:disabled) { transform: translateX(5px); border-color: var(--bleu); }
.choice:disabled { cursor: default; }
.choice .letter {
  flex-shrink: 0; width: 32px; height: 32px; border-radius: 10px;
  background: #eef2fb; color: var(--bleu);
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 15px;
}
.choice.correct { background: #e9f9ef; border-color: var(--ok); animation: yes .4s ease; }
.choice.correct .letter { background: var(--ok); color: #fff; }
.choice.wrong { background: #fdecec; border-color: var(--ko); animation: shake .4s ease; }
.choice.wrong .letter { background: var(--ko); color: #fff; }
.choice.dim { opacity: .45; }
@keyframes yes { 40% { transform: scale(1.04); } }
@keyframes shake {
  20% { transform: translateX(-7px); } 40% { transform: translateX(7px); }
  60% { transform: translateX(-4px); } 80% { transform: translateX(4px); }
}

.explanation {
  display: none; margin-top: 18px;
  background: #fff; border-radius: var(--radius);
  padding: 20px 22px; box-shadow: var(--shadow);
  border-left: 6px solid var(--bleu);
  animation: pop .3s ease;
}
.explanation.show { display: block; }
.explanation.good { border-left-color: var(--ok); }
.explanation.bad { border-left-color: var(--ko); }
.exp-title { font-size: 18px; font-weight: 700; margin-bottom: 6px; }
.exp-text { font-size: 15.5px; color: var(--ink-soft); line-height: 1.5; margin-bottom: 10px; }
.exp-source { display: none; font-size: 13.5px; font-weight: 700; color: #b8860b; background: #fff8e1; border: 1px solid #f0dca0; border-radius: 10px; padding: 8px 12px; margin-bottom: 16px; }

/* ======== RÉSULTATS ======== */
#screen-results { align-items: center; justify-content: center; text-align: center; gap: 14px; }
.result-mascot { font-size: 84px; animation: bounce 2s ease-in-out infinite; }
.result-grade { font-size: clamp(28px, 7vw, 40px); font-weight: 700; }

.result-score-circle { position: relative; width: 170px; height: 170px; margin: 8px 0; }
.result-score-circle svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.ring-bg { fill: none; stroke: #e4eaf7; stroke-width: 12; }
.ring-fill {
  fill: none; stroke: url(#grad) var(--bleu); stroke: var(--bleu);
  stroke-width: 12; stroke-linecap: round;
  stroke-dasharray: 326.7; stroke-dashoffset: 326.7;
  transition: stroke-dashoffset 1.2s ease .3s;
}
.ring-label {
  position: absolute; inset: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
}
.ring-label span { font-size: 38px; font-weight: 700; }
.ring-label small { font-size: 14px; color: var(--ink-soft); font-weight: 600; }

.verdict {
  display: none; font-size: 17px; font-weight: 700;
  padding: 10px 22px; border-radius: 999px; margin-bottom: 2px;
}
.verdict.show { display: inline-block; animation: pop .4s ease; }
.verdict.pass { background: #e9f9ef; color: var(--ok); border: 2px solid #9be7b4; }
.verdict.fail { background: #fdecec; color: var(--ko); border: 2px solid #f3b0b0; }

.result-msg { font-size: 17px; color: var(--ink-soft); max-width: 420px; line-height: 1.5; font-weight: 500; }
.result-buttons { display: flex; gap: 14px; margin-top: 18px; flex-wrap: wrap; justify-content: center; }

@media (max-width: 480px) {
  #app { padding: 30px 14px 40px; }
  .cat-grid { gap: 12px; }
  .cat-themes { gap: 10px; }
  .cat-card { padding: 16px 10px; }
  .cat-icon { font-size: 34px; }
  .quiz-stats .stat { padding: 6px 10px; font-size: 13px; }
  /* Résultats plus compacts sur mobile (on remonte tout) */
  .result-mascot { font-size: 60px; }
  .result-score-circle { width: 126px; height: 126px; margin: 4px 0; }
  .ring-label span { font-size: 28px; }
  .ring-label small { font-size: 12px; }
  .result-grade { font-size: 26px; }
  .result-msg { font-size: 15.5px; }
  #screen-results { gap: 8px; }
}
