:root {
  --paper: #f7f1e6;
  --paper-2: #efe6d5;
  --card: #fffdf8;
  --ink: #2a241d;
  --sub: #6d6356;
  --line: #e2d6c1;
  --accent: #c8452d;
  --accent-2: #a73420;
  --ring: #e0301c;
  --hint: #e9a800;
  --ok: #2d7a57;
  --r: 18px;
  --shadow: 0 1px 2px rgba(42, 36, 29, .06), 0 10px 30px -12px rgba(42, 36, 29, .22);
  --serif: "Apple Myungjo", "AppleMyungjo", "Nanum Myeongjo", "Batang", serif;
  --sans: -apple-system, "Apple SD Gothic Neo", "Malgun Gothic", "Noto Sans KR", sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root {
    --paper: #1c1915; --paper-2: #24201b; --card: #2a2520; --ink: #f2ebe0; --sub: #b9ad9d; --line: #3b342c;
    --accent: #ec7454; --accent-2: #f08a6d; --ok: #5cc296; --shadow: 0 10px 30px -14px rgba(0, 0, 0, .6);
  }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 18px/1.65 var(--sans); word-break: keep-all; overflow-wrap: anywhere; }
a { color: inherit; }
img { max-width: 100%; }
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; border-radius: 6px; }
.wrap { max-width: 1160px; margin: 0 auto; padding: 0 20px; }

