/* =========================================================
   SOPHIE ❤️  – Love Website  |  Shared Stylesheet
   Romantic · Glassmorphism · Mobile First
   ========================================================= */

@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:ital,wght@0,400;0,600;0,700;1,500&family=Poppins:wght@300;400;500;600&display=swap');

:root {
  --red:        #e11d2a;
  --red-deep:   #8e0d18;
  --red-dark:   #4a0710;
  --rose:       #ff5d8f;
  --rose-soft:  #ffb3c9;
  --pink-light: #ffe3ec;
  --white-soft: #fff6f8;
  --glass:      rgba(255, 255, 255, 0.10);
  --glass-brd:  rgba(255, 255, 255, 0.25);
  --shadow:     0 12px 40px rgba(74, 7, 16, 0.45);
  --glow:       0 0 25px rgba(255, 93, 143, 0.55);
  --font-head:  'Playfair Display', serif;
  --font-body:  'Poppins', sans-serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-body);
  color: var(--white-soft);
  min-height: 100vh;
  overflow-x: hidden;
  background:
    radial-gradient(ellipse at top, #6e0b18 0%, transparent 60%),
    radial-gradient(ellipse at bottom, #2c0509 0%, transparent 55%),
    linear-gradient(160deg, #4a0710 0%, #7a0c1c 45%, #c01428 100%);
  background-attachment: fixed;
  position: relative;
}

/* Floating hearts canvas / container sits behind everything */
#hearts-bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}

.floating-heart {
  position: absolute;
  bottom: -40px;
  color: var(--rose-soft);
  opacity: 0;
  animation: floatUp linear forwards;
  filter: drop-shadow(0 0 6px rgba(255, 93, 143, 0.7));
  user-select: none;
}

@keyframes floatUp {
  0%   { transform: translateY(0) scale(0.6) rotate(0deg);   opacity: 0; }
  10%  { opacity: 0.9; }
  90%  { opacity: 0.7; }
  100% { transform: translateY(-110vh) scale(1.1) rotate(40deg); opacity: 0; }
}

/* Pulsing background hearts (landing) */
.pulse-heart {
  position: absolute;
  color: rgba(255, 93, 143, 0.18);
  animation: pulseHeart ease-in-out infinite;
  user-select: none;
}
@keyframes pulseHeart {
  0%, 100% { transform: scale(0.85); opacity: 0.25; }
  50%      { transform: scale(1.15); opacity: 0.55; }
}

/* ---------- Layout helpers ---------- */
.page {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  padding: 90px 20px 120px;
  max-width: 760px;
  margin: 0 auto;
  animation: pageFade 0.8s ease both;
}
@keyframes pageFade {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}

.center { text-align: center; }

h1, h2, h3 { font-family: var(--font-head); font-weight: 700; line-height: 1.15; }

.title {
  font-size: clamp(2rem, 8vw, 3.4rem);
  background: linear-gradient(90deg, #fff, var(--rose-soft), #fff);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  text-shadow: 0 2px 30px rgba(255, 93, 143, 0.4);
  margin-bottom: 14px;
}
.subtitle {
  font-family: var(--font-body);
  font-weight: 300;
  font-size: clamp(0.95rem, 4vw, 1.15rem);
  color: var(--rose-soft);
  margin-bottom: 30px;
}

/* ---------- Glass cards ---------- */
.glass {
  background: var(--glass);
  backdrop-filter: blur(14px) saturate(140%);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  border: 1px solid var(--glass-brd);
  border-radius: 22px;
  box-shadow: var(--shadow);
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  font-family: var(--font-body);
  font-weight: 500;
  font-size: 1.05rem;
  color: #fff;
  padding: 16px 30px;
  min-height: 56px;
  border: none;
  border-radius: 50px;
  cursor: pointer;
  background: linear-gradient(135deg, var(--rose), var(--red));
  box-shadow: var(--glow), 0 8px 20px rgba(142, 13, 24, 0.5);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  text-decoration: none;
  -webkit-user-select: none;
  user-select: none;
}
.btn:active { transform: scale(0.95); }
.btn:hover  { box-shadow: 0 0 35px rgba(255, 93, 143, 0.8), 0 10px 26px rgba(142, 13, 24, 0.6); }
.btn.ghost {
  background: var(--glass);
  border: 1px solid var(--glass-brd);
  backdrop-filter: blur(8px);
  box-shadow: none;
}

/* ---------- Top navigation bar ---------- */
.topbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  background: rgba(74, 7, 16, 0.45);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--glass-brd);
}
.topbar a.back {
  color: #fff;
  text-decoration: none;
  font-size: 0.95rem;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: 40px;
  background: var(--glass);
  border: 1px solid var(--glass-brd);
}
.topbar .brand {
  font-family: var(--font-head);
  font-size: 1.05rem;
  letter-spacing: 1px;
}

/* Music button */
.music-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border-radius: 40px;
  font-size: 0.85rem;
  cursor: pointer;
  color: #fff;
  background: linear-gradient(135deg, var(--rose), var(--red));
  border: none;
  box-shadow: var(--glow);
}
.music-btn.playing .ic { animation: spin 3s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* =========================================================
   LANDING / PASSWORD
   ========================================================= */
.landing {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  min-height: 100vh;
  padding: 30px 22px;
  position: relative;
  z-index: 1;
}
.lock-card {
  padding: 40px 28px;
  max-width: 420px;
  width: 100%;
}
.pw-input {
  width: 100%;
  font-family: var(--font-body);
  font-size: 1.4rem;
  letter-spacing: 6px;
  text-align: center;
  color: #fff;
  padding: 16px;
  margin: 22px 0 16px;
  border-radius: 16px;
  border: 1px solid var(--glass-brd);
  background: rgba(0,0,0,0.2);
  outline: none;
}
.pw-input::placeholder { color: rgba(255,255,255,0.4); letter-spacing: 2px; }
.pw-input:focus { border-color: var(--rose); box-shadow: var(--glow); }
.error-msg { color: #ffd0d8; font-size: 0.9rem; min-height: 20px; margin-top: 8px; }
.shake { animation: shake 0.4s; }
@keyframes shake {
  0%,100%{transform:translateX(0)} 20%{transform:translateX(-10px)}
  40%{transform:translateX(10px)} 60%{transform:translateX(-7px)} 80%{transform:translateX(7px)}
}

/* Heart explosion overlay */
#explosion {
  position: fixed;
  inset: 0;
  z-index: 999;
  pointer-events: none;
  display: none;
}
.explode-heart {
  position: absolute;
  left: 50%; top: 50%;
  font-size: 26px;
  transform: translate(-50%, -50%);
  animation: explode 1.1s ease-out forwards;
}
@keyframes explode {
  0%   { transform: translate(-50%, -50%) scale(0.2); opacity: 1; }
  100% { transform: translate(calc(-50% + var(--dx)), calc(-50% + var(--dy))) scale(1.4); opacity: 0; }
}

/* =========================================================
   DASHBOARD / MENU
   ========================================================= */
.menu-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
  margin-top: 10px;
}
.menu-card {
  position: relative;
  overflow: hidden;
  padding: 26px 16px;
  text-align: center;
  text-decoration: none;
  color: #fff;
  border-radius: 22px;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
  animation: cardPop 0.6s ease both;
}
.menu-card:active { transform: scale(0.96); }
.menu-card:hover  { transform: translateY(-4px); box-shadow: 0 0 30px rgba(255,93,143,0.6); }
.menu-card .ico { font-size: 2.4rem; display: block; margin-bottom: 10px; }
.menu-card .label { font-family: var(--font-head); font-size: 1.05rem; }
.menu-card .desc  { font-size: 0.75rem; color: var(--rose-soft); margin-top: 4px; font-weight: 300; }
@keyframes cardPop { from{opacity:0; transform:scale(0.8)} to{opacity:1; transform:scale(1)} }

