/* WOD — interface sombre : lisible en salle, bras tendus, écran à distance. */

:root {
  --fond: #0f1720;
  --fond-carte: #18242f;
  --fond-carte-haut: #1f2f3d;
  --bord: #2b3d4c;
  --texte: #e8eef2;
  --texte-doux: #93a7b5;
  --bleu: #4aa3c7;
  --bleu-sombre: #225f7b;
  --or: #ffc727;
  --orange: #ff7a45;
  --vert: #5fd39b;
  --rouge: #ff6b6b;
  --rayon: 14px;
  --marge-haute: env(safe-area-inset-top, 0px);
  --marge-basse: env(safe-area-inset-bottom, 0px);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body {
  margin: 0; padding: 0; background: var(--fond); color: var(--texte);
  font: 16px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  overscroll-behavior-y: contain;
}
body { padding: var(--marge-haute) 0 var(--marge-basse); }

#app { max-width: 560px; margin: 0 auto; padding: 0 16px 96px; }

a { color: var(--bleu); text-decoration: none; }
h1 { font-size: 22px; margin: 20px 0 4px; letter-spacing: -0.2px; }
h2 { font-size: 17px; margin: 24px 0 8px; color: var(--texte); }
h3 { font-size: 15px; margin: 16px 0 6px; }
p { margin: 8px 0; }
.doux { color: var(--texte-doux); font-size: 14px; }
.centre { text-align: center; }

/* ---------------------------------------------------------------- en-tête */
.entete { display: flex; align-items: center; gap: 12px; padding: 14px 0 6px; }
.entete .titre { flex: 1; min-width: 0; }
.entete h1 { margin: 0; font-size: 20px; }
.retour {
  display: inline-flex; align-items: center; justify-content: center;
  width: 40px; height: 40px; border-radius: 12px; background: var(--fond-carte);
  border: 1px solid var(--bord); color: var(--texte); font-size: 20px; flex: none;
}

/* ----------------------------------------------------------------- cartes */
.carte {
  display: block; background: var(--fond-carte); border: 1px solid var(--bord);
  border-radius: var(--rayon); padding: 14px 16px; margin: 10px 0; color: inherit;
}
.carte-seance { display: flex; align-items: center; gap: 14px; }
.pastille {
  flex: none; width: 46px; height: 46px; border-radius: 14px;
  background: var(--bleu-sombre); color: #fff; display: grid; place-items: center;
  font-weight: 700; font-size: 19px;
}
.pastille.echauffement { background: #35485a; color: var(--texte-doux); }
.carte-seance .corps { flex: 1; min-width: 0; }
.carte-seance .nom { font-weight: 600; }
.carte-seance .meta { color: var(--texte-doux); font-size: 13px; }
.chevron { color: var(--texte-doux); font-size: 20px; }

/* --------------------------------------------------------------- boutons */
.bouton {
  display: block; width: 100%; padding: 16px; border-radius: var(--rayon);
  border: none; background: var(--bleu-sombre); color: #fff;
  font-size: 17px; font-weight: 600; font-family: inherit; cursor: pointer;
  margin: 12px 0; text-align: center;
}
.bouton.or { background: var(--or); color: #1a1a1a; }
.bouton.fantome { background: transparent; border: 1px solid var(--bord); color: var(--texte); }
.bouton.danger { background: transparent; border: 1px solid #5c3238; color: var(--rouge); }
.bouton:active { filter: brightness(1.15); }
.bouton:disabled { opacity: 0.45; }
.boutons-ligne { display: flex; gap: 10px; }
.boutons-ligne .bouton { margin: 12px 0 0; }

/* -------------------------------------------------------------- segments */
.segments { display: flex; gap: 6px; background: var(--fond-carte); border: 1px solid var(--bord);
  border-radius: 12px; padding: 4px; margin: 10px 0; }
.segments button {
  flex: 1; padding: 10px 4px; border: none; border-radius: 9px; background: transparent;
  color: var(--texte-doux); font: inherit; font-size: 14px; font-weight: 600; cursor: pointer;
}
.segments button[aria-pressed="true"] { background: var(--bleu-sombre); color: #fff; }

/* ------------------------------------------------------------ exercices */
.ligne-ex { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--bord); color: inherit; }
.ligne-ex:last-child { border-bottom: none; }
.ligne-ex .vignette { flex: none; width: 52px; height: 60px; display: flex; align-items: center; justify-content: center; }
.ligne-ex .nom { flex: 1; font-size: 15px; }
.ligne-ex .dose { font-weight: 700; color: var(--or); font-variant-numeric: tabular-nums; }

/* ---------------------------------------------------------------- pictos */
.picto { display: block; }
.picto .plein { stroke: var(--bleu); }
.picto .fantome { stroke: #3d5567; }
.picto .sol { stroke: #32475a; stroke-width: 2; }
.picto .materiel { stroke: #7f97a8; stroke-width: 3.4; stroke-linecap: round; fill: none; }
.picto .materiel-plein { fill: #7f97a8; }
.picto .fleche { stroke: var(--orange); stroke-width: 2.6; fill: none; stroke-linecap: round; }
.picto .fleche-tete { stroke: var(--orange); stroke-width: 2.6; fill: none; }
.picto-grand { margin: 10px auto; }

/* ----------------------------------------------------------------- timer */
.ecran-timer {
  position: fixed; inset: 0; background: var(--fond); z-index: 20;
  display: flex; flex-direction: column;
  padding: calc(var(--marge-haute) + 10px) 18px calc(var(--marge-basse) + 14px);
}
.ecran-timer.travail { background: #12242c; }
.ecran-timer.repos { background: #241c14; }
.ecran-timer.prepare { background: #1a1a24; }
.timer-haut { display: flex; align-items: center; justify-content: space-between; color: var(--texte-doux); font-size: 14px; }
.timer-fermer { background: none; border: none; color: var(--texte-doux); font-size: 26px; padding: 4px 10px; cursor: pointer; }
.timer-corps { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; text-align: center; }
.timer-phase { text-transform: uppercase; letter-spacing: 2px; font-size: 14px; font-weight: 700; color: var(--texte-doux); }
.ecran-timer.travail .timer-phase { color: var(--vert); }
.ecran-timer.repos .timer-phase { color: var(--or); }
.timer-chrono { font-size: clamp(62px, 22vw, 110px); font-weight: 800; line-height: 1; font-variant-numeric: tabular-nums; letter-spacing: -2px; }
.timer-ex { font-size: 26px; font-weight: 700; margin-top: 4px; }
.timer-dose { font-size: 34px; font-weight: 800; color: var(--or); }
.timer-suite { color: var(--texte-doux); font-size: 14px; }
.timer-bas { display: flex; flex-direction: column; gap: 10px; }
.barre-progres { height: 6px; border-radius: 3px; background: var(--bord); overflow: hidden; }
.barre-progres > i { display: block; height: 100%; background: var(--bleu); transition: width 0.2s linear; }
.compteur-tours { display: flex; gap: 6px; justify-content: center; }
.compteur-tours i { width: 10px; height: 10px; border-radius: 50%; background: var(--bord); }
.compteur-tours i.fait { background: var(--bleu); }
.compteur-tours i.encours { background: var(--or); }

/* ---------------------------------------------------------------- suivi */
table.suivi { width: 100%; border-collapse: collapse; font-size: 14px; }
table.suivi th { text-align: left; color: var(--texte-doux); font-weight: 600; font-size: 12px;
  text-transform: uppercase; letter-spacing: 0.6px; padding: 6px 4px; }
table.suivi td { padding: 10px 4px; border-top: 1px solid var(--bord); vertical-align: top; }
table.suivi .resultat { font-weight: 700; color: var(--or); white-space: nowrap; font-variant-numeric: tabular-nums; }
.graphe { width: 100%; height: 120px; margin: 6px 0 2px; }
.graphe .trait { stroke: var(--bleu); stroke-width: 2.5; fill: none; }
.graphe .pt { fill: var(--or); }
.graphe .axe { stroke: var(--bord); stroke-width: 1; }

/* --------------------------------------------------------------- divers */
.champ { width: 100%; padding: 14px; border-radius: 12px; border: 1px solid var(--bord);
  background: var(--fond-carte); color: var(--texte); font: inherit; }
textarea.champ { min-height: 84px; resize: vertical; }
.etiquette { display: block; font-size: 13px; color: var(--texte-doux); margin: 14px 0 6px; }
.puces { margin: 6px 0; padding-left: 20px; }
.puces li { margin-bottom: 5px; }
.alerte { background: #2a1f16; border: 1px solid #4a3620; color: #ffd79a;
  padding: 10px 12px; border-radius: 10px; font-size: 14px; margin: 10px 0; }
.badge { display: inline-block; padding: 3px 9px; border-radius: 20px; background: var(--fond-carte-haut);
  color: var(--texte-doux); font-size: 12px; font-weight: 600; }
.rien { color: var(--texte-doux); text-align: center; padding: 28px 0; }
.connexion { max-width: 320px; margin: 18vh auto 0; }

@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
