:root {
  --pink-50: #fff0f5;
  --pink-100: #ffe0ec;
  --pink-200: #ffc2d9;
  --pink-400: #ff7eb0;
  --pink-500: #ff5c9a;
  --pink-700: #c2185b;
  --ink: #6b1f45;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body { height: 100%; }

body {
  font-family: "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  color: var(--ink);
  background: linear-gradient(135deg, var(--pink-100), var(--pink-200) 50%, var(--pink-400));
  background-attachment: fixed;
  overflow: hidden;
}

/* Floating hearts */
.hearts { position: fixed; inset: 0; pointer-events: none; z-index: 0; }
.heart {
  position: absolute;
  bottom: -40px;
  opacity: 0.7;
  animation: floatUp linear forwards;
}
@keyframes floatUp {
  to { transform: translateY(-110vh) rotate(25deg); opacity: 0; }
}

/* Screens */
.screen {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 16px;
  z-index: 1;
  overflow-y: auto;
}
.screen.active { display: flex; animation: fadeIn 0.6s ease; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }

.card {
  width: 100%;
  max-width: 400px;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(6px);
  border-radius: 28px;
  padding: 32px 24px;
  text-align: center;
  box-shadow: 0 12px 40px rgba(194, 24, 91, 0.25);
}

h1 { font-size: 1.6rem; line-height: 1.3; color: var(--pink-700); margin-bottom: 8px; }
h2 { font-family: Georgia, serif; font-style: italic; color: var(--pink-700); margin-bottom: 14px; }
.sub { opacity: 0.8; margin-bottom: 20px; }

/* Lock */
.lock-icon { font-size: 3rem; margin-bottom: 8px; }
.dots { display: flex; justify-content: center; gap: 14px; margin-bottom: 22px; }
.dots span {
  width: 16px; height: 16px; border-radius: 50%;
  border: 2px solid var(--pink-500);
  transition: background 0.15s;
}
.dots span.filled { background: var(--pink-500); }
.dots.shake { animation: shake 0.4s; }
@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-10px); }
  75% { transform: translateX(10px); }
}

.keypad {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  max-width: 260px;
  margin: 0 auto;
}
.keypad button {
  height: 60px;
  font-size: 1.4rem;
  border: none;
  border-radius: 50%;
  background: var(--pink-100);
  color: var(--pink-700);
  cursor: pointer;
  transition: transform 0.1s, background 0.15s;
}
.keypad button:hover { background: var(--pink-200); }
.keypad button:active { transform: scale(0.92); }
.error { min-height: 1.4em; margin-top: 14px; color: var(--pink-700); font-weight: 600; }

/* Letter */
.letter { text-align: left; }
.letter-body p { line-height: 1.65; margin-bottom: 12px; }
.letter-body p { opacity: 0; animation: fadeIn 0.8s forwards; }
.letter-body p:nth-child(1) { animation-delay: 0.3s; }
.letter-body p:nth-child(2) { animation-delay: 1.1s; }
.letter-body p:nth-child(3) { animation-delay: 1.9s; }
.letter-body p:nth-child(4) { animation-delay: 2.7s; }
.letter-body p:nth-child(5) { animation-delay: 2.7s; }
.signature { text-align: right; margin: 8px 0 20px; font-family: Georgia, serif; font-style: italic; }
.letter .btn { display: block; margin: 0 auto; }

/* Question */
.big-emoji { font-size: 3.2rem; margin-bottom: 10px; }
.buttons { display: flex; justify-content: center; gap: 16px; margin-top: 28px; min-height: 56px; }

.btn {
  font-size: 1.1rem;
  font-weight: 600;
  padding: 14px 28px;
  border: none;
  border-radius: 999px;
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s;
}
.btn.primary {
  background: linear-gradient(135deg, var(--pink-400), var(--pink-500));
  color: #fff;
  box-shadow: 0 6px 18px rgba(255, 92, 154, 0.45);
}
.btn.primary:hover { transform: scale(1.06); }
.btn.no { background: #fff; color: var(--pink-700); border: 2px solid var(--pink-400); }
.btn.no.running { position: fixed; z-index: 10; margin: 0; transition: left 0.25s ease, top 0.25s ease; }

#screen-question { overflow: hidden; }
html { overflow: hidden; }
