/* Démo web de TradaZen : réplique des écrans de l'app (React Native) dans un cadre de 440 × 956 pt,
   réduit d'un bloc à la taille du conteneur. Chaque valeur vient de src/theme.ts et des
   StyleSheet des écrans repris (PathScreen, TrainingPlayScreen, LessonCompleteScreen,
   UnitGuideScreen, QuizPanel, VerdictPair, ui.tsx, kit.tsx, Sheet.tsx, MascotBubble.tsx,
   GlassTabBar.tsx). 1 px CSS dans le cadre = 1 pt de l'app. */

:root {
  --bg: #0E0A1B;
  --surface: #181327;
  --surface-alt: #221B3C;
  --surface-hi: #2C2448;
  --surface-glass: rgba(24, 19, 39, 0.7);
  --border: #2B2444;
  --border-hi: #3A3160;
  --hairline: rgba(255, 255, 255, 0.10);
  --ink: #ECE7FB;
  --ink-soft: #D7CEF2;
  --on-ink: #0E0A1B;
  --text: #F4F0FD;
  --text-2: #ABA2C8;
  --text-muted: #9A90B8;
  --accent: #5BC8E0;
  --violet: #8C7CF0;
  --good: #22B07D;
  --danger: #F2647C;
  --warn: #F5B544;
  --warn-soft: rgba(245, 181, 68, 0.18);
  --black: #1A1136;
  --cta-fill: #C9D2D8;
  --cta-ink: #17242F;
  --emblem: linear-gradient(135deg, #74CCE2, #A79DF1);
  --display: 'Poppins', system-ui, sans-serif;
  --body: 'Manrope', system-ui, sans-serif;
  --script: 'Caveat', cursive;
  --ease-out: cubic-bezier(0.215, 0.61, 0.355, 1); /* Easing.out(Easing.cubic) */
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--bg); overflow: hidden; }
body { font-family: var(--body); color: var(--text); -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; margin: 0; cursor: pointer; text-align: inherit; }
a { color: inherit; }
:focus { outline: none; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 8px; }
svg { display: block; flex-shrink: 0; }
p, h1, h2, h3 { margin: 0; font-weight: inherit; font-size: inherit; }

/* ---- Scène : le cadre de référence, réduit à la taille du conteneur ---- */
#scene { position: absolute; inset: 0 0 var(--pied, 22px) 0; overflow: hidden; }
.sans-pied { --pied: 0px; }
.sans-pied #pied { display: none; }
#cadre { position: absolute; left: 0; top: 0; width: 440px; height: 956px; transform-origin: 0 0; overflow: hidden; background: var(--bg); contain: layout paint; }
#pied { position: absolute; left: 0; right: 0; bottom: 0; height: var(--pied, 22px); display: flex; align-items: center; justify-content: center; gap: 14px; font: 500 11px/1 var(--body); color: var(--text-muted); white-space: nowrap; }
#pied a, #pied button { color: var(--text-2); text-decoration: underline; text-underline-offset: 2px; font: inherit; }

.ecran { position: absolute; inset: 0; background: var(--bg); overflow: hidden; will-change: transform; }
.ecran.cache { visibility: hidden; }

/* PressableScale : ressort jusqu'à 0,97 à l'appui. */
.presse { transition: transform 120ms var(--ease-out); }
.presse:active:not(:disabled) { transform: scale(0.97); }

/* FadeIn : 460 ms, Easing.out(cubic), de 16 pt plus bas. */
@keyframes fondu { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }
.fondu { animation: fondu 460ms var(--ease-out) both; }

/* ---- Fonds ---- */
.scene-cosmos { position: absolute; inset: 0; pointer-events: none; overflow: hidden; z-index: -1; }
.scene-cosmos img { position: absolute; left: 0; top: 0; width: 440px; height: 1036px; object-fit: cover; }
.etoile-derive { position: absolute; border-radius: 50%; background: rgba(236, 231, 251, 0.85); opacity: 0.5; }
@keyframes derive { from { transform: translateY(0); } to { transform: translateY(var(--montee)); } }
@keyframes scintille { 0%, 100% { opacity: 0.15; } 50% { opacity: 0.8; } }

/* ---- Bouton principal (ui.tsx Button) ---- */
.btn { display: flex; align-items: center; justify-content: center; min-height: 56px; width: 100%; border-radius: 16px; padding: 0 16px; font: 700 17px var(--body); letter-spacing: 0.2px; }
.btn-primaire { background: var(--cta-fill); border: 1px solid var(--ink-soft); color: var(--cta-ink); }
.btn-primaire .orbite { width: 20px; height: 20px; border-radius: 50%; border: 2px solid rgba(23, 36, 47, 0.25); border-top-color: var(--cta-ink); animation: tourne 0.8s linear infinite; }
@keyframes tourne { to { transform: rotate(360deg); } }
.lien-plat { align-self: center; width: fit-content; min-height: 44px; display: flex; align-items: center; justify-content: center; padding: 0 16px; margin: 8px auto 0; font: 600 17px var(--body); color: var(--text-2); text-decoration: underline; }

