/* ============================================================
   For Ashu 💖 — cinematic night-sky + rose-gold theme
   ============================================================ */

:root {
  --bg-deep:   #0d0620;
  --bg-mid:    #2a0f3d;
  --bg-rose:   #5b1437;
  --gold:      #ffd57e;
  --gold-soft: #ffe9b8;
  --pink:      #ff7eb3;
  --pink-deep: #ff4f8b;
  --white:     #fff7fb;
  --faded:     rgba(255, 247, 251, 0.35);
}

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

html, body {
  height: 100%;
  overflow: hidden;
  font-family: "Poppins", sans-serif;
  color: var(--white);
  background: radial-gradient(ellipse at 50% 120%, var(--bg-rose) 0%, var(--bg-mid) 45%, var(--bg-deep) 100%);
  -webkit-tap-highlight-color: transparent;
}

canvas#bg-canvas, canvas#fx-canvas {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
}
#bg-canvas { z-index: 0; }
#fx-canvas { z-index: 50; pointer-events: none; }

/* ---------- scenes ---------- */
.scene {
  position: fixed;
  inset: 0;
  z-index: 10;
  display: none;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  padding: 24px;
  opacity: 0;
  transition: opacity 1.2s ease;
}
.scene.visible { display: flex; }
.scene.shown   { opacity: 1; }

/* ============================================================
   SCENE 1 — the question
   ============================================================ */
.question-box {
  text-align: center;
  max-width: 640px;
  width: 100%;
}

.her-name {
  font-family: "Great Vibes", cursive;
  font-size: clamp(3.2rem, 10vw, 5.5rem);
  font-weight: 400;
  background: linear-gradient(120deg, var(--gold-soft), var(--pink), var(--gold));
  background-size: 200% auto;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: shimmer 4s linear infinite;
  filter: drop-shadow(0 0 18px rgba(255, 126, 179, 0.45));
  min-height: 1.2em;
}

@keyframes shimmer {
  to { background-position: 200% center; }
}

.emoji-stage {
  margin: 18px 0 6px;
  position: relative;
  display: inline-block;
}

.big-emoji {
  font-size: clamp(5rem, 18vw, 8rem);
  display: inline-block;
  animation: plead 2.4s ease-in-out infinite;
  filter: drop-shadow(0 10px 30px rgba(255, 79, 139, 0.35));
  transition: transform 0.4s ease;
}

@keyframes plead {
  0%, 100% { transform: translateY(0) rotate(-4deg) scale(1); }
  25%      { transform: translateY(-10px) rotate(3deg) scale(1.04); }
  50%      { transform: translateY(0) rotate(-2deg) scale(1); }
  75%      { transform: translateY(-6px) rotate(4deg) scale(1.03); }
}

.emoji-hands {
  position: absolute;
  bottom: -6px;
  left: 50%;
  transform: translateX(-50%);
  font-size: clamp(1.6rem, 6vw, 2.4rem);
  animation: shy 1.6s ease-in-out infinite;
}

@keyframes shy {
  0%, 100% { letter-spacing: 0.05em; }
  50%      { letter-spacing: 0.45em; }
}

.question-text {
  font-family: "Playfair Display", serif;
  font-size: clamp(1.6rem, 6vw, 2.6rem);
  font-weight: 700;
  line-height: 1.35;
  margin-top: 10px;
  min-height: 2.6em;
  text-shadow: 0 0 24px rgba(255, 213, 126, 0.35);
}

.question-text .ch {
  display: inline-block;
  opacity: 0;
  transform: translateY(20px) scale(0.7);
  animation: chIn 0.55s cubic-bezier(0.2, 0.9, 0.3, 1.4) forwards;
}

