/* Parkour Zazou — couleurs reprises de la salle de Nick : tapis rouges et bleus. */
:root {
  --fond: #0f1630; --carte: #1b2550; --carte2: #243066;
  --rouge: #e8463a; --bleu: #2f6fde; --jaune: #ffd23f; --vert: #2ec27e;
  --texte: #f5f7ff; --doux: #aab4e0;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { overflow-x: hidden; }
html, body { margin: 0; height: 100%; background: var(--fond); color: var(--texte);
  font: 600 18px/1.3 system-ui, -apple-system, 'Segoe UI', sans-serif; }
body { overscroll-behavior: none; -webkit-user-select: none; user-select: none; }
button { font: inherit; color: inherit; border: 0; cursor: pointer; }
svg { display: block; }

#barre { position: sticky; top: 0; z-index: 10; display: flex; align-items: center; gap: 12px;
  padding: calc(10px + env(safe-area-inset-top, 0px)) 16px 10px; background: var(--fond); }
#titre { flex: 1; margin: 0; font-size: 24px; letter-spacing: .5px; }
.rond { width: 56px; height: 56px; border-radius: 50%; background: var(--carte2); display: grid; place-items: center; }
.rond svg { width: 30px; height: 30px; fill: none; stroke: var(--texte); stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.rond svg .plein { fill: var(--texte); }
.rond[hidden] { display: none; }

#ecran { padding: 8px 16px calc(96px + env(safe-area-inset-bottom, 0px)); max-width: 1100px; margin: 0 auto; }

#parent { position: fixed; right: 14px; bottom: calc(14px + env(safe-area-inset-bottom, 0px)); width: 40px; height: 40px;
  border-radius: 50%; background: transparent; opacity: .45; display: grid; place-items: center; }
#parent svg { width: 22px; height: 22px; fill: none; stroke: var(--doux); stroke-width: 2; }
#parent svg .plein { fill: var(--doux); }

/* Accueil */
.tuiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 18px; margin-top: 12px; }
.tuile { background: var(--carte); border-radius: 28px; padding: 18px; display: flex; flex-direction: column; align-items: center;
  gap: 10px; min-height: 260px; box-shadow: 0 6px 0 rgba(0,0,0,.35); transition: transform .1s; }
.tuile:active { transform: translateY(4px); box-shadow: 0 2px 0 rgba(0,0,0,.35); }
.tuile .picto, .tuile .ico { width: 170px; height: 170px; }
.tuile b { font-size: 24px; }
.t-figures { border-bottom: 8px solid var(--rouge); }
.t-quiz { border-bottom: 8px solid var(--jaune); }
.t-echelle { border-bottom: 8px solid var(--vert); }
.ico-q { font: 900 120px/170px system-ui; color: var(--jaune); text-align: center; }

/* Grille de cartes */
.grille { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 14px; }
.carte { background: var(--carte); border-radius: 22px; padding: 10px 10px 14px; display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center; }
.carte .picto { width: 120px; height: 120px; }
.carte small { color: var(--doux); font-weight: 600; font-size: 14px; }
.carte.verrouillee { opacity: .5; }
.carte .cadenas { width: 120px; height: 120px; display: grid; place-items: center; }
.carte .cadenas svg { width: 60px; height: 60px; fill: none; stroke: var(--doux); stroke-width: 2; }
.etoiles { color: var(--jaune); font-size: 20px; letter-spacing: 2px; min-height: 24px; }

.niveau h2 { font-size: 20px; margin: 22px 4px 10px; color: var(--doux); }

