/* Page « Joue avec les Dahoman » (FR /jeux/, EN /en/games/) : produite par outils/site-jeux.mjs, ne pas modifier à la main.
   Chaque carte de jeu tombe le masque comme les 5 Phares, sans script : survol à la souris (un clic sur l'image lance le jeu), toucher ou touche Espace
   (case à cocher en rôle « interrupteur », visuellement cachée, juste avant l'image). Mobile d'abord. */
.j-haut {
  padding-top: clamp(32px, 6vw, 64px);
  background: radial-gradient(70% 38% at 50% 0%, rgba(212, 165, 55, .16), transparent 70%), var(--fond);
}
.j-haut .chapeau { margin-bottom: 0; }

/* Les trois jeux */
.j-jeux { list-style: none; margin: 30px 0 0; padding: 0; display: grid; gap: 22px; }
.j-jeu {
  position: relative; display: flex; flex-direction: column; align-items: center; gap: 20px; min-width: 0;
  padding: 22px 18px 24px; border-radius: var(--rayon); border: 1.5px solid var(--bord);
  background: linear-gradient(180deg, var(--fond-3), var(--fond-2));
  background: radial-gradient(90% 55% at 50% 0%, color-mix(in srgb, var(--c) 26%, transparent), transparent 72%), linear-gradient(180deg, var(--fond-3), var(--fond-2));
  box-shadow: var(--ombre);
}
.j-carte { position: relative; width: min(64vw, 250px); flex: none; }
.j-bascule { position: absolute; top: 50%; left: 50%; width: 1px; height: 1px; margin: 0; padding: 0; opacity: 0; pointer-events: none; }
.j-visuel {
  position: relative; display: block; width: 100%; aspect-ratio: 360 / 504; border-radius: 5.1% / 3.65%; overflow: hidden; isolation: isolate;
  background: var(--fond-3); cursor: pointer; user-select: none; -webkit-user-select: none; -webkit-tap-highlight-color: transparent; touch-action: manipulation;
  box-shadow: var(--ombre), 0 0 0 1px var(--bord), 0 0 54px -16px var(--c, var(--or));
}
.j-survol { display: none; }
.j-bascule:focus-visible + .j-visuel { outline: 3px solid var(--creme); outline-offset: 4px; }
.j-face { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; }
.j-face--m { z-index: 2; transform-origin: 50% 0; transition: transform .8s cubic-bezier(.55, -0.3, .7, 1), opacity .45s ease .32s; }
.j-face--e { z-index: 1; transform: scale(1.07); filter: brightness(.45) saturate(.6); transition: transform 1s cubic-bezier(.2, .8, .2, 1) .2s, filter .7s ease .2s; }
.j-visuel::after { content: ""; position: absolute; inset: 0; z-index: 3; pointer-events: none; border-radius: inherit; background: radial-gradient(circle at 50% 30%, rgba(255, 236, 170, .55), transparent 60%); opacity: 0; }
.j-indice {
  position: absolute; left: 50%; bottom: 4.5%; z-index: 4; transform: translateX(-50%); max-width: 92%;
  display: inline-flex; align-items: center; gap: 5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  font: 800 .8rem/1 var(--police-texte); letter-spacing: .03em;
  background: rgba(18, 13, 10, .86); color: var(--or); border: 1px solid var(--bord-fort);
  padding: 8px 13px; border-radius: 999px; box-shadow: 0 4px 14px rgba(0, 0, 0, .5); transition: background-color .2s, color .2s;
}
.j-indice__e { display: none; }
/* Le masque tombe : toucher, clic ou Espace (case cochée) */
.j-bascule:checked + .j-visuel .j-face--m { transform: translateY(32%) rotate(-7deg) scale(.92); opacity: 0; }
.j-bascule:checked + .j-visuel .j-face--e { transform: none; filter: none; }
.j-bascule:checked + .j-visuel::after { animation: eclat .9s ease-out .25s; }
.j-bascule:checked + .j-visuel .j-indice__m { display: none; }
.j-bascule:checked + .j-visuel .j-indice__e { display: inline; }
.j-bascule:checked + .j-visuel .j-indice, .j-bascule:focus-visible + .j-visuel .j-indice { background: var(--or); color: var(--encre); }
/* … et au survol, seulement avec une vraie souris (pas de survol « collant » sur téléphone). Un lien transparent couvre
   alors l'image : un clic lance le jeu au lieu de « coller » la carte éveillée après le départ de la souris. */
