/* =====================================================================
   Calendrier de l'Avent — Pour toi, mon cœur
   ===================================================================== */

:root {
  --fond-1: #6e1429;
  --fond-2: #4a0c1c;
  --fond-3: #25050e;
  --or: #e2bf73;
  --or-clair: #f6dea0;
  --or-fonce: #a97b31;
  --creme: #f7ead8;
  --encre: #4a0b19;
  --rose: #f2b4ae;
  --gap: 8px;

  --ruban-v: linear-gradient(90deg, #a6782d 0%, #e9c977 22%, #fbe8b0 45%, #d9b05a 62%, #a6782d 100%);
  --ruban-h: linear-gradient(180deg, #a6782d 0%, #e9c977 22%, #fbe8b0 45%, #d9b05a 62%, #a6782d 100%);

  --police-titre: "Playfair Display", Georgia, serif;
  --police-lettre: "Cormorant Garamond", Georgia, serif;
  --police-texte: "Jost", system-ui, -apple-system, sans-serif;

  color-scheme: dark;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100dvh;
  font-family: var(--police-texte);
  color: var(--creme);
  background-color: var(--fond-2);
  background-image:
    radial-gradient(120% 70% at 50% -10%, rgba(255, 170, 150, .16), transparent 60%),
    radial-gradient(140% 90% at 50% 0%, var(--fond-1) 0%, var(--fond-2) 48%, var(--fond-3) 100%);
  background-attachment: fixed;
  overflow-x: hidden;
  -webkit-tap-highlight-color: transparent;
}

body.modal-ouverte { overflow: hidden; }

button { font: inherit; color: inherit; }

#neige {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0;
}

/* ---------- Guirlande lumineuse ---------- */
.guirlande {
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 70px;
  z-index: 1;
  pointer-events: none;
}
.guirlande svg { width: 100%; height: 100%; display: block; overflow: visible; }
.guirlande .fil { fill: none; stroke: #1d0207; stroke-width: 1.6; opacity: .85; }
.guirlande .ampoule { animation: scintille 2.6s ease-in-out infinite; transform-box: fill-box; transform-origin: 50% 0; }
.guirlande .halo { animation: halo 2.6s ease-in-out infinite; }
@keyframes scintille { 0%, 100% { opacity: 1; } 50% { opacity: .45; } }
@keyframes halo { 0%, 100% { opacity: .55; } 50% { opacity: .08; } }

/* ---------- Bouton son ---------- */
.son-toggle {
  position: fixed;
  top: max(12px, env(safe-area-inset-top));
  right: 12px;
  z-index: 20;
  width: 40px; height: 40px;
  border-radius: 50%;
  border: 1px solid rgba(226, 191, 115, .45);
  background: rgba(40, 5, 14, .55);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  color: var(--or);
  display: grid;
  place-items: center;
  cursor: pointer;
  padding: 0;
}
.son-toggle svg { width: 20px; height: 20px; }
.son-toggle .son-off { display: none; }
.son-toggle[aria-pressed="false"] .son-on { display: none; }
.son-toggle[aria-pressed="false"] .son-off { display: block; }

/* ---------- Page ---------- */
.page {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: 560px;
  margin: 0 auto;
  padding: calc(54px + env(safe-area-inset-top)) 16px calc(32px + env(safe-area-inset-bottom));
}

.entete { text-align: center; margin-bottom: 22px; }

.surtitre {
  margin: 0 0 10px;
  font-family: var(--police-texte);
  font-weight: 500;
  font-size: 12px;
  letter-spacing: .32em;
  text-transform: uppercase;
  color: var(--creme);
  opacity: .92;
}

.titre {
  margin: 0;
  font-family: var(--police-titre);
  font-style: italic;
  font-weight: 500;
  font-size: clamp(40px, 12vw, 68px);
  line-height: 1.02;
  color: #fbe6d6;
  text-shadow: 0 2px 18px rgba(0, 0, 0, .35);
  text-wrap: balance;
}

.sous-titre {
  margin: 12px 0 0;
  font-family: var(--police-titre);
  font-size: clamp(16px, 4.6vw, 20px);
  color: var(--creme);
  opacity: .9;
}

.statut {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 16px 0 0;
  padding: 7px 14px;
  border-radius: 999px;
  border: 1px solid rgba(226, 191, 115, .35);
  background: rgba(30, 3, 10, .35);
  font-size: 13px;
  letter-spacing: .02em;
  color: var(--or-clair);
}
.statut:empty { display: none; }

/* ---------- Grille du calendrier ---------- */
.calendrier-wrap { container-type: inline-size; }

.calendrier {
  --cols: 4;
  display: grid;
  grid-template-columns: repeat(var(--cols), 1fr);
  grid-auto-rows: calc((100cqi - (var(--cols) - 1) * var(--gap)) / var(--cols) * .94);
  gap: var(--gap);
}

.case {
  grid-column: var(--mc) / span var(--cs);
  grid-row: var(--mr) / span var(--rs);
  position: relative;
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
  perspective: 700px;
  container-type: size;
  border-radius: 10px;
  outline: none;
  opacity: 0;
  animation: apparition .7s cubic-bezier(.2, .8, .3, 1.2) forwards;
  animation-delay: var(--delai, 0ms);
}
@keyframes apparition {
  from { opacity: 0; transform: translateY(14px) scale(.94); }
  to   { opacity: 1; transform: none; }
}
.case:focus-visible .case-porte { box-shadow: 0 0 0 3px var(--or-clair), 0 8px 18px rgba(0, 0, 0, .4); }

.case-interieur {
  position: absolute;
  inset: 0;
  border-radius: 10px;
  overflow: hidden;
  background:
    radial-gradient(90% 80% at 60% 50%, #fffaf2 0%, #f3e2c8 70%, #e6cfae 100%);
  box-shadow: inset 0 0 0 2px rgba(169, 123, 49, .55), inset 6px 8px 18px rgba(90, 40, 20, .35);
  display: grid;
  place-items: center;
  visibility: hidden;
}
.case-interieur .coeur-mini { width: 30cqmin; height: 30cqmin; margin-left: 30%; color: #c0192f; filter: drop-shadow(0 2px 3px rgba(120, 10, 30, .3)); }
.case-interieur img { position: absolute; inset: 6% 6% 6% 36%; width: 58%; height: 88%; object-fit: cover; border-radius: 6px; }
.case.est-ouverte .case-interieur { visibility: visible; }

/* --- Paquet cadeau (porte de la case) --- */
.paquet {
  position: absolute;
  inset: 0;
  border-radius: 10px;
  overflow: hidden;
  container-type: size;
  background: linear-gradient(155deg, var(--face-1) 0%, var(--face-2) 100%);
  box-shadow:
    0 8px 16px rgba(0, 0, 0, .38),
    0 2px 4px rgba(0, 0, 0, .25),
    inset 0 1px 0 rgba(255, 255, 255, .35),
    inset 0 -3px 6px rgba(0, 0, 0, .18);
}
.paquet::before {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--texture, none);
  background-size: var(--texture-taille, auto);
  pointer-events: none;
}
.paquet::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(255, 255, 255, .28) 0%, rgba(255, 255, 255, 0) 38%, rgba(0, 0, 0, 0) 70%, rgba(0, 0, 0, .14) 100%);
  pointer-events: none;
  z-index: 5;
}

.case-porte {
  transform-origin: left center;
  transition: transform 1.1s cubic-bezier(.25, 1.3, .45, 1), box-shadow .3s;
  will-change: transform;
}
.case.est-ouverte .case-porte { transform: rotateY(-68deg); }
.case-porte .poignee {
  position: absolute;
  right: 7%;
  top: 50%;
  width: 9cqmin; height: 9cqmin;
  min-width: 6px; min-height: 6px;
  transform: translateY(-50%);
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #fff3c9, #d2a54b 55%, #8a5f20);
  box-shadow: 0 1px 2px rgba(0, 0, 0, .4);
  z-index: 6;
  display: none;
}
.case.est-ouverte .poignee { display: block; }

/* Thèmes de couleur */
.t-bordeaux { --face-1: #8c1630; --face-2: #5a0a1c; --num: #f8e6cf; }
.t-rouge    { --face-1: #c51f38; --face-2: #8e1126; --num: #fbe9d4; }
.t-rose     { --face-1: #f7c3b9; --face-2: #e79d95; --num: #6a0f22; }
.t-peche    { --face-1: #fad3c0; --face-2: #f0ae98; --num: #6a0f22; }
.t-lavande  { --face-1: #dcc5e6; --face-2: #b896c7; --num: #5c0d22; }
.t-creme    { --face-1: #fbf1e2; --face-2: #ead6b9; --num: #5c0d22; }
.t-or       { --face-1: #f4dc9c; --face-2: #c9973f; --num: #5c0d22; }

/* Textures */
.x-rayures { --texture: repeating-linear-gradient(90deg, rgba(255, 255, 255, .13) 0 2px, rgba(255, 255, 255, 0) 2px 8px); }
.x-velours { --texture: radial-gradient(120% 90% at 25% 15%, rgba(255, 255, 255, .22), rgba(255, 255, 255, 0) 55%), radial-gradient(80% 60% at 85% 95%, rgba(0, 0, 0, .25), rgba(0, 0, 0, 0) 70%); }
.x-etoiles {
  --texture: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='46' height='46'%3E%3Cg fill='%23e2bf73'%3E%3Cpath d='M10 6l1.2 2.6 2.8.3-2.1 1.9.6 2.8L10 12.2 7.5 13.6l.6-2.8-2.1-1.9 2.8-.3z'/%3E%3Cpath d='M33 25l.9 1.9 2 .2-1.5 1.4.4 2-1.8-1-1.8 1 .4-2-1.5-1.4 2-.2z'/%3E%3Ccircle cx='38' cy='9' r='1.1'/%3E%3Ccircle cx='17' cy='37' r='1.3'/%3E%3Ccircle cx='24' cy='16' r='.8'/%3E%3C/g%3E%3C/svg%3E");
  --texture-taille: 46px 46px;
}

/* Rubans */
.paquet .rv, .paquet .rh, .paquet .rc { position: absolute; z-index: 1; pointer-events: none; }
.paquet .rv {
  top: 0; bottom: 0;
  left: var(--vx, 50%);
  width: var(--rw, 13cqmin);
  transform: translateX(-50%);
  background: var(--rv, var(--ruban-v));
  box-shadow: 0 0 3px rgba(0, 0, 0, .18);
}
.paquet .rh {
  left: 0; right: 0;
  top: var(--hy, 30%);
  height: var(--rw, 13cqmin);
  transform: translateY(-50%);
  background: var(--rh, var(--ruban-h));
  box-shadow: 0 0 3px rgba(0, 0, 0, .18);
}
.paquet .rc {
  top: 0; right: 0;
  width: 160cqmin;
  height: var(--rw, 12cqmin);
  transform-origin: 100% 0;
  transform: translate(0, 34cqmin) rotate(45deg) translateX(30%);
  background: var(--rh, var(--ruban-h));
  box-shadow: 0 0 3px rgba(0, 0, 0, .2);
}
.r-fin { --rw: 4.5cqmin; }
.r-ficelle { --rw: 2.2cqmin; }
.r-organza {
  --rw: 26cqmin;
  --rv: linear-gradient(90deg, rgba(255, 250, 235, .35), rgba(255, 252, 240, .75) 30%, rgba(255, 248, 230, .45) 60%, rgba(255, 250, 235, .7) 85%, rgba(255, 250, 235, .35));
  --rh: linear-gradient(180deg, rgba(255, 250, 235, .35), rgba(255, 252, 240, .75) 30%, rgba(255, 248, 230, .45) 60%, rgba(255, 250, 235, .7) 85%, rgba(255, 250, 235, .35));
}
.rc-lavande {
  --rv: linear-gradient(90deg, #8d6aa3, #c7a8dc 30%, #e7d5f2 48%, #b28fc9 65%, #8d6aa3);
  --rh: linear-gradient(180deg, #8d6aa3, #c7a8dc 30%, #e7d5f2 48%, #b28fc9 65%, #8d6aa3);
}
.rc-rouge {
  --rv: linear-gradient(90deg, #7a0b1d, #d22a45 35%, #ef5a6e 50%, #b81a33 65%, #7a0b1d);
  --rh: linear-gradient(180deg, #7a0b1d, #d22a45 35%, #ef5a6e 50%, #b81a33 65%, #7a0b1d);
}

/* Nœud */
.paquet .noeud {
  position: absolute;
  z-index: 2;
  left: var(--vx, 50%);
  top: var(--hy, 30%);
  width: var(--nw, 52cqmin);
  height: auto;
  transform: translate(-50%, -52%);
  filter: drop-shadow(0 2px 2px rgba(0, 0, 0, .3));
  pointer-events: none;
}
.paquet.coin .noeud { left: auto; right: -4cqmin; top: -2cqmin; transform: rotate(45deg) translate(0, 0); width: 40cqmin; }

/* Cadre (case 1) */
.paquet .cadre {
  position: absolute;
  inset: 6cqmin;
  border: 1.5px solid rgba(226, 191, 115, .75);
  border-radius: 6px;
  z-index: 1;
  box-shadow: inset 0 0 0 4px rgba(0, 0, 0, .08);
}

/* Numéro */
.paquet .num {
  position: absolute;
  z-index: 4;
  left: var(--nx, 50%);
  top: var(--ny, 62%);
  transform: translate(-50%, -50%);
  font-family: var(--police-titre);
  font-weight: 700;
  font-size: var(--nf, 40cqmin);
  line-height: 1;
  color: var(--num);
  text-shadow: 0 1px 0 rgba(255, 255, 255, .25), 0 2px 6px rgba(0, 0, 0, .25);
  letter-spacing: -.02em;
  pointer-events: none;
}

/* États */
.case.est-verrouillee .paquet { filter: saturate(.8) brightness(.86); }
.case .cadenas-mini {
  position: absolute;
  right: 5px; bottom: 5px;
  width: 13px; height: 13px;
  color: var(--or);
  opacity: .65;
  z-index: 7;
  display: none;
}
.case.est-verrouillee .cadenas-mini { display: block; }

.case.est-aujourdhui .case-porte {
  animation: lueur 2.2s ease-in-out infinite;
}
@keyframes lueur {
  0%, 100% { box-shadow: 0 0 0 2px rgba(246, 222, 160, .9), 0 0 16px 2px rgba(226, 191, 115, .55), 0 8px 16px rgba(0, 0, 0, .38); }
  50%      { box-shadow: 0 0 0 2px rgba(246, 222, 160, .6), 0 0 30px 8px rgba(226, 191, 115, .8), 0 8px 16px rgba(0, 0, 0, .38); }
}
.case .etincelle {
  position: absolute;
  z-index: 8;
  width: 16px; height: 16px;
  color: #fff4cf;
  pointer-events: none;
  display: none;
  filter: drop-shadow(0 0 4px rgba(255, 230, 160, .9));
}
.case.est-aujourdhui .etincelle { display: block; animation: etincelle 2.4s ease-in-out infinite; }
.case .etincelle.e1 { top: -6px; right: -4px; }
.case .etincelle.e2 { bottom: 8px; left: -6px; width: 11px; height: 11px; animation-delay: 1.1s !important; }
@keyframes etincelle {
  0%, 100% { transform: scale(.2) rotate(0); opacity: 0; }
  40%, 60% { transform: scale(1) rotate(90deg); opacity: 1; }
}

.case .pastille {
  position: absolute;
  top: 6px; left: 6px;
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--or-clair);
  box-shadow: 0 0 0 2px rgba(90, 10, 28, .5), 0 0 8px rgba(246, 222, 160, .9);
  z-index: 7;
  display: none;
  animation: battement 1.6s ease-in-out infinite;
}
.case.est-disponible:not(.est-aujourdhui):not(.est-ouverte) .pastille { display: block; }
@keyframes battement { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.4); } }

.case.refus { animation: refus .5s ease; opacity: 1; }
@keyframes refus {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-5px) rotate(-1.5deg); }
  40% { transform: translateX(5px) rotate(1.5deg); }
  60% { transform: translateX(-3px); }
  80% { transform: translateX(3px); }
}
@media (hover: hover) {
  .case:not(.est-verrouillee):hover .case-porte:not(:where(.case.est-ouverte .case-porte)) { transform: translateY(-3px) scale(1.02); }
  .case.est-ouverte:hover .case-porte { transform: rotateY(-74deg); }
}

/* ---------- Pied de page ---------- */
.pied { margin-top: 26px; text-align: center; }
.compteur { font-family: var(--police-titre); font-style: italic; font-size: 17px; color: var(--creme); opacity: .92; }
.perles { display: flex; flex-wrap: wrap; justify-content: center; gap: 5px; margin: 12px auto 0; max-width: 380px; }
.perles span {
  width: 9px; height: 9px;
  border-radius: 50%;
  border: 1px solid rgba(226, 191, 115, .5);
  transition: background .4s, box-shadow .4s;
}
.perles span.pleine { background: var(--or); box-shadow: 0 0 6px rgba(226, 191, 115, .8); border-color: var(--or); }

/* ---------- Toast ---------- */
.toast {
  position: fixed;
  left: 50%;
  bottom: calc(22px + env(safe-area-inset-bottom));
  z-index: 100;
  transform: translate(-50%, 30px);
  max-width: calc(100% - 32px);
  padding: 12px 18px;
  border-radius: 14px;
  background: rgba(250, 238, 222, .97);
  color: var(--encre);
  font-size: 15px;
  text-align: center;
  box-shadow: 0 10px 30px rgba(0, 0, 0, .4);
  opacity: 0;
  pointer-events: none;
  transition: opacity .3s, transform .4s cubic-bezier(.2, .9, .3, 1.3);
}
.toast.visible { opacity: 1; transform: translate(-50%, 0); }

.bandeau-test {
  position: fixed;
  left: 12px;
  top: max(12px, env(safe-area-inset-top));
  z-index: 20;
  padding: 6px 10px;
  border-radius: 8px;
  background: rgba(20, 2, 8, .7);
  border: 1px dashed rgba(226, 191, 115, .6);
  color: var(--or-clair);
  font-size: 11px;
  letter-spacing: .04em;
}

/* =====================================================================
   Fenêtre d'ouverture
   ===================================================================== */
.modal {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
}
.modal[hidden] { display: none; }
.modal-fond {
  position: absolute;
  inset: 0;
  background: rgba(18, 2, 7, .75);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  animation: fondu .35s ease;
}
@keyframes fondu { from { opacity: 0; } }

.modal-feuille {
  position: relative;
  width: 100%;
  height: 100dvh;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: calc(22px + env(safe-area-inset-top)) 16px calc(26px + env(safe-area-inset-bottom));
  background:
    radial-gradient(80% 50% at 50% 30%, rgba(255, 190, 160, .12), transparent 70%),
    radial-gradient(130% 100% at 50% 0%, #6a1328 0%, #440b1a 55%, #2a0610 100%);
  animation: monte .5s cubic-bezier(.2, .9, .3, 1.1);
}
@keyframes monte { from { opacity: 0; transform: translateY(30px) scale(.97); } }

@media (min-width: 640px) {
  .modal-feuille {
    width: min(560px, calc(100% - 40px));
    height: auto;
    max-height: calc(100dvh - 40px);
    border-radius: 26px;
    border: 1px solid rgba(226, 191, 115, .35);
    box-shadow: 0 30px 80px rgba(0, 0, 0, .55);
    padding: 30px 28px 32px;
  }
}

.modal-fermer {
  position: absolute;
  top: calc(12px + env(safe-area-inset-top));
  right: 12px;
  z-index: 10;
  width: 40px; height: 40px;
  border-radius: 50%;
  border: 1px solid rgba(226, 191, 115, .4);
  background: rgba(30, 3, 10, .4);
  color: var(--creme);
  display: grid;
  place-items: center;
  cursor: pointer;
  padding: 0;
}
.modal-fermer svg { width: 20px; height: 20px; }
@media (min-width: 640px) { .modal-fermer { top: 14px; right: 14px; } }

.vue[hidden] { display: none; }
.vue-defi { text-align: center; display: flex; flex-direction: column; align-items: center; }

.defi-jour {
  margin: 4px 0 6px;
  font-size: 11.5px;
  font-weight: 500;
  letter-spacing: .3em;
  text-transform: uppercase;
  color: var(--or);
}
.defi-titre {
  margin: 0;
  font-family: var(--police-titre);
  font-style: italic;
  font-weight: 500;
  font-size: clamp(28px, 8vw, 36px);
  color: #fbe6d6;
  line-height: 1.1;
}
.defi-consigne {
  margin: 8px auto 0;
  max-width: 32ch;
  min-height: 2.6em;
  font-size: 15px;
  line-height: 1.35;
  color: var(--creme);
  opacity: .88;
  transition: opacity .25s;
}

/* ---------- Scène et cadeau ---------- */
.scene {
  position: relative;
  width: min(84vw, 46dvh, 340px);
  aspect-ratio: 1;
  margin: 6px auto 0;
  touch-action: manipulation;
  user-select: none;
  -webkit-user-select: none;
}
.calque, .eclats { position: absolute; inset: 0; }
.eclats { pointer-events: none; z-index: 30; overflow: visible; }
.calque { z-index: 10; }
.calque:empty { pointer-events: none; }

.cadeau {
  --untie: 0;
  --secousse: 0;
  --eclat: 0;
  position: absolute;
  left: 50%;
  bottom: 7%;
  width: 62%;
  height: 58%;
  transform: translateX(-50%);
}
.cadeau .ombre {
  position: absolute;
  left: -8%; right: -8%;
  bottom: -7%;
  height: 12%;
  border-radius: 50%;
  background: radial-gradient(closest-side, rgba(0, 0, 0, .5), transparent);
}
.cadeau .corps {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 78%;
  border-radius: 6px;
  overflow: hidden;
  background: linear-gradient(160deg, var(--face-1), var(--face-2));
  box-shadow: inset 0 -10px 22px rgba(0, 0, 0, .25), inset 0 2px 0 rgba(255, 255, 255, .25), 0 12px 24px rgba(0, 0, 0, .35);
}
.cadeau .corps::before {
  content: "";
  position: absolute; inset: 0;
  background: var(--texture, none);
  background-size: var(--texture-taille, auto);
}
.cadeau .couvercle {
  position: absolute;
  left: -5%; right: -5%; top: 0;
  height: 26%;
  z-index: 3;
  transition: transform 1s cubic-bezier(.2, .8, .3, 1), opacity .5s ease .55s;
}
.cadeau .couvercle-face {
  position: absolute;
  inset: 0;
  border-radius: 6px;
  overflow: hidden;
  background: linear-gradient(170deg, var(--face-1), var(--face-2));
  box-shadow: 0 6px 10px rgba(0, 0, 0, .32), inset 0 2px 0 rgba(255, 255, 255, .35), inset 0 -4px 8px rgba(0, 0, 0, .15);
}
.cadeau .couvercle-face::before {
  content: "";
  position: absolute; inset: 0;
  background: var(--texture, none);
  background-size: var(--texture-taille, auto);
}
.cadeau .bande {
  position: absolute;
  top: 0; bottom: 0;
  left: 50%;
  width: 16%;
  transform: translateX(-50%);
  background: var(--rv, var(--ruban-v));
  box-shadow: 0 0 4px rgba(0, 0, 0, .25);
  transition: opacity .5s, transform .6s;
}
.cadeau.r-organza .bande { width: 26%; }
.cadeau.sans-ruban .bande, .cadeau.sans-ruban .grand-noeud { opacity: 0; transform: translateX(-50%) translateY(40%) scaleY(.6); }
.cadeau .grand-noeud {
  position: absolute;
  left: 50%;
  bottom: 62%;
  width: 78%;
  transform: translateX(-50%) scale(calc(1 - var(--untie) * .55)) rotate(calc(var(--untie) * -28deg));
  transform-origin: 50% 70%;
  filter: drop-shadow(0 3px 3px rgba(0, 0, 0, .35));
  z-index: 4;
  transition: opacity .5s, transform .2s;
}
.cadeau .etiquette {
  position: absolute;
  right: 9%;
  top: 30%;
  z-index: 2;
  width: 26%;
  aspect-ratio: .8;
  display: grid;
  place-items: center;
  border-radius: 4px 4px 6px 6px;
  background: linear-gradient(170deg, #fffaf0, #efdcc0);
  color: var(--encre);
  font-family: var(--police-titre);
  font-weight: 700;
  font-size: min(9vw, 34px);
  box-shadow: 0 3px 6px rgba(0, 0, 0, .3);
  transform: rotate(8deg);
  clip-path: polygon(22% 0, 78% 0, 100% 16%, 100% 100%, 0 100%, 0 16%);
}
.cadeau .etiquette::before {
  content: "";
  position: absolute;
  top: 7%;
  left: 50%;
  width: 12%; aspect-ratio: 1;
  transform: translateX(-50%);
  border-radius: 50%;
  background: rgba(74, 11, 25, .35);
}
.cadeau .lumiere {
  position: absolute;
  left: 50%; top: 22%;
  width: 240%;
  aspect-ratio: 1;
  transform: translate(-50%, -50%) scale(0);
  border-radius: 50%;
  background:
    radial-gradient(closest-side, rgba(255, 246, 210, 1) 0%, rgba(255, 220, 150, .7) 22%, rgba(255, 200, 120, 0) 70%),
    repeating-conic-gradient(from 0deg, rgba(255, 236, 180, .35) 0deg 6deg, transparent 6deg 22deg);
  -webkit-mask: radial-gradient(closest-side, #000 40%, transparent 100%);
          mask: radial-gradient(closest-side, #000 40%, transparent 100%);
  opacity: 0;
  pointer-events: none;
  z-index: 1;
}
.cadeau .halo-defi {
  position: absolute;
  inset: -20%;
  border-radius: 50%;
  background: radial-gradient(closest-side, rgba(255, 220, 150, calc(var(--eclat) * .75)), transparent 75%);
  pointer-events: none;
  z-index: 0;
}

.cadeau.secoue { animation: secoue .32s ease; }
@keyframes secoue {
  0%, 100% { transform: translateX(-50%) rotate(0); }
  25% { transform: translateX(calc(-50% - (3px + var(--secousse) * 9px))) rotate(calc(-3deg - var(--secousse) * 7deg)); }
  50% { transform: translateX(calc(-50% + (3px + var(--secousse) * 9px))) rotate(calc(3deg + var(--secousse) * 7deg)) translateY(calc(var(--secousse) * -10px)); }
  75% { transform: translateX(calc(-50% - 2px)) rotate(-1.5deg); }
}

.cadeau.ouvre .couvercle { transform: translate(28%, -190%) rotate(32deg); opacity: 0; }
.cadeau.ouvre .lumiere { animation: lumiere 1.6s ease-out forwards; }
.cadeau.ouvre .corps { animation: rebond .6s cubic-bezier(.3, 1.6, .5, 1) .1s; }
@keyframes lumiere {
  0% { opacity: 0; transform: translate(-50%, -50%) scale(.1) rotate(0); }
  35% { opacity: 1; }
  100% { opacity: .9; transform: translate(-50%, -50%) scale(1) rotate(40deg); }
}
@keyframes rebond { 0% { transform: scaleY(1); } 40% { transform: scaleY(.9) scaleX(1.05); } 100% { transform: none; } }

/* ---------- Progression ---------- */
.progression {
  width: min(260px, 70%);
  height: 4px;
  margin: 16px auto 0;
  border-radius: 99px;
  background: rgba(226, 191, 115, .18);
  overflow: hidden;
  transition: opacity .3s;
}
.progression span {
  display: block;
  height: 100%;
  width: 100%;
  transform: scaleX(var(--p, 0));
  transform-origin: left;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--or-fonce), var(--or-clair));
  box-shadow: 0 0 8px rgba(246, 222, 160, .8);
  transition: transform .15s linear;
}
.progression.cachee { opacity: 0; }

.defi-ui {
  width: 100%;
  min-height: 70px;
  margin-top: 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}
.etape {
  font-size: 12px;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--or);
  opacity: .8;
}

/* ---------- Défi : ruban ---------- */
.piste-ruban {
  position: relative;
  width: min(320px, 88%);
  height: 56px;
  touch-action: none;
}
.piste-ruban .rail {
  position: absolute;
  left: 22px; right: 22px; top: 50%;
  border-top: 2px dashed rgba(226, 191, 115, .45);
}
.piste-ruban .tire {
  position: absolute;
  left: 0; top: 50%;
  height: 12px;
  transform: translateY(-50%);
  border-radius: 3px;
  background: var(--ruban-h);
  box-shadow: 0 1px 3px rgba(0, 0, 0, .35);
}
.piste-ruban .but {
  position: absolute;
  right: 4px; top: 50%;
  margin-top: -17px;
  width: 34px; height: 34px;
  color: rgba(246, 222, 160, .7);
  animation: battement 1.4s ease-in-out infinite;
}
.piste-ruban .poignee-ruban {
  position: absolute;
  left: 0; top: 50%;
  width: 52px; height: 52px;
  margin-top: -26px;
  border: 0;
  padding: 0;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #fff5cf, #e3bd6a 50%, #a7772c);
  box-shadow: 0 4px 12px rgba(0, 0, 0, .45), 0 0 0 4px rgba(246, 222, 160, .25);
  cursor: grab;
  touch-action: none;
  display: grid;
  place-items: center;
  color: #6a1222;
}
.piste-ruban .poignee-ruban:active { cursor: grabbing; }
.piste-ruban .poignee-ruban svg { width: 24px; height: 24px; }

/* ---------- Défi : givre ---------- */
.calque canvas.givre {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border-radius: 24px;
  touch-action: none;
  cursor: crosshair;
  transition: opacity .8s ease;
}
.calque canvas.givre.fondu { opacity: 0; }

/* ---------- Défi : cœur ---------- */
.calque.voile { background: radial-gradient(closest-side, rgba(25, 2, 9, .55), rgba(25, 2, 9, 0)); border-radius: 50%; }
.calque svg.trace-coeur { position: absolute; inset: 0; width: 100%; height: 100%; touch-action: none; cursor: pointer; overflow: visible; }
.trace-coeur .guide { fill: none; stroke: rgba(255, 240, 225, .55); stroke-width: 1.2; stroke-dasharray: 2 2.5; }
.trace-coeur .rempli { fill: #d81e3c; opacity: 0; transition: opacity .6s; filter: drop-shadow(0 0 4px rgba(255, 120, 140, .8)); }
.trace-coeur.fini .rempli { opacity: .95; }
.trace-coeur .point { fill: rgba(255, 240, 225, .35); transition: fill .2s, r .2s; }
.trace-coeur .point.vu { fill: #fff0bd; r: 2.4; filter: drop-shadow(0 0 2px #ffd36e); }
.trace-coeur .depart { fill: none; stroke: #fff0bd; stroke-width: .8; animation: depart 1.4s ease-out infinite; transform-box: fill-box; transform-origin: center; }
@keyframes depart { from { transform: scale(.6); opacity: 1; } to { transform: scale(2.2); opacity: 0; } }
.trace-coeur .trainee { fill: none; stroke: rgba(255, 215, 130, .8); stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- Défi : flocons ---------- */
.calque.ciel { overflow: hidden; border-radius: 20px; }
.flocon {
  position: absolute;
  top: -60px;
  width: 52px; height: 52px;
  margin-left: -26px;
  padding: 6px;
  border: 0;
  background: none;
  cursor: pointer;
  touch-action: manipulation;
  animation: chute var(--duree, 4s) linear forwards;
}
.flocon svg { width: 100%; height: 100%; filter: drop-shadow(0 0 6px rgba(255, 255, 255, .7)); animation: tourne var(--duree, 4s) linear; }
.flocon.attrape { animation: attrape .35s ease-out forwards; pointer-events: none; }
@keyframes chute {
  from { transform: translate(0, 0); }
  to { transform: translate(var(--derive, 0px), calc(min(84vw, 46dvh, 340px) + 80px)); }
}
@keyframes tourne { to { transform: rotate(240deg); } }
@keyframes attrape { to { opacity: 0; scale: 1.8; } }
.compte-flocons { font-family: var(--police-titre); font-size: 22px; color: var(--or-clair); }

/* ---------- Défi : guirlande ---------- */
.ampoules {
  position: relative;
  display: flex;
  justify-content: center;
  gap: clamp(10px, 4vw, 18px);
  padding-top: 18px;
}
.ampoules::before {
  content: "";
  position: absolute;
  left: -14px; right: -14px; top: 0;
  height: 34px;
  border-bottom: 2px solid #1d0207;
  border-radius: 0 0 50% 50% / 0 0 100% 100%;
  opacity: .8;
}
.ampoule-btn {
  position: relative;
  width: 44px; height: 60px;
  border: 0;
  padding: 0;
  background: none;
  cursor: pointer;
  transition: transform .15s;
}
.ampoule-btn:nth-child(odd) { margin-top: 10px; }
.ampoule-btn .culot {
  position: absolute;
  left: 50%; top: 0;
  width: 14px; height: 12px;
  transform: translateX(-50%);
  border-radius: 3px 3px 2px 2px;
  background: linear-gradient(90deg, #6d5a3a, #c7b07a, #6d5a3a);
}
.ampoule-btn .verre {
  position: absolute;
  left: 50%; top: 10px;
  width: 30px; height: 44px;
  transform: translateX(-50%);
  border-radius: 50% 50% 50% 50% / 40% 40% 60% 60%;
  background: radial-gradient(circle at 40% 35%, rgba(255, 255, 255, .5), transparent 40%), var(--c);
  opacity: .5;
  filter: saturate(.75);
  transition: opacity .15s, filter .15s, box-shadow .15s;
}
.ampoule-btn.allume .verre {
  opacity: 1;
  filter: saturate(1.2) brightness(1.15);
  box-shadow: 0 0 18px 6px var(--c), 0 0 40px 10px color-mix(in srgb, var(--c) 50%, transparent);
}
.ampoule-btn:active { transform: scale(.94); }
.ampoule-btn:disabled { cursor: default; }
.ampoules.erreur { animation: refus .5s ease; }

/* ---------- Défi : ensemble ---------- */
.duo {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 18px;
  margin-bottom: 26px;
}
.duo-btn {
  position: relative;
  width: 92px; height: 92px;
  border-radius: 50%;
  border: 1.5px solid rgba(226, 191, 115, .55);
  background: radial-gradient(circle at 50% 40%, rgba(120, 20, 45, .9), rgba(50, 6, 18, .9));
  cursor: pointer;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
  display: grid;
  place-items: center;
  padding: 0;
  transition: transform .2s, box-shadow .2s, border-color .2s;
}
.duo-btn svg { width: 46px; height: 46px; color: #e2475f; transition: transform .2s, color .2s; }
.duo-btn span {
  position: absolute;
  bottom: -24px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 12px;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--creme);
  opacity: .8;
  white-space: nowrap;
}
.duo-btn.appuye {
  transform: scale(.94);
  border-color: var(--or-clair);
  box-shadow: 0 0 0 6px rgba(226, 191, 115, .18), 0 0 30px rgba(255, 90, 120, .55);
}
.duo-btn.appuye svg { color: #ff6b81; animation: battement .6s ease-in-out infinite; }
.duo-lien { width: 34px; height: 34px; color: var(--or); opacity: .4; transition: opacity .3s, transform .3s; }
.duo.ensemble .duo-lien { opacity: 1; transform: scale(1.2); }
.astuce { font-size: 12.5px; color: var(--creme); opacity: .6; margin-top: 18px; }
.astuce kbd {
  font-family: var(--police-texte);
  font-size: 11px;
  padding: 1px 6px;
  border-radius: 4px;
  border: 1px solid rgba(247, 234, 216, .4);
}

/* ---------- Défi : cadenas ---------- */
.cadenas {
  position: absolute;
  left: 50%;
  top: 58%;
  width: 72%;
  transform: translate(-50%, -50%);
  filter: drop-shadow(0 10px 18px rgba(0, 0, 0, .5));
}
.cadenas .anse {
  width: 50%;
  height: 52px;
  margin: 0 auto -6px;
  border: 10px solid #c9a052;
  border-bottom: 0;
  border-radius: 60px 60px 0 0;
  background: none;
  box-shadow: inset 0 2px 0 rgba(255, 255, 255, .3);
  transition: transform .6s cubic-bezier(.3, 1.6, .5, 1);
  transform-origin: 100% 100%;
}
.cadenas.ouvert .anse { transform: translateY(-16px) rotate(-18deg); }
.cadenas .boitier {
  border-radius: 14px;
  padding: 12px 10px 10px;
  background: linear-gradient(160deg, #f3d996, #c79a45 55%, #9c7131);
  box-shadow: 0 0 0 2px rgba(74, 11, 25, .55), inset 0 2px 0 rgba(255, 255, 255, .5), inset 0 -4px 8px rgba(0, 0, 0, .25);
  display: flex;
  justify-content: center;
  gap: 6px;
}
.molette { display: flex; flex-direction: column; align-items: center; gap: 2px; }
.molette button {
  width: 100%;
  min-width: 36px;
  height: 26px;
  border: 0;
  background: none;
  color: #5a3a10;
  cursor: pointer;
  display: grid;
  place-items: center;
  padding: 0;
}
.molette button svg { width: 16px; height: 16px; }
.molette .chiffre {
  width: 38px;
  height: 46px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  background: linear-gradient(180deg, #3a0712, #6a1226 50%, #3a0712);
  color: var(--creme);
  font-family: var(--police-titre);
  font-size: 26px;
  font-weight: 600;
  box-shadow: inset 0 3px 6px rgba(0, 0, 0, .6);
  touch-action: none;
  cursor: ns-resize;
}
.molette .chiffre.tourne { animation: tourne-chiffre .18s ease; }
@keyframes tourne-chiffre { 0% { transform: translateY(-6px); opacity: .4; } 100% { transform: none; opacity: 1; } }
.cadenas.erreur .boitier { animation: refus .45s ease; }
.indice {
  font-family: var(--police-lettre);
  font-style: italic;
  font-size: 18px;
  color: var(--or-clair);
  max-width: 30ch;
}

/* ---------- Défi : puzzle ---------- */
.puzzle {
  position: absolute;
  left: 50%; top: 50%;
  width: 82%;
  aspect-ratio: 1;
  transform: translate(-50%, -50%);
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 4px;
  transition: gap .5s ease, filter .5s, opacity .6s;
  filter: drop-shadow(0 10px 20px rgba(0, 0, 0, .45));
}
.puzzle.resolu { gap: 0; filter: drop-shadow(0 0 22px rgba(255, 215, 140, .8)); }
.puzzle.disparait { opacity: 0; }
.tuile {
  border: 0;
  padding: 0;
  border-radius: 6px;
  background-size: 300% 300%;
  cursor: pointer;
  transition: transform .35s cubic-bezier(.3, 1.4, .5, 1), border-radius .5s;
}
.puzzle.resolu .tuile { border-radius: 0; }

/* ---------- Outils communs des défis ---------- */
.scene { container-type: inline-size; }
.emo { font-family: "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", sans-serif; line-height: 1; }
.refus-anim { animation: refus-t .45s ease; }
@keyframes refus-t {
  20% { translate: -6px 0; }
  40% { translate: 6px 0; }
  60% { translate: -3px 0; }
  80% { translate: 3px 0; }
}
.bouton-jeu {
  padding: 15px 28px;
  border: 0;
  border-radius: 999px;
  background: linear-gradient(160deg, #f6dea0, #d3a752 55%, #a97b31);
  color: #4a0b19;
  font: 600 16px var(--police-texte);
  letter-spacing: .02em;
  box-shadow: 0 5px 0 #7a561f, 0 8px 16px rgba(0, 0, 0, .35);
  cursor: pointer;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
  transition: transform .1s, box-shadow .1s;
}
.bouton-jeu:active { transform: translateY(4px); box-shadow: 0 1px 0 #7a561f, 0 3px 8px rgba(0, 0, 0, .35); }
.bouton-jeu.discret {
  padding: 10px 18px;
  background: rgba(30, 3, 10, .35);
  border: 1px solid rgba(226, 191, 115, .5);
  color: var(--creme);
  font-weight: 400;
  font-size: 14px;
  box-shadow: none;
}
.bouton-jeu.discret:active { transform: scale(.97); }
.texte-pop {
  position: absolute;
  left: 0; right: 0; top: 34%;
  margin: 0;
  text-align: center;
  font: italic 600 clamp(22px, 8cqi, 30px) var(--police-titre);
  color: var(--or-clair);
  text-shadow: 0 2px 10px rgba(0, 0, 0, .6);
  opacity: 0;
  pointer-events: none;
  z-index: 5;
}
.texte-pop.haut { top: 4%; }
.texte-pop.pop { animation: pop-texte .9s ease forwards; }
@keyframes pop-texte {
  0% { opacity: 0; scale: .6; }
  20% { opacity: 1; scale: 1.08; }
  70% { opacity: 1; scale: 1; }
  100% { opacity: 0; translate: 0 -10px; }
}

/* ---------- Défi : colis ---------- */
.colis { position: absolute; inset: 0; }
.carton { position: absolute; left: 22%; bottom: 6%; width: 56%; height: 40%; }
.carton.hop { animation: hop .35s ease; }
@keyframes hop { 50% { scale: 1.05 .95; } }
.carton-fond {
  position: absolute;
  left: 3%; right: 3%; top: 0; bottom: 30%;
  border-radius: 4px;
  background: linear-gradient(#2c040d, #4a0b19);
}
.carton-face {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 78%;
  border-radius: 6px;
  overflow: hidden;
  z-index: 3;
  background: linear-gradient(160deg, #8c1630, #5a0a1c);
  box-shadow: inset 0 2px 0 rgba(255, 255, 255, .2), inset 0 -10px 18px rgba(0, 0, 0, .25), 0 12px 20px rgba(0, 0, 0, .4);
}
.carton-face span { position: absolute; left: 42%; top: 0; bottom: 0; width: 16%; background: var(--ruban-v); }
.rabat {
  position: absolute;
  bottom: 76%;
  width: 50%; height: 22%;
  border-radius: 4px;
  background: linear-gradient(#a01c3a, #6d0f24);
  box-shadow: inset 0 2px 0 rgba(255, 255, 255, .15);
  transition: transform .45s cubic-bezier(.3, 1.4, .5, 1), opacity .3s;
}
.rabat.g { left: 0; transform-origin: 0 100%; transform: rotate(-32deg); }
.rabat.d { right: 0; transform-origin: 100% 100%; transform: rotate(32deg); }
.carton.ferme .rabat { transform: rotate(0) scaleY(.1); opacity: 0; }
.carton::after {
  content: "";
  position: absolute;
  left: -5%; right: -5%; bottom: 72%;
  height: 22%;
  z-index: 4;
  border-radius: 6px;
  background: linear-gradient(90deg, transparent 42%, #e9c977 42%, #fbe8b0 50%, #d9b05a 58%, transparent 58%), linear-gradient(170deg, #9a1a36, #5a0a1c);
  box-shadow: 0 6px 10px rgba(0, 0, 0, .35), inset 0 2px 0 rgba(255, 255, 255, .25);
  opacity: 0;
  transform: translateY(-180%);
  transition: transform .55s cubic-bezier(.3, 1.3, .5, 1), opacity .25s;
}
.carton.ferme::after { opacity: 1; transform: none; }
.objet {
  position: absolute;
  width: 17%;
  aspect-ratio: 1;
  margin: -8.5% 0 0 -8.5%;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 236, 200, .2), transparent 70%);
  font-size: 11cqi;
  display: grid;
  place-items: center;
  cursor: grab;
  touch-action: none;
  z-index: 5;
  rotate: var(--r, 0deg);
  transition: translate .4s cubic-bezier(.3, 1.4, .5, 1), left .35s, top .35s, opacity .45s .15s, scale .45s .1s;
}
.objet .emo { display: block; animation: flotte 2.6s ease-in-out infinite; filter: drop-shadow(0 4px 4px rgba(0, 0, 0, .35)); }
.objet:nth-of-type(2n) .emo { animation-delay: -1.3s; }
.objet.tenu { transition: none; scale: 1.2; cursor: grabbing; z-index: 6; }
.objet.range { opacity: 0; scale: .35; pointer-events: none; }
@keyframes flotte { 50% { transform: translateY(-5px); } }

/* ---------- Défi : boule de neige ---------- */
.boule-jeu { --p: 0; position: absolute; inset: 0; touch-action: none; cursor: grab; }
.boule-jeu.actif { cursor: grabbing; }
.sol-neige {
  position: absolute;
  left: -3%; right: -3%; bottom: 0;
  height: 20%;
  border-radius: 50% 50% 18px 18px / 40% 40% 18px 18px;
  background: radial-gradient(120% 100% at 50% 0%, #ffffff, #dfe9f5);
  box-shadow: inset 0 6px 12px rgba(255, 255, 255, .7);
}
.boule {
  position: absolute;
  left: 22%; bottom: 10%;
  width: 56%;
  aspect-ratio: 1;
  border-radius: 50%;
  overflow: hidden;
  transform-origin: 50% 100%;
  scale: calc(.3 + var(--p) * .7);
  background: radial-gradient(circle at 35% 30%, #ffffff, #e9f0f9 55%, #b7c8de);
  box-shadow: inset -10px -12px 20px rgba(80, 100, 140, .35), 0 8px 14px rgba(0, 0, 0, .25);
  transition: scale .15s;
}
.boule-motif {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 30% 30%, rgba(160, 182, 210, .7) 0 4%, transparent 5%),
    radial-gradient(circle at 70% 58%, rgba(160, 182, 210, .6) 0 3%, transparent 4%),
    radial-gradient(circle at 45% 78%, rgba(160, 182, 210, .6) 0 5%, transparent 6%),
    radial-gradient(circle at 76% 24%, rgba(160, 182, 210, .5) 0 3%, transparent 4%),
    radial-gradient(circle at 18% 60%, rgba(160, 182, 210, .5) 0 3%, transparent 4%);
}
.bonhomme-tete {
  position: absolute;
  left: 33%; bottom: 62%;
  width: 34%;
  aspect-ratio: 1;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #ffffff, #e9f0f9 55%, #b7c8de);
  box-shadow: inset -6px -8px 14px rgba(80, 100, 140, .35);
  opacity: 0;
  translate: 0 -160%;
  transition: translate .7s cubic-bezier(.3, 1.5, .5, 1), opacity .3s;
  z-index: 2;
}
.bonhomme-tete i { position: absolute; top: 38%; width: 9%; aspect-ratio: 1; border-radius: 50%; background: #2a1a14; }
.bonhomme-tete i:first-child { left: 32%; }
.bonhomme-tete i:nth-child(2) { right: 32%; }
.bonhomme-tete b {
  position: absolute;
  left: 46%; top: 52%;
  width: 0; height: 0;
  border-top: 5px solid transparent;
  border-bottom: 5px solid transparent;
  border-left: 18px solid #f08a2c;
}
.boule-jeu.fini .bonhomme-tete { opacity: 1; translate: 0 0; }
.boule-guide {
  position: absolute;
  left: 9%; top: 15%;
  width: 82%;
  fill: none;
  stroke: rgba(246, 222, 160, .5);
  stroke-width: 1.2;
  stroke-linecap: round;
  stroke-dasharray: 3 5;
  pointer-events: none;
  animation: tourne-lent 7s linear infinite;
  transition: opacity .4s;
}
.boule-guide path { stroke-dasharray: none; stroke-width: 1.6; }
.boule-jeu.fini .boule-guide { opacity: 0; }
@keyframes tourne-lent { to { transform: rotate(360deg); } }

/* ---------- Défi : labyrinthe ---------- */
.labyrinthe { position: absolute; inset: 2%; width: 96%; height: 96%; touch-action: none; cursor: pointer; }
.labyrinthe .sol { fill: rgba(30, 3, 10, .6); }
.labyrinthe .murs { fill: none; stroke: var(--or); stroke-width: .12; stroke-linecap: round; stroke-linejoin: round; }
.labyrinthe .chemin { fill: none; stroke: rgba(255, 111, 134, .55); stroke-width: .2; stroke-linecap: round; stroke-linejoin: round; }
.labyrinthe .arrivee { font-size: .72px; text-anchor: middle; dominant-baseline: middle; font-family: "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", sans-serif; }
.labyrinthe .jeton { fill: #ff6f86; transition: transform .09s linear; }
.labyrinthe.fini .bat { animation: battement .5s ease-in-out 3; }

/* ---------- Défi : constellation ---------- */
.calque.nuit { background: radial-gradient(circle at 50% 40%, #2b0a2c, #12030c 78%); border-radius: 20px; overflow: hidden; }
.constellation { position: absolute; inset: 0; width: 100%; height: 100%; touch-action: none; cursor: crosshair; }
.constellation .ciel-fond circle { fill: #fff; opacity: .55; animation: scintillement 3s ease-in-out infinite; }
@keyframes scintillement { 50% { opacity: .1; } }
.constellation .forme { fill: rgba(255, 111, 134, 0); transition: fill 1s; }
.constellation.fini .forme { fill: rgba(255, 111, 134, .3); }
.constellation .liens line, .constellation .elastique { stroke: #f6dea0; stroke-width: .7; stroke-linecap: round; }
.constellation .elastique { stroke-dasharray: 1.4 1.6; opacity: .7; }
.constellation .elastique.fixe { stroke-dasharray: none; opacity: 1; }
.etoile path { fill: rgba(255, 248, 220, .6); transition: fill .2s; }
.etoile .halo { fill: rgba(246, 222, 160, 0); transition: fill .3s; }
.etoile.allumee path { fill: #fff3c4; }
.etoile.allumee .halo { fill: rgba(246, 222, 160, .28); }
.etoile text { font: 600 4px var(--police-texte); fill: rgba(247, 234, 216, .7); text-anchor: middle; }
.etoile.allumee text { fill: var(--or-clair); }
.constellation:not(.fini) .etoile:first-child .halo { fill: rgba(246, 222, 160, .22); animation: battement 1.4s ease-in-out infinite; transform-box: fill-box; transform-origin: center; }
.constellation.fini .etoile path { animation: battement .8s ease-in-out 2; transform-box: fill-box; transform-origin: center; }

/* ---------- Défi : chocolat chaud ---------- */
.chocolat { --cx: 26%; position: absolute; inset: 0; }
.chocolat.tasse-2 { --cx: 70%; }
.tasse { position: absolute; bottom: 12%; width: 30%; height: 38%; margin-left: -15%; transition: opacity .3s; }
.tasse:nth-child(1) { left: 26%; }
.tasse:nth-child(2) { left: 70%; }
.tasse:not(.active):not(.pleine) { opacity: .45; }
.tasse-corps {
  position: absolute;
  inset: 0;
  overflow: hidden;
  border: 2.5px solid rgba(255, 245, 230, .75);
  border-top-width: 1px;
  border-radius: 4px 4px 26% 26% / 4px 4px 18% 18%;
  background: linear-gradient(90deg, rgba(255, 255, 255, .06), rgba(255, 255, 255, .2) 35%, rgba(255, 255, 255, .05));
  box-shadow: 0 10px 16px rgba(0, 0, 0, .35);
}
.liquide {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 0;
  background: linear-gradient(#8a4d2a, #4e2814);
  box-shadow: inset 0 3px 0 rgba(255, 210, 170, .35);
}
.cible {
  position: absolute;
  left: 0; right: 0;
  border-top: 2px dashed var(--or-clair);
  border-bottom: 2px dashed var(--or-clair);
  background: rgba(246, 222, 160, .14);
  transition: background .15s, box-shadow .15s;
}
.tasse.dans-zone .cible { background: rgba(246, 222, 160, .4); box-shadow: 0 0 14px rgba(246, 222, 160, .7); }
.tasse.pleine .cible { opacity: 0; }
.tasse.deborde .tasse-corps { box-shadow: 0 0 0 3px #6b3a1f, 0 10px 16px rgba(0, 0, 0, .35); }
.tasse-anse {
  position: absolute;
  left: 96%; top: 18%;
  width: 26%; height: 44%;
  border: 3px solid rgba(255, 245, 230, .75);
  border-left: 0;
  border-radius: 0 50% 50% 0;
}
.tasse .etiq {
  position: absolute;
  left: 0; right: 0; bottom: -26%;
  text-align: center;
  font-size: 11px;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--creme);
  opacity: .8;
}
.vapeur { position: absolute; left: 20%; right: 20%; bottom: 100%; height: 50%; display: flex; justify-content: space-around; opacity: 0; transition: opacity .5s; }
.vapeur i { width: 4px; height: 100%; border-radius: 4px; background: linear-gradient(transparent, rgba(255, 255, 255, .55)); animation: vapeur 1.8s ease-in-out infinite; }
.vapeur i:nth-child(2) { animation-delay: -.6s; }
.vapeur i:nth-child(3) { animation-delay: -1.2s; }
.tasse.pleine .vapeur { opacity: 1; }
@keyframes vapeur { 0% { transform: translateY(20%) scaleY(.6); opacity: 0; } 50% { opacity: 1; } 100% { transform: translateY(-30%) skewX(-12deg); opacity: 0; } }
.casserole {
  position: absolute;
  top: 6%;
  left: calc(var(--cx) - 26%);
  width: 28%; height: 13%;
  border-radius: 4px 4px 40% 40% / 4px 4px 60% 60%;
  background: linear-gradient(#e2bf73, #a97b31);
  box-shadow: inset 0 -4px 6px rgba(0, 0, 0, .25), 0 6px 10px rgba(0, 0, 0, .3);
  transform-origin: 90% 40%;
  transition: left .6s cubic-bezier(.3, 1.2, .5, 1), rotate .25s;
}
.casserole::before { content: ""; position: absolute; right: 100%; top: 28%; width: 60%; height: 16%; border-radius: 4px 0 0 4px; background: #7a1530; }
.chocolat.verse .casserole { rotate: 24deg; }
.filet {
  position: absolute;
  top: 17%;
  left: var(--cx);
  width: 7px;
  margin-left: -3.5px;
  height: 0;
  border-radius: 4px;
  background: linear-gradient(#8a4d2a, #5a2e16);
  transition: height .12s, left .6s;
}
.chocolat.verse .filet { height: 36%; }

/* ---------- Défi : gui ---------- */
.gui-jeu { position: absolute; inset: 0; }
.gui-bras { position: absolute; left: 50%; top: -2%; width: 30%; height: 68%; margin-left: -15%; transform-origin: 50% 0; }
.gui-bras::before { content: ""; position: absolute; left: 50%; top: 0; width: 1.6px; height: 66%; margin-left: -.8px; background: var(--or); }
.gui-brin { position: absolute; left: 0; bottom: 0; width: 100%; filter: drop-shadow(0 4px 6px rgba(0, 0, 0, .4)); }
.gui-cible {
  position: absolute;
  left: 50%; top: 70%;
  width: 18%;
  margin-left: -9%;
  color: rgba(255, 111, 134, .45);
  transition: color .1s, scale .1s, filter .1s;
}
.gui-cible svg { display: block; width: 100%; }
.gui-cible.pret { color: #ff6f86; scale: 1.12; filter: drop-shadow(0 0 10px rgba(255, 111, 134, .9)); }
.gui-bisous { position: absolute; left: 0; right: 0; bottom: 2%; display: flex; justify-content: center; gap: 10px; }
.gui-bisous span::before { content: "♥"; font-size: 22px; color: rgba(247, 234, 216, .25); transition: color .3s; }
.gui-bisous span.fait::before { color: #ff6f86; }

/* ---------- Défi : mémoire ---------- */
.memoire {
  position: absolute;
  left: 3%; top: 50%;
  width: 94%;
  translate: 0 -50%;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 2.4cqi;
}
.carte { position: relative; aspect-ratio: .86; padding: 0; border: 0; background: none; cursor: pointer; perspective: 600px; }
.carte .dos, .carte .face {
  position: absolute;
  inset: 0;
  border-radius: 10px;
  display: grid;
  place-items: center;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  transition: transform .45s cubic-bezier(.3, 1.3, .5, 1);
}
.carte .dos {
  background: radial-gradient(circle at 50% 40%, #8c1630, #4a0b19);
  border: 1.5px solid rgba(226, 191, 115, .6);
  box-shadow: inset 0 0 0 4px rgba(74, 11, 25, .9), inset 0 0 0 5px rgba(226, 191, 115, .35), 0 4px 8px rgba(0, 0, 0, .35);
  color: var(--or);
}
.carte .dos svg { width: 36%; opacity: .85; }
.carte .face {
  background: linear-gradient(160deg, #fffaf0, #f1dfc4);
  box-shadow: 0 4px 8px rgba(0, 0, 0, .35);
  font-size: 10cqi;
  transform: rotateY(180deg);
}
.carte.visible .dos { transform: rotateY(-180deg); }
.carte.visible .face { transform: rotateY(0); }
.carte.trouvee .face { box-shadow: 0 0 0 2px var(--or-clair), 0 0 16px rgba(246, 222, 160, .7); }
.carte.trouvee { animation: hop .4s ease; }

/* ---------- Défi : taquin ---------- */
.taquin {
  position: absolute;
  left: 7%; top: 7%;
  width: 86%;
  aspect-ratio: 1;
  border-radius: 10px;
  background: rgba(30, 3, 10, .6);
  box-shadow: 0 0 0 3px rgba(226, 191, 115, .55), 0 12px 24px rgba(0, 0, 0, .45);
  transition: box-shadow .5s;
}
.taquin .piece {
  position: absolute;
  left: 0; top: 0;
  width: 33.334%; height: 33.334%;
  padding: 0;
  border: 0;
  border-radius: 6px;
  background-color: #4a0b19;
  box-shadow: inset 0 0 0 1.5px rgba(74, 11, 25, .8), inset 0 0 0 2.5px rgba(246, 222, 160, .3);
  cursor: pointer;
  transition: transform .18s ease, border-radius .5s, box-shadow .5s;
}
.taquin .piece.derniere { opacity: 0; pointer-events: none; transition: opacity .6s; }
.taquin.resolu { box-shadow: 0 0 0 3px var(--or-clair), 0 0 30px rgba(255, 215, 140, .7); }
.taquin.resolu .piece { border-radius: 0; box-shadow: none; }
.taquin.resolu .piece.derniere { opacity: 1; }
.taquin-modele { position: absolute; inset: 0; z-index: 5; border-radius: 10px; opacity: 0; pointer-events: none; transition: opacity .2s; }
.taquin.montre-modele .taquin-modele { opacity: 1; }

/* ---------- Défi : couronne de l'Avent ---------- */
.couronne { position: absolute; inset: 0; }
.couronne-sapin {
  position: absolute;
  left: 2%; right: 2%; bottom: 8%;
  height: 26%;
  border-radius: 50%;
  background:
    radial-gradient(circle at 18% 42%, #e2475f 0 2.6%, transparent 3%),
    radial-gradient(circle at 34% 78%, #e2475f 0 2.6%, transparent 3%),
    radial-gradient(circle at 62% 84%, #e2475f 0 2.6%, transparent 3%),
    radial-gradient(circle at 84% 48%, #e2475f 0 2.6%, transparent 3%),
    radial-gradient(circle at 50% 14%, #f6dea0 0 2%, transparent 2.4%),
    radial-gradient(circle at 8% 60%, #f6dea0 0 2%, transparent 2.4%),
    radial-gradient(ellipse at 50% 50%, transparent 34%, #2f7a45 37%, #1d5c3c 55%, #14432b 68%, transparent 71%);
  filter: drop-shadow(0 8px 10px rgba(0, 0, 0, .4));
}
.bougie {
  --vie: 1;
  --c: 0;
  position: absolute;
  bottom: 21%;
  width: 14%;
  height: var(--h);
  margin-left: -7%;
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
  touch-action: none;
  -webkit-touch-callout: none;
  user-select: none;
  -webkit-user-select: none;
}
.bougie .cire {
  position: absolute;
  left: 0; right: 0; bottom: 0; top: 20%;
  border-radius: 4px 4px 3px 3px;
  background: linear-gradient(90deg, #e9d7ba, #fffaf0 40%, #dcc7a4);
  box-shadow: inset 0 -6px 10px rgba(120, 80, 40, .15), 0 4px 8px rgba(0, 0, 0, .3);
  display: grid;
  place-items: center;
}
.bougie .cire::before { content: ""; position: absolute; left: 50%; bottom: 100%; width: 2px; height: 7%; margin-left: -1px; background: #2b1a10; }
.bougie .cire b { font: 600 clamp(14px, 5cqi, 19px) var(--police-titre); color: #8c1630; }
.bougie .flamme {
  position: absolute;
  left: 50%; top: 0;
  width: 46%; height: 20%;
  margin-left: -23%;
  border-radius: 50% 50% 50% 50% / 62% 62% 38% 38%;
  background: radial-gradient(circle at 50% 72%, #fffbe6, #ffd36e 38%, #ff8a3d 66%, rgba(255, 138, 61, 0) 70%);
  filter: drop-shadow(0 0 8px #ffb347);
  opacity: 0;
  transform-origin: 50% 100%;
  scale: calc(.35 + var(--vie) * .65);
  transition: opacity .2s;
  animation: flamme .22s ease-in-out infinite alternate;
}
.bougie.allumee .flamme { opacity: 1; }
@keyframes flamme { from { rotate: -3deg; } to { rotate: 3deg; } }
.bougie .charge {
  position: absolute;
  left: 50%; top: 2%;
  width: 86%;
  aspect-ratio: 1;
  margin-left: -43%;
  border-radius: 50%;
  background: conic-gradient(var(--or-clair) calc(var(--c) * 360deg), rgba(246, 222, 160, .15) 0);
  -webkit-mask: radial-gradient(closest-side, transparent 68%, #000 72%);
          mask: radial-gradient(closest-side, transparent 68%, #000 72%);
  opacity: 0;
  pointer-events: none;
}
.bougie.tenue .charge { opacity: 1; }
.couronne.fini .bougie .flamme { scale: 1.15; filter: drop-shadow(0 0 16px #ffc46b); }

/* ---------- Défi : pluie de surprises ---------- */
.pluie { position: absolute; inset: 0; overflow: hidden; border-radius: 20px; touch-action: none; }
.panier { position: absolute; left: 0; bottom: 2%; font-size: 15cqi; filter: drop-shadow(0 4px 6px rgba(0, 0, 0, .45)); pointer-events: none; }
.tombe { position: absolute; left: 0; top: 0; font-size: 9cqi; pointer-events: none; will-change: transform; filter: drop-shadow(0 2px 4px rgba(0, 0, 0, .35)); }

/* ---------- Défi : bonneteau ---------- */
.bonneteau { position: absolute; inset: 0; }
.bonneteau::before {
  content: "";
  position: absolute;
  left: 2%; right: 2%; bottom: 14%;
  height: 14%;
  border-radius: 50%;
  background: radial-gradient(closest-side, rgba(0, 0, 0, .45), transparent);
}
.gobelet {
  position: absolute;
  bottom: 20%;
  width: 26%; height: 30%;
  margin-left: -13%;
  padding: 0;
  border: 0;
  background: none;
  cursor: default;
  z-index: 2;
}
.bonneteau.choix .gobelet { cursor: pointer; }
.bonneteau.choix .gobelet .g-corps { box-shadow: 0 0 0 2px rgba(246, 222, 160, .5), 0 8px 14px rgba(0, 0, 0, .35); }
.gobelet.leve { transform: translateY(-58%); }
.gobelet .g-corps, .gobelet .g-couvercle {
  position: absolute;
  border-radius: 5px;
  background: var(--ruban-v) 50% 0 / 18% 100% no-repeat, linear-gradient(160deg, var(--face-1), var(--face-2));
}
.gobelet .g-corps { left: 0; right: 0; bottom: 0; height: 76%; box-shadow: inset 0 -8px 14px rgba(0, 0, 0, .22), 0 8px 14px rgba(0, 0, 0, .35); transition: box-shadow .3s; }
.gobelet .g-couvercle { left: -6%; right: -6%; top: 0; height: 28%; box-shadow: 0 4px 6px rgba(0, 0, 0, .3), inset 0 2px 0 rgba(255, 255, 255, .3); }
.gobelet .g-couvercle::before {
  content: "";
  position: absolute;
  left: 25%; bottom: 80%;
  width: 50%; height: 90%;
  background: radial-gradient(ellipse at 28% 62%, #e9c977 0 36%, transparent 40%), radial-gradient(ellipse at 72% 62%, #e9c977 0 36%, transparent 40%), radial-gradient(circle at 50% 80%, #fbe8b0 0 14%, transparent 17%);
}
.bille {
  position: absolute;
  bottom: 22%;
  width: 14%;
  margin-left: -7%;
  color: #ff4d6d;
  opacity: 0;
  z-index: 1;
  filter: drop-shadow(0 0 8px rgba(255, 90, 120, .8));
  transition: opacity .3s;
}
.bille svg { display: block; width: 100%; }
.manches { display: flex; gap: 12px; }
.manches span { width: 14px; height: 14px; border-radius: 50%; border: 1.5px solid var(--or); transition: background .3s, box-shadow .3s; }
.manches span.fait { background: var(--or); box-shadow: 0 0 8px rgba(246, 222, 160, .8); }

/* ---------- Défi : mot secret ---------- */
.mot-tableau {
  position: absolute;
  left: 3%; top: 50%;
  width: 94%;
  translate: 0 -50%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4cqi;
  padding: 9cqi 4cqi;
  border-radius: 14px;
  background: linear-gradient(170deg, #fdf6ea, #f3e3c9);
  box-shadow: 0 14px 30px rgba(0, 0, 0, .45), inset 0 0 0 5px #fdf6ea, inset 0 0 0 6px rgba(169, 123, 49, .4);
  transition: box-shadow .5s;
}
.mot-ligne { display: flex; flex-wrap: wrap; justify-content: center; gap: 1.8cqi; }
.mot-case {
  width: 10cqi; height: 12cqi;
  display: grid;
  place-items: center;
  border-bottom: 2.5px solid #c09245;
  font: 600 8.5cqi/1 var(--police-titre);
  color: #6d0f24;
}
.mot-case.remplie { border-color: #6d0f24; animation: hop .3s ease; }
.mot-signe { align-self: flex-start; padding-top: 1.5cqi; font: 600 8.5cqi/1 var(--police-titre); color: #6d0f24; }
.mot-tableau.fini { box-shadow: 0 0 34px rgba(255, 215, 140, .75), inset 0 0 0 5px #fdf6ea, inset 0 0 0 6px rgba(169, 123, 49, .4); }
.mot-tableau.fini .mot-case { color: #c0283f; }
.mot-lettres { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; max-width: 330px; }
.lettre-btn {
  width: 46px; height: 50px;
  padding: 0;
  border: 0;
  border-radius: 10px;
  background: linear-gradient(160deg, #f6dea0, #d3a752 55%, #a97b31);
  color: #4a0b19;
  font: 600 22px var(--police-titre);
  box-shadow: 0 4px 0 #7a561f, 0 6px 10px rgba(0, 0, 0, .35);
  cursor: pointer;
  transition: transform .1s, box-shadow .1s, opacity .3s;
}
.lettre-btn:active { transform: translateY(3px); box-shadow: 0 1px 0 #7a561f; }
.lettre-btn.utilisee { opacity: .15; transform: scale(.85); pointer-events: none; }

/* ---------- Défi : quiz ---------- */
.quiz-carte {
  position: absolute;
  left: 4%; top: 50%;
  width: 92%;
  translate: 0 -50%;
  padding: 7cqi 6cqi 6cqi;
  border-radius: 10px;
  text-align: center;
  color: var(--encre);
  background:
    repeating-linear-gradient(180deg, transparent 0 27px, rgba(169, 123, 49, .16) 27px 28px),
    linear-gradient(170deg, #fdf6ea, #f3e3c9);
  box-shadow: 0 14px 30px rgba(0, 0, 0, .45), inset 4px 0 0 rgba(192, 40, 63, .35);
}
.quiz-carte.change { animation: change-q .4s ease; }
@keyframes change-q { from { opacity: 0; scale: .95; } }
.quiz-num { margin: 0; font-size: 11px; letter-spacing: .25em; text-transform: uppercase; color: #a5732c; }
.quiz-q { margin: 3cqi 0 5cqi; font: italic 500 clamp(18px, 6.6cqi, 25px)/1.25 var(--police-titre); color: #6d0f24; text-wrap: balance; }
.quiz-liste { display: flex; justify-content: center; gap: 10px; margin: 0; padding: 0; list-style: none; }
.quiz-liste li { position: relative; width: 22px; height: 22px; border-radius: 5px; border: 1.5px solid #a5732c; }
.quiz-liste li.fait::after { content: "✓"; position: absolute; inset: -4px 0 0 2px; display: grid; place-items: center; color: #c0283f; font-size: 22px; font-weight: 700; animation: battement .4s ease; }
.quiz-choix { display: flex; flex-direction: column; gap: 9px; width: min(320px, 92%); }
.quiz-btn {
  padding: 13px 16px;
  border: 1px solid rgba(226, 191, 115, .55);
  border-radius: 12px;
  background: rgba(30, 3, 10, .45);
  color: var(--creme);
  font: 500 16px var(--police-texte);
  cursor: pointer;
  transition: background .2s, color .2s, opacity .2s;
}
.quiz-btn:hover { background: rgba(110, 20, 41, .6); }
.quiz-btn.juste { background: linear-gradient(160deg, #f6dea0, #d3a752); color: #4a0b19; border-color: transparent; }
.quiz-btn.faux { opacity: .4; text-decoration: line-through; }

/* ---------- Défi : rythme ---------- */
.rythme { position: absolute; inset: 0; pointer-events: none; }
.rythme::before, .anneau {
  content: "";
  position: absolute;
  left: 50%; top: 64%;
  width: 56%;
  aspect-ratio: 1;
  border-radius: 50%;
  transform: translate(-50%, -50%);
}
.rythme::before { border: 2px dashed rgba(246, 222, 160, .35); }
.anneau {
  border: 3px solid var(--or-clair);
  box-shadow: 0 0 14px rgba(246, 222, 160, .7), inset 0 0 12px rgba(246, 222, 160, .4);
  opacity: 0;
}
.anneau.touche { border-color: #fff; box-shadow: 0 0 30px #ffd36e; transition: opacity .3s, scale .3s; opacity: 0 !important; scale: 1.25; }
.anneau.rate { border-color: #e2475f; transition: opacity .3s; opacity: 0 !important; }

/* ---------- Défi : grand déballage ---------- */
.deballe { position: absolute; inset: 0; touch-action: none; cursor: grab; }
.couche { position: absolute; inset: 0; }
.bande-papier {
  --tire: 0;
  position: absolute;
  top: 0; bottom: 0;
  width: calc(20% + 1px);
  background-size: 500% 100%;
  box-shadow: inset -1px 0 0 rgba(0, 0, 0, .18), inset 1px 0 0 rgba(255, 255, 255, .15);
  transform-origin: 50% 0;
  translate: 0 calc(var(--tire) * 16px);
  rotate: calc(var(--tire) * 1.5deg);
  transition: translate .15s, rotate .15s;
}
.couche .bande-papier:first-child { border-radius: 18px 0 0 18px; }
.couche .bande-papier:last-child { border-radius: 0 18px 18px 0; }
.papier-or .bande-papier {
  background-color: #d6aa55;
  background-image: radial-gradient(circle, #fff3cc 0 1.6px, transparent 2.2px), linear-gradient(160deg, #f4dc9c, #c9973f);
  background-size: 16px 16px, 500% 100%;
}
.papier-rose .bande-papier {
  background-color: #f2b4ae;
  background-image: repeating-linear-gradient(45deg, #f7c3b9 0 12px, #fde6df 12px 24px);
  background-size: auto;
}
.papier-rouge .bande-papier {
  background-color: #6d0f24;
  background-image:
    repeating-linear-gradient(90deg, transparent 0 22px, rgba(226, 191, 115, .55) 22px 24px),
    repeating-linear-gradient(0deg, transparent 0 22px, rgba(226, 191, 115, .55) 22px 24px),
    linear-gradient(160deg, #8c1630, #5a0a1c);
  background-size: auto, auto, 500% 100%;
}

/* ---------- Éclats (confettis) ---------- */
.eclat { position: absolute; left: 50%; top: 50%; pointer-events: none; }

/* =====================================================================
   Lettre (contenu de la case)
   ===================================================================== */
.vue-contenu { animation: monte .6s cubic-bezier(.2, .9, .3, 1.1); }
.lettre {
  position: relative;
  margin: 34px auto 0;
  max-width: 480px;
  padding: 42px 24px 30px;
  border-radius: 6px;
  color: var(--encre);
  background:
    radial-gradient(120% 80% at 20% 0%, rgba(255, 255, 255, .7), transparent 60%),
    linear-gradient(170deg, #fdf6ea, #f3e3c9);
  box-shadow: 0 20px 50px rgba(0, 0, 0, .45), inset 0 0 0 1px rgba(169, 123, 49, .25), inset 0 0 0 7px #fdf6ea, inset 0 0 0 8px rgba(169, 123, 49, .35);
  text-align: center;
}
.sceau {
  position: absolute;
  left: 50%; top: 0;
  width: 58px; height: 58px;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #d53a52, #9b1129 60%, #6d0a1c);
  box-shadow: 0 4px 10px rgba(0, 0, 0, .4), inset 0 -3px 6px rgba(0, 0, 0, .3), inset 0 2px 3px rgba(255, 255, 255, .25);
  display: grid;
  place-items: center;
  color: #f8c9cf;
}
.sceau svg { width: 26px; height: 26px; }
.lettre .l-jour {
  margin: 0;
  font-size: 11px;
  letter-spacing: .3em;
  text-transform: uppercase;
  color: #a5732c;
}
.lettre .l-titre {
  margin: 8px 0 0;
  font-family: var(--police-titre);
  font-style: italic;
  font-weight: 500;
  font-size: clamp(26px, 7vw, 34px);
  line-height: 1.12;
  color: #6d0f24;
  text-wrap: balance;
}
.lettre .l-separateur { width: 90px; margin: 14px auto; color: #c09245; display: block; }
.lettre .l-message {
  font-family: var(--police-lettre);
  font-size: 21px;
  line-height: 1.45;
  color: #4a0b19;
  text-align: left;
}
.lettre .l-message p { margin: 0 0 .7em; }
.lettre .l-message.centre { text-align: center; font-style: italic; }
.galerie {
  display: flex;
  gap: 10px;
  margin: 6px -8px 14px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
}
.galerie::-webkit-scrollbar { display: none; }
.galerie figure {
  flex: 0 0 100%;
  margin: 0;
  scroll-snap-align: center;
  padding: 8px 8px 28px;
  background: #fff;
  box-shadow: 0 6px 16px rgba(60, 20, 10, .25);
  transform: rotate(var(--rot, -1deg));
}
.galerie { align-items: center; }
.galerie img { display: block; width: 100%; max-height: 58vh; object-fit: contain; }
.lettre .l-citation {
  position: relative;
  margin: 4px 0 18px;
  padding: 18px 14px 34px;
  font-family: var(--police-lettre);
  font-style: italic;
  font-size: 24px;
  line-height: 1.35;
  color: #6d0f24;
  text-wrap: balance;
}
.lettre .l-citation::before, .lettre .l-citation::after {
  position: absolute;
  font-family: var(--police-titre);
  font-size: 64px;
  line-height: 1;
  color: rgba(192, 146, 69, .45);
}
.lettre .l-citation::before { content: "“"; left: -6px; top: -8px; }
.lettre .l-citation::after { content: "”"; right: -4px; bottom: 6px; }
.lettre .l-citation p { margin: 0; }
.lettre .l-citation svg { position: absolute; left: 50%; bottom: 0; width: 22px; height: 22px; margin-left: -11px; color: #c0283f; animation: battement 1.6s ease-in-out infinite; }
.galerie-points { display: flex; justify-content: center; gap: 6px; margin: -4px 0 12px; }
.galerie-points span { width: 6px; height: 6px; border-radius: 50%; background: rgba(109, 15, 36, .25); }
.galerie-points span.actif { background: #6d0f24; }
.lettre video { width: 100%; border-radius: 8px; margin: 4px 0 14px; background: #000; }
.lettre audio { width: 100%; margin: 4px 0 14px; }
.lettre .l-activite {
  margin: 16px 0 0;
  padding: 14px 16px;
  border-radius: 10px;
  border: 1px dashed rgba(169, 123, 49, .6);
  background: rgba(255, 255, 255, .45);
  font-size: 15px;
  line-height: 1.4;
  text-align: left;
}
.lettre .l-activite strong { display: block; font-size: 11px; letter-spacing: .2em; text-transform: uppercase; color: #a5732c; margin-bottom: 4px; }
.lettre .l-lien {
  display: inline-block;
  margin-top: 18px;
  padding: 12px 22px;
  border-radius: 999px;
  background: linear-gradient(160deg, #8c1630, #5a0a1c);
  color: #fbe6d6;
  text-decoration: none;
  font-weight: 500;
  box-shadow: 0 6px 14px rgba(90, 10, 28, .35);
}
.lettre .l-signature {
  margin: 20px 0 0;
  font-family: var(--police-titre);
  font-style: italic;
  font-size: 20px;
  color: #8c1630;
  text-align: right;
}
.bouton-retour {
  display: block;
  margin: 22px auto 0;
  padding: 12px 24px;
  border-radius: 999px;
  border: 1px solid rgba(226, 191, 115, .5);
  background: rgba(30, 3, 10, .35);
  color: var(--creme);
  cursor: pointer;
  font-size: 15px;
}

/* =====================================================================
   Grands écrans : 8 colonnes
   ===================================================================== */
@media (min-width: 960px) {
  :root { --gap: 14px; }
  .page { max-width: 1120px; padding-top: 70px; }
  .calendrier { --cols: 8; }
  .case { grid-column: var(--dc) / span var(--cs); grid-row: var(--dr) / span var(--rs); }
  .entete { margin-bottom: 34px; }
  .titre { font-size: 76px; }
  .surtitre { font-size: 13px; }
  .case-interieur .coeur-mini { width: 26cqmin; height: 26cqmin; }
}

@media (min-width: 640px) and (max-width: 959px) {
  :root { --gap: 12px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .2s !important; }
  .case { opacity: 1; }
}
