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

:root {
  --primary: #7C3AED;
  --primary-light: #A78BFA;
  --primary-dark: #5B21B6;
  --secondary: #EC4899;
  --accent: #F59E0B;
  --bg: #0F0A1E;
  --bg-card: #1A1030;
  --bg-card2: #221540;
  --text: #F3F0FF;
  --text-muted: #A89BC2;
  --border: rgba(124, 58, 237, 0.3);
  --gradient-main: linear-gradient(135deg, #7C3AED 0%, #EC4899 100%);
  --gradient-card: linear-gradient(135deg, rgba(124,58,237,0.15) 0%, rgba(236,72,153,0.1) 100%);
  --shadow: 0 8px 32px rgba(124, 58, 237, 0.25);
  --radius: 20px;
  --radius-sm: 12px;
}

html { scroll-behavior: smooth; }

body {
  font-family: 'Noto Sans KR', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.6;
  overflow-x: hidden;
}

/* ===== Background Decoration ===== */
.bg-decoration {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

.bg-blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.15;
}

.bg-blob-1 {
  width: 400px; height: 400px;
  background: var(--primary);
  top: -100px; left: -100px;
  animation: blobMove1 12s ease-in-out infinite alternate;
}

.bg-blob-2 {
  width: 300px; height: 300px;
  background: var(--secondary);
  bottom: -80px; right: -80px;
  animation: blobMove2 10s ease-in-out infinite alternate;
}

.bg-blob-3 {
  width: 250px; height: 250px;
  background: var(--accent);
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  animation: blobMove3 14s ease-in-out infinite alternate;
}

@keyframes blobMove1 {
  from { transform: translate(0,0) scale(1); }
  to   { transform: translate(50px,80px) scale(1.2); }
}
@keyframes blobMove2 {
  from { transform: translate(0,0) scale(1); }
  to   { transform: translate(-60px,-40px) scale(1.15); }
}
@keyframes blobMove3 {
  from { transform: translate(-50%,-50%) scale(1); }
  to   { transform: translate(-40%,-60%) scale(1.3); }
}

/* ===== Container ===== */
.container {
  position: relative;
  z-index: 1;
  max-width: 480px;
  margin: 0 auto;
  padding: 0 20px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

/* ===== Card ===== */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 32px 28px;
  backdrop-filter: blur(20px);
  box-shadow: var(--shadow);
  position: relative;
  overflow: hidden;
}

.card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--gradient-card);
  pointer-events: none;
}

/* ===== Index Page ===== */
.landing-wrap {
  text-align: center;
  padding: 48px 0;
}

.landing-emoji {
  font-size: 72px;
  display: block;
  margin-bottom: 12px;
  animation: floatEmoji 3s ease-in-out infinite;
}

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

.landing-title {
  font-size: 28px;
  font-weight: 800;
  line-height: 1.3;
  background: var(--gradient-main);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 10px;
}

.landing-subtitle {
  font-size: 15px;
  color: var(--text-muted);
  margin-bottom: 32px;
}

.tag-wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  margin-bottom: 20px;
}

.tag {
  background: rgba(124,58,237,0.2);
  border: 1px solid var(--border);
  border-radius: 100px;
  padding: 6px 14px;
  font-size: 13px;
  color: var(--primary-light);
}

