/*
  Zombie Stair guide pages (public/*.html): the one shared stylesheet.
  Matches the title screen in src/pages/Home.jsx: Black Han Sans headings, Pretendard body text,
  the HOME_BASE_BG gradient, bone text, cut-corner panels and chips, and the red Start button.
  Section panels: the small inline script at the end of every page groups each h2 of <main> and
  the elements after it into <section class="panel">. The page text itself is not touched.
*/
:root {
  --bhs: "Black Han Sans", "Pretendard", "Apple SD Gothic Neo", "Malgun Gothic", sans-serif;
  --body: "Pretendard", -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", "Malgun Gothic", "Noto Sans KR", "Segoe UI", Roboto, sans-serif;
  --bone: #E8DFC8;
  --muted: #A8AC9F;
  --lime: #A3E635;
  --lime-hi: #D4FA6E;
  --toxic: #9BC53D;
  --gold: #C9A45C;
  --yellow: #FACC15;
  --chip-bg: rgba(14, 20, 17, 0.9);
  --chip-border: rgba(232, 223, 200, 0.15);
  --cut-sm: polygon(6px 0, 100% 0, 100% calc(100% - 6px), calc(100% - 6px) 100%, 0 100%, 0 6px);
  --cut-md: polygon(10px 0, 100% 0, 100% calc(100% - 10px), calc(100% - 10px) 100%, 0 100%, 0 10px);
  --cut-lg: polygon(14px 0, 100% 0, 100% calc(100% - 14px), calc(100% - 14px) 100%, 0 100%, 0 14px);
}
*, *::before, *::after { box-sizing: border-box; }
html {
  background-color: #07090A;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}
body {
  margin: 0;
  min-height: 100vh;
  background-color: #07090A;
  background-image:
    radial-gradient(120% 55% at 50% 112%, rgba(179, 18, 27, 0.32), transparent 62%),
    radial-gradient(90% 45% at 50% -5%, rgba(94, 122, 74, 0.22), transparent 70%),
    linear-gradient(180deg, #18211B 0%, #0E1411 35%, #07090A 70%, #040505 100%);
  background-attachment: fixed;
  background-repeat: no-repeat;
  color: var(--bone);
  font-family: var(--body);
  font-size: 17px;
  line-height: 1.8;
  word-break: keep-all;
  overflow-wrap: anywhere;
}
img { max-width: 100%; height: auto; }
a { color: var(--lime); }
a:focus-visible, button:focus-visible, summary:focus-visible {
  outline: 2px solid var(--yellow);
  outline-offset: -2px;
}
.skip-link {
  position: absolute; left: 8px; top: -200px; z-index: 30;
  display: inline-flex; align-items: center; min-height: 44px; padding: 10px 14px;
  background: var(--yellow); color: #07090A; font-family: var(--bhs); font-weight: 400;
  text-decoration: none; white-space: nowrap;
}
.skip-link:focus { top: calc(env(safe-area-inset-top) + 8px); }
/* ── Header ─────────────────────────────────────────── */
.site-header {
  position: sticky; top: 0; z-index: 20;
  background: rgba(7, 9, 10, 0.88);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid rgba(232, 223, 200, 0.12);
  padding: calc(env(safe-area-inset-top) + 10px) max(env(safe-area-inset-right), 16px) 10px max(env(safe-area-inset-left), 16px);
}
.site-header .bar {
  max-width: 760px; margin: 0 auto;
  display: flex; align-items: center; gap: 8px;
}
/* The logo is the only part that shrinks when the row is tight. */
.brand {
  display: block; flex: 0 1 auto; min-width: 0;
  padding: 4px 0; text-decoration: none;
}
.brand img {
  display: block; height: 36px; width: auto; max-width: 100%;
  object-fit: contain; object-position: left center;
}
.header-actions {
  flex: none; margin-left: auto;
  display: flex; align-items: center; gap: 8px;
}
.lang-switch {
  display: flex;
  background: var(--chip-bg);
  border: 1px solid var(--chip-border);
  clip-path: var(--cut-sm);
}
.lang-switch a {
  display: inline-flex; align-items: center; min-height: 44px; padding: 8px 12px;
  font-family: var(--bhs); font-weight: 400; font-size: 13px; line-height: 1;
  color: var(--bone); text-decoration: none; white-space: nowrap;
}
.lang-switch a:hover { color: #FFF5F0; background: rgba(155, 197, 61, 0.1); }
.lang-switch a[aria-current] { color: var(--lime-hi); background: rgba(155, 197, 61, 0.18); }
.btn-play {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 44px; padding: 10px 16px;
  font-family: var(--bhs); font-weight: 400; font-size: 16px; line-height: 1;
  color: #FFF5F0; text-decoration: none; white-space: nowrap;
  background: linear-gradient(180deg, #D0202A, #B3121B 55%, #5C070C);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.25), inset 0 -3px 0 rgba(0, 0, 0, 0.35);
  text-shadow: 0 2px 0 rgba(0, 0, 0, 0.4);
  clip-path: var(--cut-md);
}
.btn-play:hover { color: #FFF5F0; filter: brightness(1.1); }
.btn-play:active { transform: translateY(1px); }
/* ── Guide nav: cut-corner chips ───────────────────── */
.guide-nav {
  background: rgba(7, 9, 10, 0.55);
  border-bottom: 1px solid rgba(232, 223, 200, 0.08);
  padding: 0 max(env(safe-area-inset-right), 10px) 0 max(env(safe-area-inset-left), 10px);
}
.guide-nav ul {
  list-style: none; margin: 0 auto; max-width: 760px;
  padding: 6px;
  display: flex; gap: 6px;
  overflow-x: auto; -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.guide-nav ul::-webkit-scrollbar { display: none; }
.guide-nav li { flex: none; margin: 0; }
.guide-nav a {
  display: inline-flex; align-items: center; min-height: 40px; padding: 8px 14px;
  font-family: var(--bhs); font-weight: 400; font-size: 14px; line-height: 1.2;
  color: var(--bone); text-decoration: none; white-space: nowrap;
  background: var(--chip-bg);
  border: 1px solid var(--chip-border);
  clip-path: var(--cut-sm);
}
.guide-nav a:hover { color: #FFF5F0; border-color: rgba(155, 197, 61, 0.5); }
.guide-nav a[aria-current="page"] {
  color: var(--lime-hi);
  background: rgba(155, 197, 61, 0.18);
  border-color: var(--toxic);
}
/* ── Main + text ───────────────────────────────────── */
main {
  display: block; max-width: 760px; margin: 0 auto;
  padding: 24px max(env(safe-area-inset-right), 16px) calc(env(safe-area-inset-bottom) + 48px) max(env(safe-area-inset-left), 16px);
}
main a { text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px; }
main a:hover { color: var(--lime-hi); }
h1 {
  font-family: var(--bhs); font-weight: 400;
  color: var(--yellow); text-shadow: 0 2px 0 rgba(0, 0, 0, 0.45);
  font-size: 30px; line-height: 1.3; margin: 8px 0 16px;
}
h2 {
  font-family: var(--bhs); font-weight: 400;
  color: var(--bone); font-size: 22px; line-height: 1.35;
  margin: 36px 0 12px; padding: 2px 0 2px 12px;
  border-left: 4px solid var(--toxic);
}
h3 {
  font-family: var(--bhs); font-weight: 400;
  color: var(--gold); font-size: 18px; line-height: 1.4;
  margin: 24px 0 8px;
}
p { margin: 0 0 14px; }
ul, ol { margin: 0 0 14px; padding-left: 22px; }
li { margin: 6px 0; }
li::marker { color: var(--toxic); }
strong { color: #FFF5F0; }
.lead { font-size: 18px; color: var(--bone); }
.muted { color: var(--muted); font-size: 15px; }
code, .formula {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 15px; color: var(--lime);
}
/* ── Panels (each h2 group, FAQ sections, update cards, read next) ── */
main > section, main > article, .panel, .card {
  margin: 16px 0; padding: 20px;
  background: linear-gradient(180deg, rgba(20, 33, 24, 0.92), rgba(10, 17, 11, 0.92));
  border: 1px solid rgba(163, 230, 53, 0.18);
  clip-path: var(--cut-lg);
}
main > section > :first-child, main > article > :first-child { margin-top: 0; }
main > section > :last-child, main > article > :last-child { margin-bottom: 0; }
main > section > h2:first-child { margin-top: 0; }
main > article h2 { margin-top: 8px; }
.qa h3 { margin-top: 24px; }
/* ── Tip and warning boxes (badge text comes from CSS, not from the page text) ── */
.note {
  margin: 16px 0; padding: 14px 16px;
  border-left: 4px solid var(--toxic);
  background: rgba(155, 197, 61, 0.08);
}
.note::before {
  content: "TIP";
  display: inline-block; margin: 0 0 8px; padding: 2px 8px;
  font-family: var(--bhs); font-weight: 400; font-size: 12px; line-height: 1.4; letter-spacing: 0.06em;
  color: #132205; background: var(--lime);
}
.note > :last-child { margin-bottom: 0; }
.note.warn { border-left-color: #D0202A; background: rgba(208, 32, 42, 0.1); }
.note.warn::before { content: "WATCH OUT"; color: #FFF5F0; background: #B3121B; }
html[lang="ko"] .note.warn::before { content: "주의"; }
/* ── Keyboard keys ─────────────────────────────────── */
kbd {
  display: inline-block;
  font-family: var(--bhs); font-weight: 400; font-size: 14px; line-height: 1.4;
  color: var(--bone); background: #16221A;
  border: 1px solid rgba(163, 230, 53, 0.45);
  border-bottom: 3px solid rgba(0, 0, 0, 0.6);
  border-radius: 8px; padding: 2px 8px;
}
/* ── Tables: the wrapper scrolls, the page never does ── */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; padding: 2px; margin: 16px 0 20px; }
table { width: 100%; border-collapse: collapse; font-size: 15px; line-height: 1.6; }
caption { caption-side: top; text-align: left; color: var(--muted); font-size: 14px; padding: 0 0 8px; }
th, td {
  padding: 10px 12px; text-align: left; vertical-align: top;
  border-bottom: 1px solid rgba(232, 223, 200, 0.1);
}
th {
  font-family: var(--bhs); font-weight: 400; font-size: 14px;
  color: var(--lime-hi); background: rgba(155, 197, 61, 0.12);
  white-space: nowrap;
}
td.num { text-align: right; font-variant-numeric: tabular-nums; color: var(--lime); }
td.keys { white-space: nowrap; }
/* ── Figures ───────────────────────────────────────── */
figure { margin: 20px 0; }
.hero img {
  display: block; width: 100%; height: auto;
  border: 1px solid rgba(163, 230, 53, 0.18);
  clip-path: var(--cut-lg);
}
figcaption { margin-top: 8px; color: var(--muted); font-size: 14px; }
.tag {
  display: inline-block; padding: 4px 10px;
  font-family: var(--bhs); font-weight: 400; font-size: 13px; line-height: 1.3;
  color: var(--gold); background: rgba(201, 164, 92, 0.14);
  border: 1px solid rgba(201, 164, 92, 0.4);
  clip-path: var(--cut-sm); white-space: nowrap;
}
/* ── Hub: large logo + guide cards ─────────────────── */
.hub-logo { max-width: 480px; margin: 8px auto 12px; }
.hub-logo img { display: block; width: 100%; height: auto; }
.guide-list {
  list-style: none; padding: 0; margin: 0;
  display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px;
}
.guide-list li {
  position: relative; margin: 0;
  padding: 16px 44px 16px 16px;
  background: var(--chip-bg);
  border: 1px solid var(--chip-border);
  clip-path: var(--cut-md);
}
.guide-list li::after {
  content: "→"; position: absolute; top: 14px; right: 16px;
  color: var(--gold); font-family: var(--bhs); font-size: 18px; line-height: 1.35;
}
.guide-list a {
  font-family: var(--bhs); font-weight: 400; font-size: 18px; line-height: 1.35;
  color: var(--bone); text-decoration: none;
}
/* The whole card is the link. */
.guide-list a::before { content: ""; position: absolute; inset: 0; }
.guide-list a:hover { color: var(--bone); }
.guide-list p { margin: 6px 0 0; font-size: 15px; line-height: 1.6; color: var(--muted); }
.guide-list li:hover {
  border-color: var(--toxic);
  box-shadow: inset 0 0 18px rgba(163, 230, 53, 0.18);
}
.guide-list li:has(a:focus-visible) { outline: 2px solid var(--yellow); outline-offset: -2px; }
.guide-list li:has(a:focus-visible) a:focus-visible { outline: none; }
/* ── Read next: the same cards ─────────────────────── */
.read-next h2 { font-size: 20px; }
.read-next ul {
  list-style: none; margin: 0; padding: 0;
  display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px;
}
.read-next li { margin: 0; }
.read-next a {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  min-height: 56px; padding: 14px 16px;
  font-family: var(--bhs); font-weight: 400; font-size: 18px; line-height: 1.35;
  color: var(--bone); text-decoration: none;
  background: var(--chip-bg);
  border: 1px solid var(--chip-border);
  clip-path: var(--cut-md);
}
.read-next a::after { content: "→"; flex: none; color: var(--gold); }
.read-next a:hover {
  color: var(--bone);
  border-color: var(--toxic);
  box-shadow: inset 0 0 18px rgba(163, 230, 53, 0.18);
}
/* ── Footer ────────────────────────────────────────── */
.site-footer {
  background: rgba(0, 0, 0, 0.45);
  border-top: 1px solid rgba(232, 223, 200, 0.1);
  color: var(--muted);
  padding: 20px max(env(safe-area-inset-right), 16px) calc(env(safe-area-inset-bottom) + 24px) max(env(safe-area-inset-left), 16px);
}
.site-footer ul {
  list-style: none; margin: 0 auto 8px; padding: 0; max-width: 760px;
  display: flex; flex-wrap: wrap; gap: 4px 8px;
}
.site-footer li { margin: 0; }
.site-footer li::marker { content: none; }
.site-footer a {
  display: inline-flex; align-items: center; min-height: 44px; padding: 8px;
  color: var(--gold); text-decoration: none; white-space: nowrap;
}
.site-footer a:hover { color: #E8CB86; text-decoration: underline; text-underline-offset: 3px; }
.site-footer p { max-width: 760px; margin: 0 auto; padding: 0 8px; font-size: 14px; }
/* ── Breakpoints ───────────────────────────────────── */
@media (min-width: 600px) {
  .brand img { height: 44px; }
  .guide-list, .read-next ul { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (min-width: 768px) {
  h1 { font-size: 38px; }
  h2 { font-size: 24px; }
}
@media (min-width: 900px) {
  .guide-nav ul { flex-wrap: wrap; overflow-x: visible; }
}
@media (prefers-reduced-motion: no-preference) {
  .btn-play, .lang-switch a, .guide-nav a, .guide-list li, .read-next a, .site-footer a {
    transition: filter 0.15s, transform 0.1s, border-color 0.15s, box-shadow 0.15s, background-color 0.15s, color 0.15s;
  }
}