:root {
  --primary: #ff5c8a;
  --primary-dark: #e0416e;
  --secondary: #ffb703;
  --text-main: #2b2d42;
  --text-muted: #6c757d;
  --soft-pink: #fff0f5;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

body {
  font-family: 'Plus Jakarta Sans', sans-serif;
  background: radial-gradient(circle at top, #f7efe8 0%, #e5dbd2 100%);
  color: var(--text-main);
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

/* ================= MOBILE VIEWPORT CONTAINER ================= */
.phone-stage {
  position: relative;
  width: 100%;
  max-width: 410px;
  height: 100dvh;
  max-height: 820px;
  background: #101324;
  border-radius: 34px;
  box-shadow: 0 24px 60px rgba(16, 19, 36, 0.35), 0 0 0 8px rgba(255, 255, 255, 0.5);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: background 1s ease;
}

.phone-stage.lights-on {
  background: linear-gradient(170deg, #fff5f8 0%, #fff9f2 55%, #f4edff 100%);
}

@media (max-width: 480px) {
  body { background: #101324; }
  .phone-stage {
    max-width: 100%;
    max-height: 100dvh;
    border-radius: 0;
    box-shadow: none;
  }
}

#confetti-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 90;
}

/* ================= TOP BAR ================= */
.top-bar {
  position: relative;
  z-index: 40;
  padding: 16px 18px 8px;
  display: none; /* sebelumnya flex + opacity 0 */
  flex-direction: column;
  gap: 10px;
}

.top-bar.visible {
  display: flex;
  animation: popIn 0.4s ease;
}

.progress-segments {
  display: flex;
  gap: 5px;
  width: 100%;
}

.segment {
  flex: 1;
  height: 4px;
  border-radius: 999px;
  background: rgba(43, 45, 66, 0.12);
  transition: background 0.3s ease;
}

.segment.active { background: var(--primary); }
.segment.passed { background: #ff9ebb; }

.top-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.step-pill {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--primary-dark);
  background: rgba(255, 255, 255, 0.88);
  padding: 5px 12px;
  border-radius: 999px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}

.music-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1.5px solid #ffd6e0;
  background: white;
  font-size: 1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 3px 10px rgba(0,0,0,0.05);
}

/* ================= DECK & SHARED CARD ================= */
.deck-area {
  position: relative;
  flex: 1;
  padding: 6px 18px 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.greeting-card {
  position: absolute;
  inset: 6px 18px 14px;
  background: #ffffff;
  border-radius: 28px;
  padding: 24px 20px;
  box-shadow: 0 14px 36px rgba(255, 92, 138, 0.14), 0 2px 8px rgba(0,0,0,0.04);
  border: 2px solid rgba(255, 255, 255, 0.9);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  opacity: 0;
  transform: translateX(60px) scale(0.95);
  pointer-events: none;
  transition: transform 0.45s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.35s ease, background 0.9s ease, border-color 0.9s ease;
  overflow-y: auto;
}

.greeting-card::-webkit-scrollbar { width: 4px; }
.greeting-card::-webkit-scrollbar-thumb { background: #ffd6e0; border-radius: 999px; }

.greeting-card.active {
  opacity: 1;
  transform: translateX(0) scale(1);
  pointer-events: auto;
  z-index: 10;
}

.greeting-card.prev {
  opacity: 0;
  transform: translateX(-60px) scale(0.95);
}

.card-badge {
  display: inline-block;
  background: #ffe3ec;
  color: var(--primary-dark);
  padding: 6px 14px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 700;
  margin-bottom: 12px;
}

.card-heading {
  font-family: 'Fredoka', sans-serif;
  font-size: 1.65rem;
  line-height: 1.2;
  color: var(--text-main);
  margin-bottom: 8px;
}

.card-desc {
  font-size: 0.9rem;
  color: var(--text-muted);
  line-height: 1.55;
  margin-bottom: 20px;
}

/* ================= BOTTOM NAV ================= */
.bottom-nav {
  position: relative;
  z-index: 40;
  padding: 8px 18px 18px;
  display: none;
  gap: 10px;
}

.bottom-nav.visible { display: flex; }

.nav-btn {
  border: none;
  border-radius: 16px;
  padding: 14px 18px;
  font-family: 'Fredoka', sans-serif;
  font-size: 1rem;
  cursor: pointer;
  transition: transform 0.15s ease;
}

.nav-btn:active { transform: scale(0.97); }

.btn-prev {
  background: white;
  color: var(--text-main);
  border: 1.5px solid #e2e8f0;
  flex: 0.42;
}

.btn-next {
  background: linear-gradient(135deg, var(--primary), #ff8fab);
  color: white;
  flex: 1;
  box-shadow: 0 8px 20px rgba(255, 92, 138, 0.3);
}

@keyframes popIn {
  0% { opacity: 0; transform: scale(0.94) translateY(10px); }
  100% { opacity: 1; transform: scale(1) translateY(0); }
}