/* Muscles — mise en page propre au site. Les composants viennent de pupitre.css. */

@font-face {
  font-family: "Sofia Sans Extra Condensed";
  font-style: normal;
  font-weight: 800 900;
  font-display: swap;
  src: url("fonts/sofia-sans-extra-condensed-latin.woff2") format("woff2");
}
@font-face {
  font-family: "Rubik";
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url("fonts/rubik-latin.woff2") format("woff2");
}

/* Couleurs de la figure : silhouette aubergine, zones blanches, couverture en orange */
:root {
  --corps: #50312F;
  --zone-0: #FFFFFF;
  --zone-s: var(--pastel-orange);
  --zone-p: var(--vif-orange);
  --zone-fp: var(--rouge);
  --zone-fs: var(--citron);
  --zone-survol: var(--citron);
  --zone-choisi: var(--rouge);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) { --corps: #0E0807; --zone-0: #4A3533; --zone-s: #8C5A43; }
}
:root[data-theme="dark"] { --corps: #0E0807; --zone-0: #4A3533; --zone-s: #8C5A43; }

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; scroll-padding-top: var(--espace-4); }
body { overflow-x: clip; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

.page { max-width: 1240px; margin: 0 auto; padding-inline: var(--espace-4); display: grid; gap: var(--espace-8); }
.pp-barre { max-width: 1240px; margin: 0 auto; }
.pp-barre > span { color: var(--encre-2); font-weight: 600; }

/* ---------- Le corps ---------- */
.corps__grille { display: grid; grid-template-columns: minmax(320px, 5fr) minmax(0, 6fr); gap: var(--espace-8); align-items: start; }
.corps__figures { position: sticky; top: var(--espace-4); display: grid; gap: var(--espace-6); }
.figures { display: grid; grid-template-columns: 1fr 1fr; gap: var(--espace-3); }
.figure { display: grid; gap: var(--espace-2); justify-items: center; margin: 0; }
.figure svg { display: block; width: 100%; max-width: 250px; height: auto; overflow: visible; }
.figure figcaption { font: 900 28px/1 var(--font-affiche); text-transform: uppercase; }

.silhouette polygon { fill: var(--corps); stroke: var(--corps); stroke-width: 5; stroke-linejoin: round; }
.zone { cursor: pointer; outline: none; }
.zone polygon { fill: var(--zone-0); stroke: var(--corps); stroke-width: 2.2; stroke-linejoin: round; transition: fill 160ms ease-out; }
.zone--s polygon { fill: var(--zone-s); }
.zone--p polygon { fill: var(--zone-p); }
.zone--fs polygon { fill: var(--zone-fs); }
.zone--fp polygon { fill: var(--zone-fp); }
.zone:hover polygon { fill: var(--zone-survol); }
.zone--choisi polygon, .zone--choisi:hover polygon { fill: var(--zone-choisi); }
.zone:focus-visible polygon { stroke: var(--rouge); stroke-width: 3.5; }
.zone--choisi:focus-visible polygon { stroke: var(--encre); }
.traits polyline { fill: none; stroke: var(--corps); stroke-width: 1.6; stroke-linecap: round; opacity: .55; pointer-events: none; }

.legende { display: flex; flex-wrap: wrap; justify-content: center; gap: var(--espace-2) var(--espace-6); margin: 0; padding: 0; list-style: none; font-size: 14px; line-height: 20px; color: var(--encre-2); }
.legende li { display: inline-flex; align-items: center; gap: var(--espace-2); }
.pastille-zone { flex: none; width: 14px; height: 14px; border-radius: var(--rayon-pilule); background: var(--zone-0); box-shadow: inset 0 0 0 2px var(--corps); }
.pastille-zone.zone--s { background: var(--zone-s); }
.pastille-zone.zone--p { background: var(--zone-p); }
.pastille-zone.zone--fs { background: var(--zone-fs); }
.pastille-zone.zone--fp { background: var(--zone-fp); }

.puces { display: flex; flex-wrap: wrap; gap: var(--espace-2); }
.puce { -webkit-appearance: none; appearance: none; display: inline-flex; align-items: center; gap: var(--espace-2); height: 36px; padding: 0 14px 0 10px; border: 2px solid var(--encre); border-radius: var(--rayon-pilule); background: transparent; color: var(--encre); font: 600 14px/18px var(--font-texte); cursor: pointer; }
.puce:hover { background: var(--citron); color: var(--sur-citron); }
.puce[aria-pressed="true"] { border-color: var(--rouge); background: var(--rouge); color: var(--sur-rouge); }
.puce[aria-pressed="true"] .pastille-zone { box-shadow: inset 0 0 0 2px var(--sur-rouge); }

/* ---------- Le panneau ---------- */
.corps__panneau { display: grid; gap: var(--espace-6); align-content: start; min-width: 0; }
.panneau__tete { display: grid; gap: var(--espace-3); justify-items: start; }
.panneau__nom { margin: 0; font: 900 clamp(56px, 7vw, 96px)/.86 var(--font-affiche); text-transform: uppercase; overflow-wrap: anywhere; }
.panneau__role { margin: 0; max-width: 56ch; font-size: 18px; line-height: 27px; }
.panneau__cibles { margin: 0; color: var(--encre-2); }
.panneau__cibles b { color: var(--encre); }
.vide__titre { margin: 0 0 var(--espace-1); font: 900 32px/.95 var(--font-affiche); text-transform: uppercase; }
.pp-vide p { margin: 0; }
.pp-vide p + p { color: var(--encre-2); }

.groupe { display: grid; gap: var(--espace-3); }
details.groupe > summary { cursor: pointer; list-style: none; display: inline-flex; align-items: center; gap: var(--espace-2); }
details.groupe > summary::-webkit-details-marker { display: none; }
details.groupe > summary::after { content: "( + )"; font-weight: 700; font-size: 13px; }
details.groupe[open] > summary::after { content: "( − )"; }
.exos { display: grid; gap: var(--espace-3); }

.exo { display: grid; gap: var(--espace-2); padding: 20px 22px; border-radius: var(--rayon-l); background: var(--fond); }
.exo--hors { background: transparent; box-shadow: inset 0 0 0 2px var(--encre); }
.exo__tete { display: flex; flex-wrap: wrap; align-items: center; gap: var(--espace-2) var(--espace-3); }
.exo__rang { display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: var(--rayon-pilule); background: var(--encre); color: var(--fond); font: 900 22px/1 var(--font-affiche); }
.exo__nom { margin: 0; margin-right: auto; font: 900 30px/.95 var(--font-affiche); text-transform: uppercase; }
.exo p { margin: 0; }
.exo__dosage { font-size: 16px; }
.exo__charge { font-weight: 700; font-variant-numeric: tabular-nums; }
.exo__note { color: var(--encre-2); }
.exo__muscles { font-size: 14px; line-height: 20px; color: var(--encre-2); }
.exo__muscles span { font-weight: 700; color: var(--encre); }
.exo__actions { display: flex; flex-wrap: wrap; align-items: center; gap: var(--espace-2) var(--espace-6); margin-top: var(--espace-1); }
.exo__actions .voir[aria-pressed="true"] { color: var(--rouge-texte); }
.record { display: inline-flex; align-items: center; gap: var(--espace-2); font: 600 14px/18px var(--font-texte); }
.record input { width: 84px; height: 36px; padding: 0 12px; border: 2px solid var(--encre); border-radius: var(--rayon-pilule); background: transparent; color: var(--encre); font: 600 16px/20px var(--font-texte); font-variant-numeric: tabular-nums; }
.record input:focus-visible { outline: 3px solid var(--rouge); outline-offset: 2px; }

.panneau__seances { display: grid; gap: var(--espace-3); }
.liens { display: flex; flex-wrap: wrap; gap: var(--espace-2); }
.liens .pp-touche { text-decoration: none; }

/* ---------- Séances types ---------- */
.seances { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: var(--espace-4); }
.seance { -webkit-appearance: none; appearance: none; display: grid; gap: var(--espace-2); align-content: start; padding: 22px 22px 24px; border: 0; border-radius: var(--rayon-l); background: var(--famille); color: var(--encre); font: inherit; text-align: left; cursor: pointer; transition: transform 160ms ease-out; }
.seance:hover { transform: rotate(-1.5deg); }
.seance[aria-pressed="true"] { background: var(--rouge); color: var(--sur-rouge); }
.seance[aria-pressed="true"] .pp-etiquette { color: var(--sur-rouge); }
.seance__nom { font: 900 34px/.9 var(--font-affiche); text-transform: uppercase; }
.seance__suite { margin: var(--espace-2) 0 0; padding-left: 1.2em; font-size: 14px; line-height: 21px; }

/* ---------- Mobilité et douleurs ---------- */
.mobilite { display: grid; gap: var(--espace-8); }
.mobilite__partie { display: grid; gap: var(--espace-3); }
.mobilite__titre { margin: 0; font: 900 40px/.9 var(--font-affiche); text-transform: uppercase; }
.mobilite__chapeau { margin: 0 0 var(--espace-2); max-width: 60ch; color: var(--encre-2); }
.seance--douleur { background: transparent; box-shadow: inset 0 0 0 var(--trait) var(--encre); }
.seance--douleur .seance__nom::before { content: ""; display: inline-block; width: 14px; height: 14px; margin-right: 10px; border-radius: var(--rayon-pilule); background: var(--rouge); vertical-align: .08em; }
.seance--douleur[aria-pressed="true"] { box-shadow: none; }
.seance--douleur[aria-pressed="true"] .seance__nom::before { background: var(--sur-rouge); }

.groupe__texte { margin: 0; max-width: 60ch; }
.etapes { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: var(--espace-3) var(--espace-6); margin: 0; padding: 22px; border-radius: var(--rayon-l); background: var(--fond); }
.etapes dt { font: 900 24px/1 var(--font-affiche); text-transform: uppercase; }
.etapes dd { margin: 0; }
.alerte { display: grid; gap: var(--espace-2); padding: 20px 22px; border-radius: var(--rayon-l); box-shadow: inset 0 0 0 var(--trait) var(--rouge); }
.alerte .pp-etiquette { color: var(--rouge-texte); }
.alerte ul { margin: 0; padding-left: 1.2em; display: grid; gap: var(--espace-1); }

/* ---------- Règles ---------- */
.regles { display: grid; gap: var(--espace-3); margin: 0; padding: 0; list-style: none; counter-reset: regle; }
.regles li { display: grid; grid-template-columns: 44px minmax(0, 1fr); gap: var(--espace-3); align-items: start; font-size: 17px; line-height: 26px; counter-increment: regle; }
.regles li::before { content: counter(regle); display: grid; place-items: center; width: 40px; height: 40px; border-radius: var(--rayon-pilule); background: var(--encre); color: var(--fond); font: 900 26px/1 var(--font-affiche); }

/* ---------- Pied et chrono ---------- */
.pied { display: grid; gap: var(--espace-3); padding-top: var(--espace-8); }
.pied p { margin: 0; max-width: 80ch; color: var(--encre-2); }

.chrono { position: fixed; left: 50%; bottom: max(var(--espace-4), env(safe-area-inset-bottom)); z-index: 10; transform: translateX(-50%); width: max-content; max-width: calc(100% - 32px); box-shadow: var(--ombre-flottant); }
.chrono__texte { display: inline-flex; align-items: baseline; gap: var(--espace-3); min-width: 0; }
.chrono__texte > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chrono b { font: 900 30px/1 var(--font-affiche); font-variant-numeric: tabular-nums; }

@media (max-width: 900px) {
  .corps__grille { grid-template-columns: minmax(0, 1fr); }
  .corps__figures { position: static; }
}
@media (max-width: 640px) {
  .figure figcaption { font-size: 22px; }
  .exo { padding: 18px; }
  .exo__nom { font-size: 26px; }
  .regles li { font-size: 16px; line-height: 24px; }
  .mobilite__titre { font-size: 32px; }
  .etapes { grid-template-columns: minmax(0, 1fr); gap: var(--espace-1); }
  .etapes dd + dt { margin-top: var(--espace-2); }
}
@media (prefers-reduced-motion: reduce) { .zone polygon, .seance { transition: none; } }
