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

html, body {
  height: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  font-family: "Baloo 2", system-ui, "Segoe UI", sans-serif;
  background: linear-gradient(-45deg, #ffdde1, #ee9ca7, #d5a6ff, #ffb6d9);
  background-size: 300% 300%;
  animation: gradientShift 14s ease infinite;
  overflow: hidden;
  overscroll-behavior: none;
  -webkit-user-select: none;
  user-select: none;
}

@keyframes gradientShift {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

.stage {
  position: relative;
  width: 100vw;
  height: 100vh;
  height: 100dvh;
}

/* floating hearts in the background */
.floaties {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  z-index: 0;
}

.floaties span {
  position: absolute;
  bottom: -10%;
  font-size: 1.8rem;
  opacity: 0;
  animation: floatUp 9s ease-in infinite;
  filter: drop-shadow(0 4px 6px rgba(0, 0, 0, 0.1));
}

@keyframes floatUp {
  0% { transform: translateY(0) rotate(0deg); opacity: 0; }
  10% { opacity: 0.85; }
  90% { opacity: 0.6; }
  100% { transform: translateY(-110vh) rotate(25deg); opacity: 0; }
}

/* progress dots */
.dots {
  position: absolute;
  top: max(24px, env(safe-area-inset-top));
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 10px;
  z-index: 5;
}

.dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.5);
  transition: background 0.3s ease, transform 0.3s ease;
}

.dot.active {
  background: #ffffff;
  transform: scale(1.3);
  box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.3);
}

.screen {
  display: none;
  position: absolute;
  inset: 0;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px;
  padding-top: max(24px, env(safe-area-inset-top));
  padding-bottom: max(24px, env(safe-area-inset-bottom));
  padding-left: max(24px, env(safe-area-inset-left));
  padding-right: max(24px, env(safe-area-inset-right));
  text-align: center;
  z-index: 1;
  overflow-y: auto;
}

.screen.active {
  display: flex;
}

.card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
  background: rgba(255, 255, 255, 0.55);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid rgba(255, 255, 255, 0.6);
  border-radius: 28px;
  padding: 32px 28px;
  box-shadow: 0 20px 50px rgba(120, 40, 90, 0.25);
  animation: cardIn 0.45s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes cardIn {
  0% { opacity: 0; transform: scale(0.85) translateY(16px); }
  100% { opacity: 1; transform: scale(1) translateY(0); }
}

.card-final {
  background: rgba(255, 255, 255, 0.7);
  animation: cardIn 0.5s cubic-bezier(0.34, 1.56, 0.64, 1), glow 2.4s ease-in-out infinite;
}

@keyframes glow {
  0%, 100% { box-shadow: 0 20px 50px rgba(120, 40, 90, 0.25); }
  50% { box-shadow: 0 20px 60px rgba(255, 195, 120, 0.5); }
}

.gif {
  width: min(280px, 70vw, 40dvh);
  height: min(280px, 70vw, 40dvh);
  object-fit: contain;
  border-radius: 20px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
  background: white;
}

h1 {
  color: #5a1a5e;
  font-weight: 700;
  font-size: clamp(1.3rem, 4.6vw, 2.1rem);
  line-height: 1.25;
  margin: 0;
  max-width: 90vw;
}

.card-final h1 {
  font-size: clamp(1.5rem, 5.2vw, 2.4rem);
}

.music-card {
  width: min(280px, 70vw);
  display: flex;
  flex-direction: column;
  gap: 8px;
  background: rgba(255, 255, 255, 0.6);
  border-radius: 16px;
  padding: 10px;
}

.music-label {
  margin: 0;
  font-size: 0.85rem;
  font-weight: 700;
  color: #5a1a5e;
}

.music-frame {
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: 10px;
  overflow: hidden;
  background: #000;
}

.music-frame iframe {
  width: 100%;
  height: 100%;
  border: none;
  display: block;
}

.buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 16px 20px;
  justify-content: center;
}

