:root {
  --bg-top: #ffe3ec;
  --bg-bottom: #f3e8ff;
  --card: #fffafc;
  --ink: #5a2a3c;
  --muted: #9a6b7e;
  --pink: #ff8fab;
  --rose: #e5517a;
  --rose-dark: #c9356a;
  --soft: #ffd6e3;
  --shadow: 0 10px 30px rgba(229, 81, 122, 0.18);
  --radius: 24px;
  --font: ui-rounded, "SF Pro Rounded", "Nunito", system-ui, -apple-system, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  font-family: var(--font);
  color: var(--ink);
  background: linear-gradient(160deg, var(--bg-top), var(--bg-bottom));
  background-attachment: fixed;
}

#petals {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0;
}

.page {
  position: relative;
  z-index: 1;
  max-width: 560px;
  margin: 0 auto;
  padding: 24px 16px calc(32px + env(safe-area-inset-bottom));
}

h1 { font-size: 1.7rem; line-height: 1.25; margin: 0.4em 0; }

.center { text-align: center; }
.muted { color: var(--muted); }

.card {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 32px 22px;
  margin-top: 12vh;
}

.big-heart { font-size: 3.2rem; line-height: 1; animation: beat 1.8s ease-in-out infinite; }

@keyframes beat {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.12); }
}

.btn {
  display: inline-block;
  border: 0;
  border-radius: 999px;
  padding: 14px 28px;
  font: inherit;
  font-weight: 700;
  color: #fff;
  background: linear-gradient(135deg, var(--pink), var(--rose));
  box-shadow: 0 6px 16px rgba(229, 81, 122, 0.35);
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.12s ease;
  -webkit-tap-highlight-color: transparent;
}
.btn:active { transform: scale(0.96); }
.btn-soft { background: var(--soft); color: var(--rose-dark); box-shadow: none; }

.field {
  width: 100%;
  max-width: 280px;
  margin: 12px 0;
  padding: 14px 18px;
  border: 2px solid var(--soft);
  border-radius: 999px;
  font: inherit;
  font-size: 1.1rem; /* 16px+ stops iOS from zooming into the field */
  text-align: center;
  color: var(--ink);
  background: #fff;
}
.field:focus { outline: none; border-color: var(--pink); }

.error { color: var(--rose-dark); font-weight: 600; margin: 4px 0 12px; }

.link {
  border: 0;
  background: none;
  font: inherit;
  color: var(--muted);
  text-decoration: underline;
  cursor: pointer;
  margin-top: 18px;
}

.hero { text-align: center; padding-top: 6vh; }
.counter { font-size: 1.2rem; color: var(--muted); margin: 0; }
.counter span { font-size: 3rem; font-weight: 800; color: var(--rose); display: block; }

.menu { display: grid; gap: 14px; margin-top: 28px; }

.tile {
  position: relative;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 20px;
  border-radius: var(--radius);
  background: var(--card);
  box-shadow: var(--shadow);
  color: var(--ink);
  text-decoration: none;
  transition: transform 0.12s ease;
  -webkit-tap-highlight-color: transparent;
}
a.tile:active { transform: scale(0.97); }
.tile-icon { font-size: 2rem; }
.tile-title { font-weight: 700; font-size: 1.05rem; }
.tile-soon { opacity: 0.6; }
.tile-note {
  position: absolute;
  top: 10px;
  right: 14px;
  font-size: 0.75rem;
  color: var(--muted);
}

.footer { text-align: center; margin-top: 28px; }

.back { color: var(--muted); text-decoration: none; }

/* --- reasons deck --- */
.deck { margin-top: 24px; text-align: center; }
.reason-list { list-style: none; margin: 0; padding: 0; }

.reason {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 34px 24px;
  margin-bottom: 14px;
  font-size: 1.2rem;
  line-height: 1.5;
}

/* With JavaScript the list becomes a deck: one card at a time. */
.js .reason { display: none; min-height: 260px; align-items: center; justify-content: center; margin-bottom: 18px; }
.js .reason.current { display: flex; animation: pop 0.35s ease; }
.js .reason.current.back { animation-name: pop-back; }

@keyframes pop {
  from { opacity: 0; transform: translateX(40px) rotate(3deg); }
  to { opacity: 1; transform: none; }
}
@keyframes pop-back {
  from { opacity: 0; transform: translateX(-40px) rotate(-3deg); }
  to { opacity: 1; transform: none; }
}

.progress { color: var(--muted); margin: 0 0 14px; }
.deck-buttons { display: flex; gap: 10px; justify-content: center; }
.no-js-hide { display: none; }

@media (prefers-reduced-motion: reduce) {
  .big-heart, .reason.current { animation: none !important; }
}

/* --- quiz --- */
[hidden] { display: none !important; }

.quiz { margin-top: 12px; }
.quiz-card .big-heart { margin-bottom: 8px; }
#quiz-play { margin-top: 16px; }
.quiz-top { display: flex; justify-content: space-between; align-items: center; color: var(--muted); font-weight: 600; font-size: 0.95rem; }
.quiz-bar { height: 8px; border-radius: 999px; background: var(--soft); margin: 10px 0 20px; overflow: hidden; }
.quiz-bar-fill { height: 100%; width: 0; border-radius: 999px; background: linear-gradient(90deg, var(--pink), var(--rose)); transition: width 0.4s ease; }
#quiz-question { font-size: 1.35rem; line-height: 1.35; margin: 0 0 18px; }

