/* ══════════════════════════════════════════
   Artlogy — MBTI CSS
   520px 고정, 중앙 정렬, SPA 전용
   ══════════════════════════════════════════ */

:root {
  --progress-bg: #E0D8CE;
}

.container {
  max-width: 520px;
  margin: 0 auto;
  padding: 0 20px;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}

/* ── Header (breadcrumb 중앙) ── */
.header {
  text-align: center;
  padding: 24px 0 12px;
  font-size: 12px;
  color: var(--text-secondary);
}
.header a { color: var(--text-secondary); text-decoration: none; transition: color 0.2s; }
.header a:hover { color: var(--accent); }
.header .sep { margin: 0 6px; opacity: 0.4; }
.header .current { font-weight: 500; color: var(--text); }

/* ── Screens ── */
.screen { display: none; flex: 1; flex-direction: column; animation: fadeIn 0.5s ease; }
.screen.active { display: flex; }

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

/* ── Intro ── */
.intro {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  padding: 40px 0;
}
.intro-badge {
  display: inline-block;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 1.5px;
  color: var(--accent);
  border: 1px solid var(--accent-light);
  padding: 6px 16px;
  border-radius: 20px;
  margin-bottom: 32px;
}
.intro h1 {
  font-family: 'Noto Serif KR', serif;
  font-size: 28px;
  font-weight: 700;
  line-height: 1.5;
  margin-bottom: 16px;
}
.intro h1 em { font-style: normal; color: var(--accent); }
.intro p { font-size: 15px; color: var(--text-secondary); margin-bottom: 40px; line-height: 1.8; }
.intro-meta { font-size: 13px; color: var(--text-secondary); opacity: 0.6; margin-bottom: 12px; }

