/* La Flemme Run — styles */
:root {
  --fond: #fff8f3;
  --carte: #ffffff;
  --texte: #2d2420;
  --doux: #6f625b;
  --corail: #e8735a;
  --corail-fonce: #b9482f;
  --sauge: #5f8f7b;
  --sauge-clair: #e3efe9;
  --peche: #fde4d8;
  --bord: #efe2da;
  --ombre: 0 2px 10px rgba(80, 40, 20, .07);
  --rayon: 18px;
  --bouton: #b9482f;       /* corail foncé : texte blanc lisible (contraste > 4,5) */
  --fond-course: #b9482f;
  --fond-marche: #3f6b5a;
}
@media (prefers-color-scheme: dark) {
  :root {
    --fond: #1d1917; --carte: #2a2421; --texte: #f6ece6; --doux: #c2b3aa;
    --corail: #f08a72; --corail-fonce: #ffb39f; --sauge: #8fc0aa; --sauge-clair: #24342d;
    --peche: #3d2b24; --bord: #3b322e; --ombre: none;
  }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--fond); color: var(--texte);
  font: 17px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  padding-bottom: calc(76px + env(safe-area-inset-bottom));
}
main { max-width: 540px; margin: 0 auto; padding: 16px 16px 24px; }
h1 { font-size: 1.6rem; margin: 0; line-height: 1.2; }
h2 { font-size: 1.2rem; margin: .2em 0 .5em; line-height: 1.3; }
h3 { font-size: 1.05rem; margin: 0 0 .3em; }
p { margin: .4em 0; }
a { color: var(--corail-fonce); }
.petit { font-size: .88rem; color: var(--doux); }
.centre { text-align: center; }
.surtitre { font-size: .8rem; text-transform: uppercase; letter-spacing: .06em; color: var(--sauge); font-weight: 700; margin: 0 0 .2em; }

.carte { background: var(--carte); border: 1px solid var(--bord); border-radius: var(--rayon); padding: 16px 18px; margin: 0 0 14px; box-shadow: var(--ombre); }
.hero { text-align: center; background: var(--peche); border: none; }
.mascotte { font-size: 3.4rem; line-height: 1; margin: 4px 0 8px; }
.petite-carte { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 4px 12px; }
.petite-carte h3, .petite-carte p { grid-column: 1; margin: 0; }
.petite-carte p { font-size: .9rem; color: var(--doux); }
.petite-carte .btn { grid-column: 2; grid-row: 1 / span 2; }
.conseillee { border: 2px solid var(--sauge); }