@media (hover: hover) and (pointer: fine) {
  .j-survol { display: block; position: absolute; inset: 0; z-index: 5; border-radius: 5.1% / 3.65%; }
  .j-carte:hover .j-face--m { transform: translateY(32%) rotate(-7deg) scale(.92); opacity: 0; }
  .j-carte:hover .j-face--e { transform: none; filter: none; }
  .j-carte:hover .j-visuel::after { animation: eclat .9s ease-out .25s; }
  .j-carte:hover .j-indice { background: var(--or); color: var(--encre); }
  .j-carte:hover .j-indice__m { display: none; }
  .j-carte:hover .j-indice__e { display: inline; }
}
.j-texte { display: flex; flex-direction: column; align-items: center; text-align: center; flex: 1 1 auto; width: 100%; min-width: 0; }
.j-tag {
  display: inline-block; margin: 0 0 10px; padding: 6px 12px; border-radius: 999px; border: 1px solid var(--bord-fort);
  font: 800 .74rem/1.2 var(--police-texte); letter-spacing: .12em; text-transform: uppercase; color: var(--or);
}
.j-tete { display: flex; align-items: center; justify-content: center; gap: 10px; max-width: 100%; margin: 0 0 8px; }
.j-nom { font-size: clamp(1.7rem, 6.4vw, 2.2rem); margin: 0; min-width: 0; overflow-wrap: anywhere; }
/* Haut-parleurs (branchés par site/js/voix.js : sans lui, ils restent cachés) */
.j-hp { flex: none; width: 48px; height: 48px; min-width: 48px; min-height: 48px; padding: 0; border-radius: 50%; }
.j-hp:not(.voix-bouton) { display: none !important; }
.j-hp .voix-icone { width: 26px; height: 26px; }
.j-chapeau { display: flex; align-items: center; gap: 12px; }
.j-chapeau > span { min-width: 0; }
.j-phrase { margin: 0 0 20px; max-width: 40ch; }
.j-jouer { margin-top: auto; min-width: 170px; }
@media (min-width: 620px) and (max-width: 979px) {
  .j-jeu { display: grid; grid-template-columns: 210px minmax(0, 1fr); align-items: center; gap: 26px; padding: 24px; }
  .j-carte { width: 100%; }
  .j-texte { align-items: flex-start; text-align: left; }
  .j-tete { justify-content: flex-start; }
  .j-jouer { margin-top: 0; }
}
@media (min-width: 980px) {
  .j-jeux { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; margin-top: 38px; }
  .j-jeu { padding: 26px 22px 28px; }
  .j-carte { width: min(100%, 250px); }
}