.quiz-options { display: grid; gap: 10px; }
.quiz-options-media { grid-template-columns: 1fr 1fr; }

.quiz-option {
  font: inherit;
  font-weight: 600;
  text-align: left;
  color: var(--ink);
  background: var(--card);
  border: 2px solid var(--soft);
  border-radius: 18px;
  padding: 16px 18px;
  box-shadow: 0 4px 12px rgba(229, 81, 122, 0.12);
  cursor: pointer;
  transition: transform 0.12s ease, border-color 0.2s ease, background 0.2s ease;
  -webkit-tap-highlight-color: transparent;
}
.quiz-option:active:not(:disabled) { transform: scale(0.97); }
.quiz-option:disabled { cursor: default; }
.quiz-option-media { padding: 6px; text-align: center; }
.quiz-option-media img, .quiz-option-media video { display: block; width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 12px; }
.quiz-option.is-right { border-color: #4caf88; background: #eafaf2; animation: pop-right 0.4s ease; }
.quiz-option.is-wrong { border-color: var(--rose); background: #ffecf1; animation: shake 0.4s ease; }

@keyframes pop-right { 50% { transform: scale(1.04); } }
@keyframes shake { 25% { transform: translateX(-6px); } 75% { transform: translateX(6px); } }

.quiz-feedback { margin-top: 18px; text-align: center; }
.quiz-feedback p { background: var(--card); border-radius: 18px; padding: 14px 16px; margin: 0 0 14px; line-height: 1.45; box-shadow: var(--shadow); }

@media (prefers-reduced-motion: reduce) {
  .quiz-option.is-right, .quiz-option.is-wrong, .quiz-bar-fill { animation: none !important; transition: none !important; }
}

/* --- album --- */
.album-head { padding-top: 2vh; }
.timeline { position: relative; margin-top: 10px; padding-left: 26px; }
.timeline::before { content: ""; position: absolute; left: 9px; top: 8px; bottom: 8px; width: 3px; border-radius: 3px; background: linear-gradient(var(--pink), var(--soft)); }
.chapter { position: relative; margin-bottom: 34px; }
.chapter-title { font-size: 1.45rem; margin: 0 0 4px; position: relative; }
.chapter-dot { position: absolute; left: -33px; top: 2px; font-size: 1rem; background: var(--bg-top); border-radius: 50%; line-height: 1; padding: 2px 0; }
.chapter-intro { margin: 0 0 14px; color: var(--muted); }

.moment { background: var(--card); border-radius: 20px; box-shadow: var(--shadow); padding: 14px 16px; margin-bottom: 12px; }
.moment h3 { margin: 4px 0; font-size: 1.1rem; }
.moment p { margin: 0; line-height: 1.45; }
.moment-date { display: inline-block; font-size: 0.8rem; font-weight: 700; color: var(--rose-dark); background: var(--soft); border-radius: 999px; padding: 3px 10px; }

.shots { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin-top: 8px; }
.shot { position: relative; padding: 0; border: 0; border-radius: 12px; overflow: hidden; background: var(--soft); cursor: pointer; aspect-ratio: 1; -webkit-tap-highlight-color: transparent; }
.shot img { display: block; width: 100%; height: 100%; object-fit: cover; }
.shot:active { transform: scale(0.97); }
.shot-play { position: absolute; inset: 0; display: grid; place-items: center; color: #fff; font-size: 1.6rem; background: rgba(90, 42, 60, 0.28); text-shadow: 0 2px 8px rgba(0, 0, 0, 0.4); }
.album-outro { margin: 10px 0 0; }

.no-scroll { overflow: hidden; }
.lightbox { position: fixed; inset: 0; z-index: 10; display: flex; flex-direction: column; align-items: center; justify-content: center; background: rgba(40, 14, 26, 0.94); }
.lb-stage { max-width: 100%; max-height: 82vh; max-height: 82dvh; display: grid; place-items: center; }
.lb-stage img, .lb-stage video { max-width: 100vw; max-height: 82vh; max-height: 82dvh; object-fit: contain; border-radius: 6px; }
.lb-caption { color: #ffd6e3; margin: 12px 0 0; font-size: 0.95rem; }
.lb-close { position: absolute; top: calc(12px + env(safe-area-inset-top)); right: 14px; border: 0; background: rgba(255, 255, 255, 0.16); color: #fff; width: 42px; height: 42px; border-radius: 50%; font-size: 1.2rem; cursor: pointer; }
.lb-nav { position: absolute; top: 50%; transform: translateY(-50%); border: 0; background: rgba(255, 255, 255, 0.14); color: #fff; width: 40px; height: 56px; font-size: 2rem; line-height: 1; cursor: pointer; border-radius: 12px; }
.lb-prev { left: 6px; }
.lb-next { right: 6px; }
