:root {
  --bg: #14100e;
  --panel: #1e1815;
  --line: #3a2f28;
  --text: #e8e0d4;
  --muted: #a2958a;
  --gold: #d8b45a;
  --link: #e0c070;
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Pretendard", -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo",
    "Malgun Gothic", "Noto Sans KR", sans-serif;
  font-size: 16px;
  line-height: 1.75;
  word-break: keep-all;
  overflow-wrap: anywhere;
}

.wrap {
  max-width: 820px;
  margin: 0 auto;
  padding: 32px 20px 80px;
}

.doc-head { margin-bottom: 32px; }

.crumb {
  margin: 0 0 8px;
  font-size: 14px;
  letter-spacing: 0.08em;
  color: var(--muted);
}

h1 {
  margin: 0 0 6px;
  font-size: 30px;
  line-height: 1.3;
  color: var(--gold);
}

h2 {
  margin: 44px 0 14px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--line);
  font-size: 21px;
  color: var(--gold);
}

h3 {
  margin: 28px 0 10px;
  font-size: 17px;
  color: var(--text);
}

p { margin: 0 0 14px; }

ul, ol { margin: 0 0 16px; padding-left: 22px; }
li { margin-bottom: 6px; }

a { color: var(--link); }
a:hover { color: #fff; }

code {
  padding: 1px 5px;
  border-radius: 3px;
  background: #2a221d;
  font-size: 0.9em;
}

.meta { font-size: 14px; color: var(--muted); }

.note {
  padding: 12px 16px;
  border-left: 3px solid var(--gold);
  background: var(--panel);
  font-size: 15px;
  color: var(--muted);
}

/* 표는 좁은 화면에서 가로 스크롤 — 본문은 절대 가로로 밀리지 않는다 */
.tw {
  margin: 0 0 20px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

table {
  width: 100%;
  min-width: 460px;
  border-collapse: collapse;
  font-size: 15px;
}

th, td {
  padding: 10px 12px;
  border: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

th {
  background: var(--panel);
  color: var(--gold);
  font-weight: 600;
  white-space: nowrap;
}

hr {
  margin: 44px 0 20px;
  border: 0;
  border-top: 1px solid var(--line);
}

/* index.html 링크 카드 */
.cards {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  margin: 24px 0 0;
  padding: 0;
  list-style: none;
}

.cards a {
  display: block;
  padding: 18px 20px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  text-decoration: none;
  color: var(--text);
}

.cards a:hover { border-color: var(--gold); }
.cards strong { display: block; margin-bottom: 4px; color: var(--gold); }
.cards span { font-size: 14px; color: var(--muted); }

.steps { counter-reset: s; }

@media (max-width: 520px) {
  .wrap { padding: 24px 16px 64px; }
  h1 { font-size: 25px; }
  h2 { font-size: 19px; }
}

/* probability.html */
.toc { margin: 0 0 8px; padding-left: 22px; }
.toc a { text-decoration: none; }

caption {
  padding-bottom: 8px;
  font-size: 14px;
  color: var(--muted);
  text-align: left;
  caption-side: top;
}

.prob-table td:not(:first-child) { text-align: right; font-variant-numeric: tabular-nums; }

.cav {
  margin: 0 0 8px;
  font-size: 14px;
  line-height: 1.7;
  color: var(--muted);
}

section { margin-bottom: 8px; }

/* 남쪽게임 공식 홈페이지 */
.home {
  --home-bg: #090807;
  --home-panel: #15110f;
  --home-panel-soft: #1b1512;
  --home-gold: #d7ad51;
  --home-gold-light: #f0d58f;
  --home-text: #f2eee8;
  --home-muted: #b8ada3;
  background:
    radial-gradient(circle at 50% -10%, rgba(126, 43, 25, 0.25), transparent 35%),
    var(--home-bg);
  color: var(--home-text);
}

.home a { color: inherit; }

.site-header {
  position: absolute;
  z-index: 10;
  top: 0;
  left: 50%;
  display: flex;
  width: min(1180px, calc(100% - 48px));
  height: 88px;
  align-items: center;
  justify-content: space-between;
  transform: translateX(-50%);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  font-weight: 800;
  letter-spacing: -0.03em;
}

.brand img {
  width: 46px;
  height: 46px;
  border: 1px solid rgba(240, 213, 143, 0.42);
  border-radius: 12px;
  object-fit: cover;
}

.brand span { line-height: 1.1; }

.brand small {
  display: block;
  margin-top: 4px;
  color: var(--home-gold-light);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.18em;
}

.site-header nav { display: flex; gap: 30px; }

.site-header nav a {
  color: rgba(255, 255, 255, 0.78);
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
}

.site-header nav a:hover { color: #fff; }

.hero {
  position: relative;
  display: grid;
  min-height: 760px;
  align-items: end;
  overflow: hidden;
}

.hero-image,
.hero-shade {
  position: absolute;
  inset: 0;
}

.hero-image {
  background-image: url("dungeon-archer-hero.jpg");
  background-position: 58% 42%;
  background-size: cover;
  transform: scale(1.02);
}

.hero-shade {
  background:
    linear-gradient(90deg, rgba(4, 3, 3, 0.96) 0%, rgba(7, 5, 4, 0.78) 38%, rgba(7, 5, 4, 0.14) 70%),
    linear-gradient(0deg, var(--home-bg) 0%, transparent 35%, rgba(0, 0, 0, 0.35) 100%);
}

.hero-content {
  position: relative;
  z-index: 2;
  width: min(1180px, calc(100% - 48px));
  margin: 0 auto;
  padding: 170px 0 116px;
}

.eyebrow,
.section-kicker {
  margin: 0 0 16px;
  color: var(--home-gold-light);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.2em;
}

.hero h1 {
  max-width: 720px;
  margin: 0 0 24px;
  color: #fff;
  font-family: Georgia, "Noto Serif KR", serif;
  font-size: clamp(44px, 6.2vw, 78px);
  font-weight: 700;
  line-height: 1.17;
  letter-spacing: -0.055em;
  text-shadow: 0 8px 28px rgba(0, 0, 0, 0.48);
}

.hero-content > p:not(.eyebrow) {
  max-width: 570px;
  margin-bottom: 34px;
  color: rgba(255, 255, 255, 0.8);
  font-size: 18px;
  line-height: 1.8;
}

.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; }

.button {
  display: inline-flex;
  min-height: 50px;
  align-items: center;
  justify-content: center;
  padding: 0 24px;
  border: 1px solid transparent;
  border-radius: 3px;
  font-size: 14px;
  font-weight: 700;
  text-decoration: none;
  transition: transform 160ms ease, background 160ms ease, border-color 160ms ease;
}

.button:hover { transform: translateY(-2px); }

.button-primary {
  background: var(--home-gold);
  color: #17100a !important;
}

.button-primary:hover { background: var(--home-gold-light); }

.button-ghost {
  border-color: rgba(255, 255, 255, 0.35);
  background: rgba(0, 0, 0, 0.2);
  color: #fff !important;
  backdrop-filter: blur(8px);
}

.button-ghost:hover { border-color: rgba(255, 255, 255, 0.8); }

.home-section,
.game-feature,
.company-section,
.site-footer {
  width: min(1120px, calc(100% - 48px));
  margin-right: auto;
  margin-left: auto;
}

.home-section { padding: 116px 0; }

.home h2 {
  margin: 0 0 18px;
  padding: 0;
  border: 0;
  color: var(--home-text);
  font-family: Georgia, "Noto Serif KR", serif;
  font-size: clamp(32px, 4.5vw, 52px);
  line-height: 1.25;
  letter-spacing: -0.04em;
}

.section-lead {
  max-width: 680px;
  color: var(--home-muted);
  font-size: 17px;
}

.value-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
  margin-top: 54px;
}

.value-grid article {
  min-height: 250px;
  padding: 34px 30px;
  border: 1px solid #2e2722;
  background: linear-gradient(145deg, var(--home-panel-soft), #110e0c);
}

.value-grid article > span {
  color: var(--home-gold);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.15em;
}

.value-grid h3 {
  margin: 46px 0 12px;
  color: #fff;
  font-size: 21px;
}

.value-grid p { color: var(--home-muted); font-size: 15px; }

.game-feature {
  display: grid;
  grid-template-columns: 1fr minmax(260px, 400px);
  gap: 80px;
  align-items: center;
  padding: 96px;
  border: 1px solid #382b23;
  background:
    radial-gradient(circle at 85% 40%, rgba(142, 48, 28, 0.28), transparent 38%),
    linear-gradient(135deg, #1d1713, #0f0d0b);
}

.game-feature > img {
  width: 100%;
  max-width: 390px;
  border: 1px solid rgba(215, 173, 81, 0.3);
  border-radius: 24px;
  box-shadow: 0 26px 70px rgba(0, 0, 0, 0.45);
}

.game-copy > p:not(.section-kicker) { color: var(--home-muted); }

.game-facts,
.company-info { margin: 36px 0 0; }

.game-facts div,
.company-info div {
  display: grid;
  grid-template-columns: 130px 1fr;
  gap: 20px;
  padding: 13px 0;
  border-top: 1px solid #332a25;
}

.game-facts dt,
.company-info dt { color: var(--home-muted); font-size: 13px; }

.game-facts dd,
.company-info dd { margin: 0; color: var(--home-text); }

.game-facts a {
  color: var(--home-gold-light);
  font-weight: 700;
  text-decoration: none;
}

.game-facts a:hover { color: #fff; }

.policy-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
  margin: 48px 0 0;
  padding: 0;
  list-style: none;
}

.policy-grid li { margin: 0; }

.policy-grid a {
  position: relative;
  display: block;
  min-height: 142px;
  padding: 30px 58px 30px 30px;
  border: 1px solid #302721;
  background: var(--home-panel);
  text-decoration: none;
}

.policy-grid a::after {
  position: absolute;
  top: 50%;
  right: 28px;
  color: var(--home-gold);
  content: "→";
  transform: translateY(-50%);
}

.policy-grid a:hover { border-color: var(--home-gold); }

.policy-grid strong { display: block; margin-bottom: 8px; color: #fff; }
.policy-grid span { color: var(--home-muted); font-size: 14px; }

.company-section {
  display: grid;
  grid-template-columns: minmax(260px, 0.8fr) 1.2fr;
  gap: 90px;
  margin-bottom: 110px;
  padding: 72px;
  border-top: 1px solid #3a2d25;
  border-bottom: 1px solid #3a2d25;
  background: rgba(29, 22, 18, 0.48);
}

.company-section > div > p:last-child { color: var(--home-muted); }
.company-info { margin-top: 0; }
.company-info a { color: var(--home-gold-light); }

.site-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 28px 0 50px;
  border-top: 1px solid #2a231f;
  color: #8e837a;
  font-size: 13px;
}

.site-footer p { margin: 0; }
.site-footer a { margin-left: 20px; color: #aaa096; }

@media (max-width: 820px) {
  .site-header { width: calc(100% - 32px); }
  .site-header nav { gap: 16px; }
  .site-header nav a:nth-child(-n+2) { display: none; }
  .hero { min-height: 700px; }
  .hero-content { width: calc(100% - 32px); padding-bottom: 82px; }
  .hero-shade {
    background:
      linear-gradient(90deg, rgba(4, 3, 3, 0.9), rgba(4, 3, 3, 0.35)),
      linear-gradient(0deg, var(--home-bg), transparent 60%);
  }
  .home-section,
  .game-feature,
  .company-section,
  .site-footer { width: calc(100% - 32px); }
  .value-grid { grid-template-columns: 1fr; }
  .value-grid article { min-height: 0; }
  .value-grid h3 { margin-top: 24px; }
  .game-feature { grid-template-columns: 1fr; gap: 46px; padding: 54px 38px; }
  .game-feature > img { max-width: 320px; }
  .company-section { grid-template-columns: 1fr; gap: 32px; padding: 50px 38px; }
}

@media (max-width: 560px) {
  .brand img { width: 40px; height: 40px; }
  .site-header nav a { font-size: 13px; }
  .hero { min-height: 680px; }
  .hero-image { background-position: 64% center; }
  .hero-content { padding-bottom: 66px; }
  .hero h1 { font-size: 42px; }
  .hero-content > p:not(.eyebrow) { font-size: 16px; }
  .home-section { padding: 82px 0; }
  .policy-grid { grid-template-columns: 1fr; }
  .game-feature { padding: 42px 24px; }
  .game-facts div,
  .company-info div { grid-template-columns: 105px 1fr; gap: 12px; }
  .company-section { padding: 40px 22px; }
  .site-footer { display: block; }
  .site-footer p + p { margin-top: 10px; }
  .site-footer a { margin: 0 16px 0 0; }
}
