:root {
  --fond: #F3EFE4;
  --fond-2: #E9E3D3;
  --carte: #FFFDF8;
  --texte: #1E2D25;
  --doux: #5C6C61;
  --bord: #DDD5C2;
  --sauge: #8DB596;
  --foret: #2F5D46;
  --foret-fonce: #244A37;
  --menthe: #E1ECE2;
  --or: #B8901A;
  --or-clair: #F6EDCC;
  --alerte: #B86E0B;
  --ombre: 0 1px 2px rgba(30, 45, 37, .06), 0 6px 20px rgba(30, 45, 37, .07);
  --rayon: 14px;
  --serif: ui-serif, "New York", "Iowan Old Style", Georgia, "Times New Roman", serif;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --fond: #111915; --fond-2: #0C130F; --carte: #19241E; --texte: #E8EFE9; --doux: #9DB1A4;
    --bord: #2B3B32; --sauge: #7FB08F; --foret: #5FAE84; --foret-fonce: #4C9670; --menthe: #213429;
    --or: #E0BE4F; --or-clair: #3A321A; --alerte: #E9A24A;
    --ombre: 0 1px 2px rgba(0,0,0,.3), 0 8px 24px rgba(0,0,0,.25);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --fond: #111915; --fond-2: #0C130F; --carte: #19241E; --texte: #E8EFE9; --doux: #9DB1A4;
  --bord: #2B3B32; --sauge: #7FB08F; --foret: #5FAE84; --foret-fonce: #4C9670; --menthe: #213429;
  --or: #E0BE4F; --or-clair: #3A321A; --alerte: #E9A24A;
  color-scheme: dark;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--sans);
  color: var(--texte);
  background: var(--fond);
  background-image:
    radial-gradient(1200px 500px at 110% -10%, color-mix(in srgb, var(--sauge) 22%, transparent), transparent 60%),
    radial-gradient(900px 500px at -20% 30%, color-mix(in srgb, var(--or) 8%, transparent), transparent 60%);
  background-attachment: fixed;
  line-height: 1.45;
  -webkit-tap-highlight-color: transparent;
}
.page {
  max-width: 560px;
  margin: 0 auto;
  padding: calc(env(safe-area-inset-top) + 14px) 16px calc(env(safe-area-inset-bottom) + 28px);
  display: flex; flex-direction: column; gap: 14px;
}

/* En-tête */
.entete { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 4px 2px; }
.marque { display: flex; align-items: center; gap: 11px; min-width: 0; }
.logo { width: 42px; height: 42px; flex: none; }
h1 { font-family: var(--serif); font-size: 1.45rem; font-weight: 600; margin: 0; letter-spacing: -.01em; }
.sous-titre { margin: 0; font-size: .84rem; color: var(--doux); }

/* Cartes */
.carte {
  background: var(--carte);
  border: 1px solid var(--bord);
  border-radius: var(--rayon);
  box-shadow: var(--ombre);
  padding: 16px;
}
.titre-carte { font-family: var(--serif); font-size: 1.1rem; font-weight: 600; margin: 0 0 12px; }

/* Icônes en trait */
svg:not(.logo):not(.anneau) { fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* Boutons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font: inherit; font-weight: 600; font-size: .98rem;
  min-height: 46px; padding: 10px 16px;
  border-radius: 11px; border: 1.5px solid transparent;
  cursor: pointer; text-decoration: none; text-align: center;
  transition: transform .08s ease, background-color .15s ease, border-color .15s ease;
}
.btn svg { width: 20px; height: 20px; flex: none; }
.btn:active { transform: scale(.98); }
.btn-plein { background: var(--foret); color: #fff; border-color: var(--foret-fonce); box-shadow: 0 2px 6px color-mix(in srgb, var(--foret) 35%, transparent); }
.btn-plein:hover { background: var(--foret-fonce); }
.btn-plein svg[viewBox] path[d^="M8 5.5"] { fill: currentColor; }
:root[data-theme="dark"] .btn-plein, .btn-plein { color: #fff; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .btn-plein { color: #0E1A13; } }
.btn-contour { background: var(--carte); color: var(--foret); border-color: color-mix(in srgb, var(--foret) 45%, var(--bord)); }
.btn-contour:hover { background: var(--menthe); }
.btn-arret { background: var(--carte); color: var(--alerte); border-color: color-mix(in srgb, var(--alerte) 55%, var(--bord)); }
.btn-arret:hover { background: color-mix(in srgb, var(--alerte) 10%, var(--carte)); }
.btn-lien { background: none; border: none; color: var(--doux); font-weight: 500; text-decoration: underline; min-height: 40px; }
.btn-petit { min-height: 38px; padding: 6px 12px; font-size: .88rem; }
.btn-grand { min-height: 56px; font-size: 1.06rem; }
.btn-rond { width: 52px; height: 52px; padding: 0; font-size: 1.5rem; border-radius: 50%; }
.btn:focus-visible, .bascule-btn:focus-visible, .formule:focus-visible, .horaire:focus-visible, .raccourci:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--foret) 45%, transparent); outline-offset: 2px;
}

