:root {
  --pink: #ff6fa5;
  --pink-light: #ffc2d9;
  --purple: #6a4c93;
  --purple-deep: #2d1b4e;
  --gold: #ffd166;
  --text: #fff5f8;
}

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

html { scroll-behavior: smooth; }

body {
  font-family: 'Quicksand', sans-serif;
  background: linear-gradient(160deg, #1a0f2e 0%, #2d1b4e 40%, #4a2c5e 70%, #7a3b5e 100%);
  color: var(--text);
  min-height: 100vh;
  overflow-x: hidden;
  position: relative;
}

h1, h2, h3 { font-family: 'Playfair Display', serif; }

#stars-canvas {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  z-index: 0;
  pointer-events: none;
}

#petals-canvas {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  z-index: 2;
  pointer-events: none;
}

.screen {
  position: relative;
  min-height: 100vh;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 60px 20px;
  z-index: 1;
}

.hidden { display: none !important; }

/* ---------- GATE ---------- */
.gate-content {
  text-align: center;
  max-width: 600px;
  animation: fadeUp 1.2s ease;
}
.gate-heart {
  font-size: 4rem;
  animation: pulse 2s infinite ease-in-out;
}
.gate-content h1 {
  font-size: 3rem;
  margin: 20px 0 10px;
  color: var(--pink-light);
  text-shadow: 0 0 30px rgba(255,111,165,0.5);
}
.gate-sub {
  font-size: 1.1rem;
  opacity: 0.85;
  margin-bottom: 35px;
  line-height: 1.6;
}

.btn-main, .btn-next, .btn-music {
  background: linear-gradient(135deg, var(--pink), #c86bff);
  color: white;
  border: none;
  padding: 16px 34px;
  font-size: 1.05rem;
  font-weight: 600;
  border-radius: 50px;
  cursor: pointer;
  box-shadow: 0 8px 25px rgba(255,111,165,0.4);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
  font-family: 'Quicksand', sans-serif;
}
.btn-main:hover, .btn-next:hover, .btn-music:hover {
  transform: translateY(-3px) scale(1.03);
  box-shadow: 0 12px 30px rgba(255,111,165,0.55);
}

/* ---------- CHAPTERS ---------- */
.chapter-inner {
  max-width: 700px;
  width: 100%;
  text-align: center;
}
.chapter-inner.wide { max-width: 1100px; }

.chapter-tag {
  letter-spacing: 3px;
  text-transform: uppercase;
  font-size: 0.85rem;
  color: var(--gold);
  margin-bottom: 10px;
  opacity: 0.9;
}
.chapter h2 {
  font-size: 2.3rem;
  margin-bottom: 20px;
  color: var(--pink-light);
}
.chapter-caption {
  font-size: 1.05rem;
  opacity: 0.85;
  margin: 20px auto;
  max-width: 500px;
  line-height: 1.6;
}
.btn-next { margin-top: 40px; }

/* ---------- COUNTER ---------- */
.counter-grid {
  display: flex;
  justify-content: center;
  gap: 18px;
  flex-wrap: wrap;
  margin: 30px 0;
}
.counter-box {
  background: rgba(255,255,255,0.08);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 18px;
  padding: 22px 20px;
  min-width: 100px;
}
.counter-box span {
  display: block;
  font-size: 2.4rem;
  font-weight: 700;
  color: var(--gold);
  font-family: 'Playfair Display', serif;
}
.counter-box label {
  font-size: 0.85rem;
  opacity: 0.75;
  text-transform: uppercase;
  letter-spacing: 1px;
}

/* ---------- TIMELINE ---------- */
.timeline {
  display: flex;
  flex-direction: column;
  gap: 40px;
  margin: 30px 0;
}
.timeline-item {
  display: flex;
  align-items: center;
  gap: 30px;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 20px;
  padding: 20px;
  opacity: 0;
  transform: translateY(40px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}
.timeline-item.visible { opacity: 1; transform: translateY(0); }
.timeline-item:nth-child(even) { flex-direction: row-reverse; }
.timeline-item img {
  width: 260px;
  height: 260px;
  object-fit: cover;
  border-radius: 16px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.4);
  flex-shrink: 0;
}
.timeline-text { text-align: left; }
.timeline-date {
  display: inline-block;
  color: var(--gold);
  font-weight: 700;
  margin-bottom: 8px;
  font-size: 0.95rem;
}
.timeline-text p { line-height: 1.6; opacity: 0.9; }

@media (max-width: 700px) {
  .timeline-item, .timeline-item:nth-child(even) { flex-direction: column; }
  .timeline-item img { width: 100%; height: 220px; }
  .timeline-text { text-align: center; }
}

/* ---------- CARTE ---------- */
#map {
  width: 100%;
  height: 480px;
  border-radius: 20px;
  margin: 30px 0;
  border: 1px solid rgba(255,255,255,0.15);
  box-shadow: 0 10px 30px rgba(0,0,0,0.4);
  z-index: 1;
}
.leaflet-popup-content-wrapper {
  background: rgba(30, 15, 45, 0.95);
  color: var(--text);
  border-radius: 14px;
}
.leaflet-popup-content { font-family: 'Quicksand', sans-serif; margin: 12px 16px; }
.leaflet-popup-tip { background: rgba(30, 15, 45, 0.95); }
.leaflet-popup-content b { color: var(--gold); }
@media (max-width: 700px) {
  #map { height: 350px; }
}