.info-box {
  background: rgba(255,255,255,0.04);
  border-radius: var(--radius-sm);
  padding: 18px;
  margin-bottom: 24px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.info-item {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  color: var(--text-muted);
}

.info-item .icon { font-size: 18px; }

/* ===== Name Input ===== */
.name-input-wrap {
  margin-bottom: 20px;
  text-align: left;
}

.name-label {
  display: block;
  font-size: 13px;
  font-weight: 700;
  color: var(--primary-light);
  margin-bottom: 8px;
}

.name-input {
  width: 100%;
  background: rgba(255,255,255,0.06);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px 18px;
  font-size: 16px;
  color: var(--text);
  outline: none;
  transition: border-color 0.25s, box-shadow 0.25s;
  font-family: inherit;
}

.name-input::placeholder { color: var(--text-muted); }

.name-input:focus {
  border-color: var(--primary-light);
  box-shadow: 0 0 0 3px rgba(124,58,237,0.2);
}

@keyframes shake {
  0%,100% { transform: translateX(0); }
  20%,60% { transform: translateX(-6px); }
  40%,80% { transform: translateX(6px); }
}

.name-input.shake {
  animation: shake 0.4s ease;
  border-color: var(--secondary);
}

/* ===== Buttons ===== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 16px 32px;
  border-radius: 100px;
  font-size: 16px;
  font-weight: 700;
  border: none;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.34,1.56,0.64,1);
  text-decoration: none;
  width: 100%;
  font-family: inherit;
}

.btn-primary {
  background: var(--gradient-main);
  color: #fff;
  box-shadow: 0 4px 20px rgba(124,58,237,0.4);
}

.btn-primary:hover, .btn-primary:active {
  transform: translateY(-2px) scale(1.02);
  box-shadow: 0 8px 32px rgba(124,58,237,0.5);
}

.btn-secondary {
  background: rgba(255,255,255,0.07);
  border: 1px solid var(--border);
  color: var(--text);
}

.btn-secondary:hover {
  background: rgba(255,255,255,0.12);
  transform: translateY(-2px);
}

.btn-kakao {
  background: #FEE500;
  color: #191919;
  box-shadow: 0 4px 16px rgba(254,229,0,0.3);
}

.btn-kakao:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(254,229,0,0.4);
}

.btn-link {
  background: rgba(255,255,255,0.07);
  border: 1px solid var(--border);
  color: var(--text);
}

.btn-link:hover {
  background: rgba(255,255,255,0.12);
  transform: translateY(-2px);
}

.btn-mypage {
  background: rgba(124,58,237,0.15);
  border: 1px solid var(--border);
  color: var(--primary-light);
}

.btn-mypage:hover {
  background: rgba(124,58,237,0.25);
  transform: translateY(-2px);
}

/* ===== Progress Bar ===== */
.progress-wrap { margin-bottom: 28px; }

.progress-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}

.progress-label {
  font-size: 13px;
  color: var(--text-muted);
  font-weight: 600;
}

.progress-count {
  font-size: 13px;
  color: var(--primary-light);
  font-weight: 700;
}

.progress-track {
  width: 100%;
  height: 6px;
  background: rgba(255,255,255,0.1);
  border-radius: 100px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: var(--gradient-main);
  border-radius: 100px;
  transition: width 0.5s cubic-bezier(0.34,1.56,0.64,1);
  position: relative;
}

.progress-fill::after {
  content: '';
  position: absolute;
  right: 0; top: 0;
  width: 12px; height: 100%;
  background: rgba(255,255,255,0.4);
  border-radius: 100px;
  filter: blur(3px);
}

/* ===== Question ===== */
.question-section { padding: 40px 0 20px; }

.question-num {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--primary-light);
  margin-bottom: 8px;
}

.question-text {
  font-size: 20px;
  font-weight: 700;
  line-height: 1.5;
  margin-bottom: 28px;
  color: var(--text);
}

.options-wrap {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.option-btn {
  background: rgba(255,255,255,0.04);
  border: 1.5px solid rgba(255,255,255,0.1);
  border-radius: var(--radius-sm);
  padding: 16px 20px;
  font-size: 15px;
  color: var(--text);
  text-align: left;
  cursor: pointer;
  transition: all 0.25s ease;
  display: flex;
  align-items: center;
  gap: 12px;
  position: relative;
  overflow: hidden;
  font-family: inherit;
}

.option-btn::before {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--gradient-main);
  opacity: 0;
  transition: opacity 0.25s ease;
}

.option-label {
  font-size: 13px;
  font-weight: 700;
  color: var(--primary-light);
  min-width: 20px;
  position: relative;
  z-index: 1;
}

.option-text {
  position: relative;
  z-index: 1;
  line-height: 1.4;
}

.option-btn:hover {
  border-color: var(--primary-light);
  transform: translateX(4px);
}

.option-btn:hover::before { opacity: 0.12; }

.option-btn.selected {
  border-color: var(--primary);
  transform: translateX(4px);
}

.option-btn.selected::before { opacity: 0.2; }

/* ===== SNS 공유 카드 ===== */
.share-card {
  background: var(--bg-card);
  border: 2px solid var(--border);
  border-radius: var(--radius);
  padding: 28px 24px 24px;
  text-align: center;
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow), 0 0 40px rgba(124,58,237,0.15);
}

.share-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--gradient-card);
  pointer-events: none;
}

.share-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  position: relative;
  z-index: 1;
}

.share-card-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--text-muted);
}

