:root {
  --font-heading: 'Playfair Display', Georgia, serif;
  --font-body: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  
  --bg-primary: #0d0814;
  --bg-gradient: radial-gradient(circle at 15% 20%, rgba(224, 86, 136, 0.18), transparent 45%),
                 radial-gradient(circle at 85% 15%, rgba(243, 156, 18, 0.15), transparent 40%),
                 radial-gradient(circle at 50% 80%, rgba(155, 89, 182, 0.2), transparent 50%),
                 linear-gradient(160deg, #0d0814 0%, #170d24 50%, #0a0610 100%);

  --card-bg: rgba(255, 255, 255, 0.05);
  --card-border: rgba(255, 255, 255, 0.12);
  --card-border-hover: rgba(247, 143, 179, 0.4);
  --card-glow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);

  --text-main: #fdfbf7;
  --text-muted: #bfaec9;
  --text-accent: #f78fb3;
  --text-gold: #f6d365;

  --accent-gradient: linear-gradient(135deg, #ff758c 0%, #ff7eb3 100%);
  --gold-gradient: linear-gradient(135deg, #f6d365 0%, #fda085 100%);
  --heart-color: #ff477e;
  
  --radius-lg: 24px;
  --radius-md: 16px;
  --radius-sm: 10px;
}

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

body {
  font-family: var(--font-body);
  background: var(--bg-gradient);
  background-attachment: fixed;
  background-color: var(--bg-primary);
  color: var(--text-main);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  position: relative;
  overflow-x: hidden;
  line-height: 1.6;
}

/* Background floating ambient particles */
.ambient-glow {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

.ambient-circle {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.25;
  animation: floatOrb 18s ease-in-out infinite alternate;
}

.ambient-circle-1 {
  width: 420px;
  height: 420px;
  background: #ff758c;
  top: -80px;
  left: -80px;
}

.ambient-circle-2 {
  width: 500px;
  height: 500px;
  background: #9b59b6;
  bottom: -100px;
  right: -100px;
  animation-duration: 22s;
}

@keyframes floatOrb {
  0% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(60px, 40px) scale(1.1); }
  100% { transform: translate(-40px, 80px) scale(0.95); }
}

/* Confetti canvas */
#confetti-canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  pointer-events: none;
  z-index: 99;
}

/* Main Container */
.page-wrapper {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 900px;
  margin: 0 auto;
  padding: 48px 24px 80px 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* View Sections */
.view-section {
  width: 100%;
  display: none;
  flex-direction: column;
  align-items: center;
  animation: fadeIn 0.8s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.view-section.active {
  display: flex;
}

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

/* Header & Badges */
.sparkle-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 18px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(12px);
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-accent);
  margin-bottom: 24px;
  letter-spacing: 0.5px;
  box-shadow: 0 4px 16px rgba(247, 143, 179, 0.1);
}

.sparkle-badge span {
  animation: spinSlow 6s linear infinite;
  display: inline-block;
}

@keyframes spinSlow {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.main-title {
  font-family: var(--font-heading);
  font-size: clamp(2.4rem, 5vw, 4rem);
  font-weight: 700;
  text-align: center;
  line-height: 1.15;
  margin-bottom: 16px;
  background: linear-gradient(135deg, #ffffff 20%, #fed6e3 60%, #f6d365 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  text-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.subtitle {
  font-size: clamp(1.05rem, 2vw, 1.25rem);
  color: var(--text-muted);
  text-align: center;
  max-width: 580px;
  margin-bottom: 36px;
}

/* =========================================
   COUNTDOWN VIEW STYLING
   ========================================= */
.countdown-card-container {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  width: 100%;
  max-width: 640px;
  margin: 16px 0 36px 0;
}

.countdown-box {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-radius: var(--radius-md);
  padding: 24px 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  box-shadow: var(--card-glow);
  position: relative;
  overflow: hidden;
  transition: transform 0.3s ease, border-color 0.3s ease;
}

.countdown-box::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--accent-gradient);
  opacity: 0.7;
}

.countdown-box:hover {
  transform: translateY(-4px);
  border-color: var(--card-border-hover);
}

.countdown-number {
  font-family: var(--font-heading);
  font-size: clamp(2.2rem, 4.5vw, 3.4rem);
  font-weight: 700;
  color: #fff;
  line-height: 1;
  margin-bottom: 6px;
  text-shadow: 0 4px 16px rgba(255, 117, 140, 0.4);
}

.countdown-label {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--text-muted);
  font-weight: 600;
}

.countdown-note {
  background: rgba(255, 255, 255, 0.03);
  border: 1px dashed rgba(255, 255, 255, 0.15);
  border-radius: var(--radius-md);
  padding: 18px 24px;
  text-align: center;
  max-width: 500px;
  font-size: 0.95rem;
  color: #e5dbed;
  display: flex;
  align-items: center;
  gap: 12px;
}

/* =========================================
   BIRTHDAY VIEW STYLING
   ========================================= */