/* ---------- QUIZ ---------- */
#quiz-box { margin-top: 20px; }
.quiz-question { display: none; }
.quiz-question.active { display: block; animation: fadeUp 0.5s ease; }
.quiz-question h3 { font-size: 1.4rem; margin-bottom: 25px; color: var(--text); }
.quiz-options {
  display: flex;
  flex-direction: column;
  gap: 14px;
  max-width: 420px;
  margin: 0 auto;
}
.quiz-opt {
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.2);
  color: var(--text);
  padding: 14px 20px;
  border-radius: 14px;
  cursor: pointer;
  font-size: 1rem;
  font-family: 'Quicksand', sans-serif;
  transition: background 0.25s ease, transform 0.2s ease;
}
.quiz-opt:hover { background: rgba(255,111,165,0.25); transform: translateY(-2px); }
.quiz-opt.correct { background: rgba(120, 220, 150, 0.35); border-color: #7ee89a; }
.quiz-opt.wrong { background: rgba(255, 90, 90, 0.3); border-color: #ff7a7a; }
#quiz-feedback { margin-top: 25px; font-size: 1.1rem; min-height: 30px; color: var(--gold); }

/* ---------- FINAL ---------- */
#confetti-canvas {
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  pointer-events: none;
  z-index: 0;
}
.final-inner { position: relative; z-index: 1; max-width: 650px; }
.final-heart {
  font-size: 3.5rem;
  animation: pulse 1.8s infinite ease-in-out;
}
.final-title {
  font-size: 2.6rem;
  color: var(--pink-light);
  margin: 15px 0 30px;
}
.letter {
  background: rgba(255,255,255,0.07);
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 22px;
  padding: 35px 30px;
  text-align: left;
  line-height: 1.9;
  font-size: 1.08rem;
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 1s ease, transform 1s ease;
}
.letter.visible { opacity: 1; transform: translateY(0); }
.letter p { margin-bottom: 18px; }
.letter-signature {
  font-family: 'Playfair Display', serif;
  font-style: italic;
  font-size: 1.2rem;
  color: var(--gold);
  margin-top: 10px;
}

/* ---------- WIDGET MUSIQUE FLOTTANT ---------- */
#music-widget {
  position: fixed;
  bottom: 18px;
  right: 18px;
  z-index: 50;
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(20, 10, 35, 0.7);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 50px;
  padding: 8px 16px;
  font-size: 0.85rem;
  opacity: 0.9;
  transition: opacity 0.3s ease;
}
#music-widget:hover { opacity: 1; }
#music-note {
  display: inline-block;
  animation: pulse 1.4s infinite ease-in-out;
}
#music-label { opacity: 0.75; white-space: nowrap; }
.btn-music-mini {
  background: linear-gradient(135deg, var(--pink), #c86bff);
  color: white;
  border: none;
  padding: 6px 14px;
  font-size: 0.8rem;
  border-radius: 30px;
  cursor: pointer;
  font-family: 'Quicksand', sans-serif;
}
.btn-music-mini.playing { display: none; }

@media (max-width: 600px) {
  #music-widget { right: 10px; left: 10px; justify-content: center; bottom: 10px; }
  #music-label { display: none; }
}

/* ---------- ANIMATIONS ---------- */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(25px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.15); }
}

/* ---------- CITATION GRAND-MERE ---------- */
.letter-quote {
  font-style: italic;
  border-left: 3px solid var(--gold);
  padding-left: 16px;
  margin: 24px 0;
  opacity: 0.92;
}
.letter-quote em {
  display: block;
  margin-top: 8px;
  font-size: 0.9rem;
  color: var(--gold);
}
