* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

@font-face {
  font-family: "RougeScript-Regular";
  src: url("Rouge_Script/RougeScript-Regular.ttf") format("truetype");
  font-weight: normal;
  font-style: normal;
  font-display: swap;
}

body {
  min-height: 100vh;
  overflow: hidden;
  font-family: "RougeScript-Regular", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: linear-gradient(135deg, #ffd1dc, #c7b9ff, #a0e7ff);
  background-size: 400% 400%;
  animation: gradientShift 12s ease infinite;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #4a2c6d;
}

@keyframes gradientShift {
  0% {
    background-position: 0% 50%;
  }

  50% {
    background-position: 100% 50%;
  }

  100% {
    background-position: 0% 50%;
  }
}

.card {
  position: relative;
  z-index: 2;
  text-align: center;
  padding: 40px 30px;
  background: rgba(255, 255, 255, 0.55);
  border-radius: 28px;
  box-shadow: 0 10px 40px rgba(74, 44, 109, 0.25);
  backdrop-filter: blur(6px);
  max-width: 90vw;
  animation: popIn 1.2s cubic-bezier(.22, 1.5, .36, 1) both;
}

@keyframes popIn {
  0% {
    transform: scale(0.3) rotate(-6deg);
    opacity: 0;
  }

  100% {
    transform: scale(1) rotate(0);
    opacity: 1;
  }
}

h1 {
  font-size: clamp(2.2rem, 7vw, 4.5rem);
  color: #d63384;
  text-shadow: 2px 3px 0 #fff;
  margin-bottom: 12px;
  animation: bounce 2s ease-in-out infinite;
}

.letter {
  display: inline-block;
  opacity: 0;
  animation: letterDrop 0.7s cubic-bezier(.34, 1.56, .64, 1) forwards;
  animation-delay: calc(0.8s + var(--i) * 0.12s);
}

@keyframes letterDrop {
  0% {
    opacity: 0;
    transform: translateY(-140px) rotate(-25deg);
  }

  60% {
    opacity: 1;
  }

  100% {
    opacity: 1;
    transform: translateY(0) rotate(0);
  }
}

.dance-letter {
  display: inline-block;
  animation: danceLetter 1s ease-in-out infinite;
  animation-delay: calc(var(--i) * 0.1s);
}

@keyframes danceLetter {

  0%,
  100% {
    transform: translateY(0) rotate(0);
  }

  25% {
    transform: translateY(-8px) rotate(-8deg);
  }

  75% {
    transform: translateY(2px) rotate(8deg);
  }
}

.name {
  font-size: clamp(2.8rem, 9vw, 6rem);
  font-weight: 800;
  background: linear-gradient(90deg, #ff6fb1, #ffb347, #8e7dff, #ff6fb1);
  background-size: 300% auto;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: shimmer 4s linear infinite;
}

@keyframes shimmer {
  to {
    background-position: 300% center;
  }
}

@keyframes bounce {

  0%,
  100% {
    transform: translateY(0);
  }

  50% {
    transform: translateY(-12px);
  }
}

.message {
  margin-top: 18px;
  font-size: clamp(1.1rem, 3vw, 1.5rem);
  line-height: 1.5;
}

.cake {
  margin: 26px auto 0;
  font-size: 5rem;
  display: inline-block;
  animation: wobble 2.5s ease-in-out infinite;
}

@keyframes wobble {

  0%,
  100% {
    transform: rotate(-5deg);
  }

  50% {
    transform: rotate(5deg);
  }
}

button {
  margin-top: 22px;
  padding: 14px 30px;
  font-size: 1.1rem;
  border: none;
  border-radius: 999px;
  background: linear-gradient(90deg, #ff6fb1, #8e7dff);
  color: #fff;
  cursor: pointer;
  box-shadow: 0 6px 18px rgba(142, 125, 255, 0.45);
  transition: transform 0.2s;
}

button:hover {
  transform: scale(1.08);
}

button:active {
  transform: scale(0.96);
}

/* Konfetti & Luftballons */
.piece {
  position: fixed;
  top: -30px;
  z-index: -1000;
  pointer-events: none;
  animation: fall linear forwards;
}

@keyframes fall {
  0% {
    transform: translateY(0) rotate(0deg);
    opacity: 1;
  }

  100% {
    transform: translateY(110vh) rotate(720deg);
    opacity: 0.6;
  }
}

.balloon {
  position: fixed;
  bottom: -120px;
  z-index: -1000;
  font-size: 3rem;
  pointer-events: none;
  animation: rise linear forwards;
}

@keyframes rise {
  0% {
    transform: translateY(0) translateX(0);
  }

  50% {
    transform: translateY(-55vh) translateX(25px);
  }

  100% {
    transform: translateY(-120vh) translateX(-15px);
  }
}

.sparkle {
  position: fixed;
  z-index: -1000;
  font-size: 1.4rem;
  pointer-events: none;
  animation: twinkle 1.6s ease-in-out forwards;
}

@keyframes twinkle {
  0% {
    transform: scale(0) rotate(0);
    opacity: 0;
  }

  50% {
    transform: scale(1.3) rotate(180deg);
    opacity: 1;
  }

  100% {
    transform: scale(0) rotate(360deg);
    opacity: 0;
  }
}

/* Party-Overlay mit Fotos und Glückwünschen */
.wishes {
  position: fixed;
  inset: 0;
  z-index: 10;
  display: none;
  overflow-y: auto;
  background: rgba(74, 44, 109, 0.35);
  backdrop-filter: blur(4px);
  padding: 30px 15px;
}

.wishes.show {
  display: flex;
  justify-content: center;
  align-items: center;
  animation: fadeIn 0.6s ease both;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

.wishes-inner {
  width: min(1000px, 100%);
  background: rgba(255, 255, 255, 0.92);
  border-radius: 28px;
  padding: 30px;
  text-align: center;
  box-shadow: 0 10px 40px rgba(74, 44, 109, 0.35);
  animation: popIn 0.9s cubic-bezier(.22, 1.5, .36, 1) both;
}

.wishes h2 {
  font-size: clamp(1.8rem, 5vw, 2.8rem);
  color: #d63384;
  margin-bottom: 20px;
}

.wishes.final h2 {
  display: none;
}

.wishes.final {
  background: transparent;
  backdrop-filter: none;
}

body.final .card {
  visibility: hidden;
}

.wishes.final .wishes-inner {
  background: transparent;
  backdrop-filter: blur(6px);
  box-shadow: none;
}

.progress {
  height: 8px;
  margin-bottom: 18px;
  border-radius: 999px;
  background: rgba(214, 51, 132, 0.2);
  overflow: hidden;
}

.progress-bar {
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, #ff6fb1, #8e7dff);
}

.progress-bar.run {
  animation: fillBar 10s linear forwards;
}

@keyframes fillBar {
  to {
    width: 100%;
  }
}

.slideshow {
  position: relative;
  min-height: 470px;
}

.slide {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-evenly;
  /* gap: 16px; */
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.8s ease, visibility 0.8s;
}

.slide.active {
  opacity: 1;
  visibility: visible;
}

.slide img {
  width: min(420px, 90%);
  height: 280px;
  object-fit: cover;
  border-radius: 18px;
  border: 4px solid #fff;
  box-shadow: 0 6px 18px rgba(74, 44, 109, 0.25);
}

.slide.active img {
  animation: floatY 4s ease-in-out infinite;
}

@keyframes floatY {

  0%,
  100% {
    transform: translateY(0);
  }

  50% {
    transform: translateY(-8px);
  }
}

.slide-text {
  max-width: 620px;
  padding: 18px 22px;
  border-radius: 20px;
  background: linear-gradient(135deg, #ffd1dc, #e4dbff);
  font-size: 1.1rem;
  line-height: 1.5;
  color: #4a2c6d;
}

.slide-text strong {
  display: block;
  margin-top: 10px;
  color: #d63384;
}

.slide.active .slide-text {
  animation: slideUp 0.8s ease both;
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.final-text {
  text-align: center;
}

.final-text h1 {
  font-size: clamp(2.2rem, 7vw, 4rem);
}

@media (max-width: 600px) {
  .slideshow {
    min-height: 520px;
  }

  .slide img {
    height: 200px;
  }
}

/* iPhone 15 Pro Max (430 x 932 px) */
@media only screen and (device-width: 430px) and (device-height: 932px) {
  body {
    padding: 12px;
  }

  .card {
    padding: 28px 20px;
    border-radius: 24px;
    max-width: 92vw;
    width: 100%;
    min-height: 90vh;
    height: 80%;
    display: flex;
    justify-content: center;
    flex-direction: column;
  }

  h1 {
    font-size: 4.4rem;
  }

  .name {
    font-size: 4.4rem;
  }

  .message {
    font-size: 2rem;
    font-weight: 900;
    text-shadow: 2px 0px 20px #ff0000;
    margin-top: 14px;
  }

  .cake {
    font-size: 13rem;
    margin-top: 18px;
  }

  button {
    padding: 12px 24px;
    width: max-content;
    margin: 0 auto;
  }

  .wishes {
    padding: 16px 10px;
  }

  .wishes-inner {
    padding: 22px 16px;
    border-radius: 24px;
        min-height: 75vh;
    height: 70%;
    display: flex;
    justify-content: center;
    flex-direction: column;
  }

  .wishes h2 {
    font-size: 2.5rem;
    margin-bottom: 12px;
  }

  .slide-text strong {
    font-size: 1.6rem;
  }

  .progress {
    margin-bottom: 12px;
  }

  .slideshow {
    min-height: 500px;
  }

  .slide {
    gap: 12px;
  }

  .slide img {
    width: 100%;
    height: 280px;
  }

  .slide-text {
    font-size: 1rem;
    padding: 14px 16px;
  }

  .final-text h1 {
    font-size: 4.4rem;
  }

  .final-text .name {
    font-size: 4.4rem;
  }
}