:root {
  --pink: #ff5da2;
  --orange: #ff9a56;
  --purple: #9b5de5;
  --yellow: #ffd23f;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: 'Comic Sans MS', 'Trebuchet MS', 'Segoe UI', sans-serif;
  color: #3a2145;
  background: linear-gradient(-45deg, var(--pink), var(--orange), var(--purple), var(--yellow));
  background-size: 400% 400%;
  animation: gradientShift 16s ease infinite;
  overflow-x: hidden;
}

@keyframes gradientShift {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

section {
  padding: 80px 24px;
  max-width: 900px;
  margin: 0 auto;
}

.hero {
  text-align: center;
  padding-top: 120px;
}

.hero h1 {
  font-size: clamp(2rem, 9vw, 5rem);
  margin: 0 0 12px;
  color: #fff;
  text-shadow: 3px 3px 0 rgba(0,0,0,0.15);
}

.hero p {
  font-size: 1.3rem;
  color: #fff;
  margin-bottom: 40px;
}

.surprise-btn {
  font-family: inherit;
  font-size: 1.2rem;
  padding: 18px 36px;
  border: none;
  border-radius: 50px;
  background: #fff;
  color: var(--pink);
  font-weight: bold;
  cursor: pointer;
  box-shadow: 0 8px 0 rgba(0,0,0,0.15);
  transition: transform 0.15s ease;
}

.surprise-btn:active {
  transform: translateY(6px);
  box-shadow: 0 2px 0 rgba(0,0,0,0.15);
}

.surprise-msg {
  margin-top: 30px;
  font-size: 1.6rem;
  color: #fff;
  opacity: 0;
  transform: scale(0.7);
  transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.surprise-msg.show {
  opacity: 1;
  transform: scale(1);
}

.card-section h2, .gallery-section h2, .story-section h2, .listen-section h2 {
  text-align: center;
  color: #fff;
  font-size: clamp(1.5rem, 6vw, 2.2rem);
  text-shadow: 2px 2px 0 rgba(0,0,0,0.1);
  margin-bottom: 40px;
}

.story-timeline {
  position: relative;
  padding-left: 34px;
  margin: 0 auto;
  max-width: 640px;
  border-left: 5px solid transparent;
  border-image: linear-gradient(180deg, var(--pink), var(--purple), var(--orange), var(--yellow)) 1;
}

.story-item {
  position: relative;
  margin-bottom: 26px;
  cursor: pointer;
}

.story-item::before {
  content: '';
  position: absolute;
  left: -43px;
  top: 8px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--accent, var(--pink));
  border: 3px solid #fff;
  box-shadow: 0 4px 10px rgba(0,0,0,0.2);
}

.story-card {
  background: #fff;
  border-radius: 16px;
  padding: 16px 20px;
  box-shadow: 0 10px 20px rgba(0,0,0,0.15);
  transition: transform 0.2s ease;
}

.story-item:hover .story-card {
  transform: translateX(6px) rotate(-0.5deg);
}

.story-date {
  display: block;
  font-weight: bold;
  font-size: 0.8rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--accent, var(--pink));
  margin-bottom: 4px;
}

.story-title {
  font-weight: bold;
  color: #3a2145;
}

.story-hint {
  font-size: 0.8rem;
  color: #999;
  margin-top: 4px;
}

.story-more {
  display: none;
  margin-top: 10px;
  color: #555;
  font-size: 0.95rem;
}

.story-item.open .story-hint { display: none; }
.story-item.open .story-more { display: block; }

.reasons-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 20px;
}

.reason-card {
  background: #fff;
  border-radius: 20px;
  padding: 24px;
  text-align: center;
  cursor: pointer;
  perspective: 800px;
  min-height: 140px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 10px 20px rgba(0,0,0,0.15);
  transition: transform 0.25s ease;
}

.reason-card:hover {
  transform: translateY(-6px) rotate(-1deg);
}

