/* ── BTS Color Palette ─────────────────────── */
:root {
  --deep-purple: #6C2BD9;
  --mid-purple: #9B59B6;
  --lavender: #D4A5FF;
  --pink: #FF6B9D;
  --gold: #FFD700;
  --bg-dark: #0D0015;
  --bg-darker: #080010;
  --text-primary: #FFFFFF;
  --text-secondary: rgba(255, 255, 255, 0.7);

  --font-heading: 'Playfair Display', Georgia, serif;
  --font-body: 'Poppins', -apple-system, sans-serif;
}

/* ── Reset & Base ─────────────────────────── */
*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: var(--bg-dark);
  color: var(--text-primary);
  font-family: var(--font-body);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

/* ── Particles ────────────────────────────── */
#particles {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}

/* ── Music Toggle ─────────────────────────── */
.music-toggle {
  position: fixed;
  top: max(12px, env(safe-area-inset-top, 12px));
  right: max(12px, env(safe-area-inset-right, 12px));
  z-index: 1000;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 2px solid var(--lavender);
  background: rgba(108, 43, 217, 0.3);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  color: var(--lavender);
  font-size: 1.2rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: background 0.3s, border-color 0.3s;
}

.music-toggle.visible {
  opacity: 1;
  pointer-events: auto;
}

.music-toggle.playing .music-icon {
  animation: spin-note 1.5s linear infinite;
}

@keyframes spin-note {
  to { transform: rotate(360deg); }
}

/* ── Scene Layout ─────────────────────────── */
.scene {
  position: fixed;
  inset: 0;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  padding-bottom: max(24px, env(safe-area-inset-bottom, 24px));
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.scene.active {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  z-index: 2;
}

.scene-content {
  text-align: center;
  max-width: 600px;
  width: 100%;
  position: relative;
  z-index: 1;
}

/* ── Korean Text ──────────────────────────── */
.korean-text {
  font-size: clamp(1rem, 3vw, 1.5rem);
  color: var(--lavender);
  letter-spacing: 0.3em;
  margin-bottom: 0.5rem;
  font-weight: 300;
  opacity: 0.8;
}

#scene-5 .korean-text {
  opacity: 0;
}

/* ── Scene 0: Splash ──────────────────────── */
.splash-title {
  font-family: var(--font-heading);
  font-size: clamp(3rem, 10vw, 6rem);
  font-weight: 700;
  background: linear-gradient(135deg, var(--lavender), var(--pink), var(--gold));
  background-clip: text;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: 2rem;
}

.pulse-ring {
  width: 100px;
  height: 100px;
  border-radius: 50%;
  border: 2px solid var(--lavender);
  margin: 0 auto 2rem;
  position: relative;
  animation: pulse-ring 2s ease-in-out infinite;
}

.pulse-ring::before {
  content: '💜';
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.5rem;
}

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

.splash-subtitle {
  font-size: clamp(0.9rem, 2.5vw, 1.1rem);
  color: var(--text-secondary);
  animation: fade-pulse 2.5s ease-in-out infinite;
}

@keyframes fade-pulse {
  0%, 100% { opacity: 0.5; }
  50% { opacity: 1; }
}

/* ── Scene 1: Greeting ────────────────────── */
.lyric-quote {
  font-family: var(--font-heading);
  font-style: italic;
  font-size: clamp(0.85rem, 2.2vw, 1.05rem);
  color: var(--lavender);
  margin-bottom: 1.5rem;
  opacity: 0;
  line-height: 1.6;
}

.greeting-title {
  font-family: var(--font-heading);
  font-size: clamp(2.5rem, 8vw, 4.5rem);
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 1.5rem;
  line-height: 1.1;
}

.greeting-title .char {
  display: inline-block;
  opacity: 0;
}

.greeting-sub {
  font-size: clamp(1rem, 2.5vw, 1.2rem);
  color: var(--text-secondary);
  opacity: 0;
}

.tap-hint {
  position: absolute;
  bottom: -60px;
  left: 0;
  right: 0;
  font-size: 0.8rem;
  color: var(--text-secondary);
  opacity: 0;
  animation: fade-pulse 2.5s ease-in-out infinite;
}

/* ── Scene 2: Spring Day ──────────────────── */
.spring-title {
  font-family: var(--font-heading);
  font-size: clamp(2rem, 7vw, 3.5rem);
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 2rem;
  line-height: 1.2;
}

.spring-title .word {
  display: inline-block;
  opacity: 0;
  margin-right: 0.3em;
}

.spring-lines {
  text-align: center;
}