/* Fiche */
.fiche { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 760px) { .fiche { grid-template-columns: 1fr; } }
.bloc { background: var(--carte); border-radius: 24px; padding: 14px; }
.bloc h3 { margin: 0 0 8px; font-size: 18px; color: var(--doux); display: flex; align-items: center; gap: 8px; }
.bloc .picto { width: 100%; max-width: 260px; margin: 0 auto; }
.pastille { display: inline-block; width: 14px; height: 14px; border-radius: 50%; }
.p-nick { background: #ff3b3b; } .p-zazou { background: var(--jaune); }
.nom-en { color: var(--doux); font-size: 16px; }
.attention { border-left: 6px solid var(--rouge); padding-left: 10px; margin: 8px 0; font-weight: 600; }
.astuce { border-left: 6px solid var(--vert); padding-left: 10px; margin: 8px 0; font-weight: 600; }

/* Vidéo muette : un bouclier empêche de toucher la vidéo (pas de sortie vers YouTube). */
.clip { position: relative; width: 100%; aspect-ratio: 16 / 9; border-radius: 18px; overflow: hidden; background: #000; }
.clip .yt, .clip iframe { position: absolute; inset: 0; width: 100%; height: 100%; }
/* Iframe plus haute que le cadre : la vidéo garde sa taille (bandes noires ajoutées par YouTube),
   le titre en haut et la barre « Plus de vidéos » en bas sortent du cadre. */
.clip:not(.atelier) iframe { top: -70px; height: calc(100% + 140px); }
.clip .bouclier { position: absolute; inset: 0; z-index: 2; }
.clip .hors-ligne { position: absolute; inset: 0; display: grid; place-items: center; color: var(--doux); font-size: 16px; text-align: center; padding: 12px; }

/* Gros boutons */
.gros { border-radius: 26px; padding: 18px 26px; font-size: 24px; font-weight: 800; display: inline-flex; align-items: center; justify-content: center; gap: 12px; min-height: 88px; box-shadow: 0 6px 0 rgba(0,0,0,.35); }
.gros:active { transform: translateY(4px); box-shadow: 0 2px 0 rgba(0,0,0,.35); }
.gros svg { width: 46px; height: 46px; fill: none; stroke: #fff; stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
.g-vert { background: var(--vert); } .g-rouge { background: var(--rouge); } .g-bleu { background: var(--bleu); } .g-jaune { background: var(--jaune); color: #1b1b1b; }
.g-jaune svg { stroke: #1b1b1b; }
.choix { display: flex; gap: 18px; justify-content: center; margin-top: 16px; flex-wrap: wrap; }
.choix .gros { flex: 1; min-width: 180px; max-width: 320px; }

#ecran > .clip { max-width: calc(55vh * 16 / 9); margin: 0 auto; }
.quiz-haut { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.verdict { text-align: center; margin-top: 16px; }
.verdict .grand { width: 120px; height: 120px; margin: 0 auto; }
.verdict .grand svg { width: 100%; height: 100%; fill: none; stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }

/* Verrou adulte */
#verrou { position: fixed; inset: 0; z-index: 50; background: rgba(5, 9, 25, .88); display: grid; place-items: center; }
#verrou[hidden] { display: none; }
.verrou-boite { background: var(--carte); border-radius: 24px; padding: 20px; width: min(360px, 92vw); text-align: center; }
.verrou-q { margin: 0; color: var(--doux); }
.verrou-calc { font-size: 36px; margin: 6px 0; }
.verrou-rep { font-size: 30px; min-height: 40px; margin: 0 0 10px; color: var(--jaune); }
.pave { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.pave button { background: var(--carte2); border-radius: 14px; height: 56px; font-size: 24px; }
.verrou-annuler { margin-top: 12px; background: transparent; color: var(--doux); text-decoration: underline; }

/* Espace parent : sobre, lisible, c'est pour un adulte. */
.parent { font-weight: 500; font-size: 16px; }
.parent h2 { font-size: 20px; margin: 18px 0 8px; }
.parent p { margin: 6px 0; color: var(--doux); }
.parent .regle { background: var(--carte); border-left: 6px solid var(--rouge); padding: 12px; border-radius: 12px; color: var(--texte); }
.ligne-val { display: flex; align-items: center; gap: 12px; background: var(--carte); border-radius: 14px; padding: 10px 12px; margin: 6px 0; }
.ligne-val .picto { width: 54px; height: 54px; flex: none; }
.ligne-val label { flex: 1; }
.ligne-val input { width: 28px; height: 28px; }
.ligne-val small { display: block; color: var(--doux); font-weight: 400; }
.btn { background: var(--carte2); border-radius: 12px; padding: 10px 14px; font-size: 15px; font-weight: 600; }
.btn.actif { background: var(--bleu); }
.reglage { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0; }
.temps { font: 700 22px ui-monospace, monospace; color: var(--jaune); }
textarea { width: 100%; min-height: 120px; background: #0a0f22; color: var(--texte); border: 1px solid var(--carte2); border-radius: 10px; font: 13px ui-monospace, monospace; padding: 8px; -webkit-user-select: text; user-select: text; }