button {
  font-family: inherit;
  font-size: 1.15rem;
  font-weight: 700;
  padding: 15px 32px;
  border: none;
  border-radius: 999px;
  cursor: pointer;
  touch-action: manipulation;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.btn-yes {
  background: linear-gradient(135deg, #6fd68a, #3fae5c);
  color: white;
  transform: scale(var(--yes-scale, 1));
  transition: transform 0.2s ease, box-shadow 0.15s ease;
}

.btn-yes:hover {
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.25);
}

.btn-no {
  background: linear-gradient(135deg, #ff8a8a, #f4433f);
  color: white;
}

.btn-no.fleeing {
  position: absolute;
  z-index: 10;
  transition: left 0.15s ease, top 0.15s ease;
}

/* confetti on the final screen */
.confetti {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  z-index: 0;
}

.confetti i {
  position: absolute;
  top: -10%;
  width: 10px;
  height: 16px;
  opacity: 0.9;
  animation: confettiFall 3.2s linear infinite;
}

.confetti i:nth-child(1) { left: 5%; background: #ff6b8a; animation-delay: 0s; }
.confetti i:nth-child(2) { left: 15%; background: #ffd166; animation-delay: 0.3s; }
.confetti i:nth-child(3) { left: 25%; background: #6fd68a; animation-delay: 0.6s; }
.confetti i:nth-child(4) { left: 35%; background: #6ec6ff; animation-delay: 0.9s; }
.confetti i:nth-child(5) { left: 45%; background: #c58aff; animation-delay: 1.2s; }
.confetti i:nth-child(6) { left: 55%; background: #ff6b8a; animation-delay: 0.2s; }
.confetti i:nth-child(7) { left: 65%; background: #ffd166; animation-delay: 0.5s; }
.confetti i:nth-child(8) { left: 75%; background: #6fd68a; animation-delay: 0.8s; }
.confetti i:nth-child(9) { left: 85%; background: #6ec6ff; animation-delay: 1.1s; }
.confetti i:nth-child(10) { left: 95%; background: #c58aff; animation-delay: 1.4s; }
.confetti i:nth-child(11) { left: 50%; background: #ff6b8a; animation-delay: 1.7s; }
.confetti i:nth-child(12) { left: 10%; background: #ffd166; animation-delay: 2s; }

@keyframes confettiFall {
  0% { transform: translateY(0) rotate(0deg); opacity: 0.9; }
  100% { transform: translateY(110vh) rotate(360deg); opacity: 0.7; }
}

/* narrow phones */
@media (max-width: 420px) {
  .screen {
    padding: 16px;
    padding-top: max(16px, env(safe-area-inset-top));
    padding-bottom: max(16px, env(safe-area-inset-bottom));
    padding-left: max(16px, env(safe-area-inset-left));
    padding-right: max(16px, env(safe-area-inset-right));
  }

  .card {
    padding: 22px 18px;
    gap: 14px;
    border-radius: 22px;
    width: 100%;
  }

  .gif {
    width: min(240px, 62vw, 36dvh);
    height: min(240px, 62vw, 36dvh);
    border-radius: 16px;
  }

  h1 {
    font-size: clamp(1.15rem, 5.5vw, 1.6rem);
  }

  button {
    padding: 13px 24px;
    font-size: 1rem;
  }

  .music-card {
    width: min(240px, 62vw);
  }
}

/* very small phones */
@media (max-width: 340px) {
  .gif {
    width: min(190px, 58vw, 32dvh);
    height: min(190px, 58vw, 32dvh);
  }

  .buttons {
    gap: 12px 14px;
  }

  button {
    padding: 11px 20px;
    font-size: 0.92rem;
  }
}

/* short viewports (landscape phones, small tablets) */
@media (max-height: 560px) {
  .screen {
    justify-content: flex-start;
    padding-top: max(56px, env(safe-area-inset-top));
  }

  .card {
    gap: 10px;
    padding: 16px 20px;
  }

  .gif {
    width: min(140px, 30dvh);
    height: min(140px, 30dvh);
  }

  h1 {
    font-size: clamp(1rem, 4vw, 1.3rem);
    line-height: 1.15;
  }

  button {
    padding: 10px 20px;
    font-size: 0.95rem;
  }

  .music-card {
    width: min(200px, 45vw);
  }

  .floaties {
    display: none;
  }
}
