/* =========================================================
   클래식 바람 가이드북 — 다크 게임 테마 · 태블릿 기준
   ========================================================= */
:root {
  --bg:        #0e1014;
  --bg-2:      #14171e;
  --panel:     #1a1e27;
  --panel-2:   #20242f;
  --line:      #2b303c;
  --line-2:    #3a4150;
  --ink:       #e8e5db;
  --ink-dim:   #a6a99f;
  --ink-mute:  #767a72;
  --gold:      #e6b74d;
  --gold-2:    #f2cf7a;
  --jade:      #57c9a8;
  --blue:      #5aa9e6;
  --red:       #e56a5a;
  --purple:    #b98be6;
  --green:     #6fc06a;
  --radius:    14px;
  --radius-sm: 9px;
  --shadow:    0 6px 22px rgba(0,0,0,.35);
  --maxw:      1120px;
  --head-h:    116px;
  --sans: "Noto Sans KR", system-ui, -apple-system, "Apple SD Gothic Neo", "Malgun Gothic", sans-serif;
  --display: "Gugi", var(--sans);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: calc(var(--head-h) + 12px); }
body {
  margin: 0; font-family: var(--sans); color: var(--ink);
  background:
    radial-gradient(1200px 500px at 80% -10%, rgba(230,183,77,.08), transparent 60%),
    radial-gradient(900px 500px at -10% 10%, rgba(87,201,168,.06), transparent 55%),
    var(--bg);
  line-height: 1.7; font-size: 16px; letter-spacing: -0.01em;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
.wrap { width: 100%; max-width: var(--maxw); margin-inline: auto; padding-inline: 20px; }
.muted { color: var(--ink-mute); }
.skip-link { position: absolute; left: -999px; top: 0; background: var(--gold); color: #1a1205; padding: 8px 14px; z-index: 200; border-radius: 0 0 8px 0; }
.skip-link:focus { left: 0; }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: rgba(14,16,20,.86); backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
.header-inner { display: flex; align-items: center; gap: 16px; height: 64px; }
.brand { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.brand-mark { font-size: 26px; filter: drop-shadow(0 0 10px rgba(230,183,77,.4)); }
.brand-text { display: flex; flex-direction: column; line-height: 1.05; }
.brand-text b { font-family: var(--display); font-size: 19px; letter-spacing: .3px; color: var(--gold-2); }
.brand-text em { font-style: normal; font-size: 11px; color: var(--ink-dim); letter-spacing: 2px; }

.search { position: relative; flex: 1; max-width: 460px; margin-left: auto; }
.search input {
  width: 100%; height: 40px; border-radius: 999px; border: 1px solid var(--line-2);
  background: var(--bg-2); color: var(--ink); padding: 0 16px; font-size: 15px; outline: none;
  transition: border-color .15s, box-shadow .15s;
}
.search input:focus { border-color: var(--gold); box-shadow: 0 0 0 3px rgba(230,183,77,.16); }
.search input::placeholder { color: var(--ink-mute); }
.search-results {
  position: absolute; top: 48px; left: 0; right: 0; max-height: 60vh; overflow-y: auto;
  background: var(--panel); border: 1px solid var(--line-2); border-radius: var(--radius-sm);
  box-shadow: var(--shadow); padding: 6px; z-index: 120;
}
.search-results a { display: flex; gap: 10px; align-items: baseline; padding: 9px 12px; border-radius: 7px; }
.search-results a:hover, .search-results a.hl { background: var(--panel-2); }
.search-results .sr-ic { font-size: 16px; }
.search-results .sr-t { font-weight: 700; }
.search-results .sr-s { color: var(--ink-mute); font-size: 12.5px; margin-left: auto; }
.search-results .sr-empty { padding: 14px; color: var(--ink-mute); text-align: center; }

.nav-toggle { display: none; background: none; border: 1px solid var(--line-2); color: var(--ink); font-size: 20px; width: 42px; height: 40px; border-radius: 9px; cursor: pointer; }

/* ---------- Main nav ---------- */
.mainnav { border-top: 1px solid var(--line); }
.nav-scroll { display: flex; gap: 8px; overflow-x: auto; padding-block: 10px; scrollbar-width: none; }
.nav-scroll::-webkit-scrollbar { display: none; }
.nav-chip {
  flex-shrink: 0; padding: 7px 14px; border-radius: 999px; font-size: 14px; font-weight: 500;
  color: var(--ink-dim); background: var(--panel); border: 1px solid var(--line);
  white-space: nowrap; transition: all .14s;
}
.nav-chip:hover { color: var(--ink); border-color: var(--line-2); }
.nav-chip.is-active { color: #1a1205; background: linear-gradient(180deg, var(--gold-2), var(--gold)); border-color: var(--gold); font-weight: 700; }

/* ---------- Hero ---------- */
main { padding-block: 26px 60px; min-height: 60vh; }
.hero { position: relative; text-align: center; padding: 54px 20px 40px; margin-bottom: 8px; overflow: hidden; }
.hero-glow { position: absolute; inset: -40% 10% auto; height: 340px; background: radial-gradient(closest-side, rgba(230,183,77,.20), transparent 70%); pointer-events: none; }
.hero-inner { position: relative; }
.eyebrow { color: var(--jade); font-weight: 700; letter-spacing: 2px; font-size: 13px; margin: 0 0 12px; }
.hero-title { font-family: var(--display); font-size: clamp(30px, 6vw, 52px); line-height: 1.15; margin: 0; color: var(--ink); }
.hero-title span { color: var(--gold-2); text-shadow: 0 2px 30px rgba(230,183,77,.3); }
.hero-sub { color: var(--ink-dim); font-size: 17px; margin: 16px auto 26px; max-width: 560px; }
.hero-cta { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
.btn { display: inline-flex; align-items: center; gap: 8px; padding: 12px 22px; border-radius: 999px; font-weight: 700; font-size: 15px; border: 1px solid transparent; cursor: pointer; transition: transform .12s, filter .12s; }
.btn:active { transform: translateY(1px); }
.btn-primary { background: linear-gradient(180deg, var(--gold-2), var(--gold)); color: #1a1205; box-shadow: 0 6px 18px rgba(230,183,77,.22); }
.btn-primary:hover { filter: brightness(1.06); }
.btn-ghost { background: var(--panel); border-color: var(--line-2); color: var(--ink); }
.btn-ghost:hover { border-color: var(--gold); }

/* ---------- Sections / cards ---------- */
.section { margin-top: 44px; }
.section-title { font-size: 22px; font-weight: 900; margin: 0 0 18px; display: flex; align-items: center; gap: 8px; }
.card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; }
.menu-card {
  display: flex; align-items: center; gap: 14px; padding: 18px; border-radius: var(--radius);
  background: linear-gradient(180deg, var(--panel), var(--bg-2)); border: 1px solid var(--line);
  transition: transform .14s, border-color .14s, box-shadow .14s;
}
.menu-card:hover { transform: translateY(-3px); border-color: var(--line-2); box-shadow: var(--shadow); }
.menu-card.feature { border-color: rgba(230,183,77,.4); background: linear-gradient(180deg, rgba(230,183,77,.10), var(--bg-2)); }
.mc-icon { font-size: 30px; flex-shrink: 0; }
.mc-body { display: flex; flex-direction: column; min-width: 0; }
.mc-body b { font-size: 16.5px; }
.mc-body em { font-style: normal; color: var(--ink-mute); font-size: 13px; margin-top: 2px; }
.mc-arrow { margin-left: auto; color: var(--ink-mute); font-size: 18px; transition: transform .14s, color .14s; }
.menu-card:hover .mc-arrow { transform: translateX(4px); color: var(--gold); }

.policy-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; }
.policy { background: var(--panel); border: 1px solid var(--line); border-left: 3px solid var(--gold); border-radius: var(--radius-sm); padding: 14px 16px; }
.policy b { color: var(--gold-2); font-size: 15px; }
.policy p { margin: 6px 0 0; color: var(--ink-dim); font-size: 13.5px; line-height: 1.6; }

/* ---------- Doc / page ---------- */
.doc { max-width: 860px; margin-inline: auto; }
.doc-head { margin-bottom: 22px; padding-bottom: 18px; border-bottom: 1px solid var(--line); }
.crumb { color: var(--ink-mute); font-size: 13px; margin: 0 0 10px; }
.crumb a:hover { color: var(--gold); }
.crumb span { margin: 0 6px; }
.doc-title { font-size: clamp(24px, 4vw, 34px); margin: 0; display: flex; align-items: center; gap: 12px; }
.dt-icon { font-size: .9em; }
.doc-sub { color: var(--ink-dim); font-size: 16px; margin: 12px 0 0; }

/* ---------- Prose (markdown) ---------- */
.prose { font-size: 16px; }
.prose h2 { font-size: 22px; margin: 40px 0 14px; padding-top: 8px; border-top: 1px solid var(--line); font-weight: 900; }
.prose h2:first-child { border-top: 0; margin-top: 8px; }
.prose h3 { font-size: 18px; margin: 28px 0 10px; color: var(--gold-2); }
.prose h4 { font-size: 15.5px; margin: 20px 0 8px; color: var(--jade); }
.prose p { margin: 12px 0; color: var(--ink); }
.prose a { color: var(--gold-2); text-decoration: underline; text-underline-offset: 3px; }
.prose ul, .prose ol { padding-left: 22px; margin: 12px 0; }
.prose li { margin: 6px 0; }
.prose li::marker { color: var(--gold); }
.prose strong { color: var(--gold-2); }
.prose code { background: var(--bg-2); border: 1px solid var(--line); border-radius: 5px; padding: 1px 6px; font-size: .9em; color: var(--jade); }
.prose blockquote { margin: 16px 0; padding: 10px 16px; border-left: 3px solid var(--jade); background: var(--panel); border-radius: 0 8px 8px 0; color: var(--ink-dim); }
.prose blockquote p { margin: 4px 0; }
.prose hr { border: 0; border-top: 1px solid var(--line); margin: 30px 0; }
.prose table { width: 100%; border-collapse: collapse; margin: 16px 0; font-size: 14.5px; display: block; overflow-x: auto; }
.prose table thead { background: var(--panel-2); }
.prose th, .prose td { border: 1px solid var(--line); padding: 9px 12px; text-align: left; vertical-align: top; }
.prose th { color: var(--gold-2); font-weight: 700; white-space: nowrap; }
.prose tbody tr:nth-child(even) { background: rgba(255,255,255,.015); }

/* ---------- Dungeons ---------- */
.dungeon-controls { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; justify-content: space-between; margin-bottom: 18px; }
.tier-tabs { display: flex; gap: 6px; flex-wrap: wrap; }
.tier-tab { padding: 8px 16px; border-radius: 999px; background: var(--panel); border: 1px solid var(--line); color: var(--ink-dim); font-weight: 700; font-size: 14px; cursor: pointer; transition: all .14s; }
.tier-tab:hover { color: var(--ink); }
.tier-tab.is-active { color: #14171e; background: var(--ink); border-color: var(--ink); }
.tier-tab.tier-green.is-active { background: var(--green); border-color: var(--green); }
.tier-tab.tier-blue.is-active { background: var(--blue); border-color: var(--blue); }
.tier-tab.tier-red.is-active { background: var(--red); border-color: var(--red); }
.tier-tab.tier-purple.is-active { background: var(--purple); border-color: var(--purple); }
.inline-search { height: 40px; min-width: 220px; flex: 1; max-width: 320px; border-radius: 999px; border: 1px solid var(--line-2); background: var(--bg-2); color: var(--ink); padding: 0 16px; font-size: 15px; outline: none; }
.inline-search:focus { border-color: var(--gold); }

.dungeon-list { display: flex; flex-direction: column; gap: 12px; }
.dungeon { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.dungeon.is-open { border-color: var(--line-2); }
.dungeon-head {
  width: 100%; display: flex; align-items: center; gap: 12px; padding: 15px 18px;
  background: none; border: 0; cursor: pointer; text-align: left; color: var(--ink); font: inherit;
}
.dungeon-head:hover { background: var(--panel-2); }
.dg-badge { flex-shrink: 0; font-size: 11.5px; font-weight: 800; padding: 3px 9px; border-radius: 6px; color: #10131a; }
.dg-badge.tier-green { background: var(--green); }
.dg-badge.tier-blue { background: var(--blue); }
.dg-badge.tier-red { background: var(--red); }
.dg-badge.tier-purple { background: var(--purple); }
.dg-name { font-size: 17px; font-weight: 800; }
.dg-level { font-size: 13px; color: var(--gold-2); font-weight: 700; background: rgba(230,183,77,.12); padding: 2px 9px; border-radius: 6px; }
.dg-region { font-size: 12.5px; color: var(--ink-mute); }
.dg-count { margin-left: auto; font-size: 12.5px; color: var(--ink-dim); background: var(--bg-2); padding: 3px 10px; border-radius: 999px; }
.dg-toggle { color: var(--ink-mute); font-size: 14px; transition: transform .18s; }
.dungeon.is-open .dg-toggle { transform: rotate(180deg); }
.dungeon-body { display: none; padding: 4px 18px 18px; border-top: 1px solid var(--line); }
.dungeon.is-open .dungeon-body { display: block; }
.dg-note { color: var(--ink-dim); font-size: 14px; margin: 12px 0 14px; }

.mob-table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius-sm); }
.mob-table { width: 100%; border-collapse: collapse; font-size: 14px; min-width: 560px; }
.mob-table thead { background: var(--panel-2); }
.mob-table th { text-align: left; padding: 10px 14px; color: var(--gold-2); font-weight: 700; font-size: 13px; white-space: nowrap; }
.mob-table td { padding: 11px 14px; border-top: 1px solid var(--line); vertical-align: middle; }
.mob-table .c-exp, .mob-table .c-hp { white-space: nowrap; color: var(--jade); font-variant-numeric: tabular-nums; width: 90px; }
.mob-table .c-hp { color: var(--red); }
.mob-table tr.is-boss td { background: rgba(185,139,230,.08); }
.c-mob { display: flex; align-items: center; gap: 11px; }
.mob-ic { flex-shrink: 0; width: 34px; height: 34px; border-radius: 8px; display: grid; place-items: center; font-weight: 900; font-size: 16px; color: #12141a; background: var(--c, #c9a24a); box-shadow: inset 0 -2px 6px rgba(0,0,0,.25); }
.mob-meta { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.mob-meta b { font-size: 14.5px; }
.mob-meta em { font-style: normal; color: var(--ink-mute); font-size: 12.5px; }
.tag { display: inline-block; font-size: 10.5px; font-weight: 800; padding: 1px 7px; border-radius: 5px; vertical-align: middle; }
.tag-boss { background: var(--purple); color: #16101f; }
.tag-aggro { background: rgba(229,106,90,.18); color: var(--red); border: 1px solid rgba(229,106,90,.4); }
.tag-calm { background: rgba(111,192,106,.15); color: var(--green); border: 1px solid rgba(111,192,106,.35); }
.drop-list { display: flex; flex-wrap: wrap; gap: 5px; }
.drop-chip { font-size: 12px; background: var(--bg-2); border: 1px solid var(--line-2); color: var(--ink-dim); padding: 2px 9px; border-radius: 6px; white-space: nowrap; }
.no-results { text-align: center; color: var(--ink-mute); padding: 40px; }

/* ---------- Footer ---------- */
.site-footer { border-top: 1px solid var(--line); margin-top: 60px; padding: 30px 0 44px; }
.site-footer p { margin: 4px 0; font-size: 13.5px; }
.site-footer b { color: var(--gold-2); }

/* ---------- 404 ---------- */
.err { text-align: center; padding: 80px 20px; }
.err h1 { font-size: 72px; font-family: var(--display); color: var(--gold-2); margin: 0; }
.err p { color: var(--ink-dim); font-size: 18px; }

/* ---------- Responsive: 태블릿 기준 → 모바일 ---------- */
@media (max-width: 720px) {
  :root { --head-h: 108px; }
  body { font-size: 15.5px; }
  .header-inner { gap: 10px; }
  .brand-text em { display: none; }
  .search { max-width: none; }
  .nav-toggle { display: block; }
  .mainnav { position: fixed; inset: var(--head-h-real, 64px) 0 auto; top: 64px; background: var(--bg); display: none; border-bottom: 1px solid var(--line); }
  .mainnav.open { display: block; }
  .nav-scroll { flex-wrap: wrap; padding-block: 14px; }
  .dungeon-controls { flex-direction: column; align-items: stretch; }
  .inline-search { max-width: none; }
  .c-mob { min-width: 200px; }
}
@media (min-width: 721px) and (max-width: 1024px) {
  /* 태블릿 최적 폭 */
  .card-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (hover: none) {
  .menu-card:hover { transform: none; }
}

/* ---------- 인게임 웹뷰 임베드 모드 (?embed=1) ---------- */
body.embed .site-footer { display: none; }
body.embed .hero { padding: 30px 16px 22px; }
body.embed .hero-title { font-size: clamp(26px, 5vw, 40px); }
body.embed main { padding-block: 16px 28px; }
body.embed .hero-sub { margin-bottom: 16px; }
body.embed .section { margin-top: 32px; }
/* 임베드 창은 대개 좁으므로 카드 2열 기준 유지 */
body.embed .card-grid { grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
