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

:root {
  --bg: #0D0B08;
  --bg2: #1A1510;
  --surface: #231E16;
  --surface2: #2E2720;
  --text: #E8DFD0;
  --text2: #A89880;
  --accent: #FF8C00;
  --accent2: #FFB347;
  --fire: #FF5722;
  --warm: #D4A017;
  --radius: 16px;
}

html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
}

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

/* ========== SCREEN SYSTEM ========== */
.screen {
  display: none;
  min-height: 100vh;
}
.screen.active {
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* ========== INTRO ========== */
#intro {
  justify-content: center;
  text-align: center;
  padding: 40px 24px;
  position: relative;
  background: radial-gradient(ellipse at 50% 80%, rgba(255,100,20,0.08) 0%, transparent 60%),
              var(--bg);
}

.fire-particles {
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 200px;
  height: 300px;
  pointer-events: none;
}
.fire-particles span {
  position: absolute;
  bottom: 0;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  opacity: 0;
  animation: spark 3s infinite ease-out;
}
.fire-particles span:nth-child(1)  { left: 30%; animation-delay: 0s; }
.fire-particles span:nth-child(2)  { left: 50%; animation-delay: 0.3s; }
.fire-particles span:nth-child(3)  { left: 70%; animation-delay: 0.6s; }
.fire-particles span:nth-child(4)  { left: 40%; animation-delay: 0.9s; }
.fire-particles span:nth-child(5)  { left: 60%; animation-delay: 1.2s; }
.fire-particles span:nth-child(6)  { left: 35%; animation-delay: 1.5s; }
.fire-particles span:nth-child(7)  { left: 65%; animation-delay: 1.8s; }
.fire-particles span:nth-child(8)  { left: 45%; animation-delay: 2.1s; }
.fire-particles span:nth-child(9)  { left: 55%; animation-delay: 2.4s; }
.fire-particles span:nth-child(10) { left: 48%; animation-delay: 2.7s; }

@keyframes spark {
  0%   { transform: translateY(0) scale(1); opacity: 0.8; }
  100% { transform: translateY(-260px) scale(0); opacity: 0; }
}

.intro-content { position: relative; z-index: 1; }

.intro-logo {
  width: 130px;
  height: auto;
  margin-bottom: 24px;
  opacity: 0.9;
}

.intro-sub {
  font-size: 0.85rem;
  color: var(--text2);
  letter-spacing: 2px;
  margin-bottom: 16px;
  text-transform: uppercase;
}

.intro-title {
  margin-bottom: 24px;
}
.title-line {
  display: block;
  font-family: 'Noto Sans KR', sans-serif;
  font-weight: 900;
  line-height: 1.3;
}
.title-line.small-original {
  font-size: 1.5rem;
  color: var(--text);
}
.title-line.large-orange {
  font-size: 3.2rem;
  color: var(--accent);
  margin: 4px 0;
}

.intro-desc {
  font-size: 0.95rem;
  color: var(--text2);
  line-height: 1.7;
  margin-bottom: 40px;
}

.btn-start {
  display: inline-block;
  padding: 16px 48px;
  background: linear-gradient(135deg, var(--accent), var(--fire));
  color: #fff;
  font-family: 'Noto Sans KR', sans-serif;
  font-size: 1.1rem;
  font-weight: 700;
  border: none;
  border-radius: 60px;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
  box-shadow: 0 4px 24px rgba(255,140,0,0.3);
}
.btn-start:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 32px rgba(255,140,0,0.4);
}
.btn-start:active {
  transform: scale(0.97);
}

.intro-note {
  margin-top: 16px;
  font-size: 0.8rem;
  color: var(--text2);
}

/* ========== QUIZ ========== */
#quiz {
  padding: 0 20px 40px;
  background: var(--bg);
}

