/* Page participant : la quête dans le Royaume de Cristal. */

.scene {
  width: min(100%, 640px);
  margin: 0 auto;
  padding: max(var(--esp-5), env(safe-area-inset-top)) var(--esp-4) var(--esp-8);
  min-height: 100dvh;
}

/* ---------- Le nom du royaume ---------- */
.titre-royaume { text-align: center; margin: var(--esp-2) 0 var(--esp-2); padding: 0 48px; }
.titre-royaume__nom {
  margin: 0;
  font-family: var(--police-titre);
  font-weight: 800;
  font-size: clamp(1.6rem, 6vw, 2.6rem);
  letter-spacing: 0.06em;
  line-height: 1.1;
  background: linear-gradient(100deg, #ffffff 0%, #c9f3ff 30%, #ffffff 45%, #7fe6ff 60%, #ffffff 80%);
  background-size: 250% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: drop-shadow(0 0 14px rgba(95, 227, 255, 0.55)) drop-shadow(0 2px 2px rgba(0, 10, 40, 0.6));
  animation: scintille 7s ease-in-out infinite;
}
@keyframes scintille {
  0%, 100% { background-position: 100% 0; }
  50% { background-position: 0 0; }
}
/* Sur l'accueil, on laisse le château respirer entre le titre et Flocon */
body[data-ecran='intro'] .titre-royaume,
body[data-ecran='accueil'] .titre-royaume { margin-bottom: clamp(48px, 20vh, 220px); }
body[data-ecran='epreuve'] .titre-royaume,
body[data-ecran='recompense'] .titre-royaume { display: none; }

/* ---------- Flocon, le guide ---------- */
.duo {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: end;
  gap: var(--esp-2);
  margin-bottom: -22px;
  position: relative;
  z-index: 2;
}
.duo .flocon {
  width: 170px;
  justify-self: center;
  transform-origin: 50% 100%;
  animation: flotte 5s ease-in-out infinite;
  scale: 1 calc(1 - var(--fonte, 0) * 0.07);
  transition: scale 700ms var(--courbe-arrivee), width 400ms var(--courbe-arrivee);
}
@keyframes flotte {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}
body[data-ecran='epreuve'] .duo .flocon { width: 104px; }
body[data-flocon='sourire'] .duo .flocon,
body[data-flocon='oh'] .duo .flocon,
body[data-flocon='clin'] .duo .flocon,
body[data-flocon='rire'] .duo .flocon { width: 112px; margin-bottom: 16px; }
body[data-ecran='epreuve'][data-flocon='sourire'] .duo .flocon,
body[data-ecran='epreuve'][data-flocon='oh'] .duo .flocon,
body[data-ecran='epreuve'][data-flocon='clin'] .duo .flocon,
body[data-ecran='epreuve'][data-flocon='rire'] .duo .flocon { width: 92px; }

.flocon--rebond { animation: rebond 420ms var(--courbe-arrivee), flotte 5s 420ms ease-in-out infinite; }
@keyframes rebond {
  0% { transform: scale(0.9) translateY(6px); }
  60% { transform: scale(1.05) translateY(-4px); }
  100% { transform: none; }
}

.duo .bulle { margin-bottom: 44px; justify-self: start; }
.duo .bulle::before {
  content: '';
  position: absolute;
  left: -9px;
  bottom: 18px;
  border: 10px solid transparent;
  border-right-color: #eef9ff;
  border-left: 0;
}

/* Flaque quand Flocon fond */
.duo::after {
  content: '';
  position: absolute;
  left: 56px;
  bottom: 16px;
  width: calc(var(--fonte, 0) * 22px);
  height: calc(var(--fonte, 0) * 3px + 4px);
  transform: translateX(-50%);
  border-radius: 50%;
  background: radial-gradient(ellipse, rgba(214, 240, 255, 0.95), rgba(120, 200, 255, 0.6) 60%, transparent 72%);
  opacity: 0;
  transition: width 700ms var(--courbe-arrivee), height 700ms var(--courbe-arrivee), opacity 400ms;
  pointer-events: none;
}
body.fonte-active .duo::after { opacity: 1; }

/* ---------- Le panneau de cristal ---------- */
.panneau { padding: var(--esp-7) var(--esp-6) var(--esp-6); }
.panneau h1 { font-size: var(--t-2xl); text-shadow: 0 0 18px rgba(95, 227, 255, 0.35); }
.panneau h2 { font-size: var(--t-xl); }
.panneau h1:focus,
.panneau h2:focus { outline: none; }
.panneau > p { max-width: 60ch; }
.discret { color: var(--texte-doux); font-size: var(--t-xs); }
.sur-titre { color: var(--cyan); font-weight: 700; font-size: var(--t-xs); margin-bottom: var(--esp-1); letter-spacing: 0.02em; }

.actions-pile { display: flex; flex-direction: column; align-items: stretch; gap: var(--esp-2); margin-top: var(--esp-5); }

/* ---------- Le parcours de la quête ---------- */
.parcours {
  list-style: none;
  margin: var(--esp-5) 0 var(--esp-4);
  padding: 0;
  display: grid;
  gap: var(--esp-3);
  position: relative;
}
.parcours::before {
  content: '';
  position: absolute;
  left: 27px;
  top: 28px;
  bottom: 28px;
  border-left: 2px dashed rgba(190, 234, 255, 0.45);
}
.parcours__etape {
  position: relative;
  display: flex;
  align-items: center;
  gap: var(--esp-4);
  padding: var(--esp-2) var(--esp-4) var(--esp-2) 0;
}
.parcours__gemme {
  width: 56px;
  height: 56px;
  flex: none;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(95, 227, 255, 0.25), rgba(7, 20, 48, 0.9) 70%);
  box-shadow: inset 0 0 0 1.5px rgba(190, 234, 255, 0.5);
}
.parcours__gemme .gemme { width: 26px; animation: scintillement 3s ease-in-out infinite; }
.parcours__etape:nth-child(2) .gemme { animation-delay: -1s; }
.parcours__etape:nth-child(3) .gemme { animation-delay: -2s; }
@keyframes scintillement {
  0%, 100% { filter: drop-shadow(0 0 6px rgba(95, 227, 255, 0.6)); transform: scale(1); }
  50% { filter: drop-shadow(0 0 14px rgba(160, 240, 255, 0.95)); transform: scale(1.06); }
}
.parcours__texte { display: grid; }
.parcours__lieu { font-size: var(--t-xs); color: var(--texte-doux); }
.parcours__jeu { font-family: var(--police-titre); font-weight: 700; font-size: var(--t-m); }

