/* ============================================================
   Vocab COMEX - v5 « Accueil & Parcours »
   Feuille ADDITIONNELLE : styles.css n'est pas modifié.
   Tous les tokens (--brand, --surface, --radius…, --shadow-…)
   viennent de styles.css ; aucun n'est redéfini ici.
   Mobile-first 360 px. Ruptures : 720 px (mise en page v5) et
   768 px (la v4 remonte la tabbar en tête - réconciliation).
   Seuls éléments v4 ciblés : .views, .tabbar, .tab, #dueBadge,
   .appbar .icon-btn (liste autorisée par le brief).
   ============================================================ */

/* ===== 1. Amorçage ========================================= */
.views { transition: opacity .18s ease-out; }
.booting .views { opacity: 0 !important; animation: v5-boot-rescue 0s 1.5s forwards; }
@keyframes v5-boot-rescue { to { opacity: 1; } }

/* ===== 2. Tabbar à 5 onglets, centre surélevé =============== */
.tabbar { display: flex; align-items: stretch; position: relative; z-index: 5; overflow: visible; }
.tab { flex: 1 1 20%; min-width: 0; }

/* engrenage des Réglages ajouté dans l'appbar */
.appbar .icon-btn { flex: none; width: 44px; height: 44px; background: transparent; color: var(--ink-2); }
.appbar .icon-btn:active { background: var(--surface-2); }
.appbar .icon-btn svg { width: 22px; height: 22px; display: block; }

/* disque brand de 56 px, remonté de 14 px au-dessus de la barre */
.tab.tab-center { overflow: visible; }
.tab.tab-center::before {
  content: ''; position: absolute; top: -8px; left: 50%;
  width: 56px; height: 56px; margin-left: -28px; border-radius: 50%;
  background: linear-gradient(150deg, var(--brand-2), var(--brand));
  box-shadow: var(--shadow-2); transform: translateY(-14px);
  transition: box-shadow .18s ease-out;
}
.tab.tab-center > svg {
  position: absolute; top: -8px; left: 50%; z-index: 1;
  width: 26px; height: 26px;
  margin-top: 15px;    /* (56 − 26) / 2 : centre l'icône dans le disque */
  margin-left: -13px; transform: translateY(-14px); color: var(--on-brand);
}
.tab.tab-center > svg .ico-fill { opacity: 1; }
.tab.tab-center > span:not(.tab-badge) { margin-top: auto; line-height: 1.15; font-size: 10.5px; font-weight: 800; color: var(--brand); }
.tab.tab-center:active { background: transparent; }
.tab.tab-center.is-active::before { box-shadow: var(--shadow-2), 0 0 0 4px var(--brand-soft); }
.tab.tab-center #dueBadge { top: -26px; left: 50%; margin-left: 9px; border: 2px solid var(--surface); line-height: 15px; }

/* ===== 3. Accueil (home.js) ================================= */
.v5-home { display: flex; flex-direction: column; gap: 14px; padding: 4px 0 18px; }
.wrap.v5-home { max-width: 560px; margin: 0 auto; }
.v5-hello { display: flex; flex-direction: column; gap: 2px; padding: 2px 2px 0; }
.v5-hello h1 { margin: 0; font-size: 22px; font-weight: 800; letter-spacing: -.5px; }
.v5-hello p, .v5-hello-sub { margin: 0; color: var(--ink-3); font-size: 13px; font-weight: 700; }

/* --- carte héros --- */
.v5-hero {
  position: relative; display: block; width: 100%; overflow: hidden;
  padding: 20px 18px; border-radius: var(--radius); text-align: left;
  background: linear-gradient(145deg, var(--brand-2) 0%, var(--brand) 74%);
  color: var(--on-brand); box-shadow: var(--shadow-2);
  transition: transform .16s ease-out;
}
.v5-hero:active { transform: scale(.985); }
.v5-hero::after { content: ''; position: absolute; top: -70px; right: -50px; width: 190px; height: 190px; border-radius: 50%; background: var(--brand-2); opacity: .38; }
.v5-hero > * { position: relative; z-index: 1; }
.v5-hero-ico { display: inline-grid; place-items: center; width: 38px; height: 38px; margin-bottom: 10px; border-radius: 12px; background: var(--brand-soft); color: var(--brand); }
.v5-hero-ico svg { width: 22px; height: 22px; display: block; }
.v5-hero-num { display: block; font-size: 40px; font-weight: 800; line-height: 1; letter-spacing: -1.6px; }
.v5-hero-title, .v5-hero h2 { display: block; margin: 4px 0 0; font-size: 18px; font-weight: 800; letter-spacing: -.3px; }
.v5-hero-sub, .v5-hero p { display: block; margin: 4px 0 0; font-size: 13.5px; font-weight: 700; opacity: .82; }
.v5-hero-cta {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 46px; margin-top: 14px; padding: 0 20px; border-radius: 999px;
  background: var(--on-brand); color: var(--brand); font-size: 14.5px; font-weight: 800;
  box-shadow: var(--shadow-1);
}
.v5-hero-cta svg { width: 18px; height: 18px; }
.v5-hero--due       .v5-hero-ico { background: var(--ko-soft);    color: var(--ko); }
.v5-hero--discover  .v5-hero-ico { background: var(--warm-soft);  color: var(--warm); }
.v5-hero--journey   .v5-hero-ico { background: var(--ok-soft);    color: var(--ok); }
.v5-hero--start     .v5-hero-ico { background: var(--brand-soft); color: var(--brand); }
.v5-hero--resume    .v5-hero-ico { background: var(--surface-2);  color: var(--ink-2); }
.v5-hero--start  { background: linear-gradient(125deg, var(--brand) 0%, var(--brand-2) 96%); }
.v5-hero--resume { background: linear-gradient(160deg, var(--brand-2) 0%, var(--brand) 62%); }

