:root {
  --yellow: #fae100;
  --yellow-deep: #f5cf00;
  --dark: #191919;
  --dark-2: #2b2b2b;
  --brown: #3c1e1e;
  --bg: #12131a;
  --card: #1d1f2a;
  --card-2: #262939;
  --text: #f4f4f6;
  --text-dim: #9a9dad;
  --blue: #8ab4ff;
  --pink: #ff7eb0;
}

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

html, body { height: 100%; }

body {
  font-family: "Pretendard Variable", Pretendard, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  background-image:
    radial-gradient(600px 400px at 80% -10%, rgba(250, 225, 0, 0.08), transparent),
    radial-gradient(500px 400px at 0% 100%, rgba(138, 180, 255, 0.06), transparent);
  min-height: 100dvh;
}

#app {
  max-width: 430px;
  margin: 0 auto;
  padding: 28px 22px 40px;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}

.screen { display: none; flex: 1; flex-direction: column; animation: fade .35s ease; }
.screen.active { display: flex; }
.hidden { display: none !important; }

@keyframes fade { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* ---------- 인트로 ---------- */
#screen-intro { justify-content: center; text-align: center; gap: 14px; }

.intro-badge {
  align-self: center;
  background: rgba(250, 225, 0, 0.12);
  color: var(--yellow);
  border: 1px solid rgba(250, 225, 0, 0.35);
  font-size: 12px; font-weight: 700;
  padding: 6px 14px; border-radius: 999px;
  letter-spacing: 0.04em;
}

.intro-title { font-size: 44px; line-height: 1.15; font-weight: 800; letter-spacing: -0.02em; }
.intro-sub { color: var(--text-dim); font-size: 17px; }
.intro-sub b { color: var(--yellow); }

.bubble-demo { display: flex; flex-direction: column; gap: 8px; margin: 18px 0 8px; }
.bubble {
  max-width: 78%; padding: 11px 15px; border-radius: 18px;
  font-size: 14.5px; text-align: left; line-height: 1.4;
}
.bubble.left { align-self: flex-start; background: var(--card-2); border-bottom-left-radius: 4px; }
.bubble.right { align-self: flex-end; background: var(--yellow); color: var(--brown); font-weight: 600; border-bottom-right-radius: 4px; }

.friend-teaser {
  background: var(--card); border: 1px dashed rgba(250,225,0,.4);
  border-radius: 14px; padding: 12px 16px; font-size: 14px; color: var(--text);
}
.friend-teaser b { color: var(--yellow); }

.intro-note { font-size: 12.5px; color: var(--text-dim); }

/* ---------- 버튼 ---------- */
.btn-primary {
  width: 100%; border: none; cursor: pointer;
  background: var(--yellow); color: var(--brown);
  font-size: 17px; font-weight: 800; font-family: inherit;
  padding: 17px; border-radius: 16px; margin-top: 10px;
  box-shadow: 0 6px 24px rgba(250, 225, 0, 0.25);
  transition: transform .12s ease;
}
.btn-primary:active { transform: scale(0.97); }

.btn-secondary {
  width: 100%; cursor: pointer;
  background: var(--card-2); color: var(--text);
  border: 1px solid rgba(255,255,255,.08);
  font-size: 16px; font-weight: 700; font-family: inherit;
  padding: 16px; border-radius: 16px; margin-top: 10px;
}

.btn-ghost {
  width: 100%; cursor: pointer;
  background: none; border: none; color: var(--text-dim);
  font-size: 14px; font-family: inherit; padding: 14px; margin-top: 4px;
  text-decoration: underline; text-underline-offset: 3px;
}

/* ---------- 검사 ---------- */
#screen-quiz, #screen-bonus { justify-content: center; gap: 22px; }

.quiz-top { display: flex; align-items: center; gap: 12px; }
.progress-track { flex: 1; height: 6px; background: var(--card-2); border-radius: 99px; overflow: hidden; }
.progress-fill { height: 100%; width: 0%; background: var(--yellow); border-radius: 99px; transition: width .3s ease; }
.quiz-count { font-size: 13px; font-weight: 700; color: var(--text-dim); min-width: 44px; text-align: right; }

.quiz-q { font-size: 23px; font-weight: 800; line-height: 1.4; letter-spacing: -0.01em; min-height: 96px; display: flex; align-items: center; }

.quiz-options { display: flex; flex-direction: column; gap: 12px; }
.quiz-opt {
  cursor: pointer; text-align: left; font-family: inherit;
  background: var(--card); color: var(--text);
  border: 1.5px solid rgba(255,255,255,.07);
  font-size: 16px; font-weight: 600; line-height: 1.45;
  padding: 18px 18px; border-radius: 16px;
  transition: transform .1s ease, border-color .1s ease, background .1s ease;
}
.quiz-opt:active { transform: scale(0.98); border-color: var(--yellow); background: rgba(250,225,0,.07); }

.bonus-input {
  width: 100%; font-family: inherit; font-size: 16px;
  background: var(--card); color: var(--text);
  border: 1.5px solid rgba(255,255,255,.1); border-radius: 16px;
  padding: 16px 18px; outline: none;
}
.bonus-input:focus { border-color: var(--yellow); }

/* ---------- 로딩 ---------- */
#screen-loading { justify-content: center; align-items: center; gap: 18px; text-align: center; }
.loading-emoji { font-size: 64px; animation: bob 1.2s ease-in-out infinite; }
@keyframes bob { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-10px); } }
.loading-text { font-size: 18px; font-weight: 700; }
.loading-dots { display: flex; gap: 6px; }
.loading-dots span { width: 8px; height: 8px; border-radius: 50%; background: var(--yellow); animation: blink 1.2s infinite; }
.loading-dots span:nth-child(2) { animation-delay: .2s; }
.loading-dots span:nth-child(3) { animation-delay: .4s; }
@keyframes blink { 0%,100% { opacity: .25; } 50% { opacity: 1; } }

