/* --- Base & moody romantic background --- */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html,
body {
  height: 100%;
}

body {
  font-family: "Segoe UI", system-ui, -apple-system, sans-serif;
  color: #3d2f45;
  background: linear-gradient(
    160deg,
    #2a1a28 0%,
    #4a2a3d 25%,
    #6b3d55 50%,
    #8a4a62 75%,
    #3d2538 100%
  );
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  min-height: 100dvh;
}

/* Subtle gothic atmosphere: vignette + faint shapes */
.hearts-bg {
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(ellipse at center, transparent 40%, rgba(15, 8, 18, 0.45) 100%),
    radial-gradient(circle at 12% 18%, rgba(180, 100, 130, 0.18) 0%, transparent 42%),
    radial-gradient(circle at 88% 82%, rgba(120, 60, 90, 0.22) 0%, transparent 38%),
    radial-gradient(circle at 50% 100%, rgba(40, 20, 35, 0.35) 0%, transparent 55%);
  animation: bgPulse 10s ease-in-out infinite alternate;
}

/* Faint decorative arches — very subtle gothic hint */
.hearts-bg::before,
.hearts-bg::after {
  content: "";
  position: absolute;
  width: 140px;
  height: 200px;
  border: 1px solid rgba(80, 45, 65, 0.12);
  border-radius: 70px 70px 0 0;
  top: 8%;
  opacity: 0.5;
}

.hearts-bg::before {
  left: 6%;
  transform: rotate(-8deg);
}

.hearts-bg::after {
  right: 6%;
  transform: rotate(8deg) scaleX(-1);
}

@keyframes bgPulse {
  from { opacity: 0.9; }
  to   { opacity: 1; }
}

/* --- Layout --- */
.container {
  position: relative;
  z-index: 1;
  width: min(92vw, 480px);
  padding: 1rem;
}

.card {
  background: #f5e4ea;
  border-radius: 10px;
  padding: 2.5rem 2rem;
  text-align: center;
  box-shadow: 0 3px 12px rgba(20, 10, 25, 0.18);
  border: 1px solid #3d2538;
}

.fade-in {
  animation: fadeIn 0.8s ease-out;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(16px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.hidden {
  display: none !important;
}

.emoji {
  font-size: 2.5rem;
  margin-bottom: 0.75rem;
  animation: bounce 2s ease-in-out infinite;
}

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

.question {
  font-size: clamp(1.25rem, 4.5vw, 1.65rem);
  font-weight: 600;
  line-height: 1.45;
  margin-bottom: 2rem;
  color: #4a3548;
}

/* --- Buttons --- */
.buttons {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  justify-content: center;
  align-items: center;
  min-height: 56px;
}

.btn {
  font-size: 1.05rem;
  font-weight: 600;
  padding: 0.75rem 2rem;
  border-radius: 6px;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.btn-yes,
.btn-no {
  background: linear-gradient(145deg, #c43d6e, #a82f58);
  color: #fff;
  border: 1px solid #2a1520;
  box-shadow: 0 2px 8px rgba(30, 10, 20, 0.25);
}

.btn-yes:hover,
.btn-no:hover {
  transform: scale(1.03);
  background: linear-gradient(145deg, #d44a7a, #b83662);
  box-shadow: 0 3px 10px rgba(30, 10, 20, 0.3);
}

.btn-yes:active,
.btn-no:active {
  transform: scale(0.98);
}

/* No button starts in flow, then JS switches it to fixed positioning when dodging */
.btn-no.dodging {
  position: fixed;
  z-index: 100;
  transition: left 0.18s ease-out, top 0.18s ease-out;
}

/* --- Success screen --- */
.success-card {
  animation: successPop 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes successPop {
  from {
    opacity: 0;
    transform: scale(0.85);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

.success-message {
  font-size: clamp(1.75rem, 6vw, 2.25rem);
  font-weight: 700;
  color: #a82f58;
  margin-bottom: 0.5rem;
}

.success-subtext {
  font-size: 1.1rem;
  color: #5c4a58;
}

/* --- Optional comment on success screen --- */
.comment-section {
  margin-top: 1.75rem;
  padding-top: 1.5rem;
  border-top: 1px solid rgba(61, 37, 56, 0.15);
  text-align: left;
}

.comment-label {
  display: block;
  font-size: 0.95rem;
  font-weight: 600;
  color: #4a3548;
  margin-bottom: 0.5rem;
}

.comment-input {
  width: 100%;
  padding: 0.5rem 0.65rem;
  font-family: inherit;
  font-size: 0.9rem;
  line-height: 1.4;
  color: #3d2f45;
  background: #edd8df;
  border: 1px solid #3d2538;
  border-radius: 6px;
  resize: vertical;
  min-height: 52px;
  max-height: 96px;
  margin-bottom: 0.75rem;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.comment-input::placeholder {
  color: #8a7080;
}

.comment-input:focus {
  outline: none;
  border-color: #a82f58;
  box-shadow: 0 0 0 2px rgba(168, 47, 88, 0.15);
}

.comment-send {
  width: 100%;
  max-width: 140px;
  padding: 0.6rem 1.25rem;
  font-size: 0.95rem;
}

.comment-send:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

.comment-error {
  margin-top: 0.75rem;
  font-size: 0.85rem;
  color: #8a4a5a;
}

.comment-sent {
  font-size: 0.95rem;
  font-weight: 600;
  color: #5c4a58;
  text-align: center;
  animation: fadeIn 0.4s ease-out;
}

/* --- Celebration hearts --- */
.celebration {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 50;
  overflow: hidden;
}

.floating-heart {
  position: absolute;
  font-size: 1.5rem;
  animation: floatUp 2.5s ease-out forwards;
  opacity: 0;
}

@keyframes floatUp {
  0% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
  100% {
    opacity: 0;
    transform: translateY(-120px) scale(1.3);
  }
}

.confetti {
  position: absolute;
  width: 8px;
  height: 8px;
  border-radius: 2px;
  animation: confettiFall 2s ease-out forwards;
}

@keyframes confettiFall {
  0% {
    opacity: 1;
    transform: translateY(0) rotate(0deg);
  }
  100% {
    opacity: 0;
    transform: translateY(100vh) rotate(720deg);
  }
}

/* --- Responsive tweaks --- */
@media (max-width: 480px) {
  .card {
    padding: 2rem 1.25rem;
    border-radius: 8px;
  }

  .buttons {
    flex-direction: column;
    gap: 0.75rem;
  }

  .btn {
    width: 100%;
    max-width: 220px;
  }

  .comment-send {
    max-width: none;
  }

  .hearts-bg::before,
  .hearts-bg::after {
    width: 90px;
    height: 130px;
  }
}