.spring-lines p {
  font-size: clamp(0.9rem, 2.3vw, 1.1rem);
  color: var(--text-secondary);
  line-height: 1.8;
  opacity: 0;
  transform: translateX(-30px);
}

/* ── Scene 3: Reasons ─────────────────────── */
.reasons-title {
  font-family: var(--font-heading);
  font-size: clamp(1.8rem, 6vw, 3rem);
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 2rem;
  line-height: 1.2;
}

.reasons-title .char {
  display: inline-block;
  opacity: 0;
}

.reasons-list {
  list-style: none;
  text-align: left;
  max-width: 500px;
  margin: 0 auto;
}

.reasons-list li {
  font-size: clamp(0.85rem, 2.2vw, 1rem);
  color: var(--text-secondary);
  padding: 0.6rem 0;
  line-height: 1.5;
  opacity: 0;
  transform: translateX(-40px);
}

/* ── Scene 4: BTS Selection Grid ─────────── */
.selection-title {
  font-family: var(--font-heading);
  font-size: clamp(1.6rem, 5vw, 2.5rem);
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 1.5rem;
  line-height: 1.2;
}

.selection-title .char {
  display: inline-block;
  opacity: 0;
}

.members-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  max-width: 420px;
  margin: 0 auto;
}

.member-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  opacity: 0;
}

.member-name {
  font-family: var(--font-body);
  font-size: 0.7rem;
  font-weight: 500;
  color: var(--lavender);
  letter-spacing: 0.05em;
  white-space: nowrap;
}

.member-portrait {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  border: 2px solid var(--lavender);
  overflow: hidden;
  box-shadow: 0 0 15px rgba(108, 43, 217, 0.4);
  transition: box-shadow 0.3s, border-color 0.3s;
}

.member-portrait img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.member-portrait--placeholder {
  background: linear-gradient(135deg, var(--deep-purple), var(--mid-purple));
  border-color: var(--gold);
  box-shadow: 0 0 20px rgba(255, 215, 0, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
}

.placeholder-mark {
  font-family: var(--font-heading);
  font-size: 2rem;
  font-weight: 700;
  color: var(--gold);
  line-height: 1;
}

/* Default: user — gold border */
.member-card[data-member="user"] .member-portrait {
  border-color: var(--gold);
  box-shadow: 0 0 20px rgba(255, 215, 0, 0.4);
}

/* Hover: BTS member — pink glow */
.member-card:not([data-member="user"]):hover .member-portrait {
  border-color: var(--pink);
  box-shadow: 0 0 25px rgba(255, 107, 157, 0.6);
}

/* Hover: user — gold glow */
.member-card[data-member="user"]:hover .member-portrait {
  border-color: var(--gold);
  box-shadow: 0 0 30px rgba(255, 215, 0, 0.6);
}

.member-card[data-member="user"] .member-name {
  color: var(--gold);
  font-weight: 600;
}

.member-tooltip {
  position: absolute;
  bottom: 40px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(108, 43, 217, 0.9);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  color: white;
  padding: 8px 18px;
  border-radius: 50px;
  font-size: 0.85rem;
  font-family: var(--font-body);
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  z-index: 10;
}

/* ── Crack Overlay (Suga effect) ──────────── */
.crack-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  pointer-events: none;
  opacity: 0;
}

.crack-overlay svg {
  width: 100%;
  height: 100%;
}

.crack-line {
  fill: none;
  stroke: rgba(255, 255, 255, 0.9);
  stroke-width: 2.5;
  stroke-linecap: round;
  filter: drop-shadow(0 0 6px rgba(255, 255, 255, 0.8)) drop-shadow(0 0 12px rgba(212, 165, 255, 0.5));
}

.crack-line-thin {
  fill: none;
  stroke: rgba(255, 255, 255, 0.6);
  stroke-width: 1.5;
  stroke-linecap: round;
  filter: drop-shadow(0 0 4px rgba(255, 255, 255, 0.6));
}

.crack-line-micro {
  fill: none;
  stroke: rgba(255, 255, 255, 0.4);
  stroke-width: 0.8;
  stroke-linecap: round;
  filter: drop-shadow(0 0 2px rgba(255, 255, 255, 0.4));
}

.crack-impact {
  fill: none;
  stroke: rgba(255, 255, 255, 0.5);
  stroke-width: 1;
}

/* ── Scene 5: The Question ────────────────── */
.question-title {
  font-family: var(--font-heading);
  font-size: clamp(1.8rem, 6vw, 3.2rem);
  font-weight: 700;
  margin-bottom: 2.5rem;
  line-height: 1.2;
}