/* ---------- 결과 ---------- */
#screen-result { gap: 14px; padding-top: 6px; }

.result-card {
  background: linear-gradient(160deg, var(--card) 0%, var(--card-2) 100%);
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 24px; padding: 28px 24px; text-align: center;
}
.result-label { font-size: 12.5px; font-weight: 700; color: var(--yellow); letter-spacing: .08em; }
.result-emoji { font-size: 64px; margin: 14px 0 6px; }
.result-name { font-size: 32px; font-weight: 800; letter-spacing: -0.02em; }
.result-tagline { color: var(--text-dim); font-size: 14.5px; margin-top: 8px; }

.result-axes { display: flex; flex-direction: column; gap: 10px; margin: 22px 0; text-align: left; }
.axis-row { display: flex; align-items: center; gap: 10px; font-size: 12.5px; }
.axis-name { min-width: 74px; font-weight: 700; color: var(--text-dim); }
.axis-track { flex: 1; height: 8px; background: rgba(255,255,255,.07); border-radius: 99px; overflow: hidden; }
.axis-fill { height: 100%; background: linear-gradient(90deg, var(--yellow), var(--pink)); border-radius: 99px; transition: width .8s ease; }
.axis-pct { min-width: 66px; text-align: right; font-weight: 700; color: var(--text); }

.result-desc { font-size: 15px; line-height: 1.65; text-align: left; color: var(--text); }

.result-traits { list-style: none; margin-top: 16px; display: flex; flex-direction: column; gap: 8px; text-align: left; }
.result-traits li {
  background: rgba(255,255,255,.05); border-radius: 12px;
  padding: 10px 14px; font-size: 14px; font-weight: 600;
}
.result-traits li::before { content: "✔️ "; }

.result-match { display: flex; gap: 10px; margin-top: 18px; }
.match-item {
  flex: 1; border-radius: 14px; padding: 12px 10px;
  display: flex; flex-direction: column; gap: 4px; font-size: 14px; font-weight: 700;
}
.match-item.good { background: rgba(138, 180, 255, .12); color: var(--blue); }
.match-item.bad { background: rgba(255, 126, 176, .12); color: var(--pink); }
.match-label { font-size: 11.5px; opacity: .8; font-weight: 600; }

/* AI 섹션 */
.ai-section {
  background: var(--card);
  border: 1px solid rgba(138, 180, 255, .25);
  border-radius: 20px; padding: 22px 20px;
}
.ai-header { font-size: 15px; font-weight: 800; display: flex; align-items: center; gap: 8px; margin-bottom: 12px; }
.ai-badge {
  font-size: 10.5px; font-weight: 800; letter-spacing: .05em;
  background: rgba(138,180,255,.15); color: var(--blue);
  padding: 3px 8px; border-radius: 99px;
}
.ai-content { font-size: 14.5px; line-height: 1.7; color: var(--text); white-space: pre-wrap; }
.ai-quote {
  margin-top: 14px; padding: 14px 16px;
  background: rgba(250,225,0,.08); border-left: 3px solid var(--yellow);
  border-radius: 0 12px 12px 0;
  font-size: 15px; font-weight: 700; font-style: italic;
}
.ai-quote:empty { display: none; }

.share-row { margin-top: 6px; }
.footer-note { text-align: center; font-size: 12px; color: var(--text-dim); margin-top: 10px; }

@media (max-width: 360px) {
  .intro-title { font-size: 36px; }
  .result-name { font-size: 26px; }
}