/* --- 3 raccourcis --- */
.v5-presets { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.v5-preset {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 7px;
  min-height: 84px; padding: 12px 6px; border-radius: var(--radius-md);
  background: var(--surface); color: var(--ink); box-shadow: var(--shadow-1);
  font-size: 13px; font-weight: 800; line-height: 1.25; text-align: center;
  transition: transform .14s ease-out;
}
.v5-preset svg { flex: none; width: 22px; height: 22px; color: var(--brand); }
.v5-preset:active { transform: scale(.96); }
.v5-preset[disabled] { opacity: .4; transform: none; cursor: default; }

/* --- composeur de session --- */
.v5-composer { display: flex; flex-direction: column; gap: 13px; padding: 16px 14px; border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow-1); }
.v5-field { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.v5-field > span, .v5-label { font-size: 12px; font-weight: 800; text-transform: uppercase; letter-spacing: .7px; color: var(--ink-3); }
.v5-chips-scroll {
  display: flex; gap: 7px; overflow-x: auto; scrollbar-width: none;
  scroll-snap-type: x proximity; margin: 0 -14px; padding: 2px 14px 4px;
}
.v5-chips-scroll::-webkit-scrollbar { display: none; }
.v5-chips-scroll > * { flex: none; scroll-snap-align: start; }
.v5-more { border-top: 1px solid var(--line); padding-top: 4px; }
.v5-more > summary { display: flex; align-items: center; gap: 8px; min-height: 44px; list-style: none; cursor: pointer; font-size: 13.5px; font-weight: 800; color: var(--ink-2); }
.v5-more > summary::-webkit-details-marker { display: none; }
.v5-more > summary::after {
  content: ''; width: 8px; height: 8px; margin: -3px 2px 0 auto;
  border-right: 2px solid var(--ink-3); border-bottom: 2px solid var(--ink-3);
  transform: rotate(45deg); transition: transform .18s ease-out;
}
.v5-more[open] > summary::after { transform: rotate(-135deg) translate(-2px, -2px); }
.v5-more-body { display: flex; flex-direction: column; gap: 13px; padding: 6px 0 4px; }
.v5-stepper { display: flex; gap: 6px; }
.v5-stepper > button, .v5-step {
  flex: 1; min-height: 44px; border-radius: var(--radius-sm); border: 1px solid var(--line);
  background: var(--surface); color: var(--ink-2); font-size: 14px; font-weight: 800;
  transition: transform .12s ease-out;
}
.v5-stepper > button:active, .v5-step:active { transform: scale(.95); }
.v5-stepper > button.is-on, .v5-step.is-on { background: var(--brand-soft); border-color: transparent; color: var(--brand); }
.v5-toggle { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 44px; font-size: 14px; font-weight: 700; color: var(--ink); cursor: pointer; }
.v5-toggle small { display: block; color: var(--ink-3); font-size: 12px; font-weight: 700; }
.v5-toggle input[type="checkbox"] {
  flex: none; appearance: none; -webkit-appearance: none; position: relative; cursor: pointer;
  width: 44px; height: 26px; margin: 0; border-radius: 999px;
  border: 1px solid var(--line); background: var(--surface-2);
  transition: background .18s ease-out, border-color .18s ease-out;
}
.v5-toggle input[type="checkbox"]::after {
  content: ''; position: absolute; top: 2px; left: 2px; width: 20px; height: 20px;
  border-radius: 50%; background: var(--surface); box-shadow: var(--shadow-1);
  transition: transform .18s ease-out;
}
.v5-toggle input[type="checkbox"]:checked { background: var(--brand); border-color: var(--brand); }
.v5-toggle input[type="checkbox"]:checked::after { transform: translateX(18px); }
.v5-preview { display: flex; flex-wrap: wrap; gap: 3px 10px; font-size: 12.5px; font-weight: 700; color: var(--ink-3); }
.v5-preview strong { color: var(--ink); font-weight: 800; }
/* autonome ou imbriqué dans .v5-preview : occupe toujours la largeur */
.v5-preview-warn { flex: 1 1 100%; padding: 9px 12px; border-radius: var(--radius-sm); background: var(--warm-soft); color: var(--warm); font-size: 12.5px; font-weight: 800; line-height: 1.45; }

/* --- tuiles de navigation --- */
.v5-tiles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.v5-tile {
  position: relative; display: flex; flex-direction: column; align-items: flex-start; gap: 6px;
  min-height: 92px; padding: 12px 11px; border-radius: var(--radius-md);
  background: var(--surface); color: var(--ink); box-shadow: var(--shadow-1);
  text-align: left; transition: transform .14s ease-out;
}
.v5-tile:active { transform: scale(.97); }
.v5-tile svg { width: 20px; height: 20px; color: var(--brand); }
.v5-tile-t { font-size: 13px; font-weight: 800; line-height: 1.2; }
.v5-tile-s { font-size: 11px; font-weight: 700; color: var(--ink-3); line-height: 1.3; }
.v5-tile::after {
  content: ''; position: absolute; top: 14px; right: 12px; width: 6px; height: 6px; opacity: .8;
  border-top: 2px solid var(--ink-3); border-right: 2px solid var(--ink-3); transform: rotate(45deg);
}

/* --- squelettes de chargement --- */
.v5-skel { display: flex; flex-direction: column; gap: 12px; }
.v5-skel-b { position: relative; overflow: hidden; border-radius: var(--radius-md); background: var(--surface-2); }
.v5-skel-b::after {
  content: ''; position: absolute; inset: 0; opacity: .8; transform: translateX(-100%);
  background: linear-gradient(90deg, transparent, var(--surface), transparent);
  animation: v5-shimmer 1.35s ease-in-out infinite;
}
.v5-skel-line { height: 16px; border-radius: 999px; }
.v5-skel-card { height: 148px; }
.v5-skel-tile { height: 84px; }
@keyframes v5-shimmer { to { transform: translateX(100%); } }

/* ===== 4. Passe de découverte (discovery.js) =============== */
.v5-disc {
  position: fixed; inset: 0; z-index: 60; display: flex; flex-direction: column; gap: 12px;
  background: var(--bg);
  padding: calc(env(safe-area-inset-top, 0px) + 12px) 14px calc(env(safe-area-inset-bottom, 0px) + 14px);
}
.v5-disc-top { flex: none; display: flex; align-items: center; gap: 10px; }
.v5-disc-bar { flex: 1; display: flex; gap: 3px; min-width: 0; }
.v5-disc-seg { flex: 1; height: 4px; border-radius: 999px; background: var(--surface-2); transition: background .2s ease-out; }
.v5-disc-seg.is-done { background: var(--brand); }
.v5-disc-count { flex: none; font-size: 12.5px; font-weight: 800; color: var(--ink-3); }
.v5-disc-inter {
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 8px; text-align: center; color: var(--ink-2); font-size: 14px; font-weight: 700;
}
/* le gros chiffre de l'interstitiel : <strong> ou <div class="v5-disc-big"> */
.v5-disc-inter strong,
.v5-disc-inter .v5-disc-big { font-size: 32px; font-weight: 800; color: var(--ink); letter-spacing: -1px; }
.v5-disc-card {
  flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain;
  display: flex; flex-direction: column; gap: 12px;
  padding: 20px 18px; border-radius: var(--radius); background: var(--surface);
  box-shadow: var(--shadow-1); animation: v5-slide-in .2s ease-out;
}
.v5-disc-head { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.v5-disc-term { font-size: 30px; font-weight: 800; line-height: 1.15; letter-spacing: -.8px; overflow-wrap: anywhere; }
.v5-disc-phon { color: var(--ink-3); font-size: 14.5px; font-weight: 700; }
.v5-disc-tr { font-size: 20px; font-weight: 800; color: var(--brand); overflow-wrap: anywhere; }
.v5-disc-def { color: var(--ink-2); font-size: 14.5px; }
.v5-disc-ex { padding: 12px 14px; border-radius: var(--radius-sm); background: var(--bg); color: var(--ink-2); font-size: 14.5px; font-style: italic; line-height: 1.5; }
.v5-disc-ex-tr { display: block; margin-top: 5px; color: var(--ink-3); font-size: 13px; font-style: normal; }
.v5-ladder { display: flex; flex-direction: column; gap: 6px; margin-top: 2px; }
.v5-ladder-t { font-size: 12px; font-weight: 800; text-transform: uppercase; letter-spacing: .7px; color: var(--ink-3); }
.v5-rung {
  display: flex; align-items: center; gap: 9px; width: 100%; min-height: 46px;
  padding: 8px 12px; border-radius: var(--radius-sm); border: 1px solid var(--line);
  background: var(--bg); color: var(--ink-2); font-size: 13.5px; font-weight: 700; text-align: left;
}
.v5-rung.is-current { background: var(--brand-soft); border-color: transparent; color: var(--brand); }
.v5-rung-tr { color: var(--ink-3); font-weight: 700; }
.v5-rung-chip { flex: none; margin-left: auto; padding: 3px 9px; border-radius: 999px; background: var(--brand-soft); color: var(--brand); font-size: 11px; font-weight: 800; white-space: nowrap; }
.v5-disc-actions { flex: none; display: flex; gap: 10px; }
.v5-disc-actions > * { flex: 1; min-width: 0; }
.v5-disc-actions > *:last-child { flex: 1.4; }
.v5-disc-ready {
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 10px; text-align: center; color: var(--ink-2); font-size: 14px; font-weight: 700;
  animation: v5-slide-in .2s ease-out;
}
.v5-disc-ready-num,
.v5-disc-ready .v5-disc-big { font-size: 54px; font-weight: 800; line-height: 1; letter-spacing: -2px; color: var(--brand); }
/* discovery.js pose aussi `v5-slide-in` comme classe (uniquement si le
   mouvement est autorisé) sur l'interstitiel et l'écran final. */
.v5-slide-in { animation: v5-slide-in .2s ease-out; }
@keyframes v5-slide-in { from { opacity: 0; transform: translateX(18px); } to { opacity: 1; transform: none; } }

/* ===== 5. Bibliothèque (library-plus.js) ==================== */
#libScope, .v5-lib-scope { margin: 10px 0 0; }
#libStates, .v5-lib-states { align-items: center; padding-top: 10px; }
.v5-lib-count { flex: none; padding-left: 4px; color: var(--ink-3); font-size: 12px; font-weight: 700; white-space: nowrap; }
#libV5Head, .v5-lib-head { padding: 10px 2px 0; color: var(--ink-3); font-size: 13px; font-weight: 600; }
#libV5Head strong, .v5-lib-head strong { color: var(--ink); font-weight: 800; }
.badge.v5-state { font-weight: 800; }
.badge.v5-state-review     { background: var(--ko-soft);    color: var(--ko); }
.badge.v5-state-learning   { background: var(--warm-soft);  color: var(--warm); }
.badge.v5-state-mastered   { background: var(--ok-soft);    color: var(--ok); }
.badge.v5-state-discovered { background: var(--brand-soft); color: var(--brand); }
.badge.v5-state-new        { background: var(--surface-2);  color: var(--ink-3); }
.v5-vote-row {
  display: flex; align-items: center; flex-wrap: wrap; gap: 8px;
  margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--line);
  font-size: 13px; font-weight: 700; color: var(--ink-2);
}
.v5-vote-row > span:first-child { flex: 1; min-width: 120px; }
.v5-vote {
  flex: none; min-height: 44px; padding: 0 15px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--surface); color: var(--ink-2);
  font-size: 12.5px; font-weight: 800; transition: transform .12s ease-out;
}
.v5-vote:active { transform: scale(.95); }
.v5-vote[data-vote="1"].is-on  { background: var(--ok); border-color: var(--ok); color: var(--on-brand); }
.v5-vote[data-vote="-1"].is-on { background: var(--ko); border-color: var(--ko); color: var(--on-brand); }
.v5-vote-row.on-card { margin-top: 6px; padding-top: 8px; gap: 6px; font-size: 12px; }
.v5-vote-row.on-card > span:first-child { flex: 1 1 100%; min-width: 0; color: var(--ink-3); }
.v5-vote-row.on-card .v5-vote { min-height: 40px; padding: 0 12px; font-size: 12px; }
.v5-empty { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 30px 18px; color: var(--ink-3); font-size: 13.5px; font-weight: 700; text-align: center; }
.v5-empty svg { width: 30px; height: 30px; opacity: .7; }