.question-title .char {
  display: inline-block;
  opacity: 0;
  background: linear-gradient(135deg, var(--lavender), var(--pink), var(--gold));
  background-clip: text;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.buttons-container {
  display: flex;
  gap: 1.5rem;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
  opacity: 0;
}

.btn {
  font-family: var(--font-body);
  font-size: clamp(1rem, 2.5vw, 1.15rem);
  font-weight: 600;
  padding: 14px 36px;
  border-radius: 50px;
  border: none;
  cursor: pointer;
  min-width: 140px;
  min-height: 44px;
  transition: transform 0.3s, box-shadow 0.3s;
}

.btn-yes {
  background: linear-gradient(135deg, var(--deep-purple), var(--mid-purple));
  color: white;
  box-shadow: 0 4px 20px rgba(108, 43, 217, 0.4);
}

.btn-yes:hover {
  transform: scale(1.05);
  box-shadow: 0 6px 30px rgba(108, 43, 217, 0.6);
}

.btn-no {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-secondary);
  border: 1px solid rgba(255, 255, 255, 0.2);
  position: relative;
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.btn-no.escaping {
  position: fixed;
  z-index: 100;
}

/* ── Scene 6: Celebration ─────────────────── */
.celebration-title {
  font-family: var(--font-heading);
  font-size: clamp(2.5rem, 9vw, 5rem);
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 1rem;
}

.celebration-title .char {
  display: inline-block;
  opacity: 0;
}

.big-heart {
  font-size: clamp(4rem, 15vw, 8rem);
  opacity: 0;
  transform: scale(0);
  margin: 1rem 0;
  line-height: 1;
}

.couple-photo-wrapper {
  margin: 1rem auto;
  opacity: 0;
  transform: scale(0.9);
}

.couple-photo {
  width: clamp(160px, 45vw, 260px);
  height: auto;
  border-radius: 16px;
  border: 3px solid var(--lavender);
  box-shadow: 0 0 25px rgba(108, 43, 217, 0.5), 0 0 50px rgba(155, 89, 182, 0.2);
  object-fit: cover;
}

.dynamite-ref {
  font-family: var(--font-heading);
  font-style: italic;
  font-size: clamp(0.9rem, 2.5vw, 1.1rem);
  color: var(--gold);
  margin: 1rem 0;
  opacity: 0;
}

.final-message {
  margin-top: 1.5rem;
}

.final-message p {
  font-size: clamp(1rem, 2.5vw, 1.2rem);
  color: var(--lavender);
  line-height: 2;
  opacity: 0;
}

/* ── Responsive ───────────────────────────── */
@media (max-width: 480px) {
  .scene {
    padding: 20px 16px;
  }

  .buttons-container {
    flex-direction: column;
    gap: 1rem;
  }

  .btn {
    width: 100%;
    max-width: 260px;
  }

  .reasons-list li {
    font-size: 0.85rem;
    padding: 0.5rem 0;
  }

  .members-grid {
    gap: 12px;
    max-width: 300px;
  }

  .member-portrait {
    width: 55px;
    height: 55px;
  }

  .member-name {
    font-size: 0.6rem;
  }

  .placeholder-mark {
    font-size: 1.5rem;
  }

  .member-tooltip {
    white-space: normal;
    max-width: calc(100vw - 48px);
    text-align: center;
  }
}

@media (max-height: 500px) {
  .splash-title {
    font-size: 2.5rem;
  }

  .pulse-ring {
    width: 60px;
    height: 60px;
    margin-bottom: 1rem;
  }

  .pulse-ring::before {
    font-size: 1.5rem;
  }

  .greeting-title,
  .celebration-title {
    font-size: 2rem;
  }

  .spring-title,
  .reasons-title,
  .question-title {
    font-size: 1.6rem;
    margin-bottom: 1rem;
  }

  .big-heart {
    font-size: 3rem;
  }

  .couple-photo {
    width: 140px;
    border-radius: 12px;
  }

  .couple-photo-wrapper {
    margin: 0.5rem auto;
  }

  .reasons-list li {
    padding: 0.3rem 0;
    font-size: 0.8rem;
  }

  .tap-hint {
    bottom: -40px;
  }

  .members-grid {
    gap: 8px;
    max-width: 280px;
  }

  .member-portrait {
    width: 45px;
    height: 45px;
  }

  .member-name {
    font-size: 0.55rem;
  }

  .placeholder-mark {
    font-size: 1.2rem;
  }

  .selection-title {
    font-size: 1.4rem;
    margin-bottom: 0.8rem;
  }
}

/* ── Confetti Container ───────────────────── */
#confetti-container {
  position: fixed;
  inset: 0;
  z-index: 999;
  pointer-events: none;
}
