/* =========================================================
   한국어 패치 배포소 — 공용 스타일
   밝은 종이 톤 허브 + 게임별 강조색 (용맥: 청금/크림슨, 라어히: 히어로 옐로)
   ========================================================= */

:root {
  --paper: #f6f5f1;
  --card: #ffffff;
  --ink: #15171e;
  --ink-2: #444a57;
  --muted: #5f6573;
  --line: #e2dfd6;
  --line-strong: #cfcbc0;

  /* 용맥 */
  --av: #1d46b4;
  --av-deep: #0e2766;
  --av-soft: #e9effc;
  --av-line: #c9d6f4;
  --av-red: #c22c38;

  /* 라어히 */
  --lah: #ec833d;
  --lah-deep: #a4481a;
  --lah-soft: #fdeee3;
  --lah-line: #f4c6a3;
  --lah-blue: #1f6fd1;
  --lah-ink: #26150b;

  /* 페이지별로 덮어쓰는 강조색 */
  --accent: var(--ink);
  --accent-ink: #ffffff;
  --accent-soft: #efede7;
  --accent-line: var(--line);
  --accent-text: var(--ink);

  --radius: 18px;
  --radius-sm: 12px;
  --shadow: 0 1px 2px rgba(21, 23, 30, 0.05), 0 8px 24px rgba(21, 23, 30, 0.06);
  --wrap: 1120px;
  --font: "Pretendard Variable", Pretendard, -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", "Malgun Gothic", "맑은 고딕", system-ui, sans-serif;
  --mono: ui-monospace, "Cascadia Mono", Consolas, "D2Coding", monospace;
}

.theme-anados {
  --accent: var(--av);
  --accent-ink: #ffffff;
  --accent-soft: var(--av-soft);
  --accent-line: var(--av-line);
  --accent-text: var(--av);
}

.theme-lah {
  --accent: var(--lah);
  --accent-ink: var(--lah-ink);
  --accent-soft: var(--lah-soft);
  --accent-line: var(--lah-line);
  --accent-text: var(--lah-deep);
}

*,
*::before,
*::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; }
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.7;
  word-break: keep-all;
  overflow-wrap: break-word;
}

img { max-width: 100%; height: auto; display: block; }

a { color: var(--accent-text); text-underline-offset: 3px; }
a:hover { text-decoration-thickness: 2px; }

:focus-visible { outline: 3px solid var(--lah-blue); outline-offset: 3px; border-radius: 6px; }

h1, h2, h3 { line-height: 1.3; margin: 0; letter-spacing: -0.02em; }
p { margin: 0; }

code {
  font-family: var(--mono);
  font-size: 0.88em;
  background: #efede6;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 0.08em 0.4em;
  word-break: normal;
  overflow-wrap: anywhere;
}

kbd {
  font-family: var(--font);
  font-size: 0.9em;
  font-weight: 700;
  background: #fff;
  border: 1px solid var(--line-strong);
  border-bottom-width: 2px;
  border-radius: 6px;
  padding: 0.05em 0.45em;
  white-space: nowrap;
}

.wrap { width: 100%; max-width: var(--wrap); margin: 0 auto; padding: 0 24px; }

.skip-link {
  position: absolute; left: 12px; top: -48px; z-index: 100;
  background: var(--ink); color: #fff; padding: 8px 14px; border-radius: 8px;
}
.skip-link:focus { top: 12px; }

.sr-only {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap;
}

/* ---------- Header ---------- */

.site-header {
  position: sticky; top: 0; z-index: 20;
  background: rgba(246, 245, 241, 0.92);
  backdrop-filter: saturate(1.4) blur(8px);
  border-bottom: 1px solid var(--line);
}

.header-inner { display: flex; align-items: center; justify-content: space-between; gap: 16px; height: 64px; }

.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; font-weight: 800; letter-spacing: -0.02em; }
.brand svg { flex: none; }
.brand-text { font-size: 17px; }

