/* Prépa Build DBA. Couleurs : celles du thème Telegram, avec des valeurs de secours pour les essais hors Telegram. */

:root {
  --bg: var(--tg-theme-bg-color, #ffffff);
  --bg2: var(--tg-theme-secondary-bg-color, #f1f2f6);
  --surface: var(--tg-theme-section-bg-color, var(--tg-theme-bg-color, #ffffff));
  --texte: var(--tg-theme-text-color, #15171c);
  --pale: var(--tg-theme-hint-color, #7c8491);
  --accent: var(--tg-theme-button-color, #2f6fec);
  --accent-texte: var(--tg-theme-button-text-color, #ffffff);
  --lien: var(--tg-theme-link-color, #2f6fec);
  --ligne: rgba(127, 127, 127, 0.18);
  --code-fond: rgba(127, 127, 127, 0.14);
  --juste: #1e9e57;
  --juste-fond: rgba(30, 158, 87, 0.13);
  --faux: #d9473f;
  --faux-fond: rgba(217, 71, 63, 0.12);
  --moyen: #d68a12;
  --rayon: 16px;
  --ombre: 0 1px 2px rgba(0, 0, 0, 0.05), 0 4px 16px rgba(0, 0, 0, 0.05);
  --mono: ui-monospace, "SF Mono", SFMono-Regular, "Roboto Mono", Menlo, Consolas, monospace;
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: var(--tg-theme-bg-color, #17191e);
    --bg2: var(--tg-theme-secondary-bg-color, #0f1013);
    --surface: var(--tg-theme-section-bg-color, var(--tg-theme-bg-color, #1f2228));
    --texte: var(--tg-theme-text-color, #eef0f4);
    --pale: var(--tg-theme-hint-color, #8d95a3);
    --accent: var(--tg-theme-button-color, #4a86f7);
    --lien: var(--tg-theme-link-color, #6ea0ff);
    --ombre: none;
  }
}
:root[data-theme="dark"] {
  --ombre: none;
  --juste: #34c172;
  --faux: #f0675f;
}

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

html, body { margin: 0; background: var(--bg2); color: var(--texte); }

body {
  font: 16px/1.45 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  -webkit-text-size-adjust: 100%;
}

#app {
  max-width: 560px;
  margin: 0 auto;
  padding: 12px 16px calc(96px + env(safe-area-inset-bottom));
  min-height: 100vh;
}

button { font: inherit; color: inherit; }

code {
  font-family: var(--mono);
  font-size: 0.9em;
  background: var(--code-fond);
  padding: 0.08em 0.35em;
  border-radius: 6px;
  overflow-wrap: anywhere;
}

.cmd code { background: none; padding: 0; font-size: 0.95em; }

/* ---------- en-têtes ---------- */

.entete { display: flex; gap: 8px; align-items: flex-start; margin: 4px 0 16px; }
.entete h1 { font-size: 24px; line-height: 1.2; margin: 0; letter-spacing: -0.01em; }
.entete .sous { margin: 4px 0 0; color: var(--pale); font-size: 15px; }
.retour {
  border: 0; background: var(--surface); width: 36px; height: 36px; border-radius: 50%;
  font-size: 24px; line-height: 1; cursor: pointer; flex: none; box-shadow: var(--ombre);
}

.accueil-tete { padding: 12px 4px 4px; }
.accueil-tete .surtitre { margin: 0; color: var(--pale); font-size: 14px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em; }
.accueil-tete h1 { margin: 4px 0 8px; font-size: 32px; letter-spacing: -0.02em; }
.echeance { margin: 0; color: var(--pale); }
.pastille {
  display: inline-block; background: var(--accent); color: var(--accent-texte);
  font-weight: 700; font-size: 14px; padding: 3px 10px; border-radius: 999px; margin-right: 6px;
}

.section { font-size: 15px; text-transform: uppercase; letter-spacing: 0.04em; color: var(--pale); margin: 28px 4px 10px; }
.section small { text-transform: none; letter-spacing: 0; font-weight: 400; }

/* ---------- accueil ---------- */

.bandeau {
  display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 8px;
  background: var(--surface); border-radius: var(--rayon); padding: 14px 8px; margin: 16px 0; box-shadow: var(--ombre);
}
.bandeau div { text-align: center; display: flex; flex-direction: column; gap: 2px; }
.bandeau strong { font-size: 22px; letter-spacing: -0.01em; }
.bandeau span { font-size: 12.5px; color: var(--pale); line-height: 1.25; }

.tuile {
  display: flex; flex-direction: column; align-items: flex-start; gap: 2px; text-align: left;
  border: 0; background: var(--surface); border-radius: var(--rayon); padding: 16px; cursor: pointer;
  box-shadow: var(--ombre); min-height: 112px; transition: transform 0.12s ease;
}
.tuile:active { transform: scale(0.98); }
.tuile .icone { font-size: 26px; margin-bottom: 6px; }
.tuile .titre { font-weight: 700; font-size: 17px; }
.tuile .detail { color: var(--pale); font-size: 14px; }
.tuile.large { width: 100%; min-height: 0; margin-bottom: 10px; display: grid; grid-template-columns: auto 1fr; column-gap: 14px; align-items: center; }
.tuile.large .icone { grid-row: span 2; margin: 0; font-size: 30px; }
.tuile.principale { background: var(--accent); color: var(--accent-texte); }
.tuile.principale .detail { color: inherit; opacity: 0.85; }
.tuile.mise-en-avant { background: linear-gradient(135deg, #2b2f5e, #5a3e8f); color: #fff; }
.tuile.mise-en-avant .detail { color: inherit; opacity: 0.85; }
.grille { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
/* Une tuile seule sur la dernière ligne prend toute la largeur. */
.grille > .tuile:last-child:nth-child(odd) {
  grid-column: span 2; min-height: 0; display: grid; grid-template-columns: auto 1fr; column-gap: 14px; align-items: center;
}
.grille > .tuile:last-child:nth-child(odd) .icone { grid-row: span 2; margin: 0; }

/* ---------- boutons ---------- */

.bouton {
  display: block; width: 100%; border: 0; border-radius: 14px; padding: 15px 16px; margin: 0 0 10px;
  font-weight: 650; font-size: 16.5px; cursor: pointer; text-align: center; transition: transform 0.12s ease, opacity 0.12s;
}
.bouton:active { transform: scale(0.985); }
.bouton.plein { background: var(--accent); color: var(--accent-texte); }
.bouton.contour { background: var(--surface); color: var(--lien); box-shadow: inset 0 0 0 1.5px var(--ligne); }
.bouton.discret { background: none; color: var(--lien); font-weight: 500; margin-top: 8px; }
.bouton.vert { background: var(--juste); color: #fff; }
.bouton.rouge { color: var(--faux); }

.barre-bas {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 5;
  padding: 10px 16px calc(10px + env(safe-area-inset-bottom));
  background: linear-gradient(to top, var(--bg2) 70%, transparent);
}
.barre-bas > * { max-width: 528px; margin-left: auto; margin-right: auto; }
.barre-bas .bouton { margin-bottom: 0; }
.barre-bas.deux { display: flex; gap: 10px; justify-content: center; }
.barre-bas.deux .bouton { flex: 1; max-width: 259px; margin: 0; }

/* ---------- listes ---------- */

.liste, .faibles { display: flex; flex-direction: column; gap: 8px; }
.ligne {
  display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; border: 0; cursor: pointer;
  background: var(--surface); border-radius: 14px; padding: 13px 14px; box-shadow: var(--ombre);
}
.ligne:active { opacity: 0.8; }
.ligne-texte { flex: 1; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.ligne-texte strong { font-weight: 600; font-size: 15.5px; }
.ligne-texte small { color: var(--pale); font-size: 13.5px; }

.badge { flex: none; font-size: 13px; font-weight: 700; padding: 4px 9px; border-radius: 999px; background: var(--code-fond); color: var(--pale); }
.badge.bon { background: var(--juste-fond); color: var(--juste); }
.badge.moyen { background: rgba(214, 138, 18, 0.14); color: var(--moyen); }
.badge.faible { background: var(--faux-fond); color: var(--faux); }

.puces { display: flex; gap: 8px; overflow-x: auto; margin: 0 -16px 16px; padding: 0 16px 2px; scrollbar-width: none; }
.puces::-webkit-scrollbar { display: none; }
.puce {
  flex: none; border: 0; background: var(--surface); border-radius: 999px; padding: 8px 14px; font-size: 14.5px; cursor: pointer;
  box-shadow: inset 0 0 0 1px var(--ligne); white-space: nowrap;
}
.puce.active { background: var(--accent); color: var(--accent-texte); box-shadow: none; font-weight: 600; }

.vide { color: var(--pale); text-align: center; padding: 12px; }

/* ---------- quiz ---------- */

.progres { height: 6px; background: var(--ligne); border-radius: 999px; overflow: hidden; margin: 8px 0 12px; }
.progres div { height: 100%; background: var(--accent); border-radius: inherit; transition: width 0.25s ease; }
.meta-q { display: flex; justify-content: space-between; gap: 12px; color: var(--pale); font-size: 13.5px; margin: 0 2px 10px; }
.meta-q span:last-child { text-align: right; }
.question { font-size: 19px; line-height: 1.4; font-weight: 650; margin: 0 2px 18px; }
.question.grande { font-size: 24px; line-height: 1.3; text-align: center; margin: 28px 8px 24px; }

.choix-liste { display: flex; flex-direction: column; gap: 10px; }
.choix {
  display: flex; align-items: flex-start; gap: 12px; text-align: left; width: 100%; border: 0; cursor: pointer;
  background: var(--surface); border-radius: 14px; padding: 14px; box-shadow: var(--ombre), inset 0 0 0 1.5px transparent;
  font-size: 16px; line-height: 1.4; transition: background 0.15s, box-shadow 0.15s, opacity 0.15s;
}
.choix:active:not(:disabled) { transform: scale(0.99); }
.choix .lettre {
  flex: none; width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center;
  font-weight: 700; font-size: 14px; background: var(--code-fond); color: var(--pale);
}
.choix-texte { flex: 1; padding-top: 3px; min-width: 0; }
.choix:disabled { cursor: default; }
.choix.juste { background: var(--juste-fond); box-shadow: inset 0 0 0 1.5px var(--juste); }
.choix.juste .lettre { background: var(--juste); color: #fff; }
.choix.faux { background: var(--faux-fond); box-shadow: inset 0 0 0 1.5px var(--faux); }
.choix.faux .lettre { background: var(--faux); color: #fff; }
.choix.eteint { opacity: 0.55; }

.retour-q { margin: 16px 0 0; padding: 14px 16px; border-radius: 14px; background: var(--surface); box-shadow: var(--ombre); }
.retour-q p { margin: 0; }
.retour-q .verdict { font-weight: 700; margin-bottom: 6px; }
.retour-q.juste .verdict { color: var(--juste); }
.retour-q.faux .verdict { color: var(--faux); }

.score { text-align: center; padding: 20px 0 16px; }
.score strong { font-size: 64px; line-height: 1; letter-spacing: -0.03em; }
.score strong span { font-size: 28px; color: var(--pale); font-weight: 600; letter-spacing: 0; }
.score p { margin: 8px 0 0; color: var(--pale); font-size: 16px; }
.score.petit { padding: 16px 0 12px; }
.score.petit strong { font-size: 44px; }

.erreur { background: var(--surface); border-radius: 14px; padding: 12px 14px; box-shadow: var(--ombre); }
.erreur p { margin: 0; font-size: 15px; }
.erreur .bonne { color: var(--juste); margin-top: 6px; font-weight: 600; }

/* ---------- cartes ---------- */

.carte3d {
  display: grid; width: 100%; border: 0; padding: 0; background: none; cursor: pointer; perspective: 1200px; text-align: left;
}
.carte3d .face {
  grid-area: 1 / 1; display: flex; flex-direction: column; gap: 12px; min-height: 300px;
  background: var(--surface); border-radius: 20px; padding: 22px 20px; box-shadow: var(--ombre), inset 0 0 0 1px var(--ligne);
  backface-visibility: hidden; -webkit-backface-visibility: hidden; transition: transform 0.45s cubic-bezier(0.3, 0.7, 0.2, 1);
}
.carte3d .face small { color: var(--pale); font-size: 13px; text-transform: uppercase; letter-spacing: 0.04em; font-weight: 600; }
.carte3d .recto strong { font-size: 21px; line-height: 1.35; flex: 1; display: flex; align-items: center; }
.carte3d .recto em { color: var(--pale); font-style: normal; font-size: 14px; text-align: center; }
.carte3d .verso { transform: rotateY(180deg); font-size: 16.5px; line-height: 1.5; }
.carte3d.retournee .recto { transform: rotateY(-180deg); }
.carte3d.retournee .verso { transform: rotateY(0); }

.boites { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 8px 0 20px; }
.boites div { background: var(--surface); border-radius: 14px; padding: 12px 6px; text-align: center; box-shadow: var(--ombre); display: flex; flex-direction: column; gap: 4px; }
.boites strong { font-size: 24px; }
.boites span { font-size: 12.5px; color: var(--pale); line-height: 1.3; }

/* ---------- oral ---------- */

.role { text-align: center; color: var(--pale); font-weight: 600; font-size: 14px; margin: 4px 0 0; }
.minuteur { position: relative; width: 180px; height: 180px; margin: 8px auto 4px; }
.minuteur svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.minuteur circle { fill: none; stroke-width: 8; }
.minuteur .fond { stroke: var(--ligne); }
.minuteur .arc { stroke: var(--accent); stroke-linecap: round; transition: stroke-dashoffset 0.25s linear, stroke 0.3s; }
.minuteur.presque .arc { stroke: var(--faux); }
.minuteur strong { position: absolute; inset: 0; display: grid; place-items: center; font-size: 40px; font-variant-numeric: tabular-nums; }
.consigne { text-align: center; color: var(--pale); margin: 8px 0 0; }
.consigne.gauche { text-align: left; margin: -8px 2px 0; }

.modele { background: var(--surface); border-radius: 16px; padding: 16px; box-shadow: var(--ombre); margin: 0 0 12px; }
.modele h3 { margin: 2px 0 8px; font-size: 17px; }
.modele p { margin: 0; line-height: 1.55; }
.etiquette { color: var(--accent) !important; font-weight: 700; font-size: 13px; text-transform: uppercase; letter-spacing: 0.04em; margin-bottom: 6px !important; }
.points { margin: 10px 0 0; padding-left: 20px; color: var(--pale); font-size: 15px; }
.points li { margin: 3px 0; }

.coches { display: flex; flex-direction: column; gap: 8px; }
.coche {
  display: flex; align-items: center; gap: 12px; text-align: left; border: 0; cursor: pointer; width: 100%;
  background: var(--surface); border-radius: 14px; padding: 14px; box-shadow: var(--ombre);
}
.coche .case {
  flex: none; width: 26px; height: 26px; border-radius: 8px; display: grid; place-items: center;
  box-shadow: inset 0 0 0 2px var(--ligne); font-weight: 800; color: #fff;
}
.coche.cochee .case { background: var(--juste); box-shadow: none; }
.coche:disabled { cursor: default; }

/* ---------- remets dans l'ordre ---------- */

.etapes { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.etapes li, .etapes.reserve button {
  display: flex; gap: 12px; align-items: flex-start; background: var(--surface); border-radius: 14px; padding: 12px 14px;
  box-shadow: var(--ombre); font-size: 15.5px; line-height: 1.4;
}
.etapes.placees li { padding: 0; }
.etapes.placees li button { display: flex; gap: 12px; width: 100%; text-align: left; border: 0; background: none; padding: 12px 14px; cursor: pointer; }
.etapes .num {
  flex: none; width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center;
  background: var(--accent); color: var(--accent-texte); font-weight: 700; font-size: 13.5px;
}
.etapes .emplacement { background: none; box-shadow: inset 0 0 0 1.5px var(--ligne); color: var(--pale); }
.etapes .emplacement .num { background: var(--ligne); color: var(--pale); }
.etapes.reserve button { width: 100%; text-align: left; border: 0; cursor: pointer; }
.etapes.reserve button:active { opacity: 0.75; }
.etapes.corrigees .marque { flex: none; width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; color: #fff; font-weight: 700; font-size: 13.5px; }
.etapes.corrigees .bien .marque { background: var(--juste); }
.etapes.corrigees .mal { box-shadow: var(--ombre), inset 0 0 0 1.5px var(--faux); }
.etapes.corrigees .mal .marque { background: var(--faux); }
.etapes.corrigees em { color: var(--faux); font-style: normal; font-weight: 600; white-space: nowrap; }
.etapes.justes .num { background: var(--juste); color: #fff; }

/* ---------- veille ---------- */

.reflexes { margin: 0; padding: 14px 16px 14px 40px; background: var(--surface); border-radius: 16px; box-shadow: var(--ombre); }
.reflexes li { margin: 6px 0; font-size: 16.5px; font-weight: 550; }
.fin-veille { text-align: center; font-size: 17px; font-weight: 600; margin: 24px 0 4px; }

/* ---------- progression ---------- */

.barre-theme { margin: 0 2px 12px; }
.barre-theme p { display: flex; justify-content: space-between; gap: 10px; margin: 0 0 5px; font-size: 14.5px; }
.barre-theme p span:last-child { color: var(--pale); white-space: nowrap; }
.jauge { height: 8px; border-radius: 999px; background: var(--ligne); overflow: hidden; }
.jauge div { height: 100%; border-radius: inherit; background: var(--pale); }
.jauge .bon { background: var(--juste); }
.jauge .moyen { background: var(--moyen); }
.jauge .faible { background: var(--faux); }

/* =====================================================================
   v2 : accueil à un bouton, séance guidée, couche de jeu
   ===================================================================== */

.haut-accueil { margin: 6px 2px 14px; color: var(--pale); font-size: 14px; }
.haut-accueil .pastille { font-size: 13px; padding: 2px 9px; }

.heros {
  position: relative; overflow: hidden; border-radius: 24px; padding: 22px 18px 18px; color: #fff;
  background: radial-gradient(120% 90% at 100% 0%, #5b7cff 0%, transparent 55%), linear-gradient(150deg, #1f3a8a, #3b2a85 60%, #2a1c5c);
  box-shadow: 0 10px 30px rgba(43, 47, 120, 0.28);
}
.heros.nuit { background: radial-gradient(120% 90% at 100% 0%, #6d5bd0 0%, transparent 55%), linear-gradient(150deg, #151a3d, #2a1f55 60%, #120f2b); }
.heros-chap { margin: 0; font-weight: 700; font-size: 15px; opacity: 0.95; }
.heros-obj { margin: 6px 0 18px; font-size: 13.5px; opacity: 0.8; }
.jauge-chap { height: 8px; border-radius: 999px; background: rgba(255, 255, 255, 0.18); overflow: hidden; margin-top: 10px; }
.jauge-chap div { height: 100%; border-radius: inherit; background: linear-gradient(90deg, #7ee2a8, #3ccf7e); }

.lancer {
  display: flex; flex-direction: column; align-items: center; gap: 2px; width: 100%; border: 0; cursor: pointer;
  background: #fff; color: #23307a; border-radius: 20px; padding: 20px 16px; font-weight: 800;
  box-shadow: 0 6px 0 rgba(0, 0, 0, 0.18), 0 0 0 0 rgba(255, 255, 255, 0.5); animation: respire 2.4s ease-in-out infinite;
  transition: transform 0.1s ease, box-shadow 0.1s ease;
}
.lancer:active { transform: translateY(4px); box-shadow: 0 2px 0 rgba(0, 0, 0, 0.18); }
.lancer-titre { font-size: 22px; letter-spacing: -0.01em; }
.lancer-sous { font-size: 14px; font-weight: 600; color: #6b74a8; }
@keyframes respire {
  0%, 100% { box-shadow: 0 6px 0 rgba(0, 0, 0, 0.18), 0 0 0 0 rgba(255, 255, 255, 0.35); }
  50% { box-shadow: 0 6px 0 rgba(0, 0, 0, 0.18), 0 0 0 10px rgba(255, 255, 255, 0); }
}
.express {
  display: block; width: 100%; margin-top: 10px; border: 0; cursor: pointer; border-radius: 16px; padding: 13px;
  background: rgba(255, 255, 255, 0.14); color: #fff; font-weight: 700; font-size: 16px;
}
.mini-lien { display: block; margin: 10px auto 0; border: 0; background: none; color: rgba(255, 255, 255, 0.75); font-size: 13.5px; text-decoration: underline; cursor: pointer; }

.trio { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 14px 0; }
.trio-case {
  position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; text-align: center;
  background: var(--surface); border-radius: 16px; padding: 12px 6px; box-shadow: var(--ombre); min-height: 108px;
}
.trio-case span { font-size: 12px; color: var(--pale); line-height: 1.25; }
.trio-case .gros { font-size: 24px; }
.niveau-nom { font-size: 14.5px; line-height: 1.2; }
.anneau { display: block; transform: rotate(-90deg); }
.anneau-fond { fill: none; stroke: var(--ligne); stroke-width: 7; }
.anneau-arc { fill: none; stroke: var(--juste); stroke-width: 7; stroke-linecap: round; transition: stroke-dashoffset 0.6s ease; }
.anneau-texte { position: absolute; top: 12px; left: 0; right: 0; height: 52px; display: grid; place-items: center; font-size: 14px; }
.jauge.mini { width: 80%; height: 6px; }
.jauge.mini div { background: var(--accent); }

.lien-libre {
  display: flex; justify-content: space-between; align-items: center; width: 100%; border: 0; cursor: pointer;
  background: var(--surface); border-radius: 14px; padding: 15px 16px; font-weight: 600; box-shadow: var(--ombre); color: var(--texte);
}
.lien-libre span { color: var(--pale); font-size: 22px; line-height: 1; }

/* ---------- la séance ---------- */

.seance-haut { display: flex; align-items: center; gap: 10px; margin: 6px 0 8px; }
.fermer { flex: none; border: 0; background: var(--surface); width: 34px; height: 34px; border-radius: 50%; cursor: pointer; color: var(--pale); font-size: 15px; box-shadow: var(--ombre); }
.segments { flex: 1; display: flex; gap: 4px; }
.seg { flex: 1; height: 7px; border-radius: 999px; background: var(--ligne); overflow: hidden; }
.seg i { display: block; height: 100%; background: var(--accent); border-radius: inherit; transition: width 0.3s ease; }
.pts { flex: none; font-weight: 800; font-size: 15px; font-variant-numeric: tabular-nums; }
.etape-ligne { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin: 0 2px 14px; color: var(--pale); font-size: 13.5px; font-weight: 600; }
.combo {
  color: #fff; background: linear-gradient(90deg, #ff8a00, #ff3d6e); padding: 3px 10px; border-radius: 999px; font-weight: 800;
  animation: pop 0.35s ease;
}
@keyframes pop { 0% { transform: scale(0.6); } 70% { transform: scale(1.15); } 100% { transform: scale(1); } }

.intro {
  display: flex; flex-direction: column; align-items: center; gap: 6px; width: 100%; border: 0; cursor: pointer; text-align: center;
  background: var(--surface); border-radius: 24px; padding: 48px 20px; margin-top: 8vh; box-shadow: var(--ombre);
  animation: entree 0.4s cubic-bezier(0.2, 0.9, 0.3, 1.2);
}
.intro-icone { font-size: 56px; line-height: 1.1; }
.intro-num { color: var(--pale); font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; }
.intro strong { font-size: 27px; letter-spacing: -0.01em; }
.intro-detail { font-weight: 600; }
.intro-sous { color: var(--pale); font-size: 15px; }
@keyframes entree { from { opacity: 0; transform: translateY(16px) scale(0.96); } to { opacity: 1; transform: none; } }

.carte-jeu {
  background: var(--surface); border-radius: 20px; padding: 24px 20px; box-shadow: var(--ombre); margin-bottom: 16px;
  animation: entree 0.3s ease;
}
.phrase { margin: 0; font-size: 20px; line-height: 1.6; font-weight: 600; }
.trou {
  display: inline-block; min-width: 88px; padding: 0 8px; margin: 0 2px; border-bottom: 3px solid var(--accent);
  background: rgba(127, 127, 127, 0.1); border-radius: 6px 6px 0 0; text-align: center; line-height: 1.5;
}
.trou.mono { font-family: var(--mono); font-size: 0.9em; }
.trou.juste { border-color: var(--juste); background: var(--juste-fond); color: var(--juste); animation: pop 0.35s ease; }
.trou.revele { border-color: var(--juste); background: var(--juste-fond); color: var(--juste); }
code .trou { font-size: 1em; }

.options { display: flex; flex-direction: column; gap: 10px; }
.option {
  width: 100%; border: 0; cursor: pointer; background: var(--surface); border-radius: 16px; padding: 17px 16px; font-size: 17px; font-weight: 600;
  box-shadow: var(--ombre), inset 0 0 0 1.5px var(--ligne); transition: transform 0.1s ease;
}
.option:active:not(:disabled) { transform: scale(0.98); }
.option code.nu, .option code { background: none; padding: 0; font-size: 0.95em; }
.option.juste { background: var(--juste-fond); box-shadow: inset 0 0 0 2px var(--juste); color: var(--juste); animation: rebond 0.35s ease; }
@keyframes rebond { 0% { transform: scale(0.97); } 60% { transform: scale(1.02); } 100% { transform: none; } }
.option.faux { background: var(--faux-fond); box-shadow: inset 0 0 0 2px var(--faux); color: var(--faux); animation: secoue 0.35s ease; }
.option.eteint { opacity: 0.45; }
@keyframes secoue { 0%, 100% { transform: none; } 25% { transform: translateX(-6px); } 75% { transform: translateX(6px); } }

.choix.juste { animation: rebond 0.35s ease; }
.barre-bas.deux .bouton.plein { flex: 1.4; max-width: none; }
.barre-bas.deux .bouton { padding-left: 10px; padding-right: 10px; }
.choix.faux { animation: secoue 0.35s ease; }
.pourquoi { margin-top: 8px; border: 0; background: none; color: var(--lien); font-weight: 600; padding: 0; cursor: pointer; font-size: 15px; }

/* Vrai ou faux */
.vf-carte { min-height: 220px; display: flex; flex-direction: column; justify-content: center; gap: 14px; }
.vf-carte.juste { box-shadow: inset 0 0 0 2px var(--juste); }
.vf-carte.faux { box-shadow: inset 0 0 0 2px var(--faux); animation: secoue 0.35s ease; }
.affirmation { margin: 0; font-size: 21px; line-height: 1.45; font-weight: 650; text-align: center; }
.vf-verdict { margin: 0; text-align: center; font-weight: 800; font-size: 17px; }
.vf-carte.juste .vf-verdict { color: var(--juste); }
.vf-carte.faux .vf-verdict { color: var(--faux); }
.vf-correction { margin: 0; text-align: center; color: var(--texte); }
.chrono7 { height: 8px; border-radius: 999px; background: var(--ligne); overflow: hidden; }
.chrono7 i { display: block; height: 100%; background: linear-gradient(90deg, #ff3d6e, #ff8a00); border-radius: inherit; animation: vider linear forwards; }
@keyframes vider { to { width: 0; } }
.vf-boutons { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; position: sticky; bottom: calc(12px + env(safe-area-inset-bottom)); }
.vf {
  border: 0; cursor: pointer; border-radius: 20px; padding: 26px 10px; font-size: 21px; font-weight: 800; color: #fff;
  box-shadow: 0 5px 0 rgba(0, 0, 0, 0.18); transition: transform 0.08s ease;
}
.vf:active:not(:disabled) { transform: translateY(3px); box-shadow: 0 2px 0 rgba(0, 0, 0, 0.18); }
.vf.vrai { background: #1e9e57; }
.vf.faux { background: #d9473f; }
.vf:disabled { opacity: 0.35; }
.vf.bonne:disabled { opacity: 1; outline: 3px solid var(--texte); outline-offset: 2px; }

/* Associer les paires */
.chrono { font-variant-numeric: tabular-nums; font-weight: 700; color: var(--texte); }
.paires-grille { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.colonne { display: flex; flex-direction: column; gap: 10px; }
.paire {
  min-height: 64px; border: 0; cursor: pointer; background: var(--surface); border-radius: 14px; padding: 10px; font-size: 14.5px; line-height: 1.3;
  box-shadow: var(--ombre), inset 0 0 0 1.5px var(--ligne); transition: transform 0.1s ease, background 0.15s;
}
.paire code { font-size: 0.9em; }
.paire.choisie { box-shadow: inset 0 0 0 2.5px var(--accent); background: rgba(47, 111, 236, 0.1); transform: scale(1.02); }
.paire.faite { background: var(--juste-fond); box-shadow: inset 0 0 0 1.5px var(--juste); color: var(--juste); opacity: 0.75; animation: rebond 0.3s ease; }
.paire.rate { background: var(--faux-fond); box-shadow: inset 0 0 0 2px var(--faux); animation: secoue 0.35s ease; }
.fin-jeu { text-align: center; font-weight: 700; margin: 18px 0 0; font-size: 17px; }

/* Réflexes (mode veille) */
.reflexe { min-height: 240px; display: flex; flex-direction: column; justify-content: center; align-items: center; text-align: center; gap: 12px; }
.reflexe p { margin: 0; font-size: 24px; line-height: 1.35; font-weight: 700; }
.reflexe-num { color: var(--pale); font-weight: 700; font-size: 14px; }

/* Bilan */
.bilan { text-align: center; padding: 8px 0 4px; }
.bilan-icone { font-size: 52px; margin: 0; animation: pop 0.5s ease; }
.bilan h2 { margin: 4px 0 0; font-size: 22px; }
.gros-points { margin: 6px 0 0; font-size: 56px; font-weight: 850; letter-spacing: -0.03em; color: var(--accent); font-variant-numeric: tabular-nums; }
.gros-points small { font-size: 18px; font-weight: 700; color: var(--pale); letter-spacing: 0; }
.bilan-ligne { margin: 2px 0 10px; color: var(--pale); }
.badge-fete {
  margin: 8px auto 0; max-width: 420px; padding: 10px 14px; border-radius: 14px; font-size: 15px;
  background: linear-gradient(90deg, rgba(255, 138, 0, 0.16), rgba(255, 61, 110, 0.16)); animation: pop 0.45s ease;
}

/* Progression v2 */
.niveau-carte { background: var(--surface); border-radius: 18px; padding: 16px; box-shadow: var(--ombre); margin-bottom: 12px; }
.niveau-carte .etiquette { margin: 0 0 2px !important; }
.niveau-grand { margin: 0 0 10px; font-size: 24px; font-weight: 800; }
.niveau-carte .sous { margin: 8px 0 0; color: var(--pale); font-size: 14px; }
.barre-theme.verrou { opacity: 0.55; }

/* Effets */
.flotte {
  position: fixed; z-index: 50; transform: translate(-50%, -50%); pointer-events: none;
  font-weight: 900; font-size: 22px; color: #ff8a00; text-shadow: 0 1px 0 rgba(0, 0, 0, 0.15); animation: envol 0.95s ease-out forwards;
}
@keyframes envol { from { opacity: 1; transform: translate(-50%, -50%) scale(0.8); } to { opacity: 0; transform: translate(-50%, -160%) scale(1.25); } }
.fete { position: fixed; inset: 0; z-index: 60; display: grid; place-items: center; background: rgba(10, 12, 30, 0.55); animation: fondu 0.2s ease; }
.fete-carte {
  display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 28px 30px; border-radius: 24px; color: #fff; text-align: center;
  background: linear-gradient(150deg, #1f3a8a, #5a3e8f); box-shadow: 0 20px 60px rgba(0, 0, 0, 0.35); animation: entree 0.45s cubic-bezier(0.2, 0.9, 0.3, 1.3);
}
.fete-icone { font-size: 54px; }
.fete-titre { margin: 0; opacity: 0.8; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; font-size: 13px; }
.fete-carte strong { font-size: 24px; }
@keyframes fondu { from { opacity: 0; } }

/* ---------- messages ---------- */

.message { text-align: center; padding: 30vh 24px 0; }
.message h1 { font-size: 24px; margin: 0 0 8px; }
.message p { color: var(--pale); margin: 0 0 20px; }

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}