/* ---- En-tête d'écran (ScreenHeader) ---- */
.entete { display: flex; align-items: center; padding: 0 16px 12px; }
.entete-cote { flex: 1; display: flex; }
.entete-cote.droite { justify-content: flex-end; }
.rond-retour { width: 44px; height: 44px; border-radius: 22px; padding: 1.5px; background: var(--emblem); }
.rond-retour span { display: flex; width: 100%; height: 100%; border-radius: 20.5px; background: var(--surface); align-items: center; justify-content: center; color: var(--ink); }
.espace-rond { width: 44px; height: 44px; }
.entete-pile { flex-shrink: 1; display: flex; flex-direction: column; align-items: center; min-width: 0; }
.entete-titre { font: 700 20px var(--display); letter-spacing: -0.3px; color: var(--ink); text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.entete-sous { font: 600 13px var(--body); letter-spacing: 0.2px; margin-top: 1px; color: var(--text-2); text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ---- Barre d'avancement au dégradé emblème (kit.tsx ProgressBar) ---- */
.barre { background: var(--border-hi); overflow: hidden; position: relative; }
.barre > i { position: absolute; left: 0; top: 0; bottom: 0; background: var(--emblem); border-radius: inherit; transition: width 420ms var(--ease-out); }

/* ---- Écran de partie (TrainingPlayScreen) ---- */
.partie { display: flex; flex-direction: column; padding-top: 62px; }
.barre-session { height: 26px; display: flex; align-items: center; gap: 8px; padding: 0 16px; flex-shrink: 0; }
.barre-session .barre { flex: 1; height: 8px; border-radius: 4px; }
.combo { font: 700 13px var(--body); color: var(--accent); font-variant-numeric: tabular-nums; }
.anneau-graphique { margin: 0 16px; border-radius: 21.5px; padding: 1.5px; overflow: hidden; background: var(--emblem); flex-shrink: 0; }
.carte-graphique { position: relative; border-radius: 20px; overflow: hidden; background: var(--surface); }
.carte-graphique iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; display: block; opacity: 0.99; }
.voile-graphique { position: absolute; inset: 0; transition: opacity 180ms var(--ease-out); pointer-events: none; }
.chargement-graphique { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; background: var(--surface); padding: 0 16px; z-index: 1; }
.chargement-graphique .indice { margin-top: 4px; }
.indicateur { width: 20px; height: 20px; border-radius: 50%; border: 2.5px solid rgba(91, 200, 224, 0.25); border-top-color: var(--accent); animation: tourne 0.9s linear infinite; }
.presse-revelation { position: absolute; inset: 0; z-index: 2; cursor: pointer; }
.haut-graphique { position: absolute; top: 8px; left: 8px; display: flex; align-items: center; gap: 8px; z-index: 3; pointer-events: none; }
.haut-graphique > * { pointer-events: auto; }
.puce { padding: 4px 10px; border-radius: 999px; background: var(--surface-glass); border: 1px solid var(--border); font: 600 13px var(--body); color: var(--text); white-space: nowrap; }
.btn-theme { width: 36px; height: 36px; border-radius: 18px; display: flex; align-items: center; justify-content: center; background: var(--surface-glass); border: 1px solid var(--border); }
.barre-graphique { display: flex; align-items: center; gap: 8px; margin: 8px 16px 0; flex-shrink: 0; }
.outils { display: flex; gap: 6px; }
.btn-outil { width: 36px; height: 36px; border-radius: 18px; display: flex; align-items: center; justify-content: center; background: var(--surface); border: 1px solid var(--border-hi); color: var(--text); }
.btn-outil.actif { background: var(--accent); border-color: var(--accent); color: var(--on-ink); }
.btn-outil.supprimer { border-color: var(--danger); color: var(--danger); }
.rail-ut { flex: 1; display: flex; gap: 4px; padding: 4px; border-radius: 999px; background: var(--surface); border: 1px solid var(--border-hi); }
.btn-ut { flex: 1; height: 34px; border-radius: 999px; display: flex; align-items: center; justify-content: center; overflow: hidden; font: 700 13px var(--body); color: var(--text-2); white-space: nowrap; }
.btn-ut.actif { background: var(--emblem); color: var(--on-ink); }
.panneau { flex: 1; position: relative; min-height: 0; }
.panneau-defile { position: absolute; inset: 0; overflow-y: auto; overscroll-behavior: contain; scrollbar-width: none; }
.panneau-defile::-webkit-scrollbar { display: none; }
.panneau-contenu { padding: 16px 16px 112px; }
.panneau-contenu.decide { padding-bottom: 12px; }
.panneau-contenu.quiz { padding-bottom: 56px; }
.fondu-haut { position: absolute; left: 0; right: 0; top: 0; height: 16px; background: linear-gradient(var(--bg), rgba(14, 10, 27, 0)); pointer-events: none; z-index: 2; }
.repere-defile { position: absolute; left: 0; right: 0; bottom: 16px; height: 16px; display: flex; align-items: center; justify-content: center; color: var(--text-2); pointer-events: none; z-index: 2; }
.question { font: 700 20px var(--display); color: var(--text); }
.indice { font: 500 15px var(--body); color: var(--text-2); margin-top: 4px; }
.barre-visite { display: flex; flex-direction: column; align-items: center; gap: 4px; padding-top: 16px; }
.visite-consigne { font: 600 17px var(--body); color: var(--text); margin-top: 4px; text-align: center; }
.visite-passer { font: 600 15px var(--body); color: var(--text-2); text-decoration: none; }
.sans-mise { height: 12px; }
.revelation { padding-top: 12px; }
.progression-rev { height: 6px; border-radius: 3px; background: var(--surface-alt); margin-top: 12px; overflow: hidden; }
.progression-rev > i { display: block; height: 6px; border-radius: 3px; background: var(--accent); }
.barre-action { flex-shrink: 0; padding: 12px 16px 46px; background: var(--surface); border-top: 1px solid var(--border-hi); }

/* Cartes Long / Short (VerdictPair) */
.paire { display: flex; gap: 12px; }
.paire > div { flex: 1; }
.cote { position: relative; width: 100%; min-height: 112px; border-radius: 20px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; border: 1.5px solid; padding: 8px 0; overflow: hidden; background: var(--surface); }
.cote::before { content: ''; position: absolute; inset: 0; pointer-events: none; }
.cote.long { border-color: rgba(34, 176, 125, 0.7); }
.cote.long::before { background: rgba(34, 176, 125, 0.12); }
.cote.short { border-color: rgba(242, 100, 124, 0.7); }
.cote.short::before { background: rgba(242, 100, 124, 0.12); }
.cote.efface { opacity: 0.4; }
.cote.choisi { border-width: 2.5px; }
.disque { position: relative; width: 40px; height: 40px; border-radius: 20px; display: flex; align-items: center; justify-content: center; margin-bottom: 2px; }
.cote-titre { position: relative; font: 800 20px var(--display); letter-spacing: 0.3px; }
.cote-sous { position: relative; font: 600 13px var(--body); color: var(--text-2); }

/* Exercice court (QuizPanel) */
.quiz-question { font: 700 20px var(--display); color: var(--text); margin-bottom: 12px; white-space: pre-line; }
.options { display: flex; flex-direction: column; gap: 8px; }
.option { display: flex; align-items: center; gap: 12px; min-height: 52px; padding: 8px 16px; border-radius: 16px; background: var(--surface); border: 1px solid var(--border-hi); width: 100%; }
.option.juste { border-color: var(--good); }
.option.faux { border-color: var(--danger); }
.option.terne { opacity: 0.5; }
.option:disabled { cursor: default; }
.option-texte { flex: 1; font: 600 17px var(--body); color: var(--text); display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.lettre { width: 28px; height: 28px; border-radius: 14px; display: flex; align-items: center; justify-content: center; background: var(--surface-alt); border: 1px solid var(--warn); font: 700 15px var(--body); color: var(--warn); }
.verdict-quiz { margin-top: 12px; padding: 12px; border-radius: 20px; border: 1px solid; background: var(--surface); }
.verdict-titre { font: 700 17px var(--display); }
.verdict-corps { font: 500 15px/19px var(--body); color: var(--text-2); margin-top: 2px; white-space: pre-line; }

/* Débrief */
.retour { display: flex; align-items: flex-start; gap: 12px; padding: 12px; border-radius: 20px; border: 1px solid; margin-bottom: 12px; background: var(--surface); }
.retour-pastille { width: 32px; height: 32px; border-radius: 16px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.retour-texte { flex: 1; min-width: 0; }
.retour-titre { font: 700 17px var(--display); }
.retour-raison { font: 500 15px/19px var(--body); color: var(--text-2); margin-top: 2px; white-space: pre-line; }
.verdict { display: flex; flex-direction: column; align-items: center; padding: 8px 0; }
.verdict-r { font: 800 40px var(--display); letter-spacing: -0.5px; font-variant-numeric: tabular-nums; text-align: center; }
.verdict-ligne { display: flex; align-items: center; justify-content: center; }
.verdict-issue { font: 600 15px var(--body); color: var(--text-2); margin-top: 4px; }
.point-info { width: 44px; height: 44px; margin: -10px 0; display: flex; align-items: center; justify-content: center; color: var(--text-muted); }
.identite { margin-top: 16px; padding: 16px; border-radius: 16px; background: var(--surface); border: 1px solid var(--border); border-top-color: var(--border-hi); }
.identite-titre { font: 600 17px var(--display); color: var(--text-2); margin-bottom: 4px; }
.identite-mot { font: 700 22px var(--script); color: var(--accent); }
.identite-principal { font: 700 17px var(--display); color: var(--text); }
.identite-ligne { font: 500 15px var(--body); color: var(--text-2); margin-top: 3px; }
.identite-lien { display: inline-flex; align-items: center; gap: 6px; margin-top: 12px; font: 600 15px var(--body); color: var(--accent); text-decoration: none; }

/* ---- Feuille modale (Sheet.tsx) et bulle de Nova (MascotBubble.tsx) ---- */
.feuille-fond { position: absolute; inset: 0; z-index: 40; opacity: 0; transition: opacity 280ms var(--ease-out); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); background: linear-gradient(rgba(14, 10, 27, 0.2), rgba(14, 10, 27, 0.72)); }
.feuille-fond.ouvert { opacity: 1; }
.feuille { position: absolute; left: 8px; right: 8px; bottom: 8px; z-index: 41; border-radius: 33.5px 33.5px 51.5px 51.5px; padding: 1.5px; background: linear-gradient(135deg, rgba(91, 200, 224, 0.75), rgba(140, 124, 240, 0.45), rgba(140, 124, 240, 0.75)); transform: translateY(110%) scale(0.96); transition: transform 280ms var(--ease-out); }
.feuille.ouvert { transform: none; }
.feuille.ferme { transition: transform 220ms cubic-bezier(0.55, 0.055, 0.675, 0.19); }
.feuille-int { position: relative; overflow: hidden; border-radius: 32px 32px 50px 50px; background: var(--surface); padding-bottom: 10px; }
.feuille-int::before { content: ''; position: absolute; inset: 0; background: linear-gradient(rgba(140, 124, 240, 0.2), rgba(140, 124, 240, 0) 55%); pointer-events: none; }
.feuille-int::after { content: ''; position: absolute; inset: 0; border-radius: inherit; border: 1px solid transparent; border-top-color: rgba(236, 231, 251, 0.14); pointer-events: none; }
.poignee { position: relative; display: flex; justify-content: center; padding: 4px 0; }
.poignee i { width: 38px; height: 5px; border-radius: 3px; margin: 4px 0 2px; background: rgba(236, 231, 251, 0.26); }
.astuce { position: relative; padding: 8px 16px 22px; }
.astuce-fermer { width: 44px; height: 44px; margin-left: auto; display: flex; align-items: center; justify-content: center; background: var(--surface-hi); border: 1px solid var(--border-hi); border-radius: 22px; color: var(--text); }
.astuce .btn { margin-top: 16px; }
.quitter { position: relative; padding: 8px 16px 22px; }
.quitter-titre { font: 700 20px var(--display); color: var(--text); }
.quitter-corps { font: 500 17px/22px var(--body); color: var(--text-2); margin-top: 4px; white-space: pre-line; text-wrap: balance; }
.quitter .btn { margin-top: 16px; }
.bulle { display: flex; align-items: flex-start; gap: 8px; }
.bulle-nova { margin-top: 2px; }
.bulle-anneau { flex: 1; border-radius: 26px 26px 26px 26px; border-top-left-radius: 7.5px; padding: 1.5px; background: var(--emblem); box-shadow: 0 6px 14px rgba(91, 200, 224, 0.22); }
.bulle-int { background: var(--surface); border-radius: 24.5px; border-top-left-radius: 6px; padding: 10px 16px 12px; }
.bulle-tag { display: flex; align-items: center; gap: 6px; margin-bottom: 6px; font: 700 12px var(--body); letter-spacing: 1.2px; text-transform: uppercase; color: var(--text-muted); }
.bulle-tag i { width: 6px; height: 6px; border-radius: 3px; background: var(--accent); }
.bulle-boite { position: relative; }
.bulle-titre { font: 600 17px/24px var(--body); color: var(--ink); white-space: pre-line; text-wrap: pretty; }
.bulle-sous { font: 500 15px/20px var(--body); color: var(--text-2); white-space: pre-line; text-wrap: pretty; margin-top: 6px; }
.bulle-boite .fantome { opacity: 0; }
.bulle-boite .frappe { position: absolute; left: 0; right: 0; top: 0; margin-top: 0; }

/* ---- Mascotte (Mascot.tsx) ---- */
.nova { position: relative; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.nova-halo { position: absolute; border-radius: 50%; background: radial-gradient(closest-side, rgba(140, 124, 240, 0.2), rgba(140, 124, 240, 0.1) 30%, rgba(140, 124, 240, 0.04) 55%, rgba(140, 124, 240, 0.012) 78%, rgba(140, 124, 240, 0)); pointer-events: none; }
.nova-corps { position: relative; animation: nova-flotte 4400ms ease-in-out infinite; }
.nova-corps img { display: block; width: 100%; height: 100%; object-fit: contain; animation: nova-respire 3600ms ease-in-out infinite; }
@keyframes nova-flotte { 0%, 100% { transform: translateY(var(--flotte)); } 50% { transform: translateY(calc(-1 * var(--flotte))); } }
@keyframes nova-respire { 0%, 100% { transform: scale(1); } 50% { transform: scale(var(--respire)); } }

/* ---- Aura (kit.tsx) ---- */
.aura { position: absolute; border-radius: 50%; pointer-events: none; animation: aura 3200ms ease-in-out infinite; }
@keyframes aura { 0%, 100% { opacity: 0.9; transform: scale(1); } 50% { opacity: 0.55; transform: scale(1.16); } }

/* ---- Carte de verre (GlassCard) ---- */
.verre { border-radius: 27.5px; padding: 1.5px; background: var(--emblem); }
.verre > .verre-int { border-radius: 26px; background: var(--surface); }
.verre.accent > .verre-int { background: var(--surface-alt); }
.verre.plat { padding: 0; background: var(--surface); border: 1px solid var(--border); border-top-color: var(--border-hi); }
.verre.plat > .verre-int { background: transparent; }

/* ---- Parcours (PathScreen) ---- */
.parcours { padding-top: 62px; }
.parcours-int { position: absolute; inset: 62px 0 0 0; z-index: 0; }
.parcours-defile { position: absolute; inset: 0; overflow-y: auto; overflow-x: hidden; scrollbar-width: none; overscroll-behavior: contain; opacity: 0; transition: opacity 200ms var(--ease-out); }
.parcours-defile::-webkit-scrollbar { display: none; }
.parcours-defile.vu { opacity: 1; }
.parcours-contenu { position: relative; width: 440px; }
.ciel { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.ciel > img.remplit { position: absolute; inset: 0; width: 100%; height: 100%; }
.decor-haut, .decor-bas { position: absolute; left: 0; right: 0; height: 660px; }
.decor-haut { top: 0; -webkit-mask-image: linear-gradient(#000, #000 72%, transparent); mask-image: linear-gradient(#000, #000 72%, transparent); }
.decor-bas { bottom: 0; -webkit-mask-image: linear-gradient(transparent, #000 28%, #000); mask-image: linear-gradient(transparent, #000 28%, #000); }
.decor-haut img, .decor-bas img { width: 100%; height: 100%; object-fit: cover; }
.jalon { position: absolute; pointer-events: none; }
.jalon img { width: 100%; height: 100%; object-fit: contain; display: block; }
.couche-etoiles { position: absolute; left: 0; right: 0; top: 0; pointer-events: none; will-change: transform; }
.couche-etoiles svg { position: absolute; left: 0; top: 0; }
@keyframes etoiles { 0%, 100% { opacity: 1; } 50% { opacity: 0.35; } }
.trafic { position: absolute; left: 0; right: 0; top: 0; height: 894px; pointer-events: none; will-change: transform; overflow: visible; }
.trafic img { position: absolute; left: 0; top: 0; object-fit: contain; opacity: 0; }
.parcours-contenu-chemin { position: relative; padding: 0 16px; }
.sommet { font: 700 13px var(--body); color: var(--accent); letter-spacing: 1.2px; text-transform: uppercase; text-align: center; margin-bottom: 22px; }
.bloc { margin-bottom: 16px; }
.piste { position: relative; margin-bottom: 12px; }
.piste > svg { position: absolute; left: 0; top: 0; }
.rangee { position: absolute; left: 0; right: 0; }
.orbe-place { position: absolute; display: flex; align-items: center; justify-content: center; }
.orbe-btn { position: relative; display: flex; align-items: center; justify-content: center; border-radius: 50%; }
.orbe-halo { position: absolute; inset: 0; border-radius: 50%; border: 3px solid rgba(91, 200, 224, 0.55); }
.orbe { position: relative; display: flex; align-items: center; justify-content: center; border-radius: 50%; background: var(--surface-hi); border: 1.5px solid var(--border-hi); overflow: hidden; }
.orbe.fait { background: rgba(91, 200, 224, 0.16); border-color: rgba(91, 200, 224, 0.55); }
.orbe.courant { border-width: 0; background: var(--emblem); animation: respire-orbe 1800ms ease-in-out infinite; }
.orbe.verrou { background: var(--surface); border-color: rgba(236, 231, 251, 0.45); }
@keyframes respire-orbe { 0%, 100% { transform: scale(1); } 50% { transform: scale(0.94); } }
.etiquette-depart { position: absolute; top: -30px; width: 200px; display: flex; justify-content: center; pointer-events: none; }
.etiquette-depart span { padding: 5px 12px; border-radius: 12px; background: var(--ink); font: 700 13px var(--body); color: var(--on-ink); letter-spacing: 0.8px; text-transform: uppercase; white-space: nowrap; }
.nova-chemin { position: absolute; pointer-events: none; }
.carte-unite { padding: 19px 16px 10px; }
.unite-surtitre { font: 700 12px var(--body); color: var(--text-2); letter-spacing: 1px; text-transform: uppercase; }
.unite-titre { font: 700 20px var(--display); color: var(--text); margin-top: 2px; text-wrap: balance; }
.unite-objectif { font: 500 15px/19px var(--body); color: var(--text-2); margin-top: 4px; }
.unite-pied { display: flex; align-items: center; gap: 8px; margin-top: 12px; }
.unite-pied .barre { flex: 1; height: 8px; border-radius: 4px; }
.unite-compte { font: 600 13px var(--body); color: var(--text-2); font-variant-numeric: tabular-nums; white-space: nowrap; }
.btn-guide { display: flex; align-items: center; gap: 6px; min-height: 44px; padding-left: 8px; font: 700 15px var(--body); color: var(--accent); }
.tete-section { display: flex; flex-direction: column; align-items: center; margin: 16px 0 22px; }
.section-surtitre { font: 700 13px var(--body); color: var(--text-muted); letter-spacing: 1.2px; text-transform: uppercase; text-shadow: 0 0 6px var(--bg); }
.section-titre { font: 600 13px var(--body); color: var(--text-muted); text-align: center; margin-top: 2px; text-shadow: 0 0 6px var(--bg); text-wrap: balance; }
.depart { font: 700 13px var(--body); color: var(--text-2); letter-spacing: 1.2px; text-transform: uppercase; text-align: center; margin-top: 12px; text-shadow: 0 0 6px var(--bg); }
.fondu-barre-haut { position: absolute; left: 0; right: 0; top: 0; height: 118px; pointer-events: none; background: linear-gradient(var(--bg) 0%, rgba(14, 10, 27, 0.96) 52.5%, rgba(14, 10, 27, 0) 100%); }
.barre-haut { position: absolute; left: 0; right: 0; top: 0; display: flex; align-items: center; gap: 8px; padding: 8px 16px; }
.barre-haut > div { flex: 1; display: flex; }
.barre-haut > div:nth-child(2) { justify-content: center; }
.barre-haut > div:nth-child(3) { justify-content: flex-end; }
.pastille-stat { position: relative; display: flex; align-items: center; gap: 6px; min-height: 44px; padding: 0 12px; border-radius: 999px; background: var(--surface-glass); border: 1px solid var(--border); font: 700 17px var(--body); color: var(--text); font-variant-numeric: tabular-nums; }
.pastille-stat img { width: 26px; height: 26px; }
.pastille-stat.terne img, .pastille-stat.terne svg { opacity: 0.45; }
.pastille-stat.terne span { color: var(--text-muted); }
.pastille-stat .point { position: absolute; top: 6px; right: 6px; width: 9px; height: 9px; border-radius: 4.5px; background: var(--accent); border: 1.5px solid var(--surface); }
.fiche-voile { position: absolute; inset: 0; z-index: 30; -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); background: linear-gradient(rgba(14, 10, 27, 0.2), rgba(14, 10, 27, 0.72)); opacity: 0; transition: opacity 240ms var(--ease-out); }
.fiche-place { position: absolute; left: 16px; right: 16px; bottom: 132px; z-index: 31; opacity: 0; transform: translateY(16px); transition: opacity 240ms var(--ease-out), transform 240ms var(--ease-out); }
.fiche-ouverte .fiche-voile, .fiche-ouverte .fiche-place { opacity: 1; transform: none; }
.fiche-fermee .fiche-voile, .fiche-fermee .fiche-place { transition-duration: 180ms; transition-timing-function: cubic-bezier(0.55, 0.055, 0.675, 0.19); }
.fiche { padding: 16px; }
.fiche-tete { display: flex; align-items: center; justify-content: space-between; min-height: 44px; }
.fiche-surtitre { font: 700 12px var(--body); color: var(--accent); letter-spacing: 1px; text-transform: uppercase; }
.fiche-fermer { width: 44px; height: 44px; border-radius: 22px; display: flex; align-items: center; justify-content: center; background: var(--surface-hi); color: var(--text); }
.fiche-titre { font: 700 20px var(--display); color: var(--text); margin-top: 2px; text-wrap: balance; }
.fiche-corps { font: 500 17px/22px var(--body); color: var(--text-2); margin-top: 4px; }
.fiche .btn { margin-top: 16px; }
a.btn { text-decoration: none; }

/* Dock d'onglets (GlassTabBar) */
.dock-place { position: absolute; left: 0; right: 0; bottom: 0; padding: 0 24px 22px; z-index: 20; }
.dock-fondu { position: absolute; left: 0; right: 0; top: -36px; bottom: 0; pointer-events: none; background: linear-gradient(rgba(14, 10, 27, 0) 0%, rgba(14, 10, 27, 0.6) 14.5%, var(--bg) 41.9%, var(--bg) 100%); }
.dock-anneau { position: relative; border-radius: 33.5px; padding: 1.5px; background: linear-gradient(135deg, rgba(91, 200, 224, 0.7), rgba(140, 124, 240, 0.5), rgba(140, 124, 240, 0.7)); }
.dock { position: relative; height: 64px; border-radius: 32px; overflow: hidden; display: flex; align-items: center; background: rgba(24, 19, 39, 0.5); -webkit-backdrop-filter: blur(20px); backdrop-filter: blur(20px); }
.dock::after { content: ''; position: absolute; inset: 0; border-radius: 32px; border: 1px solid transparent; border-top-color: rgba(236, 231, 251, 0.16); pointer-events: none; }
.dock-rangee { position: relative; display: flex; align-items: stretch; height: 52px; margin: 0 6px; flex: 1; }
.dock-pilule { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 26px; background: rgba(236, 231, 251, 0.1); border: 1px solid rgba(236, 231, 251, 0.08); border-top-color: rgba(236, 231, 251, 0.22); }
.onglet { position: relative; flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; font-size: 13px; letter-spacing: 0.1px; white-space: nowrap; }
.onglet span { font-family: var(--body); font-weight: 600; }
.onglet.actif span { font-weight: 700; }
.duel-disque { width: 54px; height: 54px; border-radius: 27px; background: var(--emblem); display: flex; align-items: center; justify-content: center; box-shadow: 0 10px 20px rgba(140, 124, 240, 0.35); }

/* ---- Guide d'unité (UnitGuideScreen) ---- */
.guide { display: flex; flex-direction: column; padding-top: 62px; }
.guide-defile { flex: 1; overflow-y: auto; scrollbar-width: none; min-height: 0; position: relative; }
.guide-defile::-webkit-scrollbar { display: none; }
.guide-contenu { padding: 0 16px 22px; }
.guide-surtitre { font: 700 13px var(--body); color: var(--accent); letter-spacing: 1.2px; text-transform: uppercase; margin-top: 22px; }
.guide-objectif { font: 700 20px/27px var(--display); color: var(--text); margin: 4px 0 16px; }
.titre-section { display: flex; align-items: center; justify-content: space-between; margin: 4px 0 8px; font: 700 13px var(--body); color: var(--text-2); letter-spacing: 0.9px; text-transform: uppercase; }
.legende { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 8px; }
.legende span { display: flex; align-items: center; gap: 4px; font: 600 13px var(--body); color: var(--text-2); }
.legende i { width: 16px; height: 3px; border-radius: 2px; }
.reperes { padding: 4px 16px; }
.repere { display: flex; align-items: flex-start; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--hairline); }
.repere:last-child { border-bottom: 0; }
.repere-num { min-width: 18px; font: 800 20px/24px var(--display); font-variant-numeric: tabular-nums; }
.repere-texte { flex: 1; font: 500 17px/22px var(--body); color: var(--text); white-space: pre-line; font-variant-numeric: tabular-nums; }
.piege { display: flex; align-items: flex-start; gap: 12px; padding: 16px; margin-top: 16px; border-radius: 20px; background: var(--warn-soft); }
.piege-titre { font: 700 13px var(--body); color: var(--warn); letter-spacing: 0.9px; text-transform: uppercase; }
.piege-corps { font: 500 17px/22px var(--body); color: var(--text); margin-top: 4px; white-space: pre-line; }
.guide-pied { padding: 20px 16px 50px; flex-shrink: 0; }

/* ---- Fin de leçon (LessonCompleteScreen) ---- */
.fin { display: flex; flex-direction: column; padding: 84px 16px 34px; }
.fin-pile { flex: 1; display: flex; flex-direction: column; justify-content: space-evenly; position: relative; }
.fin-haut { display: flex; flex-direction: column; align-items: center; }
.fin-titre { font: 700 30px var(--display); color: var(--text); text-align: center; margin-top: 8px; text-wrap: balance; }
.fin-corps { font: 500 17px/22px var(--body); color: var(--text-2); text-align: center; margin-top: 4px; text-wrap: balance; }
.heros { display: flex; flex-direction: column; align-items: center; }
.heros-halo { position: relative; width: 150px; height: 150px; display: flex; align-items: center; justify-content: center; }
.heros-valeur { position: relative; font: 800 56px var(--display); color: var(--ink); font-variant-numeric: tabular-nums; letter-spacing: -1px; }
.heros-legende { font: 700 13px var(--body); color: var(--text-2); letter-spacing: 1.2px; text-transform: uppercase; margin-top: -48px; position: relative; }
.niveau { display: flex; align-items: center; gap: 8px; align-self: stretch; margin: 12px 0 8px; }
.niveau .barre { flex: 1; height: 8px; border-radius: 4px; }
.niveau-texte { font: 700 13px var(--body); color: var(--text-2); font-variant-numeric: tabular-nums; white-space: nowrap; }
.bilan { padding: 8px 16px; }
.ligne { display: flex; align-items: center; gap: 12px; min-height: 46px; width: 100%; }
.ligne.filet { border-bottom: 1px solid var(--hairline); }
.ligne-libelle { flex: 1; font: 600 17px var(--body); color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ligne-valeur { font: 700 17px var(--body); color: var(--text); font-variant-numeric: tabular-nums; white-space: nowrap; }
.fin-bas { margin-top: 16px; position: relative; }
.lien-second { min-height: 44px; width: 100%; display: flex; align-items: center; justify-content: center; margin-top: 4px; font: 700 15px var(--body); color: var(--text-2); }

/* ---- Écran de passage (propre à la démo, dans la DA de l'app) ---- */
.passage { display: flex; flex-direction: column; padding: 84px 16px 34px; }
.passage-pile { flex: 1; display: flex; flex-direction: column; justify-content: space-evenly; position: relative; }
.passage-haut { display: flex; flex-direction: column; align-items: center; text-align: center; }
.passage-surtitre { font: 700 13px var(--body); color: var(--accent); letter-spacing: 1.2px; text-transform: uppercase; margin-top: 12px; }
.passage-titre { font: 700 30px var(--display); color: var(--text); margin-top: 8px; text-wrap: balance; }
.passage-mot { font: 700 38px var(--script); color: var(--accent); }
.passage-corps { font: 500 17px/22px var(--body); color: var(--text-2); margin-top: 8px; text-wrap: balance; }

@media (prefers-reduced-motion: reduce) {
  .fondu, .aura, .orbe.courant, .nova-corps, .nova-corps img, .jalon, .jalon > *, .trafic img, .couche-etoiles, .etoile-derive { animation: none !important; }
  .presse, .barre > i, .feuille, .feuille-fond, .fiche-voile, .fiche-place, .voile-graphique, .parcours-defile { transition: none !important; }
}
.visuellement-cache { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.ecran:focus, .feuille:focus, .fiche-place:focus { outline: none; }
a.lien-second { text-decoration: none; }

/* ---- Mode exercice des fiches : pas de barre d'état ni d'indicateur d'accueil (pas de cadre d'iPhone). ---- */
.mode-exercice #cadre { height: var(--hauteur-exercice, 956px); }
.partie.exercice { padding-top: 16px; }
.partie.exercice .panneau-contenu.quiz { padding-bottom: 22px; }
.partie.exercice .barre-action { padding-bottom: 16px; }
/* 812 pt : la question la plus longue (clôture, 4 réponses) tient entière avant la réponse ; après,
   le panneau défile jusqu'au verdict, comme dans l'app sur un iPhone plus petit. */
.mode-exercice { --hauteur-exercice: 812px; }

/* ---- Langues : les polices de `family` (src/theme.ts) selon la langue de l'app (`data-langue`) ----
   Poppins n'a ni le vietnamien, ni le cyrillique, ni le grec : titres en Manrope ; Caveat n'a ni le
   vietnamien ni le grec : écriture en Manrope. Japonais, chinois, coréen, thaï : une seule police pour
   tout le texte (`cjkFont`), régulière pour le corps (400, 500), grasse au-delà. Polices système
   pour toutes : Hiragino Sans (japonais) et PingFang SC (chinois simplifié) à la place des Noto Sans
   de l'app, qui seraient à charger chez Google ; PingFang TC, Apple SD Gothic Neo et Thonburi
   comme l'app ; les équivalents hors Apple ensuite. */
@font-face { font-family: 'TZ PingFang TC'; src: local('PingFangTC-Regular'), local('PingFang TC Regular'); font-weight: 100 500; }
@font-face { font-family: 'TZ PingFang TC'; src: local('PingFangTC-Semibold'), local('PingFang TC Semibold'); font-weight: 501 1000; }
@font-face { font-family: 'TZ Apple SD Gothic Neo'; src: local('AppleSDGothicNeo-Regular'), local('Apple SD Gothic Neo Regular'); font-weight: 100 500; }
@font-face { font-family: 'TZ Apple SD Gothic Neo'; src: local('AppleSDGothicNeo-Bold'), local('Apple SD Gothic Neo Bold'); font-weight: 501 1000; }
@font-face { font-family: 'TZ Thonburi'; src: local('Thonburi'); font-weight: 100 500; }
@font-face { font-family: 'TZ Thonburi'; src: local('Thonburi-Bold'), local('Thonburi Bold'); font-weight: 501 1000; }
:root[data-langue="vi"], :root[data-langue="uk"], :root[data-langue="el"] { --display: 'Manrope', system-ui, sans-serif; }
:root[data-langue="vi"], :root[data-langue="el"] { --script: 'Manrope', system-ui, sans-serif; }
:root[data-langue="ja"] { --cjk: 'Hiragino Sans', 'Hiragino Kaku Gothic ProN', 'Noto Sans JP', 'Yu Gothic', sans-serif; }
:root[data-langue="zh-Hans"] { --cjk: 'PingFang SC', 'Noto Sans SC', 'Microsoft YaHei', sans-serif; }
:root[data-langue="zh-Hant"] { --cjk: 'TZ PingFang TC', 'PingFang TC', 'Noto Sans TC', 'Microsoft JhengHei', sans-serif; }
:root[data-langue="ko"] { --cjk: 'TZ Apple SD Gothic Neo', 'Apple SD Gothic Neo', 'Noto Sans KR', 'Malgun Gothic', sans-serif; }
:root[data-langue="th"] { --cjk: 'TZ Thonburi', 'Thonburi', 'Noto Sans Thai', 'Leelawadee UI', sans-serif; }
:root[data-langue="ja"], :root[data-langue="zh-Hans"], :root[data-langue="zh-Hant"], :root[data-langue="ko"], :root[data-langue="th"] { --display: var(--cjk); --body: var(--cjk); --script: var(--cjk); }
/* Jamais un mot coupé en son milieu : groupes de mots pour le japonais et le chinois (Chrome), mots
   entiers en coréen ; le thaï se coupe déjà aux mots (dictionnaire du navigateur). */
:root[data-langue="ja"], :root[data-langue="zh-Hans"], :root[data-langue="zh-Hant"] { word-break: auto-phrase; }
:root[data-langue="ko"] { word-break: keep-all; }
