/* ============ Grundlagen ============ */
:root {
  --pink: #ff5da2;
  --coral: #ff7b54;
  --yellow: #ffb703;
  --teal: #06d6a0;
  --sky: #4cc9f0;
  --purple: #9b5de5;
  --ink: #2b2440;
  --paper: #fff8f0;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: "Baloo 2", "Comic Sans MS", ui-rounded, system-ui, sans-serif;
  color: var(--ink);
  background-color: var(--paper);
  background-image:
    radial-gradient(#ffe1ef 10%, transparent 11%),
    radial-gradient(#e0f7ff 10%, transparent 11%);
  background-size: 46px 46px;
  background-position: 0 0, 23px 23px;
  min-height: 100vh;
  overflow-x: hidden;
}

#confetti {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 50;
}

/* ============ Hero ============ */
.hero {
  text-align: center;
  padding: 3.5rem 1.25rem 2.5rem;
}

.hero-emojis {
  font-size: 2rem;
  margin-bottom: 0.75rem;
  display: flex;
  justify-content: center;
  gap: 0.6rem;
}

.hero-emojis span {
  display: inline-block;
  animation: floaty 2.6s ease-in-out infinite;
}
.hero-emojis span:nth-child(2) { animation-delay: 0.3s; }
.hero-emojis span:nth-child(3) { animation-delay: 0.6s; }
.hero-emojis span:nth-child(4) { animation-delay: 0.9s; }
.hero-emojis span:nth-child(5) { animation-delay: 1.2s; }

@keyframes floaty {
  0%, 100% { transform: translateY(0) rotate(-4deg); }
  50% { transform: translateY(-10px) rotate(4deg); }
}

.hero h1 {
  font-size: clamp(2rem, 6.5vw, 3.6rem);
  font-weight: 800;
  line-height: 1.15;
  max-width: 18ch;
  margin: 0 auto;
  animation: wiggle 5s ease-in-out infinite;
}

.hero h1 .name {
  background: linear-gradient(90deg, var(--pink), var(--coral), var(--yellow), var(--teal), var(--purple));
  background-size: 300% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: gradient-slide 6s linear infinite;
}

@keyframes wiggle {
  0%, 100% { transform: rotate(-1deg); }
  50% { transform: rotate(1deg); }
}

@keyframes gradient-slide {
  to { background-position: 300% 0; }
}

.hero-sub {
  margin-top: 1rem;
  font-size: clamp(1.05rem, 3vw, 1.35rem);
  font-weight: 700;
  color: var(--purple);
}

/* ============ Sektionen ============ */
main {
  max-width: 780px;
  margin: 0 auto;
  padding: 0 1.25rem 3rem;
}

section {
  margin-top: 2.5rem;
}

h2 {
  font-size: clamp(1.5rem, 4.5vw, 2rem);
  font-weight: 800;
  text-align: center;
}

.section-sub {
  text-align: center;
  font-weight: 600;
  color: #6d6486;
  margin: 0.35rem auto 1.5rem;
  max-width: 46ch;
}

/* ============ Karten ============ */
.card {
  position: relative;
  background: #fff;
  border: 3px solid var(--ink);
  border-radius: 22px;
  padding: 1.1rem 1.25rem;
  box-shadow: 7px 7px 0 var(--pink);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.card:hover {
  transform: translate(-2px, -3px) rotate(0deg) !important;
  box-shadow: 10px 11px 0 var(--pink);
}

.event-list {
  display: flex;
  flex-direction: column;
  gap: 1.35rem;
}

.event-list .card:nth-child(odd) { transform: rotate(-0.7deg); }
.event-list .card:nth-child(even) { transform: rotate(0.6deg); }
.event-list .card:nth-child(5n+1) { box-shadow: 7px 7px 0 var(--pink); }
.event-list .card:nth-child(5n+2) { box-shadow: 7px 7px 0 var(--teal); }
.event-list .card:nth-child(5n+3) { box-shadow: 7px 7px 0 var(--yellow); }
.event-list .card:nth-child(5n+4) { box-shadow: 7px 7px 0 var(--sky); }
.event-list .card:nth-child(5n+5) { box-shadow: 7px 7px 0 var(--purple); }

.card.event {
  display: flex;
  gap: 1rem;
  align-items: flex-start;
}

.card-emoji {
  font-size: 2.4rem;
  line-height: 1;
  margin-top: 0.2rem;
}

.card-body {
  flex: 1;
  min-width: 0;
}

.card-date {
  font-size: 0.8rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--purple);
}

.card-title {
  font-size: 1.25rem;
  font-weight: 800;
  margin: 0.15rem 0 0.25rem;
}

.card-desc {
  font-weight: 500;
  line-height: 1.45;
}

.badge {
  position: absolute;
  top: -14px;
  right: -10px;
  font-size: 1.5rem;
  background: #fff;
  border: 3px solid var(--ink);
  border-radius: 50%;
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  transform: rotate(10deg);
  box-shadow: 3px 3px 0 rgba(43, 36, 64, 0.25);
}

.card.unlocked {
  animation: card-pop 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes card-pop {
  0% { transform: scale(0.94); }
  60% { transform: scale(1.03); }
  100% { transform: scale(1); }
}

.countdown {
  display: inline-block;
  margin-top: 0.7rem;
  background: var(--ink);
  color: var(--yellow);
  font-weight: 700;
  font-size: 0.9rem;
  padding: 0.3rem 0.9rem;
  border-radius: 999px;
}

.card.unlocked .countdown {
  display: none;
}

/* ============ Geschenke ============ */
.present-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 1.35rem;
}

.card.present {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 0.5rem;
  padding: 1.4rem 1.1rem 1.2rem;
}

.present-grid .card:nth-child(odd) { transform: rotate(0.8deg); box-shadow: 6px 6px 0 var(--coral); }
.present-grid .card:nth-child(even) { transform: rotate(-0.8deg); box-shadow: 6px 6px 0 var(--teal); }

.present-text {
  font-weight: 600;
  line-height: 1.4;
}

/* ============ Scramble-Effekt ============ */
.scramble {
  animation: hueshift 8s linear infinite;
}

@keyframes hueshift {
  to { filter: hue-rotate(360deg); }
}

.scramble .word {
  display: inline-block;
  white-space: nowrap;
}

.scramble .ch {
  display: inline-block;
  /* Feste Breite pro Zeichen, damit der Zeilenumbruch beim
     Glyphen-Tausch stabil bleibt und das Layout nicht springt */
  width: 1ch;
  text-align: center;
  overflow: visible;
  font-weight: 800;
  animation: bob 2.4s ease-in-out infinite;
}

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

.scramble .ch.pop {
  animation: bob 2.4s ease-in-out infinite, chpop 0.35s ease;
}

@keyframes chpop {
  0% { transform: scale(1.45) rotate(8deg); opacity: 0.4; }
  100% { transform: scale(1) rotate(0deg); opacity: 1; }
}

.scramble .ch.sparkle {
  animation: bob 2.4s ease-in-out infinite, sparklepop 0.55s ease;
}

@keyframes sparklepop {
  0% { transform: scale(0.4) rotate(-20deg); }
  45% { transform: scale(1.7) rotate(12deg); }
  100% { transform: scale(1) rotate(0deg); }
}

.scramble .ch.fixed {
  color: var(--ink) !important;
  animation: fix-in 0.3s ease;
}

@keyframes fix-in {
  0% { transform: scale(1.3); }
  100% { transform: scale(1); }
}

/* ============ Testmodus-Badge ============ */
#test-banner {
  position: fixed;
  bottom: 14px;
  left: 14px;
  z-index: 60;
  background: var(--ink);
  color: #fff;
  font-family: inherit;
  font-weight: 700;
  font-size: 0.85rem;
  padding: 0.4rem 0.95rem;
  border-radius: 999px;
  border: 2px solid var(--yellow);
  box-shadow: 3px 3px 0 rgba(43, 36, 64, 0.3);
}

/* ============ Footer ============ */
footer {
  text-align: center;
  padding: 2rem 1rem 2.5rem;
  font-weight: 700;
  color: #6d6486;
}

/* ============ Mobil ============ */
@media (max-width: 480px) {
  .card.event {
    flex-direction: column;
    gap: 0.4rem;
  }
  .card-emoji {
    font-size: 2rem;
    margin-top: 0;
  }
}

/* ============ Reduzierte Bewegung ============ */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }
}