.share-card-sub {
  font-size: 12px;
  font-weight: 700;
  background: var(--gradient-main);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.share-card-emoji-wrap {
  position: relative;
  z-index: 1;
  margin-bottom: 12px;
}

.share-card-emoji {
  font-size: 88px;
  display: block;
  animation: floatEmoji 3s ease-in-out infinite;
  filter: drop-shadow(0 4px 16px rgba(124,58,237,0.4));
}

.share-card-type {
  font-size: 28px;
  font-weight: 900;
  background: var(--gradient-main);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 4px;
  position: relative;
  z-index: 1;
  line-height: 1.2;
}

.share-card-eng {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 2px;
  color: var(--text-muted);
  margin-bottom: 18px;
  position: relative;
  z-index: 1;
}

/* 키워드 뱃지 */
.share-card-keywords {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  margin-bottom: 16px;
  position: relative;
  z-index: 1;
}

.kw-badge {
  background: rgba(255,255,255,0.1);
  border: 1px solid rgba(255,255,255,0.2);
  border-radius: 100px;
  padding: 5px 14px;
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
  backdrop-filter: blur(8px);
}

.share-card-oneliner {
  font-size: 13px;
  color: var(--text-muted);
  position: relative;
  z-index: 1;
  font-style: italic;
  line-height: 1.5;
}

/* ===== Result Page ===== */
.result-wrap { padding: 32px 0 24px; }

.result-personal {
  font-size: 17px;
  font-weight: 800;
  background: var(--gradient-main);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 16px;
  line-height: 1.4;
  position: relative;
  z-index: 1;
}

.result-badge {
  display: inline-block;
  background: var(--gradient-main);
  border-radius: 100px;
  padding: 6px 16px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  margin-bottom: 16px;
  color: #fff;
}

.result-emoji {
  font-size: 80px;
  display: block;
  text-align: center;
  margin-bottom: 16px;
  animation: floatEmoji 3s ease-in-out infinite;
}

.result-type-name {
  font-size: 26px;
  font-weight: 800;
  text-align: center;
  background: var(--gradient-main);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 8px;
}

.result-type-eng {
  text-align: center;
  font-size: 14px;
  color: var(--text-muted);
  font-weight: 600;
  letter-spacing: 1px;
  margin-bottom: 24px;
}

.result-desc {
  background: rgba(255,255,255,0.04);
  border-radius: var(--radius-sm);
  padding: 20px;
  font-size: 15px;
  color: var(--text-muted);
  line-height: 1.8;
  margin-bottom: 20px;
  border-left: 3px solid var(--primary);
  position: relative;
  z-index: 1;
}

.result-traits {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 4px;
  position: relative;
  z-index: 1;
}

.trait-tag {
  background: rgba(124,58,237,0.2);
  border: 1px solid var(--border);
  border-radius: 100px;
  padding: 6px 14px;
  font-size: 13px;
  color: var(--primary-light);
  font-weight: 600;
}

.share-section { margin-top: 8px; }

.share-title {
  font-size: 14px;
  color: var(--text-muted);
  text-align: center;
  margin-bottom: 14px;
}

.share-btns {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.divider {
  height: 1px;
  background: var(--border);
  margin: 24px 0;
}

.retry-section { text-align: center; }

/* ===== Mypage ===== */
.mypage-wrap { padding: 32px 0 40px; }

.mypage-header {
  text-align: center;
  margin-bottom: 24px;
}

.mypage-title {
  font-size: 24px;
  font-weight: 800;
  background: var(--gradient-main);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 6px;
}

.mypage-sub {
  font-size: 14px;
  color: var(--text-muted);
}

/* 대표 성향 카드 */
.rep-card {
  background: var(--bg-card);
  border: 2px solid var(--border);
  border-radius: var(--radius);
  padding: 28px 24px;
  text-align: center;
  margin-bottom: 16px;
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow);
}

.rep-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--gradient-card);
  pointer-events: none;
}

.rep-badge {
  display: inline-block;
  background: var(--gradient-main);
  border-radius: 100px;
  padding: 5px 14px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1px;
  color: #fff;
  margin-bottom: 16px;
  position: relative;
  z-index: 1;
}

.rep-emoji {
  font-size: 64px;
  display: block;
  margin-bottom: 12px;
  animation: floatEmoji 3s ease-in-out infinite;
  position: relative;
  z-index: 1;
}