/* ===== 6. Parcours - Le Sentier Sylvestre ==================== */
/* ===== 6. Parcours - Le Sentier Sylvestre (Expérience 3D) ===== */
#view-journey {
  position: relative;
  overflow-x: hidden;
  background: linear-gradient(180deg, rgba(247, 250, 248, 0.86) 0%, rgba(241, 246, 243, 0.92) 100%),
              url('img/forest_trail_depth_bg.jpg') no-repeat center top / cover;
  background-attachment: fixed;
  min-height: 100%;
}
.v5-ambient-canvas {
  position: absolute;
  top: 0; left: 0; width: 100%; height: 100%;
  pointer-events: none;
  z-index: 0;
}

.v5-journey {
  position: relative; z-index: 1;
  display: flex; flex-direction: column; gap: 16px; padding: 4px 0 36px;
}
.wrap.v5-journey { max-width: 680px; margin: 0 auto; }

/* --- En-tête : Titre & Pavillon des Trophées --- */
.v5-jhead { display: flex; flex-direction: column; gap: 12px; padding: 4px 2px 0; }
.v5-jhead-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.v5-jhead-titles { display: flex; flex-direction: column; gap: 2px; }
.v5-jhead-tag {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 11.5px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.8px;
  color: var(--ok);
}
.v5-jhead h1 { margin: 0; font-size: 24px; font-weight: 800; letter-spacing: -.6px; color: var(--ink); }

