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

:root {
  --pink:      #ff6b9d;
  --pink-lt:   #ffe4f0;
  --purple:    #a855f7;
  --purple-lt: #f3e8ff;
  --navy:      #1e2a4a;
  --gray:      #6b7280;
  --bg:        #fdf8ff;
  --white:     #ffffff;
  --radius:    18px;
  --shadow:    0 8px 32px rgba(168,85,247,0.12);
}

body {
  font-family: 'Nunito', sans-serif;
  background: var(--bg);
  color: var(--navy);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* ── QUESTION IMAGE ── */
.q-img {
  width: 100%;
  height: auto;
  max-height: 280px;
  object-fit: contain;
  border-radius: var(--radius);
  margin-bottom: 16px;
  display: block;
  background: transparent;
}

/* ── BACK BUTTON ── */
.back-btn {
  background: var(--white);
  border: 2px solid #e5e7eb;
  border-radius: 50px;
  color: var(--dark);
  font-family: 'Nunito', sans-serif;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  padding: 10px 22px;
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 8px;
  transition: all .2s;
}
.back-btn:hover:not(:disabled) { border-color: var(--purple); color: var(--purple); }
.back-btn:disabled { opacity: 0.3; cursor: default; }

/* ── QUIZ NAV (뒤로가기 + 홈 버튼) ── */
.quiz-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 8px;
}
.home-btn {
  font-family: 'Nunito', sans-serif;
  font-size: 14px;
  font-weight: 700;
  color: var(--dark) !important;
  text-decoration: none !important;
  padding: 10px 20px;
  border-radius: 50px;
  background: var(--white);
  border: 2px solid #e5e7eb;
  transition: all .2s;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.home-btn:hover { border-color: var(--purple); color: var(--purple) !important; }

/* ── AD SLOTS ── */
.ad-slot {
  width: 100%;
  border-radius: var(--radius);
  overflow: hidden;
  margin: 16px 0;
  min-height: 0;
}
.ad-slot-top  { margin-top: 8px; }
.ad-slot-mid  { margin-top: 0; }

/* ── ROUTINE SECTION ── */
.routine-section {
  background: var(--white);
  border-radius: var(--radius);
  padding: 22px;
  margin: 16px 0;
  box-shadow: var(--shadow);
  border-top: 4px solid #10b981;
}
.routine-section h3 {
  font-size: 16px;
  font-weight: 800;
  margin-bottom: 4px;
  color: var(--navy);
}
.routine-subtitle {
  font-size: 13px;
  color: var(--gray);
  margin-bottom: 16px;
}
.routine-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
.routine-col {
  background: var(--white);
  border-radius: 12px;
  padding: 14px;
}
.routine-time {
  font-size: 13px;
  font-weight: 800;
  margin-bottom: 10px;
  color: var(--navy);
}
.routine-col ol {
  padding-left: 18px;
  margin: 0;
}
.routine-col ol li {
  font-size: 12px;
  color: #374151;
  margin-bottom: 6px;
  line-height: 1.5;
}

/* ── SHARE CHALLENGE ── */
.share-challenge {
  background: linear-gradient(135deg, var(--pink-lt), var(--purple-lt));
  border-radius: var(--radius);
  padding: 16px 20px;
  text-align: center;
  margin-bottom: 16px;
}
.share-challenge-text {
  font-size: 17px;
  font-weight: 800;
  margin-bottom: 4px;
}
.share-challenge-sub {
  font-size: 13px;
  color: var(--gray);
}

/* ── GLOBAL STATS ── */
.stats-global-section {
  background: var(--white);
  border-radius: var(--radius);
  padding: 22px;
  box-shadow: var(--shadow);
  margin-bottom: 20px;
}
.stats-global-section h3 {
  font-size: 15px;
  font-weight: 800;
  margin-bottom: 14px;
  color: var(--navy);
}
.stats-highlight {
  font-size: 14px;
  color: var(--purple);
  font-weight: 700;
  margin-bottom: 18px;
  background: var(--purple-lt);
  padding: 10px 14px;
  border-radius: 10px;
}
.stat-global-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}
.stat-global-label {
  font-size: 13px;
  font-weight: 700;
  width: 110px;
  flex-shrink: 0;
  color: var(--gray);
}
.stat-global-label.active { color: var(--pink); }
.stat-global-track {
  flex: 1;
  height: 10px;
  background: #f1f5f9;
  border-radius: 50px;
  overflow: hidden;
}
.stat-global-fill {
  height: 100%;
  border-radius: 50px;
  background: #e2e8f0;
  transition: width 1.5s cubic-bezier(.4,0,.2,1);
}
.stat-global-fill.active {
  background: linear-gradient(90deg, var(--pink), var(--purple));
}
.stat-global-pct {
  font-size: 12px;
  font-weight: 700;
  color: var(--gray);
  width: 36px;
  text-align: right;
}
.stat-global-pct.active { color: var(--pink); }

