/* =========================================================
   Theme "After Hours" — nuit profonde, neon rose, or des bougies
   ========================================================= */
:root {
  --nuit:      #0b0e1a;
  --nuit-2:    #141a2e;
  --nuit-3:    #1d2540;
  --rose:      #ff3d6e;
  --rose-soft: #ff6f92;
  --or:        #f5c56b;
  --or-soft:   #ffe3a8;
  --brume:     #c9d2f0;
  --blanc:     #fdf7f4;

  --display: "Cormorant Garamond", Georgia, serif;
  --body:    "Space Grotesk", system-ui, sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body { height: 100%; }

body {
  font-family: var(--body);
  color: var(--brume);
  background:
    radial-gradient(120% 80% at 50% -10%, #2a1030 0%, transparent 55%),
    radial-gradient(90% 60% at 80% 110%, #10203f 0%, transparent 50%),
    var(--nuit);
  overflow-x: hidden;
  -webkit-tap-highlight-color: transparent;
}

/* --- Structure des scenes --- */
main { min-height: 100dvh; }

.scene {
  min-height: 100dvh;
  width: 100%;
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: clamp(1.5rem, 5vw, 4rem);
  animation: sceneIn 0.9s ease both;
}
.scene.is-active { display: flex; }

@keyframes sceneIn {
  from { opacity: 0; transform: translateY(18px); }
  to   { opacity: 1; transform: none; }
}

/* --- Typo --- */
.eyebrow {
  font-family: var(--body);
  text-transform: uppercase;
  letter-spacing: 0.42em;
  font-size: 0.72rem;
  font-weight: 500;
  color: var(--rose-soft);
  margin-bottom: 1.4rem;
  padding-left: 0.42em;
}
h1, h2 {
  font-family: var(--display);
  font-weight: 500;
  line-height: 1.02;
  color: var(--blanc);
  letter-spacing: -0.01em;
}
h1 { font-size: clamp(2.8rem, 11vw, 6.5rem); }
h2 { font-size: clamp(2rem, 7vw, 3.6rem); }
h1 em, h2 em {
  font-style: italic;
  color: var(--rose);
  text-shadow: 0 0 34px rgba(255, 61, 110, 0.55);
}
.lede {
  max-width: 30ch;
  margin: 1.6rem auto 0;
  font-size: clamp(1rem, 2.6vw, 1.2rem);
  color: var(--brume);
  line-height: 1.5;
}

/* --- Bouton --- */
.btn {
  appearance: none;
  border: 0;
  cursor: pointer;
  font-family: var(--body);
  font-weight: 500;
  font-size: 1rem;
  letter-spacing: 0.04em;
  color: var(--blanc);
  background: linear-gradient(120deg, var(--rose), #d81f52);
  padding: 0.95rem 2.4rem;
  border-radius: 999px;
  box-shadow: 0 12px 40px -12px rgba(255, 61, 110, 0.7);
  transition: transform 0.2s ease, box-shadow 0.2s ease, opacity 0.3s ease;
}
.btn:hover  { transform: translateY(-2px); box-shadow: 0 18px 48px -12px rgba(255, 61, 110, 0.85); }
.btn:active { transform: translateY(0); }
.btn:focus-visible { outline: 2px solid var(--or-soft); outline-offset: 4px; }
.btn.ghost {
  background: transparent;
  border: 1px solid rgba(201, 210, 240, 0.35);
  box-shadow: none;
  color: var(--brume);
}
.next-wrap { margin-top: clamp(2rem, 6vh, 3.5rem); min-height: 3.4rem; }

/* =========================================================
   VERROU / COMPTE A REBOURS
   ========================================================= */
.countdown {
  display: flex;
  gap: clamp(0.6rem, 3vw, 1.6rem);
  margin-top: 2.4rem;
}
.cd-unit { min-width: 4.5rem; }
.cd-num {
  font-family: var(--body);
  font-weight: 700;
  font-size: clamp(2.4rem, 9vw, 4rem);
  color: var(--blanc);
  font-variant-numeric: tabular-nums;
  text-shadow: 0 0 26px rgba(201, 210, 240, 0.25);
}
.cd-label {
  text-transform: uppercase;
  letter-spacing: 0.2em;
  font-size: 0.62rem;
  color: var(--rose-soft);
  margin-top: 0.5rem;
}
.moon {
  width: 76px; height: 76px; border-radius: 50%;
  margin-bottom: 2rem;
  background: radial-gradient(circle at 35% 32%, #fff 0%, #e7ecff 30%, #9fb0e6 75%, #6b7bb0 100%);
  box-shadow: 0 0 60px 8px rgba(159, 176, 230, 0.35);
  animation: floaty 6s ease-in-out infinite;
}
@keyframes floaty { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-10px); } }

/* =========================================================
   GATEAU / BOUGIES
   ========================================================= */
.cake-stage { margin: 2.4rem 0 1rem; }
.candles {
  display: flex;
  justify-content: center;
  align-items: flex-end;
  gap: clamp(0.5rem, 3vw, 1.3rem);
  flex-wrap: wrap;
  max-width: 620px;
}
.candle {
  position: relative;
  width: 16px;
  height: 78px;
  border-radius: 4px;
  background: repeating-linear-gradient(45deg, #ff6f92 0 6px, #ffa7bd 6px 12px);
  cursor: pointer;
  transition: filter 0.3s ease, opacity 0.5s ease;
}
.flame {
  position: absolute;
  top: -26px; left: 50%;
  width: 16px; height: 26px;
  transform: translateX(-50%);
  border-radius: 50% 50% 50% 50% / 60% 60% 40% 40%;
  background: radial-gradient(circle at 50% 70%, #fff6d6 0%, var(--or-soft) 30%, var(--or) 55%, #ff7a3d 100%);
  box-shadow: 0 0 22px 6px rgba(245, 197, 107, 0.75);
  transform-origin: bottom center;
  animation: flicker 0.16s infinite alternate;
}
@keyframes flicker {
  from { transform: translateX(-50%) scale(1) rotate(-2deg); opacity: 0.92; }
  to   { transform: translateX(-50%) scale(1.08) rotate(2deg); opacity: 1; }
}
.candle.out .flame { display: none; }
.candle.out {
  filter: grayscale(0.5) brightness(0.7);
  opacity: 0.55;
}
.candle.out::after {
  content: "";
  position: absolute;
  top: -18px; left: 50%;
  width: 3px; height: 16px;
  transform: translateX(-50%);
  background: linear-gradient(#8a8aa0, transparent);
  opacity: 0.6;
  animation: smoke 1.6s ease-out forwards;
}
@keyframes smoke {
  to { transform: translateX(-50%) translateY(-14px); opacity: 0; }
}

.blow-hint {
  margin-top: 1.8rem;
  font-size: 0.95rem;
  color: var(--brume);
}
.mic-meter {
  width: 180px; height: 6px;
  margin: 0.9rem auto 0;
  border-radius: 999px;
  background: rgba(201, 210, 240, 0.15);
  overflow: hidden;
}
.mic-meter span {
  display: block; height: 100%; width: 0%;
  background: linear-gradient(90deg, var(--or), var(--rose));
  transition: width 0.08s linear;
}

/* Messages reveles par les bougies */
.messages {
  display: grid;
  gap: 0.9rem;
  max-width: 540px;
  margin: 2rem auto 0;
}
.msg-card {
  font-family: var(--display);
  font-size: clamp(1.15rem, 3.4vw, 1.5rem);
  font-style: italic;
  color: var(--or-soft);
  background: rgba(29, 37, 64, 0.55);
  border: 1px solid rgba(245, 197, 107, 0.25);
  border-radius: 14px;
  padding: 1rem 1.3rem;
  opacity: 0;
  transform: translateY(12px);
  animation: cardIn 0.6s ease forwards;
}
@keyframes cardIn { to { opacity: 1; transform: none; } }

/* =========================================================
   RETROSPECTIVE
   ========================================================= */
.retro {
  width: 100%;
  max-width: 620px;
  display: flex;
  flex-direction: column;
  gap: clamp(3rem, 12vh, 7rem);
  padding: 14vh 0 8vh;
}
.retro-item {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.9s ease, transform 0.9s ease;
}
.retro-item.reveal { opacity: 1; transform: none; }
.retro-item img {
  width: 100%;
  border-radius: 16px;
  display: block;
  box-shadow: 0 30px 60px -24px rgba(0, 0, 0, 0.8);
  border: 1px solid rgba(201, 210, 240, 0.12);
}
.retro-item figcaption {
  font-family: var(--display);
  font-style: italic;
  font-size: clamp(1.2rem, 4vw, 1.7rem);
  color: var(--blanc);
  margin-top: 1.1rem;
  line-height: 1.35;
}
.retro-item.no-photo figcaption {
  font-size: clamp(1.5rem, 5.5vw, 2.4rem);
  color: var(--rose-soft);
}

/* =========================================================
   ENIGMES
   ========================================================= */
.riddle {
  max-width: 480px;
  width: 100%;
}
.riddle p.q {
  font-family: var(--display);
  font-size: clamp(1.5rem, 5vw, 2.2rem);
  color: var(--blanc);
  margin-bottom: 1.6rem;
  line-height: 1.25;
}
.riddle input {
  width: 100%;
  font-family: var(--body);
  font-size: 1.1rem;
  color: var(--blanc);
  text-align: center;
  background: rgba(29, 37, 64, 0.6);
  border: 1px solid rgba(201, 210, 240, 0.25);
  border-radius: 12px;
  padding: 0.9rem 1rem;
  margin-bottom: 1rem;
}
.riddle input:focus { outline: none; border-color: var(--rose); }
.riddle .feedback { min-height: 1.4rem; font-size: 0.95rem; margin-top: 0.8rem; }
.riddle .feedback.err { color: var(--rose-soft); }
.riddle .feedback.ok  { color: var(--or); }
.riddle .indice { margin-top: 0.6rem; font-size: 0.85rem; color: var(--brume); opacity: 0.75; }
.progress-dots { display: flex; gap: 0.5rem; justify-content: center; margin-bottom: 2rem; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: rgba(201,210,240,0.25); }
.dot.done { background: var(--rose); }

/* =========================================================
   CADEAU
   ========================================================= */
.gift-box {
  width: clamp(140px, 40vw, 200px);
  aspect-ratio: 1;
  margin: 2rem auto;
  position: relative;
  cursor: pointer;
  border-radius: 12px;
  background: linear-gradient(145deg, var(--nuit-3), var(--nuit-2));
  border: 1px solid rgba(245, 197, 107, 0.3);
  box-shadow: 0 24px 60px -20px rgba(0,0,0,0.8);
  display: grid; place-items: center;
  transition: transform 0.3s ease;
}
.gift-box:hover { transform: translateY(-4px) rotate(-1deg); }
.gift-box::before,
.gift-box::after {
  content: ""; position: absolute; background: var(--rose);
  box-shadow: 0 0 18px rgba(255,61,110,0.5);
}
.gift-box::before { left: 50%; top: 0; width: 14px; height: 100%; transform: translateX(-50%); }
.gift-box::after  { top: 50%; left: 0; height: 14px; width: 100%; transform: translateY(-50%); }
.gift-tap {
  position: relative; z-index: 2;
  font-family: var(--body); font-size: 0.8rem; letter-spacing: 0.15em;
  text-transform: uppercase; color: var(--or-soft);
}
.gift-box.open { animation: pop 0.5s ease forwards; }
@keyframes pop {
  40% { transform: scale(1.12); }
  100% { transform: scale(0.6); opacity: 0; }
}
.gift-reveal {
  display: none;
  animation: sceneIn 0.9s ease both;
}
.gift-reveal.show { display: block; }
.gift-reveal .big {
  font-family: var(--display);
  font-size: clamp(2rem, 8vw, 4rem);
  color: var(--rose);
  text-shadow: 0 0 40px rgba(255,61,110,0.5);
  line-height: 1.1;
}
.gift-reveal .sub {
  margin-top: 1.4rem; font-size: 1.05rem; color: var(--brume);
  max-width: 34ch; margin-left: auto; margin-right: auto; line-height: 1.5;
}

/* =========================================================
   Divers
   ========================================================= */
.confetti-layer {
  position: fixed; inset: 0; width: 100%; height: 100%;
  pointer-events: none; z-index: 50;
}
.sound-toggle {
  position: fixed; top: 14px; right: 14px; z-index: 60;
  width: 42px; height: 42px; border-radius: 50%;
  border: 1px solid rgba(201,210,240,0.25);
  background: rgba(20,26,46,0.7); color: var(--brume);
  font-size: 1.1rem; cursor: pointer; backdrop-filter: blur(6px);
}
.sound-toggle.muted { opacity: 0.5; }

.tiny { font-size: 0.8rem; color: var(--brume); opacity: 0.6; margin-top: 1.2rem; }

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