/* Calculateur « Ta vie » (life.js) : la scène de dialogue de l'app (ciel, sol blanc, Smartr sur son ombre), puis la grille. */
.life {
  --lf-sky: #ECF4F9; --lf-ground: #FEFEFE; --lf-card: #FEFEFE; --lf-ink: #111014; --lf-text2: rgba(17,16,20,.62); --lf-line: rgba(17,16,20,.10);
  --lf-blue: #1F6BFF; --lf-blue-a: #4D8DFF; --lf-blue-b: #1450D8; --lf-pale: #E2ECFF; --lf-lived: #E8ECF1; --lf-off: #E6E9EE; --lf-off-text: #9AA1AC;
  --lf-shadow: rgba(17,16,20,.10);
  --lf-display: "Dongle", "Epilogue", -apple-system, sans-serif; --lf-body: "Epilogue", -apple-system, "Segoe UI", Roboto, sans-serif;
  position: relative; color: var(--lf-ink); font-family: var(--lf-body); scroll-margin-top: 100px;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .life {
    --lf-sky: #11162C; --lf-ground: #1B1F33; --lf-card: #15151F; --lf-ink: #F5F5F7; --lf-text2: rgba(235,235,245,.7); --lf-line: rgba(255,255,255,.10);
    --lf-pale: rgba(91,147,255,.18); --lf-lived: #2C3040; --lf-off: #2A2D3A; --lf-off-text: #6E7383; --lf-shadow: rgba(0,0,0,.45);
  }
}
:root[data-theme="dark"] .life {
  --lf-sky: #11162C; --lf-ground: #1B1F33; --lf-card: #15151F; --lf-ink: #F5F5F7; --lf-text2: rgba(235,235,245,.7); --lf-line: rgba(255,255,255,.10);
  --lf-pale: rgba(91,147,255,.18); --lf-lived: #2C3040; --lf-off: #2A2D3A; --lf-off-text: #6E7383; --lf-shadow: rgba(0,0,0,.45);
}

/* ── Scène des questions ── */
.lf-scene {
  --ground: 112px;
  position: relative; overflow: hidden; display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, .75fr);
  grid-template-areas: "top stage" "say stage" "ctrl stage" "act stage"; grid-template-rows: auto auto 1fr auto;
  min-height: 540px; padding: 24px 32px 28px; border-radius: 32px; background: var(--lf-sky);
  border: 1px solid var(--lf-line); box-shadow: 0 24px 50px -30px var(--lf-shadow);
}
.lf-scene[hidden] { display: none; }
/* Le sol blanc, comme dans l'app : un horizon net, Smartr flotte au-dessus de son ombre. */
.lf-scene::before { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: var(--ground); background: linear-gradient(180deg, var(--lf-sky) 0, var(--lf-ground) 18px); }
.lf-body { display: contents; }
.lf-top { grid-area: top; position: relative; display: flex; align-items: center; gap: 16px; }
.lf-back { width: 44px; height: 44px; border-radius: 50%; border: 1px solid var(--lf-line); background: var(--lf-card); color: var(--lf-ink); display: grid; place-items: center; cursor: pointer; }
.lf-back svg, .lf-next svg { width: 22px; height: 22px; }
.lf-dots { display: flex; gap: 6px; }
.lf-dots span { width: 8px; height: 8px; border-radius: 8px; background: var(--lf-ink); opacity: .16; transition: width .3s ease, opacity .3s ease; }
.lf-dots span.done { opacity: .45; }
.lf-dots span.on { width: 24px; opacity: 1; }

.lf-say { grid-area: say; position: relative; margin-top: 32px; max-width: 560px; }
.life .lf-say p { color: var(--lf-ink); }
.lf-say p { margin: 0; font: 400 clamp(44px, 4.6vw, 56px)/.82 var(--lf-display); text-wrap: balance; }
.lf-say p.lf-t { font-weight: 700; }
.lf-say p + p { margin-top: 10px; }
.lf-ch { opacity: 0; transition: opacity .12s linear; }
.lf-ch.on { opacity: 1; }

.lf-ctrl { grid-area: ctrl; position: relative; align-self: center; padding-block: 24px; }
.lf-actions { grid-area: act; position: relative; z-index: 1; }
.lf-ctrl, .lf-actions { opacity: 0; transform: translateY(10px); transition: opacity .45s ease, transform .55s cubic-bezier(.16,1,.3,1); }
.lf-scene.ready .lf-ctrl, .lf-scene.ready .lf-actions { opacity: 1; transform: none; }

