/* ===== RESET & BASE ===== */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --pink: #ff6b9d;
  --pink-light: #ffc2d1;
  --pink-dark: #d63384;
  --rose: #ff3c78;
  --bg: #fff0f5;
  --white: #ffffff;
  --text: #5c2040;
  --gold: #ffd700;
}

body {
  font-family: 'Segoe UI', 'Helvetica Neue', Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  overflow-x: hidden;
  min-height: 100vh;
}

/* ===== SPARKLE CANVAS (Hintergrund-Partikel) ===== */
#sparkle-canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0;
}

/* ===== FLOATING HEARTS ===== */
#floating-hearts {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

.floating-heart {
  position: absolute;
  font-size: 1.5rem;
  opacity: 0.4;
  animation: floatUp linear infinite;
  pointer-events: none;
}

@keyframes floatUp {
  0% {
    transform: translateY(100vh) rotate(0deg) scale(1);
    opacity: 0;
  }
  10% {
    opacity: 0.4;
  }
  90% {
    opacity: 0.4;
  }
  100% {
    transform: translateY(-10vh) rotate(360deg) scale(0.5);
    opacity: 0;
  }
}

/* ===== SCREENS ===== */
.screen {
  display: none;
  min-height: 100vh;
  position: relative;
  z-index: 1;
  padding: 2rem 1rem;
  align-items: center;
  justify-content: center;
}

.screen.active {
  display: flex;
  flex-direction: column;
}

/* ===== CARD ===== */
.card {
  background: var(--white);
  border-radius: 2rem;
  padding: 3rem 2.5rem;
  max-width: 520px;
  width: 100%;
  text-align: center;
  box-shadow:
    0 10px 40px rgba(214, 51, 132, 0.15),
    0 0 80px rgba(255, 107, 157, 0.1);
  position: relative;
  animation: fadeInUp 0.8s ease-out;
}

.card-yes {
  max-width: 600px;
}

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

/* ===== HEART ICON ===== */
.heart-icon {
  font-size: 4rem;
  margin-bottom: 1rem;
  animation: heartbeat 1.2s ease-in-out infinite;
}

@keyframes heartbeat {
  0%, 100% { transform: scale(1); }
  15% { transform: scale(1.15); }
  30% { transform: scale(1); }
  45% { transform: scale(1.1); }
  60% { transform: scale(1); }
}

/* ===== TYPOGRAPHY ===== */
h1 {
  font-size: 2.5rem;
  color: var(--pink-dark);
  margin-bottom: 0.5rem;
  letter-spacing: 0.02em;
}

.subtitle {
  font-size: 1.25rem;
  color: var(--text);
  margin-bottom: 0.5rem;
  line-height: 1.5;
}

.subtext {
  font-size: 1rem;
  color: var(--pink);
  margin-bottom: 2rem;
  font-style: italic;
  min-height: 1.5em;
  transition: opacity 0.3s;
}

.yes-title {
  font-size: 3rem;
  color: var(--rose);
  animation: fadeInUp 0.5s ease-out, heartbeat 1.2s ease-in-out infinite;
}

.yes-text {
  font-size: 1.15rem;
  margin: 1rem 0 1.5rem;
  line-height: 1.6;
}

/* ===== BUTTONS ===== */
.buttons {
  display: flex;
  gap: 1.5rem;
  justify-content: center;
  flex-wrap: wrap;
  position: relative;
  min-height: 80px;
}

.btn {
  padding: 1rem 2.5rem;
  border: none;
  border-radius: 50px;
  font-size: 1.2rem;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
  letter-spacing: 0.02em;
}

.btn:active {
  transform: scale(0.97);
}

.btn-ja {
  background: linear-gradient(135deg, var(--pink), var(--rose));
  color: var(--white);
  box-shadow: 0 4px 20px rgba(255, 60, 120, 0.4);
}

.btn-ja:hover {
  transform: scale(1.05);
  box-shadow: 0 6px 30px rgba(255, 60, 120, 0.55);
}

.btn-nein {
  background: var(--white);
  color: var(--pink-dark);
  border: 2px solid var(--pink-light);
  box-shadow: 0 2px 10px rgba(214, 51, 132, 0.1);
  /* Position wird per JS absolut gesetzt wenn der Button flieht */
  transition: left 0.3s ease-out, top 0.3s ease-out, transform 0.2s;
  z-index: 10;
  user-select: none;
  -webkit-user-select: none;
}

.btn-nein.fleeing {
  position: fixed;
}

/* ===== PHOTO FRAME ===== */
.photo-frame {
  width: 280px;
  height: 280px;
  margin: 0 auto 1.5rem;
  border-radius: 1.5rem;
  overflow: hidden;
  border: 4px solid var(--pink-light);
  box-shadow: 0 4px 20px rgba(255, 107, 157, 0.2);
}

.photo-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* ===== GAME ===== */
#game-wrapper {
  width: 100%;
  max-width: 600px;
  margin: 2rem auto 0;
  position: relative;
}

#game-wrapper.hidden {
  display: none;
}

.game-hud {
  display: flex;
  justify-content: space-around;
  background: var(--white);
  border-radius: 1rem 1rem 0 0;
  padding: 0.75rem 1rem;
  font-size: 1rem;
  box-shadow: 0 -2px 10px rgba(214, 51, 132, 0.1);
}

.game-hud strong {
  color: var(--rose);
}

#game-canvas {
  display: block;
  width: 100%;
  background: linear-gradient(to bottom, #fff5f9, #ffe0ec);
  border-radius: 0 0 1rem 1rem;
  box-shadow: 0 4px 20px rgba(214, 51, 132, 0.15);
}

/* ===== GAME OVER OVERLAY ===== */
#game-over-overlay {
  position: absolute;
  inset: 0;
  background: rgba(255, 240, 245, 0.92);
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 1rem;
  z-index: 10;
}

#game-over-overlay.hidden {
  display: none;
}

.game-over-box {
  text-align: center;
  padding: 2rem;
}

.game-over-box h2 {
  font-size: 2rem;
  color: var(--pink-dark);
  margin-bottom: 0.5rem;
}

.game-over-box p {
  font-size: 1.1rem;
  margin-bottom: 0.5rem;
}

.game-over-box .btn {
  margin-top: 1rem;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 600px) {
  .card {
    padding: 2rem 1.5rem;
  }

  h1 {
    font-size: 1.8rem;
  }

  .subtitle {
    font-size: 1.05rem;
  }

  .btn {
    padding: 0.85rem 1.8rem;
    font-size: 1.05rem;
  }

  .photo-frame {
    width: 220px;
    height: 220px;
  }

  .yes-title {
    font-size: 2.2rem;
  }
}