/* ── WRAPPER ── */
#app {
  width: 100%;
  max-width: 680px;
  padding: 0 16px 60px;
}

/* ── SCREEN TRANSITIONS ── */
.screen { display: none; animation: fadeUp .45s ease both; }
.screen.active { display: block; }
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(24px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ── INTRO ── */
.intro-hero {
  text-align: center;
  padding: 32px 0 24px;
}
.intro-hero .badge {
  display: inline-block;
  background: linear-gradient(135deg, var(--pink), var(--purple));
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  padding: 6px 18px;
  border-radius: 50px;
  margin-bottom: 20px;
  letter-spacing: .5px;
}
.intro-hero h1 {
  font-size: clamp(26px, 5vw, 38px);
  font-weight: 900;
  line-height: 1.25;
  margin-bottom: 14px;
  background: linear-gradient(135deg, var(--pink), var(--purple));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.intro-hero p {
  font-size: 16px;
  color: var(--gray);
  line-height: 1.7;
  max-width: 480px;
  margin: 0 auto 28px;
}
.skin-types-preview {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
  margin-bottom: 32px;
}
.skin-chip {
  background: var(--white);
  border: 2px solid var(--pink-lt);
  border-radius: 50px;
  padding: 8px 18px;
  font-size: 14px;
  font-weight: 700;
  color: var(--pink);
  box-shadow: 0 2px 8px rgba(255,107,157,.1);
}
.skin-chip span { margin-right: 4px; }
.intro-img {
  width: 100%;
  max-width: 340px;
  border-radius: var(--radius);
  margin: 0 auto 28px;
  display: block;
  object-fit: cover;
  height: 200px;
  box-shadow: var(--shadow);
}
.stats-row {
  display: flex;
  justify-content: center;
  gap: 24px;
  margin-bottom: 32px;
}
.stat { text-align: center; }
.stat-num { font-size: 22px; font-weight: 900; color: var(--purple); }
.stat-lbl { font-size: 12px; color: var(--gray); font-weight: 600; }

/* ── BUTTON ── */
.btn-primary {
  display: block;
  width: 100%;
  max-width: 360px;
  margin: 0 auto;
  background: linear-gradient(135deg, var(--pink) 0%, var(--purple) 100%);
  color: #fff;
  font-family: 'Nunito', sans-serif;
  font-size: 18px;
  font-weight: 800;
  padding: 18px 32px;
  border: none;
  border-radius: 50px;
  cursor: pointer;
  box-shadow: 0 8px 24px rgba(168,85,247,.35);
  transition: transform .2s, box-shadow .2s;
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 12px 32px rgba(168,85,247,.45); }
.btn-primary:active { transform: translateY(0); }

/* ── QUIZ ── */
.progress-wrap { margin: 24px 0 20px; }
.progress-text {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  font-weight: 700;
  color: var(--gray);
  margin-bottom: 8px;
}
.progress-bar {
  background: var(--pink-lt);
  border-radius: 50px;
  height: 10px;
  overflow: hidden;
}
.progress-fill {
  background: linear-gradient(90deg, var(--pink), var(--purple));
  height: 100%;
  border-radius: 50px;
  transition: width .5s cubic-bezier(.4,0,.2,1);
}

.question-card {
  background: var(--white);
  border-radius: var(--radius);
  padding: 28px 24px;
  box-shadow: var(--shadow);
  margin-bottom: 20px;
}
.q-number {
  font-size: 13px;
  font-weight: 700;
  color: var(--pink);
  margin-bottom: 10px;
  letter-spacing: .5px;
}
.q-text {
  font-size: clamp(17px, 3.5vw, 20px);
  font-weight: 800;
  line-height: 1.45;
  color: var(--navy);
}
.q-icon { font-size: 32px; margin-bottom: 12px; display: block; }

.options-grid {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 20px;
}
.option-btn {
  background: var(--white);
  border: 2px solid #e9d5ff;
  border-radius: var(--radius);
  padding: 16px 20px;
  text-align: left;
  font-family: 'Nunito', sans-serif;
  font-size: 15px;
  font-weight: 700;
  color: var(--navy);
  cursor: pointer;
  transition: all .2s;
  display: flex;
  align-items: center;
  gap: 12px;
}
.option-btn:hover {
  border-color: var(--purple);
  background: var(--purple-lt);
  transform: translateX(4px);
}
.option-btn.selected {
  border-color: var(--pink);
  background: var(--pink-lt);
  color: var(--pink);
}
.option-letter {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--purple-lt);
  color: var(--purple);
  font-size: 13px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.option-btn.selected .option-letter {
  background: var(--pink);
  color: #fff;
}

/* ── LOADING ── */
#loading-screen {
  text-align: center;
  padding: 60px 20px;
}
.loader-ring {
  width: 80px;
  height: 80px;
  border: 6px solid var(--pink-lt);
  border-top-color: var(--pink);
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin: 0 auto 28px;
}
@keyframes spin { to { transform: rotate(360deg); } }
#loading-screen h2 { font-size: 22px; font-weight: 800; margin-bottom: 8px; }
#loading-screen p  { color: var(--gray); font-size: 15px; }
.loading-tips {
  margin-top: 32px;
  background: var(--white);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow);
  text-align: left;
}
.loading-tips h3 { font-size: 14px; font-weight: 800; color: var(--purple); margin-bottom: 12px; }
.loading-tips li { font-size: 14px; color: var(--gray); margin-bottom: 8px; padding-left: 4px; }

