:root {
  color-scheme: light;
  --bg: #efe3d2;
  --bg-alt: #e2cfb2;
  --card: rgba(255, 248, 238, 0.82);
  --text: #5b3e2f;
  --muted: #886754;
  --primary: #c9885b;
  --primary-hover: #d79b72;
  --secondary: #a97452;
}

* {
  box-sizing: border-box;
}

body {
  position: relative;
  margin: 0;
  min-height: 100vh;
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  color: var(--text);
  background: #0f172c;
  overflow-x: hidden;
}

.animated-bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
  background: #0f172c;
  animation: skyShift 120s ease-in-out forwards;
}

.animated-bg-lottie {
  width: 100%;
  height: 100%;
  transform: scale(1.02);
}

.animated-bg::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(85% 36% at 50% 36%, rgba(255, 247, 233, 0.46) 0%, rgba(255, 247, 233, 0) 72%),
    linear-gradient(12deg, rgba(255, 255, 255, 0.2) 0 8%, rgba(255, 255, 255, 0) 18%),
    linear-gradient(-14deg, rgba(255, 255, 255, 0.16) 0 7%, rgba(255, 255, 255, 0) 20%);
  mix-blend-mode: screen;
  opacity: 0.58;
  animation: cloudDrift 32s ease-in-out infinite, cloudNightFade 120s ease-in-out forwards;
}

.animated-bg::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: 56%;
  height: 3px;
  background: linear-gradient(to right, rgba(255, 220, 170, 0) 0%, rgba(255, 220, 170, 0.72) 48%, rgba(255, 220, 170, 0) 100%);
  opacity: 0.78;
  animation: horizonFade 120s ease-in-out forwards;
}

.sky-glow {
  position: absolute;
  width: 72vw;
  height: 72vw;
  max-width: 780px;
  max-height: 780px;
  left: -12vw;
  top: -28vw;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 220, 156, 0.75) 0%, rgba(255, 220, 156, 0) 68%);
  animation: glowFade 120s ease-in-out forwards;
}

.sun-moon {
  position: absolute;
  top: 40vh;
  left: 48vw;
  width: clamp(58px, 7.6vw, 96px);
  aspect-ratio: 1;
  border-radius: 50%;
  background: #ffd580;
  box-shadow: 0 0 46px rgba(255, 203, 120, 0.82);
  animation: sunToMoon 28s ease-in-out infinite;
  z-index: 1;
}

.sea {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 22%;
  height: 36%;
  background: linear-gradient(to bottom, rgba(62, 120, 152, 0.88) 0%, rgba(27, 66, 92, 0.96) 100%);
  animation: seaShift 120s ease-in-out forwards;
}

.sea::before {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: 2px;
  background: linear-gradient(to right, rgba(255, 218, 163, 0) 0%, rgba(255, 230, 189, 0.88) 50%, rgba(255, 218, 163, 0) 100%);
  opacity: 0.8;
  animation: horizonFade 120s ease-in-out forwards;
}

.sea::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 22%;
  background: linear-gradient(to bottom, rgba(255, 255, 255, 0) 0%, rgba(9, 28, 54, 0.28) 100%);
}

.water-texture {
  position: absolute;
  left: -8%;
  right: -8%;
  bottom: 22%;
  height: 36%;
  opacity: 0.46;
  background:
    radial-gradient(120% 36% at 22% 8%, rgba(255, 255, 255, 0.16) 0%, rgba(255, 255, 255, 0) 65%),
    radial-gradient(130% 42% at 74% 14%, rgba(255, 255, 255, 0.11) 0%, rgba(255, 255, 255, 0) 66%),
    repeating-linear-gradient(
      175deg,
      rgba(255, 255, 255, 0.14) 0 2px,
      rgba(255, 255, 255, 0) 3px 12px
    );
  mix-blend-mode: screen;
  animation: waterShimmer 11s ease-in-out infinite;
}

