/* 흥부장 안내 페이지 공용 스타일 — 게임 화면과 같은 무대 색, 읽기 편한 크림 본문. */
:root {
  --night: #14102b; --night-2: #1e1742; --night-3: #2a2154; --line: #372c58;
  --cream: #fff4dc; --ink: #2b2344; --ink-soft: #5c527e; --rule: #e6d8b8;
  --gold: #ffc531; --gold-deep: #d99a10; --coral: #ff6b7f; --coral-deep: #d63a55;
  --mint: #3ce6c2; --sky: #58c8ff; --text: #f7f1e3; --text-dim: #b9b0d6;
  --display: 'Noto Sans KR', 'Apple SD Gothic Neo', 'Malgun Gothic', sans-serif;
  --ui: 'Noto Sans KR', 'Apple SD Gothic Neo', 'Malgun Gothic', sans-serif;
  --body: 'Noto Sans KR', 'Apple SD Gothic Neo', 'Malgun Gothic', sans-serif;
  --logo: 'Bagel Fat One', 'Noto Sans KR', 'Apple SD Gothic Neo', 'Malgun Gothic', sans-serif;
}
* { box-sizing: border-box; }
html { background: var(--night); overflow-x: clip; }
body {
  margin: 0; background: var(--night); color: var(--text);
  font-family: var(--body); font-size: 16.5px; line-height: 1.8; word-break: keep-all;
  background-image: radial-gradient(ellipse 70% 40% at 50% -6%, #43317c 0%, transparent 60%);
  background-repeat: no-repeat;
}
a { color: inherit; }
:focus-visible { outline: 3px solid var(--sky); outline-offset: 3px; }

.top {
  max-width: 820px; margin: 0 auto; padding: 16px 18px 6px;
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
}
.logo {
  font-family: var(--logo); font-weight: 400; font-size: 21px; color: var(--ink); text-decoration: none;
  background: var(--gold); border: 3px solid var(--ink); border-radius: 12px;
  padding: 3px 12px 2px; box-shadow: 3px 3px 0 rgba(15, 10, 35, .55); transform: rotate(-2deg);
}
.top nav { display: flex; gap: 4px 16px; flex-wrap: wrap; margin-left: auto; }
.top nav a { font-family: var(--ui); font-weight: 700; font-size: 15px; color: var(--text-dim); text-decoration: none; }
.top nav a:hover, .top nav a[aria-current="page"] { color: var(--gold); }

main { max-width: 820px; margin: 0 auto; padding: 10px 18px 60px; }
.crumbs { font-size: 13px; color: var(--text-dim); margin: 14px 0 4px; }
.crumbs a { color: var(--text-dim); text-decoration: none; }
.crumbs a:hover { color: var(--gold); }
h1 {
  font-family: var(--display); font-weight: 800; font-size: clamp(34px, 7vw, 54px);
  line-height: 1.12; margin: 6px 0 12px; text-wrap: balance;
  text-shadow: 0 4px 0 var(--ink), 0 8px 0 rgba(15, 10, 35, .45);
}
.lede { font-size: 18px; color: var(--text-dim); margin: 0 0 22px; max-width: 38em; }
.facts { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 22px; padding: 0; list-style: none; }
.facts li {
  font-family: var(--ui); font-weight: 700; font-size: 14.5px; background: var(--night-3); border: 2px solid var(--line);
  border-radius: 999px; padding: 4px 14px 3px;
}
.facts b { color: var(--gold); font-weight: 400; margin-right: 6px; }

.sheet {
  background: var(--cream); color: var(--ink);
  border: 3px solid var(--ink); border-radius: 24px; padding: 26px 26px 18px;
  box-shadow: 0 10px 0 rgba(15, 10, 35, .5), 0 24px 50px rgba(0, 0, 0, .3);
}
@media (max-width: 520px) { .sheet { padding: 20px 18px 12px; border-radius: 20px; } }
.sheet + .sheet { margin-top: 22px; }
.sheet h2 { font-family: var(--ui); font-weight: 700; font-size: 23px; margin: 0 0 8px; }
.sheet h2:not(:first-child) { margin-top: 26px; }
.sheet h3 { font-family: var(--ui); font-weight: 700; font-size: 18px; margin: 20px 0 4px; }
.sheet p { margin: 0 0 12px; }
.sheet ol, .sheet ul { margin: 0 0 12px; padding-left: 22px; }
.sheet li { margin-bottom: 6px; }
.sheet li::marker { color: var(--coral-deep); font-family: var(--ui); font-weight: 700; }
.muted { color: var(--ink-soft); font-size: 14.5px; }

.cta {
  display: inline-block; font-family: var(--ui); font-weight: 700; font-size: 19px; color: var(--ink); text-decoration: none;
  background: var(--gold); border: 3px solid var(--ink); border-radius: 16px; padding: 11px 26px 9px;
  box-shadow: 0 6px 0 var(--gold-deep); margin: 8px 0 14px;
}
.cta:active { transform: translateY(4px); box-shadow: 0 2px 0 var(--gold-deep); }

/* 문제 목록 */
.qlist { list-style: none; padding: 0 !important; margin: 0 0 8px; }
.qlist li {
  display: flex; gap: 12px; align-items: flex-start; justify-content: space-between; flex-wrap: wrap;
  border-bottom: 1.5px dashed var(--rule); padding: 11px 0; margin: 0;
}
.qlist li:last-child { border-bottom: none; }
.qlist .q { font-family: var(--ui); font-weight: 700; font-size: 17.5px; flex: 1 1 280px; }
.qlist .no { color: var(--ink-soft); font-size: 13px; margin-right: 8px; font-family: var(--body); }
.qlist details summary {
  cursor: pointer; font-family: var(--ui); font-weight: 700; font-size: 14px; color: var(--coral-deep); list-style: none;
  border: 2px solid var(--coral); border-radius: 999px; padding: 2px 12px 1px; white-space: nowrap;
}
.qlist details summary::-webkit-details-marker { display: none; }
.qlist details[open] summary { background: var(--coral); color: #fff; }
.qlist details .ans { display: block; margin-top: 6px; font-family: var(--ui); font-weight: 700; font-size: 16.5px; color: #0f8a6c; }
.cho { font-family: var(--display); font-weight: 800; letter-spacing: .14em; font-size: 22px; }
.tags { display: inline-flex; gap: 4px; margin-left: 8px; vertical-align: 2px; }
.tags span { font-family: var(--ui); font-weight: 700; font-size: 11.5px; background: #efe2c4; color: var(--ink-soft); border-radius: 999px; padding: 1px 8px 0; }
.tags .new { background: var(--coral); color: #fff; }
.vs { display: grid; grid-template-columns: 1fr auto 1fr; gap: 10px; align-items: center; flex: 1 1 100%; }
.vs span:not(.x) { background: #fff; border: 2px solid var(--ink); border-radius: 12px; padding: 8px 12px; font-family: var(--ui); font-weight: 700; font-size: 16px; }
.vs .x { font-family: var(--display); font-weight: 800; color: var(--coral-deep); font-size: 15px; }
@media (max-width: 480px) { .vs { grid-template-columns: 1fr; } .vs .x { text-align: center; } }
.wordcloud { display: flex; flex-wrap: wrap; gap: 6px; margin: 4px 0 12px; }
.wordcloud span { font-family: var(--ui); font-weight: 700; font-size: 15px; background: #fff; border: 2px solid var(--ink); border-radius: 10px; padding: 3px 10px 2px; }

/* 카드 목록 (게임·문제 모음 목차) */
.grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
@media (max-width: 600px) { .grid { grid-template-columns: 1fr; } }
.tile {
  display: block; text-decoration: none; color: var(--ink); background: var(--cream);
  border: 3px solid var(--ink); border-radius: 20px; padding: 18px 18px 14px;
  box-shadow: 0 6px 0 rgba(15, 10, 35, .5); transition: transform .1s ease;
}
.tile:hover { transform: translateY(-3px); }
.tile .ti { font-size: 32px; line-height: 1; }
.tile .tn { font-family: var(--ui); font-weight: 700; font-size: 21px; margin-top: 8px; }
.tile .td { font-size: 14.5px; color: var(--ink-soft); line-height: 1.55; }

footer {
  max-width: 820px; margin: 0 auto; padding: 22px 18px 46px; border-top: 1px solid var(--line);
  font-size: 13px; color: var(--text-dim); text-align: center;
}
footer nav { display: flex; flex-wrap: wrap; gap: 6px 16px; justify-content: center; margin-bottom: 8px; }
footer nav a { color: var(--text-dim); text-decoration: none; font-family: var(--ui); font-weight: 700; font-size: 14px; }
footer nav a:hover { color: var(--gold); }

/* 광고 자리: 본문과 떨어뜨리고, 높이를 미리 잡아 글이 밀리지 않게 한다. 광고 단위가 설정됐을 때만 페이지에 들어간다. */
.ad-slot { margin: 30px 0; padding: 8px 0 10px; min-height: 290px; text-align: center; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.ad-slot .ad-label { display: block; font-size: 12px; color: var(--text-dim); margin-bottom: 6px; letter-spacing: .04em; }
main > h2 { font-family: var(--ui); font-weight: 800; font-size: 24px; margin: 0 0 12px; }

/* 흥부장 캐릭터가 나오는 마무리 띠(모든 안내 페이지 아래)와 없는 주소 화면 */
.mc-band { display: flex; align-items: center; gap: 18px; margin: 34px 0 6px; padding: 18px 22px; background: var(--night-2); border: 2px solid var(--line); border-radius: 22px; }
.mc-band img { flex: none; width: 118px; height: auto; filter: drop-shadow(0 10px 16px rgba(0, 0, 0, .45)); }
.mc-band b { display: block; font-size: 20px; font-weight: 900; color: var(--gold); line-height: 1.4; }
.mc-band p { margin: 4px 0 12px; color: var(--text-dim); font-size: 15px; line-height: 1.65; }
.mc-band .cta { margin: 0; }
.lost { text-align: center; padding: 30px 0 10px; }
.lost img { width: 190px; height: auto; filter: drop-shadow(0 14px 22px rgba(0, 0, 0, .45)); }
@media (max-width: 520px) { .mc-band { flex-direction: column; text-align: center; } .mc-band img { width: 104px; } }

/* 명예의 전당(/rank) */
.rk-hist { display: grid; grid-template-columns: repeat(10, 1fr); gap: 6px; align-items: end; height: 190px; margin: 14px 0 6px; }
.rk-hist div { display: flex; flex-direction: column; justify-content: flex-end; align-items: center; height: 100%; font-size: 11px; gap: 3px; }
.rk-hist i { display: block; width: 100%; border-radius: 8px 8px 0 0; background: #ffc531; }
.rk-hist b { order: -1; font-size: 13px; }
.rk-hist span { opacity: .7; white-space: nowrap; }
.rk-top { padding-left: 1.4em; }
.rk-top li { margin: 6px 0; }
.rk-top li b { display: inline-block; min-width: 4.6em; }
@media (max-width: 560px) { .rk-hist span { font-size: 9px; } }

/* 공유 버튼 줄(모든 안내 페이지 아래) */
.share-bar { display: flex; flex-wrap: wrap; gap: 10px; margin: 26px 0 6px; }
.share-bar button { font: inherit; font-weight: 800; font-size: 15px; cursor: pointer; padding: 11px 18px; border-radius: 12px; border: 3px solid var(--ink); background: var(--cream); color: var(--ink); }
.share-bar button.kakao { background: #fee500; color: #191919; }
.share-bar button:hover { transform: translateY(-2px); }

.course-btns { display: flex; flex-wrap: wrap; gap: 10px; margin: 18px 0; }

/* 의견 보내기 칸(공유 줄 아래) */
.fb-box { margin: 10px 0 6px; }
.fb-box textarea { width: 100%; max-width: 640px; font: inherit; font-size: 15px; padding: 10px 12px; border-radius: 12px; border: 3px solid var(--ink); background: var(--cream); color: var(--ink); }
.fb-box p { margin: 8px 0 0; font-size: 13.5px; color: var(--text-dim, #b9b0d6); }
.fb-box button { font: inherit; font-weight: 800; font-size: 15px; cursor: pointer; padding: 8px 16px; border-radius: 12px; border: 3px solid var(--ink); background: var(--gold); color: var(--ink); margin-right: 8px; }