/* Champ de l'âge : un grand chiffre, comme le champ en ligne de l'app. */
.lf-field input { width: 3.2ch; padding: 0 4px; border: 0; border-bottom: 3px solid var(--lf-ink); background: transparent; color: var(--lf-ink);
  font: 700 120px/.9 var(--lf-display); font-variant-numeric: tabular-nums; outline: none; }
.lf-field input::placeholder { color: var(--lf-ink); opacity: .18; }
.lf-field input:focus-visible { border-bottom-color: var(--lf-blue); }
.lf-err { min-height: 22px; margin: 8px 0 0; font-weight: 600; font-size: 15px; color: #D92D20; }

/* Roue des heures : la valeur du milieu sur une bande blanche (TimeWheel de l'app). */
.lf-wheel { position: relative; max-width: 520px; height: 96px; border-radius: 24px; outline: none; }
.lf-wheel:focus-visible { box-shadow: 0 0 0 3px var(--lf-blue); }
.lf-band { position: absolute; left: 50%; top: 8px; width: 104px; height: 80px; margin-left: -52px; border-radius: 20px; background: var(--lf-card); box-shadow: 0 10px 24px -12px var(--lf-shadow); }
.lf-track { position: relative; display: flex; height: 100%; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; cursor: grab;
  -webkit-mask: linear-gradient(90deg, transparent, #000 22%, #000 78%, transparent); mask: linear-gradient(90deg, transparent, #000 22%, #000 78%, transparent); }
.lf-track.drag { scroll-snap-type: none; cursor: grabbing; }
.lf-track::-webkit-scrollbar { display: none; }
.lf-pad { flex: 0 0 calc(50% - 52px); }
.lf-v { flex: 0 0 104px; scroll-snap-align: center; border: 0; background: none; padding: 6px 0 0; color: var(--lf-ink); cursor: pointer; white-space: nowrap;
  font: 700 48px/1 var(--lf-display); font-variant-numeric: tabular-nums; letter-spacing: -.02em; transition: color .2s ease; user-select: none; }
.lf-v.on { color: var(--lf-blue); }

/* Bouton « Suivant » : la flèche seule, pilule noire (disabled = gris, texte gris). */
.lf-next { display: inline-flex; align-items: center; justify-content: center; width: 222px; height: 56px; border: 0; border-radius: 999px; cursor: pointer;
  background: var(--lf-ink); color: var(--lf-ground); box-shadow: 0 10px 22px -8px var(--lf-shadow); transition: transform .15s ease, background .2s ease; }
.lf-next:hover:not(:disabled) { transform: translateY(-2px); }
.lf-next:disabled { background: var(--lf-off); color: var(--lf-off-text); box-shadow: none; cursor: default; }
.lf-next:focus-visible, .lf-back:focus-visible, .lf-again:focus-visible, .lf-play:focus-visible { outline: 3px solid var(--lf-blue); outline-offset: 3px; }

.lf-stage { grid-area: stage; position: relative; display: flex; align-items: flex-end; justify-content: center; padding-bottom: calc(var(--ground) - 34px); }
.lf-smartr { width: min(100%, 230px); height: auto; }
.lf-smartr.hop, .lf-psmartr.hop { animation: lf-hop .6s cubic-bezier(.34,1.56,.64,1); }
@keyframes lf-hop { 0% { transform: translateY(14px) scale(.9); } 100% { transform: none; } }

/* ── Résultat : la grille à gauche, le compteur et le curseur à droite ── */
.lf-result.in { animation: lf-in .6s cubic-bezier(.16,1,.3,1) both; }
@keyframes lf-in { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }
.lf-say-res { margin: 0 auto 24px; max-width: 760px; text-align: center; }
.lf-res { display: grid; grid-template-columns: minmax(0, 1fr) minmax(300px, 360px); gap: 24px; align-items: start; }
.lf-gridcard, .lf-panel { background: var(--lf-card); border: 1px solid var(--lf-line); border-radius: 28px; box-shadow: 0 24px 50px -30px var(--lf-shadow); }
.lf-gridcard { padding: 24px 20px; display: flex; justify-content: center; min-width: 0; }
.lf-canvas { display: block; max-width: 100%; }
.lf-panel { position: sticky; top: 100px; padding: 24px; text-align: center; }
.lf-psmartr { display: block; width: 104px; height: auto; margin: -8px auto 0; }
.lf-count { display: flex; justify-content: center; align-items: baseline; gap: 8px; margin-top: 4px; color: var(--lf-blue); }
.lf-odo { display: inline-flex; font: 700 112px/.8 var(--lf-display); font-variant-numeric: tabular-nums; }
.lf-dg { display: inline-block; height: .8em; overflow: hidden; }
.lf-strip { display: flex; flex-direction: column; transition: transform .7s cubic-bezier(.2,.9,.2,1); }
.lf-strip span { display: block; height: .8em; line-height: .8; }
.lf-sep { line-height: .8; }
.lf-unit { font: 700 44px/.8 var(--lf-display); }
.lf-won { margin: 8px 0 0; font-weight: 600; color: var(--lf-text2); }
.lf-less { display: flex; justify-content: space-between; gap: 12px; margin-top: 24px; font-weight: 700; font-size: 15px; text-align: left; }
.lf-less output { color: var(--lf-blue); font-variant-numeric: tabular-nums; white-space: nowrap; }
.lf-range { -webkit-appearance: none; appearance: none; display: block; width: 100%; height: 12px; margin: 16px 0 0; border-radius: 999px; cursor: pointer;
  background: linear-gradient(90deg, var(--lf-blue-a), var(--lf-blue-b)) 0 / var(--fill, 0%) 100% no-repeat, var(--lf-pale); }
.lf-range::-webkit-slider-thumb { -webkit-appearance: none; width: 34px; height: 34px; border-radius: 50%; background: #fff; border: 3px solid var(--lf-blue); box-shadow: 0 6px 16px var(--lf-shadow); cursor: grab; }
.lf-range::-moz-range-thumb { width: 28px; height: 28px; border-radius: 50%; background: #fff; border: 3px solid var(--lf-blue); box-shadow: 0 6px 16px var(--lf-shadow); cursor: grab; }
.lf-range:focus-visible { outline: 3px solid var(--lf-blue); outline-offset: 6px; }
.lf-phone { margin: 16px 0 0; font-size: 15px; line-height: 1.5; color: var(--lf-text2); }
.lf-phone b { color: var(--lf-ink); }
.lf-legt { margin: 24px 0 8px; padding-top: 20px; border-top: 1px solid var(--lf-line); font: 700 34px/.8 var(--lf-display); text-align: left; }
.lf-legend { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; text-align: left; font-size: 15px; }
.lf-legend li { display: grid; grid-template-columns: 14px minmax(0, 1fr) auto; align-items: center; gap: 10px; }
.lf-legend i { width: 14px; height: 14px; border-radius: 4px; }
.lf-legend b { font-variant-numeric: tabular-nums; transition: color .3s ease; }
.lf-acts { display: flex; flex-direction: column; align-items: center; gap: 12px; margin-top: 24px; }
.lf-play { display: inline-flex; align-items: center; gap: 12px; height: 58px; padding: 0 26px 0 22px; border-radius: 999px; background: #111014; color: #fff; text-decoration: none; text-align: left;
  box-shadow: 0 10px 22px -8px var(--lf-shadow); transition: transform .15s ease; }
.lf-play:hover { transform: translateY(-2px); }
.lf-play svg { width: 28px; height: 28px; }
.lf-play span { display: flex; flex-direction: column; font: 700 19px/1.1 var(--lf-body); }
.lf-play small { font-size: 12px; font-weight: 500; opacity: .85; }
.lf-again { border: 0; background: none; padding: 8px; color: var(--lf-text2); font: 600 15px/1 var(--lf-body); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.lf-note { margin: 16px auto 0; max-width: 70ch; text-align: center; font-size: 13px; line-height: 1.5; color: var(--lf-text2); }

@media (max-width: 860px) {
  .lf-res { grid-template-columns: minmax(0, 1fr); }
  .lf-panel { position: static; }
}
/* Téléphone : le texte, le choix, Smartr sur le sol, puis le bouton. */
@media (max-width: 640px) {
  .lf-scene { --ground: 132px; grid-template-columns: minmax(0, 1fr); grid-template-areas: "top" "say" "ctrl" "stage" "act"; grid-template-rows: auto auto auto 1fr auto;
    min-height: 0; padding: 20px 20px 24px; border-radius: 28px; }
  .lf-say { margin-top: 24px; }
  .lf-say p { font-size: 44px; }
  .lf-ctrl { padding-block: 16px 0; }
  .lf-field input { font-size: 96px; }
  .lf-stage { padding-bottom: 0; margin-bottom: 4px; }
  .lf-smartr { width: 128px; }
  .lf-actions { display: flex; justify-content: center; padding-top: 0; }
  .lf-gridcard { padding: 16px 12px; border-radius: 24px; }
  .lf-panel { padding: 20px; border-radius: 24px; }
  .lf-odo { font-size: 96px; }
}
@media (prefers-reduced-motion: reduce) {
  .lf-ctrl, .lf-actions, .lf-ch, .lf-strip { transition: none; }
  .lf-smartr.hop, .lf-psmartr.hop, .lf-result.in { animation: none; }
}
/* Page « Ta vie » : colonne étroite, la grille prend toute la largeur et le panneau passe dessous. */
.life-page .lf-res { grid-template-columns: minmax(0, 1fr); }
.life-page .lf-panel { position: static; }

/* Unité sous la roue (par semaine, par jour). */
.lf-wunit { margin: 8px 0 0; max-width: 520px; text-align: center; font-weight: 600; font-size: 15px; color: var(--lf-text2); }
/* Grille : légende du moment (visite guidée), bulle au survol d'une case, petite aide dessous. */
.lf-gridcard { position: relative; flex-direction: column; align-items: center; }
.lf-cap { display: flex; align-items: center; gap: 10px; min-height: 44px; margin: 0 auto 12px; padding: 8px 16px; border-radius: 999px; background: var(--lf-pale);
  font-size: 15px; opacity: 0; transform: translateY(6px); transition: opacity .3s ease, transform .4s cubic-bezier(.16,1,.3,1); }
.lf-cap.on { opacity: 1; transform: none; }
.lf-cap i, .lf-tip i { width: 14px; height: 14px; border-radius: 4px; flex: none; }
.lf-cap span { color: var(--lf-text2); }
.lf-tip { position: absolute; z-index: 2; display: grid; gap: 2px; min-width: 132px; padding: 10px 14px; border-radius: 14px; background: var(--lf-ink); color: var(--lf-ground);
  font-size: 14px; line-height: 1.35; text-align: center; pointer-events: none; transform: translate(-50%, calc(-100% - 10px)); opacity: 0; transition: opacity .15s ease; }
.lf-tip.on { opacity: 1; }
.lf-tip-age { font-size: 13px; opacity: .7; }
.lf-tip-cat { display: flex; align-items: center; justify-content: center; gap: 8px; }
.lf-tip-h:empty { display: none; }
.lf-hint { margin: 12px 0 0; font-size: 13px; color: var(--lf-text2); }
.lf-canvas { cursor: crosshair; touch-action: pan-y; }
/* Légende : chaque ligne isole sa couleur dans la grille. */
.lf-legend button { display: grid; grid-template-columns: 14px minmax(0, 1fr) auto; align-items: center; gap: 10px; width: 100%; padding: 6px 8px; margin: 0; box-sizing: border-box;
  border: 0; border-radius: 10px; background: none; color: inherit; font: inherit; text-align: left; cursor: pointer; }
.lf-legend button:hover, .lf-legend button:focus-visible { background: var(--lf-pale); outline: none; }
.lf-legend li { display: block; }
.lf-legend { gap: 2px; margin-inline: -8px; }
.lf-less output { font: 700 40px/.7 var(--lf-display); }
/* Temps libre face aux années qui restent jusqu'à 80 ans. */
.lf-free { margin-top: 24px; padding-top: 20px; border-top: 1px solid var(--lf-line); text-align: left; }
.lf-free-t { margin: 0; font-size: 16px; line-height: 1.45; color: var(--lf-text2); }
.lf-free-t b { font: 700 34px/.8 var(--lf-display); color: var(--lf-ink); }
.lf-bar { height: 14px; margin-top: 12px; border-radius: 999px; background: var(--lf-pale); overflow: hidden; }
.lf-bar i { display: block; height: 100%; border-radius: 999px; background: #FFC93C; transition: width .6s cubic-bezier(.2,.9,.2,1); }
.lf-phone:empty { display: none; }
/* Bouton bleu personnalisé : « Récupérer mes 4,6 ans » (vers Google Play). */
.lf-cta { display: inline-flex; align-items: center; justify-content: center; min-width: 222px; max-width: 100%; height: 56px; padding: 0 28px; border-radius: 999px;
  background: linear-gradient(180deg, var(--lf-blue-a), var(--lf-blue-b)); color: #fff; font: 700 17px/1 var(--lf-body); text-decoration: none; white-space: nowrap;
  box-shadow: 0 10px 22px -8px var(--lf-shadow); transition: transform .15s ease, filter .15s ease; }
.lf-cta:hover { transform: translateY(-2px); filter: brightness(1.06); }
.lf-cta:focus-visible { outline: 3px solid var(--lf-blue); outline-offset: 3px; }