@keyframes chIn {
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.tease-msg {
  margin-top: 14px;
  font-size: clamp(0.95rem, 3.6vw, 1.15rem);
  color: var(--gold-soft);
  font-weight: 500;
  min-height: 1.6em;
  transition: opacity 0.3s;
  text-shadow: 0 0 14px rgba(255, 213, 126, 0.4);
}

.btn-row {
  margin-top: 26px;
  display: flex;
  gap: 22px;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
}

.btn-yes, .btn-no, .btn-replay {
  border: none;
  border-radius: 999px;
  font-family: "Poppins", sans-serif;
  font-size: 1.15rem;
  font-weight: 600;
  padding: 16px 38px;
  cursor: pointer;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.btn-yes {
  color: #4a0e2a;
  background: linear-gradient(135deg, var(--gold-soft), var(--pink), var(--pink-deep));
  background-size: 200% auto;
  box-shadow: 0 0 30px rgba(255, 79, 139, 0.55), 0 8px 24px rgba(0, 0, 0, 0.35);
  animation: yesPulse 1.8s ease-in-out infinite, shimmer 3s linear infinite;
}

@keyframes yesPulse {
  0%, 100% { box-shadow: 0 0 26px rgba(255, 79, 139, 0.45), 0 8px 24px rgba(0,0,0,0.35); }
  50%      { box-shadow: 0 0 52px rgba(255, 126, 179, 0.85), 0 8px 24px rgba(0,0,0,0.35); }
}

.btn-yes:hover { transform: scale(1.08); }

.btn-no {
  color: var(--white);
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.25);
  backdrop-filter: blur(6px);
  transition: top 0.35s cubic-bezier(0.2, 0.9, 0.3, 1.3),
              left 0.35s cubic-bezier(0.2, 0.9, 0.3, 1.3),
              transform 0.3s ease, opacity 0.4s ease;
}

.btn-no.fleeing { position: fixed; z-index: 30; }

/* ============================================================
   SCENE 2 — the song
   ============================================================ */
#scene-song {
  justify-content: space-between;
  padding: max(20px, env(safe-area-inset-top)) 18px max(18px, env(safe-area-inset-bottom));
}

.song-header {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: 8px;
}

.pulse-heart {
  font-size: 2.2rem;
  animation: heartbeat 1.05s ease-in-out infinite;
  filter: drop-shadow(0 0 14px rgba(255, 79, 139, 0.7));
}

@keyframes heartbeat {
  0%, 100% { transform: scale(1); }
  14%      { transform: scale(1.25); }
  28%      { transform: scale(1); }
  42%      { transform: scale(1.2); }
  56%      { transform: scale(1); }
}

.song-for {
  font-family: "Great Vibes", cursive;
  font-size: clamp(1.4rem, 5vw, 1.9rem);
  color: var(--gold-soft);
  text-shadow: 0 0 16px rgba(255, 213, 126, 0.4);
}

.eq {
  display: flex;
  gap: 4px;
  height: 16px;
  align-items: flex-end;
  margin-top: 4px;
}
.eq i {
  width: 4px;
  border-radius: 2px;
  background: linear-gradient(to top, var(--pink-deep), var(--gold));
  animation: eqBounce 0.9s ease-in-out infinite;
}
.eq i:nth-child(1) { animation-delay: 0s;    height: 60%; }
.eq i:nth-child(2) { animation-delay: 0.15s; height: 100%; }
.eq i:nth-child(3) { animation-delay: 0.3s;  height: 45%; }
.eq i:nth-child(4) { animation-delay: 0.45s; height: 85%; }
.eq i:nth-child(5) { animation-delay: 0.6s;  height: 55%; }
.eq.paused i { animation-play-state: paused; }

@keyframes eqBounce {
  0%, 100% { transform: scaleY(0.4); }
  50%      { transform: scaleY(1); }
}

.lyrics-viewport {
  flex: 1;
  width: 100%;
  max-width: 720px;
  overflow: hidden;
  position: relative;
  /* NOTE: do NOT use flex/align-items:center here — the JS in script.js
     (tick) positions the active line by translating the track from a
     top-anchored origin. Centering the track would offset every line. */
  mask-image: linear-gradient(to bottom, transparent 0%, black 22%, black 78%, transparent 100%);
  -webkit-mask-image: linear-gradient(to bottom, transparent 0%, black 22%, black 78%, transparent 100%);
}

.lyrics-track {
  width: 100%;
  transition: transform 0.7s cubic-bezier(0.25, 0.9, 0.3, 1);
}

.lyric-line {
  text-align: center;
  font-family: "Playfair Display", serif;
  font-size: clamp(1.15rem, 4.6vw, 1.7rem);
  font-weight: 500;
  line-height: 1.5;
  padding: 14px 10px;
  color: var(--faded);
  transform: scale(0.92);
  transition: color 0.6s ease, transform 0.6s ease, filter 0.6s ease;
  filter: blur(0.6px);
}