.wave {
  position: absolute;
  left: -10%;
  width: 120%;
  height: 18px;
  bottom: 22%;
  border-radius: 999px;
  opacity: 0;
  background:
    radial-gradient(120% 100% at 50% 50%, rgba(255, 255, 255, 0.84) 0%, rgba(255, 255, 255, 0.45) 36%, rgba(255, 255, 255, 0) 76%);
  filter: blur(0.4px);
  animation: waveCrash 6.2s linear infinite;
}

.wave-1 {
  animation-delay: 0s;
}

.wave-2 {
  animation-delay: 1.55s;
}

.wave-3 {
  animation-delay: 3.1s;
}

.beach {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 24%;
  background: linear-gradient(to bottom, #9f7156 0%, #855b45 58%, #6f4a3d 100%);
  animation: beachShift 120s ease-in-out forwards;
}

.beach::before {
  content: '';
  position: absolute;
  left: -4%;
  right: -4%;
  top: -12px;
  height: 22px;
  border-radius: 999px;
  background:
    radial-gradient(120% 120% at 50% 50%, rgba(255, 255, 255, 0.82) 0%, rgba(255, 255, 255, 0.2) 48%, rgba(255, 255, 255, 0) 74%);
  opacity: 0.78;
  filter: blur(0.8px);
  animation: tidePulse 5.8s ease-in-out infinite;
}

.beach::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: 34px;
  background: linear-gradient(to bottom, rgba(125, 101, 87, 0.55) 0%, rgba(125, 101, 87, 0.18) 55%, rgba(125, 101, 87, 0) 100%);
}

.couple {
  position: absolute;
  left: 50%;
  bottom: 14%;
  width: 132px;
  height: 86px;
  transform: translateX(-50%);
  animation: silhouetteDarken 120s linear forwards;
  z-index: 4;
}

.person {
  position: absolute;
  bottom: 0;
  width: 46px;
  height: 64px;
  background: #2f2a2c;
  border-radius: 26px 26px 16px 16px;
}

.person::before {
  content: '';
  position: absolute;
  top: -16px;
  left: 10px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #2f2a2c;
}

.person-left {
  left: 18px;
  transform: rotate(6deg);
}

.person-right {
  right: 18px;
  width: 50px;
  transform: rotate(-10deg);
}

.person-right::before {
  left: 12px;
}

.person-left::after {
  content: '';
  position: absolute;
  width: 20px;
  height: 6px;
  right: -6px;
  top: 24px;
  background: #2f2a2c;
  border-radius: 999px;
  transform: rotate(18deg);
}


.music-gate,
.container {
  position: relative;
  z-index: 2;
}

.container {
  width: min(100%, 960px);
  margin: 0 auto;
  padding: 2rem 1rem 3rem;
}

.hero {
  text-align: center;
  margin-bottom: 1.5rem;
}

.hero h2 {
  font-size: clamp(1.6rem, 3vw, 2.4rem);
  margin-bottom: 0.4rem;
}

.hero p {
  margin: 0;
  color: var(--muted);
}

.slideshow-wrap {
  background: var(--card);
  border: 1px solid rgba(134, 98, 74, 0.2);
  border-radius: 18px;
  padding: 1rem;
  backdrop-filter: blur(6px);
}

.quiz-wrap {
  background: var(--card);
  border: 1px solid rgba(134, 98, 74, 0.2);
  border-radius: 18px;
  padding: 1.2rem 1rem;
  margin-bottom: 1rem;
  text-align: center;
}

.quiz-wrap h3 {
  margin: 0 0 0.4rem;
  font-size: clamp(1.25rem, 2.5vw, 1.7rem);
}

.quiz-score {
  margin: 0.2rem 0 0.35rem;
  font-weight: 700;
}

.quiz-progress {
  margin: 0;
  color: var(--muted);
  font-weight: 600;
}

.quiz-question {
  margin: 0.9rem 0;
  font-size: 1.05rem;
  font-weight: 600;
}

.quiz-form {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  align-items: center;
}

.quiz-options {
  width: min(100%, 420px);
  display: grid;
  gap: 0.55rem;
}

.quiz-option {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  text-align: left;
  background: #fff8ee;
  border: 1px solid rgba(134, 98, 74, 0.28);
  border-radius: 12px;
  padding: 0.62rem 0.75rem;
  cursor: pointer;
}