.entete { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 4px 0 14px; }
.entete .icone { font-size: 1.4rem; text-decoration: none; min-width: 44px; min-height: 44px; display: grid; place-items: center; border-radius: 50%; color: var(--texte); }
.entete .icone:hover { background: var(--peche); }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 46px; padding: 10px 18px; border-radius: 999px; border: 2px solid var(--corail);
  background: transparent; color: var(--corail-fonce); font: inherit; font-weight: 600; text-decoration: none; cursor: pointer;
}
.btn.principal { background: var(--bouton); border-color: var(--bouton); color: #fff; width: 100%; margin-top: 10px; }
.btn.danger { border-color: #c0392b; color: #c0392b; }
.btn:focus-visible, .puce:focus-visible, .lien:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 3px solid var(--sauge); outline-offset: 2px; }
.lien { background: none; border: none; color: var(--doux); text-decoration: underline; font: inherit; font-size: .9rem; padding: 10px 0 0; cursor: pointer; display: block; margin: 0 auto; }

label { display: block; margin: 0 0 12px; font-weight: 600; font-size: .95rem; }
input:not([type=radio]):not([type=checkbox]), select, textarea {
  display: block; width: 100%; margin-top: 4px; padding: 11px 12px; font: inherit; font-weight: 400;
  border: 1px solid var(--bord); border-radius: 12px; background: var(--fond); color: var(--texte);
}
fieldset { border: none; padding: 0; margin: 0 0 14px; }
legend { font-weight: 700; margin-bottom: 6px; padding: 0; }
.choix { font-weight: 400; display: flex; gap: 10px; align-items: center; padding: 10px 12px; border: 1px solid var(--bord); border-radius: 12px; margin-bottom: 8px; }
.choix input { width: 20px; height: 20px; accent-color: var(--corail); }
.deux { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.bascule { font-weight: 400; display: flex; gap: 10px; align-items: center; }
.bascule input { width: 22px; height: 22px; accent-color: var(--corail); }

.bandeau { background: var(--sauge-clair); border-left: 5px solid var(--sauge); padding: 12px 14px; border-radius: 12px; margin: 0 0 12px; }
.alerte { background: var(--peche); border-left: 5px solid var(--corail); padding: 10px 12px; border-radius: 10px; }
.ok { color: var(--sauge); font-weight: 600; }

.compte { display: grid; grid-template-columns: repeat(3, 1fr); text-align: center; padding: 12px; }
.compte strong { display: block; font-size: 1.5rem; color: var(--corail-fonce); }
.compte span { font-size: .78rem; color: var(--doux); display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.statut { font-size: .92rem; margin: -4px 4px 14px; color: var(--doux); }
.statut-serre, .statut-apres { color: var(--corail-fonce); font-weight: 600; }
.seance { border: 2px solid var(--corail); }
.seance h2 { font-size: 1.35rem; }
.meta { color: var(--doux); font-size: .92rem; }
.liste { padding-left: 1.2em; margin: .4em 0; }
.liste li { margin-bottom: 6px; }

.puces { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0 12px; }
.puce { border: 1.5px solid var(--bord); background: var(--fond); color: var(--texte); border-radius: 999px; padding: 9px 14px; font: inherit; font-size: .92rem; cursor: pointer; min-height: 42px; }
.puce.choisie { background: var(--bouton); border-color: var(--bouton); color: #fff; }

#respiration { text-align: center; }
.bulle { width: 70px; height: 70px; border-radius: 50%; background: var(--sauge); opacity: .7; margin: 18px auto 8px; transition: transform 4s ease-in-out; }
.bulle.gonfle { transform: scale(1.8); transition-duration: 4s; }
.bulle.degonfle { transform: scale(1); transition-duration: 6s; }
.consigne { font-weight: 600; }
@media (prefers-reduced-motion: reduce) { .bulle, .bulle.gonfle, .bulle.degonfle { transition: none; } }

.chrono { text-align: center; padding: 24px 16px; border-radius: 26px; min-height: 78vh; display: flex; flex-direction: column; justify-content: center; gap: 8px; }
.chrono.course { background: var(--fond-course); color: #fff; }
.chrono.marche { background: var(--fond-marche); color: #fff; }
.chrono .surtitre, .chrono .petit { color: rgba(255, 255, 255, .9); }
.chrono h1 { font-size: 2.2rem; }
.grand { font-size: 5rem; font-weight: 800; font-variant-numeric: tabular-nums; margin: 0; line-height: 1.1; }
.barre { height: 10px; background: rgba(255, 255, 255, .3); border-radius: 99px; overflow: hidden; margin: 10px 0; }
.barre div { height: 100%; background: #fff; width: 0; transition: width .25s linear; }
.boutons { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 14px; }
.chrono .btn { border-color: #fff; color: #fff; }
.chrono .btn.principal { background: #fff; border-color: #fff; color: #2d2420; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
h1:focus { outline: none; }

.echelle > div, .echelle { margin-bottom: 14px; }
.echelle label { display: inline-block; margin: 0 2px 0 0; }
.echelle input { position: absolute; opacity: 0; }
.echelle span { display: inline-flex; flex-direction: column; align-items: center; justify-content: center; width: 50px; height: 58px; border: 1.5px solid var(--bord); border-radius: 14px; font-size: 1.5rem; cursor: pointer; }
.echelle small { font-size: .7rem; color: var(--doux); }
.echelle input:checked + span { border-color: var(--corail); background: var(--peche); }
.echelle input:focus-visible + span { outline: 3px solid var(--sauge); outline-offset: 2px; }

table.plan { width: 100%; border-collapse: collapse; font-size: .88rem; }
.plan th, .plan td { text-align: left; padding: 6px 4px; border-bottom: 1px solid var(--bord); vertical-align: top; }
.plan th { color: var(--doux); font-weight: 600; }
.plan tr.courante td { background: var(--peche); font-weight: 700; }
.plan small { color: var(--sauge); font-weight: 600; }

.graph { width: 100%; height: auto; margin-top: 8px; }
.graph .grille { stroke: var(--bord); stroke-width: 1; }
.graph .axe { fill: var(--doux); font-size: 10px; text-anchor: end; }
.graph polyline { fill: none; stroke-width: 2.5; stroke-linejoin: round; stroke-linecap: round; }
.s-plaisir { stroke: var(--corail); }
.s-fatigue { stroke: #8a6fb5; }
.s-dos { stroke: var(--sauge); }
.legende { display: flex; gap: 14px; font-size: .85rem; color: var(--doux); }
.legende span::before { content: ""; display: inline-block; width: 18px; height: 0; border-top: 3px solid; margin-right: 6px; vertical-align: middle; }
.s-plaisir-l::before { border-color: var(--corail) !important; }
.s-fatigue-l::before { border-color: #8a6fb5 !important; border-top-style: dashed !important; }
.s-dos-l::before { border-color: var(--sauge) !important; border-top-style: dotted !important; }
.entree h3 { font-size: 1rem; }
.notes { font-size: .9rem; color: var(--doux); }
blockquote { margin: 6px 0 0; padding: 6px 12px; border-left: 3px solid var(--corail); font-style: italic; }

.texte-visu p { color: var(--doux); transition: color .3s; }
.texte-visu p.en-cours { color: var(--texte); font-weight: 600; }

nav#nav {
  position: fixed; left: 0; right: 0; bottom: 0; display: flex; justify-content: space-around;
  background: var(--carte); border-top: 1px solid var(--bord); padding: 6px 4px calc(6px + env(safe-area-inset-bottom)); z-index: 10;
}
nav#nav[hidden] { display: none; }
nav#nav a { display: flex; flex-direction: column; align-items: center; font-size: .72rem; color: var(--doux); text-decoration: none; min-width: 60px; padding: 4px; border-radius: 12px; }
nav#nav a span { font-size: 1.3rem; }
nav#nav a.actif { color: var(--corail-fonce); background: var(--peche); font-weight: 700; }
