[hidden] { display: none !important; }
:root {
  --fond: #0d1010;
  --carte: #161b1b;
  --carte2: #1e2525;
  --ligne: #2a3333;
  --texte: #eef3ee;
  --doux: #93a19b;
  --lime: #d7ff3a;
  --cyan: #5ce1e6;
  --orange: #ff7a45;
  --rouge: #ff5468;
  --ok: #4ade80;
  --rayon: 16px;
  --titre: "Barlow Condensed", "Arial Narrow", sans-serif;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; background: var(--fond); color: var(--texte); font: 15px/1.45 Inter, system-ui, sans-serif; }
body { padding-bottom: calc(76px + env(safe-area-inset-bottom)); overflow-x: hidden; }
#app { max-width: 560px; margin: 0 auto; padding: calc(14px + env(safe-area-inset-top)) 16px 24px; }
.chargement { font-family: var(--titre); font-size: 40px; color: var(--lime); text-align: center; margin-top: 40vh; }
h1, h2, h3 { font-family: var(--titre); letter-spacing: .3px; margin: 0; line-height: 1.05; }
h1 { font-size: 34px; font-weight: 800; text-transform: uppercase; }
h2 { font-size: 24px; font-weight: 700; margin: 26px 0 10px; text-transform: uppercase; }
h3 { font-size: 20px; font-weight: 700; }
p { margin: 6px 0; }
a { color: var(--lime); }
.doux { color: var(--doux); }
.petit { font-size: 13px; }
.entete { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.entete .sur { font-size: 13px; color: var(--doux); text-transform: uppercase; letter-spacing: 1px; font-weight: 600; }
.icone-btn { background: var(--carte); border: 1px solid var(--ligne); color: var(--texte); width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; text-decoration: none; font-size: 20px; flex: none; }

.carte { background: var(--carte); border: 1px solid var(--ligne); border-radius: var(--rayon); padding: 16px; margin: 12px 0; }
.carte.vive { background: linear-gradient(135deg, #222b10, #161b1b 70%); border-color: #4b5a1a; }
.carte.alerte { border-color: #6b5a1a; background: #1f1c10; }
.puce { display: inline-block; padding: 3px 10px; border-radius: 99px; font-size: 12px; font-weight: 700; background: var(--carte2); color: var(--doux); text-transform: uppercase; letter-spacing: .5px; }
.puce.lime { background: var(--lime); color: #111; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 0; border-radius: 14px; padding: 14px 18px; font: 700 16px Inter, sans-serif; cursor: pointer; text-decoration: none; background: var(--lime); color: #111; min-height: 50px; }
.btn.large { width: 100%; }
.btn.second { background: var(--carte2); color: var(--texte); border: 1px solid var(--ligne); }
.btn.mini { padding: 8px 12px; min-height: 36px; font-size: 14px; border-radius: 10px; }
.btn.danger { background: transparent; color: var(--rouge); border: 1px solid #5a2630; }
.btn:disabled { opacity: .4; }
.rangee { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.rangee > .btn { flex: 1; }

/* stats du haut */
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 6px 0 4px; }
.stat { background: var(--carte); border: 1px solid var(--ligne); border-radius: 14px; padding: 12px 10px; text-align: center; }
.stat b { display: block; font-family: var(--titre); font-size: 30px; line-height: 1; }
.stat span { font-size: 12px; color: var(--doux); }

/* semaine */
.jours { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
.jour { background: var(--carte); border: 1px solid var(--ligne); border-radius: 12px; padding: 8px 0 10px; text-align: center; font-size: 12px; color: var(--doux); position: relative; min-width: 0; }
.jour b { display: block; font-family: var(--titre); font-size: 22px; color: var(--texte); margin: 2px 0 4px; }
.jour.ajd { border-color: var(--lime); }
.jour .tag { display: block; font-weight: 800; font-size: 13px; height: 18px; }
.jour.fait { background: #142414; }
.jour.passe { opacity: .55; }
.choix-jours { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
.choix-jours button { background: var(--carte); color: var(--texte); border: 1px solid var(--ligne); border-radius: 12px; padding: 10px 0; font: 600 13px Inter; cursor: pointer; }
.choix-jours button.on { background: var(--lime); color: #111; border-color: var(--lime); }
.choix-jours button.indispo.on { background: #3a2026; color: #ffb3bd; border-color: #5a2630; }
.choix-jours button:disabled { opacity: .35; }
.plan-ligne { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--ligne); }
.plan-ligne:last-child { border: 0; }
.plan-ligne .date { width: 74px; color: var(--doux); font-size: 13px; }
.plan-ligne .quoi { flex: 1; font-weight: 600; }
.lettre { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; font-family: var(--titre); font-weight: 800; font-size: 22px; color: #111; flex: none; }

/* exercices */
.anim { position: relative; aspect-ratio: 850/569; border-radius: 12px; overflow: hidden; background: #fff; }
.anim img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.anim img + img { animation: alterne 1.8s infinite steps(1, end); }
@keyframes alterne { 0% { opacity: 0 } 50% { opacity: 1 } }
.anim.vide { display: grid; place-items: center; background: var(--carte2); color: var(--doux); font-size: 13px; text-align: center; padding: 12px; }
.anim.vide::before { content: "🧘"; font-size: 34px; display: block; }
.exo { padding: 0; overflow: hidden; }
.exo .haut { display: flex; gap: 12px; padding: 12px; align-items: center; cursor: pointer; }
.exo .haut .anim { width: 112px; flex: none; }
.exo .haut .txt { flex: 1; min-width: 0; }
.exo .haut h3 { font-size: 19px; }
.exo .corps { padding: 0 12px 12px; }
.exo.termine { border-color: #2f5a2f; }
.exo.termine .haut h3::after { content: " ✓"; color: var(--ok); }
.objectif { background: var(--carte2); border-radius: 10px; padding: 8px 10px; font-size: 13px; margin: 6px 0 10px; }
.objectif b { color: var(--lime); }
.serie { display: grid; grid-template-columns: 30px 1fr 1fr 52px; gap: 8px; align-items: center; margin: 6px 0; }
.serie.sans-charge { grid-template-columns: 30px 1fr 52px; }
.serie .n { color: var(--doux); font-weight: 700; text-align: center; }
.serie input { width: 100%; background: var(--fond); border: 1px solid var(--ligne); color: var(--texte); border-radius: 10px; padding: 11px 10px; font: 600 17px Inter; text-align: center; }
.serie input::placeholder { color: #55625c; }
.serie .ok { height: 46px; border-radius: 10px; border: 1px solid var(--ligne); background: var(--carte2); color: var(--doux); font-size: 20px; cursor: pointer; }
.serie.valide .ok { background: var(--ok); color: #0a2a12; border-color: var(--ok); }
.serie.valide input { border-color: #2f5a2f; }
.entete-series { display: grid; grid-template-columns: 30px 1fr 1fr 52px; gap: 8px; font-size: 11px; color: var(--doux); text-transform: uppercase; text-align: center; }
.entete-series.sans-charge { grid-template-columns: 30px 1fr 52px; }

.prevention-item { display: flex; gap: 12px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--ligne); }
.prevention-item:last-child { border: 0; }
.prevention-item .anim { width: 84px; flex: none; cursor: pointer; }
.prevention-item .txt { flex: 1; min-width: 0; }
.coche { width: 40px; height: 40px; border-radius: 50%; border: 2px solid var(--ligne); background: transparent; color: transparent; font-size: 20px; flex: none; cursor: pointer; }
.coche.on { background: var(--ok); border-color: var(--ok); color: #0a2a12; }

.douleurs button { flex: 1 1 30%; background: var(--carte2); border: 1px solid var(--ligne); color: var(--texte); border-radius: 12px; padding: 12px 8px; font: 600 14px Inter; cursor: pointer; }
.douleurs button.on { background: #3a2026; border-color: var(--rouge); color: #ffd0d6; }

.etapes { display: flex; gap: 6px; margin: 4px 0 14px; }
.etapes span { flex: 1; height: 5px; border-radius: 5px; background: var(--ligne); }
.etapes span.on { background: var(--lime); }

/* WOD */
.wod-nom { font-family: var(--titre); font-size: 44px; font-weight: 800; text-transform: uppercase; color: var(--lime); line-height: 1; }
.wod-lignes { font-size: 17px; font-weight: 600; margin: 12px 0; padding-left: 18px; }
.chrono { font-family: var(--titre); font-size: 84px; font-weight: 800; text-align: center; line-height: 1; margin: 12px 0 4px; font-variant-numeric: tabular-nums; }
.chrono-sous { text-align: center; color: var(--doux); margin-bottom: 12px; min-height: 22px; }

/* minuteur de repos */
#minuteur { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(84px + env(safe-area-inset-bottom)); width: min(528px, calc(100% - 32px)); background: var(--lime); color: #111; border-radius: 16px; padding: 10px 14px; display: flex; align-items: center; gap: 12px; font-weight: 700; box-shadow: 0 10px 30px #0008; z-index: 30; }
#minuteur .t { font-family: var(--titre); font-size: 34px; font-variant-numeric: tabular-nums; }
#minuteur .x { margin-left: auto; display: flex; gap: 6px; }
#minuteur button { background: #111; color: var(--lime); border: 0; border-radius: 10px; padding: 8px 10px; font-weight: 700; cursor: pointer; }
#minuteur.fini { background: var(--ok); animation: pulse .6s 3; }
@keyframes pulse { 50% { transform: translateX(-50%) scale(1.04) } }

/* nav */
#nav { position: fixed; bottom: 0; left: 0; right: 0; background: #0d1010ee; backdrop-filter: blur(12px); border-top: 1px solid var(--ligne); display: flex; justify-content: center; padding: 6px 8px calc(6px + env(safe-area-inset-bottom)); z-index: 20; }
#nav a { flex: 1; max-width: 140px; display: flex; flex-direction: column; align-items: center; gap: 3px; color: var(--doux); text-decoration: none; font-size: 11px; font-weight: 600; padding: 6px 0; }
#nav svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
#nav a.on { color: var(--lime); }

/* modale */
#modale { position: fixed; inset: 0; background: #000b; z-index: 50; display: flex; align-items: flex-end; justify-content: center; }
#modale .boite { background: var(--carte); width: min(560px, 100%); max-height: 92vh; overflow: auto; border-radius: 20px 20px 0 0; padding: 18px 16px calc(22px + env(safe-area-inset-bottom)); border: 1px solid var(--ligne); }
#modale .fermer { float: right; }
ol.consignes { padding-left: 20px; margin: 10px 0; }
ol.consignes li { margin: 6px 0; }

/* formulaires */
label.champ { display: block; margin: 10px 0; font-size: 13px; color: var(--doux); font-weight: 600; }
label.champ input, label.champ select, label.champ textarea { display: block; width: 100%; margin-top: 5px; background: var(--fond); border: 1px solid var(--ligne); color: var(--texte); border-radius: 10px; padding: 12px; font: 500 16px Inter; }
.grille2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 10px; }

/* progrès */
.barre { height: 12px; background: var(--carte2); border-radius: 12px; overflow: hidden; margin: 10px 0 6px; }
.barre i { display: block; height: 100%; background: linear-gradient(90deg, var(--lime), #9cff3a); border-radius: 12px; }
.record { display: flex; justify-content: space-between; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--ligne); }
.record:last-child { border: 0; }
.record b { font-family: var(--titre); font-size: 20px; color: var(--lime); white-space: nowrap; }
.graphe svg { width: 100%; height: auto; max-height: 150px; display: block; }
.graphe .t { display: flex; justify-content: space-between; align-items: baseline; }
.graphe .t b { font-family: var(--titre); font-size: 26px; }
.proteines { display: flex; align-items: center; gap: 10px; }
.proteines .val { font-family: var(--titre); font-size: 30px; min-width: 92px; }
.liste-exos a { display: flex; gap: 12px; align-items: center; color: var(--texte); text-decoration: none; padding: 8px 0; border-bottom: 1px solid var(--ligne); }
.liste-exos .anim { width: 76px; flex: none; }
.bravo { text-align: center; padding: 10px 0; }
.bravo .gros { font-size: 64px; }
.pr { color: var(--lime); font-weight: 700; }
.login { max-width: 360px; margin: 22vh auto 0; text-align: center; }
.login input { width: 100%; text-align: center; font: 700 28px var(--titre); letter-spacing: 6px; background: var(--carte); color: var(--texte); border: 1px solid var(--ligne); border-radius: 14px; padding: 14px; margin: 18px 0 12px; text-transform: uppercase; }
.logo { font-family: var(--titre); font-weight: 800; font-size: 56px; color: var(--lime); text-transform: uppercase; line-height: .9; }
.erreur { color: var(--rouge); min-height: 20px; }

/* ---------- corps en relief ---------- */
.corps3d { position: relative; perspective: 900px; width: 100%; max-width: 190px; margin: 0 auto; }
.corps3d .pivot { position: relative; aspect-ratio: 200/424; transform-style: preserve-3d; transition: transform .8s cubic-bezier(.3,.7,.2,1); animation: balance 6s ease-in-out infinite; }
.corps3d .pivot.retourne { transform: rotateY(180deg); animation: balance-dos 6s ease-in-out infinite; }
@keyframes balance { 0%,100% { transform: rotateY(-14deg) } 50% { transform: rotateY(14deg) } }
@keyframes balance-dos { 0%,100% { transform: rotateY(166deg) } 50% { transform: rotateY(194deg) } }
.corps3d .face { position: absolute; inset: 0; backface-visibility: hidden; -webkit-backface-visibility: hidden; }
.corps3d .arriere { transform: rotateY(180deg); }
.corps-svg { width: 100%; height: 100%; display: block; filter: drop-shadow(0 8px 14px #0009); }
.corps3d .tourner { position: absolute; bottom: 4px; right: -4px; background: var(--carte2); color: var(--texte); border: 1px solid var(--ligne); border-radius: 99px; padding: 5px 10px; font: 600 12px Inter; cursor: pointer; }
.corps3d.petit { max-width: 70px; }
.corps3d.petit .pivot { animation-duration: 4s; }
@media (prefers-reduced-motion: reduce) { .corps3d .pivot, .corps3d .pivot.retourne { animation: none; } }
.deux-faces { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; max-width: 340px; margin: 12px auto 4px; }
.deux-faces > div { text-align: center; }
.deux-faces svg { width: 100%; height: auto; display: block; filter: drop-shadow(0 8px 14px #0009); }
.deux-faces span { font-size: 12px; color: var(--doux); text-transform: uppercase; letter-spacing: 1px; }
.legende-muscles { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0; }
.legende-muscles span { font-size: 12px; font-weight: 700; padding: 4px 9px; border-radius: 99px; }
.legende-muscles .mp { background: var(--lime); color: #111; }
.legende-muscles .ms { background: #2c3a14; color: #d7ff3a; }
.fiche-visuel { display: grid; grid-template-columns: 38% 1fr; gap: 14px; align-items: center; }

/* ---------- mode guidé ---------- */
.guide-entete { margin-bottom: 8px; }
.guide-barre { height: 5px; background: var(--ligne); border-radius: 5px; overflow: hidden; margin-bottom: 14px; }
.guide-barre i { display: block; height: 100%; background: var(--lime); transition: width .4s; }
.guide-titre { text-align: center; margin-bottom: 6px; }
.guide-titre h1 { font-size: 32px; }
.guide-visuel { display: grid; grid-template-columns: 42% 1fr; gap: 14px; align-items: center; margin: 8px 0 4px; }
.guide-cote .anim { cursor: pointer; }
.anneau { position: relative; width: min(230px, 64vw); margin: 10px auto 2px; }
.anneau svg { width: 100%; display: block; transform: rotate(-90deg); }
.anneau circle { fill: none; stroke-width: 12; }
.anneau .fond { stroke: var(--carte2); }
.anneau .plein { stroke: var(--lime); stroke-linecap: round; transition: stroke-dashoffset .25s linear; filter: drop-shadow(0 0 6px #d7ff3a66); }
.anneau.repos .plein { stroke: var(--cyan); filter: drop-shadow(0 0 6px #5ce1e666); }
.anneau.fini .plein { stroke: var(--ok); }
.anneau .centre { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; }
.anneau .centre b { font-family: var(--titre); font-size: 64px; line-height: 1; font-variant-numeric: tabular-nums; }
.anneau .centre span { color: var(--doux); font-size: 13px; font-weight: 600; margin-top: 4px; max-width: 70%; }
.reglages-serie { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; margin: 4px 0; }
.pas { display: flex; align-items: center; gap: 6px; background: var(--carte); border: 1px solid var(--ligne); border-radius: 14px; padding: 6px 8px; }
.pas span { font-size: 11px; color: var(--doux); text-transform: uppercase; width: 56px; text-align: center; font-weight: 700; }
.pas button { width: 40px; height: 40px; border-radius: 10px; border: 0; background: var(--carte2); color: var(--texte); font-size: 22px; cursor: pointer; }
.pas input { width: 62px; text-align: center; background: transparent; border: 0; color: var(--texte); font: 700 24px var(--titre); }
.glisse { --p: 0; position: relative; height: 64px; border-radius: 99px; background: var(--carte); border: 1px solid var(--ligne); overflow: hidden; user-select: none; touch-action: none; }
.glisse::before { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, #d7ff3a33, #d7ff3a88); transform-origin: left; transform: scaleX(var(--p)); }
.glisse-txt { position: absolute; inset: 0; display: grid; place-items: center; font-weight: 700; color: var(--doux); padding-left: 50px; }
.glisse-btn { position: absolute; top: 4px; left: 4px; width: 56px; height: 56px; border-radius: 50%; background: var(--lime); color: #111; display: grid; place-items: center; font-size: 26px; font-weight: 800; cursor: grab; transition: transform .25s; touch-action: none; }
.glisse.appel { border-color: var(--lime); animation: appel 1.2s infinite; }
@keyframes appel { 50% { box-shadow: 0 0 0 6px #d7ff3a33 } }
.glisse.ok { background: var(--ok); border-color: var(--ok); }
.guide-repos .prochain { text-align: left; }
.prochain-corps { display: flex; gap: 12px; align-items: center; margin-top: 8px; }
.prochain-corps .anim { flex: 1; }

.note-exo { margin: 4px 0 8px; }
.note-lue { background: #2a2a10; border: 1px solid #5a5a1a; border-radius: 10px; padding: 8px 10px; font-size: 13px; margin-bottom: 6px; }
.note-lue span { color: var(--lime); }
.note-saisie summary { cursor: pointer; color: var(--doux); font-size: 13px; font-weight: 600; padding: 4px 0; }
.note-saisie textarea, .champ textarea { width: 100%; box-sizing: border-box; margin: 6px 0; background: var(--carte2); color: inherit; border: 1px solid #333; border-radius: 10px; padding: 8px; font: inherit; font-size: 14px; }
[data-prise] small { font-weight: 400; opacity: .75; }
/* calendrier intelligent + duo */
.carte.demain { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding-top: 10px; padding-bottom: 10px; }
.carte.demain span { font-weight: 600; }
.duo-carte { margin: 12px 0; text-align: left; }
.duo-carte .reglages-serie { margin: 10px 0; }
details.apercu { margin-top: 10px; border-top: 1px solid var(--carte2); padding-top: 8px; }
details.apercu summary { cursor: pointer; font-weight: 600; font-size: 15px; color: var(--lime); list-style: none; }
details.apercu summary::-webkit-details-marker { display: none; }
details.apercu .consignes a, .consignes a { color: inherit; text-decoration: underline dotted; }
.jour[data-jourprog]:active { transform: scale(.96); }

.coach-q { background: var(--carte2); border-radius: 16px 16px 4px 16px; padding: 10px 14px; margin: 12px 0 6px auto; max-width: 85%; width: fit-content; }
.coach-r { background: var(--carte); border: 1px solid var(--ligne); border-radius: 16px 16px 16px 4px; padding: 12px 14px; margin: 0 auto 6px 0; max-width: 92%; line-height: 1.45; }
#comptes input, #comptes select { background: var(--fond); border: 1px solid var(--ligne); color: var(--texte); border-radius: 10px; padding: 10px; font: 500 16px Inter; }
.login #ident { font: 600 18px Inter; letter-spacing: 0; text-transform: none; margin-bottom: 0; }
