/* 사용 설명서(guide/) 모양 — 2026-10-25.
   첫 화면·수업 세션 시작 페이지와 같은 크림 바탕·잉크색·파랑(session-home.css, doc-page.css와 같은 값).
   화면으로 읽어도, A4로 인쇄해도 보기 좋게 만든다. 인쇄 단추와 「선생님만 보세요」 펼치기는 guide.js(CSP가 인라인 스크립트를 막음). */
:root {
  --ink: #1b2440;
  --ink-2: #4a5470;
  --ink-3: #7a8299;
  --blue: #1a68e6;
  --blue-dark: #1456c2;
  --blue-soft: #e6efff;
  --orange: #f28c28;
  --orange-soft: #fff1e2;
  --cream: #fbf7f0;
  --cream-2: #f4ede1;
  --line: #e7e0d3;
  --green: #1f9d57;
  --green-soft: #e3f6ea;
  --radius: 18px;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; scroll-padding-top: 84px; }
body {
  margin: 0;
  background: var(--cream);
  color: var(--ink);
  font-family: Pretendard, -apple-system, 'Malgun Gothic', sans-serif;
  line-height: 1.7;
  word-break: keep-all; overflow-wrap: break-word;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; }
img { max-width: 100%; height: auto; }
.wrap { max-width: 980px; margin: 0 auto; padding: 0 24px; }
.print-only { display: none; }