.btn-start {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: 'Noto Sans KR', sans-serif;
  font-size: 16px;
  font-weight: 500;
  color: #fff;
  background: var(--text);
  border: none;
  padding: 16px 48px;
  border-radius: 50px;
  cursor: pointer;
  transition: all 0.3s ease;
  letter-spacing: 0.5px;
}
.btn-start:hover { background: #000; transform: translateY(-2px); box-shadow: 0 8px 24px rgba(0,0,0,0.15); }
.btn-start:active { transform: translateY(0); }

/* ── Quiz ── */
.quiz-area { flex: 1; display: flex; flex-direction: column; padding: 20px 0; }
.progress-wrap { margin-bottom: 32px; }
.progress-info { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.progress-step { font-family: 'Noto Serif KR', serif; font-size: 14px; font-weight: 700; color: var(--accent); }
.progress-total { font-size: 12px; color: var(--text-secondary); opacity: 0.5; }
.progress-bar { width: 100%; height: 3px; background: var(--progress-bg); border-radius: 2px; overflow: hidden; }
.progress-fill { height: 100%; background: var(--accent); border-radius: 2px; transition: width 0.4s cubic-bezier(0.4, 0, 0.2, 1); }

.question-card { animation: slideIn 0.4s ease; }
.question-text {
  font-family: 'Noto Serif KR', serif;
  font-size: 20px;
  font-weight: 700;
  line-height: 1.6;
  margin-bottom: 32px;
  word-break: keep-all;
}

.choices { display: flex; flex-direction: column; gap: 12px; }
.choice-btn {
  width: 100%;
  text-align: left;
  font-family: 'Noto Sans KR', sans-serif;
  font-size: 15px;
  line-height: 1.7;
  color: var(--text);
  background: var(--card);
  border: 1.5px solid var(--border);
  border-radius: 14px;
  padding: 20px 24px;
  cursor: pointer;
  transition: all 0.25s ease;
  word-break: keep-all;
}
.choice-btn:hover { border-color: var(--accent-light); background: #FFFDF8; transform: translateY(-1px); box-shadow: var(--shadow); }
.choice-btn:active { transform: translateY(0); background: #FFF9EE; border-color: var(--accent); }
.choice-btn.selected { border-color: var(--accent); background: #FFF9EE; }
.btn-back {
  display: inline-flex; align-items: center; gap: 4px;
  font-family: 'Noto Sans KR', sans-serif; font-size: 13px; font-weight: 500;
  color: var(--text-secondary); background: none; border: none; cursor: pointer;
  padding: 12px 0 0; transition: color 0.2s;
}
.btn-back:hover { color: var(--text); }

/* ── Loading ── */
.loading-screen { flex: 1; display: flex; flex-direction: column; justify-content: center; align-items: center; text-align: center; gap: 24px; }
.loading-spinner {
  width: 48px; height: 48px;
  border: 2.5px solid var(--border); border-top-color: var(--accent);
  border-radius: 50%; animation: spin 1s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.loading-text { font-family: 'Noto Serif KR', serif; font-size: 16px; color: var(--text-secondary); }

/* ── Result ── */
.result-area { flex: 1; display: flex; flex-direction: column; padding: 20px 0 40px; }
.result-header { text-align: center; margin-bottom: 20px; }
.result-type-badge { text-align: center; margin-bottom: 8px; }
.result-type-badge span {
  display: inline-block; font-size: 13px; font-weight: 700; letter-spacing: 3px;
  color: var(--accent); background: #FFF9EE; border: 1px solid var(--accent-light);
  padding: 6px 20px; border-radius: 20px;
}
.result-typename { font-family: 'Noto Serif KR', serif; font-size: 22px; font-weight: 700; text-align: center; line-height: 1.5; }

.result-artwork-wrap { margin-bottom: 20px; }
.result-hero-artwork {
  width: 100%; aspect-ratio: 3 / 2; object-fit: cover; border-radius: 18px;
  box-shadow: 0 4px 24px rgba(0,0,0,0.12);
  background: linear-gradient(135deg, #e8e0d4 0%, #d4cabe 100%);
}
.result-hero-artwork.hide { display: none; }
.artwork-placeholder {
  width: 100%; aspect-ratio: 3 / 2; border-radius: 18px;
  background: linear-gradient(135deg, #3a3226 0%, #6B5B4F 50%, #3a3226 100%);
  display: flex; align-items: center; justify-content: center;
  color: rgba(255,255,255,0.3); font-size: 40px;
}
.artwork-caption { font-size: 12px; color: var(--text-secondary); text-align: center; margin-top: 8px; opacity: 0.6; font-style: italic; }

.artist-main-section { background: var(--card); border-radius: 16px; padding: 28px 24px; box-shadow: var(--shadow); margin-bottom: 16px; }
.artist-main-section .section-label { font-size: 12px; font-weight: 500; letter-spacing: 1px; color: var(--accent); margin-bottom: 16px; }
.artist-main-section .artist-name-main { font-family: 'Noto Serif KR', serif; font-size: 20px; font-weight: 700; margin-bottom: 2px; }
.artist-main-section .artist-name-en { font-size: 13px; color: var(--text-secondary); }
.artist-main-section .artist-period { font-size: 12.5px; color: var(--text-secondary); margin-bottom: 14px; }
.artist-main-section .artist-desc { font-size: 14.5px; line-height: 1.85; word-break: keep-all; }

.kr-artist-section { background: #FFFDF8; border: 1px solid var(--border); border-radius: 16px; padding: 24px; margin-bottom: 16px; overflow: hidden; }
.kr-artist-section .section-label { font-size: 12px; font-weight: 500; letter-spacing: 1px; color: var(--accent); margin-bottom: 14px; }
.kr-artist-row { display: flex; gap: 16px; align-items: flex-start; }
.kr-artwork-thumb { width: 80px; height: 80px; min-width: 80px; border-radius: 10px; object-fit: cover; border: 1px solid var(--border); }
.also-artists { font-size: 13px; color: var(--text-secondary); text-align: center; padding: 0; margin: 0 0 16px; line-height: 1.6; }
.kr-artist-info { flex: 1; }
.kr-artist-info .artist-name { font-family: 'Noto Serif KR', serif; font-weight: 700; font-size: 15px; }
.kr-artist-info .artist-period { font-size: 12.5px; color: var(--text-secondary); margin-bottom: 8px; }
.kr-artist-info p { font-size: 14px; line-height: 1.8; word-break: keep-all; }

.result-tags { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.result-tags span { font-size: 12.5px; color: var(--text-secondary); background: var(--bg); padding: 5px 12px; border-radius: 20px; }

.share-section { text-align: center; margin-top: 24px; padding-top: 24px; }
.share-section p { font-size: 13px; color: var(--text-secondary); margin-bottom: 14px; }
.share-buttons { display: flex; justify-content: center; gap: 10px; margin-bottom: 20px; }
.btn-share {
  display: inline-flex; align-items: center; gap: 6px;
  font-family: 'Noto Sans KR', sans-serif; font-size: 13.5px; font-weight: 500;
  padding: 12px 20px; border-radius: 50px;
  border: 1.5px solid var(--border); background: var(--card); color: var(--text);
  cursor: pointer; transition: all 0.2s;
}
.btn-share:hover { border-color: var(--accent-light); background: #FFFDF8; }
.btn-share.copied { border-color: var(--accent); color: var(--accent); }

.btn-retry {
  display: inline-flex; align-items: center; gap: 6px;
  font-family: 'Noto Sans KR', sans-serif; font-size: 14px; font-weight: 500;
  color: var(--text-secondary); background: none; border: none; cursor: pointer;
  padding: 10px 20px; transition: color 0.2s;
}
.btn-retry:hover { color: var(--text); }

/* ── Explore ── */
.explore-section { margin-top: 32px; padding-top: 24px; border-top: 1px solid var(--border); }
.explore-section .section-label { font-size: 12px; font-weight: 500; letter-spacing: 1px; color: var(--accent); text-align: center; margin-bottom: 14px; }
.explore-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.explore-chip {
  display: flex; flex-direction: column; align-items: center;
  padding: 10px 4px; border-radius: 10px; background: var(--card);
  border: 1px solid var(--border); text-decoration: none;
  color: var(--text); font-size: 12px; font-weight: 700;
  letter-spacing: 1px; transition: all 0.2s;
}
.explore-chip span { font-size: 10px; font-weight: 400; color: var(--text-secondary); margin-top: 2px; letter-spacing: 0; }
.explore-chip:hover { border-color: var(--accent-light); background: #FFFDF8; }
.explore-chip.current { border-color: var(--accent); background: #FFF9EE; }

.footer { text-align: center; padding: 20px 0 32px; font-size: 12px; color: var(--text-secondary); opacity: 0.4; }
.footer a { color: inherit; text-decoration: none; }
.footer a:hover { text-decoration: underline; }

/* ── Toast ── */
.toast {
  position: fixed; bottom: 32px; left: 50%;
  transform: translateX(-50%) translateY(80px);
  background: var(--text); color: #fff; font-size: 14px;
  padding: 12px 28px; border-radius: 50px; opacity: 0;
  transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 100; pointer-events: none;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