.quiz-option input {
  accent-color: var(--primary);
}

.quiz-feedback {
  min-height: 1.5rem;
  margin: 0.75rem 0 0;
  color: var(--muted);
  font-weight: 600;
}

.quiz-complete {
  margin-top: 0.8rem;
  display: grid;
  gap: 0.65rem;
  justify-items: center;
}

.quiz-final-score {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 700;
}

.debug-skip {
  margin-top: 0.6rem;
  font-size: 0.82rem;
  opacity: 0.92;
}

.slideshow {
  position: relative;
  width: 100%;
  border-radius: 14px;
  background: var(--bg-alt);
}

.slide {
  position: relative;
  margin: 0;
  opacity: 0;
  display: none;
}

.slide img {
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  border-radius: 14px;
}

.caption-display {
  margin-top: 1.5rem;
  padding: 0;
  color: #ffffff;
  font-size: clamp(1.3rem, 2.8vw, 1.9rem);
  font-weight: 600;
  text-align: center;
  min-height: 3rem;
}

.caption-display::after {
  content: '|';
  animation: blink 0.75s step-end infinite;
}

.caption-display.typing-done::after {
  content: '';
  animation: none;
}

@keyframes blink {
  50% { border-color: transparent; }
}

.slide.is-active {
  opacity: 1;
  display: block;
  animation: fadeIn 1.5s ease;
}

@keyframes fadeIn {
  from { opacity: 0; transform: scale(1.02); }
  to { opacity: 1; transform: scale(1); }
}

.controls {
  display: flex;
  justify-content: center;
  margin-top: 1rem;
}

.btn {
  border: 0;
  border-radius: 999px;
  padding: 0.72rem 1.15rem;
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.2s ease, background 0.2s ease, color 0.2s ease;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn-primary {
  background: var(--primary);
  color: #fff9f2;
}

.btn-primary:hover {
  background: var(--primary-hover);
}

.btn-secondary {
  background: var(--secondary);
  color: #fff9f2;
}

.music-gate {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  z-index: 99;
  background: rgba(70, 45, 33, 0.5);
  backdrop-filter: blur(4px);
}

.music-gate-card {
  width: min(92vw, 420px);
  border-radius: 16px;
  background: #f8ecdc;
  border: 1px solid rgba(134, 98, 74, 0.28);
  padding: 1.5rem;
  text-align: center;
}

.music-gate-card h1 {
  margin-top: 0;
  margin-bottom: 0.6rem;
}

.music-gate-card p {
  margin-top: 0;
  margin-bottom: 1rem;
  color: var(--muted);
}

.proposal {
  margin-top: 1.4rem;
  text-align: center;
  padding: 1.2rem 1rem 1.8rem;
  background: var(--card);
  border: 1px solid rgba(134, 98, 74, 0.2);
  border-radius: 18px;
  position: relative;
  min-height: 180px;
}

.proposal h3 {
  margin-top: 0.2rem;
  margin-bottom: 1rem;
  font-size: clamp(1.3rem, 2.8vw, 1.9rem);
}

.proposal-buttons {
  position: relative;
  width: 100%;
  height: 90px;
}

#yesFiveBtn {
  position: absolute;
  left: calc(50% - 165px);
  top: 30px;
}

#yesForeverBtn {
  position: absolute;
  left: calc(50% + 15px);
  top: 30px;
}

.success-message {
  margin-top: 1rem;
  color: #926448;
  font-weight: 700;
}

.confetti-layer {
  position: fixed;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
  z-index: 120;
}

.confetti-piece {
  position: absolute;
  top: -20px;
  width: 10px;
  height: 16px;
  border-radius: 2px;
  opacity: 0.95;
  animation-name: confettiFall;
  animation-timing-function: linear;
  animation-fill-mode: forwards;
}

@keyframes confettiFall {
  0% {
    transform: translateY(-20px) rotate(0deg);
    opacity: 0.95;
  }
  100% {
    transform: translateY(115vh) rotate(720deg);
    opacity: 0;
  }
}