/* 머리줄: 첫 화면·문서 페이지와 같다 */
.nav {
  position: sticky; top: 0; z-index: 10;
  background: rgba(251, 247, 240, 0.86);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
.nav .wrap { display: flex; align-items: center; gap: 20px; height: 68px; }
.nav-home { display: block; }
.nav-home img { display: block; height: 38px; width: auto; }
.nav-links { display: flex; gap: 20px; margin-left: auto; font-size: 15px; font-weight: 600; color: var(--ink-2); }
.nav-links a { text-decoration: none; }
.nav-links a:hover { color: var(--ink); }
.nav-links a[aria-current="page"] { color: var(--ink); box-shadow: inset 0 -2px 0 var(--blue); }

.crumb { font-size: 14px; color: var(--ink-3); margin: 28px 0 0; }
.crumb a { text-decoration: none; }
.crumb a:hover { color: var(--ink); }

/* 첫머리 */
.g-hero { display: grid; grid-template-columns: 1.15fr 0.85fr; gap: 36px; align-items: center; margin-top: 18px; }
.g-hero-solo { grid-template-columns: 1fr; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chips span { font-size: 13px; font-weight: 700; padding: 3px 10px; border-radius: 999px; background: var(--cream-2); color: var(--ink-2); line-height: 1.6; }
.chips .grade { background: var(--blue-soft); color: var(--blue); }
h1 { font-size: clamp(28px, 4.2vw, 40px); line-height: 1.22; letter-spacing: -1px; font-weight: 800; margin: 12px 0 0; }
.lead { margin: 12px 0 0; color: var(--ink-2); font-size: 17px; line-height: 1.65; }
.g-art img {
  display: block; width: 100%; aspect-ratio: 16 / 9; object-fit: cover;
  border-radius: 18px; border: 4px solid #fff; box-shadow: 0 16px 36px rgba(27, 36, 64, 0.16);
}
.g-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 20px; }
.btn {
  display: inline-flex; align-items: center; gap: 8px; justify-content: center;
  padding: 11px 18px; border-radius: 12px; font: inherit; font-size: 15px; font-weight: 700;
  text-decoration: none; cursor: pointer; border: 2px solid var(--blue);
  background: var(--blue); color: #fff; transition: background 0.2s, transform 0.15s;
}
.btn:hover { background: var(--blue-dark); border-color: var(--blue-dark); transform: translateY(-1px); }
.btn-ghost { background: #fff; color: var(--blue); }
.btn-ghost:hover { background: #f2f7ff; color: var(--blue-dark); }
.btn svg { width: 18px; height: 18px; flex: none; }

/* 한눈에 보기 */
.g-facts { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-top: 28px; }
.g-fact { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 14px 16px; }
.g-fact span { display: block; font-size: 13px; font-weight: 700; color: var(--ink-3); }
.g-fact strong { display: block; font-size: 15.5px; line-height: 1.45; margin-top: 2px; }

/* 목차 */
.g-toc { margin-top: 22px; background: var(--cream-2); border-radius: 14px; padding: 14px 22px; }
.g-toc p { margin: 0 0 4px; font-size: 14px; font-weight: 800; }
.g-toc ol { margin: 0; padding-left: 20px; columns: 2; column-gap: 28px; font-size: 14.5px; }
.g-toc li { break-inside: avoid; }
.g-toc a { text-decoration: none; color: var(--ink-2); }
.g-toc a:hover { color: var(--blue); text-decoration: underline; }

/* 큰 칸(장) */
main { counter-reset: sec; }
.g-sec {
  margin-top: 26px; background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  padding: 8px 32px 28px; box-shadow: 0 6px 18px rgba(27, 36, 64, 0.04);
}
.g-sec > h2 {
  counter-increment: sec;
  display: flex; align-items: center; gap: 12px;
  font-size: 22px; letter-spacing: -0.5px; line-height: 1.3; margin: 24px 0 6px;
}
.g-sec > h2::before {
  content: counter(sec);
  flex: none; display: inline-flex; align-items: center; justify-content: center;
  width: 32px; height: 32px; border-radius: 10px; background: var(--ink); color: #fff; font-size: 16px;
}
.g-sec > .sec-lead { margin: 0 0 10px; color: var(--ink-2); }
.g-sec h3 { font-size: 17.5px; letter-spacing: -0.3px; margin: 24px 0 6px; line-height: 1.4; }
.g-sec h3 .tag { margin-left: 6px; vertical-align: 2px; }
.g-sec p { margin: 0 0 10px; }
.g-sec ul, .g-sec ol { margin: 6px 0 10px; padding-left: 22px; }
.g-sec li { margin-bottom: 5px; }
.g-sec strong { font-weight: 800; }
.g-sec a { color: var(--blue); }
.q { font-weight: 700; color: var(--ink); background: var(--cream-2); border-radius: 6px; padding: 0 6px; white-space: nowrap; }

.tag { display: inline-block; font-size: 12.5px; font-weight: 800; padding: 2px 9px; border-radius: 999px; background: var(--blue-soft); color: var(--blue); line-height: 1.6; }
.tag-orange { background: var(--orange-soft); color: #b85f0b; }
.tag-gray { background: var(--cream-2); color: var(--ink-2); }

/* 차례대로 하는 일 */
.g-steps { list-style: none; padding: 0 !important; margin: 14px 0 6px !important; counter-reset: step; display: grid; gap: 14px; }
.g-steps > li {
  counter-increment: step; position: relative; margin: 0 !important;
  padding: 14px 18px 14px 60px; border: 1px solid var(--line); border-radius: 14px; background: #fff;
}
.g-steps > li::before {
  content: counter(step);
  position: absolute; left: 16px; top: 14px;
  width: 30px; height: 30px; border-radius: 50%; background: var(--blue); color: #fff;
  display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 15px;
}
.g-steps > li > strong:first-child { display: block; font-size: 16px; line-height: 1.5; margin-top: 2px; }
.g-steps > li p { margin: 4px 0 0; color: var(--ink-2); }
.g-steps > li ul { color: var(--ink-2); }
.g-steps .shot { margin-top: 12px; }
.g-steps-wide > li { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 22px; align-items: start; }
.g-steps-wide > li > .shot { grid-column: 2; grid-row: 1 / span 4; margin-top: 2px; }
.g-steps-wide > li:not(:has(> .shot)) { display: block; }

/* 화면 사진 */
.shot { margin: 14px 0 6px; }
.shot img {
  display: block; width: 100%; border-radius: 12px; border: 1px solid var(--line);
  box-shadow: 0 8px 22px rgba(27, 36, 64, 0.08); background: var(--cream-2);
}
.shot figcaption { font-size: 13.5px; color: var(--ink-3); margin-top: 6px; line-height: 1.5; }
.shots { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin: 14px 0 6px; }
.shots .shot { margin: 0; }
.shot-phone img { max-width: 360px; margin: 0 auto; }

/* 세 가지 방법 비교 */
.g-modes { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin: 14px 0 6px; }
.g-mode { border: 2px solid var(--line); border-radius: 16px; padding: 16px 18px; background: #fff; }
.g-mode.is-main { border-color: var(--blue); }
.g-mode h3 { margin: 8px 0 4px !important; font-size: 18px; }
.g-mode p { font-size: 14.5px; color: var(--ink-2); margin: 0 0 8px; }
.g-mode ul { list-style: none; padding: 0 !important; margin: 0 !important; font-size: 14.5px; }
.g-mode li { padding-left: 20px; position: relative; margin-bottom: 4px; }
.g-mode li::before { content: '✓'; position: absolute; left: 0; color: var(--blue); font-weight: 800; }
.g-mode .when { margin-top: 10px; padding-top: 10px; border-top: 1px dashed var(--line); font-size: 14px; color: var(--ink); }

/* 알림 상자 */
.callout { border-radius: 14px; padding: 14px 18px; margin: 14px 0; background: var(--blue-soft); border-left: 5px solid var(--blue); }
.callout p:last-child, .callout ul:last-child { margin-bottom: 0; }
.callout > strong:first-child { display: block; margin-bottom: 2px; }
.callout-warn { background: var(--orange-soft); border-left-color: var(--orange); }
.callout-good { background: var(--green-soft); border-left-color: var(--green); }

/* 선생님만 보세요(정답·숨은 규칙). 화면에서는 접어 두고, 인쇄할 때는 guide.js가 펼친다 */
.g-secret { margin: 16px 0 6px; border-radius: 16px; background: var(--ink); color: #e9ecf5; overflow: hidden; }
.g-secret > summary {
  list-style: none; cursor: pointer; padding: 16px 20px; display: flex; align-items: center; gap: 10px;
  font-weight: 800; font-size: 16px; color: #fff;
}
.g-secret > summary::-webkit-details-marker { display: none; }
.g-secret > summary::after { content: '펼치기'; margin-left: auto; font-size: 13px; font-weight: 700; color: #9aa3bb; }
.g-secret[open] > summary::after { content: '접기'; }
.g-secret > summary .lock { font-size: 18px; }
.g-secret-body { padding: 0 22px 18px; }
.g-secret-body p, .g-secret-body li { color: #d8dcea; }
.g-secret-body strong { color: #fff; }
.g-secret-body .q { background: rgba(255, 255, 255, 0.12); color: #fff; }
/* 어두운 칸 안의 표: 머리줄도 어둡게, 글자는 밝게 */
.g-secret .g-table th { background: rgba(255, 255, 255, 0.1); color: #fff; }
.g-secret .g-table th, .g-secret .g-table td { border-bottom-color: rgba(255, 255, 255, 0.14); }
.g-secret .g-table td { color: #d8dcea; }
.g-secret .g-table td:first-child { color: #fff; }

/* 표 */
.g-table { width: 100%; border-collapse: collapse; margin: 12px 0 8px; font-size: 14.5px; }
.g-table th, .g-table td { border-bottom: 1px solid var(--line); padding: 9px 10px; text-align: left; vertical-align: top; }
.g-table th { background: var(--cream-2); font-weight: 800; white-space: nowrap; }
.g-table td:first-child { font-weight: 700; white-space: nowrap; }

/* 자주 묻는 질문 */
.faq { margin: 10px 0 0; }
.faq dt { font-weight: 800; margin-top: 14px; display: flex; gap: 8px; }
.faq dt::before { content: 'Q'; color: var(--blue); }
.faq dd { margin: 4px 0 0 22px; color: var(--ink-2); }

/* 게임별 설명서 목록(첫 페이지) */
.g-games { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin: 14px 0 4px; }
.g-game {
  display: flex; flex-direction: column; text-decoration: none; background: #fff;
  border: 1px solid var(--line); border-radius: 16px; overflow: hidden; transition: transform 0.15s, box-shadow 0.2s;
}
.g-game:hover { transform: translateY(-2px); box-shadow: 0 12px 26px rgba(27, 36, 64, 0.1); }
.g-game img { display: block; width: 100%; aspect-ratio: 16 / 9; object-fit: cover; }
.g-game div { padding: 12px 14px 14px; display: flex; flex-direction: column; flex: 1; }
.g-game h3 { margin: 8px 0 4px !important; font-size: 16.5px; line-height: 1.4; }
.g-game p { margin: 0 0 10px; font-size: 14px; color: var(--ink-2); }
.g-game .go { margin-top: auto; font-weight: 800; font-size: 14px; color: var(--blue); }
.g-game .go::after { content: ' →'; }

.g-note { margin-top: 26px; color: var(--ink-3); font-size: 14px; }

/* 바닥글: 첫 화면과 같음 */
.site-footer { background: var(--ink); color: #c9cfdf; font-size: 14px; padding: 26px 0; margin-top: 44px; }
.site-footer .wrap { display: flex; gap: 8px 22px; align-items: center; flex-wrap: wrap; }
.foot-brand { font-size: 19px; font-weight: 800; color: #fff; letter-spacing: -0.3px; text-decoration: none; }
.site-footer a { color: #c9cfdf; text-decoration: none; }
.site-footer a:hover { color: #fff; text-decoration: underline; }
.site-footer a.foot-brand { color: #fff; }
.foot-links { margin-left: auto; display: flex; gap: 16px; }
.foot-links a { color: #9aa3bb; }

@media (max-width: 860px) {
  .g-hero { grid-template-columns: 1fr; gap: 20px; }
  .g-art { order: -1; }
  .g-facts { grid-template-columns: 1fr 1fr; }
  .g-modes, .g-games { grid-template-columns: 1fr 1fr; }
  .g-steps-wide > li { grid-template-columns: 1fr; }
  .g-steps-wide > li > .shot { grid-column: auto; grid-row: auto; margin-top: 10px; }
}
@media (max-width: 620px) {
  .wrap { padding: 0 16px; }
  .nav-links { gap: 14px; font-size: 14px; }
  .nav-home img { height: 32px; }
  .g-sec { padding: 4px 18px 22px; }
  .g-sec > h2 { font-size: 20px; }
  .g-modes, .g-games, .shots { grid-template-columns: 1fr; }
  .g-toc ol { columns: 1; }
  .g-steps > li { padding: 14px 14px 14px 52px; }
  .g-steps > li::before { left: 12px; }
  .g-table { font-size: 13.5px; }
  .g-table td:first-child { white-space: normal; }
  .foot-links { margin-left: 0; }
}
@media (max-width: 420px) {
  .nav-links a.nav-main { display: none; }
  .g-facts { grid-template-columns: 1fr; }
}

/* 인쇄: A4, 머리줄·바닥글·목차·단추는 빼고, 맨 위에 제목 줄을 넣는다 */
@page { size: A4; margin: 13mm 13mm 14mm; }
@media print {
  html { scroll-behavior: auto; }
  body { background: #fff; font-size: 10.5pt; line-height: 1.6; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .wrap { max-width: none; padding: 0; }
  .nav, .crumb, .g-toc, .g-actions, .site-footer, .no-print { display: none !important; }
  .print-only { display: block; }
  .print-head { display: flex; justify-content: space-between; font-size: 9pt; color: var(--ink-3); border-bottom: 1px solid var(--line); padding-bottom: 4px; margin-bottom: 10px; }
  h1 { font-size: 22pt; margin-top: 6px; }
  .lead { font-size: 11pt; }
  .g-hero { grid-template-columns: 1.3fr 0.7fr; gap: 20px; margin-top: 0; }
  .g-art { order: 0; }
  .g-art img { border: 0; box-shadow: none; border-radius: 10px; }
  .g-facts { grid-template-columns: repeat(4, 1fr); gap: 8px; margin-top: 14px; }
  .g-fact { padding: 8px 10px; }
  .g-fact strong { font-size: 10.5pt; }
  .g-sec { box-shadow: none; border: 0; border-radius: 0; padding: 0; margin-top: 18px; }
  .g-sec > h2 { font-size: 15pt; margin: 6px 0 6px; break-after: avoid; }
  .g-sec > h2::before { width: 24px; height: 24px; font-size: 11pt; border-radius: 7px; }
  .g-sec h3 { font-size: 12pt; margin-top: 14px; break-after: avoid; }
  .g-steps { gap: 8px; }
  .g-steps > li { padding: 8px 12px 8px 46px; break-inside: avoid; }
  .g-steps > li::before { left: 12px; top: 9px; width: 24px; height: 24px; font-size: 10.5pt; }
  .g-steps-wide > li { grid-template-columns: 1fr 1fr; }
  .g-steps-wide > li > .shot { grid-column: 2; grid-row: 1 / span 4; }
  .shot { break-inside: avoid; }
  .shot img { box-shadow: none; max-height: 82mm; width: auto; max-width: 100%; margin: 0 auto; }
  .shots { gap: 10px; }
  .g-modes { grid-template-columns: repeat(3, 1fr); gap: 8px; }
  .g-mode { padding: 10px 12px; break-inside: avoid; }
  .g-games { grid-template-columns: repeat(3, 1fr); gap: 8px; }
  .g-game { break-inside: avoid; }
  .callout { break-inside: avoid; padding: 10px 14px; }
  .g-secret { background: #fff; color: var(--ink); border: 2px solid var(--ink); break-inside: avoid; }
  .g-secret > summary { color: var(--ink); padding: 10px 14px; }
  .g-secret > summary::after { content: '' !important; }
  .g-secret-body { padding: 0 16px 12px; }
  .g-secret-body p, .g-secret-body li { color: var(--ink); }
  .g-secret-body strong { color: var(--ink); }
  .g-secret-body .q { background: var(--cream-2); color: var(--ink); }
  .g-secret .g-table th { background: var(--cream-2); color: var(--ink); }
  .g-secret .g-table th, .g-secret .g-table td { border-bottom-color: var(--line); }
  .g-secret .g-table td, .g-secret .g-table td:first-child { color: var(--ink); }
  .g-table, .faq dt, .faq dd { break-inside: avoid; }
  .page-break { break-before: page; }
  a { text-decoration: none; }
}
