/* Clock Champion — appli. Style « autocollant » : traits d'encre épais, ombres pleines décalées,
   couleurs et motifs donnés par le thème choisi (variables posées par themes.js). */
@font-face { font-family: 'Fredoka'; src: url('/assets/fonts/fredoka.woff2') format('woff2'); font-weight: 500 700; font-display: swap; }
@font-face { font-family: 'Nunito'; src: url('/assets/fonts/nunito.woff2') format('woff2'); font-weight: 400 800; font-display: swap; }

:root {
  --fond: #dff1ff; --panneau: #ffffff; --encre: #1d3557; --accent: #ff7a45; --accent2: #ffd166;
  --cadran: #fffdf7; --aig-h: #1d3557; --aig-m: #e63946; --encre-cadran: #1d3557;
  --ok: #1f9d55; --ko: #d64545; --trait: 3px; --ombre: 4px 4px 0 var(--encre);
  --r: 18px; --titre: 'Fredoka', 'Nunito', system-ui, sans-serif; --texte: 'Nunito', system-ui, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; max-width: 100%; overflow-x: hidden; }
body {
  font-family: var(--texte); color: var(--encre); background: var(--fond) var(--motif, none);
  background-size: 180px 180px; min-height: 100vh; min-height: 100dvh; -webkit-tap-highlight-color: transparent;
  transition: background-color .3s;
}
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
h1, h2, .titre-geant { font-family: var(--titre); line-height: 1.1; }
h1 { font-size: 1.7rem; margin: .4em 0 .5em; }
h2 { font-size: 1.15rem; margin: 1.4em 0 .5em; }
a { color: inherit; }
button { font: inherit; color: inherit; cursor: pointer; }
.ecran { width: 100%; max-width: 760px; margin: 0 auto; padding: 14px 16px 110px; padding-top: max(14px, env(safe-area-inset-top)); }
.e-jeu { max-width: 520px; padding-bottom: 24px; }
.attente { font-size: 3rem; text-align: center; padding: 30vh 0; animation: tourne 1.4s linear infinite; }
@keyframes tourne { to { transform: rotate(360deg); } }
.noscript { padding: 20px; }

/* ---------- Boutons ---------- */
.btn {
  display: inline-flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  background: var(--panneau); border: var(--trait) solid var(--encre); border-radius: 14px; box-shadow: var(--ombre);
  padding: 10px 18px; font-family: var(--titre); font-weight: 600; font-size: 1.05rem; transition: transform .08s, box-shadow .08s;
  text-decoration: none; min-height: 48px;
}
.btn:active { transform: translate(3px, 3px); box-shadow: 1px 1px 0 var(--encre); }
.btn:disabled { opacity: .55; cursor: default; }
.btn-accent { background: var(--accent); color: #fff; text-shadow: 0 1px 0 rgba(0, 0, 0, .25); }
.btn-large { width: 100%; font-size: 1.25rem; padding: 14px; }
.btn-gros { width: 100%; font-size: 1.3rem; padding: 16px; }
.btn-gros small { font-family: var(--texte); font-weight: 600; font-size: .85rem; opacity: .85; }
.btn-petit { font-size: .9rem; padding: 6px 12px; min-height: 38px; box-shadow: 2px 2px 0 var(--encre); border-width: 2px; }
.btn-danger { color: var(--ko); }
.btn-lien { background: none; border: 0; text-decoration: underline; font-weight: 700; padding: 8px; }
.btn-lien.danger { color: var(--ko); }
.btn-retour { background: none; border: 0; font-weight: 800; padding: 6px 0; font-size: 1rem; }
.btn-rond {
  width: 54px; height: 54px; border-radius: 50%; border: var(--trait) solid var(--encre); background: var(--accent2);
  box-shadow: var(--ombre); font-size: 1.5rem; display: inline-grid; place-items: center; flex: none;
}
.btn-rond:active { transform: translate(3px, 3px); box-shadow: none; }
.chip {
  border: 2px solid var(--encre); background: var(--panneau); border-radius: 999px; padding: 7px 13px; font-weight: 800; font-size: .92rem;
}
.chip.actif { background: var(--encre); color: var(--panneau); }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }

/* ---------- Panneaux et formulaires ---------- */
.panneau {
  background: var(--panneau); border: var(--trait) solid var(--encre); border-radius: var(--r); box-shadow: 6px 6px 0 var(--encre);
  padding: 16px 18px 22px; margin-top: 8px;
}
.etroit { max-width: 480px; margin-left: auto; margin-right: auto; }
.aide { font-size: 1rem; opacity: .9; }
.fine { font-size: .85rem; opacity: .8; }
.bas { text-align: center; margin: 12px 0 0; }
.champ { display: block; margin: 0 0 14px; }
.champ span { display: block; font-weight: 800; margin-bottom: 5px; }
.champ small { display: block; margin-top: 4px; opacity: .75; }
.champ input, .champ textarea, .ligne-btn input {
  width: 100%; font: inherit; font-size: 1.05rem; padding: 12px; border: 2px solid var(--encre); border-radius: 12px;
  background: #fff; color: #1b2433;
}
.form-erreur { color: var(--ko); font-weight: 800; min-height: 1.2em; margin: 6px 0; }
.ok-msg { background: #e3f7ea; border: 2px solid var(--ok); border-radius: 12px; padding: 12px; font-weight: 700; color: #14532d; }
.ligne-btn { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.ligne-btn input { flex: 1 1 180px; width: auto; }
.ligne-btn .form-erreur { flex-basis: 100%; }
.interrupteur { display: flex; gap: 12px; align-items: center; padding: 12px 0; border-bottom: 2px dashed rgba(0, 0, 0, .12); font-weight: 700; }
.interrupteur input { width: 26px; height: 26px; accent-color: var(--accent); flex: none; }
.case { display: flex; gap: 10px; align-items: flex-start; font-size: .95rem; margin: 10px 0; }
.case input { width: 24px; height: 24px; flex: none; accent-color: var(--accent); }

/* ---------- Accueil ---------- */
.accueil { text-align: center; padding-top: 10px; }
.accueil-horloge { width: min(62vw, 250px); margin: 0 auto; animation: flotte 4s ease-in-out infinite; }
@keyframes flotte { 50% { transform: translateY(-8px) rotate(-2deg); } }
.titre-geant { font-size: clamp(2rem, 8vw, 3rem); margin: .3em 0 .2em; }
.sous { font-size: 1.15rem; font-weight: 700; margin: 0 0 22px; }
.choix { display: grid; gap: 14px; max-width: 420px; margin: 0 auto; }
.lien-parents { display: inline-block; margin-top: 26px; font-weight: 800; }

/* ---------- Choix du joueur ---------- */
.profils { text-align: center; }
.profils-liste { display: flex; flex-wrap: wrap; gap: 18px; justify-content: center; margin: 20px 0; }
.profil { background: none; border: 0; display: grid; gap: 6px; justify-items: center; font-family: var(--titre); font-size: 1.2rem; }
.profil-avatar {
  width: 104px; height: 104px; border-radius: 50%; background: var(--panneau); border: var(--trait) solid var(--encre);
  box-shadow: var(--ombre); display: grid; place-items: center; font-size: 3.4rem;
}

/* ---------- Carte ---------- */
.bandeau-invite {
  display: flex; flex-wrap: wrap; gap: 8px; align-items: center; justify-content: space-between; background: var(--accent2);
  border: 2px solid var(--encre); border-radius: 14px; padding: 8px 12px; font-weight: 800; margin-bottom: 10px; color: #1b2433;
}
.entete { display: grid; grid-template-columns: auto 1fr auto; gap: 12px; align-items: center; }
.moi { display: flex; align-items: center; gap: 8px; background: none; border: 0; padding: 0; text-align: left; min-width: 0; }
.moi-avatar {
  width: 58px; height: 58px; border-radius: 50%; display: grid; place-items: center; font-size: 2rem; flex: none;
  background: var(--panneau); border: var(--trait) solid var(--encre); box-shadow: 3px 3px 0 var(--encre);
}
.moi-txt { display: grid; min-width: 0; }
.moi-txt b { font-family: var(--titre); font-size: 1.15rem; }
.moi-txt small { font-size: .8rem; font-weight: 700; opacity: .8; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rang { display: grid; gap: 3px; min-width: 0; }
.rang-nom { font-family: var(--titre); font-weight: 600; font-size: .95rem; }
.rang small { font-size: .75rem; font-weight: 700; opacity: .8; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.jauge { display: block; height: 12px; border: 2px solid var(--encre); border-radius: 999px; background: var(--panneau); overflow: hidden; }
.jauge i { display: block; height: 100%; background: var(--accent); border-radius: 999px; }
.flamme { font-size: 1.6rem; filter: grayscale(1); opacity: .5; display: grid; justify-items: center; line-height: 1; }
.flamme b { font-family: var(--titre); font-size: 1rem; }
.flamme.allumee { filter: none; opacity: 1; animation: flamme 1.6s ease-in-out infinite; }
@keyframes flamme { 50% { transform: scale(1.08) rotate(3deg); } }
.objectifs { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0; }
.puce { background: var(--panneau); border: 2px solid var(--encre); border-radius: 999px; padding: 4px 11px; font-size: .82rem; font-weight: 800; }
.puce-ok { background: #d9f7e3; color: #14532d; }

.onglets-exo { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 6px 0 12px; }
.onglet-exo {
  text-align: left; display: grid; grid-template-columns: auto 1fr; column-gap: 8px; align-items: center;
  background: var(--panneau); border: var(--trait) solid var(--encre); border-radius: 16px; padding: 10px 12px; opacity: .75;
}
.onglet-exo .onglet-ico { grid-row: span 2; font-size: 1.6rem; }
.onglet-exo b { font-family: var(--titre); font-size: 1.02rem; line-height: 1.15; }
.onglet-exo small { font-size: .74rem; line-height: 1.25; }
.onglet-exo.actif { opacity: 1; box-shadow: var(--ombre); background: var(--accent2); color: #1b2433; }
.chronos { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-bottom: 4px; }
.chronos-titre { font-weight: 800; margin-right: 4px; }

.monde { margin-top: 18px; }
.monde-tete { display: grid; grid-template-columns: auto 1fr; column-gap: 10px; align-items: baseline; }
.monde-badge {
  grid-row: span 2; font-family: var(--titre); font-weight: 700; background: var(--encre); color: var(--panneau);
  border-radius: 10px; padding: 4px 10px; transform: rotate(-4deg); align-self: center;
}
.monde-tete h2 { margin: 0; }
.monde-tete p { margin: 2px 0 0; font-size: .85rem; font-weight: 600; opacity: .85; }
/* Les étapes d'un monde forment un bracelet de montre : des cadrans reliés par une sangle */
.bracelet {
  position: relative; display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px 10px; margin-top: 12px; padding: 4px 2px;
}
.tuile {
  position: relative; aspect-ratio: 1; border-radius: 50%; border: var(--trait) solid var(--encre); background: var(--cadran);
  box-shadow: var(--ombre); display: grid; align-content: center; justify-items: center; gap: 1px; padding: 6px; color: var(--encre-cadran);
  transition: transform .1s;
}
.tuile:active { transform: scale(.95); }
.tuile::before, .tuile::after { /* attaches de la sangle */
  content: ''; position: absolute; top: 50%; width: 12px; height: 14px; background: var(--encre); transform: translateY(-50%); z-index: -1;
}
.tuile::before { left: -12px; } .tuile::after { right: -12px; }
.tuile-num { font-family: var(--titre); font-size: clamp(1.4rem, 6vw, 2rem); font-weight: 700; line-height: 1; }
.tuile-nom { font-weight: 800; font-size: clamp(.68rem, 2.6vw, .85rem); text-align: center; line-height: 1.1; }
.tuile-etoiles { color: #f2a900; font-size: clamp(.85rem, 3.4vw, 1.1rem); letter-spacing: 1px; -webkit-text-stroke: .5px var(--encre-cadran); }
.tuile-record { font-size: .64rem; font-weight: 800; opacity: .8; min-height: 1em; }
.tuile-ouvert { background: var(--accent2); color: #1b2433; animation: appel 2s ease-in-out infinite; }
@keyframes appel { 50% { transform: scale(1.04); } }
.tuile-fait { background: var(--cadran); }
.tuile-ferme { background: #e6e6e6; color: #666; box-shadow: 2px 2px 0 var(--encre); }
.tuile-premium { background: repeating-linear-gradient(45deg, #fff3c4 0 8px, #ffe596 8px 16px); color: #6b4d00; }

.menu-bas {
  position: fixed; left: 0; right: 0; bottom: 0; display: flex; justify-content: center; gap: 2px; z-index: 5;
  background: var(--panneau); border-top: var(--trait) solid var(--encre); padding: 6px 6px max(6px, env(safe-area-inset-bottom));
}
.menu-bas button {
  flex: 1 1 0; max-width: 130px; background: none; border: 0; display: grid; justify-items: center; font-size: .72rem; font-weight: 800; padding: 4px 2px;
}
.menu-bas span { font-size: 1.45rem; }

/* ---------- Jeu ---------- */
.jeu-haut { display: grid; grid-template-columns: auto 1fr auto; gap: 10px; align-items: center; }
.btn-quitter { width: 42px; height: 42px; border-radius: 50%; border: 2px solid var(--encre); background: var(--panneau); font-weight: 800; }
.progres { display: flex; gap: 4px; justify-content: center; }
.progres i { width: 100%; max-width: 22px; height: 12px; border-radius: 6px; border: 2px solid var(--encre); background: var(--panneau); }
.progres .p-ok { background: var(--ok); } .progres .p-ko { background: var(--ko); }
.progres .p-encours { background: var(--accent2); }
.score-live { font-family: var(--titre); font-size: 1.05rem; background: var(--panneau); border: 2px solid var(--encre); border-radius: 999px; padding: 4px 10px; white-space: nowrap; }
.minuteur { height: 14px; border: 2px solid var(--encre); border-radius: 999px; background: var(--panneau); overflow: hidden; margin-top: 10px; }
.minuteur i { display: block; height: 100%; width: 100%; background: var(--ok); transition: width .1s linear; }
.minuteur i.urgent { background: var(--ko); }
.combo { text-align: center; font-family: var(--titre); font-weight: 700; min-height: 1.4em; margin: 4px 0; color: var(--accent); font-size: 1.1rem; }
.consigne { text-align: center; display: grid; justify-items: center; gap: 6px; font-weight: 800; font-size: 1.05rem; position: relative; }
.consigne .btn-rond { position: absolute; right: 0; top: 18px; width: 46px; height: 46px; font-size: 1.2rem; }
/* Écran de montre numérique, comme celle que l'enfant porte */
.ecran-montre {
  font-family: var(--titre); font-weight: 700; font-size: clamp(2.6rem, 13vw, 3.6rem); letter-spacing: 2px; line-height: 1;
  background: #1f2a20; color: #b8f5a5; border: var(--trait) solid var(--encre); border-radius: 16px; padding: 10px 22px 8px;
  box-shadow: inset 0 0 0 4px #2f3e30, var(--ombre); text-shadow: 0 0 10px rgba(184, 245, 165, .55); min-width: 7ch; text-align: center;
  display: grid; justify-items: center;
}
.ecran-montre.invalide { color: #ffb4a2; }
.ecran-montre.secoue { animation: secoue .35s; }
@keyframes secoue { 25% { transform: translateX(-6px); } 75% { transform: translateX(6px); } }
.apm { font-family: var(--texte); font-size: .8rem; letter-spacing: 0; color: #ffe08a; text-shadow: none; font-weight: 800; }
.consigne > .apm { background: #fff3c4; color: #6b4d00; border: 2px solid var(--encre); border-radius: 999px; padding: 3px 10px; }
.en-lettres { margin: 0; font-size: .95rem; font-weight: 700; opacity: .9; }
.astuce { background: #fff3c4; color: #4a3500; border: 2px dashed #c79a00; border-radius: 12px; padding: 8px 12px; font-size: .9rem; font-weight: 700; margin: 6px 0; }
.zone-horloge { width: min(88vw, 380px); margin: 10px auto 6px; touch-action: none; }
.zone-horloge.petite { width: min(78vw, 330px); }
.legende-aig { display: flex; justify-content: center; gap: 18px; font-size: .82rem; font-weight: 800; margin-bottom: 10px; }
.leg-h { color: var(--aig-h); } .leg-m { color: var(--aig-m); }
.theme-sombre .leg-h, .theme-sombre .leg-m { background: var(--cadran); padding: 0 8px; border-radius: 6px; }

.saisie { display: flex; gap: 12px; align-items: center; justify-content: center; margin: 6px 0; }
.micro.ecoute { background: var(--ko); animation: appel .8s ease-in-out infinite; }
.voix-info { text-align: center; min-height: 1.2em; font-size: .88rem; font-weight: 700; margin: 4px 0; }
.clavier { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; max-width: 340px; margin: 0 auto; }
.clavier button {
  font-family: var(--titre); font-size: 1.6rem; font-weight: 700; padding: 10px 0; border: var(--trait) solid var(--encre);
  border-radius: 14px; background: var(--panneau); box-shadow: 3px 3px 0 var(--encre);
}
.clavier button:active { transform: translate(3px, 3px); box-shadow: none; }
.clavier .ok { background: var(--accent); color: #fff; }

.retour-q {
  position: fixed; left: 50%; bottom: max(12px, env(safe-area-inset-bottom)); transform: translateX(-50%); width: min(calc(100% - 32px), 488px);
  border: var(--trait) solid var(--encre); border-radius: 18px; box-shadow: 6px 6px 0 var(--encre); padding: 12px 16px; z-index: 6;
  font-weight: 700; animation: monte .2s ease-out; text-align: center; color: #1b2433;
}
.retour-q b { font-family: var(--titre); font-size: 1.4rem; }
.retour-q p { margin: 6px 0; font-size: .95rem; text-align: left; }
.retour-q .btn { margin-top: 6px; width: 100%; }
.retour-q.juste { background: #d9f7e3; }
.retour-q.faux { background: #ffe1dc; }
.gain { font-family: var(--titre); font-size: 1.3rem; color: var(--ok); }
.combo-inline { color: #c2410c; }
@keyframes monte { from { transform: translate(-50%, 30px); opacity: 0; } }

/* ---------- Cadran (SVG) ---------- */
.horloge { width: 100%; height: auto; display: block; overflow: visible; }
.horloge.interactive { cursor: grab; }
.h-boitier { fill: var(--encre); }
.h-cadran { fill: var(--cadran); stroke: var(--accent2); stroke-width: 5; }
.h-cran { stroke: var(--encre-cadran); stroke-width: 1.5; opacity: .45; }
.h-cran-fort { stroke: var(--encre-cadran); stroke-width: 4; stroke-linecap: round; }
.h-chiffre { font-family: var(--titre); font-weight: 700; font-size: 27px; fill: var(--encre-cadran); text-anchor: middle; dominant-baseline: central; }
.h-chiffre.gros { font-size: 36px; }
.h-minute { font-family: var(--texte); font-weight: 800; font-size: 11px; fill: var(--aig-m); text-anchor: middle; dominant-baseline: central; }
.h-aig-h { stroke: var(--aig-h); stroke-width: 11; stroke-linecap: round; }
.h-aig-m { stroke: var(--aig-m); stroke-width: 7; stroke-linecap: round; }
.h-poignee { fill: transparent; stroke: none; }
.interactive .h-g-h .h-poignee { fill: var(--aig-h); opacity: .18; }
.interactive .h-g-m .h-poignee { fill: var(--aig-m); opacity: .18; }
.tient-h .h-g-h .h-poignee, .tient-m .h-g-m .h-poignee { opacity: .4; }
.tient-h .h-g-h, .tient-m .h-g-m { filter: drop-shadow(0 0 6px var(--accent2)); }
.h-axe { fill: var(--encre-cadran); } .h-axe-centre { fill: var(--accent2); }
.h-fantome { transition: opacity .3s; }
.h-fantome line { stroke: var(--ok); opacity: .55; stroke-dasharray: 2 9; }

/* ---------- Résultat ---------- */
.resultat { text-align: center; padding-top: 4vh; }
.res-mascotte { font-size: 4.4rem; animation: flotte 2.4s ease-in-out infinite; }
.res-etoiles { font-size: 3.6rem; letter-spacing: 6px; }
.res-etoiles span { color: rgba(0, 0, 0, .15); display: inline-block; }
.res-etoiles .pleine { color: #f5b301; -webkit-text-stroke: 2px var(--encre); animation: pop .5s backwards; }
@keyframes pop { from { transform: scale(0) rotate(-90deg); } 70% { transform: scale(1.3); } }
.res-score { font-family: var(--titre); font-size: 2.2rem; font-weight: 700; margin: 6px 0; }
.res-score small { display: block; font-size: 1rem; font-family: var(--texte); }
.res-points { font-family: var(--titre); font-size: 1.5rem; color: var(--accent); margin: 0; font-weight: 700; }
.res-msgs { max-width: 440px; margin: 12px auto; font-weight: 700; }
.res-msgs p { background: var(--panneau); border: 2px solid var(--encre); border-radius: 12px; padding: 8px 12px; }
.res-msgs .msg-record { background: #ffe9a8; font-size: 1.1rem; }
.res-msgs .msg-invite { background: var(--accent2); color: #1b2433; }
.res-actions { display: grid; gap: 10px; max-width: 360px; margin: 0 auto; }
.confettis { position: fixed; inset: 0; pointer-events: none; z-index: 9; overflow: hidden; }
.confettis span { position: absolute; top: -50px; animation: tombe 2.6s ease-in forwards; }
@keyframes tombe { to { transform: translateY(110vh) rotate(540deg); } }

/* ---------- Classement ---------- */
.onglets { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.cl-info { font-weight: 700; font-size: .92rem; }
.classement { list-style: none; padding: 0; margin: 0; display: grid; gap: 6px; }
.classement li {
  display: grid; grid-template-columns: 34px 34px 1fr auto; gap: 8px; align-items: center; padding: 8px 10px;
  border: 2px solid var(--encre); border-radius: 12px; background: var(--panneau);
}
.classement .moi-ligne { background: var(--accent2); color: #1b2433; box-shadow: 3px 3px 0 var(--encre); }
.cl-rang { font-family: var(--titre); font-weight: 700; text-align: center; font-size: 1.1rem; }
.cl-avatar { font-size: 1.5rem; text-align: center; }
.cl-nom { font-weight: 800; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cl-nom em { font-weight: 600; }
.cl-pts { font-family: var(--titre); font-weight: 600; white-space: nowrap; }

/* ---------- Mon style ---------- */
.grille-avatars { display: grid; grid-template-columns: repeat(auto-fill, minmax(52px, 1fr)); gap: 8px; }
.av { font-size: 1.8rem; aspect-ratio: 1; border: 2px solid var(--encre); border-radius: 14px; background: var(--panneau); }
.av.actif { background: var(--accent2); box-shadow: 3px 3px 0 var(--encre); }
.pseudo-ligne { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; font-size: 1.1rem; }
.grille-themes { display: grid; grid-template-columns: repeat(auto-fill, minmax(102px, 1fr)); gap: 10px; }
.th {
  position: relative; display: grid; justify-items: center; gap: 4px; padding: 12px 6px 10px; border-radius: 16px;
  border: var(--trait) solid var(--e); background: var(--f); color: var(--e); box-shadow: inset 0 -8px 0 var(--a2);
}
.th-masc { font-size: 2rem; }
.th-nom { font-weight: 800; font-size: .8rem; line-height: 1.1; text-align: center; }
.th.actif { outline: 4px solid var(--a); outline-offset: 2px; }
.th-verrou { filter: saturate(.55); }
.th-cour { position: absolute; top: 4px; right: 6px; font-size: 1rem; }

/* ---------- Espace parent ---------- */
.parent-haut { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; }
.bandeau-premium {
  display: block; text-decoration: none; background: repeating-linear-gradient(45deg, #fff3c4 0 10px, #ffe596 10px 20px);
  border: 2px solid var(--encre); border-radius: 12px; padding: 10px 12px; font-weight: 800; color: #4a3500; margin-bottom: 12px;
}
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 8px; }
.kpi { border: 2px solid var(--encre); border-radius: 12px; padding: 8px 10px; background: var(--fond); }
.kpi small { display: block; font-weight: 800; font-size: .76rem; opacity: .8; }
.kpi b { font-family: var(--titre); font-size: 1.4rem; font-weight: 600; }
.t-mieux { color: var(--ok); font-size: .9rem; } .t-moins { color: var(--ko); font-size: .9rem; }
.graphe { position: relative; border: 2px solid var(--encre); border-radius: 12px; padding: 6px 4px 0; background: #fff; color: #1b2433; }
.courbe { width: 100%; height: auto; display: block; touch-action: pan-y; }
.c-grille { stroke: #1b2433; stroke-opacity: .1; stroke-width: 1; }
.c-axe { font-family: var(--texte); font-size: 12px; fill: #4b5563; font-weight: 700; }
.c-ligne { fill: none; stroke: #2f6fd6; stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.c-point { fill: #2f6fd6; stroke: #fff; stroke-width: 2; }
.c-actif { fill: #2f6fd6; stroke: #fff; stroke-width: 2; }
.c-reticule { stroke: #1b2433; stroke-opacity: .35; stroke-dasharray: 3 3; }
.c-etiquette { font-family: var(--titre); font-size: 14px; font-weight: 600; fill: #1b2433; }
.c-bulle {
  position: absolute; transform: translateX(-50%); background: #1b2433; color: #fff; border-radius: 8px; padding: 4px 9px;
  font-size: .85rem; pointer-events: none; display: grid; justify-items: center; white-space: nowrap;
}
.c-bulle small { opacity: .8; }
.graphe-vide { padding: 18px; margin: 0; text-align: center; font-weight: 700; }
.chiffres { margin: 8px 0; } .chiffres summary { font-weight: 800; cursor: pointer; }
.chiffres table, .tab-niveaux { width: 100%; border-collapse: collapse; font-size: .9rem; }
.chiffres th, .chiffres td, .tab-niveaux td { padding: 5px 6px; border-bottom: 1px solid rgba(0, 0, 0, .12); text-align: left; }
.barres { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.barres li { display: grid; grid-template-columns: minmax(0, 1.4fr) 1fr auto; gap: 8px; align-items: center; font-size: .88rem; font-weight: 700; }
.b-piste { height: 14px; border-radius: 4px; background: rgba(0, 0, 0, .08); overflow: hidden; }
.b-piste i { display: block; height: 100%; background: #2f6fd6; border-radius: 0 4px 4px 0; }
.b-piste i.faible { background: #d97706; }
.b-val { font-family: var(--titre); font-weight: 600; min-width: 3.4em; text-align: right; }
.cadence { border: 2px solid var(--encre); border-radius: 12px; padding: 8px 12px; margin: 0 0 10px; }
.cadence legend { font-weight: 800; padding: 0 4px; }
.radio { display: flex; gap: 8px; align-items: center; padding: 6px 0; font-weight: 700; }
.radio input { width: 20px; height: 20px; accent-color: var(--accent); }
.radio.verrou { opacity: .6; }
.liste-enfants { list-style: none; padding: 0; margin: 0 0 10px; display: grid; gap: 6px; }
.liste-enfants li { display: flex; flex-wrap: wrap; gap: 8px; justify-content: space-between; align-items: center; border-bottom: 1px dashed rgba(0, 0, 0, .15); padding: 6px 0; }
.liste-enfants small { opacity: .7; }
.zone-compte { margin-top: 26px; display: grid; gap: 8px; justify-items: start; }
.form-avis { border: 2px solid var(--encre); border-radius: 14px; padding: 10px 14px; background: var(--fond); }
.etoiles-choix { display: flex; gap: 4px; font-size: 2.2rem; margin: 4px 0 10px; }
.etoiles-choix input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.etoiles-choix label { cursor: pointer; color: rgba(0, 0, 0, .2); -webkit-text-stroke: 1.5px var(--encre); line-height: 1; }
.etoiles-choix label.on { color: #f5b301; }
.etoiles-choix label:focus-within { outline: 3px solid var(--accent); border-radius: 6px; }

/* ---------- Boutique ---------- */
.etiquette-prix {
  display: inline-grid; justify-items: center; background: var(--accent2); color: #1b2433; border: var(--trait) solid var(--encre);
  border-radius: 14px 14px 14px 4px; padding: 10px 22px; box-shadow: var(--ombre); transform: rotate(-2deg); margin: 6px 0 4px;
}
.etiquette-prix b { font-family: var(--titre); font-size: 2.4rem; line-height: 1; }
.etiquette-prix span { font-weight: 800; font-size: .85rem; }
.avantages { padding-left: 0; list-style: none; display: grid; gap: 8px; }
.avantages li { padding-left: 30px; position: relative; font-weight: 700; }
.avantages li::before { content: '✔'; position: absolute; left: 4px; color: var(--ok); font-weight: 900; }

#toast {
  position: fixed; left: 50%; top: 14px; transform: translate(-50%, -120px); background: #1b2433; color: #fff; padding: 10px 16px;
  border-radius: 12px; font-weight: 800; z-index: 20; transition: transform .25s; max-width: calc(100% - 32px); text-align: center;
}
#toast.visible { transform: translate(-50%, 0); }

/* Thèmes sombres : panneaux foncés, texte clair */
.theme-sombre .champ input, .theme-sombre .champ textarea, .theme-sombre .ligne-btn input { background: #fff; color: #1b2433; }
.theme-sombre .kpi { background: rgba(255, 255, 255, .06); }

@media (min-width: 640px) {
  .bracelet { grid-template-columns: repeat(6, 1fr); }
  .onglet-exo small { font-size: .82rem; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
.avis-cite { margin: 10px 0; border: 2px solid var(--encre); border-radius: 14px 14px 14px 4px; padding: 10px 14px; background: var(--fond); }
.avis-cite p { margin: 4px 0; font-weight: 600; }
.avis-cite footer { font-size: .85rem; font-weight: 800; opacity: .8; }
.avis-etoiles { color: #f5b301; letter-spacing: 1px; }
