:root {
  --bg: #fff6ec;
  --card: #ffffff;
  --ink: #2b231d;
  --sub: #7d7068;
  --line: #f1e3d4;
  --accent: #f0802f;
  --soft: #ffe7d1;
  --radius: 20px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
body {
  font-family: 'Pretendard Variable', Pretendard, -apple-system, 'Apple SD Gothic Neo', 'Malgun Gothic', sans-serif;
  background: var(--bg);
  color: var(--ink);
  line-height: 1.6;
  word-break: keep-all;
  overflow-wrap: anywhere;
  min-height: 100dvh;
}
button { font: inherit; color: inherit; cursor: pointer; border: 0; background: none; }
a { color: inherit; }

.wrap { max-width: 480px; margin: 0 auto; padding: 20px 16px 40px; }

/* 상단 바 */
.topbar { display: flex; align-items: center; justify-content: space-between; height: 40px; margin-bottom: 8px; }
.logo { font-weight: 800; font-size: 15px; text-decoration: none; letter-spacing: -0.02em; }
.logo span { color: var(--accent); }

/* 공통 버튼 */
.btn {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  width: 100%; min-height: 54px; padding: 14px 18px;
  border-radius: 16px; font-weight: 700; font-size: 16px;
  background: var(--card); border: 1.5px solid var(--line);
  transition: transform .08s ease, background .15s ease;
  text-decoration: none;
}
.btn:active { transform: scale(.98); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; box-shadow: 0 6px 18px -8px var(--accent); }
.btn.big { min-height: 60px; font-size: 18px; }
.btn-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.stack { display: grid; gap: 10px; }

.screen { animation: rise .35s ease both; }
@keyframes rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

/* 인트로 */
.intro { text-align: center; padding-top: 24px; }
.emoji-row { font-size: clamp(26px, 8vw, 36px); display: flex; justify-content: center; gap: 2px; margin-bottom: 28px; line-height: 1.3; }
.emoji-row span { display: inline-block; animation: bob 2.4s ease-in-out infinite; }
@keyframes bob { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-6px); } }
.eyebrow { color: var(--accent); font-weight: 700; font-size: 15px; }
.intro h1 { font-size: 34px; line-height: 1.25; letter-spacing: -0.03em; margin: 6px 0 14px; font-weight: 800; }
.lead { color: var(--sub); font-size: 16px; white-space: pre-line; margin-bottom: 36px; }
.meta { color: var(--sub); font-size: 13px; margin-top: 12px; }

/* 질문 */
.qtop { display: flex; align-items: center; gap: 10px; margin-bottom: 36px; }
.back { width: 36px; height: 36px; border-radius: 50%; font-size: 22px; line-height: 1; display: grid; place-items: center; flex: none; color: var(--sub); }
.back:disabled { visibility: hidden; }
.progress { flex: 1; height: 10px; border-radius: 99px; background: var(--soft); overflow: hidden; }
.progress span { display: block; height: 100%; background: var(--accent); border-radius: 99px; transition: width .3s ease; }
.count { font-size: 13px; font-weight: 700; color: var(--sub); min-width: 38px; text-align: right; font-variant-numeric: tabular-nums; }
.qnum { color: var(--accent); font-weight: 800; font-size: 20px; }
.qtext { font-size: 24px; line-height: 1.4; letter-spacing: -0.02em; font-weight: 800; margin: 4px 0 28px; white-space: pre-line; min-height: 2.8em; }
.options { display: grid; gap: 10px; }
.option {
  text-align: left; padding: 18px 18px; border-radius: 16px; font-size: 16px; font-weight: 600;
  background: var(--card); border: 1.5px solid var(--line);
  transition: border-color .15s, background .15s, transform .08s;
}
.option:active { transform: scale(.98); }
@media (hover: hover) { .option:hover { border-color: var(--accent); } }
.option.picked { background: var(--soft); border-color: var(--accent); }

/* 로딩 */
.loading { text-align: center; padding-top: 30vh; }
.loading .big-emoji { font-size: 72px; height: 96px; }
.loading p { font-weight: 700; color: var(--sub); margin-top: 12px; }