.rep-name {
  font-size: 22px;
  font-weight: 800;
  background: var(--gradient-main);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 6px;
  position: relative;
  z-index: 1;
}

.rep-count {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 14px;
  position: relative;
  z-index: 1;
}

.rep-keywords {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  position: relative;
  z-index: 1;
}

/* 통계 바 */
.section-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-muted);
  letter-spacing: 1px;
  text-transform: uppercase;
  margin-bottom: 14px;
}

.stats-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  margin-bottom: 16px;
}

.stat-row { margin-bottom: 14px; }
.stat-row:last-child { margin-bottom: 0; }

.stat-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.stat-count {
  margin-left: auto;
  font-weight: 700;
  color: var(--primary-light);
}

.stat-track {
  width: 100%;
  height: 6px;
  background: rgba(255,255,255,0.08);
  border-radius: 100px;
  overflow: hidden;
}

.stat-fill {
  height: 100%;
  border-radius: 100px;
  transition: width 0.8s cubic-bezier(0.34,1.56,0.64,1);
  min-width: 4px;
}

/* 타임라인 */
.timeline-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  margin-bottom: 16px;
}

.timeline {
  display: flex;
  flex-direction: column;
  gap: 0;
  position: relative;
}

.timeline::before {
  content: '';
  position: absolute;
  left: 9px;
  top: 12px;
  bottom: 12px;
  width: 2px;
  background: var(--border);
}

.timeline-item {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  padding-bottom: 20px;
  position: relative;
}

.timeline-item:last-child { padding-bottom: 0; }

.timeline-dot {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  flex-shrink: 0;
  margin-top: 2px;
  border: 2px solid var(--bg-card);
  box-shadow: 0 0 8px rgba(124,58,237,0.4);
  position: relative;
  z-index: 1;
}

.timeline-content {
  flex: 1;
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.07);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
}

.timeline-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
}

.timeline-emoji { font-size: 20px; }

.timeline-type {
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
}

.timeline-eng {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1px;
  color: var(--text-muted);
  margin-left: auto;
}

.timeline-date {
  font-size: 12px;
  color: var(--text-muted);
}

/* 빈 상태 */
.empty-state {
  text-align: center;
  padding: 48px 0;
}

.empty-emoji {
  font-size: 56px;
  display: block;
  margin-bottom: 16px;
}

.empty-title {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 8px;
  color: var(--text);
}

.empty-desc {
  font-size: 14px;
  color: var(--text-muted);
  margin-bottom: 28px;
  line-height: 1.6;
}

/* ===== Toast ===== */
.toast {
  position: fixed;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%) translateY(80px);
  background: rgba(30,20,60,0.95);
  border: 1px solid var(--border);
  border-radius: 100px;
  padding: 12px 24px;
  font-size: 14px;
  color: var(--text);
  backdrop-filter: blur(20px);
  box-shadow: 0 8px 32px rgba(0,0,0,0.4);
  z-index: 1000;
  transition: transform 0.4s cubic-bezier(0.34,1.56,0.64,1), opacity 0.3s ease;
  opacity: 0;
  white-space: nowrap;
}

.toast.show {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}

/* ===== Loading ===== */
.loading-spinner {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding: 60px 0;
}

.spinner {
  width: 48px; height: 48px;
  border: 3px solid rgba(124,58,237,0.2);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

.loading-text { color: var(--text-muted); font-size: 15px; }

/* ===== Utility ===== */
.text-center { text-align: center; }
.mt-12 { margin-top: 12px; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.hidden { display: none !important; }

/* ===== Animations ===== */
.fade-in { animation: fadeIn 0.5s ease forwards; }

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

.slide-in { animation: slideIn 0.4s cubic-bezier(0.34,1.56,0.64,1) forwards; }

@keyframes slideIn {
  from { opacity: 0; transform: translateX(30px); }
  to   { opacity: 1; transform: translateX(0); }
}

/* ===== Responsive ===== */
@media (min-width: 480px) {
  .container { padding: 40px 24px; }
  .landing-title { font-size: 32px; }
  .question-text { font-size: 22px; }
  .share-card-type { font-size: 32px; }
}

@media (max-width: 360px) {
  .card { padding: 24px 20px; }
  .landing-title { font-size: 24px; }
  .question-text { font-size: 18px; }
  .landing-emoji { font-size: 60px; }
  .share-card-emoji { font-size: 64px; }
  .share-card-type { font-size: 22px; }
}