.heart-icon {
  display: inline-block;
  color: var(--heart-color);
  animation: heartbeat 1.4s ease-in-out infinite;
  filter: drop-shadow(0 0 10px rgba(255, 71, 126, 0.6));
  vertical-align: middle;
}

@keyframes heartbeat {
  0% { transform: scale(1); }
  14% { transform: scale(1.22); }
  28% { transform: scale(1); }
  42% { transform: scale(1.22); }
  70% { transform: scale(1); }
}

.love-banner {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 117, 140, 0.3);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-radius: var(--radius-lg);
  padding: 28px 32px;
  text-align: center;
  max-width: 680px;
  margin-bottom: 44px;
  box-shadow: 0 12px 40px rgba(255, 71, 126, 0.15);
  position: relative;
}

.love-message {
  font-family: var(--font-heading);
  font-size: clamp(1.4rem, 3vw, 1.85rem);
  font-style: italic;
  color: #fff;
  line-height: 1.4;
}

.love-message .sub-sad {
  display: block;
  font-family: var(--font-body);
  font-size: 1.05rem;
  font-style: normal;
  color: #e0d0eb;
  margin-top: 10px;
  opacity: 0.9;
}

/* Interactive Confetti Button */
.confetti-trigger-btn {
  background: var(--accent-gradient);
  border: none;
  color: white;
  font-family: var(--font-body);
  font-size: 0.95rem;
  font-weight: 600;
  padding: 12px 26px;
  border-radius: 999px;
  cursor: pointer;
  box-shadow: 0 4px 20px rgba(255, 117, 140, 0.4);
  transition: all 0.25s ease;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 32px;
}

.confetti-trigger-btn:hover {
  transform: translateY(-2px) scale(1.03);
  box-shadow: 0 8px 25px rgba(255, 117, 140, 0.6);
}

.confetti-trigger-btn:active {
  transform: translateY(1px) scale(0.98);
}

/* =========================================
   GIFTS SECTION STYLING
   ========================================= */
/* =========================================
   GIFTS SECTION STYLING & UNWRAPPING
   ========================================= */
.gifts-header-group {
  text-align: center;
  margin-bottom: 24px;
}

.gifts-actions-row {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin-top: 8px;
  margin-bottom: 12px;
}

