/* GRIMPO — design « cahier d'écolier » de Madame Luma (copie autonome des couleurs de letopweb.org) */
@font-face { font-family: "Andika"; font-style: normal; font-weight: 400; font-display: swap; src: url(fonts/andika-400.woff2) format("woff2"); }
@font-face { font-family: "Andika"; font-style: normal; font-weight: 700; font-display: swap; src: url(fonts/andika-700.woff2) format("woff2"); }
@font-face { font-family: "Playwrite FR Moderne"; font-style: normal; font-weight: 400; font-display: swap; src: url(fonts/playwrite-fr-moderne.woff2) format("woff2"); }

:root {
  --ciel: #E8F0FB; --papier: #FFFFFF; --seyes-fin: #CFDBF3; --seyes-fort: #9FB3E2; --marge-rouge: #E8697A;
  --couverture: #FFC83D; --couverture-fonce: #E0A615; --couverture-pale: #FFF4D6;
  --encre: #1B2A4A; --stylo: #2346B5; --vert: #1C7F50; --vert-pale: #DDF3E8; --rouge: #B3261E; --gris: #4F5D7C; --surface: #F4F7FD;
  --sapin: #2E8B57; --sapin-fonce: #1F6B42;
  --cp: #FFC83D; --ce1: #7ED3AE; --ce2: #9FB3E2; --cm1: #F4A3A9; --cm2: #C8A8EA; --grand: #F2A541;
  --marge: 40px;
  --manuscrite: "Playwrite FR Moderne", "Segoe Script", cursive;
  --lisible: "Andika", "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  color-scheme: light;
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--ciel); color: var(--encre); font-family: var(--lisible); font-size: 18px; line-height: 1.5;
  padding: env(safe-area-inset-top, 0) env(safe-area-inset-right, 0) env(safe-area-inset-bottom, 0) env(safe-area-inset-left, 0);
  -webkit-tap-highlight-color: transparent; overscroll-behavior-y: contain;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--stylo); }
button { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--stylo); outline-offset: 3px; border-radius: 8px; }
[hidden] { display: none !important; }
.bandeau-test { background: #FDE2E4; color: #7A1F2B; text-align: center; font-size: 13px; padding: 4px 10px; }

.appli { max-width: 780px; margin: 0 auto; padding: 12px 14px 24px; }
.ecran { animation: g-entre .25s ease-out; }
@keyframes g-entre { from { opacity: 0; transform: translateY(8px); } }

/* Cahier et papier Seyès (comme le site) */
.cahier { border: 10px solid var(--couverture); border-radius: 22px; background: var(--papier); overflow: hidden; box-shadow: 0 6px 18px rgba(27, 42, 74, .08); }
.seyes {
  background-color: var(--papier);
  background-image:
    linear-gradient(90deg, transparent calc(var(--marge) - 1px), var(--marge-rouge) calc(var(--marge) - 1px), var(--marge-rouge) calc(var(--marge) + 1px), transparent calc(var(--marge) + 1px)),
    repeating-linear-gradient(180deg, transparent 0 31px, var(--seyes-fort) 31px 32px),
    repeating-linear-gradient(180deg, transparent 0 7px, var(--seyes-fin) 7px 8px),
    repeating-linear-gradient(90deg, transparent 0 31px, var(--seyes-fin) 31px 32px);
}
.page { padding: 18px 16px 20px calc(var(--marge) + 12px); }

/* Titres */
.logo-grimpo { font-family: var(--manuscrite); font-weight: 400; font-size: clamp(46px, 13vw, 72px); line-height: 1.35; margin: 4px 0 14px; text-align: center; color: var(--encre); }
.sous-titre { text-align: center; margin: 0 0 12px; font-weight: 700; color: var(--gris); }
.titre-ecran { font-family: var(--manuscrite); font-weight: 400; font-size: clamp(24px, 6vw, 32px); line-height: 1.55; margin: 6px 0 4px; }
.petit-titre { font-size: 18px; margin: 18px 0 8px; }
.aide { color: var(--gris); margin: 0 0 12px; font-size: 16px; }
.petit { font-size: 15px; color: var(--gris); margin: 4px 0; }
.message { min-height: 1.5em; font-weight: 700; color: var(--rouge); text-align: center; }

/* Boutons */
.gros-btn, .btn {
  display: flex; align-items: center; justify-content: center; gap: 10px; width: 100%;
  min-height: 64px; padding: 8px 18px; font-size: 21px; font-weight: 700; text-align: center;
  border-radius: 18px; border: 3px solid var(--encre); background: var(--papier); color: var(--encre);
  box-shadow: 0 4px 0 var(--encre); cursor: pointer; touch-action: manipulation; transition: transform .1s, box-shadow .1s;
}
.btn { min-height: 52px; font-size: 18px; width: auto; border-width: 2px; box-shadow: 0 3px 0 var(--encre); }
.gros-btn:active:not(:disabled), .btn:active:not(:disabled) { transform: translateY(3px); box-shadow: 0 1px 0 var(--encre); }
.gros-btn.jaune { background: var(--couverture); border-color: var(--couverture-fonce); box-shadow: 0 4px 0 var(--couverture-fonce); }
.gros-btn.vert { background: var(--vert); border-color: #14603C; color: #fff; box-shadow: 0 4px 0 #14603C; }
.gros-btn:disabled, .btn:disabled { opacity: .45; cursor: default; box-shadow: none; transform: none; }
.gros-btn[aria-pressed="true"] { background: var(--vert); border-color: #14603C; color: #fff; box-shadow: 0 4px 0 #14603C; }
.gros-boutons { display: grid; gap: 14px; margin-top: 14px; }
.gros-boutons .gros-btn span { flex: none; }
.lien-btn { background: none; border: 0; color: var(--stylo); text-decoration: underline; cursor: pointer; font-size: 16px; padding: 10px; }
.retour { background: none; border: 0; font-size: 18px; font-weight: 700; color: var(--gris); padding: 8px 4px; cursor: pointer; }
.rebond { animation: g-rebond .4s; }
@keyframes g-rebond { 30% { transform: scale(1.08); } 60% { transform: scale(.96); } }

/* Accueil */
.montagne-accueil { display: block; width: 100%; height: auto; aspect-ratio: 360 / 300; max-height: 42vh; background: #BFE3FF; }
.bulle-luma { display: grid; grid-template-columns: 76px 1fr; gap: 12px; align-items: center; }
.bulle-luma img { width: 76px; height: 76px; border-radius: 50%; border: 3px solid var(--couverture); background: #fff; }
.bulle-luma p { margin: 0; background: var(--papier); border: 2px solid var(--seyes-fin); border-radius: 16px 16px 16px 4px; padding: 10px 14px; font-size: 17px; line-height: 1.45; }
.regle h2 { font-family: var(--manuscrite); font-weight: 400; font-size: 24px; line-height: 1.55; margin: 22px 0 8px; }
.regle-etapes { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; counter-reset: e; }
.regle-etapes li { counter-increment: e; display: grid; grid-template-columns: 54px 1fr; grid-template-rows: auto auto; column-gap: 12px; background: var(--papier); border: 2px solid var(--seyes-fin); border-left: 8px solid var(--couverture); border-radius: 16px; padding: 10px 14px; }
.regle-ic { grid-row: span 2; font-size: 34px; display: grid; place-items: center; }
.regle-etapes b::before { content: counter(e) ". "; color: var(--couverture-fonce); }
.regle-etapes span:last-child { font-size: 16px; color: var(--gris); }
.pied-accueil { text-align: center; margin-top: 22px; font-size: 15px; color: var(--gris); }
.pied-accueil a { font-weight: 700; }

/* Créer : nombre de joueurs */
.nombres { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.nombres button { min-height: 110px; flex-direction: column; gap: 2px; font-size: 40px; padding: 8px; }
.nombres small { font-size: 15px; font-weight: 400; }

/* Saisie du code */
.code-saisie { display: flex; align-items: center; justify-content: center; gap: 8px; margin: 6px 0 4px; font-size: 30px; font-weight: 700; letter-spacing: 1px; background: var(--papier); border: 3px dashed var(--seyes-fort); border-radius: 16px; padding: 8px; min-height: 76px; }
.code-animal { display: flex; align-items: center; gap: 6px; }
.code-chiffres { font-variant-numeric: tabular-nums; letter-spacing: 6px; }
.grille-animaux { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.grille-animaux button {
  display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 6px 2px 4px; min-height: 92px;
  border: 3px solid var(--seyes-fin); border-radius: 16px; background: var(--papier); cursor: pointer; font-size: 14px; font-weight: 700; touch-action: manipulation;
}
.grille-animaux button .av { width: 56px; height: 56px; }
.grille-animaux button[aria-pressed="true"] { border-color: var(--couverture-fonce); background: var(--couverture-pale); box-shadow: 0 0 0 3px var(--couverture); }
.grille-animaux button:disabled { opacity: .35; cursor: default; }
.grille-animaux button:disabled::after { content: "pris"; font-size: 12px; font-weight: 400; }
.pave { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; }
.pave button { min-height: 60px; font-size: 28px; padding: 0; }
.pave .effacer { grid-column: span 5; font-size: 18px; min-height: 48px; }

/* Salle d'attente */
.salle-code { text-align: center; background: var(--papier); border: 4px solid var(--couverture); border-radius: 18px; padding: 12px; }
.code-grand { display: flex; align-items: center; justify-content: center; gap: 10px; margin: 0; font-size: clamp(30px, 9vw, 44px); font-weight: 700; letter-spacing: 1px; }
.code-grand .av { width: 1.5em; height: 1.5em; }
.qr { display: flex; justify-content: center; margin: 6px 0; }
.qr svg { width: min(210px, 56vw); height: auto; border-radius: 10px; }
.salle-code .btn { margin: 8px auto 0; }
.joueurs { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.joueurs li { display: grid; grid-template-columns: 48px 1fr auto; align-items: center; gap: 10px; background: var(--papier); border: 2px solid var(--seyes-fin); border-radius: 14px; padding: 6px 10px; }
.joueurs li.moi-meme { border-color: var(--couverture-fonce); }
.joueurs .av { width: 48px; height: 48px; }
.joueurs .vide { width: 48px; height: 48px; border-radius: 50%; border: 3px dashed var(--seyes-fort); }
.joueurs .nom { font-weight: 700; }
.joueurs .etat { font-size: 15px; font-weight: 700; border-radius: 99px; padding: 2px 10px; background: var(--surface); color: var(--gris); }
.joueurs .etat.pret { background: var(--vert-pale); color: var(--vert); }
.classe { display: inline-block; font-size: 13px; font-weight: 700; line-height: 1; padding: 4px 7px; border-radius: 6px; color: #1B2A4A; margin-left: 6px; vertical-align: 2px; }
.classe-cp { background: var(--cp); } .classe-ce1 { background: var(--ce1); } .classe-ce2 { background: var(--ce2); }
.classe-cm1 { background: var(--cm1); } .classe-cm2 { background: var(--cm2); } .classe-grand { background: var(--grand); }
.pastilles-niveaux { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.pastilles-niveaux button { display: flex; flex-direction: column; align-items: center; min-height: 64px; border-radius: 14px; border: 3px solid var(--seyes-fort); background: var(--papier); cursor: pointer; font-size: 20px; font-weight: 700; padding: 4px; }
.pastilles-niveaux button small { font-size: 13px; font-weight: 400; color: var(--gris); }
.pastilles-niveaux button[aria-pressed="true"] { border-color: var(--encre); box-shadow: 0 0 0 3px var(--couverture); }
.pastilles-niveaux button[data-n="cp"][aria-pressed="true"] { background: var(--cp); } .pastilles-niveaux button[data-n="ce1"][aria-pressed="true"] { background: var(--ce1); }
.pastilles-niveaux button[data-n="ce2"][aria-pressed="true"] { background: var(--ce2); } .pastilles-niveaux button[data-n="cm1"][aria-pressed="true"] { background: var(--cm1); }
.pastilles-niveaux button[data-n="cm2"][aria-pressed="true"] { background: var(--cm2); } .pastilles-niveaux button[data-n="grand"][aria-pressed="true"] { background: var(--grand); }
.salle-actions {
  position: sticky; bottom: 0; z-index: 5; display: grid; gap: 8px; margin: 18px -14px 0; padding: 10px 14px calc(10px + env(safe-area-inset-bottom, 0));
  background: rgba(232, 240, 251, .96); border-top: 2px solid var(--seyes-fin); box-shadow: 0 -6px 14px rgba(27, 42, 74, .08); text-align: center;
}
.salle-actions .aide { margin: 0; font-weight: 700; color: var(--encre); }
.salle-actions .lien-btn { padding: 2px; font-size: 14px; }
.salle-actions .gros-btn { min-height: 58px; }
.salle-mini { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; background: var(--papier); border: 4px solid var(--couverture); border-radius: 16px; padding: 6px 10px; }
.salle-mini .petit { margin: 0; }
.code-court { display: flex; align-items: center; gap: 6px; font-size: 22px; letter-spacing: 1px; }
.code-court .av { width: 40px; height: 40px; }
.salle-mini .btn { margin-left: auto; min-height: 44px; font-size: 16px; }
.salle-code { margin-top: 8px; }
.bulle-salle { margin-top: 12px; grid-template-columns: 60px 1fr; }
.bulle-salle img { width: 60px; height: 60px; }
.bulle-salle p { font-weight: 700; }
.durees { display: grid; gap: 12px; }
.durees .gros-btn { justify-content: flex-start; text-align: left; min-height: 84px; }
.durees .duree-ic { font-size: 36px; flex: none; }
.durees .duree-txt { display: flex; flex-direction: column; }
.durees small { font-size: 15px; font-weight: 400; }
.durees .lien-btn { justify-self: center; }
.dialogue { border: 6px solid var(--couverture); border-radius: 22px; padding: 18px; max-width: min(420px, 92vw); text-align: center; color: var(--encre); background: var(--papier); }
.dialogue::backdrop { background: rgba(27, 42, 74, .45); }
.dialogue img { width: 80px; height: 80px; border-radius: 50%; margin: 0 auto; border: 3px solid var(--couverture); }
.dialogue h2 { font-family: var(--manuscrite); font-weight: 400; font-size: 26px; line-height: 1.5; margin: 6px 0; }
.dialogue p { margin: 0 0 6px; }

/* ============ La partie ============ */
.ecran-jeu {
  display: grid; grid-template-rows: auto auto minmax(0, 1fr) auto; gap: 8px;
  min-height: calc(100dvh - 24px);
}
.barre { display: flex; gap: 6px; align-items: center; flex-wrap: nowrap; min-width: 0; }
.puce { display: inline-flex; align-items: center; gap: 4px; background: var(--papier); border: 2px solid var(--seyes-fin); border-radius: 99px; padding: 3px 10px; font-weight: 700; font-size: 16px; white-space: nowrap; }
.puce.son { margin-left: auto; cursor: pointer; min-height: 38px; flex: none; }
.puce.quitter { cursor: pointer; min-height: 38px; flex: none; color: var(--gris); }
#j-cordes.alerte { border-color: var(--marge-rouge); background: #FDECEE; }
.zone-montagne { position: relative; border: 6px solid var(--couverture); border-radius: 18px; overflow: hidden; background: linear-gradient(#C7E6FF 0 72%, #79C48D 72%); }
.montagne { display: block; width: 100%; height: auto; aspect-ratio: 360 / 300; max-height: 34vh; margin: 0 auto; }
.ecran-jeu .montagne { max-height: 34dvh; }

/* Décor animé */
.mt-nuage { animation: g-nuage 38s linear infinite; }
.mt-nuage-1 { animation-duration: 52s; animation-delay: -20s; }
.mt-nuage-2 { animation-duration: 64s; animation-delay: -40s; }
@keyframes g-nuage { from { translate: -60px 0; } to { translate: 120px 0; } }
.mt-tissu { transform-box: fill-box; transform-origin: left center; }
.mt-drapeau.flotte .mt-tissu { fill: var(--marge-rouge); animation: g-flotte 1.1s ease-in-out infinite; }
@keyframes g-flotte { 50% { transform: skewY(-8deg) scaleX(.92); } }
.mt-case.mt-fait { opacity: .45; }
.mt-grimpeur .mt-anneau { fill: #fff; stroke: #1B2A4A; stroke-width: 1.5; }
.mt-grimpeur.actif .mt-anneau { fill: var(--couverture); stroke: var(--couverture-fonce); stroke-width: 3; animation: g-anneau 1.2s ease-in-out infinite; transform-box: fill-box; transform-origin: center; }
@keyframes g-anneau { 50% { transform: scale(1.18); } }
.mt-secousse { animation: g-secousse .45s; }
@keyframes g-secousse { 20% { transform: translateX(-6px); } 40% { transform: translateX(5px); } 60% { transform: translateX(-3px); } 80% { transform: translateX(2px); } }
.mt-victoire .mt-grimpeur > svg { animation: g-saut .6s ease-in-out infinite alternate; animation-delay: calc(var(--i) * .12s); }
@keyframes g-saut { to { transform: translateY(-8px); } }

/* Encouragements qui s'envolent */
.cris { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.cri { position: absolute; bottom: 8px; display: flex; align-items: center; gap: 2px; font-size: 30px; animation: g-cri 2.4s ease-out forwards; }
.cri .av { width: 30px; height: 30px; }
@keyframes g-cri { from { transform: translateY(0) scale(.6); opacity: 0; } 15% { opacity: 1; transform: translateY(-20px) scale(1.1); } to { transform: translateY(-170px) scale(1); opacity: 0; } }

/* Panneau d'action */
.panneau { display: flex; flex-direction: column; gap: 10px; min-height: 0; overflow-y: auto; padding: 2px; }
.tour { display: flex; align-items: center; gap: 10px; font-size: 22px; font-weight: 700; margin: 0; }
.tour .av { width: 52px; height: 52px; flex: none; }
.tour.mon-tour { font-family: var(--manuscrite); font-weight: 400; font-size: clamp(24px, 6.5vw, 32px); line-height: 1.5; color: var(--encre); }
.modes { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.modes .gros-btn { flex-direction: column; min-height: 104px; gap: 0; }
.modes small { font-size: 15px; font-weight: 400; }
.calcul {
  margin: 0; text-align: center; font-size: clamp(34px, 10vw, 54px); font-weight: 700; line-height: 1.2; font-variant-numeric: tabular-nums;
  background: var(--papier); border: 2px solid var(--seyes-fin); border-left: 8px solid var(--couverture); border-radius: 0 16px 16px 0; padding: 10px 12px;
}
.calcul.enigme { font-size: clamp(19px, 5vw, 24px); font-weight: 700; text-align: left; line-height: 1.45; }
.dessin { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 4px 10px; font-size: clamp(22px, 6vw, 30px); line-height: 1.1; }
.dessin .groupe { display: flex; flex-wrap: wrap; gap: 2px; padding: 3px 6px; background: var(--surface); border-radius: 10px; }
.dessin .barre-objet { opacity: .4; text-decoration: line-through; text-decoration-color: var(--marge-rouge); text-decoration-thickness: 4px; }
.dessin .op { font-weight: 700; color: var(--stylo); }
.reponses { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.reponses button {
  min-height: 84px; font-size: clamp(26px, 8vw, 40px); font-weight: 700; border-radius: 20px; cursor: pointer; touch-action: manipulation; padding: 4px;
  border: 3px solid var(--couverture-fonce); background: var(--couverture-pale); box-shadow: 0 5px 0 var(--couverture-fonce); font-variant-numeric: tabular-nums;
}
.reponses button:active:not(:disabled) { transform: translateY(4px); box-shadow: 0 1px 0 var(--couverture-fonce); }
.reponses button.juste { background: var(--vert); border-color: #14603C; color: #fff; box-shadow: 0 5px 0 #14603C; }
.reponses button.faux { background: var(--papier); border-color: var(--marge-rouge); box-shadow: none; opacity: .6; text-decoration: line-through; }
.reponses button:disabled { cursor: default; }
.reponses.longues { grid-template-columns: 1fr; }
.reponses.longues button { min-height: 62px; }

/* Le soleil qui se couche (temps restant, sans chiffres) */
.soleil { display: block; width: 100%; height: 46px; border-radius: 14px; overflow: hidden; }
.soleil-boite { height: 46px; }
.soleil .astre { transition: transform .25s linear; }
.encourager { display: flex; gap: 10px; justify-content: center; }
.encourager button { font-size: 32px; min-width: 70px; min-height: 60px; border-radius: 16px; border: 2px solid var(--seyes-fort); background: var(--papier); cursor: pointer; touch-action: manipulation; }
.encourager button:active { transform: scale(.9); }
.encourager-titre { text-align: center; margin: 0; font-size: 15px; color: var(--gris); }

.resultat { text-align: center; border-radius: 18px; padding: 10px 14px; background: var(--papier); border: 3px solid var(--seyes-fin); }
.resultat.ok { border-color: var(--vert); background: var(--vert-pale); }
.resultat.ko { border-color: var(--marge-rouge); background: #FFF1F2; }
.resultat h3 { margin: 0; font-size: 26px; }
.resultat p { margin: 6px 0 0; }
.resultat .bonne { font-size: 30px; font-weight: 700; color: var(--vert); }
.resultat .expl { font-size: 17px; text-align: left; background: var(--papier); border-radius: 12px; padding: 8px 12px; border: 2px dashed var(--seyes-fort); }
.etoiles { position: relative; height: 0; }
.etoile { position: absolute; left: 50%; top: -20px; font-size: 26px; pointer-events: none; animation: g-etoile 1s ease-out forwards; }
@keyframes g-etoile { from { transform: translate(-50%, 0) scale(.5); opacity: 1; } to { transform: translate(calc(-50% + var(--dx)), -90px) scale(1.2); opacity: 0; } }
.tremble { animation: g-secousse .4s; }

.annonce { text-align: center; padding: 6px; }
.annonce .grande-icone { font-size: 64px; line-height: 1; animation: g-rebond 1s infinite; }
.annonce svg { margin: 0 auto; }
.annonce h3 { font-family: var(--manuscrite); font-weight: 400; font-size: 28px; line-height: 1.5; margin: 4px 0; }
.etat-cordee { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.etat-cordee li { display: flex; flex-direction: column; align-items: center; font-size: 13px; font-weight: 700; min-width: 58px; }
.etat-cordee .av { width: 44px; height: 44px; }
.etat-cordee .cherche .av { opacity: .5; }
.etat-cordee .juste { color: var(--vert); } .etat-cordee .faux { color: var(--rouge); }

/* Madame Luma */
.luma { display: grid; grid-template-columns: 56px 1fr; gap: 10px; align-items: center; }
.luma img { width: 56px; height: 56px; border-radius: 50%; border: 3px solid var(--couverture); background: #fff; }
.luma p { margin: 0; min-height: 50px; display: flex; align-items: center; font-weight: 700; font-size: 17px; line-height: 1.35;
  background: var(--papier); border: 2px solid var(--seyes-fin); border-radius: 16px 16px 16px 4px; padding: 6px 12px; }
.luma.bravo p { border-color: var(--vert); color: var(--vert); }
.luma.oups p { border-color: var(--marge-rouge); }

/* Fin de partie */
.fin { text-align: center; }
.fin h3 { font-family: var(--manuscrite); font-weight: 400; font-size: clamp(28px, 8vw, 40px); line-height: 1.5; margin: 0; }
.recap { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; margin: 10px 0; }
.recap div { background: var(--papier); border: 2px solid var(--seyes-fin); border-radius: 14px; padding: 8px; }
.recap b { display: block; font-size: 28px; line-height: 1.2; }
.recap span { font-size: 14px; color: var(--gris); }
.noms { display: grid; gap: 10px; }
.noms .gros-btn { min-height: 56px; font-size: 19px; }
.nom-cordee { font-family: var(--manuscrite); font-size: clamp(24px, 7vw, 34px); line-height: 1.6; margin: 6px 0; color: var(--stylo); }

/* Confettis */
.confettis { position: fixed; inset: 0; pointer-events: none; overflow: hidden; z-index: 40; }
.confettis i { position: absolute; top: -20px; width: 10px; height: 16px; border-radius: 2px; animation: g-tombe linear forwards; }
@keyframes g-tombe { to { transform: translateY(110vh) rotate(720deg); } }

/* Grands écrans en paysage : la montagne à gauche, le jeu à droite */
@media (min-width: 900px) and (orientation: landscape) {
  .appli { max-width: 1240px; }
  .ecran-jeu { grid-template-columns: minmax(0, 1.25fr) minmax(360px, 1fr); grid-template-rows: auto minmax(0, 1fr) auto; column-gap: 18px; height: calc(100dvh - 30px); min-height: 0; }
  .barre { grid-column: 1 / -1; }
  .zone-montagne { grid-row: 2 / 4; }
  .ecran-jeu .montagne { max-height: none; height: 100%; width: 100%; }
  .panneau { grid-column: 2; grid-row: 2; }
  .luma { grid-column: 2; grid-row: 3; }
  .ecran-accueil { max-width: 780px; margin: 0 auto; }
}
/* Petits téléphones */
@media (max-width: 360px) {
  body { font-size: 17px; }
  .appli { padding: 8px 8px 16px; }
  .grille-animaux { grid-template-columns: repeat(3, 1fr); }
  .reponses button { min-height: 72px; }
  .modes .gros-btn { min-height: 92px; font-size: 19px; }
  .puce { font-size: 14px; padding: 2px 8px; }
}
/* Téléphone couché (petite hauteur) */
@media (max-height: 520px) and (orientation: landscape) {
  .ecran-jeu { grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr); grid-template-rows: auto minmax(0, 1fr) auto; column-gap: 12px; height: calc(100dvh - 16px); min-height: 0; }
  .barre { grid-column: 1 / -1; }
  .zone-montagne { grid-row: 2 / 4; }
  .ecran-jeu .montagne { max-height: none; height: 100%; }
  .panneau { grid-column: 2; grid-row: 2; }
  .luma { display: none; }
  .panneau { grid-row: 2 / 4; gap: 6px; }
  .tour { font-size: 18px; } .tour.mon-tour { font-size: 22px; } .tour .av { width: 36px; height: 36px; }
  .soleil, .soleil-boite { height: 24px; }
  .calcul { font-size: 30px; padding: 4px 10px; } .calcul.enigme { font-size: 17px; }
  .reponses button { min-height: 54px; font-size: 26px; }
  .modes .gros-btn { min-height: 76px; }
  .encourager button { min-height: 48px; font-size: 26px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition: none !important; }
  .confettis { display: none; }
}