.quiz-progress {
  width: 100%;
  max-width: 520px;
  padding: 24px 0 8px;
  display: flex;
  align-items: center;
  gap: 12px;
}
.progress-bar {
  flex: 1;
  height: 6px;
  background: var(--surface);
  border-radius: 3px;
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent), var(--fire));
  border-radius: 3px;
  transition: width 0.4s ease;
}
.progress-text {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 1rem;
  color: var(--text2);
  min-width: 52px;
  text-align: right;
}

.quiz-card {
  width: 100%;
  max-width: 520px;
  margin-top: 16px;
}

.quiz-card.slide-in {
  animation: slideIn 0.35s ease-out;
}
@keyframes slideIn {
  from { opacity: 0; transform: translateX(30px); }
  to   { opacity: 1; transform: translateX(0); }
}

/* 문항 블록 */
.q-block {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 24px 20px;
  margin-bottom: 14px;
  border: 1px solid rgba(255,255,255,0.05);
}
.q-header {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  margin-bottom: 16px;
}
.q-number {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 1rem;
  color: var(--accent);
  flex-shrink: 0;
  padding-top: 2px;
}
.q-text {
  font-size: 0.95rem;
  font-weight: 500;
  line-height: 1.6;
  color: var(--text);
  word-break: keep-all;
}

/* 5개 선택지 가로 배열 */
.q-options {
  display: flex;
  gap: 8px;
}
.opt-pill {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 12px 4px;
  background: var(--bg2);
  border: 1.5px solid rgba(255,255,255,0.06);
  border-radius: 12px;
  color: var(--text2);
  font-family: 'Noto Sans KR', sans-serif;
  font-size: 0.72rem;
  cursor: pointer;
  transition: all 0.2s;
  text-align: center;
  line-height: 1.3;
}
.opt-pill:hover {
  border-color: var(--accent);
  background: rgba(255,140,0,0.06);
}
.opt-pill.selected {
  border-color: var(--accent);
  background: rgba(255,140,0,0.15);
  color: var(--text);
}
.opt-pill.selected .pill-num {
  background: var(--accent);
  color: #000;
}
.pill-num {
  width: 26px;
  height: 26px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--surface2);
  font-weight: 700;
  font-size: 0.8rem;
  color: var(--text2);
  transition: all 0.2s;
}
.pill-label {
  white-space: pre-line;
}

/* 네비게이션 */
.quiz-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 8px;
  padding-top: 8px;
}
.nav-btn {
  padding: 14px 28px;
  font-family: 'Noto Sans KR', sans-serif;
  font-size: 0.95rem;
  font-weight: 700;
  border: none;
  border-radius: 60px;
  cursor: pointer;
  transition: all 0.2s;
}
.nav-prev {
  background: var(--surface2);
  color: var(--text2);
}
.nav-prev:hover {
  background: var(--surface);
  color: var(--text);
}
.nav-next, .nav-submit {
  background: linear-gradient(135deg, var(--accent), var(--fire));
  color: #fff;
  box-shadow: 0 4px 16px rgba(255,140,0,0.25);
}
.nav-next:hover, .nav-submit:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(255,140,0,0.35);
}
.btn-disabled {
  opacity: 0.35;
  pointer-events: none;
}

/* 추가된 퀴즈 하단 링크 영역 스타일 */
.quiz-footer {
  text-align: center;
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px dashed rgba(255,255,255,0.08);
}
.quiz-footer p {
  font-size: 0.75rem;
  color: var(--text2);
  margin-bottom: 8px;
}
.quiz-footer a {
  display: inline-block;
  font-size: 0.9rem;
  color: var(--accent);
  text-decoration: none;
  font-weight: 700;
  transition: all 0.2s;
}
.quiz-footer a:hover {
  color: var(--accent2);
  text-decoration: underline;
}