/* 머리 */
.nav { position: sticky; top: 0; z-index: 20; background: color-mix(in srgb, var(--paper) 88%, transparent); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.nav-in { display: flex; align-items: center; justify-content: space-between; height: 64px; }
.logo { display: inline-flex; align-items: center; gap: 10px; font-weight: 800; font-size: 21px; letter-spacing: -.02em; text-decoration: none; }
.logo svg { width: 30px; height: 30px; }
.logo rect { fill: none; stroke: var(--ink); stroke-width: 2.2; }
.logo circle { fill: none; stroke: var(--ring); stroke-width: 2.4; }
.links { display: flex; gap: 6px; }
.links a { text-decoration: none; padding: 8px 14px; border-radius: 999px; font-weight: 600; color: var(--sub); }
.links a:hover { background: var(--paper-2); color: var(--ink); }

/* 첫 화면 */
.hero { display: grid; grid-template-columns: 1.05fr 1fr; gap: 48px; align-items: center; padding-top: 56px; padding-bottom: 64px; }
.eyebrow { margin: 0 0 14px; color: var(--accent); font-weight: 700; letter-spacing: .08em; font-size: 15px; }
.hero h1 { font-family: var(--serif); font-weight: 700; font-size: clamp(38px, 5.4vw, 64px); line-height: 1.18; letter-spacing: -.03em; margin: 0 0 20px; }
.hero h1 em { font-style: normal; color: var(--accent); position: relative; }
.hero h1 em::after { content: ""; position: absolute; inset: -.08em -.22em -.02em; border: 3px solid var(--ring); border-radius: 50%; transform: rotate(-6deg); opacity: .85; }
.lede { font-size: 19px; color: var(--sub); margin: 0 0 28px; max-width: 30em; }
.hero-cta { display: flex; gap: 12px; flex-wrap: wrap; }
.progress { margin: 22px 0 0; color: var(--sub); font-size: 16px; min-height: 1.5em; }
.progress b { color: var(--ink); }
.bar-mini { display: inline-block; vertical-align: middle; width: 120px; height: 8px; border-radius: 99px; background: var(--paper-2); margin-left: 8px; overflow: hidden; }
.bar-mini i { display: block; height: 100%; background: var(--ok); border-radius: 99px; }

.hero-art { position: relative; height: clamp(360px, 44vw, 520px); }
.sheet { position: absolute; width: 56%; aspect-ratio: 3 / 4; background: var(--card); padding: 10px; border-radius: 16px; box-shadow: var(--shadow); }
.sheet .ph { position: relative; width: 100%; height: 100%; }
.sheet img { width: 100%; height: 100%; object-fit: cover; border-radius: 10px; display: block; }
.s1 { left: 0; top: 6%; transform: rotate(-5deg); }
.s2 { right: 0; top: 0; transform: rotate(4deg); }
.hero-ring { position: absolute; border: 4px solid var(--ring); border-radius: 50%; box-shadow: 0 0 0 2px rgba(255, 255, 255, .9); animation: draw 1.1s .5s ease both; }
@keyframes draw { from { transform: scale(.3) rotate(-40deg); opacity: 0; } to { transform: none; opacity: 1; } }

/* 구역 */
.band { background: var(--paper-2); padding: 64px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.sec-head { margin-bottom: 26px; }
.sec-head h2 { font-family: var(--serif); font-size: clamp(28px, 3.4vw, 38px); letter-spacing: -.03em; margin: 0 0 6px; line-height: 1.25; }
.sec-head p { margin: 0; color: var(--sub); }

.theme { margin-top: 38px; }
.theme:first-child { margin-top: 0; }
.theme-h { display: flex; align-items: baseline; gap: 12px; margin-bottom: 14px; }
.theme-h h3 { margin: 0; font-size: 23px; letter-spacing: -.02em; }
.chip { display: inline-block; width: 12px; height: 12px; border-radius: 50%; background: var(--c); transform: translateY(-1px); }
.theme-h small { color: var(--sub); font-size: 15px; }
.grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.card { position: relative; display: flex; flex-direction: column; background: var(--card); border-radius: var(--r); overflow: hidden; text-decoration: none; box-shadow: var(--shadow); transition: transform .2s ease, box-shadow .2s ease; }
.card:hover { transform: translateY(-4px); box-shadow: 0 18px 40px -18px rgba(42, 36, 29, .45); }
.card .thumb { display: grid; grid-template-columns: 1fr 1fr; gap: 3px; background: var(--line); }
.card .thumb img { width: 100%; aspect-ratio: 3 / 4; object-fit: cover; display: block; }
.card .meta { padding: 14px 16px 16px; display: flex; justify-content: space-between; align-items: center; gap: 10px; border-top: 4px solid var(--c); }
.card .meta strong { font-size: 19px; line-height: 1.35; }
.badge { flex: none; font-size: 14px; font-weight: 700; color: var(--ok); background: color-mix(in srgb, var(--ok) 12%, transparent); padding: 3px 10px; border-radius: 99px; }
.badge.todo { color: var(--sub); background: var(--paper-2); }

.how { padding-top: 70px; padding-bottom: 70px; }
.steps { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; }
.steps li { background: var(--card); border-radius: var(--r); padding: 26px 24px; box-shadow: var(--shadow); }
.steps .num { display: inline-grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; border: 3px solid var(--ring); color: var(--ring); font-weight: 800; font-size: 20px; }
.steps h3 { margin: 14px 0 6px; font-size: 21px; }
.steps p { margin: 0; color: var(--sub); }

.books-in { display: grid; grid-template-columns: 1fr 1.2fr; gap: 40px; align-items: center; }
.books h2 { font-family: var(--serif); font-size: clamp(26px, 3vw, 34px); margin: 0 0 10px; letter-spacing: -.03em; }
.books p { color: var(--sub); margin: 0; }
.book-list { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.book-list li { background: var(--card); border-radius: 14px; padding: 14px 16px; box-shadow: var(--shadow); border-left: 5px solid var(--c); }
.book-list b { display: block; font-size: 17px; }
.book-list span { color: var(--sub); font-size: 14px; }

/* 버튼 */
.btn { appearance: none; border: 2px solid var(--line); background: var(--card); color: var(--ink); font: inherit; font-weight: 700; padding: 10px 20px; border-radius: 999px;
  cursor: pointer; text-decoration: none; min-height: 50px; display: inline-flex; align-items: center; gap: 8px; transition: border-color .15s, background .15s, transform .1s; }
.btn:hover { border-color: var(--ink); }
.btn:active { transform: scale(.97); }
.btn svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.primary:hover { background: var(--accent-2); border-color: var(--accent-2); }
.btn.lg { min-height: 58px; padding: 12px 28px; font-size: 19px; }
.btn[aria-pressed="true"] { background: color-mix(in srgb, var(--accent) 12%, var(--card)); border-color: var(--accent); color: var(--accent-2); }

/* 풀기 */
.play-bar { position: sticky; top: 64px; z-index: 15; background: var(--paper); border-bottom: 1px solid var(--line); }
.play-bar-in { display: flex; align-items: center; gap: 14px; min-height: 70px; }
.back { display: grid; place-items: center; width: 46px; height: 46px; border-radius: 50%; border: 2px solid var(--line); text-decoration: none; font-size: 22px; flex: none; }
.back:hover { border-color: var(--ink); }
.ptitle { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.3; }
.ptitle small { color: var(--sub); font-size: 15px; }
.ptitle strong { font-size: 22px; letter-spacing: -.02em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.stat { display: flex; align-items: center; gap: 14px; }
.dots { display: flex; gap: 6px; }
.dots i { width: 24px; height: 24px; border-radius: 50%; border: 3px solid var(--ring); display: block; transition: background .2s; }
.dots i.on { background: var(--ring); }
.time { font-variant-numeric: tabular-nums; color: var(--sub); font-weight: 700; min-width: 3.2em; text-align: right; }

.stage { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; margin-top: 20px; }
.pic { margin: 0; display: flex; flex-direction: column; align-items: center; }
.pane { width: 100%; max-width: calc((100vh - 290px) * .75); border-radius: 14px; overflow: hidden; background: var(--card); box-shadow: var(--shadow); padding: 6px; }
.zoomed .pane { aspect-ratio: 3 / 4; overflow: auto; overscroll-behavior: contain; padding: 0; }
.inner { position: relative; }
.zoomed .inner { width: 200%; }
.pane img { display: block; width: 100%; height: auto; border-radius: 10px; cursor: crosshair; user-select: none; -webkit-user-select: none; touch-action: manipulation; }
.zoomed .pane img { border-radius: 0; }
.pic figcaption { color: var(--sub); font-size: 15px; margin-top: 8px; font-weight: 600; }
.marks { position: absolute; inset: 0; pointer-events: none; }
.ring { position: absolute; border: 4px solid var(--ring); border-radius: 50%; box-shadow: 0 0 0 2px rgba(255, 255, 255, .9), inset 0 0 0 2px rgba(255, 255, 255, .5); animation: pop .4s cubic-bezier(.2, 1.4, .4, 1); }
.ring.ans { border-style: dashed; animation: none; }
.miss { position: absolute; width: 40px; height: 40px; margin: -20px 0 0 -20px; color: var(--ring); font: 800 34px/40px var(--sans); text-align: center; text-shadow: 0 0 4px #fff, 0 0 2px #fff; animation: fade .75s ease forwards; }
.hintbox { position: absolute; border: 4px dotted var(--hint); border-radius: 16px; background: color-mix(in srgb, var(--hint) 10%, transparent); animation: blink 2s ease forwards; }
@keyframes pop { from { transform: scale(.4); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes fade { to { opacity: 0; transform: scale(1.5); } }
@keyframes blink { 0%, 40%, 80% { opacity: 1; } 20%, 60% { opacity: .25; } 100% { opacity: 0; } }

.msg { text-align: center; font-size: 20px; font-weight: 600; min-height: 1.7em; margin: 18px 0 6px; }
.tools { display: flex; justify-content: center; gap: 10px; flex-wrap: wrap; padding-bottom: 50px; }

.done-wrap { position: fixed; inset: 0; z-index: 40; display: grid; place-items: center; padding: 20px; background: rgba(28, 25, 21, .45); animation: fadein .25s ease; }
@keyframes fadein { from { opacity: 0; } }
.done { position: relative; width: min(560px, 100%); max-height: calc(100vh - 40px); overflow: auto; background: var(--card); border-radius: 22px; padding: 34px 30px 26px; box-shadow: 0 30px 80px -20px rgba(0, 0, 0, .5); text-align: center; }
.done h2 { font-family: var(--serif); margin: 6px 0 4px; font-size: 30px; letter-spacing: -.03em; }
.done-sub { color: var(--sub); margin: 0 0 18px; }
.done ol { text-align: left; margin: 0 auto 22px; padding: 16px 20px 16px 2.6em; background: var(--paper); border-radius: 14px; max-width: 440px; }
.done li { padding: 3px 0; }
.done-act { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
.burst { height: 66px; background:
  radial-gradient(circle, var(--ring) 0 5px, transparent 6px) 20% 40% / 34px 34px no-repeat,
  radial-gradient(circle, var(--hint) 0 6px, transparent 7px) 50% 10% / 34px 34px no-repeat,
  radial-gradient(circle, var(--ok) 0 5px, transparent 6px) 78% 50% / 34px 34px no-repeat,
  radial-gradient(circle, var(--accent) 0 4px, transparent 5px) 35% 80% / 34px 34px no-repeat,
  radial-gradient(circle, var(--hint) 0 4px, transparent 5px) 65% 85% / 34px 34px no-repeat; animation: pop .5s ease; }

.foot { border-top: 1px solid var(--line); padding: 30px 0 40px; color: var(--sub); font-size: 15px; }
.foot-in { display: flex; gap: 20px; align-items: center; flex-wrap: wrap; }
.foot p { margin: 0; flex: 1; min-width: 240px; }
.logo.sm { font-size: 17px; color: var(--ink); }
.logo.sm svg { width: 24px; height: 24px; }

@media (max-width: 900px) {
  .hero { grid-template-columns: 1fr; gap: 34px; padding-top: 40px; }
  .hero-art { height: 340px; max-width: 460px; width: 100%; margin: 0 auto; }
  .grid { grid-template-columns: repeat(2, 1fr); }
  .steps { grid-template-columns: 1fr; }
  .books-in { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  body { font-size: 17px; }
  .wrap { padding: 0 16px; }
  .links a { padding: 8px 10px; }
  .grid { grid-template-columns: 1fr 1fr; gap: 12px; }
  .card .meta { padding: 10px 12px 12px; }
  .card .meta strong { font-size: 16px; }
  .stage { gap: 8px; }
  .pane { max-width: none; padding: 3px; }
  .dots i { width: 18px; height: 18px; border-width: 2.5px; }
  .time { display: none; }
  .ptitle strong { font-size: 19px; }
  .band { padding: 46px 0; }
}
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; scroll-behavior: auto !important; } }

/* 활동지 */
.print { padding-top: 70px; }
.print-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.print-card { background: var(--card); border-radius: var(--r); padding: 18px 20px; box-shadow: var(--shadow); border-top: 5px solid var(--c); }
.print-card h3 { margin: 0 0 8px; font-size: 19px; }
.print-card ul { list-style: none; padding: 0; margin: 0; }
.print-card li { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 8px 0; border-top: 1px solid var(--line); }
.print-card li:first-child { border-top: 0; }
.print-card a { font-weight: 700; text-decoration: none; color: var(--accent-2); white-space: nowrap; font-size: 16px; }
.print-card a:hover { text-decoration: underline; }
.sub-links { text-align: center; margin: -36px 0 46px; color: var(--sub); font-size: 16px; }
.sub-links a { color: var(--accent-2); font-weight: 700; }

/* 검색용 정적 쪽 */
.static-main { padding-top: 40px; padding-bottom: 60px; }
.static-h1 { font-family: var(--serif); font-size: clamp(32px, 4.4vw, 50px); line-height: 1.2; letter-spacing: -.03em; margin: 0 0 14px; }
.static-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin: 30px 0; max-width: 900px; }
.static-pair figure { margin: 0; text-align: center; color: var(--sub); font-size: 15px; }
.static-pair img { width: 100%; height: auto; border-radius: 12px; box-shadow: var(--shadow); }
.static-more h2 { font-size: 22px; }
.static-more ul { padding-left: 1.2em; }

/* 큰 화면 */
body.tvmode .nav, body.tvmode .foot { display: none; }
.tv { position: fixed; inset: 0; z-index: 50; background: #14110e; color: #f6efe3; display: flex; flex-direction: column; padding: 18px 28px 20px; }
.tv-top { display: flex; justify-content: space-between; align-items: center; }
.tv-top small { display: block; color: #bfb3a2; font-size: 20px; }
.tv-top strong { font-family: var(--serif); font-size: clamp(28px, 3.4vw, 46px); letter-spacing: -.02em; }
.tv-time { font-size: clamp(30px, 3.6vw, 52px); font-weight: 800; font-variant-numeric: tabular-nums; color: #ffd36b; }
.tv-stage { flex: 1; min-height: 0; display: flex; justify-content: center; align-items: center; gap: 2.4vw; padding: 10px 0; }
.tv-stage figure { margin: 0; height: 100%; display: flex; flex-direction: column; align-items: center; }
.tv-stage .inner { position: relative; height: calc(100% - 34px); aspect-ratio: 3 / 4; }
.tv-stage img { width: 100%; height: 100%; object-fit: contain; border-radius: 12px; display: block; }
.tv-stage figcaption { color: #bfb3a2; font-size: 20px; margin-top: 6px; }
.tv .ring { border-width: 7px; }
.tv-bar { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; }
.tv-cap { font-size: clamp(22px, 2.4vw, 34px); font-weight: 700; }
.tv-btns { display: flex; gap: 10px; flex-wrap: wrap; }
.tv .btn { background: #2a2520; color: #f6efe3; border-color: #4a4239; min-height: 56px; font-size: 19px; }
.tv .btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }

@media (max-width: 900px) { .print-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 640px) { .print-grid { grid-template-columns: 1fr; } .static-pair { gap: 8px; } .sub-links { margin-top: -30px; } }

/* 지금 보고 있는 탭 표시 */
.nav .links a.active { color: var(--accent, #b5432f); font-weight: 700; text-decoration: underline; text-underline-offset: 6px; text-decoration-thickness: 2px; }

/* 테마 고르기 칩: 한 번에 한 테마만 */
.theme-chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 22px; }
.tchip { font: inherit; font-size: 16px; padding: 9px 14px; border-radius: 999px; border: 2px solid var(--line); background: var(--card); color: var(--ink); cursor: pointer; }
.tchip.on { border-color: var(--c); background: var(--c); color: #fff; font-weight: 700; }
.print-grid { display: block; }
.print-grid .print-card { max-width: 640px; }
#themesSec, #printSec, #howSec, #booksSec { padding-top: 28px; }
