/*
  Global variables for romantic theme
*/
:root {
  --bg-1: #fff5f8;
  --bg-2: #ffe7ee;
  --card: rgba(255, 255, 255, 0.78);
  --text-main: #5b2c3f;
  --text-soft: #8a4e64;
  --primary: #ff4f81;
  --primary-hover: #ec2f6a;
  --secondary: #f8cad8;
  --shadow: 0 16px 40px rgba(156, 64, 98, 0.18);
}

/*
  Reset and base setup
*/
* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text-main);
  font-family: "Nunito", sans-serif;
  background: radial-gradient(circle at top right, #ffe3ee, transparent 40%),
    radial-gradient(circle at bottom left, #ffd6e8, transparent 40%),
    linear-gradient(150deg, var(--bg-1), var(--bg-2));
  overflow-x: hidden;
}

h1,
h2,
h3 {
  margin-top: 0;
  font-family: "Playfair Display", serif;
}

/*
  Helper classes
*/
.hidden {
  display: none !important;
}

.screen {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 2rem 1.2rem;
}

.card {
  width: min(92vw, 640px);
  background: var(--card);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.8);
  border-radius: 24px;
  box-shadow: var(--shadow);
  padding: 2rem;
  text-align: center;
}

.card p {
  margin-top: 0.4rem;
  color: var(--text-soft);
}

/*
  Innocent sticker bubble for wrong password
*/
.wrong-sticker {
  margin: 0.9rem auto 0;
  width: fit-content;
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.55rem 0.9rem;
  border-radius: 999px;
  background: #fff0f6;
  border: 1px solid #ffc5d8;
  color: #a14469;
  box-shadow: 0 10px 22px rgba(255, 109, 157, 0.18);
  transform: scale(0.94);
  opacity: 0;
}

.wrong-sticker.show {
  animation: sticker-pop 1.8s ease forwards;
}

.sticker-face {
  font-size: 1.25rem;
}

.sticker-text {
  font-size: 0.95rem;
  font-weight: 700;
}

/*
  Inputs and buttons
*/
input {
  width: 100%;
  margin: 1.2rem 0 1rem;
  border: 1px solid #f7bdd0;
  border-radius: 12px;
  padding: 0.85rem 1rem;
  font-size: 1rem;
  outline: none;
  background: #fff;
}

input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(255, 79, 129, 0.12);
}

button {
  border: 0;
  border-radius: 999px;
  padding: 0.8rem 1.4rem;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.22s ease, background 0.22s ease, box-shadow 0.22s ease;
}

button:hover {
  transform: translateY(-2px);
}

.primary {
  color: #fff;
  background: linear-gradient(135deg, var(--primary), #ff6f99);
  box-shadow: 0 10px 20px rgba(255, 79, 129, 0.25);
}

.primary:hover {
  background: linear-gradient(135deg, var(--primary-hover), #ff4f81);
}

.secondary {
  color: var(--text-main);
  background: var(--secondary);
}

/*
  Proposal section styling
*/
.proposal-card h2 {
  font-size: clamp(2rem, 5vw, 3.2rem);
  margin-bottom: 1.2rem;
}

.button-row {
  min-height: 66px;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
}

#noBtn {
  position: relative;
}

/*
  Story section
*/
#storySection {
  padding: 3rem 1rem 4rem;
}

.container {
  width: min(1024px, 95vw);
  margin: 0 auto;
}

.section-title {
  text-align: center;
  font-size: clamp(2rem, 4vw, 2.8rem);
  margin-bottom: 1.5rem;
}

.timeline {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1.4rem;
}

.memory-card {
  margin: 0;
  background: rgba(255, 255, 255, 0.8);
  border-radius: 18px;
  overflow: hidden;
  box-shadow: var(--shadow);
  text-align: center;
}

.memory-card img {
  width: 100%;
  height: 250px;
  object-fit: cover;
  display: block;
}

.memory-card figcaption {
  padding: 0.9rem;
  font-weight: 700;
}

.letter-trigger-wrap {
  margin-top: 2rem;
  text-align: center;
}

/*
  Letter overlay
*/
.letter-overlay {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: grid;
  place-items: center;
  background: rgba(75, 24, 45, 0.8);
  padding: 1.2rem;
}

.letter-content {
  position: relative;
  background: linear-gradient(165deg, #fff9fb, #ffeef4);
  color: #5c253b;
  max-width: 760px;
  max-height: 86vh;
  overflow-y: auto;
  border-radius: 18px;
  padding: 2.4rem 2rem;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.25);
}

.letter-content h3 {
  font-size: clamp(1.4rem, 3.4vw, 2.1rem);
  margin-bottom: 1rem;
}

.letter-content p {
  line-height: 1.85;
  font-size: clamp(1rem, 2.8vw, 1.2rem);
}

.close-btn {
  position: absolute;
  right: 0.8rem;
  top: 0.6rem;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: #ffd9e7;
  color: #8b3b57;
  font-size: 1.5rem;
  line-height: 1;
  padding: 0;
}

/*
  Decorative heart animation
*/
.hearts {
  position: fixed;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  z-index: 0;
}

.hearts span {
  position: absolute;
  color: rgba(255, 95, 145, 0.22);
  font-size: 1.5rem;
  animation: float 12s linear infinite;
}

.hearts span:nth-child(1) {
  left: 10%;
  animation-duration: 11s;
}

.hearts span:nth-child(2) {
  left: 28%;
  animation-duration: 14s;
  animation-delay: -2s;
}

.hearts span:nth-child(3) {
  left: 47%;
  animation-duration: 10s;
  animation-delay: -3s;
}

.hearts span:nth-child(4) {
  left: 69%;
  animation-duration: 13s;
  animation-delay: -1s;
}

.hearts span:nth-child(5) {
  left: 84%;
  animation-duration: 15s;
  animation-delay: -4s;
}

@keyframes float {
  0% {
    transform: translateY(100vh) scale(0.8);
    opacity: 0;
  }
  12% {
    opacity: 1;
  }
  80% {
    opacity: 0.9;
  }
  100% {
    transform: translateY(-18vh) scale(1.2);
    opacity: 0;
  }
}

@keyframes sticker-pop {
  0% {
    opacity: 0;
    transform: translateY(8px) scale(0.86);
  }
  18% {
    opacity: 1;
    transform: translateY(0) scale(1.06);
  }
  78% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
  100% {
    opacity: 0;
    transform: translateY(-4px) scale(0.96);
  }
}

/*
  Confetti canvas overlays everything
*/
.confetti-canvas {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 25;
}

/*
  Mobile optimization
*/
@media (max-width: 560px) {
  .card {
    padding: 1.5rem 1.1rem;
  }

  .button-row {
    flex-direction: column;
  }
}