/* ---------- Les cristaux récoltés ---------- */
.hud { list-style: none; margin: 0; padding: 0; display: flex; gap: var(--esp-2); }
.hud__cristal {
  width: 40px;
  height: 46px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  background: rgba(4, 16, 42, 0.5);
  box-shadow: inset 0 0 0 1.5px rgba(190, 234, 255, 0.25);
}
.hud__gemme { width: 22px; opacity: 0.22; filter: grayscale(0.8); transition: opacity 400ms, filter 400ms; }
.hud__cristal--plein .hud__gemme { opacity: 1; filter: drop-shadow(0 0 8px rgba(95, 227, 255, 0.8)); }
.hud__cristal--actuel { box-shadow: inset 0 0 0 1.5px var(--cyan), 0 0 14px rgba(95, 227, 255, 0.45); }

.entete-epreuve {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: var(--esp-4);
  margin-bottom: var(--esp-2);
}
.titre-jeu { margin-bottom: 0; }

.consigne { color: var(--texte-doux); margin-top: var(--esp-2); }
.passer { margin: var(--esp-5) 0 0; text-align: center; font-size: var(--t-xs); }

.outils {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: var(--esp-3);
  margin-top: var(--esp-4);
}
.coups,
.compteur-cristaux { font-size: var(--t-xs); color: var(--texte-doux); min-width: 7ch; text-align: center; }
.compteur-cristaux { color: var(--glace); font-weight: 800; }