/* ========== LOADING ========== */
#loading {
  justify-content: center;
  text-align: center;
  background: var(--bg);
}
.loading-content { text-align: center; }
.loading-fire {
  font-size: 4rem;
  animation: pulse 1s infinite alternate;
}
@keyframes pulse {
  from { transform: scale(1); }
  to   { transform: scale(1.15); }
}
.loading-text {
  margin-top: 20px;
  font-size: 1rem;
  color: var(--text2);
}
.loading-dots {
  display: flex;
  justify-content: center;
  gap: 6px;
  margin-top: 16px;
}
.loading-dots span {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--accent);
  animation: bounce 1.4s infinite ease-in-out;
}
.loading-dots span:nth-child(2) { animation-delay: 0.2s; }
.loading-dots span:nth-child(3) { animation-delay: 0.4s; }
@keyframes bounce {
  0%, 80%, 100% { transform: scale(0.4); opacity: 0.3; }
  40% { transform: scale(1); opacity: 1; }
}

/* ========== RESULT ========== */
#result {
  padding: 32px 20px 60px;
  background: var(--bg);
}
.result-content {
  width: 100%;
  max-width: 560px;
}

/* 등급 카드 */
.result-grade-card {
  text-align: center;
  padding: 48px 28px 40px;
  background: var(--surface);
  border-radius: 20px;
  border: 2px solid var(--grade-color);
  position: relative;
  overflow: hidden;
}
.result-grade-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 4px;
  background: var(--grade-color);
}

.grade-hero-img {
  width: 180px;
  height: auto;
  margin: 0 auto 16px auto;
  display: block;
}

.grade-emoji { font-size: 2.8rem; margin-bottom: 8px; }
.grade-lv {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 1.4rem;
  color: var(--grade-color);
  letter-spacing: 2px;
}
.grade-name {
  font-size: 1.8rem;
  font-weight: 900;
  color: var(--text);
  margin: 4px 0 12px;
}
.grade-score {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 2.6rem;
  color: var(--grade-color);
}
.grade-max {
  font-size: 1rem;
  color: var(--text2);
}
.grade-msg {
  margin-top: 24px;
  font-size: 0.92rem;
  line-height: 1.8;
  color: var(--text2);
  word-break: keep-all;
}

/* 섹션 */
.result-section {
  margin-top: 36px;
}
.section-title {
  font-size: 1.15rem;
  font-weight: 700;
  margin-bottom: 20px;
  color: var(--text);
}

/* 레이더 */
.radar-wrap {
  display: flex;
  justify-content: center;
  margin-bottom: 24px;
}

/* 레벨 바 */
.level-bars {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.level-bar-row {
  display: flex;
  align-items: center;
  gap: 12px;
}
.lv-label {
  font-size: 0.82rem;
  color: var(--text2);
  min-width: 90px;
}
.lv-bar-track {
  flex: 1;
  height: 10px;
  background: var(--surface2);
  border-radius: 5px;
  overflow: hidden;
}
.lv-bar-fill {
  height: 100%;
  border-radius: 5px;
  transition: width 1s ease-out;
}
.lv-pct {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 0.95rem;
  color: var(--accent);
  min-width: 40px;
  text-align: right;
}

/* 버튼 그리드 */
.button-grid {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.btn-score-card {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  background: var(--surface);
  border-radius: 12px;
}
.btn-icon { font-size: 1.2rem; flex-shrink: 0; }
.btn-name {
  font-size: 0.85rem;
  color: var(--text2);
  min-width: 90px;
}
.btn-bar-track {
  flex: 1;
  height: 8px;
  background: var(--surface2);
  border-radius: 4px;
  overflow: hidden;
}
.btn-bar-fill {
  height: 100%;
  border-radius: 4px;
}
.btn-avg {
  font-size: 0.82rem;
  min-width: 55px;
  text-align: right;
  color: var(--text2);
}

/* 약한 버튼 */
.weak-card {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 12px;
  border-left: 4px solid var(--fire);
}
.weak-rank {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 0.9rem;
  color: var(--fire);
  margin-bottom: 8px;
}
.weak-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
}
.weak-icon { font-size: 1.3rem; }
.weak-name { font-weight: 700; font-size: 1rem; flex: 1; }
.weak-score {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 1.1rem;
  color: var(--fire);
}
.weak-prescription {
  font-size: 0.88rem;
  line-height: 1.75;
  color: var(--text2);
  word-break: keep-all;
}

/* 강한 버튼 */
.strong-card {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 12px;
  border-left: 4px solid var(--warm);
}
.strong-rank-badge {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 0.9rem;
  color: var(--warm);
  margin-bottom: 8px;
}
.strong-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
}
.strong-icon { font-size: 1.3rem; }
.strong-name { font-weight: 700; font-size: 1rem; flex: 1; }
.strong-score {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 1.1rem;
  color: var(--warm);
}
.strong-text {
  font-size: 0.88rem;
  line-height: 1.75;
  color: var(--text2);
  word-break: keep-all;
}

