/* 사이트 전체 꾸미기 ------------------------------------------------------
   색을 바꾸고 싶으면 아래 :root 안의 값만 고치면 전체가 같이 바뀝니다. */
:root {
  --paper: #f6f3ec;     /* 배경 (시험지 느낌의 미색) */
  --ink: #1d1d1f;       /* 글자 */
  --muted: #6b6b70;     /* 흐린 글자 */
  --navy: #1f3b73;      /* 주 색 (버튼, 제목) */
  --line: #c9c3b6;      /* 선 */
  --card: #ffffff;
  --accent: #c0392b;    /* 도장 빨강 */
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; background: var(--paper); color: var(--ink); word-break: keep-all; overflow-wrap: anywhere;
  font-family: "Pretendard Variable", Pretendard, -apple-system, "Apple SD Gothic Neo", "Malgun Gothic", sans-serif; }
a { color: inherit; text-decoration: none; }
button { font: inherit; }

/* 휴대폰 화면 기준으로 만듭니다. 컴퓨터에서 열어도 가운데에 폰 너비(최대 420px)로 보입니다. */
#app { max-width: 420px; min-height: 100vh; margin: 0 auto; padding: 0 16px 48px; background: var(--paper); }
@media (min-width: 480px) { html, body { background: #dcd6c8; } #app { box-shadow: 0 0 24px rgba(0,0,0,.08); } }

/* ---------- 홈 */
.hero { text-align: center; padding: 48px 0 24px; }
.logo { font-size: 40px; font-weight: 900; letter-spacing: -1px; color: var(--navy); }
.tagline { font-size: 18px; font-weight: 700; margin: 6px 0; }
.sub { color: var(--muted); font-size: 14px; line-height: 1.6; margin: 4px 0; }
.list { display: grid; gap: 12px; }
.card { display: flex; align-items: center; gap: 14px; background: var(--card); border-radius: 14px;
  padding: 16px; box-shadow: 0 1px 3px rgba(0,0,0,.08); transition: transform .1s; }
a.card:active { transform: scale(.98); }
.card .emoji { font-size: 32px; width: 44px; text-align: center; flex: none; }
.card h2 { font-size: 17px; margin: 0 0 4px; }
.card p { font-size: 13px; color: var(--muted); margin: 0; }
.card > div:nth-child(2) { flex: 1; }
.card.soon { opacity: .55; }
.tag { flex: none; font-size: 12px; padding: 5px 10px; border-radius: 99px; background: #eee; color: var(--muted); }
.tag.go { background: var(--navy); color: #fff; }
.tag.done { background: #e4ecf8; color: var(--navy); }
.foot { text-align: center; color: var(--muted); font-size: 12px; margin-top: 32px; }

/* ---------- 공통 */
.page { padding-top: 16px; display: flex; flex-direction: column; align-items: center; }
.back { align-self: flex-start; color: var(--muted); font-size: 14px; padding: 8px 0; }
button.big { margin-top: 16px; font-size: 17px; font-weight: 700; padding: 14px 36px; border: 0;
  border-radius: 12px; background: var(--navy); color: #fff; cursor: pointer; min-width: 220px; }
button.big.ghost { background: transparent; color: var(--navy); border: 2px solid var(--navy); }
.link { margin-top: 14px; color: var(--navy); font-size: 14px; text-decoration: underline;
  background: none; border: 0; cursor: pointer; padding: 0; }

/* ---------- 시험 안내 (문제지 표지) */
.exam-cover { width: 100%; background: var(--card); border: 2px solid var(--ink); padding: 28px 16px;
  text-align: center; margin-top: 8px; }
.exam-kicker { display: inline-block; border: 1.5px solid var(--ink); padding: 2px 12px; font-size: 13px; margin-bottom: 10px; }
.exam-cover h1 { font-size: 22px; margin: 0 0 10px; line-height: 1.4; white-space: pre-line; }
.exam-meta { font-size: 13px; color: var(--muted); text-wrap: balance; line-height: 1.6; }
.exam-meta .nw { white-space: nowrap; }
.exam-meta .areas { letter-spacing: -0.02em; }
.exam-meta .cnt { margin-top: 2px; font-size: 12px; }
.rules { width: 100%; background: var(--card); border-radius: 12px; padding: 14px 18px 14px 34px; margin-top: 16px; }
.rules li { margin: 8px 0; line-height: 1.55; font-size: 15px; }

/* ---------- 문제 풀기 (화면 고정 + 좌우로 넘기기) */
body.quiz-mode { overflow: hidden; height: 100dvh; overscroll-behavior: none; }
body.quiz-mode #app { height: 100dvh; padding-bottom: 0; }
.quiz { height: 100dvh; padding-bottom: 12px; display: flex; flex-direction: column; padding-top: 12px; }
.quiz-top { display: flex; align-items: center; justify-content: space-between; font-size: 14px; }
.quiz-top .quit { margin: 0; color: var(--muted); }
.area-chip { background: var(--navy); color: #fff; padding: 4px 12px; border-radius: 99px; font-size: 13px; }
.count { color: var(--muted); }
.progress { height: 6px; background: #e3ded2; border-radius: 99px; margin: 12px 0 16px; overflow: hidden; flex: none; }
.progress i { display: block; height: 100%; width: 0; background: var(--navy); transition: width .3s; }
.stage { position: relative; flex: 1; overflow: hidden; touch-action: pan-y; }
.slide { position: absolute; inset: 0; overflow-y: auto; display: flex; flex-direction: column; }
.slide.in-left { animation: inL .26s ease-out; }
.slide.in-right { animation: inR .26s ease-out; }
.slide.out-left { animation: outL .26s ease-in forwards; }
.slide.out-right { animation: outR .26s ease-in forwards; }
@keyframes inL { from { transform: translateX(100%); } to { transform: none; } }
@keyframes inR { from { transform: translateX(-100%); } to { transform: none; } }
@keyframes outL { to { transform: translateX(-100%); } }
@keyframes outR { to { transform: translateX(100%); } }
.slide.nudge { animation: nudge .3s; }
@keyframes nudge { 25% { transform: translateX(-8px); } 75% { transform: translateX(8px); } }
.qbox { display: flex; gap: 8px; font-size: 18px; font-weight: 700; line-height: 1.5; margin-bottom: 14px; }
.qnum { flex: none; }
.choices { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.choices button { width: 100%; text-align: left; display: flex; gap: 10px; align-items: flex-start;
  background: var(--card); border: 1.5px solid var(--line); border-radius: 12px; padding: 12px 14px;
  font-size: 15px; line-height: 1.45; color: var(--ink); cursor: pointer; user-select: none; }
.choices button:hover { border-color: var(--navy); }
.choices button.picked { border-color: var(--navy); background: #e4ecf8; font-weight: 600; }
.choices .num { flex: none; font-size: 17px; }
.after { display: flex; flex-direction: column; align-items: center; }
.joke { margin-top: 14px; width: 100%; background: #fff8e1; border-left: 4px solid #f2b705; padding: 10px 14px;
  border-radius: 8px; font-size: 14px; line-height: 1.5; }
.after button.big { margin-top: 12px; }
.swipe-hint { text-align: center; font-size: 12px; color: var(--muted); padding: 6px 0; transition: opacity .4s; }
.swipe-hint.gone { opacity: 0; }

/* 광고 자리: 메뉴 바로 아래에 고정. 보기(손가락이 머무는 아래쪽)와 떨어뜨려 잘못 누르는 일을 줄임 */
.ad-slot { flex: none; height: 60px; display: flex; align-items: center; justify-content: center;
  background: #e9e5db; border: 1px solid var(--line); border-radius: 8px; color: var(--muted); font-size: 12px; margin-bottom: 16px; }
.slide.out-left, .slide.out-right { pointer-events: none; }

/* ---------- 성적표 (수능 성적표 패러디, 공식 양식 복제 아님) */
.report { position: relative; width: 100%; background: #fffefb; border: 2px solid var(--ink);
  padding: 20px 16px; margin-top: 8px; }
.report-title { text-align: center; font-size: 14px; line-height: 1.6; margin-bottom: 14px; white-space: pre-line; }
.report-title b { font-size: 22px; letter-spacing: 6px; }
.report table { width: 100%; border-collapse: collapse; font-size: 14px; }
.report th, .report td { border: 1px solid var(--ink); padding: 8px 4px; text-align: center; }
.report th { background: #efebe2; font-weight: 600; }
.info { margin-bottom: 12px; }
.info th { white-space: nowrap; width: 1%; padding: 8px 8px; }
.info .exam-no { white-space: nowrap; }
.info input { width: 100%; min-width: 0; max-width: 90px; border: 0; border-bottom: 1px dashed var(--muted); background: transparent;
  text-align: center; font: inherit; padding: 2px; }
.scores tbody th { white-space: nowrap; }
.scores small { color: var(--muted); }
.grade { font-size: 20px; font-weight: 900; }
.g1, .g2 { color: var(--navy); }
.g8, .g9 { color: var(--accent); }
.note { font-size: 12px; color: var(--muted); line-height: 1.5; margin: 8px 0 0; }
.diag { border-top: 2px solid var(--ink); margin-top: 16px; padding-top: 12px; }
.diag h3 { margin: 0 0 8px; font-size: 15px; }
.diag-big { font-size: 30px; font-weight: 900; color: var(--navy); }
.diag-big small { font-size: 17px; color: var(--ink); }
.diag-line { margin: 4px 0 10px; font-size: 14px; line-height: 1.5; }
.diag-line.soft { color: var(--muted); }
.titles { padding-left: 18px; margin: 6px 0 10px; font-size: 14px; line-height: 1.8; }
.bar-row { display: flex; align-items: center; gap: 8px; font-size: 13px; margin: 6px 0; }
.bar-label { width: 124px; flex: none; }
.bar { flex: 1; height: 10px; background: #e3ded2; border-radius: 99px; overflow: hidden; }
.bar i { display: block; height: 100%; background: var(--navy); }
.bar-val { width: 32px; text-align: right; color: var(--muted); }
.stamp { position: absolute; right: 12px; top: 34px; width: 70px; height: 70px; border: 3px solid var(--accent);
  border-radius: 50%; color: var(--accent); font-weight: 900; font-size: 10.5px; line-height: 1.1;
  display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center;
  transform: rotate(-14deg); opacity: .75; pointer-events: none; }
.stamp small { font-size: 10px; font-weight: 600; }
.actions { display: flex; flex-direction: column; align-items: center; width: 100%; }

.toast { position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%) translateY(20px);
  background: #222; color: #fff; padding: 10px 18px; border-radius: 99px; font-size: 14px;
  opacity: 0; transition: all .25s; pointer-events: none; }
.toast.on { opacity: 1; transform: translateX(-50%) translateY(0); }
.sharebox { width: 100%; margin-top: 12px; font: inherit; font-size: 13px; padding: 10px; border: 1.5px solid var(--line);
  border-radius: 10px; background: #fff; resize: none; }
.hero .home-ad { margin: 16px 0 0; }
.hero { padding-bottom: 16px; }
.diag-code { font-size: 22px; line-height: 1.4; }

/* ---------- 오답 노트 */
.review { width: 100%; margin-top: 16px; background: var(--card); border-radius: 12px; padding: 16px; }
.review h3 { margin: 0 0 8px; font-size: 16px; }
.review h3 small { color: var(--accent); font-size: 13px; margin-left: 6px; }
.review ol { list-style: none; margin: 0; padding: 0; }
.review-item { border-top: 1px solid #eee; padding: 12px 0; font-size: 14px; line-height: 1.55; }
.review-item:first-child { border-top: 0; }
.review-q { font-weight: 700; margin-bottom: 6px; }
.review-num { color: var(--navy); margin-right: 4px; }
.review-mine { color: var(--accent); text-decoration: line-through; text-decoration-thickness: 1px; }
.review-right { color: var(--navy); font-weight: 700; }
.review-explain { margin-top: 6px; background: #f7f5ef; border-radius: 8px; padding: 8px 10px; }
.review-ex, .review-origin { color: var(--muted); font-size: 13px; margin-top: 2px; }
.review-perfect { margin: 4px 0; font-size: 15px; }
.review-item.locked .review-q { color: var(--muted); }
.review-hidden { margin-top: 6px; background: #eeeae0; border-radius: 8px; padding: 10px; color: var(--muted); font-size: 13px; text-align: center; }
.review-lock { display: flex; flex-direction: column; align-items: center; padding: 4px 0 12px; border-bottom: 1px solid #eee; margin-bottom: 4px; }
.review-lock-msg { margin: 0; font-size: 13px; color: var(--muted); }
.review-lock button.big { margin-top: 10px; }
.link.small { font-size: 12px; color: var(--muted); margin-top: 10px; }

.badge { display: inline-block; vertical-align: middle; font-size: 10px; font-weight: 600; color: #2f6f5e; background: #e3f1ec; padding: 2px 6px; border-radius: 99px; margin-left: 4px; }

/* ---------- 연애 심리 결과지 */
.love-disclaimer { font-size: 12px; color: var(--muted); background: #f7f5ef; border-radius: 8px; padding: 8px 10px; line-height: 1.5; margin: 8px 0; }
.love-combo { text-align: center; font-size: 22px; font-weight: 900; color: #b0306a; margin: 12px 0 4px; line-height: 1.4; }
.love-type { font-size: 18px; margin-top: 4px; }
.love-type b { color: #b0306a; }
.love-report .diag h3 small { font-weight: 400; color: var(--muted); font-size: 12px; margin-left: 4px; }
.love-report .bar i { background: #d4628f; }

/* ---------- 한 화면 여러 문항 (빅파이브) */
.lk-item { padding: 10px 0 12px; border-bottom: 1px solid #e6e1d6; border-radius: 8px; }
.lk-item.missing { background: #fdecea; }
.lk-q { font-size: 15px; font-weight: 600; line-height: 1.45; margin-bottom: 8px; padding: 0 2px; }
.lk-num { color: var(--muted); font-weight: 400; font-size: 12px; margin-right: 6px; }
.lk-scale { display: grid; grid-template-columns: repeat(5, 1fr); gap: 4px; }
.lk-scale button { background: none; border: 0; padding: 4px 0; display: flex; flex-direction: column; align-items: center; gap: 4px; cursor: pointer; color: var(--muted); }
.lk-scale button i { width: 28px; height: 28px; border-radius: 50%; border: 2px solid var(--line); background: #fff; display: block; }
.lk-scale button:nth-child(1) i, .lk-scale button:nth-child(5) i { width: 34px; height: 34px; }
.lk-scale button span { font-size: 10.5px; line-height: 1.2; text-align: center; }
.lk-scale button.picked i { background: #2f6f5e; border-color: #2f6f5e; }
.lk-scale button.picked span { color: #2f6f5e; font-weight: 700; }

/* ---------- 빅파이브 리포트 (패러디가 아닌 차분한 결과지) */
.b5-report { width: 100%; background: #fff; border-radius: 14px; padding: 20px 16px; margin-top: 8px; border: 1px solid #e5e5e5; }
.b5-title { font-size: 20px; font-weight: 800; }
.b5-date { font-size: 12px; color: var(--muted); margin: 2px 0 14px; }
.b5-warn { background: #fff4e5; color: #8a5300; font-size: 13px; padding: 8px 10px; border-radius: 8px; margin-bottom: 12px; }
.b5-row { margin: 14px 0 18px; }
.b5-head { display: flex; justify-content: space-between; align-items: baseline; font-size: 15px; }
.b5-num { font-size: 22px; font-weight: 800; color: #2f6f5e; }
.b5-bar { position: relative; height: 12px; background: #eef1ef; border-radius: 99px; overflow: hidden; margin: 4px 0; }
.b5-bar { overflow: visible; }
.b5-dot { position: absolute; top: 50%; width: 18px; height: 18px; margin: -9px 0 0 -9px; background: #2f6f5e; border: 3px solid #fff; border-radius: 50%; box-shadow: 0 0 0 1px #2f6f5e; }
.b5-pair { font-weight: 700; }
.b5-lean { font-size: 13.5px; color: #2f6f5e; }
.b5-acad { color: var(--muted); font-size: 11.5px; margin-left: 4px; }
.b5-more { font-size: 12.5px; color: var(--muted); margin-top: 14px; }
.b5-more a { color: #2f6f5e; text-decoration: underline; }
.b5-mid { position: absolute; left: 50%; top: -3px; bottom: -3px; width: 2px; margin-left: -1px; background: #9aa7a2; }
.b5-ends { display: flex; justify-content: space-between; font-size: 11px; color: var(--muted); }
.b5-line { font-size: 12.5px; color: #444; margin-top: 4px; }
.b5-sub { font-size: 15px; margin: 22px 0 8px; }
.b5-sub small { font-weight: 400; color: var(--muted); font-size: 12px; }
.b5-card { border: 1px solid #e5e5e5; border-radius: 10px; padding: 10px 12px; margin: 8px 0; font-size: 14px; line-height: 1.55; }
.b5-card summary { cursor: pointer; }
.b5-card p { margin: 6px 0; }
.b5-text { font-size: 13.5px; line-height: 1.6; color: #333; }
.b5-source { font-size: 11.5px; color: var(--muted); line-height: 1.6; border-top: 1px solid #eee; margin-top: 18px; padding-top: 12px; }
.b5-source a { color: #2f6f5e; text-decoration: underline; }

/* ---------- 사이트 바닥 글 (면책·링크·문의) */
.site-foot { margin-top: 32px; padding: 16px 4px 8px; border-top: 1px solid var(--line); text-align: center; }
.foot-disclaimer { font-size: 11.5px; color: var(--muted); line-height: 1.6; margin: 0 0 10px; }
.foot-links { display: flex; justify-content: center; flex-wrap: wrap; gap: 4px 14px; font-size: 12px; }
.foot-links a { color: var(--ink); text-decoration: underline; }
.foot-copy { font-size: 11px; color: var(--muted); margin: 10px 0 0; }

/* ---------- 안내 문서 페이지 (소개·개인정보처리방침·약관·문의) */
.doc { padding: 16px 0 8px; font-size: 14.5px; line-height: 1.7; }
.doc h1 { font-size: 22px; margin: 8px 0 14px; }
.doc h2 { font-size: 16px; margin: 22px 0 6px; }
.doc ul { padding-left: 20px; }
.doc li { margin: 4px 0; }
.doc a { color: var(--navy); text-decoration: underline; }
.contact-mail { font-size: 18px; background: #fff; border-radius: 10px; padding: 14px; text-align: center; }
.qnav { display: flex; justify-content: space-between; gap: 10px; margin: 12px 0 4px; }
.qnav-btn { flex: 1; padding: 11px 8px; border: 1px solid #d6d0c4; border-radius: 10px; background: #fff; color: #888; font: inherit; font-size: 14px; cursor: pointer; }
.qnav-btn.ready { border-color: var(--navy); color: var(--navy); font-weight: 700; }
.qnav-btn:disabled { opacity: .35; cursor: default; }
/* 시험지 느낌: 문제지·성적표 제목은 명조체 (수능 시험지처럼) */
.exam-cover h1, .report-title, .exam-kicker { font-family: "Nanum Myeongjo", "AppleMyungjo", "Batang", serif; }
.report-title b { font-weight: 800; }
/* 광고 승인 전에는 광고 칸을 숨김. 승인되면 js/app.js의 ADS_ON을 true로 (사용자 2026-11-23) */
body:not(.ads-on) .ad-slot { display: none; }