/* =========================================================
   LOVE LETTER
   ========================================================= */
.letter-paper {
  padding: 34px 26px;
  font-size: 1.08rem;
  line-height: 2;
  font-weight: 300;
  white-space: pre-wrap;
  min-height: 300px;
}
.letter-paper .cursor {
  display: inline-block;
  width: 2px; height: 1.2em;
  background: var(--rose-soft);
  margin-left: 2px;
  animation: blink 0.8s steps(1) infinite;
  vertical-align: text-bottom;
}
@keyframes blink { 50% { opacity: 0; } }
.signature { font-family: var(--font-head); font-style: italic; font-size: 1.3rem; color: var(--rose-soft); margin-top: 20px; }

/* =========================================================
   PLACES / MAP
   ========================================================= */
#map {
  height: 60vh;
  min-height: 360px;
  width: 100%;
  border-radius: 22px;
  border: 1px solid var(--glass-brd);
  box-shadow: var(--shadow);
  z-index: 1;
}
.leaflet-popup-content-wrapper {
  background: rgba(74,7,16,0.92);
  color: #fff;
  border-radius: 16px;
  border: 1px solid var(--rose);
}
.leaflet-popup-tip { background: rgba(74,7,16,0.92); }
.leaflet-popup-content { margin: 14px 16px; font-family: var(--font-body); }
.leaflet-popup-content b { font-family: var(--font-head); color: var(--rose-soft); font-size: 1.05rem; }
.leaflet-popup-content .date { color: var(--rose-soft); font-size: 0.8rem; }
.place-list { margin-top: 20px; display: flex; flex-direction: column; gap: 12px; }
.place-item { padding: 14px 18px; display: flex; gap: 12px; align-items: center; cursor: pointer; }
.place-item .pin { font-size: 1.5rem; }
.place-item small { color: var(--rose-soft); }