/* 📚 새롭게 추가된 홍보 배너 스타일 */
.promo-banner {
  display: flex;
  align-items: center;
  gap: 16px;
  background: var(--surface);
  border: 1px solid rgba(255, 140, 0, 0.2);
  border-radius: var(--radius);
  padding: 20px;
  margin-top: 40px;
}
.promo-img {
  width: 90px;
  height: auto;
  flex-shrink: 0;
  border-radius: 4px;
}
.promo-text {
  display: flex;
  flex-direction: column;
  gap: 6px;
  text-align: left;
}
.promo-text p {
  font-size: 0.85rem;
  color: var(--text2);
  line-height: 1.4;
}
.promo-text .promo-highlight {
  font-size: 0.95rem;
  color: var(--text);
  font-weight: 700;
  margin-top: 4px;
}
.promo-text a {
  display: inline-block;
  margin-top: 8px;
  font-size: 0.95rem;
  color: var(--accent);
  text-decoration: none;
  font-weight: 700;
  transition: all 0.2s;
}
.promo-text a:hover {
  color: var(--accent2);
  text-decoration: underline;
}

/* 버튼 2개 (다시하기, 공유하기) 정렬용 */
.result-footer {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding-top: 24px;
}

/* 다시 테스트하기 버튼 (테두리만 있는 스타일 유지) */
.btn-retry {
  width: 100%;
  max-width: 320px;
  padding: 14px 0;
  background: transparent;
  border: 2px solid var(--accent);
  color: var(--accent);
  font-family: 'Noto Sans KR', sans-serif;
  font-size: 1rem;
  font-weight: 700;
  border-radius: 60px;
  cursor: pointer;
  transition: all 0.2s;
}
.btn-retry:hover {
  background: var(--accent);
  color: #000;
}

/* 공유하기 버튼 (색이 꽉 찬 눈에 띄는 스타일) */
.btn-share {
  width: 100%;
  max-width: 320px;
  padding: 14px 0;
  background: linear-gradient(135deg, var(--accent), var(--fire));
  color: #fff;
  font-family: 'Noto Sans KR', sans-serif;
  font-size: 1rem;
  font-weight: 700;
  border: none;
  border-radius: 60px;
  cursor: pointer;
  transition: all 0.2s;
  box-shadow: 0 4px 16px rgba(255,140,0,0.25);
}
.btn-share:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(255,140,0,0.35);
}

/* ========== RESPONSIVE ========== */
@media (max-width: 480px) {
  .title-line { font-size: 1.6rem; }
  .title-line.accent { font-size: 1.9rem; }
  .quiz-card { padding: 28px 20px; }
  .quiz-question { font-size: 1rem; }
  .result-grade-card { padding: 36px 20px 32px; }
  .grade-name { font-size: 1.5rem; }
  .grade-score { font-size: 2.2rem; }
  .title-line.large-orange { font-size: 2.6rem; } 
  
  /* 모바일에서 책 홍보 배너 대응 */
  .promo-banner {
    flex-direction: column;
    text-align: center;
  }
  .promo-text {
    align-items: center;
    text-align: center;
  }
}