.reason-card .front { font-weight: bold; color: var(--purple); font-size: 1.1rem; }
.reason-card .back { display: none; color: #555; font-size: 0.95rem; }
.reason-card.flipped .front { display: none; }
.reason-card.flipped .back { display: block; }

.gallery {
  display: flex;
  flex-wrap: wrap;
  gap: 24px;
  justify-content: center;
}

.polaroid {
  background: #fff;
  padding: 14px 14px 34px;
  border-radius: 4px;
  box-shadow: 0 10px 20px rgba(0,0,0,0.2);
  width: 220px;
  transform: rotate(var(--r, -4deg));
  transition: transform 0.25s ease;
}

.polaroid:nth-child(2) { --r: 3deg; }
.polaroid:nth-child(3) { --r: -2deg; }
.polaroid:nth-child(4) { --r: 5deg; }
.polaroid:nth-child(5) { --r: -3deg; }
.polaroid:nth-child(6) { --r: 2deg; }

.polaroid:hover { transform: rotate(0deg) scale(1.08); }

.polaroid .photo {
  width: 100%;
  height: 220px;
  border-radius: 2px;
  object-fit: cover;
  display: block;
}

.polaroid .caption {
  text-align: center;
  font-size: 0.85rem;
  margin-top: 10px;
  color: #555;
}

.lock-screen {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  z-index: 1000;
}

.lock-card {
  background: #fff;
  border-radius: 24px;
  padding: 40px 32px;
  max-width: 360px;
  width: 100%;
  text-align: center;
  box-shadow: 0 20px 40px rgba(0,0,0,0.25);
}

.lock-heart {
  font-size: 3rem;
  margin-bottom: 12px;
}

.lock-title {
  font-size: 1.6rem;
  margin: 0 0 8px;
  color: #3a2145;
}

.lock-subtitle {
  color: #666;
  font-size: 0.95rem;
  margin: 0 0 24px;
}

.lock-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.lock-input {
  font-family: inherit;
  font-size: 1.05rem;
  padding: 14px 18px;
  border-radius: 50px;
  border: 2px solid #eee;
  text-align: center;
  outline: none;
  transition: border-color 0.2s ease;
}

.lock-input:focus {
  border-color: var(--purple);
}

.lock-btn {
  font-family: inherit;
  font-size: 1.05rem;
  font-weight: bold;
  padding: 14px 28px;
  border: none;
  border-radius: 50px;
  color: #fff;
  cursor: pointer;
  background: linear-gradient(135deg, var(--pink), var(--purple));
  box-shadow: 0 6px 0 rgba(0,0,0,0.15);
  transition: transform 0.15s ease;
}

.lock-btn:active {
  transform: translateY(4px);
  box-shadow: 0 2px 0 rgba(0,0,0,0.15);
}

.lock-error {
  min-height: 20px;
  margin-top: 16px;
  color: #e0457b;
  font-size: 0.9rem;
  font-weight: bold;
}

@keyframes shake {
  10%, 90% { transform: translateX(-2px); }
  20%, 80% { transform: translateX(4px); }
  30%, 50%, 70% { transform: translateX(-8px); }
  40%, 60% { transform: translateX(8px); }
}

.lock-card.shake {
  animation: shake 0.5s ease;
}

.audio-player {
  background: #fff;
  border-radius: 24px;
  padding: 32px;
  max-width: 420px;
  margin: 0 auto;
  box-shadow: 0 10px 20px rgba(0,0,0,0.15);
  text-align: center;
}

.audio-invite {
  font-weight: bold;
  color: var(--purple);
  margin-bottom: 22px;
  font-size: 1.1rem;
}

.play-btn {
  width: 84px;
  height: 84px;
  border-radius: 50%;
  border: none;
  cursor: pointer;
  background: linear-gradient(135deg, var(--pink), var(--purple));
  box-shadow: 0 8px 0 rgba(0,0,0,0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 24px;
  transition: transform 0.15s ease;
}

.play-btn:active {
  transform: translateY(6px);
  box-shadow: 0 2px 0 rgba(0,0,0,0.15);
}

.play-btn .icon-play {
  width: 0;
  height: 0;
  border-style: solid;
  border-width: 14px 0 14px 22px;
  border-color: transparent transparent transparent #fff;
  margin-left: 6px;
}

.play-btn .icon-pause {
  display: none;
  gap: 6px;
}

.play-btn .icon-pause span {
  width: 7px;
  height: 26px;
  background: #fff;
  border-radius: 2px;
}

.play-btn.playing .icon-play { display: none; }
.play-btn.playing .icon-pause { display: flex; }

.audio-progress-track {
  width: 100%;
  height: 8px;
  background: #eee;
  border-radius: 4px;
  cursor: pointer;
  overflow: hidden;
  margin-bottom: 10px;
}

.audio-progress-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--pink), var(--orange), var(--purple));
  border-radius: 4px;
}