/* Encore plus */
.j-sous-titre { font-size: clamp(1.75rem, 4.6vw, 2.5rem); margin-bottom: .4em; }
.j-liens { list-style: none; margin: 22px 0 0; padding: 0; display: grid; gap: 14px; }
@media (min-width: 780px) { .j-liens { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.j-lien {
  display: grid; grid-template-columns: 48px minmax(0, 1fr); column-gap: 14px; row-gap: 3px; align-items: center; height: 100%; min-height: 80px;
  padding: 16px 18px; border-radius: 18px; border: 1.5px solid var(--bord); background: var(--fond-3);
  color: var(--texte); text-decoration: none; transition: border-color .15s ease, background-color .15s ease, transform .15s ease;
}
.j-lien:hover { border-color: var(--bord-fort); background: var(--fond-4); color: var(--texte); transform: translateY(-2px); }
.j-lien svg { grid-row: 1 / span 2; width: 48px; height: 48px; color: var(--or); }
.j-lien__titre { font: 800 1.16rem/1.2 var(--police-titre); color: var(--creme); }
.j-lien__texte { font-size: .93rem; line-height: 1.4; color: var(--texte-doux); }

/* Installer sur le téléphone */
.j-encart {
  display: grid; gap: 24px; align-items: center; max-width: 900px; margin-inline: auto;
  padding: clamp(20px, 4.5vw, 36px); border-radius: 24px;
  background: linear-gradient(180deg, var(--fond-2), #150f0b); box-shadow: inset 0 0 0 2px rgba(243, 212, 138, .45), var(--ombre);
}
@media (min-width: 720px) { .j-encart { grid-template-columns: 170px minmax(0, 1fr); gap: 34px; } }
.j-encart__texte > p { margin-bottom: 0; }
.j-installer__bouton { margin-top: 14px !important; }
.j-installer__bouton:has(> [hidden]) { display: none; }
.j-tel {
  width: 150px; margin-inline: auto; aspect-ratio: 9 / 17; padding: 28px 13px 14px; border-radius: 28px;
  border: 3px solid var(--bord-fort); background: radial-gradient(80% 50% at 50% 40%, rgba(212, 165, 55, .2), transparent 70%), var(--fond);
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px 10px; align-content: start; position: relative;
}
.j-tel::before { content: ""; position: absolute; top: 10px; left: 50%; width: 38px; height: 7px; margin-left: -19px; border-radius: 99px; background: var(--fond-4); }
.j-tel__ic { aspect-ratio: 1; border-radius: 10px; background: rgba(243, 212, 138, .1); }
.j-tel__app { display: flex; flex-direction: column; align-items: center; gap: 3px; min-width: 0; }
.j-tel__app img { width: 100%; aspect-ratio: 1; border-radius: 10px; box-shadow: 0 0 0 1.5px var(--or), 0 0 18px rgba(243, 212, 138, .5); animation: j-pouls 2.2s ease-in-out 2; } /* bref : pas de mouvement sans fin */
.j-tel__app small { font: 800 .56rem/1 var(--police-texte); letter-spacing: .04em; color: var(--creme); }
@keyframes j-pouls { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.1); } }
.j-etapes { list-style: none; margin: 18px 0 0; padding: 0; display: grid; gap: 12px; }
.j-etapes li {
  display: grid; grid-template-columns: 36px minmax(0, 1fr); gap: 12px; align-items: start;
  padding: 12px 14px; border-radius: 14px; border: 1px solid var(--bord); background: rgba(255, 255, 255, .03);
}
.j-etapes li > svg { width: 36px; height: 36px; color: var(--or); }
.j-etapes p { margin: 0; line-height: 1.5; }
.j-etapes b { display: block; }
.j-geste { display: inline-block; width: 1.2em; height: 1.2em; vertical-align: -.22em; color: var(--or); }
/* Le lien discret vers le Coin des parents (page des adultes) */
.j-parents { text-align: center; margin: 30px 0 0; font-size: .92rem; }
.j-parents a { display: inline-flex; align-items: center; min-height: 44px; padding: 6px 4px; color: var(--texte-doux); font-weight: 700; }
.j-parents a:hover { color: var(--or); }

/* Mouvement réduit : le masque s'efface en fondu, sans glisser */
@media (prefers-reduced-motion: reduce) {
  .j-face--m, .j-face--e { transition: opacity .25s ease !important; transform: none !important; }
  .j-visuel::after { animation: none !important; }
  .j-tel__app img { animation: none !important; }
  .j-lien:hover { transform: none; }
}