.hidden {
  display: none;
}

@keyframes skyShift {
  0% {
    background: linear-gradient(to bottom, #63a7d9 0%, #84c2ef 28%, #f6b07b 63%, #d4885f 100%);
  }
  100% {
    background: linear-gradient(to bottom, #5f9fce 0%, #79b8e9 30%, #f0a06f 62%, #c87955 100%);
  }
}

@keyframes cloudDrift {
  0%,
  100% {
    transform: translateX(0);
  }
  50% {
    transform: translateX(2.5%);
  }
}

@keyframes cloudNightFade {
  0% {
    opacity: 0.58;
  }
  100% {
    opacity: 0.36;
  }
}

@keyframes horizonFade {
  0% {
    opacity: 0.68;
  }
  100% {
    opacity: 0.9;
  }
}

@keyframes glowFade {
  0% {
    opacity: 0.72;
    transform: scale(0.96);
  }
  100% {
    opacity: 0.9;
    transform: scale(1.05);
  }
}

@keyframes sunToMoon {
  0% {
    top: 39vh;
    left: 46vw;
    background: #ffd067;
    box-shadow: 0 0 30px rgba(255, 194, 94, 0.76);
  }
  100% {
    top: 41vh;
    left: 50vw;
    background: #ffcc5f;
    box-shadow: 0 0 40px rgba(255, 185, 92, 0.86);
  }
}

@keyframes seaShift {
  0% {
    background: linear-gradient(to bottom, rgba(43, 106, 147, 0.9) 0%, rgba(24, 72, 105, 0.95) 64%, rgba(15, 52, 82, 0.98) 100%);
  }
  100% {
    background: linear-gradient(to bottom, rgba(48, 112, 154, 0.92) 0%, rgba(28, 79, 113, 0.95) 64%, rgba(17, 58, 90, 0.98) 100%);
  }
}

@keyframes beachShift {
  0% {
    background: linear-gradient(to bottom, #8f624b 0%, #7b533f 58%, #684535 100%);
  }
  100% {
    background: linear-gradient(to bottom, #996b51 0%, #815944 58%, #704a39 100%);
  }
}

@keyframes waterShimmer {
  0%,
  100% {
    transform: translateX(0) scaleX(1);
    opacity: 0.44;
  }
  50% {
    transform: translateX(2.8%) scaleX(1.02);
    opacity: 0.56;
  }
}

@keyframes waveCrash {
  0% {
    transform: translateY(-28vh) scaleX(0.9);
    opacity: 0;
  }
  35% {
    opacity: 0.18;
  }
  70% {
    opacity: 0.62;
  }
  88% {
    transform: translateY(-1vh) scaleX(1.04);
    opacity: 0.72;
  }
  100% {
    transform: translateY(2.1vh) scaleX(1.1);
    opacity: 0;
  }
}

@keyframes tidePulse {
  0%,
  100% {
    transform: translateY(0) scaleX(0.95);
    opacity: 0.58;
  }
  50% {
    transform: translateY(4px) scaleX(1.03);
    opacity: 0.82;
  }
}

@keyframes silhouetteDarken {
  0% {
    filter: brightness(1);
  }
  100% {
    filter: brightness(0.72);
  }
}

@keyframes dance {
  0%, 100% { transform: translateY(0) rotate(0deg) scale(1); }
  15% { transform: translateY(-15px) rotate(-10deg) scale(1.25); }
  30% { transform: translateY(0) rotate(10deg) scale(1.2); }
  45% { transform: translateY(-12px) rotate(-8deg) scale(1.22); }
  60% { transform: translateY(0) rotate(8deg) scale(1.18); }
  75% { transform: translateY(-8px) rotate(0deg) scale(1.15); }
}

.dance {
  animation: dance 0.7s ease !important;
  z-index: 10;
}

@media (max-width: 620px) {
  .proposal-buttons {
    height: 140px;
  }

  #yesFiveBtn {
    left: 12px;
    top: 78px;
  }

  #yesForeverBtn {
    left: auto;
    right: 12px;
    top: 20px;
  }
}
