/* Anniversary Gift Surprise — dark romantic theme, mobile first */
* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

:root {
  --bg: #0d0710;
  --bg2: #1a0b16;
  --card: #22101d;
  --pink: #ff2d78;
  --pink2: #ff5e8a;
  --pink-soft: #ff7aa2;
  --pink-pale: #ffb3c8;
  --red: #ff3b5c;
  --text: #fff;
  --muted: #d9a7bd;
  --btn-grad: linear-gradient(135deg, #ff2d78, #ff6a5e);
}

html, body { height: 100%; }
body {
  background: radial-gradient(120% 100% at 50% 0%, #2a0e22 0%, var(--bg) 55%);
  color: var(--text);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  overflow-x: hidden;
  min-height: 100vh;
}

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

.phone {
  position: relative; z-index: 1;
  max-width: 430px; margin: 0 auto; min-height: 100vh;
  padding: 28px 20px 40px;
  display: flex; flex-direction: column;
}

/* ---------- screens ---------- */
.screen { display: none; flex-direction: column; align-items: center; text-align: center; animation: fadeUp .5s ease both; }
.screen.active { display: flex; }
@keyframes fadeUp { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
.hidden { display: none !important; }

/* ---------- type ---------- */
.title {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 34px; line-height: 1.2; font-weight: 700;
  background: linear-gradient(135deg, #ff7aa2, #ff2d78);
  -webkit-background-clip: text; background-clip: text; color: transparent;
  margin: 18px 0 12px;
}
.title.small { font-size: 27px; }
.title.pink { color: var(--pink2); -webkit-text-fill-color: var(--pink2); background: none; }
.sub { color: var(--muted); font-size: 15px; line-height: 1.55; margin-bottom: 18px; }
.sub.small { font-size: 13px; }
.kicker { color: var(--pink-soft); font-size: 17px; font-weight: 600; margin: 10px 0 14px; }
.hint { color: #8a6a7e; font-size: 12.5px; margin-top: 16px; }
.turn { color: var(--muted); font-size: 14px; margin-bottom: 16px; min-height: 20px; }

/* ---------- buttons ---------- */
.btn {
  background: var(--btn-grad); color: #fff; border: none; cursor: pointer;
  font-size: 16px; font-weight: 700; padding: 15px 26px; border-radius: 999px;
  box-shadow: 0 8px 24px rgba(255, 45, 120, .45);
  transition: transform .15s ease, box-shadow .15s ease;
  margin-top: 8px; max-width: 100%;
}
.btn:active { transform: scale(.96); }
.btn.ghost { background: transparent; border: 1.5px solid var(--pink); box-shadow: none; color: var(--pink-soft); }
.skip { background: none; border: none; color: #8a6a7e; font-size: 13px; margin-top: 18px; cursor: pointer; }

/* ---------- intro ---------- */
.intro-heart { font-size: 84px; margin-top: 12vh; animation: beat 1.2s ease-in-out infinite; filter: drop-shadow(0 0 24px rgba(255,45,120,.6)); }
@keyframes beat { 0%,100% { transform: scale(1); } 15% { transform: scale(1.12); } 30% { transform: scale(1); } 45% { transform: scale(1.08); } }

/* ---------- tic-tac-toe ---------- */
.board {
  display: grid; grid-template-columns: repeat(3, 96px); grid-template-rows: repeat(3, 96px);
  gap: 0; margin: 6px auto 20px; position: relative;
}
.cell {
  background: transparent; border: none; cursor: pointer;
  font-size: 52px; line-height: 96px; color: #fff; font-weight: 300;
  font-family: Georgia, serif;
}
.cell:nth-child(3n+2) { border-left: 2px solid var(--pink); border-right: 2px solid var(--pink); }
.cell:nth-child(n+4):nth-child(-n+6) { border-top: 2px solid var(--pink); border-bottom: 2px solid var(--pink); }
.cell:disabled { cursor: default; }
.cell.heart { font-size: 46px; animation: pop .45s cubic-bezier(.2, 2.2, .4, 1) both; }
@keyframes pop { from { transform: scale(.2); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.win-msg { animation: fadeUp .6s ease both; }
.win-line { color: var(--pink-soft); font-family: Georgia, serif; font-size: 21px; line-height: 1.45; margin-bottom: 14px; }

/* ---------- date / calendar ---------- */
.days { font-size: 64px; font-weight: 800; line-height: 1; color: #fff; margin: 4px 0 6px; text-shadow: 0 0 30px rgba(255,45,120,.55); }
.calendar {
  background: var(--card); border: 1px solid rgba(255,45,120,.25); border-radius: 18px;
  padding: 16px 14px; width: 100%; max-width: 330px; margin: 6px 0 20px;
}
.cal-title { color: var(--pink-soft); font-weight: 700; font-size: 15px; margin-bottom: 10px; }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; font-size: 13px; }
.cal-grid .dow { color: #8a6a7e; font-size: 11px; padding: 4px 0; }
.cal-grid .day { padding: 7px 0; border-radius: 8px; color: #e8c9d8; }
.cal-grid .day.mark { background: var(--pink); color: #fff; font-weight: 800; position: relative; box-shadow: 0 0 16px rgba(255,45,120,.7); }
.cal-grid .day.mark::after { content: "❤️"; position: absolute; top: -11px; right: -4px; font-size: 11px; }
.cal-grid .day.empty { visibility: hidden; }

/* ---------- polaroids ---------- */
.polaroids { position: relative; width: 100%; height: 400px; margin: 4px 0 22px; }
.polaroid {
  position: absolute; width: 148px; background: #fff; padding: 8px 8px 26px; border-radius: 4px;
  box-shadow: 0 10px 28px rgba(0,0,0,.55); cursor: pointer; transition: transform .2s ease;
}
.polaroid img { width: 100%; height: 168px; object-fit: cover; display: block; border-radius: 2px; }
.polaroid figcaption { color: #333; font-size: 12.5px; font-family: "Segoe Script", "Brush Script MT", cursive; margin-top: 6px; }
.polaroid:active { transform: scale(1.05) rotate(0deg) !important; z-index: 5; }
.p1 { left: 2%; top: 6px; transform: rotate(-8deg); }
.p2 { right: 2%; top: 26px; transform: rotate(7deg); }
.p3 { left: 6%; top: 158px; transform: rotate(5deg); }
.p4 { right: 5%; top: 168px; transform: rotate(-6deg); }

/* ---------- photo viewer ---------- */
.viewer {
  position: fixed; inset: 0; z-index: 50; background: rgba(5,2,6,.94);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 18px;
  cursor: pointer; padding: 20px;
}
.viewer img { max-width: 92vw; max-height: 76vh; border: 10px solid #fff; border-bottom-width: 44px; border-radius: 4px; box-shadow: 0 20px 60px rgba(0,0,0,.8); }
.viewer p { color: #c9a0b4; font-size: 14px; }

/* ---------- music player ---------- */
.player {
  background: var(--card); border: 1px solid rgba(255,45,120,.28); border-radius: 22px;
  padding: 18px 16px 20px; width: 100%; margin-bottom: 20px;
}
#heartCanvas { width: 100%; max-width: 300px; height: 230px; display: block; margin: 0 auto; }
.track { color: var(--pink-soft); font-weight: 700; font-size: 16px; margin: 6px 0 12px; }
.progress { height: 6px; background: rgba(255,255,255,.14); border-radius: 99px; overflow: hidden; margin: 0 8px 16px; }
.progress-fill { height: 100%; width: 0%; background: var(--btn-grad); border-radius: 99px; transition: width .3s linear; }
.controls { display: flex; align-items: center; justify-content: center; gap: 26px; }
.ctrl { background: none; border: none; color: var(--pink-soft); font-size: 26px; cursor: pointer; }
.ctrl.play {
  width: 62px; height: 62px; border-radius: 50%; background: var(--btn-grad); color: #fff;
  font-size: 24px; box-shadow: 0 8px 22px rgba(255,45,120,.5); display: flex; align-items: center; justify-content: center;
}
.track-note { color: #8a6a7e; font-size: 12px; margin-top: 14px; }

/* ---------- reason cards ---------- */
.cards { display: flex; flex-direction: column; gap: 14px; width: 100%; margin-bottom: 20px; }
.reason-card {
  background: var(--btn-grad); border: none; border-radius: 16px; min-height: 76px; width: 100%;
  color: #fff; font-size: 16px; cursor: pointer; padding: 16px 18px; position: relative; overflow: hidden;
  box-shadow: 0 8px 22px rgba(255,45,120,.35); transition: transform .15s ease;
}
.reason-card:active { transform: scale(.98); }
.reason-card .card-front { display: flex; flex-direction: column; align-items: center; gap: 4px; font-size: 22px; }
.reason-card .card-front em { font-style: normal; font-size: 13px; opacity: .9; }
.reason-card .card-back { display: none; font-family: Georgia, serif; font-size: 17px; line-height: 1.5; }
.reason-card.open { background: var(--card); border: 1px solid rgba(255,45,120,.4); box-shadow: none; }
.reason-card.open .card-front { display: none; }
.reason-card.open .card-back { display: block; animation: fadeUp .4s ease both; }

/* ---------- letter ---------- */
.letter-wrap { position: relative; width: 100%; margin-bottom: 20px; }
.mascot { margin-bottom: -6px; position: relative; z-index: 2; }
.roses { position: absolute; right: 2px; top: 74px; font-size: 20px; line-height: 1.5; z-index: 2; }
.letter {
  background: #1c0f18; border: 1px solid rgba(255,45,120,.35); border-radius: 16px;
  padding: 20px 18px; text-align: left; min-height: 190px;
  box-shadow: 0 0 0 4px rgba(255,45,120,.06), 0 14px 34px rgba(0,0,0,.5);
}
.letter .line { font-family: Georgia, serif; font-size: 16.5px; line-height: 1.65; color: #f6dbe7; margin-bottom: 12px; animation: fadeUp .5s ease both; }
.letter .line.placeholder { color: #8a6a7e; font-style: italic; }
.petals { display: flex; justify-content: center; gap: 10px; margin-top: 14px; }
.petal { background: rgba(255,45,120,.14); border: 1px solid rgba(255,45,120,.4); border-radius: 50%; width: 46px; height: 46px; font-size: 22px; cursor: pointer; transition: transform .15s ease, opacity .3s ease; }
.petal:active { transform: scale(.9); }
.petal.used { opacity: .25; transform: scale(.85); pointer-events: none; }

/* ---------- puzzle ---------- */
.puzzle-stage { display: flex; justify-content: center; align-items: center; margin: 10px 0 18px; min-height: 130px; cursor: pointer; }
.piece { transition: transform .7s cubic-bezier(.3, 1.4, .4, 1); filter: drop-shadow(0 8px 16px rgba(0,0,0,.5)); }
.piece-a { transform: translateX(-38px); }
.piece-b { transform: translateX(38px); }
.puzzle-stage.joined .piece-a { transform: translateX(14px); }
.puzzle-stage.joined .piece-b { transform: translateX(-14px); }
.match-title { color: var(--pink-soft); font-family: Georgia, serif; font-size: 21px; margin-bottom: 6px; }
.heart-tap { background: none; border: none; font-size: 54px; cursor: pointer; margin: 10px 0 6px; animation: beat 1.2s ease-in-out infinite; }
.heart-bar { height: 8px; background: rgba(255,255,255,.14); border-radius: 99px; overflow: hidden; max-width: 260px; margin: 0 auto 8px; }
.heart-fill { height: 100%; width: 0%; background: var(--btn-grad); border-radius: 99px; transition: width .5s ease; }

/* ---------- infinity ---------- */
.infinity { margin: 26px 0 30px; filter: drop-shadow(0 0 18px rgba(255,45,120,.55)); }
.infinity path { stroke-dasharray: 620; stroke-dashoffset: 620; animation: draw 3.2s ease-in-out infinite; }
@keyframes draw { 0% { stroke-dashoffset: 620; } 55% { stroke-dashoffset: 0; } 85% { stroke-dashoffset: 0; } 100% { stroke-dashoffset: -620; } }

/* ---------- finale ---------- */
#screen-finale { position: relative; }
#rain { position: fixed; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 0; }
#screen-finale > :not(#rain) { position: relative; z-index: 1; }
.big-num { font-size: 110px; font-weight: 800; line-height: 1; color: var(--pink); text-shadow: 0 0 44px rgba(255,45,120,.7); margin: 9vh 0 10px; }
.final-card {
  background: var(--card); border: 1px solid rgba(255,45,120,.4); border-radius: 20px;
  padding: 24px 20px; width: 100%; margin: 22px 0;
  box-shadow: 0 16px 40px rgba(0,0,0,.55);
}
.final-title { font-family: Georgia, serif; font-size: 24px; color: var(--pink-soft); margin-bottom: 10px; }
.final-text { color: #e8c9d8; font-size: 16px; line-height: 1.6; }

@media (min-width: 500px) {
  body { padding: 24px 0; }
  .phone { border: 1px solid rgba(255,45,120,.25); border-radius: 36px; box-shadow: 0 30px 80px rgba(0,0,0,.6); min-height: calc(100vh - 48px); }
}

/* ================= v2 — more pages, music, animations ================= */

/* screen slide-in (replaces the plain fade on navigation) */
.screen.active { animation: slideIn .45s ease both; }
@keyframes slideIn { from { opacity: 0; transform: translateX(26px); } to { opacity: 1; transform: none; } }

/* floating background-music toggle */
.music-toggle {
  position: fixed; top: 14px; right: 14px; z-index: 40;
  width: 46px; height: 46px; border-radius: 50%; border: 1px solid rgba(255,45,120,.5);
  background: rgba(34,16,29,.85); color: #fff; font-size: 20px; cursor: pointer;
  box-shadow: 0 6px 18px rgba(0,0,0,.5); backdrop-filter: blur(4px);
}
.music-toggle.muted { opacity: .55; }

/* progress dots */
.progress-dots {
  position: fixed; top: 16px; left: 50%; transform: translateX(-50%); z-index: 40;
  display: flex; gap: 5px; padding: 7px 10px; border-radius: 99px;
  background: rgba(13,7,16,.6); backdrop-filter: blur(4px);
}
.progress-dots i { width: 7px; height: 7px; border-radius: 50%; background: rgba(255,255,255,.25); transition: all .3s ease; }
.progress-dots i.done { background: var(--pink-soft); }
.progress-dots i.now { background: var(--pink); transform: scale(1.5); box-shadow: 0 0 8px var(--pink); }

/* confetti overlay */
#confetti { position: fixed; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 60; }

/* ---------- timeline ---------- */
.timeline { position: relative; width: 100%; text-align: left; margin: 6px 0 20px; padding-left: 8px; }
.timeline::before { content: ""; position: absolute; left: 27px; top: 8px; bottom: 8px; width: 2px; background: linear-gradient(180deg, var(--pink), var(--pink-soft), var(--pink)); opacity: .5; }
.tl-item { position: relative; display: flex; gap: 14px; margin-bottom: 14px; opacity: 0; transform: translateY(16px); transition: opacity .5s ease, transform .5s ease; }
.tl-item.visible { opacity: 1; transform: none; }
.tl-dot { flex: 0 0 40px; width: 40px; height: 40px; border-radius: 50%; background: var(--card); border: 1.5px solid var(--pink); display: flex; align-items: center; justify-content: center; font-size: 18px; z-index: 1; }
.tl-card { background: var(--card); border: 1px solid rgba(255,45,120,.25); border-radius: 14px; padding: 12px 14px; flex: 1; }
.tl-card b { color: var(--pink-soft); font-size: 14px; }
.tl-card p { color: #e8c9d8; font-size: 14px; line-height: 1.5; margin-top: 3px; }

/* ---------- quiz ---------- */
.quiz { width: 100%; }
.q-card { display: none; animation: slideIn .4s ease both; }
.q-card.active { display: block; }
.q-text { font-family: Georgia, serif; font-size: 19px; line-height: 1.5; margin-bottom: 18px; }
.q-opt {
  display: block; width: 100%; margin-bottom: 12px; padding: 15px 16px; text-align: left;
  background: var(--card); border: 1.5px solid rgba(255,45,120,.35); border-radius: 14px;
  color: #fff; font-size: 15.5px; cursor: pointer; transition: transform .15s ease, border-color .2s ease, background .2s ease;
}
.q-opt:active { transform: scale(.97); }
.q-opt.correct { background: rgba(46, 160, 90, .25); border-color: #2ea05a; animation: pop .4s ease both; }
.q-opt.wrong { border-color: #ff5e5e; animation: shake .4s ease both; opacity: .55; }
@keyframes shake { 0%,100% { transform: translateX(0); } 25% { transform: translateX(-6px); } 75% { transform: translateX(6px); } }
.q-score { font-size: 56px; font-weight: 800; color: var(--pink); text-shadow: 0 0 30px rgba(255,45,120,.6); margin: 26px 0 8px; }

/* ---------- bouquet ---------- */
.bouquet { display: flex; justify-content: center; gap: 6px; flex-wrap: wrap; margin: 8px 0 22px; }
.flower { width: 62px; cursor: pointer; display: flex; flex-direction: column; align-items: center; }
.bloom { position: relative; width: 62px; height: 62px; }
.bloom i {
  position: absolute; left: calc(50% - 11px); top: calc(50% - 32px); width: 22px; height: 32px;
  border-radius: 50% 50% 50% 50% / 62% 62% 38% 38%;
  background: radial-gradient(circle at 50% 30%, #ff8fb8, #ff2d78 70%);
  transform-origin: 50% 100%; transform: rotate(var(--r)) scale(0);
  transition: transform .55s cubic-bezier(.3, 1.6, .4, 1);
}
.bloom i:nth-child(1) { --r: 0deg; }
.bloom i:nth-child(2) { --r: 72deg; }
.bloom i:nth-child(3) { --r: 144deg; }
.bloom i:nth-child(4) { --r: 216deg; }
.bloom i:nth-child(5) { --r: 288deg; }
.bloom b {
  position: absolute; left: calc(50% - 9px); top: calc(50% - 9px); width: 18px; height: 18px;
  border-radius: 50%; background: radial-gradient(circle at 40% 35%, #ffe066, #ffb703);
  transform: scale(0); transition: transform .4s ease .35s;
}
.flower .stem { width: 3px; height: 0; background: linear-gradient(180deg, #2ea05a, #1d7a44); border-radius: 2px; transition: height .5s ease .1s; }
.flower .word { font-size: 12px; color: var(--pink-soft); font-weight: 700; margin-top: 6px; opacity: 0; transition: opacity .4s ease .5s; }
.flower.bloomed .bloom i { transform: rotate(var(--r)) scale(1); }
.flower.bloomed .bloom b { transform: scale(1); }
.flower.bloomed .stem { height: 34px; }
.flower.bloomed .word { opacity: 1; }
.flower:not(.bloomed) .bloom::after { content: "🌱"; position: absolute; left: 50%; top: 50%; transform: translate(-50%,-50%); font-size: 26px; }

/* ---------- coupons ---------- */
.coupons { display: flex; flex-direction: column; gap: 13px; width: 100%; margin-bottom: 20px; }
.coupon {
  display: flex; align-items: center; gap: 14px; width: 100%; text-align: left;
  background: var(--card); border: 1.5px dashed rgba(255,122,162,.6); border-radius: 16px;
  padding: 15px 16px; color: #fff; cursor: pointer; transition: transform .15s ease, background .25s ease;
}
.coupon:active { transform: scale(.98); }
.c-emoji { font-size: 30px; flex: 0 0 auto; }
.c-text { flex: 1; display: flex; flex-direction: column; gap: 2px; }
.c-text b { font-size: 15.5px; }
.c-text em { font-style: normal; font-size: 12.5px; color: var(--muted); }
.c-state { font-size: 11.5px; color: var(--pink-soft); border: 1px solid rgba(255,45,120,.5); border-radius: 99px; padding: 5px 9px; white-space: nowrap; }
.coupon.redeemed { background: rgba(255,45,120,.16); border-style: solid; }
.coupon.redeemed .c-state { background: var(--pink); color: #fff; border-color: var(--pink); }

/* ---------- countdown ---------- */
.countdown { display: flex; gap: 10px; justify-content: center; margin: 10px 0 20px; }
.cd-box {
  background: var(--card); border: 1px solid rgba(255,45,120,.35); border-radius: 16px;
  width: 74px; padding: 14px 0 10px;
}
.cd-box span { display: block; font-size: 30px; font-weight: 800; color: #fff; font-variant-numeric: tabular-nums; }
.cd-box em { font-style: normal; font-size: 11.5px; color: var(--pink-soft); text-transform: uppercase; letter-spacing: 1px; }

/* ---------- v2 animation upgrades ---------- */
.reason-card.open { animation: flipIn .55s ease both; }
@keyframes flipIn { from { transform: rotateY(88deg); opacity: .3; } to { transform: rotateY(0); opacity: 1; } }
.polaroid img { animation: kenburns 14s ease-in-out infinite alternate; }
@keyframes kenburns { from { transform: scale(1); } to { transform: scale(1.12); } }
.letter .line { white-space: pre-line; }
.letter .line.typing::after { content: "▍"; color: var(--pink); animation: blink .7s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }
.btn { animation: glowPulse 2.6s ease-in-out infinite; }
@keyframes glowPulse { 0%,100% { box-shadow: 0 8px 24px rgba(255,45,120,.45); } 50% { box-shadow: 0 8px 34px rgba(255,45,120,.75); } }