/* ---------- Récompense ---------- */
.recompense { position: relative; text-align: center; padding-top: var(--esp-3); }
.recompense .hud { justify-content: center; margin: var(--esp-4) 0; }
.recompense__gemme {
  position: relative;
  width: 110px;
  margin: 0 auto var(--esp-4);
  animation: gemme-arrive 900ms var(--courbe-arrivee) both;
}
.recompense__svg { width: 100%; height: auto; filter: drop-shadow(0 0 24px rgba(120, 235, 255, 0.95)); }
@keyframes gemme-arrive {
  0% { transform: translateY(30px) scale(0.3) rotate(-25deg); opacity: 0; }
  70% { transform: translateY(-6px) scale(1.08) rotate(4deg); opacity: 1; }
  100% { transform: none; }
}
.recompense__eclat {
  position: absolute;
  left: 50%;
  top: 70px;
  width: 320px;
  height: 320px;
  margin: -160px 0 0 -160px;
  background: repeating-conic-gradient(from 0deg, rgba(190, 240, 255, 0.22) 0 8deg, transparent 8deg 30deg);
  -webkit-mask: radial-gradient(circle, #000 20%, transparent 68%);
  mask: radial-gradient(circle, #000 20%, transparent 68%);
  animation: rayons 18s linear infinite;
  pointer-events: none;
}
@keyframes rayons { to { transform: rotate(360deg); } }

.revelation__nom {
  font-family: var(--police-titre);
  font-weight: 800;
  line-height: 1;
  overflow-wrap: anywhere;
  color: #fff;
  text-shadow: 0 0 18px rgba(95, 227, 255, 0.9), 0 0 40px rgba(95, 227, 255, 0.5);
}

/* ---------- Puzzle ---------- */
.puzzle-cadre { display: grid; grid-template-columns: 1fr 88px; gap: var(--esp-3); align-items: start; }
.puzzle {
  display: grid;
  grid-template-columns: repeat(var(--n), 1fr);
  gap: 3px;
  aspect-ratio: 1;
  padding: 4px;
  border-radius: var(--rayon-m);
  background: linear-gradient(160deg, rgba(190, 234, 255, 0.5), rgba(60, 120, 200, 0.3));
  box-shadow: 0 0 24px rgba(95, 227, 255, 0.3);
  transition: gap 500ms var(--courbe-arrivee), padding 500ms var(--courbe-arrivee);
}
.piece {
  border: 0;
  padding: 0;
  border-radius: 5px;
  cursor: pointer;
  aspect-ratio: 1;
  min-width: 0;
  position: relative;
  transition: transform var(--duree-rapide), box-shadow var(--duree-rapide);
}
.piece:hover { transform: scale(0.97); }
.piece--choisie { box-shadow: 0 0 0 3px var(--cyan), 0 0 20px 4px rgba(95, 227, 255, 0.8); transform: scale(0.93); z-index: 1; }
.piece:focus-visible { outline-offset: -3px; }
.puzzle--fini { gap: 0; padding: 0; box-shadow: 0 0 40px rgba(95, 227, 255, 0.6); }
.puzzle--fini .piece { border-radius: 0; cursor: default; }
.puzzle-modele { margin: 0; text-align: center; }
.puzzle-modele img { border-radius: var(--rayon-s); width: 100%; height: auto; box-shadow: 0 0 0 1.5px rgba(190, 234, 255, 0.5); }
.puzzle-modele figcaption { font-size: var(--t-xs); color: var(--texte-doux); margin-top: var(--esp-1); }

/* ---------- Chasse aux cristaux ---------- */
.chasse {
  position: relative;
  aspect-ratio: 3 / 2;
  border-radius: var(--rayon-m);
  overflow: hidden;
  cursor: crosshair;
  box-shadow: 0 0 0 2px rgba(190, 234, 255, 0.5), 0 0 30px rgba(95, 227, 255, 0.3);
  touch-action: manipulation;
}
.chasse__image { width: 100%; height: 100%; object-fit: cover; user-select: none; -webkit-user-drag: none; }
.chasse__cristal {
  position: absolute;
  width: var(--taille);
  aspect-ratio: 4 / 5;
  transform: translate(-50%, -50%) rotate(-8deg);
  border: 0;
  padding: 0;
  background: none;
  cursor: pointer;
  opacity: 0.85;
  animation: lueur-cachee 3s ease-in-out infinite;
}
.chasse__cristal .gemme { width: 100%; height: 100%; }
.chasse__cristal--discret { opacity: 0.6; }
.chasse__cristal::before {
  content: '';
  position: absolute;
  inset: -40%;
}
@keyframes lueur-cachee {
  0%, 100% { filter: brightness(0.9); }
  50% { filter: brightness(1.5) drop-shadow(0 0 6px #bff4ff); }
}
.chasse__cristal--indice { animation: indice 0.6s ease-in-out 4; opacity: 1; }
@keyframes indice {
  0%, 100% { transform: translate(-50%, -50%) scale(1); }
  50% { transform: translate(-50%, -50%) scale(1.6); filter: drop-shadow(0 0 14px #fff); }
}
.chasse__cristal--trouve {
  animation: ramasse 700ms var(--courbe-arrivee) forwards;
  pointer-events: none;
}
@keyframes ramasse {
  0% { transform: translate(-50%, -50%) scale(1); opacity: 1; }
  40% { transform: translate(-50%, -90%) scale(1.8); opacity: 1; filter: drop-shadow(0 0 18px #fff); }
  100% { transform: translate(-50%, -160%) scale(0.4); opacity: 0; }
}
.chasse__onde {
  position: absolute;
  width: 40px;
  height: 40px;
  margin: -20px 0 0 -20px;
  border-radius: 50%;
  border: 2px solid rgba(190, 240, 255, 0.9);
  animation: onde 700ms ease-out forwards;
  pointer-events: none;
}
@keyframes onde { from { transform: scale(0.2); opacity: 1; } to { transform: scale(1.6); opacity: 0; } }

/* ---------- Devinettes du lutin ---------- */
.devinette { display: grid; grid-template-columns: 110px 1fr; gap: var(--esp-4); align-items: center; margin-top: var(--esp-3); }
.devinette__lutin-img { width: 110px; height: auto; filter: drop-shadow(0 0 16px rgba(150, 220, 255, 0.5)); }
.devinette__corps {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.95), #e6f6ff);
  color: #0b2149;
  border-radius: var(--rayon-m);
  padding: var(--esp-4);
  box-shadow: 0 0 0 1px rgba(190, 234, 255, 0.8), 0 0 24px rgba(95, 227, 255, 0.25);
}
.devinette__compte { font-size: var(--t-xs); font-weight: 800; color: #1c6fa8; margin-bottom: var(--esp-1); }
.devinette__question { font-size: var(--t-m); font-weight: 700; margin: 0; line-height: 1.4; }
.choix { display: grid; gap: var(--esp-2); margin-top: var(--esp-4); }
.choix__bouton {
  min-height: 52px;
  border-radius: var(--rayon-m);
  border: 1.5px solid rgba(190, 234, 255, 0.5);
  background: rgba(190, 234, 255, 0.08);
  color: var(--texte);
  font: 700 var(--t-m)/1.2 var(--police-texte);
  cursor: pointer;
  padding: var(--esp-2) var(--esp-4);
  transition: background var(--duree-rapide), box-shadow var(--duree-rapide), transform var(--duree-rapide);
}
.choix__bouton:hover:not([disabled]) { background: rgba(190, 234, 255, 0.18); box-shadow: 0 0 18px rgba(95, 227, 255, 0.35); }
.choix__bouton:active:not([disabled]) { transform: scale(0.98); }
.choix__bouton--juste { background: rgba(70, 176, 122, 0.35); border-color: #8ff5c8; box-shadow: 0 0 20px rgba(143, 245, 200, 0.5); }
.choix__bouton--faux { opacity: 0.45; text-decoration: line-through; cursor: default; }

/* ---------- Chemin des lanternes ---------- */
.lanternes__etat { text-align: center; font-weight: 800; color: var(--glace); min-height: 1.6em; margin: var(--esp-2) 0; }
.lanternes { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--esp-3); max-width: 420px; margin: 0 auto; }
.lanterne {
  border: 0;
  background: radial-gradient(circle at 50% 60%, rgba(255, 255, 255, 0.06), transparent 70%);
  border-radius: var(--rayon-m);
  padding: var(--esp-2) 0;
  cursor: pointer;
  min-height: 110px;
  transition: transform var(--duree-rapide);
}
.lanterne[disabled] { cursor: default; }
.lanterne:active:not([disabled]) { transform: scale(0.95); }
.lanterne-svg { width: 100%; max-width: 70px; height: auto; margin: 0 auto; display: block; }
.lanterne-svg__verre { opacity: 0.35; transition: opacity 160ms; }
.lanterne--allumee .lanterne-svg__verre { opacity: 1; }
.lanterne--allumee { filter: drop-shadow(0 0 18px var(--teinte)) drop-shadow(0 0 36px var(--teinte)); transform: translateY(-4px); }

/* ---------- Lettres gelées ---------- */
.anagramme { margin: var(--esp-4) 0; }
.cases-lettres,
.mot-cache {
  list-style: none;
  margin: var(--esp-3) 0 var(--esp-4);
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px;
}
.case-lettre {
  width: 44px;
  height: 52px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 8px;
  background: rgba(4, 16, 42, 0.55);
  box-shadow: inset 0 0 0 1.5px rgba(190, 234, 255, 0.35), inset 0 -3px 0 rgba(95, 227, 255, 0.4);
  color: #fff;
  font: 700 1.5rem/1 var(--police-titre);
  text-transform: uppercase;
  padding: 0;
  cursor: pointer;
}
.case-lettre[disabled] { cursor: default; opacity: 1; color: #fff; }
.case-lettre--statique { cursor: default; }
.case-lettre--statique span[aria-hidden] { color: #6f8fb8; }
.case-lettre--pleine { background: linear-gradient(180deg, rgba(190, 234, 255, 0.35), rgba(95, 180, 255, 0.2)); }
.case-lettre--fixe { background: linear-gradient(180deg, rgba(143, 245, 200, 0.4), rgba(47, 196, 138, 0.25)); box-shadow: inset 0 0 0 1.5px #8ff5c8, 0 0 12px rgba(143, 245, 200, 0.4); }
.case-lettre--symbole { background: transparent; box-shadow: none; width: 16px; }
.case-lettre--nouvelle { animation: apparait 420ms var(--courbe-arrivee); }
@keyframes apparait {
  from { transform: translateY(-8px) scale(0.7); opacity: 0; filter: brightness(2); }
  to { transform: none; opacity: 1; }
}
.anagramme--faux .cases-lettres { animation: non 380ms ease; }
.anagramme--fini .case-lettre { background: linear-gradient(180deg, rgba(143, 245, 200, 0.4), rgba(47, 196, 138, 0.25)); }
@keyframes non {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-8px); }
  50% { transform: translateX(7px); }
  75% { transform: translateX(-4px); }
}

.reserve {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  padding: var(--esp-4);
  border-radius: var(--rayon-m);
  background: rgba(4, 16, 42, 0.45);
  box-shadow: inset 0 0 0 1px rgba(190, 234, 255, 0.2);
}
.lettre {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  border: 0;
  background: linear-gradient(160deg, #ffffff, #c4ecff 55%, #8fd3f5);
  color: #0b2a5c;
  font: 700 1.5rem/1 var(--police-titre);
  text-transform: uppercase;
  cursor: pointer;
  box-shadow: 0 4px 0 #4b90c4, 0 0 16px rgba(95, 227, 255, 0.35);
  transition: transform var(--duree-rapide);
}
.lettre:active { transform: translateY(3px); box-shadow: 0 1px 0 #4b90c4; }
.lettre[disabled] { background: transparent; box-shadow: inset 0 0 0 1.5px rgba(190, 234, 255, 0.15); cursor: default; }

/* ---------- Memory de Flocon ---------- */
.memoire { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--esp-2); max-width: 400px; margin: 0 auto; }
.carte-memo { position: relative; aspect-ratio: 3 / 4; border: 0; padding: 0; background: none; cursor: pointer; perspective: 600px; min-width: 0; }
.carte-memo__dos,
.carte-memo__face {
  position: absolute;
  inset: 0;
  border-radius: var(--rayon-s);
  backface-visibility: hidden;
  transition: transform 420ms var(--courbe-arrivee);
  display: grid;
  place-items: center;
  overflow: hidden;
}
.carte-memo__dos {
  background:
    repeating-linear-gradient(45deg, rgba(190, 234, 255, 0.07) 0 6px, transparent 6px 12px),
    linear-gradient(160deg, #22457f, #0d1f45);
  box-shadow: inset 0 0 0 1.5px rgba(190, 234, 255, 0.5), 0 4px 12px rgba(0, 8, 30, 0.4);
}
.carte-memo__gemme { width: 34%; height: auto; opacity: 0.85; filter: drop-shadow(0 0 6px rgba(95, 227, 255, 0.7)); }
.carte-memo__face {
  background: radial-gradient(circle at 50% 40%, #ffffff, #cdeeff);
  box-shadow: inset 0 0 0 2px var(--cyan), 0 0 16px rgba(95, 227, 255, 0.5);
  transform: rotateY(180deg);
}
.carte-memo__face img { width: 88%; height: 88%; object-fit: contain; }
.carte-memo--visible .carte-memo__dos { transform: rotateY(-180deg); }
.carte-memo--visible .carte-memo__face { transform: rotateY(0); }
.carte-memo--trouvee .carte-memo__face { box-shadow: inset 0 0 0 2px #8ff5c8, 0 0 18px rgba(143, 245, 200, 0.6); }
.carte-memo--trouvee { cursor: default; }
.carte-memo:hover:not([disabled]) .carte-memo__dos { box-shadow: inset 0 0 0 1.5px var(--cyan), 0 0 16px rgba(95, 227, 255, 0.45); }

/* ---------- Le bonhomme qui fond ---------- */
.chaleur { text-align: center; color: #ffb8c4; font-size: var(--t-xs); font-weight: 800; min-height: 1.5em; margin: 0 0 var(--esp-2); }
.clavier { display: grid; grid-template-columns: repeat(10, 1fr); gap: 5px; }
.touche {
  min-height: 46px;
  min-width: 0;
  border: 0;
  border-radius: 9px;
  background: linear-gradient(180deg, rgba(190, 234, 255, 0.28), rgba(95, 160, 230, 0.14));
  color: #fff;
  font: 800 1.05rem/1 var(--police-texte);
  box-shadow: inset 0 0 0 1px rgba(190, 234, 255, 0.45), 0 3px 0 rgba(4, 16, 42, 0.6);
  cursor: pointer;
  padding: 0;
  touch-action: manipulation;
}
.touche:hover:not([disabled]) { box-shadow: inset 0 0 0 1px var(--cyan), 0 0 12px rgba(95, 227, 255, 0.4); }
.touche:active { transform: translateY(2px); }
.touche--bonne { background: linear-gradient(180deg, #8ff5c8, #2fc48a); color: #06321f; box-shadow: 0 0 12px rgba(143, 245, 200, 0.5); }
.touche--faute { background: transparent; color: #6f8fb8; box-shadow: inset 0 0 0 1px rgba(190, 234, 255, 0.15); text-decoration: line-through; }
.touche[disabled] { cursor: default; }

/* ---------- Les portes du château ---------- */
.chateau-portes {
  position: relative;
  height: clamp(300px, 52vh, 420px);
  margin: calc(var(--esp-3) * -1) calc(var(--esp-3) * -1) 0;
  border-radius: 50% 50% var(--rayon-m) var(--rayon-m) / 26% 26% var(--rayon-m) var(--rayon-m);
  overflow: hidden;
  perspective: 1100px;
  display: grid;
  place-items: center;
  background: radial-gradient(ellipse at 50% 55%, #2a5aa0, #0a1a40 75%);
  box-shadow: 0 0 0 2px rgba(190, 234, 255, 0.5), 0 0 40px rgba(95, 227, 255, 0.35);
}
.chateau-portes__lumiere {
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 50% 50%, rgba(255, 255, 255, 0.95), rgba(160, 240, 255, 0.55) 25%, rgba(95, 227, 255, 0.12) 55%, transparent 70%);
  opacity: 0;
  transform: scale(0.4);
  transition: opacity 1200ms ease, transform 1800ms var(--courbe-arrivee);
}
.revelation__titre {
  position: relative;
  text-align: center;
  margin: 0;
  padding: 0 var(--esp-4);
  opacity: 0;
  transform: translateY(16px) scale(0.92);
  transition: opacity 900ms 700ms ease, transform 1200ms 700ms var(--courbe-arrivee);
}
.revelation__intro {
  display: block;
  font-family: var(--police-texte);
  font-weight: 700;
  font-size: var(--t-m);
  color: #0b2149;
  letter-spacing: 0;
  margin-bottom: var(--esp-3);
}
.revelation__nom {
  display: block;
  font-size: clamp(2.4rem, calc(34rem / var(--longueur)), 4.6rem);
  color: #0a2a66;
  text-shadow: 0 0 20px rgba(255, 255, 255, 0.9), 0 0 50px rgba(95, 227, 255, 0.9);
}
.porte {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 50%;
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.25), transparent 30%),
    repeating-linear-gradient(60deg, rgba(255, 255, 255, 0.08) 0 2px, transparent 2px 22px),
    repeating-linear-gradient(-60deg, rgba(255, 255, 255, 0.08) 0 2px, transparent 2px 22px),
    linear-gradient(170deg, #b9e9ff 0%, #5fb8e6 40%, #2a6fb5 100%);
  box-shadow: inset 0 0 0 2px rgba(230, 250, 255, 0.7), inset 0 0 40px rgba(255, 255, 255, 0.35);
  transition: transform 1700ms cubic-bezier(0.6, 0.05, 0.2, 1);
  z-index: 2;
}
.porte::after {
  content: '';
  position: absolute;
  top: 18%;
  bottom: 18%;
  width: 6px;
  border-radius: 3px;
  background: linear-gradient(180deg, #e9fdff, #7fd6ff);
  box-shadow: 0 0 10px rgba(255, 255, 255, 0.8);
}
.porte--g { left: 0; transform-origin: left center; }
.porte--g::after { right: 14px; }
.porte--d { right: 0; transform-origin: right center; background-position: 0 0; }
.porte--d::after { left: 14px; }
.chateau-portes__serrure {
  position: absolute;
  z-index: 3;
  display: flex;
  gap: 6px;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  padding: 10px 14px;
  border-radius: 999px;
  background: rgba(7, 20, 48, 0.75);
  box-shadow: inset 0 0 0 1.5px rgba(190, 234, 255, 0.6);
  transition: opacity 400ms 200ms;
}
.serrure__gemme { width: 22px; opacity: 0.25; filter: grayscale(0.8); transition: opacity 300ms calc(var(--i) * 320ms), filter 300ms calc(var(--i) * 320ms), transform 300ms calc(var(--i) * 320ms); }
.chateau-portes--serrure .serrure__gemme { opacity: 1; filter: drop-shadow(0 0 10px #bff4ff); transform: scale(1.15); }
.chateau-portes--ouvertes .chateau-portes__serrure { opacity: 0; }
.chateau-portes--ouvertes .porte--g { transform: rotateY(-105deg); }
.chateau-portes--ouvertes .porte--d { transform: rotateY(105deg); }
.chateau-portes--ouvertes .chateau-portes__lumiere { opacity: 1; transform: scale(1.4); }
.chateau-portes--ouvertes .revelation__titre { opacity: 1; transform: none; }
.chateau-portes--immediat *,
.chateau-portes--immediat { transition: none !important; }

.apres-portes { animation: monte 600ms var(--courbe-arrivee) both; margin-top: var(--esp-5); }
@keyframes monte { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }

.infos { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: var(--esp-3); margin: 0 0 var(--esp-4); }
.infos div {
  background: rgba(190, 234, 255, 0.08);
  border-radius: var(--rayon-m);
  padding: var(--esp-3) var(--esp-4);
  box-shadow: inset 0 0 0 1px rgba(190, 234, 255, 0.3);
}
.infos dt { font-size: var(--t-xs); color: var(--texte-doux); }
.infos dd { margin: 0; font-weight: 800; font-size: var(--t-m); }
.mot {
  margin: 0 0 var(--esp-4);
  padding: var(--esp-3) var(--esp-4);
  border-left: 3px solid var(--cyan);
  font-style: italic;
  font-size: var(--t-m);
}
.mot p { margin: 0 0 var(--esp-1); }
.mot footer { font-style: normal; font-size: var(--t-xs); color: var(--texte-doux); }
.secret { text-align: center; color: var(--glace); font-weight: 700; }

.sans-js {
  max-width: 480px;
  margin: var(--esp-6) auto;
  padding: var(--esp-4);
  background: var(--nuit);
  border-radius: var(--rayon-m);
}

@media (max-width: 520px) {
  .titre-royaume { padding: 0 52px 0 0; text-align: left; }
  .duo .flocon { width: 124px; }
  body[data-ecran='epreuve'] .duo .flocon { width: 84px; }
  body[data-flocon='sourire'] .duo .flocon,
  body[data-flocon='oh'] .duo .flocon,
  body[data-flocon='clin'] .duo .flocon,
  body[data-flocon='rire'] .duo .flocon { width: 88px; }
  body[data-ecran='epreuve'][data-flocon] .duo .flocon { width: 76px; }
  .duo { padding-right: 52px; }
  body[data-ecran='intro'] .duo,
  body[data-ecran='accueil'] .duo,
  body[data-ecran='portes'] .duo { padding-right: 0; }
  .duo .bulle { font-size: var(--t-s); margin-bottom: 32px; }
  .duo::after { left: 44px; }
  .panneau { padding: var(--esp-6) var(--esp-4) var(--esp-5); }
  .panneau h1 { font-size: var(--t-xl); }
  .panneau h2 { font-size: var(--t-l); }
  .entete-epreuve { flex-direction: column-reverse; gap: var(--esp-2); }
  .puzzle-cadre { grid-template-columns: 1fr; }
  .puzzle-modele { display: flex; align-items: center; gap: var(--esp-3); }
  .puzzle-modele img { width: 72px; }
  .case-lettre { width: 36px; height: 46px; font-size: 1.3rem; }
  .lettre { width: 48px; height: 48px; }
  .clavier { gap: 4px; }
  .touche { min-height: 44px; font-size: 1rem; }
  .devinette { grid-template-columns: 72px 1fr; gap: var(--esp-3); }
  .devinette__lutin-img { width: 72px; }
  .lanterne { min-height: 96px; }
}

/* ---------- Listes de cadeaux ---------- */
.listes {
  margin-top: var(--esp-5);
  padding: var(--esp-5);
  border-radius: var(--rayon-m);
  background: rgba(4, 16, 42, 0.4);
  box-shadow: inset 0 0 0 1px rgba(190, 234, 255, 0.28), inset 0 1px 0 rgba(255, 255, 255, 0.15);
}
.listes h2 { font-size: var(--t-l); margin-bottom: var(--esp-2); }
.liste-cadeaux { list-style: none; margin: var(--esp-3) 0; padding: 0; display: grid; gap: var(--esp-2); }
.liste-cadeaux li {
  display: grid;
  grid-template-columns: 18px 1fr;
  gap: var(--esp-3);
  align-items: start;
  padding: var(--esp-3) var(--esp-4);
  border-radius: var(--rayon-s);
  background: rgba(190, 234, 255, 0.08);
  overflow-wrap: anywhere;
}
.liste-cadeaux__puce { width: 16px; height: auto; margin-top: 3px; }
.liste-cadeaux a { color: var(--cyan); font-weight: 700; white-space: nowrap; }

.idees { list-style: none; margin: var(--esp-4) 0; padding: 0; display: grid; gap: var(--esp-3); }
.idee {
  display: grid;
  grid-template-columns: 1.4fr 1fr auto;
  gap: var(--esp-3);
  align-items: end;
  padding-bottom: var(--esp-3);
  border-bottom: 1px dashed rgba(190, 234, 255, 0.2);
}
.idee .champ { margin: 0; }
.idee .lien-bouton { font-size: var(--t-xs); }
.actions-liste { display: flex; flex-wrap: wrap; gap: var(--esp-3); align-items: center; justify-content: space-between; }
.statut-liste { min-height: 1.5em; margin: var(--esp-3) 0 0; font-weight: 700; color: var(--texte-doux); }
.statut-liste--ok { color: #8ff5c8; }
.statut-liste--erreur { color: var(--alerte); }

@media (max-width: 520px) {
  .listes { padding: var(--esp-4) var(--esp-3); }
  .idee { grid-template-columns: 1fr; gap: var(--esp-2); }
  .idee .lien-bouton { justify-self: start; min-height: 36px; padding: 0; }
  .actions-liste .bouton { width: 100%; }
}

/* ---------- Récit de la quête ---------- */
.recit { margin: var(--esp-4) 0 var(--esp-2); }
.recit p { font-size: var(--t-m); line-height: 1.65; max-width: 62ch; }
.recit strong { color: var(--glace); }
.intertitre {
  font-size: var(--t-l);
  margin: var(--esp-6) 0 var(--esp-2);
  color: var(--glace);
}
.parcours__raison { margin-top: var(--esp-1); font-size: var(--t-xs); color: var(--texte-doux); line-height: 1.5; }
.parcours__etape { align-items: flex-start; }
.parcours__gemme { margin-top: var(--esp-1); }
.regles { list-style: none; margin: var(--esp-3) 0 0; padding: 0; display: grid; gap: var(--esp-2); }
.regles li { display: grid; grid-template-columns: 16px 1fr; gap: var(--esp-3); align-items: start; }
.regles__puce { width: 14px; height: auto; margin-top: 5px; }
.histoire-epreuve {
  font-style: italic;
  color: var(--glace);
  border-left: 3px solid var(--cyan);
  padding-left: var(--esp-3);
  margin: var(--esp-3) 0 0;
  max-width: 62ch;
}

/* ---------- Tirage en cours (appareil de l'organisateur) ---------- */
.tirage-en-cours {
  margin-top: var(--esp-5);
  padding: var(--esp-5);
  border-radius: var(--rayon-m);
  background: rgba(4, 16, 42, 0.4);
  box-shadow: inset 0 0 0 1px rgba(190, 234, 255, 0.28), inset 0 1px 0 rgba(255, 255, 255, 0.15);
}
.tirage-en-cours h2 { font-size: var(--t-l); margin-bottom: var(--esp-1); }
.tirage-en-cours__titre { color: var(--cyan); font-weight: 800; margin-bottom: var(--esp-2); }
.tirage-en-cours__liste { list-style: none; margin: var(--esp-3) 0; padding: 0; display: grid; gap: var(--esp-1); }
.tirage-en-cours__liste > li {
  display: grid;
  gap: var(--esp-1);
  padding: var(--esp-2) var(--esp-3);
  border-radius: var(--rayon-s);
  background: rgba(190, 234, 255, 0.07);
}
.pastille-enfant { font-size: 0.75rem; font-weight: 700; color: var(--or); margin-left: var(--esp-1); }
.statut-envoi { font-size: var(--t-xs); font-weight: 700; color: var(--texte-doux); white-space: nowrap; }
.statut-envoi--ok { color: #8ff5c8; }

/* ---------- Les lettres gelées (façon Wordle) ---------- */
.legende-wordle {
  list-style: none;
  margin: 0 0 var(--esp-4);
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: var(--esp-2) var(--esp-4);
  font-size: var(--t-xs);
  color: var(--texte-doux);
}
.legende-wordle li { display: flex; align-items: center; gap: var(--esp-2); }
.legende-wordle .tuile { width: 26px; height: 26px; font-size: 0.85rem; border-radius: 6px; }

.wordle {
  display: grid;
  gap: 6px;
  justify-content: center;
  margin-bottom: var(--esp-2);
  --taille: min(48px, calc((100vw - 120px) / var(--n)), calc(380px / var(--n)));
}
.wordle__ligne { display: grid; grid-template-columns: repeat(var(--n), var(--taille)); gap: 6px; }
.tuile {
  width: var(--taille);
  height: var(--taille);
  display: grid;
  place-items: center;
  border-radius: 8px;
  font: 700 calc(var(--taille) * 0.5)/1 var(--police-titre);
  color: #fff;
  background: rgba(4, 16, 42, 0.5);
  box-shadow: inset 0 0 0 1.5px rgba(190, 234, 255, 0.25);
  text-transform: uppercase;
}
.tuile--pleine { box-shadow: inset 0 0 0 2px rgba(190, 234, 255, 0.75); animation: tape 140ms ease; }
@keyframes tape { 50% { transform: scale(1.08); } }
.wordle__ligne--future .tuile { opacity: 0.45; }
.tuile--bien {
  background: linear-gradient(180deg, #8ff5c8, #2fc48a);
  color: #06321f;
  box-shadow: 0 0 14px rgba(143, 245, 200, 0.55);
}
.tuile--present {
  background: linear-gradient(180deg, #ffe39a, #f3b43c);
  color: #4a2c00;
  box-shadow: 0 0 14px rgba(255, 210, 122, 0.5);
}
.tuile--absent {
  background: #3a4766;
  color: #b9c3d8;
  box-shadow: none;
}
/* Les lettres « dégèlent » une par une */
.tuile--revele { animation: degel 520ms ease both; animation-delay: calc(var(--i) * 130ms); }
@keyframes degel {
  0% { transform: rotateX(0); filter: brightness(1.8); }
  50% { transform: rotateX(90deg); }
  100% { transform: rotateX(0); filter: none; }
}
.wordle__ligne--faux { animation: non 380ms ease; }
.wordle__info { text-align: center; color: var(--glace); font-weight: 700; font-size: var(--t-xs); min-height: 1.5em; margin: 0 0 var(--esp-3); }

.clavier--wordle { grid-template-columns: repeat(10, 1fr); }
.touche--large { grid-column: span 2; font-size: var(--t-xs); }
.touche--entree { background: linear-gradient(180deg, #9ff0ff, #1d9fd6); color: #04213f; box-shadow: 0 3px 0 rgba(4, 16, 42, 0.6); }
.touche--bien { background: linear-gradient(180deg, #8ff5c8, #2fc48a); color: #06321f; box-shadow: 0 0 10px rgba(143, 245, 200, 0.45); }
.touche--present { background: linear-gradient(180deg, #ffe39a, #f3b43c); color: #4a2c00; box-shadow: 0 0 10px rgba(255, 210, 122, 0.4); }
.touche--absent { background: rgba(58, 71, 102, 0.6); color: #7a879f; box-shadow: none; }

@media (max-width: 520px) {
  .wordle { --taille: min(44px, calc((100vw - 90px) / var(--n))); gap: 5px; }
  .wordle__ligne { gap: 5px; }
  .touche--large { font-size: 0.75rem; }
}

.tirage-en-cours__nom { font-weight: 800; }

/* ---------- Les lutins voleurs ---------- */
.toits {
  position: relative;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--esp-4) var(--esp-2);
  padding: var(--esp-6) var(--esp-3) var(--esp-4);
  border-radius: var(--rayon-m);
  background:
    linear-gradient(180deg, rgba(7, 20, 48, 0.78), rgba(7, 20, 48, 0.92)),
    url('../assets/img/village.jpg') center 30% / cover;
  box-shadow: 0 0 0 2px rgba(190, 234, 255, 0.45), 0 0 30px rgba(95, 227, 255, 0.25);
  overflow: hidden;
}
/* Un toit enneigé sous chaque rangée */
.toits::before {
  content: '';
  position: absolute;
  inset: auto 0 0;
  height: 22px;
  background: linear-gradient(180deg, #eaf6ff, #b9d9f2);
  border-radius: 50% 50% 0 0 / 100% 100% 0 0;
  opacity: 0.9;
}
.cheminee {
  position: relative;
  border: 0;
  padding: 0;
  background: none;
  display: grid;
  justify-items: center;
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}
.cheminee[disabled] { cursor: default; }
.cheminee__trou {
  position: relative;
  width: 100%;
  height: 96px;
  overflow: hidden;
  display: grid;
  justify-items: center;
  align-items: end;
}
.cheminee__lutin {
  position: relative;
  display: block;
  width: 62px;
  transform: translateY(105%);
  transition: transform 170ms cubic-bezier(0.3, 1.4, 0.5, 1);
}
.cheminee__img { width: 62px; height: auto; display: block; filter: drop-shadow(0 0 8px rgba(150, 220, 255, 0.5)); }
.cheminee__objet { position: absolute; top: 18px; right: -10px; width: 26px; }
.cheminee__gemme { width: 26px; height: auto; filter: drop-shadow(0 0 8px rgba(160, 240, 255, 0.9)); animation: scintillement 1s ease-in-out infinite; }
.cheminee__boule {
  display: block;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #fff, #cfe4f5 70%, #9fbfdb);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}
.cheminee--sortie .cheminee__lutin { transform: translateY(18%); }
.cheminee--attrape .cheminee__lutin { transform: translateY(18%) rotate(-12deg) scale(0.92); transition-duration: 90ms; }
.cheminee--attrape:not(.cheminee--boule) .cheminee__objet { animation: envol 420ms ease-out forwards; }
@keyframes envol {
  to { transform: translate(-20px, -70px) scale(1.6); opacity: 0; }
}
.cheminee__brique {
  position: relative;
  width: 70px;
  height: 44px;
  margin-top: -4px;
  border-radius: 4px 4px 0 0;
  background:
    repeating-linear-gradient(0deg, transparent 0 10px, rgba(0, 0, 0, 0.25) 10px 11px),
    linear-gradient(180deg, #3c5a8f, #22385f);
  box-shadow: inset 0 0 0 1.5px rgba(190, 234, 255, 0.35);
  z-index: 1;
}
/* Neige sur le rebord de la cheminée */
.cheminee__brique::before {
  content: '';
  position: absolute;
  left: -5px;
  right: -5px;
  top: -6px;
  height: 12px;
  border-radius: 10px;
  background: linear-gradient(180deg, #ffffff, #d6ecff);
}
.cheminee:focus-visible { outline: 3px solid var(--cyan); outline-offset: 2px; border-radius: 10px; }

@media (max-width: 520px) {
  .toits { padding: var(--esp-5) var(--esp-2) var(--esp-4); gap: var(--esp-3) var(--esp-1); }
  .cheminee__trou { height: 82px; }
  .cheminee__lutin, .cheminee__img { width: 52px; }
  .cheminee__brique { width: 58px; height: 38px; }
}

/* ---------- Les congères ---------- */
.congeres {
  display: grid;
  gap: 6px;
  max-width: calc(var(--t) * 72px);
  margin: var(--esp-3) auto 0;
  padding: 10px;
  border-radius: var(--rayon-m);
  background: linear-gradient(180deg, rgba(40, 80, 140, 0.45), rgba(10, 28, 64, 0.7));
  box-shadow: inset 0 0 0 1px rgba(190, 234, 255, 0.3), 0 0 24px rgba(95, 227, 255, 0.2);
}
.congeres__rang { display: grid; grid-template-columns: repeat(var(--t), 1fr); gap: 6px; }
.congere {
  aspect-ratio: 1;
  min-width: 0;
  border: 0;
  padding: 0;
  border-radius: 46% 46% 14px 14px / 60% 60% 14px 14px;
  background:
    radial-gradient(ellipse at 40% 25%, #ffffff 0 30%, transparent 55%),
    linear-gradient(180deg, #f2f9ff 0%, #cfe5f7 60%, #a9c9e6 100%);
  box-shadow: inset 0 -5px 0 rgba(90, 140, 200, 0.35), 0 3px 6px rgba(0, 10, 40, 0.35);
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: transform var(--duree-rapide);
  touch-action: manipulation;
}
.congere:hover:not(.congere--creusee) { transform: translateY(-2px); }
.congere:active:not(.congere--creusee) { transform: scale(0.94); }
.congere--creusee {
  border-radius: 10px;
  background: rgba(4, 16, 42, 0.55);
  box-shadow: inset 0 0 0 1px rgba(190, 234, 255, 0.18);
  cursor: default;
  animation: creuse 260ms ease;
}
@keyframes creuse { from { transform: scale(1.12); filter: brightness(1.6); } to { transform: none; filter: none; } }
.congere--cristal { background: radial-gradient(circle, rgba(95, 227, 255, 0.35), rgba(4, 16, 42, 0.6) 70%); }
.congere__gemme { width: 52%; height: auto; filter: drop-shadow(0 0 8px rgba(160, 240, 255, 0.9)); }
.congere__nombre { font: 800 clamp(1rem, 4vw, 1.4rem)/1 var(--police-titre); }
.congere__nombre--1 { color: #7ff0ff; }
.congere__nombre--2 { color: #8ff5c8; }
.congere__nombre--3 { color: #ffd27a; }
.congere__nombre--4,
.congere__nombre--5,
.congere__nombre--6 { color: #ff9aa8; }
.congere--indice { animation: indice-congere 0.6s ease-in-out 4; }
@keyframes indice-congere {
  50% { transform: scale(1.1); box-shadow: 0 0 22px 6px rgba(160, 240, 255, 0.9); }
}

/* ---------- Idées déjà prises par la Mère Noël ---------- */
.liste-cadeaux__prise > span { text-decoration: line-through; text-decoration-color: rgba(255, 210, 122, 0.7); color: var(--texte-doux); }
.liste-cadeaux__badge {
  display: inline-block;
  margin-left: var(--esp-2);
  padding: 1px 10px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 800;
  color: #4a2c00;
  background: linear-gradient(180deg, #ffe39a, #f3b43c);
  text-decoration: none;
}

/* ---------- Résumé des tirages (adulte + enfants) ---------- */
.resume-tirages__liste { list-style: none; margin: var(--esp-3) 0; padding: 0; display: grid; gap: var(--esp-2); }
.resume-tirages__liste li {
  display: grid;
  grid-template-columns: minmax(70px, auto) 28px 1fr;
  align-items: center;
  gap: var(--esp-2);
  padding: var(--esp-3) var(--esp-4);
  border-radius: var(--rayon-s);
  background: rgba(190, 234, 255, 0.08);
}
.resume-tirages__liste strong { font-family: var(--police-titre); font-size: var(--t-m); color: #fff; text-shadow: 0 0 12px rgba(95, 227, 255, 0.6); }
.resume-tirages__fleche { height: 2px; background: linear-gradient(90deg, rgba(190, 234, 255, 0.3), var(--cyan)); position: relative; }
.resume-tirages__fleche::after {
  content: '';
  position: absolute;
  right: -1px;
  top: -4px;
  border: 5px solid transparent;
  border-left-color: var(--cyan);
  border-right: 0;
}

/* ---------- Le bureau de la Mère Noël ---------- */
.liste-mere { list-style: none; margin: var(--esp-3) 0 0; padding: 0; display: grid; gap: var(--esp-2); }
.liste-mere li {
  display: grid;
  grid-template-columns: 24px 1fr auto;
  gap: var(--esp-3);
  align-items: center;
  padding: var(--esp-3) var(--esp-4);
  border-radius: var(--rayon-s);
  background: rgba(190, 234, 255, 0.08);
}
.liste-mere input { width: 22px; height: 22px; margin: 0; accent-color: var(--or); }
.liste-mere label { display: grid; gap: 2px; cursor: pointer; overflow-wrap: anywhere; }
.liste-mere small { color: var(--texte-doux); font-size: 0.75rem; }
.liste-mere a { color: var(--cyan); font-weight: 700; font-size: var(--t-xs); }
.liste-mere__prise { box-shadow: inset 0 0 0 1.5px rgba(255, 210, 122, 0.6); }
.liste-mere__prise small { color: var(--or); font-weight: 800; }
body[data-ecran='mere'] .titre-royaume { margin-bottom: var(--esp-4); }

/* Fin d'un essai d'épreuve */
.essais { list-style: none; margin: var(--esp-3) 0 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: var(--esp-2); text-align: left; }
.essais a {
  display: block;
  padding: var(--esp-3) var(--esp-4);
  border-radius: var(--rayon-s);
  background: rgba(190, 234, 255, 0.08);
  box-shadow: inset 0 0 0 1px rgba(190, 234, 255, 0.3);
  text-decoration: none;
  font-weight: 700;
}
.essais a:hover { background: rgba(190, 234, 255, 0.16); }

/* Congères, version démineur */
.congeres__barre { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: var(--esp-2); max-width: calc(var(--t, 6) * 64px); margin: var(--esp-3) auto 0; }
.congeres__vies { font-weight: 800; color: #ffb8c4; letter-spacing: 0.1em; }
.congeres { max-width: min(100%, calc(var(--t) * 64px)); }
.congere--lanterne { background: radial-gradient(circle at 50% 40%, rgba(255, 210, 122, 0.45), transparent 60%), linear-gradient(180deg, #f2f9ff 0%, #cfe5f7 60%, #a9c9e6 100%); }
.congere__lanterne { width: 46%; height: auto; filter: drop-shadow(0 0 8px rgba(255, 210, 122, 0.9)); }
.congere__lanterne .lanterne-svg__verre { opacity: 1; }
.congere--reveille { border-radius: 10px; background: radial-gradient(circle, rgba(255, 154, 168, 0.35), rgba(4, 16, 42, 0.6) 70%); box-shadow: inset 0 0 0 1.5px rgba(255, 154, 168, 0.6); }
.congere__lutin { width: 70%; height: 70%; object-fit: contain; object-position: top; }
.congeres--lanterne .congere--neige { outline: 2px dashed rgba(255, 210, 122, 0.55); outline-offset: -4px; }
.congere--creuse { border-radius: 10px; background: rgba(4, 16, 42, 0.55); box-shadow: inset 0 0 0 1px rgba(190, 234, 255, 0.18); cursor: default; animation: creuse 260ms ease; }

/* ---------- Puzzle à vraies pièces ---------- */
.jigsaw {
  position: relative;
  width: min(100%, 420px);
  aspect-ratio: 1 / var(--ratio);
  margin: var(--esp-3) auto 0;
  touch-action: none;
  user-select: none;
}
.jigsaw__plateau {
  position: absolute;
  left: 0;
  top: 0;
  width: 100%;
  aspect-ratio: 1;
  border-radius: 6px;
  background-size: cover;
  opacity: 0.16;
  box-shadow: 0 0 0 2px rgba(190, 234, 255, 0.55), 0 0 30px rgba(95, 227, 255, 0.3);
}
.jigsaw__plateau::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 6px;
  background: rgba(4, 16, 42, 0.35);
}
.jigsaw__reserve {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;

  border-radius: var(--rayon-m);
  background: rgba(4, 16, 42, 0.35);
  box-shadow: inset 0 0 0 1px rgba(190, 234, 255, 0.2);
}
.jigsaw__piece {
  position: absolute;
  cursor: grab;
  touch-action: none;
  filter: drop-shadow(0 4px 6px rgba(0, 8, 30, 0.55));
  transition: filter var(--duree-rapide);
  z-index: 5;
}
.jigsaw__piece svg { width: 100%; height: 100%; display: block; overflow: visible; pointer-events: none; }
.jigsaw__piece:focus-visible { outline: none; }
.jigsaw__piece:focus-visible svg { filter: drop-shadow(0 0 0 #5fe3ff) drop-shadow(0 0 6px #5fe3ff); }
.jigsaw__piece--prise { cursor: grabbing; filter: drop-shadow(0 12px 14px rgba(0, 8, 30, 0.6)) brightness(1.08); }
.jigsaw__piece--placee { cursor: default; filter: none; transition: left 120ms ease, top 120ms ease; }
.jigsaw__contour { fill: none; stroke: rgba(230, 248, 255, 0.85); stroke-width: 1.6; }
.jigsaw__piece--placee .jigsaw__contour { stroke: rgba(230, 248, 255, 0.25); }
.jigsaw--fini .jigsaw__contour { stroke: transparent; transition: stroke 600ms ease; }
.jigsaw--fini .jigsaw__plateau { opacity: 0; }

/* Lien discret vers la salle des cartes */
.pied { text-align: center; margin-top: var(--esp-6); font-size: var(--t-xs); }
.pied a { color: var(--texte-doux); opacity: 0.8; }
.pied a:hover { color: var(--texte); opacity: 1; }