.lyric-line.active {
  color: transparent;
  background: linear-gradient(120deg, var(--gold-soft), #ffffff, var(--pink), var(--gold));
  background-size: 220% auto;
  -webkit-background-clip: text;
  background-clip: text;
  transform: scale(1.12);
  filter: blur(0) drop-shadow(0 0 22px rgba(255, 213, 126, 0.45));
  animation: shimmer 3.5s linear infinite;
  font-weight: 700;
}

.lyric-line.passed { color: rgba(255, 247, 251, 0.18); }

.lyric-emoji { font-style: normal; }

/* floating emojis released per lyric line */
.float-emoji {
  position: fixed;
  bottom: -40px;
  z-index: 40;
  pointer-events: none;
  animation: floatUp linear forwards;
}

@keyframes floatUp {
  0%   { transform: translateY(0) rotate(0deg) scale(0.7); opacity: 0; }
  10%  { opacity: 1; }
  100% { transform: translateY(-110vh) rotate(30deg) scale(1.25); opacity: 0; }
}

/* ---------- player bar ---------- */
.player-bar {
  width: 100%;
  max-width: 560px;
  display: flex;
  align-items: center;
  gap: 14px;
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.14);
  backdrop-filter: blur(10px);
  border-radius: 999px;
  padding: 10px 18px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.btn-play {
  border: none;
  background: linear-gradient(135deg, var(--pink), var(--pink-deep));
  color: white;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  font-size: 1.1rem;
  cursor: pointer;
  flex-shrink: 0;
  box-shadow: 0 0 18px rgba(255, 79, 139, 0.6);
  transition: transform 0.2s;
}
.btn-play:hover { transform: scale(1.1); }

.progress-wrap {
  flex: 1;
  height: 8px;
  background: rgba(255, 255, 255, 0.15);
  border-radius: 999px;
  position: relative;
  cursor: pointer;
}

.progress-fill {
  height: 100%;
  width: 0%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--gold), var(--pink-deep));
  box-shadow: 0 0 12px rgba(255, 126, 179, 0.7);
}

.progress-knob {
  position: absolute;
  top: 50%;
  left: 0%;
  transform: translate(-50%, -54%);
  font-size: 1.05rem;
  filter: drop-shadow(0 0 8px rgba(255, 126, 179, 0.9));
}

.time-label {
  font-size: 0.85rem;
  color: var(--gold-soft);
  min-width: 42px;
  text-align: right;
}

.audio-note {
  font-size: 0.8rem;
  color: var(--faded);
  margin-top: 8px;
  text-align: center;
  min-height: 1.2em;
}

/* ============================================================
   SCENE 3 — the forever
   ============================================================ */
.end-box {
  text-align: center;
  max-width: 620px;
}

.end-rings {
  font-size: clamp(4rem, 14vw, 6rem);
  display: inline-block;
  animation: ringSpin 3.2s ease-in-out infinite;
  filter: drop-shadow(0 0 30px rgba(255, 213, 126, 0.7));
}

@keyframes ringSpin {
  0%, 100% { transform: rotate(-12deg) scale(1); }
  50%      { transform: rotate(12deg) scale(1.12); }
}

.end-title {
  font-family: "Great Vibes", cursive;
  font-size: clamp(2.6rem, 9vw, 4.2rem);
  font-weight: 400;
  margin-top: 10px;
  background: linear-gradient(120deg, var(--gold-soft), var(--pink), var(--gold));
  background-size: 200% auto;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: shimmer 4s linear infinite;
  filter: drop-shadow(0 0 18px rgba(255, 126, 179, 0.45));
}

.end-message {
  font-family: "Playfair Display", serif;
  font-size: clamp(1.05rem, 4vw, 1.35rem);
  line-height: 1.7;
  margin-top: 16px;
  color: var(--white);
  text-shadow: 0 0 18px rgba(255, 213, 126, 0.25);
}

.end-sign {
  font-family: "Great Vibes", cursive;
  font-size: clamp(1.6rem, 6vw, 2.2rem);
  margin-top: 22px;
  color: var(--gold-soft);
  text-shadow: 0 0 16px rgba(255, 213, 126, 0.5);
}

.btn-replay {
  margin-top: 30px;
  color: var(--white);
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.3);
  backdrop-filter: blur(6px);
  font-size: 1rem;
}
.btn-replay:hover { transform: scale(1.06); background: rgba(255, 255, 255, 0.18); }
