/* =========================================================
   Calendrier de l'Avent IA · Wolph Lab
   Palette et typographies reprises de lab.wolph.ai
   ========================================================= */

:root {
  --ink: #0C0A08;
  --ink2: #100D0A;
  --panel: #16120E;
  --panel2: #1E1812;
  --line: rgba(255, 255, 255, .10);
  --line-soft: rgba(255, 255, 255, .06);
  --orange: #FF6B1A;
  --orange-br: #FF8338;
  --orange-deep: #C9531B;
  --ambre: #FFC46B;
  --green: #46C36B;
  --rouge: #FF6A5C;
  --creme: #F4EEE7;
  --gris: #A89F95;
  --sur-orange: #160D06;
  --papier: #FFF8EC;
  --encre: #2A1E14;

  --titre: "Space Grotesk", "Work Sans", system-ui, sans-serif;
  --texte: "Work Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "JetBrains Mono", ui-monospace, "Cascadia Mono", Consolas, monospace;
  --plume: "Caveat", "Segoe Print", "Bradley Hand", cursive;
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  min-height: 100vh;
  background: var(--ink);
  color: var(--creme);
  font-family: var(--texte);
  font-size: 16px;
  line-height: 1.55;
  overflow-x: hidden;
}

h1, h2, h3 { font-family: var(--titre); letter-spacing: -.02em; margin: 0; text-wrap: balance; }
p { margin: 0 0 .8em; }
button { font: inherit; color: inherit; cursor: pointer; }
a { color: var(--orange-br); }
img { max-width: 100%; height: auto; }
[hidden] { display: none !important; }
.accent { color: var(--orange); }

:focus-visible { outline: 2px solid var(--ambre); outline-offset: 3px; border-radius: 6px; }

/* ---------- Le décor : village flou, grille, guirlande, neige ---------- */

