/* Musamundo · les jeux des œuvres (jeux-oeuvres.js) : le jeu de chaque œuvre des parcours des enfants, le dessin de la visite et
   le mur des enfants. Une carte claire couleur papier, la même dans tous les musées et dans la visite 3D ; de grands boutons
   (48 px au moins) pour les doigts d'enfants ; l'arabe de droite à gauche par les propriétés logiques.
   Les couleurs suivies du commentaire « fixe » ne changent pas quand le gabarit habille le fichier aux couleurs du musée
   (outils/identite.js) ; ne jamais écrire ce commentaire en entier dans un autre commentaire, il le fermerait.
   L'accent est celui du musée, imprimé assez foncé pour le papier (--accent-papier).
   La carte de chaque jeu porte « jo jo--<sorte> » (deux tirets) : les classes à un tiret sont les pièces des jeux. */
.jo {
  --jo-papier: #f6f0e3/*fixe*/; --jo-papier2: #ece3cf/*fixe*/; --jo-encre: #2a231b/*fixe*/; --jo-doux: #6b6153/*fixe*/;
  --jo-accent: var(--accent-papier, #8C2424/*fixe*/); --jo-vert: #2f7a46/*fixe*/; --jo-bleu: #2f6fb5/*fixe*/; --jo-or: #e0a722/*fixe*/;
  --jo-rouge: #c43c32/*fixe*/; --jo-haut: min(58vh, 620px);
  box-sizing: border-box; position: relative; width: 100%; margin: 0; padding: 18px 18px 20px; border-radius: 18px;
  background: var(--jo-papier); color: var(--jo-encre); font-family: Raleway, system-ui, sans-serif; font-size: calc(17px * var(--k, 1)); line-height: 1.5; text-align: start;
}
.jo *, .jo *::before, .jo *::after { box-sizing: border-box; }
.jo [hidden] { display: none !important; }
.jo :focus-visible { outline: 3px solid var(--jo-bleu); outline-offset: 3px; }
.jo p { margin: 0; }

/* la tête : le nom du jeu, la consigne et son bouton 🔊 */
.jo-tete { display: grid; gap: 4px; margin: 0 0 12px; }
.jo-type { font-size: calc(13px * var(--k, 1)); font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: var(--jo-accent); }
.jo:lang(zh) .jo-type, .jo:lang(ar) .jo-type { letter-spacing: .04em; text-transform: none; font-size: calc(14px * var(--k, 1)); }
.jo-consigne-l { display: flex; align-items: flex-start; gap: 10px; }
.jo-consigne { flex: 1; font-family: "EB Garamond", Georgia, serif; font-weight: 500; font-size: calc(clamp(22px, 3.2vw, 28px) * min(var(--k, 1), 1.25)); line-height: 1.22; }
.jo-ecouter { flex: none; display: grid; place-items: center; width: 48px; height: 48px; padding: 0; border: 2px solid var(--jo-encre); border-radius: 50%;
  background: #fff/*fixe*/; color: var(--jo-encre); font-size: calc(22px * var(--k, 1)); line-height: 1; cursor: pointer; }
.jo-ecouter:hover { background: var(--jo-papier2); }

/* la scène : l'œuvre (et ce qui va avec), centrée */
.jo-scene { display: flex; flex-direction: column; align-items: center; gap: 14px; }
.jo-image { position: relative; display: block; width: fit-content; max-width: 100%; margin: 0 auto; line-height: 0; border: 6px solid #fff/*fixe*/;
  border-radius: 3px; background: #fff/*fixe*/; box-shadow: 0 10px 28px rgba(60,40,20,.22)/*fixe*/; touch-action: manipulation;
  -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; cursor: pointer; }
.jo-image img { display: block; max-width: 100%; max-height: var(--jo-haut); width: auto; height: auto; -webkit-user-drag: none; pointer-events: none; }
.jo-image.petite img { max-height: min(40vh, 400px); }
.jo--quiz .jo-image, .jo--compte .jo-image, .jo--memoire .jo-image, .jo--couleurs .jo-image { cursor: default; }
.jo-image:focus-visible { outline: 4px solid var(--jo-bleu); outline-offset: 4px; }
.jo-marques { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }

/* les marques posées sur l'œuvre */
.jo-marque { position: absolute; border-radius: 12px; }
.jo-marque.trouvee { border: 4px solid var(--jo-vert); box-shadow: 0 0 0 3px #fff/*fixe*/, 0 0 18px rgba(47,122,70,.55)/*fixe*/; background: rgba(47,122,70,.12)/*fixe*/;
  display: grid; place-items: center; animation: jo-pop .45s ease-out; }
.jo-etoile { font-size: calc(30px * min(var(--k, 1), 1.25)); line-height: 1; color: var(--jo-or); text-shadow: 0 0 3px #fff/*fixe*/, 0 2px 6px rgba(0,0,0,.45); }
.jo-marque.indice { border: 4px dashed var(--jo-or); box-shadow: 0 0 0 3px rgba(255,255,255,.75); border-radius: 18px; animation: jo-palpite 1.1s ease-in-out infinite; }
.jo-marque.montree { border: 4px solid var(--jo-accent); box-shadow: 0 0 0 3px #fff/*fixe*/, 0 0 20px rgba(0,0,0,.35); animation: jo-pop .45s ease-out; }
.jo-marque.comptee { border: 3px solid #fff/*fixe*/; box-shadow: 0 0 0 3px var(--jo-bleu); border-radius: 14px; animation: jo-pop .35s ease-out; }
.jo-num { position: absolute; top: -12px; inset-inline-start: -12px; display: grid; place-items: center; min-width: 30px; height: 30px; padding: 0 6px;
  border-radius: 15px; background: var(--jo-bleu); color: #fff/*fixe*/; font: 700 calc(17px * var(--k, 1))/1 Raleway, system-ui, sans-serif; box-shadow: 0 0 0 2px #fff/*fixe*/; }
.jo-rate { position: absolute; width: 36px; height: 36px; margin: -18px 0 0 -18px; animation: jo-efface .9s ease-in forwards; }
.jo-rate::before, .jo-rate::after { content: ""; position: absolute; left: 50%; top: 50%; width: 32px; height: 6px; margin: -3px 0 0 -16px; border-radius: 3px;
  background: var(--jo-rouge); box-shadow: 0 0 0 2px #fff/*fixe*/; transform: rotate(45deg); }
.jo-rate::after { transform: rotate(-45deg); }
.jo-viseur { position: absolute; width: 46px; height: 46px; margin: -23px 0 0 -23px; border: 3px solid #fff/*fixe*/; border-radius: 50%;
  box-shadow: 0 0 0 2px var(--jo-encre), inset 0 0 0 2px var(--jo-encre); }
.jo-viseur::after { content: ""; position: absolute; left: 50%; top: 50%; width: 6px; height: 6px; margin: -3px 0 0 -3px; border-radius: 50%; background: #fff/*fixe*/; box-shadow: 0 0 0 2px var(--jo-encre); }

/* la lampe de poche : la nuit sur l'œuvre, percée par la lumière du doigt */
.jo-image.nuit { touch-action: none; cursor: crosshair; }
.jo-nuit { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; transition: opacity .9s ease; }
.jo-nuit.jour { opacity: 0; }

/* le détail à retrouver */
.jo-loupe-l { display: flex; flex-direction: column; align-items: center; gap: 6px; font-size: calc(14px * var(--k, 1)); font-weight: 600; color: var(--jo-doux); }
.jo-loupe { display: block; width: auto; height: auto; max-width: min(200px, 46vw); max-height: 200px; border: 5px solid #fff/*fixe*/; border-radius: 16px;
  box-shadow: 0 0 0 3px var(--jo-or), 0 8px 22px rgba(60,40,20,.25)/*fixe*/; background: #fff/*fixe*/; }

/* compter : les nombres */
.jo-nombres { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; max-width: 560px; }
.jo-nombre { width: 56px; height: 56px; padding: 0; border: 2px solid var(--jo-papier2); border-radius: 50%; background: #fff/*fixe*/; color: var(--jo-encre);
  font: 700 calc(22px * var(--k, 1))/1 Raleway, system-ui, sans-serif; cursor: pointer; transition: transform .1s, border-color .15s; }
.jo-nombre:hover:not(:disabled) { border-color: var(--jo-encre); transform: scale(1.06); }

/* devinette et mémoire : les réponses */
.jo-choix { display: grid; gap: 10px; width: 100%; max-width: 600px; }
.jo-choix.deux { grid-template-columns: 1fr 1fr; }
.jo-option { min-height: 56px; padding: 12px 18px; border: 2px solid var(--jo-papier2); border-radius: 14px; background: #fff/*fixe*/; color: var(--jo-encre);
  font: 600 calc(18px * var(--k, 1))/1.3 Raleway, system-ui, sans-serif; text-align: start; cursor: pointer; transition: border-color .15s, transform .1s; }
.jo-option:hover:not(:disabled) { border-color: var(--jo-encre); }
.jo-nombre.bon, .jo-option.bon { border-color: var(--jo-vert); background: #e3f1e6/*fixe*/; color: #1d5230/*fixe*/; box-shadow: 0 0 0 2px var(--jo-vert); animation: jo-pop .35s ease-out; }
.jo-nombre.faux, .jo-option.faux { border-color: var(--jo-rouge); background: #f8e3e1/*fixe*/; color: #7a221b/*fixe*/; animation: jo-non .35s ease-in-out; }
.jo-nombre:disabled, .jo-option:disabled { cursor: default; }
.jo-nombre:disabled:not(.bon):not(.faux), .jo-option:disabled:not(.bon):not(.faux) { opacity: .5; }
.jo-option.bon::after { content: " ✓"; }
.jo-compte { margin: 0; font-size: calc(18px * var(--k, 1)); font-weight: 600; color: var(--jo-doux); font-variant-numeric: tabular-nums; }
.jo-image.cache::after { content: "?"; position: absolute; inset: 0; display: grid; place-items: center; z-index: 2;
  background: repeating-linear-gradient(45deg, var(--jo-papier2) 0 16px, var(--jo-papier) 16px 32px); color: var(--jo-accent);
  font: 500 clamp(64px, 14vw, 120px)/1 "EB Garamond", Georgia, serif; animation: jo-rideau .4s ease-out; }
.jo-image.cache .jo-marques { visibility: hidden; }

/* les couleurs : les pastilles et les gouttes posées sur l'œuvre */
.jo-palette { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; max-width: 520px; }
.jo-pastille { position: relative; width: 56px; height: 56px; padding: 0; border: 4px solid #fff/*fixe*/; border-radius: 50%; cursor: pointer;
  box-shadow: 0 0 0 1px var(--jo-papier2), 0 3px 8px rgba(60,40,20,.2)/*fixe*/; transition: transform .12s; }
.jo-pastille:hover:not(:disabled) { transform: scale(1.08); }
.jo-pastille.actif { transform: scale(1.16); box-shadow: 0 0 0 4px var(--jo-encre), 0 4px 10px rgba(60,40,20,.25)/*fixe*/; }
.jo-pastille.bon, .jo-pastille.montree { cursor: default; transform: none; }
.jo-pastille.bon { box-shadow: 0 0 0 3px var(--jo-vert), 0 3px 8px rgba(60,40,20,.2)/*fixe*/; }
.jo-pastille.montree { box-shadow: 0 0 0 3px var(--jo-or), 0 3px 8px rgba(60,40,20,.2)/*fixe*/; }
.jo-pastille.bon::after, .jo-pastille.montree::after { content: "✓"; position: absolute; right: -8px; bottom: -8px; display: grid; place-items: center; width: 26px; height: 26px;
  border: 2px solid #fff/*fixe*/; border-radius: 50%; color: #fff/*fixe*/; font-size: calc(15px * var(--k, 1)); font-weight: 700; line-height: 1; }
.jo-pastille.bon::after { background: var(--jo-vert); }
.jo-pastille.montree::after { background: var(--jo-or); }
/* la goutte a la couleur trouvée, posée sur la même couleur : un bord blanc et un liseré sombre pour qu'elle se voie partout */
.jo-goutte { position: absolute; width: 32px; height: 32px; margin: -16px 0 0 -16px; border: 3px solid #fff/*fixe*/; border-radius: 50% 50% 50% 0;
  transform: rotate(-45deg); box-shadow: 0 0 0 2px rgba(0,0,0,.55), 0 3px 8px rgba(0,0,0,.45); animation: jo-goutte .5s ease-out; }

/* le puzzle */
.jo-puzzle { display: grid; gap: 2px; width: min(100%, 560px, calc(var(--jo-haut) * var(--r, 1))); background: var(--jo-papier2); border: 6px solid #fff/*fixe*/;
  box-shadow: 0 10px 28px rgba(60,40,20,.2)/*fixe*/; touch-action: manipulation; }
.jo-piece { display: block; width: 100%; height: 100%; min-height: 44px; margin: 0; padding: 0; border: 0; border-radius: 0; background-repeat: no-repeat;
  background-color: #fff/*fixe*/; cursor: pointer; outline: 3px solid transparent; outline-offset: -3px; transition: filter .15s, outline-color .15s, transform .12s; }
.jo-piece.choisi { outline-color: var(--jo-bleu); filter: brightness(1.12); transform: scale(.94); z-index: 1; }
.jo-piece:focus-visible { outline: 4px solid var(--jo-bleu); outline-offset: -4px; }
.jo-puzzle.fini { gap: 0; }
.jo-puzzle.fini .jo-piece { outline-color: transparent; transform: none; filter: none; }
.jo-modele { margin: 0; }
.jo-modele img { display: block; max-width: min(220px, 60vw); max-height: 220px; border: 4px solid #fff/*fixe*/; box-shadow: 0 6px 16px rgba(60,40,20,.2)/*fixe*/; }

/* l'état (ce que l'on a trouvé, l'erreur) et les boutons */
.jo-etat { min-height: 1.5em; margin: 12px 0 0; text-align: center; font-weight: 600; color: var(--jo-doux); }
.jo-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin: 12px 0 0; }
.jo-btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 48px; margin: 0; padding: 10px 20px; border: 2px solid var(--jo-encre);
  border-radius: 999px; background: #fff/*fixe*/; color: var(--jo-encre); font: 600 calc(16px * var(--k, 1))/1.2 Raleway, system-ui, sans-serif; text-decoration: none; cursor: pointer;
  transition: background .15s, color .15s, transform .1s; }
.jo-btn:hover { background: var(--jo-encre); color: #fff/*fixe*/; }
.jo-btn:active { transform: scale(.97); }
.jo-btn.plein { background: var(--jo-accent); border-color: var(--jo-accent); color: #fff/*fixe*/; }
.jo-btn.plein:hover { filter: brightness(1.15); }
.jo-btn.leger { border-width: 2px; }
.jo-btn.petit { min-height: 40px; padding: 6px 14px; font-size: calc(14px * var(--k, 1)); }
.jo-btn[aria-pressed="true"] { background: var(--jo-encre); color: #fff/*fixe*/; }
.jo-btn[data-sur] { background: var(--jo-accent); border-color: var(--jo-accent); color: #fff/*fixe*/; }
.jo-btn:disabled { opacity: .5; cursor: default; }

/* la fin du jeu : le verdict, les étoiles, l'explication */
.jo-fin { margin: 16px 0 0; padding: 20px 18px 18px; border-radius: 16px; background: #fff/*fixe*/; text-align: center; box-shadow: 0 2px 0 var(--jo-papier2); animation: jo-monte .4s ease-out; }
.jo-fin:focus { outline: none; }
.jo-verdict { font-family: "EB Garamond", Georgia, serif; font-weight: 500; font-size: calc(clamp(28px, 4vw, 36px) * min(var(--k, 1), 1.25)); line-height: 1.1; }
.jo-verdict.oui { color: var(--jo-vert); }
.jo-verdict.non { color: var(--jo-accent); }
.jo-etoiles { margin: 4px 0 8px !important; font-size: calc(40px * min(var(--k, 1), 1.25)); line-height: 1.1; letter-spacing: .1em; color: var(--jo-or); }
.jo-etoiles .vide { color: var(--jo-papier2); }
.jo-bravo-l { justify-content: center; max-width: 640px; margin: 0 auto; text-align: start; }
.jo-bravo { flex: 1; font-size: calc(18px * var(--k, 1)); line-height: 1.55; }
.jo-fin .jo-actions { margin-top: 16px; }

/* le dessin de la visite */
.jo--dessin { padding-bottom: 16px; }
.jo-feuille { display: grid; gap: 14px; grid-template-columns: minmax(0, 1fr); align-items: start; }
.jo-feuille:has(.jo-dessin-modele) { grid-template-columns: minmax(0, 1fr) minmax(130px, 240px); }
.jo-toile { display: block; width: 100%; height: auto; aspect-ratio: 4 / 3; border: 6px solid #fff/*fixe*/; border-radius: 4px; background: #fff/*fixe*/;
  box-shadow: 0 10px 28px rgba(60,40,20,.18)/*fixe*/; touch-action: none; cursor: crosshair; }
.jo-dessin-modele { margin: 0; }
.jo-dessin-modele img { display: block; width: 100%; height: auto; border: 5px solid #fff/*fixe*/; box-shadow: 0 6px 16px rgba(60,40,20,.2)/*fixe*/; }
.jo-outils, .jo-crayons { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 12px 0 0; }
.jo-crayons .jo-pastille { width: 44px; height: 44px; border-width: 3px; }
.jo-crayons .jo-pastille[aria-pressed="true"] { box-shadow: 0 0 0 3px var(--jo-encre); transform: scale(1.12); }
.jo-crayons .jo-pastille.blanc { box-shadow: 0 0 0 1px var(--jo-doux); }
.jo-crayons .jo-pastille.blanc[aria-pressed="true"] { box-shadow: 0 0 0 3px var(--jo-encre); }
.jo-prenom-l { display: block; margin: 14px 0 0; }
.jo-prenom { width: min(340px, 100%); min-height: 48px; padding: 10px 14px; border: 2px solid var(--jo-papier2); border-radius: 12px; background: #fff/*fixe*/;
  color: var(--jo-encre); font: 600 calc(17px * var(--k, 1)) Raleway, system-ui, sans-serif; }
.jo-prenom:focus { border-color: var(--jo-encre); outline: none; }
.jo--dessin .jo-actions { justify-content: flex-start; }
.jo--dessin .jo-etat { text-align: start; }
.jo-parents { max-width: 720px; margin: 14px 0 0 !important; padding: 10px 14px; border-inline-start: 4px solid var(--jo-papier2); border-radius: 4px;
  background: rgba(255,255,255,.6); font-size: calc(13.5px * var(--k, 1)); line-height: 1.5; color: var(--jo-doux); }

/* le mur des enfants (les dessins gardés sur cet appareil) */
.jo-mur { list-style: none; margin: 0; padding: 26px 20px 30px; display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 26px 20px;
  border-radius: 14px; background: #c79a68/*fixe*/ radial-gradient(rgba(90,60,30,.25)/*fixe*/ 1px, transparent 1.6px) 0 0 / 9px 9px;
  box-shadow: inset 0 0 0 10px #8a5a36/*fixe*/, inset 0 0 30px rgba(60,35,15,.45)/*fixe*/; }
.jo-mur li { position: relative; margin: 0; padding: 10px 10px 12px; background: #fff/*fixe*/; border-radius: 2px; box-shadow: 0 6px 14px rgba(40,25,10,.35)/*fixe*/;
  transform: rotate(-1.4deg); font-family: Raleway, system-ui, sans-serif; color: #2a231b/*fixe*/; }
.jo-mur li:nth-child(2n) { transform: rotate(1.2deg); }
.jo-mur li:nth-child(3n) { transform: rotate(-.6deg); }
.jo-mur li::before { content: ""; position: absolute; top: -9px; left: 50%; width: 18px; height: 18px; margin-left: -9px; border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #ff8a7a/*fixe*/, #c0302a/*fixe*/ 60%); box-shadow: 0 3px 4px rgba(0,0,0,.35); }
.jo-mur li:nth-child(3n+2)::before { background: radial-gradient(circle at 35% 35%, #8fc3ff/*fixe*/, #1f5fb8/*fixe*/ 60%); }
.jo-mur li:nth-child(3n)::before { background: radial-gradient(circle at 35% 35%, #ffe38a/*fixe*/, #d19a12/*fixe*/ 60%); }
.jo-mur img { display: block; width: 100%; height: auto; aspect-ratio: 4 / 3; object-fit: cover; background: #fff/*fixe*/; }
.jo-mur-leg { display: grid; gap: 2px; margin: 8px 0 6px !important; }
.jo-mur-leg b { font-family: "EB Garamond", Georgia, serif; font-weight: 500; font-size: calc(19px * var(--k, 1)); line-height: 1.2; }
.jo-mur-leg small { font-size: calc(12px * var(--k, 1)); color: #6b6153/*fixe*/; }
.jo-mur-vide { margin: 0; padding: 26px 22px; border-radius: 14px; background: #fff/*fixe*/; color: #6b6153/*fixe*/; font-size: calc(17px * var(--k, 1)); text-align: center; }

/* animations (aucune si l'appareil le demande) */
@keyframes jo-pop { 0% { transform: scale(.6); opacity: 0; } 70% { transform: scale(1.08); opacity: 1; } 100% { transform: scale(1); } }
@keyframes jo-palpite { 0%, 100% { opacity: .55; transform: scale(1); } 50% { opacity: 1; transform: scale(1.04); } }
@keyframes jo-efface { 0% { opacity: 1; transform: scale(.7); } 25% { transform: scale(1); } 100% { opacity: 0; } }
@keyframes jo-non { 0%, 100% { transform: translateX(0); } 25% { transform: translateX(-6px); } 75% { transform: translateX(6px); } }
@keyframes jo-goutte { 0% { transform: rotate(-45deg) translate(-12px, -12px) scale(.4); opacity: 0; } 100% { transform: rotate(-45deg); opacity: 1; } }
@keyframes jo-rideau { 0% { opacity: 0; } 100% { opacity: 1; } }
@keyframes jo-monte { 0% { opacity: 0; transform: translateY(10px); } 100% { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) {
  .jo *, .jo *::before, .jo *::after { animation: none !important; transition: none !important; }
}

/* téléphone */
@media (max-width: 560px) {
  .jo { padding: 14px 12px 16px; border-radius: 14px; --jo-haut: 52vh; }
  .jo-consigne { font-size: calc(21px * var(--k, 1)); }
  .jo-image { border-width: 4px; }
  .jo-nombre { width: 52px; height: 52px; font-size: calc(20px * var(--k, 1)); }
  .jo-pastille { width: 52px; height: 52px; }
  .jo-option { min-height: 52px; padding: 10px 14px; font-size: calc(17px * var(--k, 1)); }
  .jo-choix.deux { grid-template-columns: 1fr; }
  .jo-btn { padding: 10px 16px; font-size: calc(15px * var(--k, 1)); }
  .jo-feuille:has(.jo-dessin-modele) { grid-template-columns: minmax(0, 1fr); }
  .jo-dessin-modele { max-width: 200px; }
  .jo-mur { grid-template-columns: repeat(2, minmax(0, 1fr)); padding: 22px 12px 24px; gap: 22px 12px; }
  /* (0.22) téléphone debout : sur un petit écran (360 × 640), le jeu peut dépasser ; « Indice », « Passer le jeu » restent en vue */
  .jo:not(.jo--dessin) > .jo-actions { position: sticky; bottom: 0; z-index: 2; margin: 8px 0 0; padding: 8px 0 4px; background: var(--jo-papier); }
  .jo:not(.jo--dessin) .jo-loupe { max-width: min(170px, 46vw); max-height: 150px; }
  .jo.jo--detail { --jo-haut: 44vh; }
}
/* (0.22) petit téléphone debout (360 × 640) : consigne, œuvre et réponses resserrées, morceau à retrouver plus petit, pour que les
   réponses tiennent sous l'œuvre (essai de travail : cap-jeux.js) */
@media (max-width: 560px) and (max-height: 700px) {
  .jo:not(.jo--dessin) { --jo-haut: 30vh; padding: 10px 10px 12px; }
  .jo.jo--detail { --jo-haut: 38vh; }
  .jo.jo--puzzle { --jo-haut: 44vh; }  /* des morceaux d'au moins 44 px */
  .jo:not(.jo--dessin) .jo-image.petite img { max-height: var(--jo-haut); }
  .jo:not(.jo--dessin) .jo-tete { gap: 2px; margin: 0 0 8px; }
  .jo:not(.jo--dessin) .jo-type { font-size: calc(12px * var(--k, 1)); }
  .jo:not(.jo--dessin) .jo-consigne { font-size: calc(18px * var(--k, 1)); line-height: 1.22; }
  .jo:not(.jo--dessin) .jo-scene { gap: 8px; }
  .jo:not(.jo--dessin) .jo-choix { gap: 6px; }
  .jo:not(.jo--dessin) .jo-option { min-height: 46px; padding: 6px 12px; font-size: calc(16px * var(--k, 1)); line-height: 1.25; }
  .jo:not(.jo--dessin) :is(.jo-nombres, .jo-palette) { gap: 6px; }
  .jo:not(.jo--dessin) .jo-nombre, .jo:not(.jo--dessin) .jo-pastille { width: 46px; height: 46px; }
  .jo:not(.jo--dessin) .jo-loupe-l > :not(.jo-loupe) { display: none; }
  .jo:not(.jo--dessin) .jo-loupe { max-height: 96px; max-width: 40vw; border-width: 3px; border-radius: 12px; }
}
/* téléphone couché : l'œuvre d'un côté, de toute la hauteur (à gauche, à droite en arabe), et de l'autre la consigne, les réponses,
   l'état et les boutons, pour que tout le jeu tienne dans l'écran. La scène s'efface (display: contents) : l'image ou le puzzle et
   leurs réponses se rangent dans la grille de la carte. Les rangées vides ne prennent pas de place (des marges, pas de row-gap) ;
   la dernière (1fr) prend ce que l'image a de plus que la colonne d'à côté. */
@media (max-height: 480px) and (orientation: landscape) {
  .jo { --jo-haut: calc(100vh - 150px); }
  .jo-consigne { font-size: calc(19px * var(--k, 1)); }
  .jo:not(.jo--dessin) { display: grid; grid-template-columns: auto minmax(0, 1fr); grid-template-rows: repeat(7, auto) 1fr; column-gap: 22px; align-items: start; }
  .jo:not(.jo--dessin) > *, .jo:not(.jo--dessin) > .jo-scene > * { grid-column: 2; margin: 0 0 10px; }
  .jo:not(.jo--dessin) > .jo-scene { display: contents; }
  .jo:not(.jo--dessin) > .jo-scene > :is(.jo-image, .jo-puzzle) { grid-column: 1; grid-row: 1 / -1; align-self: center; margin: 0; }
  .jo:not(.jo--dessin) .jo-image img { max-width: 50vw; }
  /* (0.22) les devinettes (image « petite ») : à côté des réponses, l'œuvre prend toute la hauteur ; un tableau en
     hauteur (un portrait) n'est plus réduit à une vignette de 110 px de large, un tableau en largeur ne prend que le tiers de l'écran */
  .jo:not(.jo--dessin) .jo-image.petite img { max-height: var(--jo-haut); max-width: 34vw; }
  .jo:not(.jo--dessin) .jo-puzzle { width: min(50vw, 560px, calc(var(--jo-haut) * var(--r, 1))); }
  .jo:not(.jo--dessin) :is(.jo-etat, .jo-compte) { text-align: start; }
  .jo:not(.jo--dessin) :is(.jo-actions, .jo-nombres, .jo-palette) { justify-content: flex-start; }
  .jo:not(.jo--dessin) .jo-loupe-l { align-items: flex-start; }
  .jo:not(.jo--dessin) .jo-modele img { max-height: 40vh; }
  /* (0.22) tout plus serré, pour qu'un jeu tienne dans 390 px de haut (téléphone couché) : moins de marges, une consigne plus petite, les
     réponses sur deux colonnes, des boutons de 44 px ; l'œuvre en haut et qui reste en vue (sticky), les boutons du bas aussi, si un
     très petit écran (568 × 320) oblige à faire défiler le reste. outils-essai : cap-jeux.js ouvre chaque jeu sur plusieurs écrans. */
  .jo:not(.jo--dessin) { padding: 10px 14px 12px; border-radius: 14px; }
  .jo:not(.jo--dessin) > *, .jo:not(.jo--dessin) > .jo-scene > * { margin: 0 0 6px; }
  .jo:not(.jo--dessin) > .jo-scene > :is(.jo-image, .jo-puzzle) { align-self: start; position: sticky; top: 4px; margin: 0; }
  .jo-tete { gap: 2px; }
  .jo-type { font-size: calc(11px * var(--k, 1)); line-height: 1.3; }
  .jo-consigne { font-size: calc(17px * var(--k, 1)); line-height: 1.2; }
  .jo-ecouter { width: 44px; height: 44px; font-size: calc(19px * var(--k, 1)); }
  .jo:not(.jo--dessin) .jo-choix { gap: 6px; grid-template-columns: 1fr 1fr; }
  .jo:not(.jo--dessin) .jo-option { min-height: 44px; padding: 6px 12px; font-size: calc(15px * var(--k, 1)); line-height: 1.25; }
  .jo:not(.jo--dessin) :is(.jo-nombres, .jo-palette) { gap: 6px; }
  .jo:not(.jo--dessin) .jo-nombre { width: 46px; height: 46px; font-size: calc(18px * var(--k, 1)); }
  .jo:not(.jo--dessin) .jo-pastille { width: 46px; height: 46px; }
  .jo:not(.jo--dessin) .jo-btn { min-height: 44px; padding: 6px 14px; font-size: calc(15px * var(--k, 1)); }
  .jo:not(.jo--dessin) > .jo-actions { gap: 8px; position: sticky; bottom: 0; z-index: 2; padding: 6px 0 0; background: var(--jo-papier); }
  .jo:not(.jo--dessin) .jo-etat { min-height: 0; }
  .jo:not(.jo--dessin) .jo-loupe-l > :not(.jo-loupe) { display: none; }
  .jo:not(.jo--dessin) .jo-loupe { max-height: max(72px, calc(100vh - 250px)); max-width: 34vw; border-width: 3px; border-radius: 12px; }
  /* la feuille du dessin d'un côté, de toute la hauteur, et qui reste en vue (sticky) quand on descend vers les boutons ; les outils,
     les couleurs, le prénom et « Accrocher au mur » de l'autre côté */
  .jo--dessin { --jo-feuille-h: calc(100vh - 40px); display: grid; grid-template-columns: auto minmax(0, 1fr); grid-template-rows: repeat(7, auto) 1fr;
    column-gap: 20px; align-items: start; }
  .jo--dessin > *, .jo--dessin > .jo-feuille > * { grid-column: 2; margin: 0 0 10px; }
  .jo--dessin > .jo-feuille { display: contents; }
  .jo--dessin .jo-toile { grid-column: 1; grid-row: 1 / -1; position: sticky; top: 8px; width: min(52vw, calc(var(--jo-feuille-h) * 4 / 3)); margin: 0; }
  .jo--dessin .jo-dessin-modele { max-width: 180px; }
  .jo--dessin .jo-actions { justify-content: flex-start; }
}

/* (0.22) pages des parcours des enfants : l'avis de la touche M (sons coupés, rétablis), en bas de l'écran, deux secondes */
.avis-sons { position: fixed; z-index: 60; inset-inline: 0; bottom: 18px; width: max-content; max-width: calc(100vw - 32px); margin: 0 auto; padding: 8px 16px;
  border-radius: 16px; background: rgba(20,17,14,.9)/*fixe*/; color: #fff/*fixe*/; font: 600 calc(15px * var(--k, 1))/1.4 Raleway, system-ui, sans-serif; text-align: center; pointer-events: none; }
.avis-sons[hidden] { display: none; }

/* (0.24) les badges des parcours et le diplôme d'apprenti peintre (jeux-oeuvres.js : badges, recompense, diplome, medaillon).
   Le médaillon d'un parcours : l'œuvre de sa première étape dans un rond, cerclé de l'encre du musée (un tampon), et son étoile ;
   à gagner : cercle en pointillés, l'œuvre pâle, « ? ». Il garde ses couleurs hors de la carte de papier (la carte de fin de la
   visite 3D) et à l'impression. Le diplôme : une feuille de 263 × 186 mm (A4 comme Letter, en paysage), mesurée en largeur (cqw). */
.jo-impression-page { display: none; }
.jo-medaille { --jo-m: 92px; position: relative; display: inline-block; flex: none; box-sizing: border-box; width: var(--jo-m); height: var(--jo-m);
  border: calc(var(--jo-m) * .05) solid var(--jo-accent, #8C2424/*fixe*/); border-radius: 50%; background: #fff/*fixe*/; vertical-align: middle;
  box-shadow: 0 4px 12px rgba(60,40,20,.28)/*fixe*/; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
.jo-medaille-rond { position: absolute; inset: calc(var(--jo-m) * .035); overflow: hidden; border-radius: 50%; background: #ece3cf/*fixe*/; }
.jo-medaille-rond img { display: block; width: 100%; height: 100%; object-fit: cover; -webkit-user-drag: none; }
.jo-medaille.gagnee .jo-medaille-rond::after { content: ""; position: absolute; inset: 7%; border: max(1px, calc(var(--jo-m) * .018)) dashed rgba(255,255,255,.85); border-radius: 50%; }
.jo-medaille-etoile { position: absolute; inset-inline-end: -9%; bottom: -9%; display: grid; place-items: center; box-sizing: border-box; width: 40%; height: 40%;
  border: max(1px, calc(var(--jo-m) * .03)) solid #fff/*fixe*/; border-radius: 50%; background: #e0a722/*fixe*/; color: #fff/*fixe*/;
  font-family: Raleway, system-ui, sans-serif; font-weight: 700; font-size: calc(var(--jo-m) * .2); line-height: 1; }
.jo-medaille:not(.gagnee) { border-style: dashed; border-color: #8d8170/*fixe*/; background: #f6f0e3/*fixe*/; box-shadow: none; }
.jo-medaille:not(.gagnee) .jo-medaille-rond img { opacity: .28; filter: grayscale(1); }
.jo-medaille:not(.gagnee) .jo-medaille-etoile { background: #ece3cf/*fixe*/; color: #6b6153/*fixe*/; }

/* la récompense de la fin d'un parcours */
.jo--recompense { padding: 16px 18px 16px; }
.jo-recompense { display: flex; align-items: center; gap: 18px; }
.jo-recompense > .jo-medaille { --jo-m: 88px; }
.jo--recompense.nouveau .jo-recompense > .jo-medaille { animation: jo-tampon .6s ease-out; }
.jo-recompense-texte { display: grid; gap: 2px; min-width: 0; }
.jo-recompense-titre { font-family: "EB Garamond", Georgia, serif; font-weight: 500; font-size: calc(27px * min(var(--k, 1), 1.25)); line-height: 1.1; color: var(--jo-accent, #8C2424/*fixe*/); }
.jo-recompense-compte { font-weight: 600; }
.jo-recompense-tous { display: flex; flex-wrap: wrap; gap: 10px; margin: 14px 0 0; }
.jo-recompense-tous .jo-medaille { --jo-m: 42px; box-shadow: none; }
.jo-recompense-tous .jo-medaille-etoile { display: none; }
.jo-recompense-suite { margin: 12px 0 0 !important; font-weight: 600; }
.jo--recompense .jo-actions { justify-content: flex-start; }
@keyframes jo-tampon { 0% { transform: scale(1.7) rotate(-16deg); opacity: 0; } 55% { transform: scale(.93) rotate(3deg); opacity: 1; } 100% { transform: none; } }

/* la page du diplôme : l'état, les badges des parcours, le diplôme */
.jo--diplome { padding: 20px 20px 22px; }
.jo-diplome-etat { display: grid; gap: 2px; font-size: calc(18px * var(--k, 1)); }
.jo-diplome-etat .jo-etat { text-align: start; }
.jo-etagere { list-style: none; margin: 18px 0 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 14px; }
.jo-etagere li { display: flex; flex-direction: column; align-items: center; gap: 8px; margin: 0; padding: 16px 10px 12px; border: 2px solid transparent; border-radius: 14px;
  background: #fff/*fixe*/; text-align: center; }
.jo-etagere li:not(.gagne) { background: transparent; border: 2px dashed #ece3cf/*fixe*/; }
.jo-etagere .jo-medaille { --jo-m: 84px; }
.jo-etagere-t { display: grid; justify-items: center; gap: 0; }
.jo-etagere-t a, .jo-etagere-t b { display: inline-flex; align-items: center; min-height: 44px; padding: 2px 4px; font-family: "EB Garamond", Georgia, serif; font-weight: 500;
  font-size: calc(19px * var(--k, 1)); line-height: 1.2; color: var(--jo-encre, #2a231b/*fixe*/); }
.jo-etagere-t a { text-decoration: underline; text-decoration-color: rgba(42,35,27,.35)/*fixe*/; text-underline-offset: 4px; }
.jo-etagere-t a:hover { text-decoration-color: currentColor; }
.jo-etagere-t small { font-size: calc(13px * var(--k, 1)); font-weight: 600; letter-spacing: .04em; color: #6b6153/*fixe*/; }
.jo-etagere li.gagne .jo-etagere-t small { color: #2f7a46/*fixe*/; }
.jo--diplome .jo-actions { justify-content: flex-start; }
.jo--diplome .jo-prenom-l { margin: 16px 0 0; }
.jo-effacer-l { margin-top: 18px !important; }

.jo-diplome { container-type: inline-size; position: relative; box-sizing: border-box; width: 100%; max-width: 980px; margin: 20px auto 0; aspect-ratio: 263 / 186;
  padding: 0; overflow: hidden; border-radius: 4px; background: #fffdf7/*fixe*/; color: #2a231b/*fixe*/; box-shadow: 0 14px 34px rgba(60,40,20,.25)/*fixe*/;
  -webkit-print-color-adjust: exact; print-color-adjust: exact; }
.jo-diplome * { box-sizing: border-box; }
.jo-diplome p { margin: 0; }
.jo-diplome-cadre { position: absolute; inset: 2.2cqw; display: flex; flex-direction: column; align-items: center; justify-content: space-between; padding: 2.4cqw 4cqw 2cqw;
  border: .75cqw double var(--jo-accent, #8C2424/*fixe*/); border-radius: .6cqw; text-align: center; }
.jo-diplome-musee { font-family: Raleway, system-ui, sans-serif; font-weight: 600; font-size: 1.55cqw; line-height: 1.2; letter-spacing: .22em; text-transform: uppercase;
  color: var(--jo-accent, #8C2424/*fixe*/); }
.jo-diplome-titre { font-family: "EB Garamond", Georgia, serif; font-weight: 500; font-size: 5.4cqw; line-height: 1.05; color: var(--jo-accent, #8C2424/*fixe*/); }
.jo-diplome-a, .jo-diplome-pour { font-family: "EB Garamond", Georgia, serif; font-style: italic; font-size: 2cqw; line-height: 1.3; color: #4a4036/*fixe*/; }
.jo-diplome-nom { display: flex; justify-content: center; width: 100%; }
.jo-diplome-nom-t { display: block; min-width: 52%; min-height: 6.2cqw; padding: 0 1cqw; font-family: "EB Garamond", Georgia, serif; font-weight: 500;
  font-size: 5cqw; line-height: 1.2; overflow-wrap: anywhere; }
.jo-diplome-nom-t.vide { border-bottom: .2cqw dotted #6b6153/*fixe*/; }
.jo-diplome-badges { list-style: none; display: flex; justify-content: center; gap: 2cqw; width: 100%; margin: 0; padding: 0; }
.jo-diplome-badges li { display: flex; flex-direction: column; align-items: center; gap: .9cqw; width: 14.5cqw; margin: 0; }
.jo-diplome-badges .jo-medaille { --jo-m: 8.6cqw; box-shadow: none; }
.jo-diplome-badges span:not([class]) { font-family: Raleway, system-ui, sans-serif; font-weight: 600; font-size: 1.3cqw; line-height: 1.25; }
.jo-diplome-pied { display: flex; align-items: flex-end; justify-content: space-between; gap: 2cqw; width: 100%; }
.jo-diplome-date, .jo-diplome-par { flex: 1 1 0; min-width: 0; font-family: Raleway, system-ui, sans-serif; font-size: 1.5cqw; line-height: 1.3; color: #4a4036/*fixe*/; }
.jo-diplome-date { text-align: start; }
.jo-diplome-par { text-align: end; }
.jo-diplome-sceau { flex: none; display: grid; place-items: center; width: 6.6cqw; height: 6.6cqw; border: .55cqw double var(--jo-accent, #8C2424/*fixe*/); border-radius: 50%;
  color: var(--jo-accent, #8C2424/*fixe*/); font-size: 3.2cqw; line-height: 1; transform: rotate(-8deg); }
.jo-diplome.a-completer .jo-diplome-cadre { opacity: .42; filter: grayscale(.5); }
.jo-diplome-bandeau { position: absolute; left: 50%; top: 50%; width: max-content; max-width: 78%; margin: 0 !important; padding: 1.4cqw 3cqw; border-radius: 1cqw;
  background: var(--jo-accent, #8C2424/*fixe*/); color: #fff/*fixe*/; font-family: Raleway, system-ui, sans-serif; font-weight: 700; font-size: 2.3cqw; line-height: 1.3;
  text-align: center; transform: translate(-50%, -50%) rotate(-6deg); box-shadow: 0 8px 20px rgba(0,0,0,.25); }
.jo-diplome:is(:lang(zh), :lang(ar)) .jo-diplome-musee { letter-spacing: .04em; text-transform: none; }
.jo-diplome:is(:lang(zh), :lang(ar)) :is(.jo-diplome-a, .jo-diplome-pour) { font-style: normal; }
@media (max-width: 560px) {
  .jo-recompense { gap: 14px; }
  .jo-recompense > .jo-medaille { --jo-m: 72px; }
  .jo-recompense-titre { font-size: calc(23px * var(--k, 1)); }
  .jo-etagere { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .jo-etagere .jo-medaille { --jo-m: 72px; }
  .jo--diplome { padding: 14px 12px 16px; }
}
@media (prefers-reduced-motion: reduce) { .jo-medaille { animation: none !important; } }
/* l'impression du diplôme : sa copie seule (html.jo-impression, posé par le module le temps d'imprimer), la page en paysage */
@media print {
  html.jo-impression body > :not(.jo-impression-page) { display: none !important; }
  html.jo-impression, html.jo-impression body { margin: 0 !important; padding: 0 !important; min-height: 0 !important; background: #fff/*fixe*/ !important; }
  html.jo-impression .jo-impression-page { display: block !important; }
  .jo-impression-page .jo-diplome { width: 263mm; max-width: none; height: 186mm; aspect-ratio: auto; margin: 0 auto; border-radius: 0; box-shadow: none; break-inside: avoid; page-break-inside: avoid; }
}
