@import url("https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;600;700&family=Fraunces:wght@600;700&display=swap");

:root {
  --bg-warm: #f9c7c2;
  --bg-soft: #fde7e3;
  --accent: #d94b56;
  --accent-dark: #a62f39;
  --ink: #3b1e1f;
  --cream: #fff7f4;
  --shadow: 0 20px 45px rgba(166, 47, 57, 0.25);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "DM Sans", sans-serif;
  color: var(--ink);
  background: radial-gradient(circle at top, #fff6f4 0%, var(--bg-soft) 35%, var(--bg-warm) 100%);
  display: grid;
  place-items: center;
  overflow-x: hidden;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  background: url("love.jpg") center / cover no-repeat;
  opacity: 0;
  transition: opacity 0.4s ease;
  z-index: 0;
  pointer-events: none;
}

body.unlocked::before {
  opacity: 0.22;
}

.gate {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  background:
    linear-gradient(rgba(255, 231, 227, 0.9), rgba(255, 231, 227, 0.9)),
    url("geheim.jpg") center / cover no-repeat;
  backdrop-filter: blur(6px);
  z-index: 3;
}

.gate-card {
  width: min(420px, 90vw);
  background: var(--cream);
  border-radius: 24px;
  padding: 2rem;
  box-shadow: var(--shadow);
  display: grid;
  gap: 0.9rem;
  text-align: center;
}

.gate-card h2 {
  font-family: "Fraunces", serif;
  margin: 0;
}

.gate-label {
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  color: var(--accent-dark);
}

.gate-input {
  width: 100%;
  padding: 0.85rem 1rem;
  border-radius: 14px;
  border: 2px solid rgba(166, 47, 57, 0.2);
  font-size: 1rem;
  text-align: center;
}

.gate-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.75rem;
  align-items: center;
}

.gate-input-hidden {
  position: absolute;
  opacity: 0;
  pointer-events: none;
  width: 1px;
  height: 1px;
}

.gate-input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(217, 75, 86, 0.2);
}

.gate-hint {
  color: var(--accent-dark);
  font-size: 0.95rem;
}

.gate-note {
  margin: 0;
  font-size: 0.85rem;
  color: var(--accent-dark);
}

.scene {
  width: min(920px, 92vw);
  display: grid;
  min-height: 100vh;
  gap: 2rem;
  padding: 2.5rem 0 3rem;
  align-content: space-between;
}

.hero {
  text-align: center;
  display: grid;
  gap: 0.75rem;
  align-self: start;
}

.kicker {
  text-transform: uppercase;
  letter-spacing: 0.3em;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--accent-dark);
}

h1 {
  font-family: "Fraunces", serif;
  font-size: clamp(2.2rem, 4vw, 3.4rem);
  margin: 0;
}

.subline {
  font-size: 1.05rem;
  max-width: 580px;
  margin: 0 auto;
}

.card {
  background: var(--cream);
  border-radius: 28px;
  padding: 2.5rem;
  box-shadow: var(--shadow);
  display: grid;
  gap: 1.75rem;
  justify-items: center;
  text-align: center;
  position: relative;
  overflow: hidden;
  align-self: end;
}

.portrait {
  width: 130px;
  height: 130px;
  background: linear-gradient(140deg, #ffd6cf, #f3a7a0);
  border-radius: 40% 60% 55% 45%;
  display: grid;
  place-items: center;
  box-shadow: inset 0 0 0 10px rgba(255, 255, 255, 0.5);
}

.portrait-inner {
  width: 70px;
  height: 70px;
  border-radius: 50%;
  background: var(--accent);
  position: relative;
}

.portrait-inner::before,
.portrait-inner::after {
  content: "";
  position: absolute;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #fff3f0;
  top: 18px;
}

.portrait-inner::before {
  left: 8px;
}

.portrait-inner::after {
  right: 8px;
}

.prompt {
  font-size: 1.1rem;
  max-width: 460px;
}

.gif-wrap {
  width: 120px;
  height: 120px;
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.8);
  display: grid;
  place-items: center;
  box-shadow: 0 12px 25px rgba(217, 75, 86, 0.2);
  overflow: hidden;
}

.gif-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

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

.btn {
  border: none;
  border-radius: 999px;
  padding: 0.85rem 1.8rem;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.btn-yes {
  background: var(--accent);
  color: white;
  box-shadow: 0 12px 20px rgba(217, 75, 86, 0.35);
}

.btn-yes:hover {
  transform: translateY(-2px) scale(1.02);
  box-shadow: 0 18px 25px rgba(217, 75, 86, 0.45);
}

.btn-no {
  background: rgba(255, 255, 255, 0.6);
  color: var(--accent-dark);
  border: 2px dashed rgba(166, 47, 57, 0.4);
}

.gate-picker {
  padding: 0.85rem;
  border: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 10px 18px rgba(217, 75, 86, 0.15);
}

.gate-picker svg {
  width: 20px;
  height: 20px;
  fill: currentColor;
}

.final {
  background: rgba(255, 247, 244, 0.85);
  border-radius: 22px;
  padding: 2rem;
  text-align: center;
  display: grid;
  gap: 0.85rem;
  animation: popIn 0.5s ease forwards;
}

.final h2 {
  font-family: "Fraunces", serif;
  margin: 0;
  font-size: 2.2rem;
}

.signature {
  margin-top: 0.5rem;
  display: grid;
  gap: 0.25rem;
  font-weight: 600;
}

.hidden {
  display: none;
}

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

.heart {
  position: absolute;
  width: 24px;
  height: 24px;
  animation: floatUp 12s linear infinite;
  pointer-events: none;
}

.heart svg {
  width: 100%;
  height: 100%;
  display: block;
}

.heart path {
  fill: currentColor;
}

@keyframes floatUp {
  from {
    transform: translateY(110vh);
    opacity: 0;
  }
  15%,
  85% {
    opacity: 1;
  }
  to {
    transform: translateY(-20vh);
    opacity: 0;
  }
}

@keyframes popIn {
  from {
    transform: translateY(20px) scale(0.98);
    opacity: 0;
  }
  to {
    transform: translateY(0) scale(1);
    opacity: 1;
  }
}

@media (max-width: 720px) {
  .card {
    padding: 2rem 1.5rem;
  }

  .prompt {
    font-size: 1rem;
  }
}

#confetti {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 2;
}

@media (prefers-reduced-motion: reduce) {
  .btn,
  .final,
  .heart,
  #confetti {
    animation: none !important;
    transition: none !important;
  }
}