.decor-page {
  position: fixed; inset: -30px; z-index: 0;
  background:
    linear-gradient(180deg, rgba(12, 10, 8, .34) 0%, rgba(12, 10, 8, .5) 55%, rgba(12, 10, 8, .78) 100%),
    url("../assets/village-flou.jpg") center / cover no-repeat;
  filter: blur(5px) saturate(1.25);
}
.decor-page::after {
  content: ""; position: absolute; inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, .035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, .035) 1px, transparent 1px);
  background-size: 64px 64px;
  mask-image: radial-gradient(ellipse at 50% 30%, #000 0%, transparent 75%);
  -webkit-mask-image: radial-gradient(ellipse at 50% 30%, #000 0%, transparent 75%);
}

.guirlande-page { position: fixed; top: 0; left: 0; right: 0; height: 64px; z-index: 3; pointer-events: none; }
.guirlande-page svg { width: 100%; height: 100%; display: block; overflow: visible; }
.guirlande-page .fil { fill: none; stroke: #2c3a2c; stroke-width: 2; }
.guirlande-page .ampoule { animation: scintille 2.6s ease-in-out infinite; transform-box: fill-box; transform-origin: center; }
.guirlande-page .culot { fill: #3a2f26; }
@keyframes scintille {
  0%, 100% { opacity: .55; filter: none; }
  50% { opacity: 1; filter: drop-shadow(0 0 5px currentColor) drop-shadow(0 0 10px currentColor); }
}

.neige { position: absolute; inset: 0; overflow: hidden; pointer-events: none; }
.neige-page { position: fixed; z-index: 2; }
.flocon {
  position: absolute; top: -6%;
  color: #fff; opacity: .8; user-select: none;
  text-shadow: 0 0 6px rgba(255, 255, 255, .5);
  animation: chute linear infinite;
  will-change: transform;
}
@keyframes chute {
  0% { transform: translate3d(0, 0, 0) rotate(0deg); }
  50% { transform: translate3d(var(--derive, 20px), 56vh, 0) rotate(120deg); }
  100% { transform: translate3d(0, 112vh, 0) rotate(240deg); }
}
.neige-village .flocon { animation-name: chute-village; }
@keyframes chute-village {
  0% { transform: translate3d(0, 0, 0); }
  100% { transform: translate3d(var(--derive, 14px), 700px, 0); }
}

/* ---------- Les écrans ---------- */

.ecran { display: none; position: relative; z-index: 4; min-height: 100vh; padding: 84px 20px 40px; }
.ecran.actif { display: block; animation: apparition .5s ease both; }
#accueil.actif, #presentation.actif { display: grid; place-items: center; }
@keyframes apparition { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

.carte {
  width: min(620px, 100%);
  background: linear-gradient(165deg, rgba(34, 26, 18, .86), rgba(18, 14, 10, .9));
  border: 1px solid rgba(255, 131, 56, .55);
  border-radius: 22px;
  padding: 30px 34px 34px;
  text-align: center;
  box-shadow: 0 0 0 7px rgba(255, 107, 26, .08), 0 30px 90px rgba(0, 0, 0, .55);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}
.carte .logo { width: 190px; display: block; margin: 0 auto; }
.carte-accueil .mascotte {
  width: 132px; margin: 14px auto 2px; display: block;
  filter: drop-shadow(0 10px 14px rgba(0, 0, 0, .45));
  animation: flotte 3.4s ease-in-out infinite;
}
@keyframes flotte { 0%, 100% { transform: translateY(0) rotate(-2deg); } 50% { transform: translateY(-7px) rotate(2deg); } }
.carte-accueil h1 { font-size: clamp(2.1rem, 6vw, 3.3rem); line-height: 1.05; margin: 8px 0 14px; }
.chapeau { font-size: 1.08rem; color: #E6DDD2; margin: 0 auto 22px; max-width: 30em; }

/* ---------- Boutons ---------- */

.bouton-principal {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  background: var(--orange); color: var(--sur-orange);
  font-family: var(--titre); font-weight: 600; font-size: 1.02rem;
  border: 0; border-radius: 12px; padding: 12px 22px;
  box-shadow: 0 0 0 6px rgba(255, 107, 26, .14), 0 10px 26px rgba(255, 107, 26, .22);
  transition: transform .15s ease, background .15s ease, box-shadow .15s ease;
  text-decoration: none;
}
.bouton-principal:hover { background: var(--orange-br); transform: translateY(-1px); }
.bouton-principal:active { transform: translateY(1px); }
.bouton-principal.large { width: 100%; padding: 17px 22px; font-size: 1.2rem; }
.bouton-principal:disabled { opacity: .5; cursor: default; transform: none; }

.bouton-contour {
  background: rgba(255, 255, 255, .04); color: var(--creme);
  font-family: var(--titre); font-weight: 600;
  border: 1px solid rgba(255, 255, 255, .22); border-radius: 11px; padding: 10px 18px;
  transition: border-color .15s ease, background .15s ease;
}
.bouton-contour:hover { border-color: var(--orange); background: rgba(255, 107, 26, .12); }
.bouton-contour:disabled { opacity: .45; cursor: default; }

.bouton-rond {
  flex: none; width: 42px; height: 42px; border-radius: 50%;
  background: transparent; border: 1px solid rgba(255, 255, 255, .28); color: var(--ambre); font-size: 1.15rem;
  transition: transform .3s ease, border-color .15s ease;
}
.bouton-rond:hover { transform: rotate(90deg); border-color: var(--orange); }

.lien-discret {
  background: none; border: 0; padding: 0; margin-top: 14px;
  color: var(--gris); font-size: .86rem; text-decoration: underline; text-underline-offset: 3px;
}
.lien-discret:hover { color: var(--creme); }

/* ---------- L'enveloppe et la lettre ---------- */

.scene-enveloppe { display: grid; justify-items: center; gap: 26px; width: 100%; }
.porteur { position: relative; animation: arrivee 1.7s cubic-bezier(.2, .8, .25, 1) both; }
@keyframes arrivee {
  0% { transform: translate(-70vw, -22vh) rotate(-16deg); }
  70% { transform: translate(10px, 6px) rotate(3deg); }
  100% { transform: none; }
}
.porteur-loup {
  position: absolute; right: 100%; bottom: -18px; width: 104px; max-width: none; margin-right: -26px; z-index: 2;
  filter: drop-shadow(0 10px 12px rgba(0, 0, 0, .45));
  animation: repart 1.1s ease-in 2.3s both;
}
@keyframes repart {
  0% { transform: none; opacity: 1; }
  25% { transform: translateY(-16px) rotate(-6deg); opacity: 1; }
  100% { transform: translate(-60vw, -8vh) rotate(-14deg); opacity: 0; }
}

.enveloppe {
  position: relative; display: block;
  width: min(430px, 82vw); aspect-ratio: 1.55;
  border: 0; border-radius: 6px; padding: 0;
  background: linear-gradient(180deg, #F6EFE4 0%, #E7DAC6 100%);
  box-shadow: 0 26px 50px rgba(0, 0, 0, .55), inset 0 0 0 1px rgba(255, 255, 255, .5);
  perspective: 900px;
  transition: transform .5s ease, opacity .5s ease;
}
.enveloppe::before { /* les plis du bas */
  content: ""; position: absolute; inset: 0; border-radius: 6px;
  background:
    linear-gradient(to top right, transparent 49.6%, rgba(120, 88, 56, .18) 50%, transparent 50.6%) left bottom / 50% 62% no-repeat,
    linear-gradient(to top left, transparent 49.6%, rgba(120, 88, 56, .18) 50%, transparent 50.6%) right bottom / 50% 62% no-repeat;
}
.rabat {
  position: absolute; left: 0; right: 0; top: 0; height: 62%;
  background: linear-gradient(180deg, #F4EADB, #DCCBB3);
  clip-path: polygon(0 0, 100% 0, 50% 100%);
  transform-origin: top center;
  transition: transform .8s cubic-bezier(.4, .1, .2, 1);
  filter: drop-shadow(0 4px 4px rgba(80, 50, 20, .5));
  backface-visibility: visible;
}
.cachet {
  position: absolute; left: 50%; top: 61%;
  width: 21%; aspect-ratio: 1; transform: translate(-50%, -50%);
  display: grid; place-items: center;
  border-radius: 50%;
  background: radial-gradient(circle at 34% 30%, #FFA566 0%, var(--orange) 46%, var(--orange-deep) 100%);
  box-shadow: 0 0 0 4px rgba(201, 83, 27, .55), 0 6px 14px rgba(120, 40, 0, .5), inset 0 -5px 9px rgba(120, 40, 0, .45);
  color: #FFE7D3; font-family: var(--titre); font-weight: 700; font-size: clamp(1.5rem, 5vw, 2.3rem);
  text-shadow: 0 2px 2px rgba(120, 40, 0, .6);
  transition: transform .5s ease, opacity .5s ease;
  animation: battement 1.8s ease-in-out 2.6s infinite;
}
@keyframes battement { 0%, 100% { box-shadow: 0 0 0 4px rgba(201, 83, 27, .55), 0 6px 14px rgba(120, 40, 0, .5), inset 0 -5px 9px rgba(120, 40, 0, .45); } 50% { box-shadow: 0 0 0 10px rgba(255, 107, 26, .22), 0 6px 22px rgba(255, 107, 26, .6), inset 0 -5px 9px rgba(120, 40, 0, .45); } }
.pour-toi {
  position: absolute; left: 9%; bottom: 9%;
  font-family: var(--plume); font-size: clamp(1.3rem, 4.4vw, 1.9rem); color: #7A5A3A; transform: rotate(-4deg);
}
.enveloppe:hover .cachet { transform: translate(-50%, -50%) scale(1.07); }
.enveloppe.ouverte .rabat { transform: rotateX(178deg); }
.enveloppe.ouverte .cachet { transform: translate(-50%, -50%) scale(1.5); opacity: 0; animation: none; }
.enveloppe.partie { transform: translateY(30px) scale(.94); opacity: 0; }

.invite {
  max-width: 24em; text-align: center; font-size: 1.1rem; color: #EFE7DC; margin: 0;
  animation: apparition .8s ease 2.2s both;
  text-shadow: 0 2px 10px rgba(0, 0, 0, .7);
}
.invite.efface { opacity: 0 !important; transition: opacity .4s ease; animation: none; }

.carte-lettre { width: min(740px, 100%); padding: 26px 34px 30px; animation: apparition .7s ease both; }
.papier {
  margin: 18px 0 22px; padding: 22px 30px 16px;
  background:
    repeating-linear-gradient(180deg, transparent 0 2.33rem, rgba(190, 150, 110, .16) 2.33rem calc(2.33rem + 1px)),
    var(--papier);
  color: var(--encre);
  border: 1px solid rgba(255, 131, 56, .6); border-radius: 12px;
  font-family: var(--plume); font-size: 1.56rem; line-height: 2.33rem; text-align: left;
  box-shadow: inset 0 0 40px rgba(210, 170, 120, .25);
}
.papier p { margin: 0 0 1.05rem; opacity: 0; transform: translateY(6px); transition: opacity .8s ease, transform .8s ease; }
.papier p.visible { opacity: 1; transform: none; }
.papier .signature {
  display: flex; align-items: center; justify-content: flex-end; gap: 12px;
  font-size: 2rem; font-weight: 700; color: var(--orange-deep); margin-bottom: .2rem;
}
.papier .signature img { width: 54px; }
#bouton-village { opacity: 0; transition: opacity .6s ease; }
#bouton-village.visible { opacity: 1; }

/* ---------- L'écran village ---------- */

#ecran-village { padding: 74px clamp(14px, 2.4vw, 44px) 28px; }

.entete { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 6px; }
.entete .logo { width: 150px; }
.entete .espace { flex: 1; }
.pastille {
  display: inline-flex; align-items: center; gap: 6px;
  font-family: var(--mono); font-size: .88rem; font-weight: 600;
  padding: 7px 14px; border-radius: 999px;
  background: rgba(22, 18, 14, .7); border: 1px solid rgba(255, 255, 255, .2);
  white-space: nowrap;
}

.titre-village { text-align: center; margin: 0 0 14px; }
.titre-village h1 { font-size: clamp(1.9rem, 4.2vw, 3.4rem); line-height: 1.08; text-shadow: 0 4px 24px rgba(0, 0, 0, .6); }
.sous-titre { font-family: var(--mono); font-size: .92rem; letter-spacing: .12em; text-transform: uppercase; color: var(--orange-br); margin: 6px 0 0; }

.grille-village {
  display: grid; gap: 22px; align-items: start;
  grid-template-columns: minmax(230px, 300px) minmax(0, 1fr) minmax(250px, 340px);
  grid-template-areas: "progression village hotte";
  max-width: 1820px; margin: 0 auto;
}
.panneau-progression { grid-area: progression; }
.colonne-village { grid-area: village; min-width: 0; }
.panneau-hotte { grid-area: hotte; }

.panneau {
  background: linear-gradient(165deg, rgba(30, 24, 18, .84), rgba(18, 14, 10, .88));
  border: 1px solid rgba(255, 255, 255, .14);
  border-radius: 18px; padding: 20px 22px;
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  box-shadow: 0 18px 50px rgba(0, 0, 0, .35);
}
.panneau h2 { font-size: 1.2rem; color: var(--ambre); margin-bottom: 14px; }
.panneau h3 { font-family: var(--mono); font-weight: 600; font-size: .8rem; letter-spacing: .14em; text-transform: uppercase; color: var(--gris); margin: 20px 0 8px; }

.gros-compteur { font-weight: 500; margin-bottom: 10px; }
.gros-compteur strong { font-family: var(--titre); font-size: 2.3rem; color: var(--orange); margin-right: 2px; line-height: 1; }
.jauge { height: 8px; border-radius: 99px; background: rgba(255, 255, 255, .12); overflow: hidden; margin-bottom: 18px; }
.jauge span { display: block; height: 100%; width: 0; border-radius: 99px; background: linear-gradient(90deg, var(--orange-deep), var(--orange), var(--ambre)); transition: width .8s ease; }

.chapitre { margin-bottom: 16px; }
.chapitre-tete { display: flex; justify-content: space-between; gap: 8px; font-weight: 600; margin-bottom: 8px; }
.chapitre-tete span:last-child { font-family: var(--mono); color: var(--gris); font-weight: 400; }
.chapitre-jours { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 7px; }
.jour {
  aspect-ratio: 1; min-width: 0; display: grid; place-items: center;
  font-family: var(--mono); font-weight: 600; font-size: .9rem;
  border-radius: 10px; border: 1px solid rgba(255, 255, 255, .14);
  background: rgba(255, 255, 255, .03); color: rgba(244, 238, 231, .4);
  padding: 0;
}
.jour.ouverte { color: var(--creme); border-color: rgba(255, 255, 255, .42); background: rgba(255, 255, 255, .07); }
.jour.ouverte:hover { border-color: var(--orange); }
.jour.prochaine { border: 2px solid var(--orange); box-shadow: 0 0 0 3px rgba(255, 107, 26, .18); }
.jour.faite { background: rgba(70, 195, 107, .2); border-color: var(--green); color: #BDF2CC; }
.surprise { font-size: .9rem; color: var(--gris); margin: 4px 0 0; }
.surprise.ouverte { color: var(--ambre); }

.prochaine {
  display: flex; align-items: center; gap: 12px;
  padding: 14px; border-radius: 14px;
  border: 1px dashed rgba(255, 131, 56, .55); background: rgba(255, 107, 26, .06);
}
.prochaine .numero {
  flex: none; width: 46px; height: 46px; display: grid; place-items: center; border-radius: 50%;
  background: var(--orange); color: var(--sur-orange); font-family: var(--mono); font-weight: 600;
}
.prochaine .libelle { flex: 1; min-width: 0; line-height: 1.3; }
.prochaine .libelle small { display: block; color: var(--gris); font-size: .8rem; }
.prochaine .libelle strong { font-family: var(--titre); }
.prochaine .bouton-principal { padding: 9px 14px; font-size: .92rem; box-shadow: none; white-space: nowrap; }

.cadeaux { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.cadeaux li.vide, .carnet-vide { color: var(--gris); font-style: italic; font-size: .94rem; padding: 10px 12px; border-radius: 10px; background: rgba(255, 255, 255, .04); }
.carnet-vide { padding: 0; background: none; margin: 0; }
.cadeau-bouton {
  width: 100%; text-align: left; display: flex; gap: 10px; align-items: baseline;
  background: rgba(255, 255, 255, .05); border: 1px solid transparent; border-radius: 10px; padding: 9px 12px; font-size: .93rem;
}
.cadeau-bouton:hover { border-color: var(--orange); }
.cadeau-bouton span:first-child { font-family: var(--mono); color: var(--orange-br); font-size: .82rem; flex: none; }
.carnet-chiffre { font-family: var(--titre); font-size: 1.5rem; color: var(--orange); line-height: 1.1; }
.carnet-ligne { font-size: .93rem; margin: 4px 0 0; color: #E6DDD2; }

/* Le village et ses maisons */

.cadre-village {
  border-radius: 20px; overflow: hidden; scroll-margin-top: 72px;
  border: 1px solid rgba(255, 131, 56, .6);
  box-shadow: 0 0 0 7px rgba(255, 107, 26, .08), 0 26px 70px rgba(0, 0, 0, .5);
  background: #0b0d18;
}
.village { position: relative; aspect-ratio: 16 / 9; container-type: inline-size; overflow: hidden; }
.village-image { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; }
.village-nuit {
  position: absolute; inset: 0; background: rgba(5, 5, 14, .86);
  opacity: 0; transition: opacity .9s ease; pointer-events: none;
}
.village.nuit .village-nuit { opacity: 1; }
.village-lueurs { position: absolute; inset: 0; pointer-events: none; }
.lueur {
  position: absolute; width: 20%; aspect-ratio: 1; transform: translate(-50%, -50%);
  background: radial-gradient(circle, rgba(255, 196, 107, .5) 0%, rgba(255, 107, 26, .22) 35%, transparent 66%);
  mix-blend-mode: screen; animation: allume 1s ease both;
}
@keyframes allume { 0% { opacity: 0; transform: translate(-50%, -50%) scale(.3); } 60% { opacity: 1; transform: translate(-50%, -50%) scale(1.25); } 100% { opacity: .85; transform: translate(-50%, -50%) scale(1); } }

.village-maisons { position: absolute; inset: 0; }
.maison {
  position: absolute; transform: translate(-50%, -50%);
  min-width: 2.5em; height: 2.15em; padding: 0 .5em;
  display: grid; place-items: center;
  font-family: var(--mono); font-weight: 600; font-size: clamp(11px, 1.45cqw, 17px);
  border-radius: .6em;
  background: rgba(22, 18, 14, .86); color: rgba(244, 238, 231, .78);
  border: 1.5px solid rgba(255, 255, 255, .34);
  box-shadow: 0 3px 10px rgba(0, 0, 0, .5);
  transition: transform .15s ease, box-shadow .15s ease;
}
.maison:hover { transform: translate(-50%, -50%) scale(1.12); }
.maison.ouverte {
  background: var(--orange); color: var(--sur-orange); border-color: #FFD9BF;
  box-shadow: 0 0 0 4px rgba(255, 107, 26, .28), 0 4px 16px rgba(255, 107, 26, .6);
}
.maison.aujourdhui::after {
  content: ""; position: absolute; inset: -5px; border-radius: .8em; border: 2px solid var(--orange);
  animation: onde 1.8s ease-out infinite; pointer-events: none;
}
@keyframes onde { 0% { opacity: .9; transform: scale(.9); } 100% { opacity: 0; transform: scale(1.7); } }
.maison.faite {
  background: #1E8E47; color: #fff; border-color: #BDF2CC;
  box-shadow: 0 0 0 4px rgba(70, 195, 107, .25), 0 4px 14px rgba(0, 0, 0, .45);
}
.maison.faite::before {
  content: "✓"; position: absolute; top: -.75em; right: -.75em; width: 1.4em; height: 1.4em; border-radius: 50%;
  display: grid; place-items: center; font-size: .72em; background: #fff; color: #1E8E47; box-shadow: 0 2px 5px rgba(0, 0, 0, .4);
}
.village.nuit .maison { opacity: .55; pointer-events: none; }

.village-loup {
  position: absolute; width: 8.5%; max-width: none; transform: translate(-50%, -100%);
  transition: left .9s cubic-bezier(.4, .1, .2, 1), top .9s cubic-bezier(.4, .1, .2, 1);
  filter: drop-shadow(0 0 12px rgba(255, 196, 107, .55)) drop-shadow(0 6px 8px rgba(0, 0, 0, .5));
  animation: flotte-village 2.4s ease-in-out infinite; pointer-events: none; z-index: 3;
}
@keyframes flotte-village { 0%, 100% { margin-top: 0; } 50% { margin-top: -1.2%; } }

.indice-glisser { display: none; text-align: center; font-size: .85rem; color: var(--gris); margin: 8px 0 0; }

.conseil { display: flex; align-items: center; gap: 16px; margin-top: 18px; padding: 16px 20px; }
.conseil img { width: 50px; flex: none; }
.conseil > div { flex: 1; min-width: 0; }
.conseil h2 { font-size: 1.05rem; margin-bottom: 2px; }
.conseil p { margin: 0; font-weight: 500; }

.pied { text-align: center; color: var(--gris); font-size: .85rem; margin-top: 26px; }

/* ---------- La fenêtre de jeu ---------- */

.fenetre {
  position: fixed; inset: 0; z-index: 50;
  display: grid; place-items: center; padding: 16px;
  background: rgba(6, 5, 4, .7); backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px);
  overflow: auto; animation: apparition .3s ease both;
}
.fenetre-boite {
  position: relative; width: min(700px, 100%); max-height: calc(100vh - 32px); overflow: auto;
  background: linear-gradient(160deg, #2A1F15 0%, #17120D 70%);
  border: 1px solid rgba(255, 131, 56, .65); border-radius: 20px;
  padding: 26px 30px 28px;
  box-shadow: 0 0 0 7px rgba(255, 107, 26, .08), 0 30px 90px rgba(0, 0, 0, .65);
  scrollbar-width: thin; scrollbar-color: rgba(255, 131, 56, .5) transparent;
}
.fenetre.scene { background: transparent; backdrop-filter: none; -webkit-backdrop-filter: none; place-items: end center; pointer-events: none; padding-bottom: 3vh; }
.fenetre.scene .fenetre-boite { pointer-events: auto; width: min(640px, 100%); max-height: 48vh; }
.fenetre-boite h2 { font-size: 1.45rem; color: var(--orange-br); margin: 0 44px 14px 0; }
.fermer {
  position: absolute; top: 16px; right: 16px; width: 38px; height: 38px; border-radius: 50%;
  background: rgba(255, 255, 255, .06); border: 1px solid rgba(255, 255, 255, .3); font-size: 1.3rem; line-height: 1;
}
.fermer:hover { border-color: var(--orange); }
.fenetre-zone > *:last-child { margin-bottom: 0; }

.question { font-family: var(--titre); font-weight: 600; font-size: 1.1rem; margin-bottom: .6em; }
.bravo { color: #8BE3A6; font-weight: 600; }
.perdu { color: #FF9C90; font-weight: 600; }
.discret { color: var(--gris); font-size: .9rem; }
.explication { background: rgba(255, 255, 255, .05); border-left: 3px solid var(--orange); border-radius: 8px; padding: 10px 14px; }
.explication:empty { display: none; }
.explication strong { color: var(--ambre); }
.actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 14px; align-items: center; }
.gros-chiffre { font-family: var(--titre); font-size: 3rem; line-height: 1; margin: 0 0 8px; color: var(--orange); }
.lecture { font-family: var(--mono); font-size: .86rem; color: var(--ambre); margin: 10px 0; }

.chrono { display: flex; align-items: center; gap: 12px; margin: 12px 0; }
.chrono-piste { flex: 1; height: 8px; border-radius: 99px; background: rgba(255, 255, 255, .13); overflow: hidden; }
.chrono-jauge { height: 100%; width: 100%; border-radius: 99px; background: linear-gradient(90deg, var(--orange), var(--ambre)); transition: width .1s linear; }
.chrono.presse .chrono-jauge { background: var(--rouge); }
.chrono-texte { font-family: var(--mono); font-weight: 600; min-width: 46px; text-align: right; }

@keyframes secoue { 0%, 100% { transform: translateX(0); } 25% { transform: translateX(-5px); } 75% { transform: translateX(5px); } }

/* Associer */
.associer { display: grid; grid-template-columns: 1fr 1fr; gap: 9px 16px; }
.tuile {
  text-align: left; padding: 10px 12px; border-radius: 10px; font-size: .95rem; line-height: 1.3;
  background: rgba(255, 255, 255, .06); border: 1px solid rgba(255, 255, 255, .16);
}
.tuile:hover:not(:disabled) { border-color: rgba(255, 131, 56, .7); }
.tuile.choisie { border-color: var(--orange); background: rgba(255, 107, 26, .2); }
.tuile.trouve { border-color: var(--green); background: rgba(70, 195, 107, .16); color: #BDF2CC; cursor: default; }
.tuile.erreur { animation: secoue .35s; border-color: var(--rouge); }

/* Guirlande */
.fil-guirlande { height: 16px; margin: 12px 4px 0; border-top: 2px solid #3d5a3d; border-radius: 50% 50% 0 0 / 100% 100% 0 0; }
.suspensions { display: flex; flex-wrap: wrap; gap: 14px 10px; margin-top: -4px; }
.suspension {
  --couleur: var(--orange);
  position: relative; flex: 1 1 104px; min-height: 60px;
  display: grid; place-items: center; text-align: center;
  padding: 9px 10px; border-radius: 14px; font-size: .93rem; line-height: 1.3;
  border: 2px dashed rgba(255, 255, 255, .24); color: var(--gris); font-family: var(--mono);
}
.suspension::before { content: ""; position: absolute; left: 50%; top: -12px; width: 2px; height: 12px; background: #7a6a58; }
.suspension.posee {
  border-style: solid; border-color: var(--couleur); color: var(--creme); font-family: var(--texte); font-weight: 500;
  background: color-mix(in srgb, var(--couleur) 24%, transparent);
  animation: pose .45s ease;
}
@keyframes pose { 0% { transform: translateY(-14px) scale(.9); opacity: 0; } 60% { transform: translateY(3px); opacity: 1; } 100% { transform: none; } }
.suspensions.longues .suspension { flex-basis: 100%; min-height: 46px; justify-items: start; text-align: left; }
.suspensions.longues .suspension::before { left: 22px; }
.boules { display: flex; flex-wrap: wrap; gap: 9px; margin-top: 16px; }
.boule {
  --couleur: var(--orange);
  display: inline-flex; align-items: center; gap: 9px; text-align: left;
  padding: 9px 14px; border-radius: 12px; font-size: .95rem; line-height: 1.3;
  background: rgba(255, 255, 255, .06); border: 1px solid rgba(255, 255, 255, .18);
}
.boule::before {
  content: ""; flex: none; width: 17px; height: 17px; border-radius: 50%;
  background: radial-gradient(circle at 32% 28%, rgba(255, 255, 255, .85), var(--couleur) 48%, color-mix(in srgb, var(--couleur) 55%, #000) 100%);
}
.boule:hover:not(:disabled) { border-color: var(--couleur); }
.boule.erreur { animation: secoue .35s; border-color: var(--rouge); }
.boule:disabled { display: none; }

/* Les cheminées (livrer + semaine) */
.colis {
  background: rgba(255, 255, 255, .06); border: 1px solid rgba(255, 255, 255, .16); border-radius: 12px;
  padding: 12px 14px; font-weight: 500;
}
.scene-cheminees {
  position: relative; height: 216px; margin: 12px 0; border-radius: 14px; overflow: hidden;
  background:
    radial-gradient(circle at 20% 22%, rgba(255, 255, 255, .7) 0 1px, transparent 2px),
    radial-gradient(circle at 72% 14%, rgba(255, 255, 255, .6) 0 1px, transparent 2px),
    radial-gradient(circle at 48% 30%, rgba(255, 255, 255, .5) 0 1px, transparent 2px),
    radial-gradient(circle at 90% 34%, rgba(255, 255, 255, .6) 0 1px, transparent 2px),
    linear-gradient(180deg, #0a0c1a 0%, #1a1826 64%, #dfe6f0 64%, #c3cede 100%);
  border: 1px solid rgba(255, 255, 255, .12);
}
.chalet {
  position: absolute; bottom: 8px; width: 27%; transform: translateX(-50%);
  background: none; border: 0; padding: 0; display: grid; justify-items: center;
}
.chalet .cheminee { width: 16%; height: 22px; background: #5c3a28; border-top: 5px solid #f2f5fa; border-radius: 3px 3px 0 0; margin-left: 38%; margin-bottom: -10px; position: relative; z-index: 1; }
.chalet .toit { width: 100%; height: 42px; background: linear-gradient(180deg, #f2f5fa 0 34%, #2b2a3a 34%); clip-path: polygon(50% 0, 100% 100%, 0 100%); }
.chalet .murs { width: 78%; height: 44px; background: linear-gradient(180deg, #6b4630, #53331f); display: grid; place-items: center; border-radius: 0 0 4px 4px; }
.chalet .lucarne { width: 26%; height: 20px; border-radius: 3px; background: #FFC46B; box-shadow: 0 0 12px rgba(255, 170, 80, .9); }
.chalet .nom {
  margin-top: 6px; padding: 3px 9px; border-radius: 8px; font-size: .84rem; font-weight: 600; line-height: 1.25;
  background: rgba(22, 18, 14, .9); color: var(--creme); border: 1px solid rgba(255, 255, 255, .25);
}
.chalet:hover:not(:disabled) .nom { border-color: var(--orange); background: var(--orange); color: var(--sur-orange); }
.chalet:disabled { cursor: default; }
.chalet.juste .nom, .chalet.choisie .nom { background: #1E8E47; border-color: #BDF2CC; color: #fff; }
.chalet.faux .nom { background: #B5382C; border-color: #FFC9C2; color: #fff; }
.livreur {
  position: absolute; top: 4px; left: 50%; width: 46px; max-width: none; transform: translateX(-50%);
  transition: left .5s cubic-bezier(.4, .1, .2, 1); z-index: 2;
  filter: drop-shadow(0 4px 5px rgba(0, 0, 0, .5));
}
.colis-vol { position: absolute; top: 46px; left: 50%; transform: translateX(-50%); font-size: 1.3rem; transition: left .5s cubic-bezier(.4, .1, .2, 1); z-index: 2; }
.colis-vol.tombe { animation: tombe .6s ease-in .45s both; }
@keyframes tombe { 0% { top: 46px; opacity: 1; } 100% { top: 104px; opacity: 0; transform: translateX(-50%) scale(.5); } }

/* Attraper */
.terrain {
  position: relative; height: 290px; margin: 10px 0; border-radius: 14px; overflow: hidden; cursor: pointer;
  background:
    linear-gradient(90deg, transparent 33.2%, rgba(255, 255, 255, .07) 33.2% 33.5%, transparent 33.5% 66.5%, rgba(255, 255, 255, .07) 66.5% 66.8%, transparent 66.8%),
    linear-gradient(180deg, #0a0c1a 0%, #1a1826 80%, #dfe6f0 80%, #c3cede 100%);
  border: 1px solid rgba(255, 255, 255, .12);
}
.cadeau-qui-tombe { position: absolute; top: 0; width: 31%; transform: translateX(-50%); display: grid; justify-items: center; gap: 2px; transition: top .12s linear; }
.cadeau-qui-tombe .paquet { font-size: 1.9rem; line-height: 1; }
.cadeau-qui-tombe .etiquette {
  font-size: .82rem; line-height: 1.25; text-align: center; padding: 4px 7px; border-radius: 8px;
  background: rgba(22, 18, 14, .92); border: 1px solid rgba(255, 255, 255, .25);
}
.cadeau-qui-tombe.bon .etiquette { background: #1E8E47; border-color: #BDF2CC; }
.cadeau-qui-tombe.mauvais .etiquette { background: #B5382C; border-color: #FFC9C2; }
.loup-terrain { position: absolute; bottom: 2px; width: 50px; max-width: none; transform: translateX(-50%); transition: left .18s ease; filter: drop-shadow(0 4px 5px rgba(0, 0, 0, .5)); }
.loup-terrain.saut { animation: saut .5s ease; }
@keyframes saut { 0%, 100% { margin-bottom: 0; } 45% { margin-bottom: 26px; } }
.commandes { display: flex; justify-content: center; gap: 10px; margin: 10px 0; }
.commandes button { min-width: 56px; }

/* Semaine */
.ligne-tache { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--line-soft); }
.ligne-tache label { display: flex; align-items: center; gap: 10px; cursor: pointer; }
.ligne-tache input[type="checkbox"] { width: 18px; height: 18px; accent-color: var(--orange); flex: none; }
.heures { display: inline-flex; align-items: center; gap: 6px; font-size: .88rem; color: var(--gris); white-space: nowrap; }
.champ {
  background: rgba(0, 0, 0, .35); color: var(--creme); border: 1px solid rgba(255, 255, 255, .22); border-radius: 9px;
  padding: 8px 10px; font: inherit;
}
.champ:focus { outline: none; border-color: var(--orange); }
.heures .champ { width: 68px; padding: 5px 8px; }
.ajout-tache { display: flex; gap: 10px; margin: 14px 0; }
.ajout-tache .champ { flex: 1; min-width: 0; }

/* Memory */
.memory { display: grid; grid-template-columns: repeat(4, 1fr); gap: 9px; margin-top: 10px; }
.carte-memory { aspect-ratio: 5 / 4; padding: 0; border: 0; background: none; perspective: 700px; }
.carte-memory .interieur { position: relative; display: block; width: 100%; height: 100%; transition: transform .45s ease; transform-style: preserve-3d; }
.carte-memory.retournee .interieur, .carte-memory.trouvee .interieur { transform: rotateY(180deg); }
.carte-memory .dos, .carte-memory .face {
  position: absolute; inset: 0; display: grid; place-items: center; border-radius: 12px; backface-visibility: hidden; -webkit-backface-visibility: hidden;
  border: 1px solid rgba(255, 255, 255, .2);
}
.carte-memory .dos { background: linear-gradient(150deg, #3A2414, #1E1812); font-size: 1.7rem; color: var(--ambre); }
.carte-memory:hover .dos { border-color: var(--orange); }
.carte-memory .face { transform: rotateY(180deg); background: #2A2018; padding: 6px; font-size: clamp(.68rem, 1.9vw, .86rem); line-height: 1.22; text-align: center; overflow: hidden; }
.carte-memory.terme .face { font-weight: 600; color: var(--ambre); }
.carte-memory.trouvee .face { border-color: var(--green); background: rgba(70, 195, 107, .2); color: #D6F7E0; }

/* Course */
.piste {
  position: relative; height: 170px; margin: 10px 0; border-radius: 14px; overflow: hidden;
  background:
    radial-gradient(circle at 16% 20%, rgba(255, 255, 255, .7) 0 1px, transparent 2px),
    radial-gradient(circle at 62% 12%, rgba(255, 255, 255, .6) 0 1px, transparent 2px),
    radial-gradient(circle at 84% 30%, rgba(255, 255, 255, .5) 0 1px, transparent 2px),
    linear-gradient(180deg, #0a0c1a 0%, #1a1826 68%, #dfe6f0 68%, #c3cede 100%);
  border: 1px solid rgba(255, 255, 255, .12);
}
.piste::after { /* les traces dans la neige qui défilent */
  content: ""; position: absolute; left: 0; right: 0; bottom: 14px; height: 3px;
  background: repeating-linear-gradient(90deg, rgba(120, 140, 170, .55) 0 26px, transparent 26px 60px);
  animation: defile 0.9s linear infinite;
}
@keyframes defile { to { background-position: -60px 0; } }
.piste.arret::after { animation-play-state: paused; }
.coureur { position: absolute; left: 13%; bottom: 20px; width: 62px; transform: translateX(-50%); z-index: 2; }
.coureur img { width: 50px; max-width: none; display: block; margin: 0 auto -8px; filter: drop-shadow(0 4px 5px rgba(0, 0, 0, .5)); }
.coureur .luge { display: block; height: 10px; border-radius: 3px 14px 6px 6px; background: linear-gradient(180deg, var(--orange), var(--orange-deep)); box-shadow: 0 3px 0 #5c3a28; }
.coureur.saute { animation: grand-saut .75s ease; }
@keyframes grand-saut { 0%, 100% { bottom: 20px; } 45% { bottom: 84px; } }
.coureur.attrape { animation: attrape .5s ease; }
@keyframes attrape { 0%, 100% { transform: translateX(-50%); } 50% { transform: translateX(-30%) rotate(8deg); } }
.obstacle { position: absolute; bottom: 22px; left: 100%; transform: translateX(-50%); font-size: 2rem; line-height: 1; transition: left .1s linear; }
.obstacle.pris { transition: all .3s ease; opacity: 0; transform: translateX(-50%) scale(.3); }

/* Lettre */
.papier-jeu {
  background: var(--papier); color: var(--encre); border-radius: 12px; padding: 16px 20px;
  font-family: var(--plume); font-size: 1.36rem; line-height: 1.5; border: 1px solid rgba(255, 131, 56, .6);
}
.phrase { cursor: pointer; border-radius: 6px; padding: 1px 2px; transition: background .15s ease; -webkit-box-decoration-break: clone; box-decoration-break: clone; }
.phrase:hover { background: rgba(255, 107, 26, .2); }
.phrase.trouvee { background: rgba(70, 195, 107, .38); cursor: default; }
.phrase.fausse-piste { background: rgba(255, 90, 77, .3); cursor: default; }
.phrase.manquee { background: rgba(255, 196, 107, .55); }
.compteurs { display: flex; gap: 16px; flex-wrap: wrap; font-family: var(--mono); font-size: .88rem; margin: 10px 0; }

/* Quiz */
.tableau-score { display: flex; justify-content: space-between; gap: 10px; font-family: var(--mono); font-size: .88rem; color: var(--ambre); margin-bottom: 8px; }
.reponses { display: grid; gap: 9px; }
.reponse {
  text-align: left; padding: 11px 14px; border-radius: 11px; line-height: 1.35;
  background: rgba(255, 255, 255, .06); border: 1px solid rgba(255, 255, 255, .18);
}
.reponse:hover:not(:disabled) { border-color: var(--orange); background: rgba(255, 107, 26, .12); }
.reponse:disabled { cursor: default; }
.reponse.juste { background: rgba(70, 195, 107, .22); border-color: var(--green); }
.reponse.faux { background: rgba(255, 90, 77, .2); border-color: var(--rouge); }

/* Final */
.cadenas { font-size: 1.25rem; letter-spacing: .14em; word-break: break-all; }
.bilan-grille { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin: 12px 0 16px; }
.bilan-case { background: rgba(255, 255, 255, .05); border: 1px solid rgba(255, 255, 255, .14); border-radius: 12px; padding: 12px 14px; font-size: .92rem; line-height: 1.35; }
.bilan-case strong { display: block; font-family: var(--titre); font-size: 1.7rem; color: var(--orange); line-height: 1.15; }

/* Récompense */
.recompense {
  margin-top: 18px; padding: 18px 20px; border-radius: 14px;
  border: 1px dashed rgba(255, 131, 56, .7); background: rgba(255, 107, 26, .07);
  animation: apparition .5s ease both;
}
.recompense h3 { color: var(--ambre); font-size: 1.15rem; margin-bottom: 8px; }
.recompense ul { margin: 0 0 .8em; padding-left: 1.2em; }
.recompense li { margin-bottom: .35em; }
.cadre-prompt {
  position: relative; background: var(--ink); border: 1px solid rgba(255, 255, 255, .18); border-radius: 10px;
  padding: 14px; margin: 10px 0; font-family: var(--mono); font-size: .82rem; line-height: 1.55; white-space: pre-wrap;
  max-height: 230px; overflow: auto; color: #E9E0D5;
  scrollbar-width: thin; scrollbar-color: rgba(255, 131, 56, .5) transparent;
}
.demain { color: var(--gris); font-style: italic; margin-top: 12px; }

/* Inscription */
.papier-reponse {
  background: var(--papier); color: var(--encre); border-radius: 12px; padding: 16px 22px; margin: 10px 0 14px;
  font-family: var(--plume); font-size: 1.5rem; line-height: 1.5; border: 1px solid rgba(255, 131, 56, .6);
}
.papier-reponse p { margin: 0 0 .3em; }
.champ-plume {
  border: 0; border-bottom: 2px dashed #B89A7A; background: transparent; color: var(--orange-deep);
  font: inherit; font-weight: 700; padding: 0 6px; width: min(100%, 13em); border-radius: 0;
}
.champ-plume:focus { outline: none; border-bottom-color: var(--orange); }
.champ-plume::placeholder { color: #BBA58E; font-weight: 500; }
.mention-donnees { font-family: var(--texte); font-size: .78rem; line-height: 1.4; color: #6B5847; margin-top: .8em !important; }
.mention-donnees a { color: var(--orange-deep); }
.message-erreur { color: #FF9C90; min-height: 1.2em; font-size: .92rem; }

/* La bulle d'information */
.bulle {
  position: fixed; left: 50%; bottom: 26px; z-index: 80; transform: translate(-50%, 20px);
  max-width: min(92vw, 460px); padding: 11px 18px; border-radius: 12px; text-align: center;
  background: #221A12; border: 1px solid rgba(255, 131, 56, .7); box-shadow: 0 14px 40px rgba(0, 0, 0, .55);
  opacity: 0; pointer-events: none; transition: opacity .25s ease, transform .25s ease;
}
.bulle.visible { opacity: 1; transform: translate(-50%, 0); }

/* ---------- Adaptation aux petits écrans ---------- */

@media (max-width: 1240px) {
  .grille-village {
    grid-template-columns: 1fr 1fr;
    grid-template-areas: "village village" "progression hotte";
  }
}
@media (max-width: 760px) {
  .ecran { padding: 70px 14px 30px; }
  #ecran-village { padding-top: 64px; }
  .carte { padding: 24px 20px 26px; }
  .papier { font-size: 1.36rem; padding: 16px 18px 10px; }
  .grille-village { grid-template-columns: 1fr; grid-template-areas: "village" "progression" "hotte"; }
  .entete .logo { width: 118px; }
  .entete .espace { flex-basis: 100%; height: 0; }
  .entete .bouton-contour { padding: 8px 12px; font-size: .9rem; }
  .cadre-village { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .village { width: 860px; }
  .indice-glisser { display: block; }
  .fenetre-boite { padding: 22px 18px 22px; }
  .fenetre.scene { padding: 8px; }
  .fenetre.scene .fenetre-boite { max-height: 44vh; padding: 16px 16px 18px; }
  .fenetre.scene .fenetre-boite h2 { font-size: 1.15rem; margin-bottom: 8px; }
  .associer { gap: 8px; }
  .tuile { font-size: .86rem; padding: 8px 9px; }
  .memory { grid-template-columns: repeat(3, 1fr); }
  .conseil { padding: 14px; gap: 12px; }
}

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