:root {
  --fond: #0a1612;
  --fond-clair: #10221c;
  --creme: #f6eedd;
  --doux: #c3bca9;
  --or: #e6c068;
  --or-clair: #f0cf7f;
  --or-fonce: #b8862f;
  --rouge: #c62f3e;
  --rouge-fonce: #8f1b28;
  --vert: #1f6b4a;
  --ligne: rgba(230, 192, 104, 0.22);
  --rayon: 20px;
  --police-titre: 'Fraunces', Georgia, 'Times New Roman', serif;
  --police-texte: 'Nunito', system-ui, -apple-system, 'Segoe UI', sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }

html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}

body {
  margin: 0;
  background: var(--fond);
  color: var(--creme);
  font-family: var(--police-texte);
  font-size: 1.0625rem;
  line-height: 1.65;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}
body.verrouille { overflow: hidden; }

:focus-visible {
  outline: 3px solid var(--or);
  outline-offset: 3px;
}

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

/* ---------- Boutons ---------- */
.bouton {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5em;
  padding: 15px 30px;
  border: 0;
  border-radius: 999px;
  font: 800 1.05rem/1.1 var(--police-texte);
  letter-spacing: 0.01em;
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.2s ease, opacity 0.2s ease, filter 0.2s ease;
}
.bouton:hover:not(:disabled) { transform: translateY(-2px); filter: brightness(1.06); }
.bouton:active:not(:disabled) { transform: translateY(0); }
.bouton:disabled { opacity: 0.45; cursor: not-allowed; box-shadow: none; }