.audio-time {
  display: flex;
  justify-content: space-between;
  font-size: 0.8rem;
  color: #999;
}

.finale {
  text-align: center;
  padding-bottom: 140px;
}

.finale .big-heart {
  font-size: 5rem;
  display: inline-block;
  animation: pulse 1.4s ease-in-out infinite;
}

.finale p {
  font-size: 1.4rem;
  color: #fff;
  text-shadow: 2px 2px 0 rgba(0,0,0,0.1);
  margin-top: 16px;
}

@keyframes pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.15); }
}

.confetti-piece {
  position: fixed;
  top: -10px;
  width: 10px;
  height: 10px;
  border-radius: 2px;
  pointer-events: none;
  animation: fall linear forwards;
  z-index: 999;
}

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

/* Sanftes Einblenden beim Scrollen (Startzustand wird per JS gesetzt, siehe main.js) */
.reveal-fade, .reveal-up {
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.reason-card.reveal-fade:nth-child(2) { transition-delay: 0.05s; }
.reason-card.reveal-fade:nth-child(3) { transition-delay: 0.1s; }
.reason-card.reveal-fade:nth-child(4) { transition-delay: 0.15s; }
.reason-card.reveal-fade:nth-child(5) { transition-delay: 0.2s; }
.reason-card.reveal-fade:nth-child(6) { transition-delay: 0.25s; }
.reason-card.reveal-fade:nth-child(7) { transition-delay: 0.3s; }
.reason-card.reveal-fade:nth-child(n+8) { transition-delay: 0.35s; }

.polaroid.reveal-fade:nth-child(2) { transition-delay: 0.05s; }
.polaroid.reveal-fade:nth-child(3) { transition-delay: 0.1s; }
.polaroid.reveal-fade:nth-child(4) { transition-delay: 0.15s; }
.polaroid.reveal-fade:nth-child(5) { transition-delay: 0.2s; }
.polaroid.reveal-fade:nth-child(6) { transition-delay: 0.25s; }

.story-item.reveal-up:nth-child(2) { transition-delay: 0.08s; }
.story-item.reveal-up:nth-child(3) { transition-delay: 0.16s; }
.story-item.reveal-up:nth-child(4) { transition-delay: 0.24s; }

@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}

@media (max-width: 640px) {
  section {
    padding: 56px 20px;
  }

  .hero {
    padding-top: 72px;
  }

  .hero p {
    font-size: 1.05rem;
  }

  .surprise-btn {
    padding: 14px 28px;
    font-size: 1rem;
  }

  .story-timeline {
    padding-left: 26px;
  }

  .story-item::before {
    left: -33px;
    width: 13px;
    height: 13px;
  }

  .reasons-grid {
    gap: 16px;
  }

  .gallery {
    gap: 18px;
  }

  .polaroid {
    width: 45vw;
    max-width: 220px;
  }

  .polaroid .photo {
    height: 45vw;
    max-height: 220px;
  }

  .lock-card {
    padding: 32px 24px;
  }

  .lock-heart {
    font-size: 2.4rem;
  }

  .audio-player {
    padding: 22px;
  }

  .play-btn {
    width: 68px;
    height: 68px;
  }

  .play-btn .icon-play {
    border-width: 11px 0 11px 18px;
  }

  .play-btn .icon-pause span {
    width: 6px;
    height: 20px;
  }

  .finale {
    padding-bottom: 100px;
  }

  .finale .big-heart {
    font-size: 3.5rem;
  }

  .finale p {
    font-size: 1.15rem;
  }
}

@media (max-width: 360px) {
  .polaroid {
    width: 100%;
    max-width: 260px;
  }

  .polaroid .photo {
    height: 200px;
    max-height: none;
  }
}