.unwrap-all-btn {
  background: rgba(255, 255, 255, 0.08);
  border: 1px dashed rgba(247, 143, 179, 0.5);
  color: var(--text-accent);
  padding: 8px 18px;
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.25s ease;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.unwrap-all-btn:hover {
  background: rgba(247, 143, 179, 0.15);
  border-color: var(--text-accent);
  transform: translateY(-2px);
  color: #fff;
}

.gifts-section-title {
  font-family: var(--font-heading);
  font-size: clamp(1.8rem, 3.5vw, 2.5rem);
  color: var(--text-gold);
  background: var(--gold-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
}

.gifts-container {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 22px;
}

.gift-card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-radius: var(--radius-lg);
  box-shadow: var(--card-glow);
  transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
  overflow: hidden;
}

/* -----------------------------------------
   WRAPPED STATE (Geschenk ist noch verpackt)
   ----------------------------------------- */
.gift-card.is-wrapped {
  cursor: pointer;
  user-select: none;
  background: linear-gradient(135deg, rgba(255, 117, 140, 0.12) 0%, rgba(155, 89, 182, 0.15) 100%),
              radial-gradient(circle at top right, rgba(246, 211, 101, 0.1), transparent 60%),
              var(--card-bg);
  border: 1.5px dashed rgba(247, 143, 179, 0.45);
  padding: 32px 28px;
  text-align: center;
  box-shadow: 0 10px 30px rgba(255, 71, 126, 0.12), var(--card-glow);
}

.gift-card.is-wrapped:hover {
  transform: translateY(-5px) scale(1.015);
  border-color: #ff758c;
  box-shadow: 0 16px 40px rgba(255, 71, 126, 0.25), 0 0 25px rgba(246, 211, 101, 0.2);
  animation: giftWiggle 0.6s ease-in-out;
}

@keyframes giftWiggle {
  0%, 100% { transform: translateY(-5px) scale(1.015) rotate(0deg); }
  25% { transform: translateY(-5px) scale(1.015) rotate(-1.2deg); }
  75% { transform: translateY(-5px) scale(1.015) rotate(1.2deg); }
}

/* Shimmer shine over wrapped box */
.gift-card.is-wrapped::after {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: linear-gradient(
    60deg,
    transparent 40%,
    rgba(255, 255, 255, 0.12) 50%,
    transparent 60%
  );
  transform: rotate(30deg);
  animation: shimmerLight 5s infinite;
  pointer-events: none;
}

@keyframes shimmerLight {
  0% { transform: translateX(-100%) rotate(30deg); }
  25%, 100% { transform: translateX(100%) rotate(30deg); }
}

/* Decorative ribbon across wrapped card */
.wrapped-ribbon-horizontal {
  position: absolute;
  top: 50%;
  left: 0;
  right: 0;
  height: 12px;
  transform: translateY(-50%);
  background: linear-gradient(90deg, #f6d365, #fda085, #ff758c, #fda085, #f6d365);
  box-shadow: 0 2px 10px rgba(246, 211, 101, 0.4);
  opacity: 0.85;
  pointer-events: none;
  z-index: 1;
}

.wrapped-cover {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

.wrapped-box-icon {
  font-size: 3.2rem;
  display: inline-block;
  animation: boxBounce 2s infinite ease-in-out;
  filter: drop-shadow(0 6px 14px rgba(255, 117, 140, 0.4));
}

@keyframes boxBounce {
  0%, 100% { transform: translateY(0) scale(1); }
  50% { transform: translateY(-6px) scale(1.08); }
}

.wrapped-tag {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 2px;
  font-weight: 700;
  color: var(--text-gold);
  background: rgba(246, 211, 101, 0.12);
  padding: 4px 14px;
  border-radius: 999px;
  border: 1px solid rgba(246, 211, 101, 0.3);
}

.wrapped-prompt {
  font-family: var(--font-heading);
  font-size: clamp(1.2rem, 2.5vw, 1.5rem);
  color: #ffffff;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
}

.wrapped-hint {
  font-size: 0.85rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 6px;
}

/* -----------------------------------------
   UNWRAPPING ANIMATION (Beim Klick)
   ----------------------------------------- */
.gift-card.is-unwrapping {
  animation: unwrapExplode 0.7s cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
  pointer-events: none;
}

@keyframes unwrapExplode {
  0% {
    transform: scale(1);
    filter: brightness(1);
  }
  40% {
    transform: scale(1.06) rotate(-1.5deg);
    filter: brightness(1.3) drop-shadow(0 0 30px rgba(246, 211, 101, 0.8));
  }
  70% {
    transform: scale(0.96) rotate(1deg);
    filter: brightness(1.5);
  }
  100% {
    transform: scale(1) rotate(0);
    filter: brightness(1);
  }
}

.gift-card.is-unwrapping .wrapped-cover {
  animation: fadeScaleOut 0.4s ease forwards;
}

@keyframes fadeScaleOut {
  to {
    opacity: 0;
    transform: scale(0.8);
  }
}

/* -----------------------------------------
   UNWRAPPED STATE (Ausgepackt)
   ----------------------------------------- */
.gift-card.is-unwrapped {
  padding: 26px 30px;
  border: 1px solid var(--card-border);
  background: var(--card-bg);
}

.gift-card.is-unwrapped::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 5px;
  height: 100%;
  background: var(--accent-gradient);
  border-radius: 4px 0 0 4px;
  opacity: 0.9;
}

.gift-card.is-unwrapped:hover {
  transform: translateY(-4px);
  border-color: var(--card-border-hover);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.45), 0 0 25px rgba(247, 143, 179, 0.15);
}

.gift-content {
  display: none;
}

.gift-card.is-unwrapped .gift-content {
  display: block;
  animation: revealContent 0.6s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

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

.gift-card.is-unwrapped .wrapped-cover,
.gift-card.is-unwrapped .wrapped-ribbon-horizontal {
  display: none;
}

.gift-header {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  margin-bottom: 16px;
}

.gift-icon-bubble {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: rgba(255, 117, 140, 0.12);
  border: 1px solid rgba(255, 117, 140, 0.25);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  flex-shrink: 0;
}

.gift-title-wrap {
  flex: 1;
}

.gift-badge-was {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  color: var(--text-accent);
  margin-bottom: 4px;
  display: flex;
  align-items: center;
  gap: 4px;
}

.gift-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: #fff;
  line-height: 1.3;
}

.gift-meta-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.gift-meta-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

.meta-icon {
  font-size: 1.1rem;
  line-height: 1.3;
}

.meta-content {
  display: flex;
  flex-direction: column;
}

.meta-label {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-muted);
  font-weight: 600;
}

.meta-value {
  font-size: 0.95rem;
  color: #e9e3f0;
  font-weight: 500;
}

.gift-details {
  margin-top: 14px;
  padding: 10px 14px;
  background: rgba(255, 255, 255, 0.03);
  border-radius: var(--radius-sm);
  font-size: 0.88rem;
  color: #cfc2dc;
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Empty state or loading */
.gifts-loading,
.gifts-error {
  text-align: center;
  padding: 36px;
  color: var(--text-muted);
  background: var(--card-bg);
  border: 1px dashed var(--card-border);
  border-radius: var(--radius-md);
  width: 100%;
}

/* Responsive adjustments */
@media (max-width: 640px) {
  .page-wrapper {
    padding: 32px 16px 60px 16px;
  }
  
  .countdown-card-container {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
  }

  .love-banner {
    padding: 20px;
  }

  .gift-card {
    padding: 20px;
  }

  .gift-meta-grid {
    grid-template-columns: 1fr;
    gap: 10px;
  }
}