.bouton--rouge {
  background: linear-gradient(180deg, #d93e4d, #a51f2e);
  color: #fff;
  box-shadow: 0 12px 28px rgba(198, 47, 62, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.25);
}
.bouton--or {
  background: linear-gradient(180deg, var(--or-clair), #c99a3b);
  color: #2a1a05;
  box-shadow: 0 12px 28px rgba(230, 192, 104, 0.28), inset 0 1px 0 rgba(255, 255, 255, 0.45);
}
.bouton--large { width: min(100%, 360px); }

/* ---------- Intro ---------- */
.intro {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  padding: 24px 16px;
  text-align: center;
  background:
    radial-gradient(circle at 50% 38%, rgba(230, 192, 104, 0.16), transparent 45%),
    radial-gradient(circle at 50% 40%, #183c31 0%, var(--fond) 72%);
  transition: opacity 0.8s ease, visibility 0.8s;
}
.intro--ouverte { opacity: 0; visibility: hidden; }

.cadeau {
  display: block;
  width: 156px;
  height: 156px;
  margin: 0 auto 8px;
  overflow: visible;
  animation: sautille 2.4s ease-in-out infinite;
  filter: drop-shadow(0 18px 24px rgba(0, 0, 0, 0.45));
}
.cadeau__couvercle {
  transform-box: fill-box;
  transform-origin: 50% 100%;
  transition: transform 0.7s cubic-bezier(0.3, 1.5, 0.5, 1), opacity 0.6s ease 0.2s;
}
.intro--ouverture .cadeau { animation: none; }
.intro--ouverture .cadeau__couvercle { transform: translate(14px, -70px) rotate(24deg); opacity: 0; }

.intro__sur-titre {
  margin: 8px 0 0;
  color: var(--or);
  font-weight: 700;
  font-size: 0.85rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
}
.intro__titre {
  margin: 4px 0 28px;
  font: italic 700 clamp(2.6rem, 11vw, 4.6rem)/1.05 var(--police-titre);
}
.intro__note {
  margin: 18px 0 0;
  color: var(--doux);
  font-size: 0.9rem;
}

@keyframes sautille {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  20% { transform: translateY(-10px) rotate(-4deg); }
  40% { transform: translateY(0) rotate(3deg); }
  55% { transform: translateY(-4px) rotate(0deg); }
}

/* ---------- Bouton son ---------- */
.son {
  position: fixed;
  right: 16px;
  bottom: calc(16px + env(safe-area-inset-bottom, 0px));
  z-index: 40;
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  border: 1px solid var(--ligne);
  border-radius: 50%;
  background: rgba(10, 22, 18, 0.82);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  color: var(--or);
  cursor: pointer;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.35);
}
.son__barres {
  display: flex;
  align-items: flex-end;
  gap: 3px;
  height: 20px;
}
.son__barres i {
  display: block;
  width: 4px;
  height: 100%;
  border-radius: 2px;
  background: currentColor;
  transform-origin: bottom;
  animation: egaliseur 0.9s ease-in-out infinite alternate;
}
.son__barres i:nth-child(2) { animation-delay: -0.3s; }
.son__barres i:nth-child(3) { animation-delay: -0.6s; }
.son__barres i:nth-child(4) { animation-delay: -0.15s; }
.son--coupe { color: var(--doux); }
.son--coupe .son__barres i { animation: none; transform: scaleY(0.2); }
.son--coupe::after {
  content: '';
  position: absolute;
  width: 30px;
  height: 2px;
  background: var(--doux);
  transform: rotate(-45deg);
  border-radius: 2px;
}

@keyframes egaliseur {
  from { transform: scaleY(0.25); }
  to { transform: scaleY(1); }
}

/* ---------- Hero ---------- */
.hero {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  min-height: 100svh;
  padding: 96px 16px clamp(150px, 20vw, 260px);
  overflow: hidden;
  text-align: center;
  background:
    radial-gradient(ellipse 70% 45% at 50% 0%, rgba(230, 192, 104, 0.14), transparent 70%),
    linear-gradient(180deg, #0b1d31 0%, #0d2a2b 55%, var(--fond) 100%);
}

.lune {
  position: absolute;
  top: clamp(40px, 8vw, 80px);
  right: clamp(24px, 10vw, 140px);
  width: clamp(54px, 9vw, 96px);
  aspect-ratio: 1;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #fffaf0, #f3e3bd 60%, #e2c98c);
  box-shadow: 0 0 40px 10px rgba(246, 230, 190, 0.25), 0 0 120px 40px rgba(246, 230, 190, 0.1);
  opacity: 0.9;
}

.sur-titre {
  position: relative;
  margin: 0 0 10px;
  color: var(--or);
  font-weight: 800;
  font-size: 0.85rem;
  letter-spacing: 0.26em;
  text-transform: uppercase;
}

.titre {
  position: relative;
  margin: 0;
  font: 800 clamp(2.9rem, 10.5vw, 6.4rem)/0.98 var(--police-titre);
  letter-spacing: -0.02em;
  text-wrap: balance;
}
.titre em {
  display: block;
  font-style: italic;
  font-weight: 600;
  background: linear-gradient(180deg, #f7dd9a 10%, #d3a24a 90%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  padding-bottom: 0.08em;
}

.accroche {
  position: relative;
  max-width: 600px;
  margin: 24px auto 0;
  color: var(--doux);
  font-size: clamp(1.05rem, 2.6vw, 1.2rem);
  text-wrap: pretty;
}
.accroche strong { color: var(--creme); }

.compte {
  position: relative;
  display: flex;
  justify-content: center;
  gap: 10px;
  margin: 32px 0 36px;
}
.compte__bloc {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 70px;
  padding: 12px 8px 10px;
  border: 1px solid var(--ligne);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.045);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}
.compte__nombre {
  font: 700 clamp(1.6rem, 6vw, 2.3rem)/1 var(--police-titre);
  color: var(--or);
  font-variant-numeric: tabular-nums;
}
.compte__unite {
  margin-top: 6px;
  color: var(--doux);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}
.compte__message {
  margin: 0;
  font: italic 700 clamp(1.6rem, 5vw, 2.2rem)/1.2 var(--police-titre);
  color: var(--or);
}

.sapins {
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px;
  width: 100%;
  height: clamp(120px, 15vw, 240px);
}
.sapins .arriere { fill: #12332a; }
.sapins .avant { fill: var(--fond); }

/* ---------- Sections ---------- */
.section {
  position: relative;
  max-width: 1080px;
  margin: 0 auto;
  padding: 72px 16px;
}
.section__titre {
  margin: 0 0 36px;
  text-align: center;
  font: 700 clamp(2rem, 5.5vw, 3rem)/1.1 var(--police-titre);
  text-wrap: balance;
}
.section__titre::before {
  content: '✦';
  display: block;
  margin-bottom: 10px;
  color: var(--or);
  font-size: 1rem;
  letter-spacing: 0.6em;
}

/* Infos pratiques */
.cartes {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 14px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.carte {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 26px 16px 24px;
  border: 1px solid var(--ligne);
  border-radius: var(--rayon);
  background: linear-gradient(160deg, rgba(255, 255, 255, 0.065), rgba(255, 255, 255, 0.02));
  text-align: center;
  transition: transform 0.25s ease, border-color 0.25s ease;
}
.carte:hover { transform: translateY(-4px); border-color: rgba(230, 192, 104, 0.45); }
.carte__icone { font-size: 2rem; line-height: 1; margin-bottom: 8px; }
.carte__label {
  color: var(--doux);
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}
.carte__valeur {
  font: 700 clamp(1.25rem, 3.4vw, 1.6rem)/1.2 var(--police-titre);
  color: var(--creme);
}
.carte__lien {
  margin-top: 6px;
  color: var(--or);
  font-size: 0.9rem;
  font-weight: 700;
  text-decoration: none;
}
.carte__lien:hover { text-decoration: underline; }

/* Mot du lutin */
.mot { padding-top: 24px; }
.mot__carte {
  position: relative;
  max-width: 760px;
  margin: 0 auto;
  padding: clamp(28px, 6vw, 52px);
  border: 1px solid var(--ligne);
  border-radius: 28px;
  background:
    radial-gradient(circle at 100% 0%, rgba(198, 47, 62, 0.18), transparent 50%),
    radial-gradient(circle at 0% 100%, rgba(31, 107, 74, 0.25), transparent 55%),
    var(--fond-clair);
  box-shadow: 0 30px 60px rgba(0, 0, 0, 0.3);
}
.mot__carte::before {
  content: '';
  position: absolute;
  inset: 8px;
  border: 1px dashed rgba(230, 192, 104, 0.18);
  border-radius: 22px;
  pointer-events: none;
}
.mot__titre {
  margin: 0 0 18px;
  font: italic 700 clamp(1.6rem, 4.5vw, 2.2rem)/1.15 var(--police-titre);
  color: var(--or);
}
.mot__carte p { margin: 0 0 14px; text-wrap: pretty; }
.mot__signature {
  margin-top: 22px !important;
  font: italic 600 1.15rem var(--police-titre);
  color: var(--doux);
  text-align: right;
}

/* ---------- Tirage ---------- */
.etapes {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px 26px;
  margin: -12px 0 44px;
  padding: 0;
  list-style: none;
  color: var(--doux);
  font-weight: 700;
}
.etapes li { display: flex; align-items: center; gap: 10px; }
.etapes span {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--or);
  color: #2a1a05;
  font-weight: 800;
  font-size: 0.95rem;
}

.tirage__grille {
  display: grid;
  grid-template-columns: 1fr;
  grid-template-areas: "choix" "roue" "action";
  gap: 28px;
  align-items: center;
}
.tirage__choix { grid-area: choix; }
.tirage__roue { grid-area: roue; display: flex; justify-content: center; }
.tirage__action { grid-area: action; display: flex; justify-content: center; }

@media (min-width: 860px) {
  .tirage__grille {
    grid-template-columns: 1fr 1.1fr;
    grid-template-areas: "choix roue" "action roue";
    column-gap: 56px;
    row-gap: 24px;
  }
  .tirage__choix { align-self: end; }
  .tirage__action { align-self: start; justify-content: flex-start; }
}

.tirage__question {
  margin: 0 0 14px;
  font: 700 1.4rem/1.2 var(--police-titre);
  text-align: center;
}
@media (min-width: 860px) { .tirage__question { text-align: left; } }

.prenoms {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(122px, 1fr));
  gap: 10px;
}
.prenom {
  padding: 13px 10px;
  border: 1px solid var(--ligne);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.045);
  color: var(--creme);
  font: 700 1rem/1.2 var(--police-texte);
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease, transform 0.15s ease, box-shadow 0.2s ease;
}
.prenom:hover:not(:disabled) { border-color: var(--or); transform: translateY(-1px); }
.prenom[aria-pressed="true"] {
  background: var(--or);
  border-color: var(--or);
  color: #2a1a05;
  box-shadow: 0 0 0 4px rgba(230, 192, 104, 0.22);
}
.prenom:disabled { cursor: wait; opacity: 0.6; }
.prenom[aria-pressed="true"]:disabled { opacity: 1; }

.tirage__salut {
  min-height: 1.65em;
  margin: 16px 0 0;
  color: var(--doux);
  text-align: center;
}
@media (min-width: 860px) { .tirage__salut { text-align: left; } }

/* Roue */
.roue {
  position: relative;
  width: min(86vw, 420px);
  aspect-ratio: 1;
}
.roue__disque {
  display: block;
  width: 100%;
  height: 100%;
  transform-origin: 50% 50%;
  will-change: transform;
  filter: drop-shadow(0 24px 40px rgba(0, 0, 0, 0.55));
}
.roue__nom {
  font: 700 19px var(--police-titre);
  text-anchor: middle;
  dominant-baseline: central;
}
.roue__pointeur {
  position: absolute;
  top: -6%;
  left: 50%;
  z-index: 2;
  width: 12%;
  transform: translateX(-50%);
  transform-origin: 50% 25%;
  filter: drop-shadow(0 6px 6px rgba(0, 0, 0, 0.45));
}
.roue__centre {
  position: absolute;
  top: 50%;
  left: 50%;
  z-index: 2;
  display: grid;
  place-items: center;
  width: 19%;
  aspect-ratio: 1;
  border: 4px solid var(--rouge-fonce);
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #fbe6ac, #d3a24a 70%);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.45), inset 0 2px 0 rgba(255, 255, 255, 0.5);
  font-size: clamp(1.4rem, 5vw, 2rem);
  transform: translate(-50%, -50%);
}

.lumiere { animation: clignote 1.3s ease-in-out infinite alternate; }
.lumiere:nth-child(even) { animation-delay: -0.65s; }
.roue--tourne .lumiere { animation-duration: 0.22s; }

@keyframes clignote {
  from { fill: #fff3cf; }
  to { fill: #7a5a1e; }
}

/* ---------- Révélation ---------- */
.revelation {
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  max-width: none;
  max-height: none;
  margin: 0;
  padding: 16px;
  border: 0;
  background: transparent;
  color: var(--creme);
  overflow: hidden;
}
.revelation[open] { display: grid; place-items: center; }
.revelation::backdrop {
  background: rgba(4, 10, 8, 0.8);
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
}
.revelation canvas {
  position: absolute;
  inset: 0;
  z-index: 2;
  width: 100%;
  height: 100%;
  pointer-events: none;
}
.revelation__carte {
  position: relative;
  z-index: 1;
  width: min(100%, 440px);
  padding: 40px 28px 32px;
  border: 1px solid var(--or);
  border-radius: 28px;
  text-align: center;
  background:
    radial-gradient(circle at 50% 0%, rgba(230, 192, 104, 0.25), transparent 60%),
    linear-gradient(180deg, #173a30, #0d211b);
  box-shadow: 0 40px 80px rgba(0, 0, 0, 0.6), 0 0 0 8px rgba(230, 192, 104, 0.08);
  animation: apparition 0.7s cubic-bezier(0.2, 1.3, 0.4, 1);
}
.revelation__intro {
  margin: 0;
  color: var(--doux);
  font-weight: 700;
  letter-spacing: 0.04em;
}
.revelation__nom {
  margin: 6px 0 12px;
  font: italic 800 clamp(3rem, 14vw, 4.4rem)/1.05 var(--police-titre);
  background: linear-gradient(180deg, #f7dd9a 10%, #d3a24a 90%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  padding-bottom: 0.06em;
}
.revelation__texte { margin: 0 0 18px; text-wrap: pretty; }
.revelation__rappel {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin: 0 0 26px;
  padding: 0;
  list-style: none;
}
.revelation__rappel li {
  padding: 6px 12px;
  border: 1px solid var(--ligne);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.05);
  font-size: 0.9rem;
  font-weight: 700;
}

@keyframes apparition {
  from { opacity: 0; transform: scale(0.7) rotate(-4deg); }
  to { opacity: 1; transform: scale(1) rotate(0deg); }
}

/* ---------- Pied de page ---------- */
.pied {
  padding: 40px 16px calc(48px + env(safe-area-inset-bottom, 0px));
  border-top: 1px solid rgba(230, 192, 104, 0.12);
  color: var(--doux);
  font-size: 0.9rem;
  text-align: center;
}
.pied p { margin: 0; }

@media (prefers-reduced-motion: reduce) {
  .cadeau, .lumiere, .son__barres i { animation: none !important; }
  .revelation__carte { animation: none; }
}
