:root {
  --hanji:      #f4ead2;   /* 한지 바탕 */
  --hanji-deep: #ebdcbb;   /* 한지 음영 */
  --ink:        #2b2018;   /* 먹색 글자 */
  --ink-soft:   #5b4a38;
  --red:        #a8322d;   /* 단청 적색 */
  --blue:       #1d4e7c;   /* 단청 청색 */
  --gold:       #b4892f;   /* 금박 */
  --line:       #c9b58a;
  --shadow:     rgba(43, 32, 24, 0.18);
}

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

html, body {
  height: 100%;
}

body {
  font-family: 'Gowun Batang', 'Nanum Myeongjo', serif;
  color: var(--ink);
  background-color: var(--hanji);
  background-image:
    radial-gradient(circle at 20% 15%, rgba(180,137,47,0.08) 0, transparent 40%),
    radial-gradient(circle at 80% 85%, rgba(29,78,124,0.06) 0, transparent 40%),
    repeating-linear-gradient(0deg, rgba(150,120,70,0.04) 0 2px, transparent 2px 5px);
  min-height: 100vh;
  display: flex;
  padding: 24px 16px;
  line-height: 1.6;
}

.frame {
  width: 100%;
  max-width: 560px;
  margin: auto;
  background: var(--hanji);
  border: 2px solid var(--line);
  border-radius: 6px;
  box-shadow: 0 14px 40px var(--shadow);
  padding: 40px 32px 36px;
  position: relative;
}
/* 모서리 단청 장식 */
.frame::before, .frame::after {
  content: "";
  position: absolute;
  width: 26px; height: 26px;
  border: 2px solid var(--red);
}
.frame::before { top: 10px; left: 10px; border-right: none; border-bottom: none; }
.frame::after  { bottom: 10px; right: 10px; border-left: none; border-top: none; }

.screen { display: none; animation: fade .4s ease; }
.screen.active { display: block; }
@keyframes fade { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

h1 {
  font-family: 'Nanum Myeongjo', serif;
  font-weight: 800;
  font-size: 1.9rem;
  text-align: center;
  line-height: 1.45;
  color: var(--ink);
  letter-spacing: -0.5px;
}
h1 .accent { color: var(--red); }

.seal {
  display: block;
  width: 64px; height: 64px;
  margin: 0 auto 18px;
  border: 3px solid var(--red);
  border-radius: 8px;
  color: var(--red);
  font-family: 'Nanum Myeongjo', serif;
  font-weight: 800;
  font-size: 1.5rem;
  line-height: 58px;
  text-align: center;
  transform: rotate(-4deg);
  background: rgba(168,50,45,0.05);
}

.lead {
  text-align: center;
  color: var(--ink-soft);
  margin: 18px 0 30px;
  font-size: 1.02rem;
}

.btn {
  display: block;
  width: 100%;
  border: none;
  cursor: pointer;
  font-family: inherit;
  font-size: 1.1rem;
  font-weight: 700;
  padding: 15px 18px;
  border-radius: 4px;
  text-align: center;
  text-decoration: none;
  transition: transform .08s ease, box-shadow .15s ease, background .15s ease;
}
.btn:active { transform: translateY(1px); }

.btn-primary {
  background: var(--red);
  color: #fff5e6;
  box-shadow: 0 4px 0 #7d211d;
}
.btn-primary:hover { background: #952c27; }

/* 진행 바 */
.progress-wrap { margin-bottom: 26px; }
.progress-meta {
  display: flex;
  justify-content: space-between;
  font-size: .85rem;
  color: var(--ink-soft);
  margin-bottom: 8px;
}
.progress-track {
  height: 8px;
  background: var(--hanji-deep);
  border: 1px solid var(--line);
  border-radius: 99px;
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, var(--gold), var(--red));
  transition: width .35s ease;
}

.q-text {
  font-family: 'Nanum Myeongjo', serif;
  font-weight: 700;
  font-size: 1.35rem;
  text-align: center;
  min-height: 3.4em;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 16px;
}

.q-image {
  width: 100%;
  aspect-ratio: 16 / 9;
  border: 1px solid var(--line);
  border-radius: 4px;
  margin-bottom: 22px;
  object-fit: cover;
  background: var(--hanji-deep);
}
.q-image-ph {
  width: 100%;
  aspect-ratio: 16 / 9;
  border: 1px dashed var(--line);
  border-radius: 4px;
  margin-bottom: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--ink-soft);
  font-size: .9rem;
  background: rgba(201,181,138,0.12);
  text-align: center;
  padding: 12px;
}