/* =========================================================
   CANDLES
   ========================================================= */
.candle-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 14px;
  margin: 30px 0;
}
@media (max-width: 420px){ .candle-grid { grid-template-columns: repeat(5, 1fr); gap: 8px; } }
.candle {
  display: flex;
  flex-direction: column;
  align-items: center;
  cursor: pointer;
}
.candle .flame {
  width: 14px; height: 22px;
  background: radial-gradient(circle at 50% 70%, #fff7c0, #ff8a00 60%, transparent 75%);
  border-radius: 50% 50% 50% 50% / 60% 60% 40% 40%;
  opacity: 0;
  transform: scale(0.3);
  transition: all 0.4s ease;
  filter: blur(0.4px);
  margin-bottom: -3px;
}
.candle.lit .flame { opacity: 1; transform: scale(1); animation: flicker 0.5s ease-in-out infinite alternate; }
@keyframes flicker {
  from { transform: scale(1) translateX(-0.5px); filter: brightness(1); }
  to   { transform: scale(1.08) translateX(0.5px); filter: brightness(1.3); }
}
.candle .wax {
  width: 22px; height: 60px;
  border-radius: 6px 6px 4px 4px;
  background: linear-gradient(180deg, #ffe3ec, #ff9bb6 80%);
  box-shadow: inset 0 -6px 10px rgba(142,13,24,0.4);
  position: relative;
}
.candle.lit .wax { box-shadow: inset 0 -6px 10px rgba(142,13,24,0.4), 0 0 22px rgba(255,170,0,0.6); }
.candle .wick { width: 2px; height: 7px; background: #2b2b2b; margin: 0 auto; }
.candle-msg {
  text-align: center;
  font-family: var(--font-head);
  font-size: 1.4rem;
  color: var(--rose-soft);
  margin-top: 20px;
  opacity: 0;
  transform: scale(0.9);
  transition: all 0.8s ease;
}
.candle-msg.show { opacity: 1; transform: scale(1); }

/* =========================================================
   COUNTDOWN + CALENDAR
   ========================================================= */
.countdown {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin: 26px 0;
  flex-wrap: wrap;
}
.cd-box {
  min-width: 72px;
  padding: 18px 10px;
  text-align: center;
}
.cd-box .num { font-family: var(--font-head); font-size: 2.2rem; display: block; }
.cd-box .lbl { font-size: 0.7rem; color: var(--rose-soft); text-transform: uppercase; letter-spacing: 1px; }

.calendar { padding: 20px; margin-top: 24px; }
.cal-head { text-align: center; font-family: var(--font-head); font-size: 1.3rem; margin-bottom: 14px; }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
.cal-grid .dow { font-size: 0.7rem; color: var(--rose-soft); text-align: center; padding: 4px 0; }
.cal-cell {
  aspect-ratio: 1;
  display: flex; align-items: center; justify-content: center;
  border-radius: 10px;
  font-size: 0.85rem;
  background: rgba(255,255,255,0.05);
}
.cal-cell.empty { background: transparent; }
.cal-cell.highlight {
  background: linear-gradient(135deg, var(--rose), var(--red));
  font-weight: 600;
  box-shadow: var(--glow);
  position: relative;
}
.cal-cell.highlight::after { content:'❤'; position:absolute; top:-6px; right:-2px; font-size:0.7rem; }

/* =========================================================
   QUIZ
   ========================================================= */
.quiz-card { padding: 28px 22px; margin-top: 16px; }
.quiz-q { font-family: var(--font-head); font-size: 1.3rem; margin-bottom: 20px; }
.quiz-opt {
  display: block;
  width: 100%;
  text-align: left;
  padding: 16px 18px;
  margin-bottom: 12px;
  border-radius: 14px;
  border: 1px solid var(--glass-brd);
  background: var(--glass);
  color: #fff;
  font-family: var(--font-body);
  font-size: 1rem;
  cursor: pointer;
  transition: all 0.2s ease;
}
.quiz-opt:active { transform: scale(0.97); }
.quiz-opt.correct { background: linear-gradient(135deg,#1db954,#0a8c3f); border-color:#1db954; }
.quiz-opt.wrong   { background: linear-gradient(135deg,#8e0d18,#e11d2a); border-color:#e11d2a; }
.quiz-progress { font-size: 0.85rem; color: var(--rose-soft); margin-bottom: 16px; text-align:center; }
.quiz-result { text-align: center; }
.quiz-result .score { font-family: var(--font-head); font-size: 3rem; color: var(--rose-soft); }

/* =========================================================
   STORY (scroll / parallax)
   ========================================================= */
.story-section {
  min-height: 88vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 40px 8px;
}
.story-block {
  padding: 30px 26px;
  opacity: 0;
  transform: translateY(50px);
  transition: opacity 1s ease, transform 1s ease;
}
.story-block.in { opacity: 1; transform: translateY(0); }
.story-block .chapter { font-size: 0.8rem; letter-spacing: 3px; text-transform: uppercase; color: var(--rose-soft); }
.story-block h2 { font-size: clamp(1.6rem, 6vw, 2.4rem); margin: 8px 0 14px; }
.story-block p { font-weight: 300; line-height: 1.9; font-size: 1.05rem; }

/* =========================================================
   FUTURE
   ========================================================= */
.future-card {
  padding: 28px 24px;
  margin-bottom: 18px;
  opacity: 0;
  transform: translateY(40px);
  transition: all 0.9s ease;
  background:
    linear-gradient(160deg, rgba(255,179,201,0.12), rgba(255,255,255,0.04));
}
.future-card.in { opacity: 1; transform: translateY(0); }
.future-card .ico { font-size: 2rem; }
.future-card h3 { font-size: 1.4rem; margin: 10px 0 8px; }
.future-card p { font-weight: 300; line-height: 1.8; }

/* =========================================================
   LOVE LIST
   ========================================================= */
.love-list { list-style: none; margin-top: 20px; }
.love-list li {
  padding: 20px 22px;
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  gap: 16px;
  cursor: pointer;
  font-size: 1.1rem;
  transition: transform 0.2s ease;
  opacity: 0;
  transform: translateX(-30px);
}
.love-list li.in { opacity: 1; transform: translateX(0); }
.love-list li:active { transform: scale(0.97); }
.love-list li .hp { font-size: 1.6rem; transition: transform 0.3s ease; }
.love-list li.pulsed .hp { animation: heartPulse 0.6s ease; }
@keyframes heartPulse {
  0%{transform:scale(1)} 30%{transform:scale(1.6)} 60%{transform:scale(0.9)} 100%{transform:scale(1)}
}

/* =========================================================
   FINAL PAGE
   ========================================================= */
.final {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  min-height: 100vh;
  padding: 40px 24px;
  position: relative;
  z-index: 1;
}
.final .big-q {
  font-family: var(--font-head);
  font-size: clamp(2rem, 9vw, 3.6rem);
  margin-bottom: 36px;
  animation: glowPulse 2.5s ease-in-out infinite;
}
@keyframes glowPulse {
  0%,100% { text-shadow: 0 0 20px rgba(255,93,143,0.5); }
  50%     { text-shadow: 0 0 45px rgba(255,93,143,0.95); }
}
.final-btns { display: flex; flex-direction: column; gap: 16px; align-items: center; }
.btn-yes { font-size: 1.4rem; padding: 22px 60px; animation: yesBeat 1.4s ease-in-out infinite; }
@keyframes yesBeat { 0%,100%{transform:scale(1)} 50%{transform:scale(1.07)} }
.btn-no {
  position: relative;
  transition: all 0.25s ease;
}
.celebration {
  display: none;
  text-align: center;
  animation: pageFade 1s ease;
}
.celebration.show { display: block; }
.celebration h1 { font-size: clamp(2.2rem, 10vw, 4rem); }
.celebration p  { font-size: 1.2rem; color: var(--rose-soft); margin-top: 14px; font-weight: 300; }

/* Confetti */
.confetti-piece {
  position: fixed;
  top: -10px;
  width: 10px; height: 16px;
  z-index: 900;
  pointer-events: none;
  animation: confettiFall linear forwards;
}
@keyframes confettiFall {
  to { transform: translateY(110vh) rotate(720deg); opacity: 0.9; }
}

/* Utility */
.fade-in { animation: pageFade 1s ease both; }
.mt { margin-top: 24px; }
.hidden { display: none !important; }
.note { font-size: 0.8rem; color: var(--rose-soft); opacity: 0.8; }
