:root {
  --bg1: #ffffff;
  --bg2: #ee9ca7;
  --bg3: #dd92c4;
  --heart1: #ff3b7b;
  --heart2: #ff6b9e;
  --heart3: #ff96b5;
}

html,
body {
  height: 100%;
  margin: 0;
}

body {
  background:
    radial-gradient(1200px 800px at 80% -10%, var(--bg3), transparent 60%),
    radial-gradient(900px 600px at -10% 20%, var(--bg2), transparent 60%),
    linear-gradient(160deg, var(--bg1), var(--bg2) 60%, var(--bg3));
  overflow: hidden;
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto,
    "Helvetica Neue", Arial;
}

/* Hearts canvas = full-screen background */
canvas#hearts {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  display: block;
  filter: drop-shadow(0 4px 12px rgba(255, 80, 130, 0.18));
}

/* Content wrapper = full-screen overlay, centered */
.content {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 1.5rem;
  z-index: 1;
  text-align: center;
  color: #7a0c2e;
  text-shadow: 0 2px 14px rgba(255, 255, 255, 0.6);
  pointer-events: none; /* we'll re-enable on the card */
}

h1 {
  margin: 0;
  font-weight: 800;
  letter-spacing: 0.02em;
  line-height: 1;
  font-size: clamp(28px, 6vw, 64px);
}

.content > .card p {
  opacity: 0.8;
  margin: 0.6rem 0 0;
  font-size: clamp(14px, 2.5vw, 18px);
}

/* --- Card container on top of hearts --- */
.card {
  background: rgba(255, 255, 255, 0.85);
  padding: 2.5rem 2rem;
  border-radius: 1.5rem;
  box-shadow: 0 18px 45px rgba(0, 0, 0, 0.12);
  max-width: 480px;
  /* If the card content is taller than the viewport (e.g. the letter page),
     let the card scroll instead of overflowing off-screen. */
  max-height: calc(100vh - 3rem);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  width: 90%;
  margin: 0 auto;
  pointer-events: auto; /* clickable even though parent has none */
}

/* --- Buttons --- */
.buttons {
  margin-top: 1.6rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  justify-content: center;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.7rem 1.4rem;
  border-radius: 999px;
  font-size: 0.95rem;
  font-weight: 600;
  text-decoration: none;
  border: 1px solid transparent;
  cursor: pointer;
  transition:
    transform 0.12s ease,
    box-shadow 0.12s ease,
    background-color 0.12s ease,
    color 0.12s ease,
    border-color 0.12s ease;
  text-transform: lowercase;
}

.btn-primary {
  background: #ff3b7b;
  color: #fff;
  box-shadow: 0 8px 20px rgba(255, 59, 123, 0.35);
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 26px rgba(255, 59, 123, 0.5);
}

.btn-secondary {
  background: #ffffff;
  color: #7a0c2e;
  border-color: rgba(122, 12, 46, 0.25);
}

.btn-secondary:hover {
  background: #ffe6ee;
  border-color: rgba(122, 12, 46, 0.4);
}

/* Ghost-style button for “Back” etc. */
.btn-ghost {
  background: transparent;
  color: #7a0c2e;
  border-color: rgba(122, 12, 46, 0.3);
}

.btn-ghost:hover {
  background: rgba(255, 255, 255, 0.6);
}

/* --- Feelings form page --- */
.feelings-text {
  margin-top: 0.75rem;
  font-size: 0.9rem;
  opacity: 0.8;
}

form {
  margin-top: 1.2rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

textarea {
  resize: vertical;
  min-height: 140px;
  max-height: 260px;
  border-radius: 1rem;
  border: 1px solid rgba(122, 12, 46, 0.25);
  padding: 0.9rem 1rem;
  font-family: inherit;
  font-size: 0.95rem;
  outline: none;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.04);
}

textarea:focus {
  border-color: #ff3b7b;
  box-shadow: 0 0 0 1px rgba(255, 59, 123, 0.3);
}

.form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  justify-content: center;
}

/* --- Slideshow page --- */
.slideshow {
  margin-top: 1.4rem;
}

.slide {
  display: none;
  animation: fade-in 0.35s ease;
}

.slide.active {
  display: block;
}

.slide img {
  max-width: 100%;
  border-radius: 1.2rem;
  display: block;
  margin: 0 auto 0.75rem;
  box-shadow: 0 14px 32px rgba(0, 0, 0, 0.18);
}

.slide p {
  margin-top: 0.4rem;
  font-size: 0.95rem;
}

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

.back-link {
  margin-top: 1.2rem;
  display: flex;
  justify-content: center;
}

/* Simple fade animation */
@keyframes fade-in {
  from {
    opacity: 0;
    transform: translateY(4px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Accessibility: respect reduced motion */
@media (prefers-reduced-motion: reduce) {
  canvas#hearts {
    animation: none !important;
  }
}

