/* MyGolfPlan : téléphone d'abord, ordinateur pour l'espace entraîneur. */
:root {
  --vert: #2e7d32;
  --vert-fonce: #1b5e20;
  --vert-clair: #e8f5e9;
  --fond: #f4f8f1;
  --carte: #ffffff;
  --texte: #1f2a22;
  --discret: #5f6f63;
  --bord: #d6e2d3;
  --rouge: #c62828;
  --orange: #ef6c00;
  --bleu: #1565c0;
  --rayon: 14px;
  --ombre: 0 1px 3px rgba(20, 50, 25, .08), 0 4px 14px rgba(20, 50, 25, .05);
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--fond); color: var(--texte);
  font: 16px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  padding-bottom: calc(76px + env(safe-area-inset-bottom));
}
a { color: var(--vert-fonce); }
h1 { font-size: 1.5rem; margin: .4rem 0 .8rem; }
h2 { font-size: 1.15rem; margin: 0 0 .6rem; }
h3 { font-size: 1rem; margin: 1rem 0 .4rem; }
img, svg { max-width: 100%; }

/* En-tête et navigation */
.entete {
  position: sticky; top: 0; z-index: 10; display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  padding: calc(8px + env(safe-area-inset-top)) 16px 8px; background: var(--vert); color: #fff;
}
.marque { display: flex; align-items: center; gap: 8px; color: #fff; font-weight: 700; text-decoration: none; }
.marque img { border-radius: 7px; background: #fff; }
.nav-haut { display: none; gap: 4px; margin-left: auto; }
.nav-haut a { color: #fff; text-decoration: none; padding: 6px 10px; border-radius: 8px; }
.nav-haut a:hover { background: rgba(255,255,255,.15); }
.nav-haut .lien-entraineur { background: rgba(255,255,255,.18); font-weight: 600; }
.etat-synchro { font-size: .8rem; padding: 3px 10px; border-radius: 99px; background: #fff; color: var(--texte); margin-left: auto; }
.etat-synchro.attente { background: #fff3e0; color: #8a4b00; }
.etat-synchro.erreur { background: #ffebee; color: var(--rouge); }
.etat-synchro.hors-ligne { background: #eceff1; }
.nav-bas {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 10; display: flex; background: #fff;
  border-top: 1px solid var(--bord); padding-bottom: env(safe-area-inset-bottom);
}
.nav-bas a { flex: 1; display: flex; flex-direction: column; align-items: center; padding: 8px 0 6px;
  font-size: .72rem; color: var(--discret); text-decoration: none; min-height: 56px; justify-content: center; }
.nav-bas a span { font-size: 1.3rem; line-height: 1.1; }
.sous-nav { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; padding: 8px 16px; background: var(--vert-clair);
  border-bottom: 1px solid var(--bord); font-size: .92rem; }
.sous-nav a { padding: 4px 10px; border-radius: 8px; text-decoration: none; }
.sous-nav a:hover { background: #fff; }
.sous-nav strong { margin-right: 6px; color: var(--vert-fonce); }

.contenu { max-width: 760px; margin: 0 auto; padding: 12px 16px 24px; }
.espace-entraineur .contenu { max-width: 1200px; }

/* Cartes et blocs */
.carte { background: var(--carte); border-radius: var(--rayon); box-shadow: var(--ombre); padding: 16px; margin: 0 0 14px; }
.carte.etroite { max-width: 460px; margin-left: auto; margin-right: auto; }
.carte.alerte-douce { background: #fff8e1; }
.carte.commentaire { border-left: 5px solid var(--bleu); }
blockquote { margin: .4rem 0 .8rem; padding: 8px 12px; background: #f1f6fb; border-radius: 10px; }
.grille-cartes { display: grid; gap: 14px; grid-template-columns: 1fr; }
.grille-cartes > .carte { margin: 0; }
.grille-cartes { margin-bottom: 14px; }
.grille-fiche { display: grid; gap: 14px; grid-template-columns: 1fr; margin-bottom: 14px; }
.grille-fiche > .carte { margin: 0; }
.titre-ligne { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.titre-ligne h1, .titre-ligne h2 { margin-bottom: .4rem; }
.discret { color: var(--discret); }
.petit { font-size: .88rem; }
.infos { color: var(--discret); font-size: .92rem; margin-top: 0; }
.liste { padding-left: 1.2rem; margin: .3rem 0 .6rem; }
.liste li { margin: .25rem 0; }
.consignes { white-space: pre-line; }

/* Messages */
.messages { margin-bottom: 10px; }
.message { padding: 10px 14px; border-radius: 10px; background: var(--vert-clair); margin: 0 0 8px; }
.message.error, .message.erreur { background: #ffebee; color: var(--rouge); }
.message.info { background: #e3f2fd; }
.message.succes, .message.success { background: var(--vert-clair); }
.erreurs { background: #ffebee; color: var(--rouge); padding: 8px 12px; border-radius: 10px; margin-bottom: 10px; }
.erreurs p { margin: .2rem 0; }
.erreur { color: var(--rouge); display: block; }

/* Pastilles */
.pastille { display: inline-block; font-size: .75rem; padding: 2px 9px; border-radius: 99px; background: #eceff1; color: #37474f; font-weight: 600; }
.pastille.ok { background: var(--vert-clair); color: var(--vert-fonce); }
.pastille.alerte { background: #fff3e0; color: #8a4b00; }
.mode-putting { background: #e3f2fd; color: #0d47a1; }
.mode-chipping { background: #fff3e0; color: #8a4b00; }
.mode-practice { background: var(--vert-clair); color: var(--vert-fonce); }

/* Formulaires */
.champ { margin-bottom: 14px; }
.champ label { display: block; font-weight: 600; margin-bottom: 4px; }
.champ-case label { font-weight: 400; display: flex; gap: 10px; align-items: flex-start; }
.champ-case input { width: 22px; height: 22px; flex: none; margin-top: 2px; }
input[type=text], input[type=email], input[type=password], input[type=number], input[type=date], input[type=search],
input:not([type]), select, textarea {
  width: 100%; font: inherit; padding: 11px 12px; border: 1px solid var(--bord); border-radius: 10px; background: #fff; min-height: 46px;
}
textarea { min-height: 80px; }
.champ ul { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 6px 14px; }
.champ ul label { font-weight: 400; display: flex; gap: 6px; align-items: center; }
.aide { display: block; color: var(--discret); font-size: .85rem; margin-top: 3px; }
.ligne-form { display: flex; gap: 8px; align-items: center; }
.ligne-form input { max-width: 140px; }
.en-ligne { display: inline; }
.recherche { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 12px; }
.recherche input[type=search] { flex: 1 1 220px; width: auto; }
.recherche select { width: auto; }
details { margin: .6rem 0; }
summary { cursor: pointer; color: var(--vert-fonce); font-weight: 600; padding: 6px 0; }

/* Boutons */
.bouton, button.bouton {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; font: inherit; font-weight: 600;
  padding: 10px 16px; min-height: 46px; border-radius: 12px; border: 1px solid var(--bord); background: #fff;
  color: var(--vert-fonce); text-decoration: none; cursor: pointer; margin: 2px 0;
}
.bouton.principal { background: var(--vert); color: #fff; border-color: var(--vert); }
.bouton.principal:hover { background: var(--vert-fonce); }
.bouton.danger { color: var(--rouge); border-color: #f3c6c6; }
.bouton.danger.large { background: var(--rouge); color: #fff; }
.bouton.discret { border-color: transparent; background: transparent; color: var(--discret); }
.bouton.large { width: 100%; min-height: 54px; font-size: 1.05rem; }
.bouton.rond { width: 46px; padding: 0; border-radius: 50%; font-size: 1.4rem; }
.bouton.petit-bouton { min-height: 36px; padding: 4px 12px; font-size: .9rem; }
.bouton:disabled { opacity: .5; }
.lien-bouton { background: none; border: 0; color: var(--rouge); cursor: pointer; font: inherit; font-size: .88rem; padding: 0 4px; text-decoration: underline; }

/* Accueil */
.bonjour { margin-top: .2rem; }
.choix-seance { display: grid; gap: 10px; margin-bottom: 14px; }
.tuile { display: flex; flex-direction: column; gap: 2px; padding: 16px; border-radius: var(--rayon); background: #fff;
  box-shadow: var(--ombre); text-decoration: none; color: var(--texte); border-left: 6px solid var(--vert); }
.tuile strong { font-size: 1.1rem; color: var(--vert-fonce); }
.tuile.principale { background: var(--vert); color: #fff; border-left-color: #a5d6a7; }
.tuile.principale strong { color: #fff; }
.tuile.tuile-admin { border-left-color: var(--bleu); }
.tuile.tuile-admin strong { color: var(--bleu); }
.seances { list-style: none; padding: 0; margin: 0 0 8px; }
.ligne-seance a { display: grid; grid-template-columns: auto 1fr; gap: 0 12px; padding: 10px 0; border-bottom: 1px solid var(--bord);
  text-decoration: none; color: var(--texte); }
.ligne-seance .date { font-weight: 700; grid-row: span 2; }
.ligne-seance .score { color: var(--discret); font-size: .9rem; }
.progression { height: 12px; background: var(--vert-clair); border-radius: 99px; overflow: hidden; }
.progression div { height: 100%; background: var(--vert); }

/* Choix des gestes et durée */
fieldset.gestes { border: 0; padding: 0; margin: 0 0 10px; }
fieldset.gestes legend { font-weight: 700; margin-bottom: 6px; color: var(--discret); font-size: .9rem; text-transform: uppercase; letter-spacing: .03em; }
.puce { display: inline-block; margin: 0 6px 8px 0; }
.puce input { position: absolute; opacity: 0; }
.puce span { display: inline-block; padding: 10px 14px; border-radius: 99px; border: 2px solid var(--bord); background: #fff; cursor: pointer; }
.puce input:checked + span { background: var(--vert); color: #fff; border-color: var(--vert); }
.puce input:focus-visible + span { outline: 3px solid #81c784; }
.duree { display: flex; align-items: center; gap: 10px; justify-content: center; margin: 4px 0 10px; }
.duree input { width: 96px; text-align: center; font-size: 1.4rem; font-weight: 700; }

/* Séance */
.etapes { list-style: none; padding: 0; margin: 0; counter-reset: etape; }
.etape { position: relative; }
.etape h2 { padding-right: 4px; }
.exercice.faite { opacity: .75; border-left: 5px solid var(--vert); }
.media { margin: 8px 0; }
.media .schema, .media-double .schema { display: block; width: 100%; height: auto; border-radius: 14px; }
.video-exercice { display: block; width: 100%; aspect-ratio: 16 / 9; border: 0; border-radius: 14px; background: #000; margin: 8px 0 4px; }
.video-youtube { margin: 8px 0; }
.media-double { display: grid; gap: 10px; grid-template-columns: 1fr; }
.saisie-rapide { display: grid; grid-template-columns: 1fr auto 1fr; gap: 10px; align-items: center; margin: 12px 0 6px; }
.gros { min-height: 64px; border-radius: 16px; border: 0; font: inherit; font-size: 1.1rem; font-weight: 700; cursor: pointer;
  touch-action: manipulation; -webkit-tap-highlight-color: transparent; }
.gros:active { transform: scale(.97); }
.gros.ok { background: var(--vert); color: #fff; }
.gros.ko { background: #eceff1; color: #37474f; }
.compteur { font-size: 1.4rem; font-weight: 700; min-width: 70px; text-align: center; }
.actions-ligne { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 8px; }
.case-fait { display: flex; gap: 8px; align-items: center; font-weight: 600; }
.case-fait input { width: 24px; height: 24px; }
.bascule { display: flex; border: 2px solid var(--vert); border-radius: 12px; overflow: hidden; margin: 10px 0; }
.bascule button { flex: 1; min-height: 44px; border: 0; background: #fff; font: inherit; font-weight: 600; color: var(--vert-fonce); cursor: pointer; }
.bascule button[aria-pressed=true] { background: var(--vert); color: #fff; }
.serie { border: 1px solid var(--bord); border-radius: 12px; padding: 10px; margin-bottom: 10px; }
.serie.courante { border: 2px solid var(--vert); background: #fbfefa; }
.titre-serie { background: none; border: 0; font: inherit; font-weight: 700; padding: 0; cursor: pointer; color: var(--texte); text-align: left; width: 100%; }
.points-balles { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0; }
.balle { width: 20px; height: 20px; border-radius: 50%; border: 2px solid #90a4ae; }
.balle.vide { background: #fff; }
.balle.r0 { background: var(--vert); border-color: var(--vert); }
.balle.r1 { background: #9ccc65; border-color: #9ccc65; }
.balle.r2 { background: #ffca28; border-color: #ffca28; }
.balle.r3 { background: #b0bec5; border-color: #b0bec5; }
.boutons-resultats { display: grid; gap: 8px; grid-template-columns: 1fr 1fr; }
.boutons-resultats .gros.r0 { background: var(--vert); color: #fff; }
.boutons-resultats .gros.r1 { background: #9ccc65; color: #1b3a10; }
.boutons-resultats .gros.r2 { background: #ffca28; color: #4a3800; }
.boutons-resultats .gros.r3 { background: #eceff1; color: #37474f; }
.boutons-resultats.n2 .gros.r1 { background: #eceff1; color: #37474f; }
.ligne-total { display: grid; grid-template-columns: 1fr auto 40px auto; gap: 8px; align-items: center; margin: 6px 0; }
.ligne-total strong { text-align: center; font-size: 1.2rem; }
.score-provisoire { font-weight: 700; text-align: right; }

/* Résultats et statistiques */
.resultat-test { display: flex; gap: 16px; align-items: center; margin-bottom: 10px; }
.gros-score { width: 96px; height: 96px; flex: none; border-radius: 50%; background: var(--vert); color: #fff;
  display: flex; align-items: baseline; justify-content: center; padding-top: 22px; }
.gros-score strong { font-size: 2.2rem; line-height: 1; }
.gros-score span { font-size: .9rem; opacity: .85; }
.ecart.hausse, .tendance.hausse { color: var(--vert); font-weight: 700; }
.ecart.baisse, .tendance.baisse { color: var(--rouge); font-weight: 700; }
.tendance.stable { color: var(--discret); }
svg.courbe { width: 100%; max-width: 560px; height: auto; display: block; }
svg.courbe .grille { stroke: #e3ebe1; stroke-width: 1; }
svg.courbe .axe { font-size: 10px; fill: var(--discret); }
.legende { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: .82rem; color: var(--discret); margin-top: 4px; }
.legende i { display: inline-block; width: 12px; height: 12px; border-radius: 3px; margin-right: 5px; vertical-align: -1px; }

/* Tableaux */
.tableau-defilant { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.tableau { width: 100%; border-collapse: collapse; background: #fff; border-radius: var(--rayon); overflow: hidden; box-shadow: var(--ombre); }
.tableau th, .tableau td { padding: 10px 12px; text-align: left; border-bottom: 1px solid var(--bord); vertical-align: top; }
.tableau th { background: var(--vert-clair); font-size: .85rem; color: var(--vert-fonce); }
.tableau.compact { box-shadow: none; font-size: .92rem; }
.tableau.compact th, .tableau.compact td { padding: 6px 8px; }
.tableau tr.inactif, .inactif { opacity: .55; }
.fiche-exercice .media { margin-top: 0; }

/* Ordinateur */
@media (min-width: 900px) {
  body { padding-bottom: 0; }
  .nav-bas { display: none; }
  .nav-haut { display: flex; }
  .etat-synchro { margin-left: 0; }
  .grille-cartes { grid-template-columns: repeat(2, 1fr); }
  .espace-entraineur .grille-cartes { grid-template-columns: repeat(3, 1fr); }
  .grille-fiche { grid-template-columns: 1fr 1fr; }
  .choix-seance { grid-template-columns: repeat(2, 1fr); }
  .media-double { grid-template-columns: 1fr 1fr; }
}
@media (prefers-reduced-motion: reduce) {
  .media-anime animate, .media-anime animateMotion { display: none; }
}

/* Paramètres de l'exercice pour le niveau du joueur */
.consigne-niveau { background: var(--vert-clair); color: var(--vert-fonce); padding: 8px 12px; border-radius: 10px; }
.niveaux-exercice th { width: 34%; }