/* Bascule Intermittent / Long */
.bascule { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 12px; }
.bascule-btn {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  font: inherit; font-weight: 600; min-height: 48px; border-radius: 11px; cursor: pointer;
  background: var(--carte); color: var(--texte); border: 1.5px solid var(--bord);
}
.bascule-btn svg { width: 20px; height: 20px; }
.bascule-btn[aria-selected="true"] { background: var(--foret); border-color: var(--foret-fonce); color: #fff; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .bascule-btn[aria-selected="true"] { color: #0E1A13; } }

/* Formules */
.formules { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.formule {
  font: inherit; cursor: pointer; text-align: center;
  padding: 10px 6px; border-radius: 11px; min-height: 64px;
  background: var(--fond); border: 1.5px solid var(--bord); color: var(--texte);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
}
.formule b { font-size: 1.08rem; font-variant-numeric: tabular-nums; }
.formule small { font-size: .74rem; color: var(--doux); line-height: 1.2; }
.formule:hover { border-color: color-mix(in srgb, var(--foret) 50%, var(--bord)); }
.formule[aria-pressed="true"] { background: var(--menthe); border-color: var(--foret); box-shadow: inset 0 0 0 1px var(--foret); }
.formule[aria-pressed="true"] b { color: var(--foret); }

/* Chrono */
.carte-chrono { padding-top: 20px; }
.anneau-zone { position: relative; width: min(100%, 300px); aspect-ratio: 1; margin: 0 auto; }
.anneau { width: 100%; height: 100%; display: block; }
.anneau-fond { fill: none; stroke: var(--menthe); stroke-width: 14; }
.anneau-progres { fill: none; stroke: url(#degrade); stroke-width: 14; stroke-linecap: round; transition: stroke-dashoffset .6s ease; }
.anneau-progres.atteint { stroke: url(#degradOr); }
.repere { fill: var(--carte); stroke: var(--sauge); stroke-width: 2; }
.repere.passe { fill: var(--sauge); }
.anneau-centre {
  position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center; padding: 0 18%;
}
.anneau-centre p { margin: 0; }
.etiquette { font-size: .82rem; color: var(--doux); text-transform: uppercase; letter-spacing: .08em; font-weight: 600; }
.temps { font-size: clamp(2rem, 11vw, 2.6rem); font-weight: 700; font-variant-numeric: tabular-nums; letter-spacing: -.02em; margin: 4px 0 2px !important; }
.reste { font-size: .95rem; color: var(--texte); font-weight: 500; }
.pourcent { font-size: .82rem; color: var(--foret); font-weight: 700; margin-top: 4px !important; min-height: 1.2em; }

.bandeau-bravo {
  display: flex; align-items: center; gap: 10px; margin: 12px 0 0;
  padding: 10px 12px; border-radius: 11px;
  background: var(--or-clair); color: var(--texte); border: 1px solid color-mix(in srgb, var(--or) 45%, transparent);
  font-weight: 600;
}
.bandeau-bravo svg { width: 22px; height: 22px; color: var(--or); stroke-width: 2.6; flex: none; }

.horaires { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 16px 0 14px; }
.horaire {
  display: flex; flex-direction: column; align-items: flex-start; gap: 2px; text-align: left;
  font: inherit; color: var(--texte);
  padding: 10px 12px; border-radius: 11px; background: var(--fond); border: 1.5px solid var(--bord);
}
button.horaire { cursor: pointer; }
button.horaire:hover { border-color: color-mix(in srgb, var(--foret) 50%, var(--bord)); }
button.horaire:disabled { cursor: default; }
button.horaire:disabled .horaire-action { visibility: hidden; }
.horaire-titre { font-size: .76rem; text-transform: uppercase; letter-spacing: .07em; color: var(--doux); font-weight: 600; }
.horaire-valeur { font-size: 1.02rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.horaire-action { display: inline-flex; align-items: center; gap: 4px; font-size: .82rem; color: var(--foret); font-weight: 600; }
.horaire-action svg { width: 14px; height: 14px; }
.horaire-note { font-size: .82rem; color: var(--doux); }

.actions { display: flex; flex-direction: column; gap: 10px; }

/* Étapes */
.etape-actuelle {
  display: flex; gap: 12px; align-items: flex-start;
  padding: 12px; border-radius: 12px; background: var(--menthe); margin-bottom: 14px;
}
.etape-actuelle .emoji { font-size: 1.6rem; line-height: 1; }
.etape-actuelle strong { display: block; font-size: 1rem; }
.etape-actuelle span { font-size: .9rem; color: var(--doux); }
.frise { list-style: none; margin: 0; padding: 0; position: relative; }
.frise::before { content: ""; position: absolute; left: 11px; top: 8px; bottom: 8px; width: 2px; background: var(--bord); }
.frise li { position: relative; display: grid; grid-template-columns: 24px 54px 1fr; gap: 8px; align-items: baseline; padding: 7px 0; }
.frise .point { width: 12px; height: 12px; border-radius: 50%; margin-left: 6px; background: var(--carte); border: 2px solid var(--bord); position: relative; top: 1px; }
.frise .heure { font-size: .82rem; color: var(--doux); font-weight: 600; font-variant-numeric: tabular-nums; }
.frise .nom { font-size: .93rem; }
.frise li.passe .point { background: var(--sauge); border-color: var(--sauge); }
.frise li.actuelle .point { background: var(--foret); border-color: var(--foret); box-shadow: 0 0 0 4px color-mix(in srgb, var(--foret) 22%, transparent); }
.frise li.actuelle .nom { font-weight: 700; }
.frise li.avenir .nom { color: var(--doux); }
.mention { font-size: .8rem; color: var(--doux); margin: 12px 0 0; }

/* Conseils */
.conseils { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.conseils li { display: flex; gap: 12px; align-items: flex-start; font-size: .92rem; }
.conseils .pastille { width: 36px; height: 36px; flex: none; border-radius: 10px; background: var(--fond); border: 1px solid var(--bord); display: grid; place-items: center; font-size: 1.1rem; }
.conseils div { color: var(--doux); }
.conseils strong { color: var(--texte); }

/* Suivi */
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-bottom: 12px; }
.stat { background: var(--fond); border: 1px solid var(--bord); border-radius: 11px; padding: 10px 6px; text-align: center; }
.stat b { display: block; font-size: 1.12rem; font-variant-numeric: tabular-nums; }
.stat span { font-size: .72rem; color: var(--doux); line-height: 1.2; display: block; }
.historique { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.historique li { display: flex; align-items: center; gap: 10px; padding: 10px 10px 10px 12px; border-radius: 11px; border: 1px solid var(--bord); }
.historique .badge { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; flex: none; background: var(--menthe); color: var(--foret); }
.historique .badge.ok { background: var(--or-clair); color: var(--or); }
.historique .badge svg { width: 17px; height: 17px; stroke-width: 2.6; }
.historique .infos { flex: 1; min-width: 0; }
.historique .infos b { display: block; font-variant-numeric: tabular-nums; }
.historique .infos span { font-size: .82rem; color: var(--doux); }
.historique .suppr { width: 38px; height: 38px; border-radius: 10px; border: 1px solid var(--bord); background: var(--carte); color: var(--doux); cursor: pointer; display: grid; place-items: center; flex: none; }
.historique .suppr svg { width: 16px; height: 16px; }
.historique .vide { justify-content: center; color: var(--doux); font-size: .92rem; border-style: dashed; }

.pied { text-align: center; font-size: .8rem; color: var(--doux); padding: 4px 10px 0; }
.pied p { margin: 4px 0; }

/* Fenêtres */
.fenetre {
  border: none; padding: 0; background: transparent; color: var(--texte);
  width: min(100% - 24px, 440px); max-height: calc(100% - 24px);
}
.fenetre::backdrop { background: rgba(14, 22, 17, .45); }
.fenetre-corps {
  background: var(--carte); border: 1px solid var(--bord); border-radius: 18px; padding: 20px 18px 16px;
  box-shadow: 0 20px 50px rgba(0,0,0,.25); display: flex; flex-direction: column; gap: 14px;
}
.fenetre h3 { font-family: var(--serif); font-size: 1.2rem; margin: 0; }
.fenetre-boutons { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 4px; }
.fenetre-boutons.colonne { grid-template-columns: 1fr; }
.fenetre-boutons:has(> :only-child) { grid-template-columns: 1fr; }
.raccourcis { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.raccourci {
  font: inherit; font-weight: 600; font-size: .9rem; cursor: pointer; min-height: 46px; padding: 6px;
  border-radius: 10px; background: var(--fond); border: 1.5px solid var(--bord); color: var(--texte);
}
.raccourci:hover { border-color: var(--foret); }
.raccourci[aria-pressed="true"] { background: var(--menthe); border-color: var(--foret); color: var(--foret); }
.champ { display: flex; flex-direction: column; gap: 6px; font-size: .88rem; color: var(--doux); }
.champ input, .compteur input {
  font: inherit; font-size: 1.02rem; color: var(--texte); background: var(--fond);
  border: 1.5px solid var(--bord); border-radius: 10px; padding: 11px 12px; min-height: 48px; width: 100%;
}
.champ input:focus, .compteur input:focus { outline: none; border-color: var(--foret); }
.erreur { margin: 0; color: var(--alerte); font-size: .88rem; font-weight: 600; }
.compteur { display: flex; align-items: center; justify-content: center; gap: 12px; }
.compteur-valeur { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.compteur-valeur input { width: 110px; text-align: center; font-size: 1.6rem; font-weight: 700; }
.compteur-valeur span { font-size: .82rem; color: var(--doux); }
.compteur-jours { text-align: center; margin: 0; color: var(--doux); font-size: .9rem; min-height: 1.3em; }
.resume-fin { margin: 0; color: var(--doux); }
.resume-fin strong { color: var(--texte); }
.install-bloc { display: flex; flex-direction: column; gap: 8px; padding-bottom: 12px; border-bottom: 1px solid var(--bord); }
.install-bloc:last-of-type { border-bottom: none; }
.install-titre { margin: 0; font-weight: 700; }
.install-etapes { margin: 0; padding-left: 20px; display: grid; gap: 6px; font-size: .93rem; }
.install-texte { margin: 0; font-size: .88rem; color: var(--doux); }
.ico-inline { width: 18px; height: 18px; vertical-align: -3px; color: var(--foret); }

/* ---------- Palettes à débloquer ---------- */
:root[data-palette="ocean"] { --foret: #1F4FD8; --foret-fonce: #17254A; --sauge: #7FA3D9; --menthe: #E1E9F7; }
:root[data-palette="lavande"] { --foret: #6A4FB3; --foret-fonce: #4E3A8A; --sauge: #A996D9; --menthe: #ECE6F7; }
:root[data-palette="soleil"] { --foret: #A87A12; --foret-fonce: #7E5B0C; --sauge: #D9B65A; --menthe: #F5ECD2; }
:root[data-palette="lagon"] { --foret: #11796F; --foret-fonce: #0C5A53; --sauge: #6CC0B4; --menthe: #DDF0ED; }
@media (prefers-color-scheme: dark) {
  :root[data-palette="ocean"]:not([data-theme="light"]) { --foret: #6E96F0; --foret-fonce: #5A82DE; --sauge: #8FAEE6; --menthe: #1C2840; }
  :root[data-palette="lavande"]:not([data-theme="light"]) { --foret: #A994EC; --foret-fonce: #937DDB; --sauge: #B8A8E8; --menthe: #2A2340; }
  :root[data-palette="soleil"]:not([data-theme="light"]) { --foret: #E0B84A; --foret-fonce: #CFA437; --sauge: #E6C877; --menthe: #3A311A; }
  :root[data-palette="lagon"]:not([data-theme="light"]) { --foret: #4CC3B4; --foret-fonce: #3AAE9F; --sauge: #7ED3C7; --menthe: #183632; }
}

/* ---------- En-tête : points ---------- */
.entete-droite { display: flex; align-items: center; gap: 8px; flex: none; }
.entete h1 { white-space: nowrap; }
@media (max-width: 430px) {
  .entete h1 { font-size: 1.22rem; }
  .entete .sous-titre { display: none; }
  .entete .logo { width: 38px; height: 38px; }
}
.puce-points {
  display: inline-flex; align-items: baseline; gap: 4px; cursor: pointer;
  font: inherit; color: var(--texte); background: var(--carte);
  border: 1.5px solid color-mix(in srgb, var(--or) 55%, var(--bord)); border-radius: 999px;
  padding: 7px 12px; min-height: 38px; box-shadow: var(--ombre);
}
.puce-points b { font-variant-numeric: tabular-nums; font-size: .98rem; }
.puce-points small { color: var(--doux); font-size: .74rem; }
.puce-points.pulse { animation: pulse .9s ease; }
@keyframes pulse { 0%,100% { transform: scale(1); } 40% { transform: scale(1.14); } }
.btn-icone { width: 40px; min-height: 40px; height: 40px; padding: 0; }

/* ---------- Vues et onglets ---------- */
.vue { display: flex; flex-direction: column; gap: 14px; }
.page { padding-bottom: calc(env(safe-area-inset-bottom) + 96px); }
.onglets {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 20;
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px;
  padding: 8px max(10px, calc(50% - 270px)) calc(env(safe-area-inset-bottom) + 8px);
  background: color-mix(in srgb, var(--carte) 88%, transparent);
  -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
  border-top: 1px solid var(--bord);
}
.onglet {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  font: inherit; font-size: .76rem; font-weight: 600; cursor: pointer; min-height: 54px;
  color: var(--doux); background: transparent; border: 1.5px solid transparent; border-radius: 12px;
}
.onglet svg { width: 23px; height: 23px; }
.onglet[aria-current="page"] { background: var(--foret); color: #fff; border-color: var(--foret-fonce); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .onglet[aria-current="page"] { color: #0E1A13; } }

/* ---------- Chrono : compléments ---------- */
.temps.bonus { color: var(--or); }
.anneau-centre { cursor: pointer; }
.sous-anneau { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-top: 10px; }
.puce-inverser {
  display: inline-flex; align-items: center; gap: 6px; cursor: pointer;
  font: inherit; font-size: .86rem; font-weight: 600; color: var(--foret);
  background: var(--menthe); border: 1.5px solid color-mix(in srgb, var(--foret) 35%, transparent);
  border-radius: 999px; padding: 7px 13px; min-height: 38px;
}
.puce-inverser svg { width: 17px; height: 17px; }
.puce-gain {
  display: inline-flex; align-items: center; gap: 5px; font-size: .86rem; font-weight: 700;
  color: var(--texte); background: var(--or-clair); border: 1.5px solid color-mix(in srgb, var(--or) 45%, transparent);
  border-radius: 999px; padding: 7px 13px; min-height: 38px;
}

/* ---------- Félicitations ---------- */
.fete {
  position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; padding: 20px;
  background: rgba(14, 22, 17, .5); -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px);
  animation: apparait .25s ease;
}
.fete-carte {
  position: relative; z-index: 2; width: min(100%, 400px); text-align: center;
  background: var(--carte); border: 1px solid var(--bord); border-radius: 22px;
  padding: 24px 20px 18px; box-shadow: 0 24px 60px rgba(0,0,0,.3);
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  animation: rebond .5s cubic-bezier(.2,1.4,.4,1);
}
.fete-emoji { font-size: 3.2rem; line-height: 1; margin-bottom: 4px; }
.fete h3 { font-family: var(--serif); font-size: 1.6rem; margin: 0; }
.fete-sous { margin: 0; font-weight: 600; color: var(--foret); font-size: 1.02rem; }
.fete-heures { margin: 6px 0 0; font-size: 2.1rem; font-weight: 800; font-variant-numeric: tabular-nums; letter-spacing: -.02em; }
.fete-message { margin: 4px 0 8px; color: var(--doux); font-size: .96rem; line-height: 1.5; }
.fete-points {
  font-weight: 800; font-size: 1.15rem; color: var(--texte);
  background: var(--or-clair); border: 1.5px solid color-mix(in srgb, var(--or) 50%, transparent);
  border-radius: 999px; padding: 6px 16px;
}
.fete-bonus { margin: 4px 0 0; font-size: .9rem; font-weight: 600; color: var(--or); }
.fete .btn { width: 100%; margin-top: 12px; }
.fete-pluie { position: absolute; inset: 0; overflow: hidden; pointer-events: none; z-index: 1; }
.fete-pluie span { position: absolute; top: -40px; font-size: 22px; animation: tombe linear forwards; }
@keyframes tombe { to { transform: translateY(110vh) rotate(540deg); opacity: .2; } }
@keyframes apparait { from { opacity: 0; } }
@keyframes rebond { from { transform: scale(.7); opacity: 0; } }

/* ---------- Petit message ---------- */
.toast {
  position: fixed; left: 50%; bottom: calc(env(safe-area-inset-bottom) + 92px); z-index: 40;
  transform: translateX(-50%); width: max-content; max-width: calc(100% - 32px);
  background: var(--texte); color: var(--fond); font-weight: 600; font-size: .94rem;
  padding: 11px 16px; border-radius: 12px; box-shadow: 0 10px 30px rgba(0,0,0,.25);
  animation: monte .3s ease;
}
@keyframes monte { from { transform: translate(-50%, 12px); opacity: 0; } }

/* ---------- Niveau ---------- */
.niveau-haut { display: flex; align-items: center; gap: 12px; }
.niveau-emoji { font-size: 2.4rem; width: 58px; height: 58px; display: grid; place-items: center; border-radius: 16px; background: var(--menthe); flex: none; }
.niveau-txt { flex: 1; min-width: 0; }
.niveau-txt p { margin: 0; }
.niveau-rang { font-size: .78rem; text-transform: uppercase; letter-spacing: .08em; color: var(--doux); font-weight: 700; }
.niveau-nom { font-family: var(--serif); font-size: 1.3rem; font-weight: 700; }
.niveau-solde { text-align: right; flex: none; }
.niveau-solde b { display: block; font-size: 1.5rem; font-variant-numeric: tabular-nums; color: var(--or); line-height: 1.1; }
.niveau-solde span { font-size: .74rem; color: var(--doux); }
.barre { height: 12px; border-radius: 99px; background: var(--menthe); margin: 14px 0 6px; overflow: hidden; }
.barre-plein { height: 100%; width: 0; border-radius: 99px; background: linear-gradient(90deg, var(--sauge), var(--foret)); transition: width .6s ease; }
.niveau-suite { margin: 0; font-size: .86rem; color: var(--doux); }
.regles { margin-top: 12px; border: 1.5px solid var(--bord); border-radius: 11px; background: var(--fond); }
.regles summary { cursor: pointer; display: flex; align-items: center; gap: 8px; padding: 11px 12px; font-weight: 600; color: var(--foret); list-style: none; min-height: 44px; }
.regles summary::-webkit-details-marker { display: none; }
.regles summary svg { width: 19px; height: 19px; }
.regles ul { margin: 0; padding: 0 14px 12px 30px; display: grid; gap: 7px; font-size: .9rem; color: var(--doux); }
.regles b { color: var(--texte); }

.titre-ligne { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.titre-ligne .titre-carte { margin-bottom: 12px; }
.compte { font-size: .84rem; color: var(--doux); font-weight: 600; }
.aide { margin: -4px 0 12px; font-size: .9rem; color: var(--doux); }

/* ---------- Jardin ---------- */
.jardin {
  position: relative; height: 210px; border-radius: 14px; overflow: hidden;
  background: linear-gradient(#CFE6F2, #EAF4EC 62%);
  border: 1px solid var(--bord);
}
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .jardin { background: linear-gradient(#16263A, #1C2E28 62%); } }
.jardin .sol { position: absolute; left: -10%; right: -10%; bottom: -40px; height: 130px; border-radius: 50% 50% 0 0; background: linear-gradient(#9CC98C, #6FA463); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .jardin .sol { background: linear-gradient(#3E6A43, #2B4D31); } }
.jardin .soleil { position: absolute; top: 10px; right: 14px; font-size: 1.8rem; }
.jardin .el { position: absolute; transform: translate(-50%, -100%); line-height: 1; user-select: none; }
.jardin .el.ciel { animation: flotte 4s ease-in-out infinite; }
@keyframes flotte { 50% { transform: translate(-50%, calc(-100% - 6px)); } }
.jardin .el.nouveau { animation: pousse .7s cubic-bezier(.2,1.5,.4,1); }
@keyframes pousse { from { transform: translate(-50%, -100%) scale(0); } }
.jardin-vide { position: absolute; left: 0; right: 0; top: 28%; margin: 0; text-align: center; font-size: .9rem; color: var(--doux); padding: 0 20px; }

/* ---------- Boutique ---------- */
.boutique { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.article {
  display: flex; flex-direction: column; align-items: center; gap: 2px; text-align: center;
  padding: 10px 6px 8px; border-radius: 12px; background: var(--fond); border: 1.5px solid var(--bord);
}
.article .em { font-size: 1.9rem; line-height: 1.2; }
.article .nom { font-size: .82rem; font-weight: 600; }
.article .possede { font-size: .72rem; color: var(--doux); min-height: 1.1em; }
.article .btn { min-height: 36px; padding: 5px 8px; font-size: .84rem; width: 100%; margin-top: 4px; gap: 4px; }
.article .btn:disabled { opacity: .55; cursor: not-allowed; box-shadow: none; }
.btn:disabled:active { transform: none; }

/* ---------- Couleurs ---------- */
.couleurs { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.couleur {
  display: flex; align-items: center; gap: 10px; padding: 10px; border-radius: 12px;
  background: var(--fond); border: 1.5px solid var(--bord); font: inherit; color: var(--texte); text-align: left; cursor: pointer;
}
.couleur[aria-pressed="true"] { border-color: var(--foret); box-shadow: inset 0 0 0 1px var(--foret); background: var(--menthe); }
.couleur .pastilles { display: flex; flex: none; }
.couleur .pastilles i { width: 20px; height: 20px; border-radius: 50%; border: 2px solid var(--carte); margin-left: -6px; }
.couleur .pastilles i:first-child { margin-left: 0; }
.couleur .txt { display: flex; flex-direction: column; min-width: 0; }
.couleur .txt b { font-size: .9rem; }
.couleur .txt small { font-size: .76rem; color: var(--doux); }
.couleur.bloque .txt small { color: var(--or); font-weight: 700; }

/* ---------- Récompenses perso ---------- */
.ajout-reco { display: grid; grid-template-columns: 1fr 92px 48px; gap: 8px; margin-bottom: 12px; }
.ajout-reco input {
  font: inherit; font-size: 1rem; color: var(--texte); background: var(--fond); min-width: 0;
  border: 1.5px solid var(--bord); border-radius: 10px; padding: 10px; min-height: 48px;
}
.ajout-reco input:focus { outline: none; border-color: var(--foret); }
.ajout-reco .btn { padding: 0; min-height: 48px; }
.recos { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.recos li { display: flex; align-items: center; gap: 10px; padding: 10px 10px 10px 12px; border-radius: 11px; border: 1px solid var(--bord); }
.recos .infos { flex: 1; min-width: 0; }
.recos .infos b { display: block; overflow-wrap: anywhere; }
.recos .infos span { font-size: .82rem; color: var(--doux); }
.recos .mini { height: 6px; border-radius: 9px; background: var(--menthe); margin-top: 5px; overflow: hidden; }
.recos .mini i { display: block; height: 100%; background: var(--or); border-radius: 9px; }
.recos .btn { min-height: 40px; padding: 6px 12px; font-size: .86rem; flex: none; }
.recos .vide, .historique .vide { justify-content: center; color: var(--doux); font-size: .9rem; border-style: dashed; text-align: center; }
.suppr { width: 38px; height: 38px; border-radius: 10px; border: 1px solid var(--bord); background: var(--carte); color: var(--doux); cursor: pointer; display: grid; place-items: center; flex: none; }
.suppr svg { width: 16px; height: 16px; }

/* ---------- Badges ---------- */
.badges { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.badge-item { display: flex; flex-direction: column; align-items: center; gap: 3px; text-align: center; padding: 10px 4px; border-radius: 12px; border: 1.5px solid var(--bord); background: var(--fond); }
.badge-item .em { font-size: 1.7rem; line-height: 1.1; }
.badge-item b { font-size: .74rem; line-height: 1.15; }
.badge-item small { font-size: .66rem; color: var(--doux); line-height: 1.2; }
.badge-item.bloque .em { filter: grayscale(1); opacity: .35; }
.badge-item.bloque b { color: var(--doux); }
.badge-item.obtenu { border-color: color-mix(in srgb, var(--or) 55%, var(--bord)); background: var(--or-clair); }

.points-ligne { font-size: .8rem; font-weight: 700; color: var(--or); white-space: nowrap; }

@media (max-width: 370px) {
  .formules, .raccourcis, .boutique { grid-template-columns: repeat(2, 1fr); }
  .stats, .badges { grid-template-columns: repeat(2, 1fr); }
  .sous-titre { display: none; }
}
@media (prefers-reduced-motion: reduce) { .fete-pluie, .jardin .el { animation: none !important; } }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