.nav { display: flex; gap: 4px; list-style: none; margin: 0; padding: 0; }
.nav a {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 7px 14px; border-radius: 999px;
  color: var(--ink-2); font-weight: 600; font-size: 15px; text-decoration: none;
}
.nav a:hover { background: #ebe9e2; color: var(--ink); }
.nav a[aria-current="page"] { background: var(--ink); color: #fff; }
.nav .dot { width: 8px; height: 8px; border-radius: 50%; flex: none; }
.nav .dot-av { background: var(--av); }
.nav .dot-lah { background: var(--lah); box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.15); }

/* ---------- Footer ---------- */

#main { padding-bottom: 96px; }

/* ---------- Common blocks ---------- */

.eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 13px; font-weight: 700; letter-spacing: 0.04em;
  color: var(--muted);
}

.badge {
  display: inline-flex; align-items: center;
  padding: 3px 10px; border-radius: 999px;
  font-size: 13px; font-weight: 700; line-height: 1.5; white-space: nowrap;
}
.badge-test { background: var(--lah-ink); color: var(--lah); }
.card-av .badge-test, .theme-anados .badge-test { background: var(--av-deep); color: #fff; }
.badge-ver { background: #fff; color: var(--ink-2); border: 1px solid var(--line-strong); font-family: var(--mono); font-weight: 600; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 48px; padding: 0 22px; border-radius: 12px;
  font-weight: 700; font-size: 16px; text-decoration: none; cursor: pointer;
  border: 2px solid transparent;
  transition: transform 0.15s ease, background-color 0.15s ease, box-shadow 0.15s ease;
}
.btn svg { flex: none; }
.btn-primary { background: var(--accent); color: var(--accent-ink); box-shadow: 0 2px 0 rgba(0, 0, 0, 0.18); }
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 4px 0 rgba(0, 0, 0, 0.18); }
.btn-ghost { background: #fff; color: var(--ink); border-color: var(--line-strong); }
.btn-ghost:hover { border-color: var(--ink); }
.btn-block { width: 100%; }

.btn[aria-disabled="true"] {
  background: #e7e5de; color: #6a6f7b; border-color: #d8d5cc;
  box-shadow: none; transform: none; cursor: not-allowed;
}

/* ---------- Hub ---------- */

.hub-games { padding-top: 56px; }

.game-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; }

.game-card {
  position: relative; display: flex; flex-direction: column;
  background: var(--card); border: 1px solid var(--line); border-radius: 24px;
  overflow: hidden; color: var(--ink); text-decoration: none;
  box-shadow: var(--shadow);
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}
.game-card:hover { transform: translateY(-3px); box-shadow: 0 2px 4px rgba(21, 23, 30, 0.06), 0 18px 40px rgba(21, 23, 30, 0.1); }
.game-card.card-av:hover { border-color: var(--av); }
.game-card.card-lah:hover { border-color: var(--lah-deep); }

.game-art { position: relative; height: 240px; display: flex; align-items: center; justify-content: center; overflow: hidden; }