/* 결과 */
.note { text-align: center; font-size: 14px; font-weight: 700; color: var(--accent); background: var(--soft); border-radius: 99px; padding: 6px 14px; width: fit-content; margin: 0 auto 14px; }
.card {
  --rc: var(--accent);
  background: var(--card); border-radius: 28px; padding: 32px 22px 22px;
  text-align: center; border: 1.5px solid var(--line);
  box-shadow: 0 12px 32px -20px rgba(80, 40, 10, .35);
}
.card .label { font-size: 15px; font-weight: 700; color: var(--sub); }
.card .big-emoji { font-size: 96px; line-height: 1.15; margin: 10px 0 4px; }
.card .name { font-size: 34px; font-weight: 800; letter-spacing: -0.03em; color: var(--rc); line-height: 1.2; }
.card .nick { font-size: 17px; font-weight: 700; margin-top: 4px; }
.tags { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; margin: 16px 0 20px; }
.tags span { font-size: 13px; font-weight: 700; padding: 4px 10px; border-radius: 99px; background: var(--soft); color: var(--ink); }
.desc { text-align: left; list-style: none; display: grid; gap: 10px; padding: 18px; background: var(--bg); border-radius: 18px; }
.desc li { position: relative; padding-left: 16px; font-size: 15px; }
.desc li::before { content: ''; position: absolute; left: 2px; top: .62em; width: 6px; height: 6px; border-radius: 50%; background: var(--rc); }
.match { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 12px; }
.match button { background: var(--bg); border-radius: 18px; padding: 14px 8px; display: grid; gap: 2px; }
.match small { font-size: 13px; font-weight: 700; color: var(--sub); }
.match .m-emoji { font-size: 36px; line-height: 1.2; }
.match b { font-size: 15px; }
.card .foot { font-size: 12px; color: var(--sub); margin-top: 18px; font-weight: 600; }
.result .stack { margin-top: 18px; }

.section-title { font-size: 18px; font-weight: 800; margin: 36px 0 12px; letter-spacing: -0.02em; }
.all { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.all button { background: var(--card); border: 1.5px solid var(--line); border-radius: 16px; padding: 10px 4px; display: grid; gap: 2px; font-size: 13px; font-weight: 700; }
.all button .e { font-size: 30px; line-height: 1.2; }
.all button.me { border-color: var(--accent); background: var(--soft); }

/* 테스트 목록(홈) */
.hero { padding: 28px 0 20px; }
.hero h1 { font-size: 28px; line-height: 1.3; letter-spacing: -0.03em; font-weight: 800; }
.hero p { color: var(--sub); margin-top: 6px; }
.test-list { display: grid; gap: 12px; }
.test-card {
  display: flex; gap: 16px; align-items: center; padding: 18px; border-radius: var(--radius);
  background: var(--card); border: 1.5px solid var(--line); text-decoration: none;
}
.test-card .thumb { width: 72px; height: 72px; border-radius: 18px; background: var(--soft); display: grid; place-items: center; font-size: 40px; flex: none; }
.test-card h2 { font-size: 17px; font-weight: 800; letter-spacing: -0.02em; }
.test-card p { font-size: 14px; color: var(--sub); }
.test-card.soon { opacity: .55; pointer-events: none; }

/* 광고 자리 */
.ad { margin: 24px 0 0; min-height: 0; }
.ad:empty { display: none; }

/* 푸터 */
.footer { text-align: center; font-size: 12px; color: var(--sub); margin-top: 48px; }
.footer a { margin: 0 6px; }

/* 토스트 */
.toast {
  position: fixed; left: 50%; bottom: 32px; transform: translate(-50%, 20px);
  background: var(--ink); color: #fff; font-size: 14px; font-weight: 600;
  padding: 12px 18px; border-radius: 99px; opacity: 0; pointer-events: none;
  transition: opacity .2s, transform .2s; max-width: calc(100% - 32px); text-align: center;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* 문서 페이지 */
.doc h1 { font-size: 24px; margin: 16px 0; }
.doc h2 { font-size: 17px; margin: 24px 0 8px; }
.doc p, .doc li { font-size: 15px; color: var(--sub); }
.doc ul { padding-left: 20px; }
