:root {
  --primary: #6366f1;
  --primary-glow: rgba(99, 102, 241, 0.4);
  --bg-color: #f8fafc;
  --glass-bg: rgba(255, 255, 255, 0.7);
  --glass-border: rgba(255, 255, 255, 0.5);
  --text-main: #1e293b;
  --text-muted: #475569;
  --card-gradient: linear-gradient(135deg, rgba(255,255,255,0.95) 0%, rgba(238,242,255,0.9) 40%, rgba(255,241,242,0.9) 100%);
}

[data-theme="dark"] {
  --bg-color: #020617;
  --glass-bg: rgba(15, 23, 42, 0.8);
  --glass-border: rgba(255, 255, 255, 0.1);
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --card-gradient: linear-gradient(135deg, rgba(30, 41, 59, 0.95) 0%, rgba(15, 23, 42, 0.9) 100%);
}

* { box-sizing: border-box; margin: 0; padding: 0; font-family: 'Pretendard', sans-serif; -webkit-tap-highlight-color: transparent; }

body { background-color: var(--bg-color); color: var(--text-main); min-height: 100vh; overflow-x: hidden; display: flex; justify-content: center; align-items: center; transition: background-color 0.3s ease; }

/* 🌀 움직이는 배경 */
.bg-visual-wrapper { position: fixed; top: 0; left: 0; width: 100%; height: 100%; z-index: -1; filter: blur(80px); opacity: 0.55; }
.blob { position: absolute; border-radius: 50%; animation: move 20s infinite alternate; }
.blob-1 { width: 450px; height: 450px; background: #a5b4fc; top: -10%; left: -5%; }
.blob-2 { width: 550px; height: 550px; background: #ddd6fe; bottom: -5%; right: -5%; animation-delay: -5s; }
.blob-3 { width: 350px; height: 350px; background: #fda4af; top: 30%; left: 20%; animation-delay: -10s; }
@keyframes move { from { transform: translate(0, 0) scale(1); } to { transform: translate(80px, 50px) scale(1.1); } }

.app-container { width: 100%; max-width: 440px; padding: 24px; position: relative; }

/* 💎 수채화풍 파스텔 카드 배경 */
.glass-card {
  background: var(--card-gradient);
  backdrop-filter: blur(25px); 
  -webkit-backdrop-filter: blur(25px);
  border-radius: 36px;
  border: 1.5px solid var(--glass-border); 
  padding: 32px; 
  box-shadow: 0 20px 50px -10px rgba(0, 0, 0, 0.1);
  margin-bottom: 24px;
  position: relative;
  overflow: hidden;
  transition: all 0.3s ease;
}

.glass-card::before {
  content: ""; position: absolute; top: -20%; left: -20%; width: 140%; height: 140%;
  background-image: radial-gradient(at 10% 10%, rgba(165,180,252,0.15) 0, transparent 40%), 
                    radial-gradient(at 90% 90%, rgba(253,164,175,0.15) 0, transparent 40%),
                    radial-gradient(at 50% 50%, rgba(216,180,254,0.1) 0, transparent 50%);
  pointer-events: none;
  filter: blur(20px);
}
[data-theme="dark"] .glass-card::before { opacity: 0.2; }

/* ✨ 머리말(Tag) 스타일 */
.item-tag {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 900;
  color: var(--primary);
  background: rgba(99, 102, 241, 0.1);
  padding: 4px 10px;
  border-radius: 8px;
  margin-bottom: 12px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* 🚀 상단 헤더 행 */
.header-top-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
}

.weather-pill { 
  display: inline-flex; 
  align-items: center; 
  gap: 8px; 
  padding: 10px 20px; 
  background: var(--glass-bg); 
  border-radius: 100px; 
  font-weight: 800; 
  color: var(--primary); 
  box-shadow: 0 4px 12px rgba(0,0,0,0.03); 
  border: 1.5px solid var(--glass-border);
}

.theme-pill-btn {
  background: var(--glass-bg);
  border: 1.5px solid var(--glass-border);
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 1.1rem;
  transition: 0.3s;
  color: var(--text-main);
}

/* ✨ Stagger Animation */
.stagger-item {
  opacity: 0;
  transform: translateY(30px);
  transition: all 1s cubic-bezier(0.16, 1, 0.3, 1);
}
.stagger-item.show {
  opacity: 1;
  transform: translateY(0);
}

/* 🚀 공통 버튼 UI */
.btn-romantic {
  width: 100%; padding: 22px; margin-top: 15px; font-size: 1.15rem; font-weight: 900; color: white; border: none; border-radius: 28px; cursor: pointer;
  background: linear-gradient(135deg, #6366f1 0%, #a855f7 100%);
  box-shadow: 0 10px 25px -5px var(--primary-glow);
  transition: 0.3s;
}
.btn-romantic:active { transform: scale(0.96); }

.btn-sm-romantic {
  padding: 12px 24px; border-radius: 100px; border: none; background: var(--primary); color: white; font-weight: 800; cursor: pointer; transition: 0.3s;
}
.btn-sm-romantic:active { transform: scale(0.95); }

/* 폼 스타일 복구 */
.onboarding-card input, .onboarding-card select, .partner-selector select {
  width: 100%; padding: 16px 20px; border-radius: 18px; border: 1.5px solid var(--glass-border); background: var(--glass-bg); color: var(--text-main); font-size: 1rem; font-weight: 600; outline: none; margin-bottom: 20px; transition: 0.3s;
}
.onboarding-card input:focus, .onboarding-card select:focus, .partner-selector select:focus {
  border-color: var(--primary); background: white;
}
[data-theme="dark"] .onboarding-card input:focus, [data-theme="dark"] .onboarding-card select:focus {
  background: rgba(255,255,255,0.05);
}

.input-group label { display: block; font-size: 0.85rem; font-weight: 800; color: var(--text-muted); margin-bottom: 10px; margin-left: 4px; }
.row { display: flex; gap: 12px; }
.row .input-group { flex: 1; }

/* 커넥션 카드 레이아웃 */
.partner-selector { display: flex; gap: 10px; align-items: flex-start; }
.partner-selector select { margin-bottom: 0; }
.connection-result { margin-top: 20px; padding: 20px; background: rgba(99, 102, 241, 0.05); border-radius: 20px; border: 1px dashed var(--primary-glow); animation: fadeIn 0.5s ease; }

/* 📊 슬라이더 및 태그 */
.mood-tag-cloud { display: flex; flex-wrap: wrap; gap: 10px; margin: 15px 0; }
.mood-chip { padding: 10px 16px; border-radius: 100px; border: 1.5px solid var(--glass-border); background: var(--glass-bg); color: var(--text-main); font-size: 0.85rem; font-weight: 700; cursor: pointer; transition: 0.3s; }
.mood-chip.active { background: var(--primary); color: white; border-color: var(--primary); }

/* 🌀 익명 메시지 보이스 릴레이 */
.mood-voice-section { margin-top: 35px; background: rgba(255,255,255,0.05); border-radius: 24px; padding: 20px; border: 1px solid var(--glass-border); }
.voice-relay-container { 
  height: 180px; overflow: hidden; position: relative;
  mask-image: linear-gradient(to bottom, transparent, black 20%, black 80%, transparent);
}
.voice-list-track { 
  display: flex; flex-direction: column; gap: 15px; 
  animation: scrollUpShrink 25s linear infinite; 
}
.voice-item {
  font-size: 0.85rem; font-weight: 600; color: var(--text-main); padding: 14px 18px; 
  background: var(--glass-bg); border-radius: 4px 18px 18px 18px; border: 1px solid var(--glass-border);
  box-shadow: 0 4px 15px rgba(0,0,0,0.05); width: fit-content; max-width: 90%;
}

@keyframes scrollUpShrink {
  0% { transform: translateY(0); opacity: 1; }
  80% { opacity: 1; transform: translateY(-70%) scale(1); }
  100% { transform: translateY(-100%) scale(0.8); opacity: 0; }
}

.voice-input-area { display: flex; gap: 8px; margin-top: 20px; }
.voice-input-area input { flex: 1; padding: 12px 20px; border-radius: 100px; border: 1.5px solid var(--glass-border); background: var(--glass-bg); color: var(--text-main); outline: none; }
.voice-input-area button { width: 45px; height: 45px; border-radius: 50%; border: none; background: var(--primary); color: white; cursor: pointer; }

/* 폰트 및 텍스트 디테일 */
.logo-text { font-size: 3.2rem; font-weight: 900; color: var(--primary); text-align: center; margin-bottom: 8px; }
.sub-text { font-size: 1.1rem; font-weight: 600; color: var(--text-muted); text-align: center; margin-bottom: 30px; line-height: 1.6; }
h3 { font-size: 1.3rem; font-weight: 800; margin-bottom: 12px; }

.romantic-footer { text-align: center; margin-top: 50px; padding-bottom: 40px; opacity: 0.6; font-size: 0.8rem; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