/* ── RESULT ── */
.result-header {
  text-align: center;
  padding: 28px 0 0;
}
.result-badge {
  display: inline-block;
  padding: 8px 22px;
  border-radius: 50px;
  font-size: 14px;
  font-weight: 700;
  margin-bottom: 16px;
}
.result-skin-name {
  font-size: clamp(28px, 6vw, 42px);
  font-weight: 900;
  line-height: 1.2;
  margin-bottom: 10px;
}
.result-emoji { font-size: 64px; margin-bottom: 12px; display: block; }
.result-tagline {
  font-size: 16px;
  color: var(--gray);
  line-height: 1.6;
  margin-bottom: 24px;
}

/* Score bars */
.score-section {
  background: var(--white);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow);
  margin-bottom: 20px;
}
.score-section h3 {
  font-size: 16px;
  font-weight: 800;
  margin-bottom: 18px;
  color: var(--navy);
}
.score-item { margin-bottom: 14px; }
.score-label {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  font-weight: 700;
  margin-bottom: 6px;
}
.score-track {
  background: #f1f5f9;
  border-radius: 50px;
  height: 10px;
  overflow: hidden;
}
.score-fill {
  height: 100%;
  border-radius: 50px;
  transition: width 1.2s cubic-bezier(.4,0,.2,1);
}

/* Info cards */
.info-card {
  background: var(--white);
  border-radius: var(--radius);
  padding: 22px;
  box-shadow: var(--shadow);
  margin-bottom: 16px;
}
.info-card h3 {
  font-size: 15px;
  font-weight: 800;
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.info-card ul { list-style: none; }
.info-card li {
  font-size: 14px;
  color: var(--gray);
  padding: 6px 0;
  border-bottom: 1px solid #f1f5f9;
  display: flex;
  gap: 8px;
  line-height: 1.5;
}
.info-card li:last-child { border-bottom: none; }

/* Product recommendations */
.products-section {
  background: var(--white);
  border-radius: var(--radius);
  padding: 22px;
  box-shadow: var(--shadow);
  margin-bottom: 20px;
}
.products-section h3 {
  font-size: 16px;
  font-weight: 800;
  margin-bottom: 16px;
  color: var(--navy);
}
.product-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px;
  border: 2px solid var(--pink-lt);
  border-radius: 14px;
  margin-bottom: 12px;
  text-decoration: none;
  color: var(--navy);
  transition: all .2s;
}
.product-card:hover {
  border-color: var(--pink);
  background: var(--pink-lt);
  transform: translateY(-2px);
}
.product-img {
  width: 64px;
  height: 64px;
  border-radius: 10px;
  background: var(--purple-lt);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  flex-shrink: 0;
}
.product-info { flex: 1; }
.product-name { font-size: 14px; font-weight: 800; margin-bottom: 4px; }
.product-desc { font-size: 12px; color: var(--gray); line-height: 1.4; }
.product-price {
  font-size: 15px;
  font-weight: 800;
  color: var(--pink);
  white-space: nowrap;
}
.product-arrow { font-size: 18px; color: var(--pink); }

