:root {
  --bg: #fff5f7;
  --accent: #e35d7a;
  --accent-dark: #b8395a;
  --text: #4a2c33;
  --card-shadow: 0 20px 40px rgba(179, 60, 90, 0.18);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  overflow-x: hidden;
}

/* ---------- Password gate ---------- */

#gate {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: radial-gradient(circle at 50% 20%, #ffe3ea 0%, var(--bg) 65%);
  transition: opacity 0.6s ease;
}

#gate.hidden {
  opacity: 0;
  pointer-events: none;
}

.gate-box {
  text-align: center;
  max-width: 320px;
  width: 100%;
}

.gate-hint {
  font-size: 1.4rem;
  margin-bottom: 24px;
  color: var(--accent-dark);
}

#password-input {
  width: 100%;
  padding: 14px 16px;
  font-size: 1.1rem;
  border: 2px solid #f0c3cf;
  border-radius: 12px;
  outline: none;
  text-align: center;
  letter-spacing: 4px;
  background: #fff;
  color: var(--text);
}

#password-input:focus {
  border-color: var(--accent);
}

#unlock-btn {
  margin-top: 14px;
  width: 100%;
  padding: 14px 16px;
  font-size: 1.05rem;
  border: none;
  border-radius: 12px;
  background: var(--accent);
  color: #fff;
  cursor: pointer;
  transition: background 0.2s ease, transform 0.1s ease;
}

#unlock-btn:hover { background: var(--accent-dark); }
#unlock-btn:active { transform: scale(0.98); }

.gate-error {
  margin-top: 14px;
  color: var(--accent-dark);
  font-size: 0.9rem;
}

.shake {
  animation: shake 0.4s;
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  20%, 60% { transform: translateX(-8px); }
  40%, 80% { transform: translateX(8px); }
}

/* ---------- Story ---------- */

#story {
  scroll-snap-type: y proximity;
  height: 100vh;
  overflow-y: auto;
}

.scene {
  scroll-snap-align: start;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 48px 24px;
  gap: 24px;
  text-align: center;
}

.scene img {
  max-width: min(420px, 85vw);
  max-height: 55vh;
  width: auto;
  border-radius: 20px;
  box-shadow: var(--card-shadow);
  object-fit: cover;
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.8s ease, transform 0.8s ease;
}

.scene p {
  font-size: 1.2rem;
  max-width: 480px;
  line-height: 1.5;
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.8s ease 0.15s, transform 0.8s ease 0.15s;
}

.scene.visible img,
.scene.visible p {
  opacity: 1;
  transform: translateY(0);
}

.scroll-hint {
  position: absolute;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 0.85rem;
  color: var(--accent-dark);
  opacity: 0.7;
  animation: bounce 2s infinite;
}

@keyframes bounce {
  0%, 100% { transform: translate(-50%, 0); }
  50% { transform: translate(-50%, 6px); }
}

/* ---------- Finale ---------- */

.finale h1 {
  font-size: 1.8rem;
  color: var(--accent-dark);
  max-width: 480px;
}

.finale-actions {
  display: flex;
  gap: 16px;
}

#yes-btn {
  padding: 16px 32px;
  font-size: 1.15rem;
  border: none;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  cursor: pointer;
  box-shadow: var(--card-shadow);
  transition: background 0.2s ease, transform 0.1s ease;
}

#yes-btn:hover { background: var(--accent-dark); }
#yes-btn:active { transform: scale(0.97); }

#confirmation {
  display: none;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}

#confirmation.visible {
  display: flex;
}

#confirmation h1 {
  font-size: 2rem;
  color: var(--accent-dark);
}

.hearts {
  position: fixed;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
  z-index: 10;
}

.heart {
  position: absolute;
  top: -10vh;
  font-size: 1.8rem;
  animation: fall linear forwards;
}

@keyframes fall {
  to {
    transform: translateY(115vh) rotate(360deg);
    opacity: 0.9;
  }
}