/* Bouton Trophées */
.v5-trophy-btn {
  display: inline-flex; align-items: center; gap: 7px; min-height: 42px;
  padding: 0 14px; border-radius: 999px;
  background: linear-gradient(135deg, var(--warm-soft), #fef3c7);
  border: 1.5px solid rgba(224, 134, 0, 0.25);
  color: var(--warm); font-size: 13px; font-weight: 800;
  box-shadow: 0 2px 8px rgba(224, 134, 0, 0.12);
  transition: transform .14s ease-out, box-shadow .14s ease-out;
}
.v5-trophy-btn:active { transform: scale(0.96); }
.v5-trophy-btn svg { width: 18px; height: 18px; color: var(--warm); }
.v5-trophy-count { font-size: 12.5px; font-weight: 800; color: #b45309; }

/* --- Astrolabe Forestier de Progression (3D Glassmorphic) --- */
.v5-astrolabe {
  display: flex; align-items: center; gap: 18px;
  padding: 18px 20px; border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px);
  border: 1.5px solid rgba(255, 255, 255, 0.8);
  box-shadow: 0 14px 36px rgba(15, 23, 20, 0.12), inset 0 1px 2px rgba(255, 255, 255, 0.9);
}
.v5-astrolabe-ring {
  position: relative; flex: none; width: 94px; height: 94px;
  display: grid; place-items: center;
}
.v5-astrolabe-svg {
  position: absolute; inset: 0; width: 100%; height: 100%;
  transform: rotate(-90deg);
}
.v5-astro-bg {
  stroke: var(--line); stroke-width: 8; fill: none;
}
.v5-astro-bar {
  stroke: var(--ok); stroke-width: 8; stroke-linecap: round; fill: none;
  transition: stroke-dashoffset .8s cubic-bezier(.2, .7, .3, 1);
  filter: drop-shadow(0 0 6px rgba(14, 164, 107, 0.35));
}
.v5-astrolabe-center {
  position: relative; z-index: 2; display: flex; flex-direction: column;
  align-items: center; text-align: center; line-height: 1;
}
.v5-astrolabe-pct { font-size: 20px; font-weight: 800; color: var(--ink); letter-spacing: -.5px; }
.v5-astrolabe-sub { font-size: 10px; font-weight: 700; color: var(--ink-3); margin-top: 2px; }

.v5-astrolabe-meta { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.v5-rank-badge {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 13.5px; font-weight: 800; color: var(--brand);
}
.v5-rank-badge svg { width: 14px; height: 14px; flex: none; }
.v5-rank-desc { margin: 0; font-size: 12px; font-weight: 600; color: var(--ink-2); line-height: 1.35; }
.v5-astrolabe-stats {
  display: flex; flex-wrap: wrap; gap: 6px 12px; margin-top: 4px;
  font-size: 11.5px; font-weight: 700; color: var(--ink-3);
}
.v5-stat-item { display: inline-flex; align-items: center; gap: 4px; }
.v5-stat-item svg { width: 13px; height: 13px; }
.v5-stat-item strong { color: var(--ink); font-weight: 800; }

/* --- Pilules de Navigation par Biome --- */
.v5-stage-pills { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; padding: 6px 0 2px; }
.v5-stage-pills::-webkit-scrollbar { display: none; }
.v5-stage-pill {
  flex: none; display: inline-flex; align-items: center; gap: 7px; min-height: 42px;
  padding: 0 14px; border-radius: 999px; border: 1.5px solid var(--line);
  background: rgba(255, 255, 255, 0.88); backdrop-filter: blur(8px);
  color: var(--ink-2); font-size: 12px; font-weight: 800;
  white-space: nowrap; transition: transform .12s ease-out, border-color .15s ease-out;
}
.v5-stage-pill:active { transform: scale(.96); }
.v5-stage-pill em { font-style: normal; color: var(--ink-3); font-weight: 700; font-size: 11px; }
.v5-stage-pill.is-on { background: var(--surface); border-color: var(--brand); color: var(--brand); box-shadow: 0 0 0 1px var(--brand); }
.v5-stage-pill.is-on em { color: var(--brand); }
.v5-stage-pill.is-locked { opacity: .55; }
.v5-pill-foundations.is-on { border-color: #0ea46b; color: #0ea46b; box-shadow: 0 0 0 1px #0ea46b; }
.v5-pill-influence.is-on { border-color: #0284c7; color: #0284c7; box-shadow: 0 0 0 1px #0284c7; }
.v5-pill-mastery.is-on { border-color: #6366f1; color: #6366f1; box-shadow: 0 0 0 1px #6366f1; }
.v5-pill-register.is-on { border-color: #d97706; color: #d97706; box-shadow: 0 0 0 1px #d97706; }

/* --- Étape Forestière (Section Stage avec Diorama 3D) --- */
.v5-stage { content-visibility: auto; contain-intrinsic-size: 1px 900px; margin-top: 20px; }
.v5-stage-band {
  display: flex; flex-direction: row; align-items: center; gap: 16px;
  padding: 16px 18px; border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  box-shadow: 0 12px 32px rgba(15, 23, 20, 0.12);
  border: 1.5px solid rgba(255, 255, 255, 0.8);
  border-left: 6px solid var(--biome-color, var(--brand));
  transition: transform .2s ease-out, box-shadow .2s ease-out;
}
.v5-stage-diorama-card {
  position: relative; flex: none; width: 84px; height: 84px;
  border-radius: 18px; overflow: hidden;
  border: 2px solid rgba(255, 255, 255, 0.7);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.22), 0 2px 6px rgba(0, 0, 0, 0.1);
  transform: perspective(400px) rotateY(-4deg) rotateX(4deg);
  transition: transform .22s ease-out, box-shadow .22s ease-out;
}
.v5-stage-diorama-card:hover {
  transform: perspective(400px) rotateY(0deg) rotateX(0deg) scale(1.04);
  box-shadow: 0 14px 30px rgba(0, 0, 0, 0.32);
}
.v5-stage-diorama-img { width: 100%; height: 100%; object-fit: cover; display: block; }
.v5-stage-diorama-glow {
  position: absolute; inset: 0; border-radius: 16px;
  box-shadow: inset 0 0 12px var(--biome-color, rgba(255, 255, 255, 0.3));
  pointer-events: none;
}
.v5-stage-band-info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 5px; }
.v5-stage-band-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.v5-stage-tag { font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.8px; color: var(--biome-color, var(--ink-3)); }
.v5-stage-pct { font-size: 14px; font-weight: 800; color: var(--biome-color, var(--brand)); }
.v5-stage-band h2 { margin: 0; font-size: 18px; font-weight: 800; letter-spacing: -.4px; color: var(--ink); }
.v5-stage-band p { margin: 0; color: var(--ink-2); font-size: 13px; font-weight: 600; line-height: 1.4; }
.v5-bar { flex: 1 1 100%; height: 8px; margin-top: 4px; border-radius: 999px; background: var(--surface-2); overflow: hidden; }
.v5-bar > span { display: block; height: 100%; border-radius: 999px; background: linear-gradient(90deg, var(--brand-2), var(--brand)); transition: width .5s cubic-bezier(.2, .7, .3, 1); }
.v5-stage-meta { margin: 2px 0 0; color: var(--ink-3); font-size: 12px; font-weight: 700; }

.v5-lock-note {
  display: flex; align-items: center; flex-wrap: wrap; gap: 8px 10px;
  margin-top: 8px; padding: 11px 13px; border-radius: var(--radius-sm);
  background: var(--warm-soft); color: var(--warm); font-size: 12.5px; font-weight: 800; line-height: 1.45;
}
.v5-lock-note svg { flex: none; width: 18px; height: 18px; }
.v5-gate-btn { margin-left: auto; min-height: 44px; padding: 0 16px; border-radius: 999px; background: var(--warm); color: var(--on-brand); font-size: 12.5px; font-weight: 800; }
.v5-stage.is-locked .v5-chapter,
.v5-stage.is-locked .v5-snake { filter: grayscale(.9) opacity(.55); pointer-events: none; }

.v5-biome-foundations { --biome-color: #0ea46b; }
.v5-biome-influence   { --biome-color: #0284c7; }
.v5-biome-mastery     { --biome-color: #6366f1; }
.v5-biome-register    { --biome-color: #d97706; }

/* --- Clairières (Chapitres) --- */
.v5-clearing-header {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  margin: 28px 0 12px; padding: 4px 12px; text-align: center;
}
.v5-clearing-icon { color: var(--biome-color, var(--brand)); display: grid; place-items: center; opacity: 0.85; }
.v5-chapter {
  margin: 0; font-size: 13.5px; font-weight: 800; text-transform: uppercase;
  letter-spacing: 0.9px; color: var(--ink);
}
.v5-clearing-count { font-size: 11.5px; font-weight: 700; color: var(--ink-3); }

/* --- Sentier Vivant (v5-snake & Tracé SVG Connecté) --- */
.v5-snake {
  position: relative; width: 100%; max-width: 420px;
  margin: 0 auto; list-style: none; padding: 0;
}
.v5-trail-canvas {
  position: absolute; top: 0; left: 50%; transform: translateX(-50%);
  width: 300px; height: 100%; pointer-events: none; z-index: 1;
}
.v5-trail-shadow {
  stroke: rgba(23, 21, 38, 0.08); stroke-width: 18;
  fill: none; stroke-linecap: round;
}
.v5-trail-base {
  stroke: rgba(100, 116, 139, 0.35); stroke-width: 8;
  stroke-dasharray: 4 12; stroke-linecap: round; fill: none;
}
.v5-trail-lit {
  stroke-width: 7; stroke-linecap: round; fill: none;
  filter: drop-shadow(0 2px 10px rgba(16, 185, 129, 0.45));
}

/* --- Pierres de Gué Runiques avec Relief 3D (.v5-node) --- */
.v5-node {
  position: absolute; z-index: 2; width: 66px; height: 66px;
  border-radius: 50%; display: grid; place-items: center;
  transform: translateX(-50%);
  box-shadow: 0 10px 22px rgba(0, 0, 0, 0.28), 0 3px 6px rgba(0, 0, 0, 0.16);
  transition: transform .18s cubic-bezier(.2, .8, .3, 1), box-shadow .18s ease-out, filter .18s ease-out;
  cursor: pointer;
}
.v5-node > *:not(.v5-ring) { position: relative; z-index: 2; }
.v5-node:hover {
  transform: translateX(-50%) translateY(-3px) scale(1.05);
  box-shadow: 0 14px 28px rgba(0, 0, 0, 0.35), 0 5px 10px rgba(0, 0, 0, 0.2);
}
.v5-node:active {
  transform: translateX(-50%) translateY(3px) scale(.92);
  box-shadow: 0 3px 6px rgba(0, 0, 0, 0.25);
}

.v5-node-in {
  font-size: 19px; font-weight: 800; color: var(--ink); line-height: 1;
}
.v5-node-in svg { width: 24px; height: 24px; display: block; }

/* Anneau runique avec effet 3D convexe */
.v5-ring {
  position: absolute; inset: 0; z-index: 1; border-radius: 50%;
  background: conic-gradient(var(--biome-color, var(--brand)) calc(var(--pct, 0) * 1%), rgba(148, 163, 184, 0.3) 0);
  transition: transform .14s ease-out;
}
.v5-ring::after {
  content: ''; position: absolute; inset: 5px; border-radius: 50%;
  background: radial-gradient(circle at 35% 25%, #ffffff 0%, var(--surface) 48%, var(--surface-2) 100%);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.16), inset 0 2px 3px rgba(255, 255, 255, 0.9), inset 0 -2px 4px rgba(0, 0, 0, 0.14);
}
.v5-node.is-done .v5-ring { background: var(--ok); }
.v5-node.is-done .v5-ring::after {
  background: radial-gradient(circle at 35% 25%, #ffffff 0%, #ecfdf5 50%, #d1fae5 100%);
  box-shadow: 0 4px 12px rgba(14, 164, 107, 0.2), inset 0 2px 3px rgba(255, 255, 255, 0.95);
}
.v5-node.is-done .v5-node-in { color: var(--ok); }

.v5-node.is-locked .v5-ring { background: var(--line); }
.v5-node.is-locked .v5-ring::after { background: var(--surface-2); box-shadow: none; }
.v5-node.is-locked .v5-node-in { color: var(--ink-3); }

/* Nœud courant : Halo palpitant & Balise Pisteur */
.v5-node.is-current .v5-node-in { color: var(--biome-color, var(--brand)); }
.v5-node.is-current { filter: drop-shadow(0 0 14px var(--biome-color, var(--ok))); }
.v5-node.is-current::after {
  content: ''; position: absolute; inset: -9px; z-index: 0; border-radius: 50%;
  background: var(--brand-soft); pointer-events: none;
  animation: v5-halo 2s ease-in-out infinite;
}

/* Particules & Confettis 3D */
.v5-confetti-3d i {
  position: fixed; z-index: 100; pointer-events: none;
  animation: confetti3d-fall linear forwards;
  will-change: transform, opacity;
}
.v5-particle-leaf-gold {
  width: 14px; height: 18px;
  background: linear-gradient(135deg, #fef08a, #f59e0b);
  border-radius: 60% 0 60% 0;
  box-shadow: 0 2px 6px rgba(245, 158, 11, 0.4);
}
.v5-particle-leaf-amber {
  width: 12px; height: 16px;
  background: linear-gradient(135deg, #fcd34d, #d97706);
  border-radius: 0 60% 0 60%;
  box-shadow: 0 2px 6px rgba(217, 119, 6, 0.4);
}
.v5-particle-gem-ruby {
  width: 12px; height: 12px;
  background: linear-gradient(135deg, #fda4af, #e11d48);
  transform: rotate(45deg);
  box-shadow: 0 2px 8px rgba(225, 29, 72, 0.5);
}
.v5-particle-gem-emerald {
  width: 11px; height: 11px;
  background: linear-gradient(135deg, #86efac, #10b981);
  transform: rotate(45deg);
  box-shadow: 0 2px 8px rgba(16, 185, 129, 0.5);
}
.v5-particle-gem-sapphire {
  width: 11px; height: 11px;
  background: linear-gradient(135deg, #93c5fd, #2563eb);
  transform: rotate(45deg);
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.5);
}
.v5-particle-stardust {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 0 10px #fef08a, 0 0 18px #f59e0b;
}
@keyframes confetti3d-fall {
  0% {
    opacity: 1;
    transform: translateY(0) rotateX(0deg) rotateY(0deg) rotateZ(0deg) scale(1);
  }
  100% {
    opacity: 0;
    transform: translateY(440px) rotateX(720deg) rotateY(1080deg) rotateZ(360deg) scale(0.6);
  }
}

/* Balise de position du Pisteur */
.v5-tracker-pin {
  position: absolute; top: -22px; left: 50%; transform: translateX(-50%);
  width: 26px; height: 26px; border-radius: 50%;
  background: var(--biome-color, var(--brand)); color: var(--on-brand);
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
  animation: v5-pin-bob 1.8s ease-in-out infinite;
  z-index: 5; pointer-events: none;
}
.v5-tracker-pin svg { width: 14px; height: 14px; display: block; }
@keyframes v5-pin-bob {
  0%, 100% { transform: translateX(-50%) translateY(0); }
  50% { transform: translateX(-50%) translateY(-5px); }
}

.v5-node .v5-crowns {
  position: absolute; top: -7px; left: 50%; z-index: 3;
  display: flex; gap: 1px; transform: translateX(-50%);
  color: var(--warm); pointer-events: none;
}
.v5-crowns svg { width: 14px; height: 14px; display: block; }
.v5-node .v5-node-label {
  position: absolute; top: 100%; left: 50%; z-index: 2;
  margin-top: 6px; transform: translateX(-50%);
  color: var(--ink-2); font-size: 11.5px; font-weight: 800; white-space: nowrap;
}

/* --- Pavillon des Trophées (Modale) --- */
.v5-trophy-wrap { display: flex; flex-direction: column; gap: 16px; padding-bottom: 20px; }
.v5-trophy-hero {
  display: flex; align-items: center; gap: 14px;
  padding: 16px 18px; border-radius: var(--radius-md);
  background: linear-gradient(135deg, #fef3c7, #fde68a);
  color: #92400e; box-shadow: var(--shadow-1);
}
.v5-trophy-hero-ico {
  display: grid; place-items: center; width: 52px; height: 52px;
  border-radius: 16px; background: rgba(255, 255, 255, 0.7);
  color: #d97706; flex: none;
}
.v5-trophy-hero-text h3 { margin: 0; font-size: 18px; font-weight: 800; letter-spacing: -.3px; }
.v5-trophy-hero-text p { margin: 2px 0 0; font-size: 13px; font-weight: 700; opacity: 0.9; }

.v5-trophy-grid { display: flex; flex-direction: column; gap: 10px; }
.v5-badge-card {
  display: flex; align-items: center; gap: 14px;
  padding: 12px 14px; border-radius: var(--radius-md);
  background: var(--surface); border: 1.5px solid var(--line);
  box-shadow: var(--shadow-1); transition: transform .12s ease-out;
}
.v5-badge-card.is-unlocked {
  border-color: rgba(14, 164, 107, 0.35);
  background: linear-gradient(135deg, var(--surface) 0%, #f0fdf4 100%);
}
.v5-badge-card.is-locked { opacity: 0.65; }

.v5-badge-medallion {
  flex: none; width: 50px; height: 50px; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--surface-2); color: var(--ink-3);
  border: 2px solid var(--line);
}
.v5-badge-card.is-unlocked .v5-badge-medallion {
  background: linear-gradient(135deg, #dcfce7, #bbf7d0);
  border-color: #22c55e; color: #15803d;
  box-shadow: 0 2px 10px rgba(34, 197, 94, 0.25);
}
.v5-badge-card.is-locked .v5-badge-medallion svg { opacity: 0.5; }

.v5-badge-info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.v5-badge-title { font-size: 15px; font-weight: 800; color: var(--ink); }
.v5-badge-desc { font-size: 12.5px; font-weight: 600; color: var(--ink-2); line-height: 1.35; }
.v5-badge-meta { margin-top: 4px; display: flex; align-items: center; gap: 6px; }
.v5-badge-tag {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 2px 8px; border-radius: 999px;
  font-size: 11px; font-weight: 800;
}
.v5-badge-tag.is-ok { background: var(--ok-soft); color: var(--ok); }
.v5-badge-tag.is-locked { background: var(--surface-2); color: var(--ink-3); }

.v5-unit-badge-bar { display: flex; align-items: center; gap: 8px; margin-bottom: 2px; }
.v5-biome-chip { background: var(--surface-2); color: var(--ink); font-weight: 800; }
.v5-unit-meta-sub { font-size: 13px; font-weight: 700; color: var(--ink-3); }

/* --- fiche d'unité (#journeySheet, réutilise .sheet de la v4) --- */
.v5-sheet-unit { display: flex; flex-direction: column; gap: 10px; }
.v5-unit-meta { display: flex; align-items: center; gap: 8px; color: var(--ink-3); font-size: 13px; font-weight: 800; }
.v5-unit-list { display: flex; flex-direction: column; gap: 8px; margin: 0; padding: 0; list-style: none; }
.v5-unit-row { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: var(--radius-sm); background: var(--surface); box-shadow: var(--shadow-1); font-size: 14px; }
.v5-unit-term { font-weight: 800; overflow-wrap: anywhere; }
.v5-unit-tr { flex: 1; min-width: 90px; color: var(--ink-2); font-size: 13.5px; overflow-wrap: anywhere; }
.v5-unit-cta { display: flex; flex-direction: column; gap: 8px; margin-top: 4px; }

/* --- test d'accès / checkpoint --- */
.v5-quiz { display: flex; flex-direction: column; gap: 12px; }
.v5-quiz-bar { display: flex; gap: 2px; }
.v5-quiz-seg { flex: 1; height: 4px; border-radius: 999px; background: var(--surface-2); }
.v5-quiz-seg.is-ok { background: var(--ok); }
.v5-quiz-seg.is-ko { background: var(--ko); }
.v5-quiz-q { font-size: 18px; font-weight: 800; line-height: 1.3; overflow-wrap: anywhere; }
.v5-opt {
  display: flex; align-items: center; gap: 10px; width: 100%; min-height: 52px;
  padding: 8px 14px; border-radius: var(--radius-sm); border: 1.5px solid var(--line);
  background: var(--surface); color: var(--ink); font-size: 14.5px; font-weight: 700;
  text-align: left; transition: transform .12s ease-out;
}
.v5-opt:active:not(:disabled) { transform: scale(.98); }
.v5-opt.is-ok { background: var(--ok-soft); border-color: var(--ok); color: var(--ok); font-weight: 800; }
.v5-opt.is-ko { background: var(--ko-soft); border-color: var(--ko); color: var(--ko); font-weight: 800; }

/* --- célébrations --- */
.v5-celebrate {
  position: fixed; inset: 0; z-index: 93; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 8px; padding: 24px; text-align: center;
  background: linear-gradient(155deg, var(--brand-2), var(--brand)); color: var(--on-brand);
  pointer-events: none; animation: v5-celebrate 1.5s ease-out forwards;
}
.v5-celebrate strong { font-size: 30px; font-weight: 800; letter-spacing: -.8px; }
.v5-celebrate span { font-size: 15px; font-weight: 700; opacity: .85; }
.v5-celebrate svg { width: 54px; height: 54px; }
@keyframes v5-celebrate { 0% { opacity: 0; } 14% { opacity: 1; } 78% { opacity: 1; } 100% { opacity: 0; visibility: hidden; } }
.v5-confetti { position: fixed; inset: 0; z-index: 94; overflow: hidden; pointer-events: none; }
.v5-confetti i { position: absolute; top: -16px; width: 8px; height: 13px; border-radius: 2px; animation: v5-fall 1.7s linear forwards; }
.v5-confetti i:nth-child(5n+1) { background: var(--brand); }
.v5-confetti i:nth-child(5n+2) { background: var(--brand-2); }
.v5-confetti i:nth-child(5n+3) { background: var(--warm); }
.v5-confetti i:nth-child(5n+4) { background: var(--ok); }
.v5-confetti i:nth-child(5n+5) { background: var(--ko); }
@keyframes v5-fall { 0% { transform: translateY(0) rotate(0deg); opacity: 1; } 100% { transform: translateY(105vh) rotate(560deg); opacity: .15; } }

/* ===== 7. Réviser - origine de la session =================== */
.v5-origin {
  display: inline-flex; align-items: center; gap: 7px; max-width: 100%; min-height: 34px;
  margin: 0 0 8px; padding: 0 13px; border-radius: 999px;
  background: var(--brand-soft); color: var(--brand); font-size: 13px; font-weight: 800;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.v5-origin svg { flex: none; width: 16px; height: 16px; }

/* ===== 8. Thème sombre ======================================
   Les tokens font l'essentiel ; seuls les effets propres à la v5
   (halos, brillances, ombres portées) sont retouchés ici.
   ============================================================ */
html[data-theme="dark"] .v5-hero::after { opacity: .28; }
html[data-theme="dark"] .v5-skel-b::after { opacity: .45; }
html[data-theme="dark"] .v5-ring::after { box-shadow: none; }
html[data-theme="dark"] .v5-unit-row { box-shadow: none; border: 1px solid var(--line); }
html[data-theme="dark"] #view-journey {
  background: linear-gradient(180deg, rgba(10, 15, 12, 0.82) 0%, rgba(7, 11, 9, 0.93) 100%),
              url('img/forest_trail_depth_bg.jpg') no-repeat center top / cover;
  background-attachment: fixed;
}
html[data-theme="dark"] .v5-stage-band {
  background: rgba(22, 28, 25, 0.9);
  backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  border-color: rgba(255, 255, 255, 0.1);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.45);
}
html[data-theme="dark"] .v5-stage-diorama-card {
  border-color: rgba(255, 255, 255, 0.18);
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.55);
}
html[data-theme="dark"] .v5-astrolabe {
  background: rgba(24, 30, 27, 0.9);
  backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px);
  border-color: rgba(255, 255, 255, 0.12);
  box-shadow: 0 14px 36px rgba(0, 0, 0, 0.5);
}
html[data-theme="dark"] .v5-stage-pill {
  background: rgba(24, 30, 27, 0.88);
  backdrop-filter: blur(8px);
}
html[data-theme="dark"] .v5-trophy-btn { background: #3b2800; border-color: #854d0e; color: #fde68a; }
html[data-theme="dark"] .v5-trophy-hero { background: linear-gradient(135deg, #451a03, #78350f); color: #fef3c7; }
html[data-theme="dark"] .v5-trophy-hero-ico { background: rgba(0, 0, 0, 0.3); color: #fde68a; }
html[data-theme="dark"] .v5-badge-card { background: var(--surface); border-color: var(--line); }
html[data-theme="dark"] .v5-badge-card.is-unlocked { background: linear-gradient(135deg, #18281e 0%, #102016 100%); border-color: rgba(34, 197, 94, 0.4); }
html[data-theme="dark"] .v5-badge-medallion { background: var(--surface-2); border-color: var(--line); }

/* avant l'exécution de app.js (qui pose data-theme), suivre le système */
@media (prefers-color-scheme: dark) {
  html:not([data-theme="light"]) .v5-hero::after { opacity: .28; }
  html:not([data-theme="light"]) .v5-skel-b::after { opacity: .45; }
  html:not([data-theme="light"]) .v5-ring::after { box-shadow: none; }
  html:not([data-theme="light"]) .v5-unit-row { box-shadow: none; border: 1px solid var(--line); }
  html:not([data-theme="light"]) #view-journey {
    background: linear-gradient(180deg, rgba(10, 15, 12, 0.82) 0%, rgba(7, 11, 9, 0.93) 100%),
                url('img/forest_trail_depth_bg.jpg') no-repeat center top / cover;
    background-attachment: fixed;
  }
  html:not([data-theme="light"]) .v5-stage-band {
    background: rgba(22, 28, 25, 0.9);
    border-color: rgba(255, 255, 255, 0.1);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.45);
  }
  html:not([data-theme="light"]) .v5-stage-diorama-card {
    border-color: rgba(255, 255, 255, 0.18);
    box-shadow: 0 10px 26px rgba(0, 0, 0, 0.55);
  }
  html:not([data-theme="light"]) .v5-astrolabe {
    background: rgba(24, 30, 27, 0.9);
    border-color: rgba(255, 255, 255, 0.12);
    box-shadow: 0 14px 36px rgba(0, 0, 0, 0.5);
  }
  html:not([data-theme="light"]) .v5-trophy-btn { background: #3b2800; border-color: #854d0e; color: #fde68a; }
  html:not([data-theme="light"]) .v5-trophy-hero { background: linear-gradient(135deg, #451a03, #78350f); color: #fef3c7; }
  html:not([data-theme="light"]) .v5-trophy-hero-ico { background: rgba(0, 0, 0, 0.3); color: #fde68a; }
  html:not([data-theme="light"]) .v5-badge-card.is-unlocked { background: linear-gradient(135deg, #18281e 0%, #102016 100%); border-color: rgba(34, 197, 94, 0.4); }
}

/* ===== 9. Écrans larges ===================================== */
@media (min-width: 720px) {
  .wrap.v5-home { max-width: 560px; }
  .v5-hero { padding: 24px 22px; }
  .v5-presets, .v5-tiles { gap: 12px; }
  .v5-disc { padding-left: 24px; padding-right: 24px; }
  .v5-disc-top, .v5-disc-card, .v5-disc-actions,
  #journeySheet .v5-sheet-unit, #journeySheet .v5-quiz,
  #trophySheet .v5-trophy-wrap {
    width: 100%; max-width: 620px; margin-left: auto; margin-right: auto;
  }
  .v5-trophy-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
}

/* Au-delà de 768 px la v4 remonte la tabbar en tête de page :
   le disque central redevient un onglet ordinaire. */
@media (min-width: 768px) {
  .tabbar { justify-content: center; gap: 8px; }
  .tab { flex: 0 0 auto; }
  .tab.tab-center::before { display: none; }
  .tab.tab-center > svg { position: static; width: 20px; height: 20px; margin: 0; transform: none; color: inherit; }
  .tab.tab-center > svg .ico-fill { opacity: 0; }
  .tab.tab-center.is-active > svg .ico-fill { opacity: 1; }
  .tab.tab-center > span:not(.tab-badge) { margin-top: 0; font-size: 14px; font-weight: 700; color: inherit; }
  .tab.tab-center #dueBadge { position: static; margin: 0; border: 0; }
}

/* ===== 10. Mouvement réduit ================================= */
@media (prefers-reduced-motion: reduce) {
  .views, .v5-hero, .v5-preset, .v5-tile, .v5-node, .v5-ring, .v5-bar > span,
  .v5-vote, .v5-opt, .v5-step, .v5-stepper > button, .v5-stage-pill, .v5-disc-seg,
  .v5-toggle input[type="checkbox"], .v5-toggle input[type="checkbox"]::after,
  .v5-more > summary::after, .tab.tab-center::before, .v5-astro-bar { transition: none; }
  .v5-disc-card, .v5-disc-ready, .v5-slide-in, .v5-skel-b::after, .v5-tracker-pin { animation: none; }
  .v5-node.is-current::after { animation: none; opacity: .7; transform: none; }
  .v5-confetti { display: none; }
}

/* ===== 11. V9 - Matrice Multilingue & Profils de Haute Autorité ===== */

/* Badge profil dans l'en-tête */
.v5-profile-badge-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: var(--v5-card-bg, rgba(255, 255, 255, 0.9));
  border: 1.5px solid var(--primary, #0ea46b);
  border-radius: 999px;
  padding: 4px 11px;
  font-size: 12.5px;
  font-weight: 700;
  color: var(--text, #1a2421);
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
  transition: all .2s ease;
}
.v5-profile-badge-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}
.v5-prof-label {
  letter-spacing: .2px;
}

/* Modale de sélection de profil */
.v5-profile-modal-body {
  padding: 16px 20px 24px;
}
.v5-profile-intro {
  margin: 0 0 16px;
  font-size: 14px;
  line-height: 1.5;
  color: var(--muted, #64748b);
}
.v5-profile-grid {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.v5-profile-card {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  text-align: left;
  padding: 16px;
  border-radius: 14px;
  border: 1.5px solid var(--border, #e2e8f0);
  background: var(--card-bg, #ffffff);
  cursor: pointer;
  transition: all .2s ease;
  font: inherit;
}
.v5-profile-card:hover {
  border-color: var(--primary, #0ea46b);
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.06);
}
.v5-profile-card.is-active {
  border-color: var(--primary, #0ea46b);
  background: rgba(14, 164, 107, 0.04);
  box-shadow: 0 0 0 1px var(--primary, #0ea46b);
}
.v5-pcard-icon {
  flex: 0 0 40px;
  height: 40px;
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.04);
  display: flex;
  align-items: center;
  justify-content: center;
}
.v5-pcard-info h3 {
  margin: 0 0 3px;
  font-size: 16px;
  font-weight: 700;
  color: var(--text, #1a2421);
}
.v5-pcard-badge {
  display: inline-block;
  font-size: 11.5px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .4px;
  color: var(--primary, #0ea46b);
  margin-bottom: 6px;
}
.v5-pcard-info p {
  margin: 0;
  font-size: 13px;
  line-height: 1.45;
  color: var(--muted, #64748b);
}

/* Définition en immersion française haute autorité */
.definition.v5-high-def {
  font-size: 15.5px;
  font-weight: 600;
  color: var(--text, #1a2421);
  background: rgba(14, 164, 107, 0.07);
  border-left: 3.5px solid var(--primary, #0ea46b);
  padding: 10px 14px;
  border-radius: 0 8px 8px 0;
  margin: 10px 0 14px;
  line-height: 1.45;
}

/* Tiroir polyglotte sur la flashcard */
.v5-polyglot-box {
  margin: 12px 0;
  padding: 12px 14px;
  border-radius: 12px;
  background: var(--v5-card-subtle, rgba(248, 250, 252, 0.9));
  border: 1px solid var(--border, #e2e8f0);
}
.v5-polyglot-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
  flex-wrap: wrap;
}
.v5-polyglot-title {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .5px;
  color: var(--muted, #64748b);
}
.v5-polyglot-tabs {
  display: inline-flex;
  gap: 5px;
  background: rgba(0, 0, 0, 0.05);
  padding: 2px;
  border-radius: 7px;
}
.v5-ptab {
  border: none;
  background: transparent;
  padding: 3px 8px;
  border-radius: 5px;
  font-size: 11px;
  font-weight: 800;
  color: var(--muted, #64748b);
  cursor: pointer;
  transition: all .15s ease;
}
.v5-ptab.is-active {
  background: var(--card-bg, #ffffff);
  color: var(--primary, #0ea46b);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.1);
}
.v5-polyglot-content {
  background: var(--card-bg, #ffffff);
  border-radius: 8px;
  padding: 10px 12px;
  border: 1px solid rgba(0, 0, 0, 0.04);
}
.v5-pflag {
  display: block;
  font-size: 10.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .4px;
  color: var(--primary, #0ea46b);
  margin-bottom: 3px;
}
.v5-ptext {
  margin: 0;
  font-size: 14.5px;
  font-weight: 600;
  font-style: italic;
  color: var(--text, #1a2421);
}

/* Calepin de direction & Notes personnelles */
.v5-notes-section {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px dashed var(--border, #cbd5e1);
}
.v5-notes-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}
.v5-notes-title {
  font-size: 11.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .4px;
  color: var(--muted, #64748b);
}
.v5-note-add-btn {
  border: none;
  background: transparent;
  color: var(--primary, #0ea46b);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  padding: 2px 6px;
}
.v5-note-add-btn:hover {
  text-decoration: underline;
}
.v5-notes-list {
  list-style: none;
  margin: 0 0 8px;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.v5-notes-list li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(14, 164, 107, 0.05);
  border-radius: 6px;
  padding: 6px 10px;
  font-size: 12.5px;
  color: var(--text, #1a2421);
}
.v5-note-del {
  border: none;
  background: transparent;
  color: #ef4444;
  font-size: 16px;
  cursor: pointer;
  padding: 0 4px;
}
.v5-note-editor {
  margin-top: 8px;
}
.v5-note-inp {
  width: 100%;
  box-sizing: border-box;
  border: 1.5px solid var(--border, #cbd5e1);
  border-radius: 8px;
  padding: 8px 10px;
  font-size: 13px;
  background: var(--card-bg, #ffffff);
  color: var(--text, #1a2421);
  margin-bottom: 8px;
}
.v5-note-inp:focus {
  outline: none;
  border-color: var(--primary, #0ea46b);
}
.v5-note-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

/* Thème sombre pour V9 */
html[data-theme="dark"] .v5-profile-badge-btn {
  background: rgba(22, 32, 27, 0.9);
  color: #e2e8f0;
}
html[data-theme="dark"] .v5-profile-card {
  background: #16201b;
  border-color: #27372f;
}
html[data-theme="dark"] .v5-profile-card.is-active {
  background: rgba(14, 164, 107, 0.12);
}
html[data-theme="dark"] .v5-pcard-icon {
  background: rgba(255, 255, 255, 0.05);
}
html[data-theme="dark"] .definition.v5-high-def {
  background: rgba(14, 164, 107, 0.12);
  color: #f1f5f9;
}
html[data-theme="dark"] .v5-polyglot-box {
  background: rgba(22, 32, 27, 0.7);
  border-color: #27372f;
}
html[data-theme="dark"] .v5-polyglot-content {
  background: #111a15;
}
html[data-theme="dark"] .v5-ptext {
  color: #e2e8f0;
}
html[data-theme="dark"] .v5-notes-list li {
  background: rgba(14, 164, 107, 0.1);
  color: #e2e8f0;
}
html[data-theme="dark"] .v5-note-inp {
  background: #111a15;
  border-color: #27372f;
  color: #f1f5f9;
}

/* ============================================================
   Bandeau de Profil d'Éloquence sur l'Accueil & Sentier Dédié
   ============================================================ */
.v5-home-profile-banner {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.95), rgba(248, 250, 252, 0.92));
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--border, #e2e8f0);
  border-left: 5px solid var(--primary, #0ea46b);
  border-radius: 16px;
  padding: 16px 20px;
  margin: 14px 0 20px 0;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.04);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.v5-home-profile-banner:hover {
  box-shadow: 0 8px 26px rgba(0, 0, 0, 0.07);
}
.v5-hpb-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}
.v5-hpb-badge-wrap {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.v5-hpb-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.v5-hpb-badge {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted, #64748b);
}
.v5-hpb-switch {
  font-size: 12px;
  font-weight: 600;
  color: var(--primary, #0ea46b);
  background: transparent;
  border: 1px solid currentColor;
  border-radius: 20px;
  padding: 4px 12px;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
.v5-hpb-switch:hover {
  background: rgba(14, 164, 107, 0.1);
}
.v5-hpb-title {
  font-size: 18px;
  font-weight: 800;
  color: var(--text, #0f172a);
  margin: 0 0 8px 0;
  letter-spacing: -0.01em;
}
.v5-hpb-quote {
  font-size: 13.5px;
  font-style: italic;
  color: var(--text-secondary, #334155);
  margin: 0 0 14px 0;
  line-height: 1.5;
  padding-left: 10px;
  border-left: 2px solid rgba(14, 164, 107, 0.3);
}
.v5-hpb-quote cite {
  font-style: normal;
  font-weight: 600;
  color: var(--text-muted, #64748b);
  font-size: 12px;
}
.v5-hpb-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}
.v5-hpb-trail-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 700;
  color: #ffffff;
  background: linear-gradient(135deg, #0ea46b, #059669);
  border: none;
  border-radius: 10px;
  padding: 8px 16px;
  cursor: pointer;
  box-shadow: 0 2px 10px rgba(14, 164, 107, 0.3);
  transition: transform 0.15s, box-shadow 0.15s;
}
.v5-hpb-trail-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(14, 164, 107, 0.4);
}
.v5-hpb-trail-ico {
  width: 16px;
  height: 16px;
}
.v5-pcard-trail {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 600;
  color: var(--primary, #0ea46b);
  margin-top: 6px;
  padding-top: 6px;
  border-top: 1px dashed rgba(100, 116, 139, 0.2);
}

/* Thème sombre pour le bandeau d'accueil */
html[data-theme="dark"] .v5-home-profile-banner {
  background: linear-gradient(135deg, rgba(22, 32, 27, 0.95), rgba(17, 26, 21, 0.92));
  border-color: #27372f;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.25);
}
html[data-theme="dark"] .v5-hpb-title {
  color: #f8fafc;
}
html[data-theme="dark"] .v5-hpb-quote {
  color: #cbd5e1;
}
html[data-theme="dark"] .v5-hpb-badge {
  color: #94a3b8;
}