.art-av {
  background:
    repeating-linear-gradient(45deg, rgba(29, 70, 180, 0.06) 0 1px, transparent 1px 22px),
    repeating-linear-gradient(-45deg, rgba(29, 70, 180, 0.06) 0 1px, transparent 1px 22px),
    linear-gradient(160deg, #f4f7ff 0%, #dfe8fb 100%);
  border-bottom: 4px solid var(--av);
}
.art-av img { width: min(78%, 400px); transform: translateX(3%); } /* 글자 무게가 왼쪽에 쏠린 로고라 시각적 중심 보정 */

.art-lah {
  background:
    radial-gradient(rgba(38, 21, 11, 0.12) 1.3px, transparent 1.8px) 0 0 / 14px 14px,
    linear-gradient(160deg, #f6a46a 0%, var(--lah) 100%);
  border-bottom: 4px solid var(--lah-ink);
}
.game-art .badge-test { position: absolute; top: 20px; left: 22px; z-index: 1; }
.art-lah .art-logo { width: min(78%, 400px); }


.game-body { padding: 26px 28px 28px; display: flex; flex-direction: column; gap: 14px; flex: 1; }
.game-body h2 { font-size: 24px; font-weight: 800; }
.game-body h2 small { display: block; font-size: 14px; font-weight: 600; color: var(--muted); letter-spacing: 0; margin-top: 4px; }
.game-body p { color: var(--ink-2); }

.chip-row { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 5px 12px; border-radius: 999px; font-size: 14px; font-weight: 600;
  background: #f1efe9; color: var(--ink-2);
}
.chip .ver { font-family: var(--mono); font-size: 13px; color: var(--muted); }

.game-cta { margin-top: auto; padding-top: 6px; display: inline-flex; align-items: center; gap: 8px; font-weight: 800; }
.card-av .game-cta { color: var(--av); }
.card-lah .game-cta { color: var(--lah-deep); }
.game-card:hover .game-cta svg { transform: translateX(3px); }
.game-cta svg { transition: transform 0.2s ease; }

.notes { margin-top: 40px; max-width: 40em; }
.note { background: transparent; border-top: 2px solid var(--ink); padding-top: 14px; }
.note h3 { font-size: 16px; font-weight: 800; margin-bottom: 6px; }
.note p { font-size: 15px; color: var(--ink-2); }

/* ---------- Game page hero ---------- */

.page-hero { border-bottom: 1px solid var(--line); }
.hero-av {
  background:
    repeating-linear-gradient(45deg, rgba(29, 70, 180, 0.05) 0 1px, transparent 1px 24px),
    repeating-linear-gradient(-45deg, rgba(29, 70, 180, 0.05) 0 1px, transparent 1px 24px),
    linear-gradient(170deg, #f7f9ff 0%, #e3ebfc 100%);
}
.hero-lah {
  background:
    radial-gradient(rgba(38, 21, 11, 0.1) 1.3px, transparent 1.8px) 0 0 / 14px 14px,
    linear-gradient(165deg, #f6a46a 0%, var(--lah) 100%);
  border-bottom: 4px solid var(--lah-ink);
  overflow: hidden;
}

.hero-inner { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); align-items: center; gap: 32px; padding-top: 56px; padding-bottom: 56px; }
.hero-inner h1 { font-size: clamp(28px, 4vw, 44px); font-weight: 800; margin-top: 12px; }
.hero-inner .lead { margin-top: 16px; font-size: 17px; color: var(--ink-2); max-width: 34em; }
.hero-actions { display: grid; grid-template-columns: repeat(2, 180px); gap: 10px; margin-top: 26px; }
.hero-actions .btn { white-space: nowrap; }

.hero-av .eyebrow { color: var(--av); }
.hero-av .hero-logo { justify-self: center; width: min(100%, 440px); }

.hero-lah .eyebrow { color: var(--lah-ink); }
.hero-lah .lead { color: var(--lah-ink); }
.hero-lah .hero-logo { justify-self: center; width: min(100%, 460px); }

/* ---------- Page layout ---------- */

.page-main { padding-top: 48px; }

.layout { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 32px; align-items: start; }
.layout + .layout { margin-top: 72px; }
.layout-main { display: grid; gap: 24px; min-width: 0; }
.layout-aside { position: sticky; top: 88px; display: grid; gap: 16px; min-width: 0; }

.platform-head { display: flex; align-items: center; gap: 14px; margin-bottom: 4px; }
.platform-icon {
  width: 48px; height: 48px; border-radius: 14px; flex: none;
  display: grid; place-items: center;
  background: var(--accent); color: var(--accent-ink);
}
.platform-head h2 { font-size: 28px; font-weight: 800; }
.platform-head p { color: var(--muted); font-size: 15px; }

.section {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 28px 30px; box-shadow: var(--shadow);
  scroll-margin-top: 88px;
}
.section > h2, .section > h3 { font-size: 21px; font-weight: 800; display: flex; align-items: center; gap: 10px; }
.section > h2::before, .section > h3::before {
  content: ""; width: 6px; height: 22px; border-radius: 3px; background: var(--accent); flex: none;
}
.section > h2 + *, .section > h3 + * { margin-top: 14px; }
.section p + p, .section p + ul, .section ul + p, .section ol + p, .section p + ol { margin-top: 12px; }
.section p, .section li { color: var(--ink-2); }
.section strong { color: var(--ink); }

.list { margin: 0; padding-left: 1.2em; display: grid; gap: 6px; }
.list li::marker { color: var(--accent-text); }

/* Steps */
.steps { list-style: none; margin: 0; padding: 0; counter-reset: step; display: grid; gap: 0; }
.steps > li { position: relative; counter-increment: step; padding: 0 0 22px 52px; }
.steps > li:last-child { padding-bottom: 0; }
.steps > li::before {
  content: counter(step);
  position: absolute; left: 0; top: 0;
  width: 34px; height: 34px; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--accent); color: var(--accent-ink);
  font-weight: 800; font-size: 15px;
}
.steps > li::after {
  content: ""; position: absolute; left: 16px; top: 40px; bottom: 6px; width: 2px; background: var(--accent-line);
}
.steps > li:last-child::after { display: none; }
.step-title { display: block; font-weight: 800; color: var(--ink); font-size: 17px; line-height: 34px; }
.step-desc { display: block; color: var(--ink-2); }
.step-desc + .step-desc { margin-top: 6px; }
.shots { display: grid; grid-template-columns: repeat(2, minmax(0, 220px)); gap: 12px; align-items: start; margin-top: 12px; }
.shots img { display: block; width: 100%; height: auto; border-radius: 14px; border: 1px solid var(--line); }

/* Callouts */
.callout {
  border-radius: var(--radius-sm); padding: 14px 18px;
  background: var(--accent-soft); border: 1px solid var(--accent-line);
  font-size: 15px; color: var(--ink-2);
}
.callout strong { color: var(--ink); }
.callout-warn { background: #fdf0f0; border-color: #f2c9cc; }
.callout-warn strong { color: #9d1f2a; }
* + .callout { margin-top: 16px; }

pre.code {
  margin: 14px 0 0; padding: 14px 18px; border-radius: var(--radius-sm);
  background: #16192a; color: #e8ecff; font-family: var(--mono); font-size: 14px; line-height: 1.6;
  overflow-x: auto;
}
pre.code code { background: none; border: 0; padding: 0; color: inherit; font-size: inherit; word-break: normal; }

/* Download card */
.dl-card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  overflow: hidden; box-shadow: var(--shadow);
}
.dl-top { padding: 22px 24px 20px; background: var(--accent-soft); border-bottom: 1px solid var(--accent-line); }
.dl-kicker { font-size: 13px; font-weight: 700; color: var(--accent-text); letter-spacing: 0.02em; }
.dl-title { font-size: 20px; font-weight: 800; margin-top: 4px; }
.dl-version { display: inline-block; margin-top: 10px; font-family: var(--mono); font-size: 15px; font-weight: 700; color: var(--ink); background: #fff; border: 1px solid var(--accent-line); border-radius: 8px; padding: 2px 10px; }
.dl-body { padding: 20px 24px 22px; display: grid; gap: 14px; }
.dl-meta { margin: 0; display: grid; gap: 10px; font-size: 14px; }
.dl-meta div { display: grid; gap: 2px; }
.dl-meta dt { color: var(--muted); font-weight: 600; font-size: 13px; }
.dl-meta dd { margin: 0; color: var(--ink); font-weight: 600; }
.dl-note { font-size: 13px; color: var(--muted); }
.noscript-note { font-size: 13px; color: #9d1f2a; }

/* In-page TOC */
.toc { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; }
.toc-title { font-size: 13px; font-weight: 700; color: var(--muted); margin-bottom: 8px; }
.toc ol { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.toc a { display: block; padding: 5px 10px; margin: 0 -10px; border-radius: 8px; color: var(--ink-2); text-decoration: none; font-weight: 600; font-size: 15px; }
.toc a:hover { background: var(--accent-soft); color: var(--ink); }

/* Test notice (라어히) */
.test-notice {
  background: var(--card); border: 2px solid var(--lah-ink); border-radius: var(--radius);
  padding: 22px 28px; box-shadow: 5px 5px 0 var(--lah-ink);
  margin-bottom: 40px; scroll-margin-top: 88px;
}
.test-notice h2 { font-size: 21px; font-weight: 800; display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.test-notice ul { margin-top: 10px; }
.test-notice li { color: var(--ink-2); }

/* Requirements grid */
.req-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.req {
  border: 1px solid var(--accent-line); background: var(--accent-soft);
  border-radius: var(--radius-sm); padding: 16px;
}
.req svg { color: var(--lah-ink); }
.req strong { display: block; margin-top: 8px; font-size: 16px; }
.req span { display: block; font-size: 14px; color: var(--ink-2); margin-top: 2px; }

/* Scope table */
.scope-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.scope { border-radius: var(--radius-sm); padding: 16px 18px; border: 1px solid var(--line); }
.scope h3 { font-size: 15px; font-weight: 800; margin-bottom: 8px; }
.scope-in { background: #eef8f0; border-color: #c4e3cb; }
.scope-in h3 { color: #1d6b33; }
.scope-out { background: #f4f3ee; }
.scope-out h3 { color: var(--ink-2); }
.scope .list { font-size: 15px; }

/* ---------- Responsive ---------- */

@media (max-width: 960px) {
  .layout { grid-template-columns: minmax(0, 1fr); }
  .layout-aside { position: static; }
  .layout-dl-first .layout-aside { order: -1; }
  .toc { display: none; }
}

@media (max-width: 820px) {
  .game-grid { grid-template-columns: minmax(0, 1fr); }
  .hero-inner { grid-template-columns: minmax(0, 1fr); }
  .hero-av .hero-logo, .hero-lah .hero-logo { order: -1; width: min(80%, 340px); }
  .req-grid { grid-template-columns: minmax(0, 1fr); gap: 10px; }
  .req { display: grid; grid-template-columns: 26px minmax(0, 1fr); column-gap: 14px; align-items: center; padding: 12px 16px; }
  .req svg { grid-row: 1 / 3; }
  .req strong { margin-top: 0; }
  .scope-grid { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 560px) {
  .wrap { padding: 0 16px; }
  .header-inner { height: 58px; gap: 8px; }
  .brand-text { display: none; }
  .nav a { padding: 6px 11px; font-size: 14px; }
  .hub-games { padding-top: 28px; }
  .game-art { height: 190px; }
  .game-art .badge-test { top: 14px; left: 16px; }
  .game-body { padding: 22px 20px 24px; }
  .game-body h2 { font-size: 21px; }
  .hero-inner { padding-top: 32px; padding-bottom: 36px; }
  .hero-inner .lead { font-size: 16px; }
  .hero-actions { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .page-main { padding-top: 32px; }
  .section { padding: 22px 18px; border-radius: 16px; }
  .platform-head h2 { font-size: 23px; }
  .layout + .layout { margin-top: 56px; }
  .steps > li { padding-left: 46px; }
  .test-notice { padding: 20px 18px; margin-bottom: 32px; }
  .test-notice h2 { font-size: 19px; }
  #main { padding-bottom: 64px; }
}