/* Share */
.share-section {
  text-align: center;
  padding: 24px 0;
}
.share-section h3 {
  font-size: 17px;
  font-weight: 800;
  margin-bottom: 16px;
}
.share-buttons {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: 20px;
}
.share-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 22px;
  border-radius: 50px;
  font-family: 'Nunito', sans-serif;
  font-size: 14px;
  font-weight: 700;
  border: none;
  cursor: pointer;
  transition: all .2s;
  color: #fff;
}
.share-btn:hover { transform: translateY(-2px); opacity: .9; }
.share-fb   { background: #1877f2; }
.share-zalo { background: #0068ff; }
.share-copy { background: var(--gray); }

.result-action-btns {
  display: flex;
  gap: 12px;
  justify-content: center;
  margin-top: 8px;
  flex-wrap: wrap;
}
.retry-btn {
  background: var(--white);
  border: 2px solid #e5e7eb;
  border-radius: 50px;
  color: var(--dark);
  font-family: 'Nunito', sans-serif;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  padding: 12px 28px;
  transition: all .2s;
}
.retry-btn:hover { border-color: var(--purple); color: var(--purple); }
.home-result-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: linear-gradient(135deg, var(--purple), var(--pink));
  color: #fff;
  text-decoration: none;
  font-family: 'Nunito', sans-serif;
  font-size: 15px;
  font-weight: 700;
  padding: 12px 28px;
  border-radius: 50px;
  transition: opacity .2s;
}
.home-result-btn:hover { opacity: 0.88; }

/* ── EMAIL CAPTURE ── */
.email-capture {
  background: linear-gradient(135deg, #f3f0ff, #fce7f3);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 20px;
  text-align: center;
}
.email-capture h3 {
  font-size: 16px;
  font-weight: 800;
  margin-bottom: 4px;
  color: var(--navy);
}
.email-sub {
  font-size: 13px;
  color: var(--gray);
  margin-bottom: 12px;
}
.email-form {
  display: flex;
  gap: 8px;
  max-width: 320px;
  margin: 0 auto;
}
.email-form input[type="email"] {
  flex: 1;
  padding: 10px 14px;
  border: 2px solid #e5e7eb;
  border-radius: 50px;
  font-family: 'Nunito', sans-serif;
  font-size: 14px;
  outline: none;
  transition: border-color .2s;
}
.email-form input[type="email"]:focus { border-color: var(--purple); }
.btn-email {
  background: var(--purple);
  color: white;
  border: none;
  border-radius: 50px;
  padding: 10px 20px;
  font-family: 'Nunito', sans-serif;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  transition: opacity .2s;
}
.btn-email:hover { opacity: .85; }
.btn-email:disabled { opacity: .5; cursor: default; }
.email-status {
  font-size: 13px;
  font-weight: 700;
  margin-top: 8px;
  min-height: 18px;
}

.disclaimer {
  font-size: 11px;
  color: #9ca3af;
  text-align: center;
  padding: 8px 0 24px;
  line-height: 1.6;
}

footer {
  width: 100%;
  background: var(--white);
  border-top: 1px solid #f1f5f9;
  padding: 20px 16px;
  text-align: center;
  font-size: 13px;
  color: var(--gray);
  margin-top: auto;
}
footer a { color: var(--purple); text-decoration: none; font-weight: 700; }

@media (max-width: 768px) and (min-width: 481px) {
  .stats-row { gap: 20px; }
  .question-card { padding: 24px 20px; }
  .share-buttons { gap: 10px; }
  .product-card { padding: 14px; }
}

/* ── Blog Recommendations ── */
.blog-recs-section {
  background: var(--white);
  border-radius: var(--radius);
  padding: 22px;
  margin: 16px 0;
  box-shadow: var(--shadow);
  border-top: 4px solid var(--purple);
}
.blog-recs-section h3 {
  font-size: 16px;
  font-weight: 800;
  color: var(--navy);
  margin-bottom: 4px;
}
.blog-recs-sub {
  font-size: 13px;
  color: var(--gray);
  margin-bottom: 16px;
}
.blog-recs-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}
.blog-rec-card {
  display: block;
  background: linear-gradient(135deg, #faf5ff, #fdf2f8);
  border: 1px solid #e9d5ff;
  border-radius: 14px;
  padding: 16px;
  text-decoration: none;
  color: inherit;
  transition: transform .15s, box-shadow .15s;
}
.blog-rec-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(124,58,237,.12);
}
.blog-rec-tag {
  display: inline-block;
  background: var(--purple);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 50px;
  margin-bottom: 8px;
}
.blog-rec-title {
  font-size: 15px;
  font-weight: 800;
  color: var(--dark);
  margin-bottom: 6px;
  line-height: 1.4;
}
.blog-rec-desc {
  font-size: 13px;
  color: #6b7280;
  line-height: 1.5;
  margin-bottom: 10px;
}
.blog-rec-read {
  font-size: 13px;
  font-weight: 700;
  color: var(--purple);
}

@media (max-width: 480px) {
  .stats-row { gap: 14px; }
  .question-card { padding: 20px 16px; }
  .share-btn { font-size: 13px; padding: 10px 16px; }
  .routine-grid { grid-template-columns: 1fr; }
  .quiz-nav { gap: 8px; }
}