.answers { display: flex; gap: 12px; }
.answers .btn { box-shadow: 0 3px 0 rgba(0,0,0,0.15); }
.btn-yes {
  background: var(--blue);
  color: #f2f6fb;
  box-shadow: 0 4px 0 #143a5c;
}
.btn-yes:hover { background: #1a4470; }
.btn-no {
  background: var(--hanji-deep);
  color: var(--ink);
  box-shadow: 0 4px 0 var(--line);
}
.btn-no:hover { background: #e0cfa8; }

.back-link {
  display: inline-block;
  margin-top: 22px;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--ink-soft);
  font-family: inherit;
  font-size: .9rem;
  text-decoration: underline;
}

/* 결과 화면 */
.result-badge {
  font-family: 'Nanum Myeongjo', serif;
  font-weight: 800;
  font-size: 3rem;
  text-align: center;
  margin: 6px 0 4px;
}
.result-sub { text-align: center; color: var(--ink-soft); margin-bottom: 18px; }
.result-image {
  width: 100%;
  aspect-ratio: 4 / 3;
  border: 2px solid var(--line);
  border-radius: 6px;
  margin: 6px 0 18px;
  object-fit: cover;
  background: var(--hanji-deep);
}
.result-image-ph {
  width: 100%;
  aspect-ratio: 4 / 3;
  border: 1px dashed var(--line);
  border-radius: 6px;
  margin: 6px 0 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--ink-soft);
  font-size: .9rem;
  background: rgba(201,181,138,0.12);
  text-align: center;
  padding: 12px;
}
.result-card {
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 22px 20px;
  background: rgba(255,255,255,0.35);
  margin-bottom: 18px;
}
.result-desc { font-size: 1.02rem; margin-bottom: 16px; }
.result-score {
  text-align: center;
  font-weight: 700;
  color: var(--ink);
  padding: 10px;
  border-top: 1px dashed var(--line);
  border-bottom: 1px dashed var(--line);
}
.result-stat {
  text-align: center;
  font-size: .98rem;
  color: var(--ink-soft);
  margin-bottom: 22px;
}
.result-stat b { color: var(--red); font-size: 1.15rem; }

.theme-yangban .result-badge { color: var(--gold); }
.theme-pyeongmin .result-badge { color: var(--blue); }
.theme-nobi .result-badge { color: var(--ink-soft); }

/* 공유 */
.share-title {
  text-align: center;
  font-size: .9rem;
  color: var(--ink-soft);
  margin-bottom: 12px;
  letter-spacing: 2px;
}
.share-row { display: flex; gap: 10px; margin-bottom: 14px; }
.share-btn {
  flex: 1;
  border: none;
  cursor: pointer;
  font-family: inherit;
  font-weight: 700;
  font-size: .95rem;
  padding: 13px 8px;
  border-radius: 4px;
  color: #fff;
  transition: opacity .15s ease;
}
.share-btn:hover { opacity: .88; }
.share-share { background: var(--blue); }
.share-link  { background: var(--ink-soft); }

.footer-note {
  text-align: center;
  font-size: .78rem;
  color: var(--ink-soft);
  margin-top: 18px;
  opacity: .8;
}

/* 콘텐츠 페이지(양반/평민/노비 설명) */
.article-body p {
  font-size: 1rem;
  margin-bottom: 16px;
}
.article-body h2 {
  font-family: 'Nanum Myeongjo', serif;
  font-size: 1.15rem;
  color: var(--red);
  margin: 22px 0 10px;
}

/* 사이트 하단 콘텐츠 네비게이션 */
.site-nav {
  margin-top: 16px;
  text-align: center;
  font-size: .85rem;
}
.site-nav a {
  color: var(--ink-soft);
  text-decoration: underline;
  margin: 0 8px;
}
