/* 페이븐 위키 — 게임 화면(client/ui/theme.css)과 같은 결: 먹색 바탕 · 가는 테두리 · 금빛 수치 · 조수 청 선택 · 거의 직각 모서리 · 모닥불 불빛 */
:root {
  --bg: #0a0b0e;
  --s1: #111318;
  --s2: #171a20;
  --s3: #20242b;
  --s4: #2a2f38;
  --line: rgba(255, 255, 255, .09);
  --line-2: rgba(255, 255, 255, .15);
  --text: #ecebe6;
  --sub: #c3c4c7;
  --muted: #8f939b;
  --gold: #e8c66e;
  --gold-2: #c9a457;
  --gold-soft: rgba(232, 198, 110, .12);
  --ember: #f08a3c;
  --sel: #6fb3dc;
  --sel-soft: rgba(111, 179, 220, .14);
  --accent: #c9a457;
  --accent-text: #e8c66e;
  --accent-soft: rgba(232, 198, 110, .12);
  --good: #5fc77a;
  --bad: #e5575c;
  --r-common: #b8b8b8;
  --r-rare: #4fbf5a;
  --r-saga: #4f8fd1;
  --r-epic: #9a5fd6;
  --r-legendary: #e0862e;
  --r-unique: #f0c64a;
  --r-absolute: #ff4d4d;
  --btn-gold: linear-gradient(180deg, #a27c3b, #7d5b29 52%, #62461c);
  --radius: 4px;
  --radius-lg: 6px;
  --top: 64px;
  --font: 'Pretendard Variable', Pretendard, -apple-system, BlinkMacSystemFont, system-ui, 'Apple SD Gothic Neo', 'Malgun Gothic', sans-serif;
  --display: 'Hahmlet', 'Noto Serif KR', 'AppleMyungjo', serif;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html { background: var(--bg); scroll-padding-top: calc(var(--top) + 72px); scrollbar-color: #343841 transparent; }
body { margin: 0; font: 16px/1.72 var(--font); color: var(--sub); background: var(--bg); -webkit-font-smoothing: antialiased; word-break: keep-all; overflow-wrap: anywhere; }
/* 바탕: 위쪽에 아주 옅은 모닥불 빛 */
body::before { content: ''; position: fixed; inset: 0; z-index: -1; pointer-events: none; background: radial-gradient(1200px 520px at 70% -180px, rgba(240, 138, 60, .07), transparent 70%), radial-gradient(900px 600px at -10% 110%, rgba(111, 179, 220, .04), transparent 70%); }
a { color: var(--accent-text); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
b, strong { color: var(--text); font-weight: 700; }
:focus-visible { outline: 2px solid var(--sel); outline-offset: 2px; border-radius: 3px; }
::selection { background: rgba(111, 179, 220, .35); color: #fff; }
.i { width: 20px; height: 20px; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.skip { position: absolute; left: -999px; top: 8px; z-index: 60; background: var(--btn-gold); color: #fff6e0; padding: 8px 14px; border-radius: var(--radius); }
.skip:focus { left: 8px; }
h1, h2, h3 { color: var(--text); line-height: 1.3; margin: 0 0 .5em; letter-spacing: -0.01em; }
h1, h2 { font-family: var(--display); font-weight: 700; }
h1 { font-size: 34px; }
h2 { font-size: 24px; margin: 56px 0 16px; }
/* 문서 절: 위에 선 + 금빛 마름모. 긴 문서도 절이 바뀌는 곳이 한눈에 보인다 */
main > h2 { position: relative; padding-top: 28px; border-top: 1px solid var(--line); display: flex; align-items: center; gap: 10px; }
main > h2::before { content: ''; flex: none; width: 9px; height: 9px; transform: rotate(45deg); background: var(--gold); box-shadow: 0 0 10px rgba(232, 198, 110, .55); }
main > .page-head + h2, main > .toc + h2 { border-top: 0; padding-top: 0; margin-top: 8px; }
h2 .anchor { margin-left: 4px; display: inline-grid; place-items: center; width: 30px; height: 30px; border-radius: var(--radius); color: var(--muted); opacity: 0; transition: opacity .15s; }
h2:hover .anchor, h2 .anchor:focus-visible { opacity: 1; }
@media (hover: none) { h2 .anchor { opacity: .7; } }
h2 .anchor:hover { color: var(--gold); background: var(--s2); text-decoration: none; }
h2 .anchor .i { width: 16px; height: 16px; }
/* 본문 줄 길이: 한 줄 약 45자 안팎이 읽기 편하다(표·카드 격자는 넓게 그대로) */
main > p, main > ul, main > ol, .card > p, .card > ul, .card > ol, .note > div { max-width: 46em; }
h3 { font-size: 18px; font-weight: 700; }
p { margin: 0 0 .9em; }
code, .mono { font-family: ui-monospace, 'SF Mono', 'Cascadia Code', Consolas, monospace; font-size: .92em; }
code { background: var(--s3); padding: 2px 6px; border-radius: 3px; }
.muted { color: var(--muted); }
.small { font-size: 14px; }
.num { font-variant-numeric: tabular-nums; }
mark { background: none; color: var(--gold); font-weight: 800; }
kbd { font: 600 11.5px var(--font); color: var(--sub); background: var(--s3); border: 1px solid var(--line-2); border-bottom-width: 2px; border-radius: 3px; padding: 0 6px; }

/* ── 상단 ── */
.top { position: sticky; top: 0; z-index: 30; height: var(--top); display: flex; align-items: center; gap: 16px; padding: 0 20px; background: rgba(10, 11, 14, .88); backdrop-filter: saturate(140%) blur(14px); border-bottom: 1px solid var(--line); }
.top::after { content: ''; position: absolute; left: 0; right: 0; bottom: -1px; height: 1px; background: linear-gradient(90deg, transparent, rgba(232, 198, 110, .45) 30%, rgba(240, 138, 60, .35) 60%, transparent); pointer-events: none; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--text); white-space: nowrap; }
.brand:hover { text-decoration: none; }
.brand-logo { display: block; height: 44px; width: auto; filter: drop-shadow(0 0 10px rgba(240, 138, 60, .25)); }
.brand-wiki { font-family: var(--display); font-size: 17px; font-weight: 700; color: var(--gold); letter-spacing: .04em; padding-left: 10px; border-left: 1px solid var(--line-2); }
.icon-btn { display: inline-grid; place-items: center; width: 44px; height: 44px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--s2); color: var(--text); cursor: pointer; }
.icon-btn:hover { background: var(--s3); border-color: var(--line-2); }
.menu-btn { display: none; }
.search-trigger { flex: 1; min-width: 0; max-width: 520px; margin-left: auto; display: flex; align-items: center; gap: 10px; height: 42px; padding: 0 10px 0 14px; border: 1px solid var(--line-2); border-radius: var(--radius); background: var(--s1); color: var(--muted); font: inherit; font-size: 15px; cursor: pointer; text-align: left; }
.search-trigger:hover { border-color: rgba(232, 198, 110, .45); color: var(--sub); }
.search-trigger .st-text { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.search { position: relative; flex: 1; display: flex; align-items: center; }
.search > .i { position: absolute; left: 14px; color: var(--muted); pointer-events: none; }
.search input { width: 100%; height: 44px; padding: 0 44px 0 44px; border-radius: var(--radius); border: 1px solid var(--line-2); background: var(--s1); color: var(--text); font: inherit; font-size: 15px; }
.search input::placeholder { color: var(--muted); }
.search input:focus { outline: none; border-color: var(--gold-2); box-shadow: 0 0 0 3px rgba(232, 198, 110, .14); background: var(--s1); }
.search input::-webkit-search-cancel-button { display: none; }
.search-results { position: absolute; top: calc(100% + 6px); left: 0; right: 0; max-height: min(72vh, 540px); overflow: auto; background: var(--s2); border: 1px solid var(--line-2); border-radius: var(--radius-lg); box-shadow: 0 24px 56px rgba(0, 0, 0, .6); padding: 6px; z-index: 40; text-align: left; }
.search-results a { display: flex; align-items: center; gap: 12px; padding: 9px 12px; border-radius: var(--radius); color: var(--text); border-left: 2px solid transparent; }
.search-results a:hover, .search-results a[aria-selected='true'] { background: var(--s3); border-left-color: var(--gold); text-decoration: none; }
.search-results a.more { color: var(--gold); font-weight: 700; border-top: 1px solid var(--line); border-radius: 0; margin-top: 4px; }
.search-results .empty { padding: 14px; color: var(--muted); }
.search-results .sr-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 10px 12px 4px; font-size: 12.5px; font-weight: 700; color: var(--muted); letter-spacing: .04em; }
.search-results .sr-head button { border: 0; background: none; color: var(--muted); font: inherit; font-size: 12.5px; cursor: pointer; padding: 2px 4px; }
.search-results .sr-head button:hover { color: var(--gold); }
.search-results .sr-chips { display: flex; flex-wrap: wrap; gap: 6px; padding: 4px 10px 10px; }
.sr-main { min-width: 0; flex: 1; display: grid; }
.sr-main .nm { font-weight: 700; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sr-main .snip { font-size: 13.5px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.kind { margin-left: auto; font-size: 13px; color: var(--muted); white-space: nowrap; }
/* 금빛 주 버튼(게임 기본 버튼과 같은 낡은 금) */
.play, .btn-primary { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 42px; padding: 0 18px; border: 1px solid #c9a457; border-radius: var(--radius); background: var(--btn-gold); color: #fff6e0; font: inherit; font-weight: 700; font-size: 15px; white-space: nowrap; text-shadow: 0 1px 1px rgba(0, 0, 0, .45); box-shadow: inset 0 1px 0 rgba(255, 236, 190, .3), 0 0 16px rgba(240, 138, 60, .12); cursor: pointer; }
.play:hover, .btn-primary:hover { text-decoration: none; filter: brightness(1.12); }
.play .i { color: #ffd38a; }

/* ── 검색 팔레트(Ctrl+K · / · 상단 검색 버튼) ── */
.palette { width: min(680px, calc(100vw - 24px)); max-height: none; margin: 10vh auto auto; padding: 0; border: 1px solid var(--line-2); border-radius: var(--radius-lg); background: var(--s2); color: var(--sub); box-shadow: 0 30px 80px rgba(0, 0, 0, .7), 0 0 0 1px rgba(232, 198, 110, .08); overflow: hidden; }
.palette::backdrop { background: rgba(4, 5, 7, .72); backdrop-filter: blur(3px); }
.pal-box { display: flex; flex-direction: column; max-height: min(78vh, 680px); }
.pal-search { flex: none; border-bottom: 1px solid var(--line); }
.pal-search > .i { left: 18px; color: var(--gold); }
.pal-search input { height: 58px; border: 0; border-radius: 0; background: transparent; padding-left: 50px; padding-right: 60px; font-size: 17px; }
.pal-search input:focus { box-shadow: none; background: transparent; }
.pal-close { position: absolute; right: 8px; width: 40px; height: 40px; background: none; border: 0; color: var(--muted); }
.pal-results { position: static; flex: 1; min-height: 0; max-height: none; border: 0; border-radius: 0; box-shadow: none; background: transparent; padding: 6px; }
.pal-results:empty { display: none; }
.pal-foot { flex: none; margin: 0; display: flex; gap: 16px; padding: 9px 14px; border-top: 1px solid var(--line); font-size: 12.5px; color: var(--muted); background: var(--s1); }
.pal-foot kbd { margin-right: 3px; }

/* ── 레이아웃 ── */
.shell { display: grid; grid-template-columns: 240px minmax(0, 1fr); min-height: calc(100vh - var(--top)); }
.nav { position: sticky; top: var(--top); height: calc(100vh - var(--top)); overflow: auto; padding: 14px 12px 12px; display: flex; flex-direction: column; gap: 2px; border-right: 1px solid var(--line); background: linear-gradient(180deg, rgba(17, 19, 24, .7), rgba(10, 11, 14, .4)); }
.nav-group { margin: 16px 12px 6px; font-size: 12px; font-weight: 700; letter-spacing: .14em; color: #a08a58; }
.nav-group:first-child { margin-top: 4px; }
.nav a { position: relative; display: flex; align-items: center; gap: 11px; padding: 7px 12px; border-radius: var(--radius); color: var(--sub); font-size: 15px; font-weight: 600; }
.nav a:hover { background: var(--s2); color: var(--text); text-decoration: none; }
.nav a[aria-current='page'] { background: linear-gradient(90deg, rgba(232, 198, 110, .14), rgba(232, 198, 110, .02)); color: var(--gold); }
.nav a[aria-current='page']::before { content: ''; position: absolute; left: 0; top: 8px; bottom: 8px; width: 2px; background: var(--gold); box-shadow: 0 0 8px var(--gold); }
.nav .ni { width: 28px; height: 28px; object-fit: contain; flex: none; filter: drop-shadow(0 1px 2px rgba(0, 0, 0, .6)); }
.nav-foot { margin-top: auto; padding: 18px 12px 6px; font-size: 12.5px; color: var(--muted); line-height: 1.55; }
main { padding: 36px clamp(16px, 4vw, 56px) 96px; max-width: 1160px; width: 100%; }
main:focus { outline: none; }
.loading, .error { color: var(--muted); padding: 48px 0; }
.scrim { position: fixed; inset: var(--top) 0 0 0; background: rgba(0, 0, 0, .6); z-index: 19; }
.to-top { position: fixed; right: 20px; bottom: 20px; z-index: 25; display: grid; place-items: center; width: 46px; height: 46px; border: 1px solid var(--gold-2); border-radius: var(--radius); background: rgba(23, 26, 32, .92); color: var(--gold); box-shadow: 0 8px 24px rgba(0, 0, 0, .5); }
.to-top:hover { background: var(--s3); text-decoration: none; }
.toast { position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%); z-index: 70; padding: 10px 18px; border: 1px solid var(--line-2); border-radius: var(--radius); background: var(--s3); color: var(--text); font-size: 14.5px; box-shadow: 0 10px 30px rgba(0, 0, 0, .5); }
.to-top[hidden], .toast[hidden] { display: none; }

/* ── 공통 부품 ── */
.page-head { margin-bottom: 28px; }
.page-head h1 { display: flex; align-items: center; gap: 12px; }
.page-head p { margin: 4px 0 0; color: var(--muted); font-size: 17px; }
/* 목차: 스크롤해도 상단에 붙어 있고, 지금 읽는 절을 표시한다(app.js spyToc) */
.toc { position: sticky; top: var(--top); z-index: 10; display: flex; gap: 6px; overflow-x: auto; margin: -8px calc(-1 * clamp(16px, 4vw, 56px)) 28px; padding: 10px clamp(16px, 4vw, 56px); background: rgba(10, 11, 14, .92); backdrop-filter: saturate(140%) blur(14px); border-bottom: 1px solid var(--line); scrollbar-width: none; -webkit-mask-image: linear-gradient(90deg, #000 calc(100% - 40px), transparent); mask-image: linear-gradient(90deg, #000 calc(100% - 40px), transparent); }
.toc a { flex: none; display: inline-flex; align-items: center; height: 34px; padding: 0 14px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--s1); color: var(--sub); font-size: 14px; font-weight: 600; }
.toc a:hover { background: var(--s2); color: var(--text); text-decoration: none; }
.toc a[aria-current='true'] { background: var(--gold-soft); border-color: rgba(232, 198, 110, .5); color: var(--gold); }
.toc a:last-child { margin-right: 40px; }
.crumb { display: inline-flex; align-items: center; gap: 6px; font-size: 15px; font-weight: 600; margin-bottom: 16px; color: var(--muted); }
.crumb:hover { color: var(--gold); text-decoration: none; }
/* 패널: 게임 창처럼 가는 테두리 + 위쪽만 살짝 밝게 */
.card { background: linear-gradient(180deg, rgba(255, 255, 255, .025), transparent 120px), var(--s1); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 22px; }
.card > h2:first-child, .card > h3:first-child { margin-top: 0; }
.card h3 { margin-bottom: 14px; }
.grid { display: grid; gap: 12px; }
.g2 { grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); }
.g3 { grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
.g4 { grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); }
.stack > * + * { margin-top: 16px; }
.chip { display: inline-flex; align-items: center; gap: 5px; height: 26px; padding: 0 9px; border: 1px solid var(--line); border-radius: 3px; background: var(--s3); color: var(--sub); font-size: 13.5px; font-weight: 600; white-space: nowrap; vertical-align: middle; }
.chip .i { width: 15px; height: 15px; }
.chip.accent { background: var(--gold-soft); border-color: rgba(232, 198, 110, .35); color: var(--gold); }
.chip.sel { background: var(--sel-soft); border-color: rgba(111, 179, 220, .35); color: var(--sel); }
a.chip:hover { text-decoration: none; filter: brightness(1.2); }
button.chip { cursor: pointer; font: inherit; font-size: 13.5px; font-weight: 700; }
button.chip:hover { filter: brightness(1.2); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.filters { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 16px; }
.seg { display: inline-flex; flex-wrap: wrap; gap: 2px; padding: 3px; border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--s1); }
.seg button { height: 36px; padding: 0 13px; border: 1px solid transparent; border-radius: var(--radius); background: none; color: var(--muted); font: inherit; font-size: 14.5px; font-weight: 600; cursor: pointer; }
.seg button:hover { color: var(--text); }
.seg button[aria-pressed='true'] { background: var(--s3); border-color: rgba(232, 198, 110, .4); color: var(--gold); }
.seg button .n { margin-left: 4px; font-size: 12.5px; color: var(--muted); }
select, input[type='number'], input[type='text'].field, input[type='search'].field { height: 42px; padding: 0 12px; border-radius: var(--radius); border: 1px solid var(--line-2); background: var(--s2); color: var(--text); font: inherit; font-size: 15px; }
select { padding-right: 8px; }
select:focus, input:focus { outline: none; border-color: var(--gold-2); }
input[type='number'] { width: 92px; }
label.f { display: grid; grid-template-columns: minmax(0, 1fr); gap: 6px; font-size: 14px; font-weight: 600; color: var(--muted); }
label.f select { width: 100%; }
.count { color: var(--muted); font-size: 15px; font-weight: 600; margin-left: auto; }
.empty-state { padding: 44px 24px; text-align: center; color: var(--muted); background: var(--s1); border: 1px dashed var(--line-2); border-radius: var(--radius-lg); }
.empty-state .chips { justify-content: center; margin-top: 14px; }

/* 표 */
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--s1); }
.card .table-wrap { background: var(--s2); border-radius: var(--radius); }
.src-grid { grid-auto-flow: dense; }
.src-grid > .card:has(.table-wrap), .src-grid > .empty-state, .src-grid > .card:only-child { grid-column: 1 / -1; }
table { width: 100%; border-collapse: collapse; font-size: 15px; }
th, td { padding: 12px 16px; text-align: left; border-bottom: 1px solid var(--line); vertical-align: middle; }
td { color: var(--text); }
th { font-size: 13px; font-weight: 700; color: #b9a473; background: inherit; position: sticky; top: 0; white-space: nowrap; letter-spacing: .02em; }
.table-wrap th { background: #15171c; box-shadow: inset 0 -1px 0 var(--line-2); }
.card .table-wrap th { background: #1b1e25; }
tr:last-child td { border-bottom: 0; }
/* 줄무늬: 넓은 표에서 가로로 따라 읽을 때 줄을 놓치지 않게 */
tbody tr:nth-child(even) td { background: rgba(255, 255, 255, .018); }
tbody tr:hover td { background: rgba(111, 179, 220, .07); }
td.r, th.r { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
td.r { color: var(--gold); }
td a { color: var(--text); font-weight: 600; }
td a:hover { color: var(--gold); }
td .muted.small, td .small.muted { font-size: 13px; }
.scroll-y { max-height: 560px; overflow: auto; }
/* 섬 바로가기(지역 페이지) */
.isl-index { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 8px; margin-bottom: 20px; }
.isl-index a { display: grid; gap: 2px; padding: 11px 14px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--s1); color: var(--text); }
.isl-index a:hover { background: var(--s2); border-color: rgba(232, 198, 110, .4); text-decoration: none; }
.isl-index span { font-size: 13.5px; color: var(--muted); }
tbody tr.hl td { background: var(--gold-soft); }

/* 아이콘(게임 슬롯처럼 각진 칸) */
.ico { width: 44px; height: 44px; flex: none; border-radius: var(--radius); background: radial-gradient(circle at 50% 35%, #262a33, #14161b); border: 1px solid var(--line-2); object-fit: contain; }
.ico.sm { width: 32px; height: 32px; border-radius: 3px; }
.ico.lg { width: 96px; height: 96px; border-radius: var(--radius-lg); }
.ico.ph { display: inline-grid; place-items: center; color: var(--muted); }
.ico.lg.ph .i { width: 36px; height: 36px; }
.name-cell { display: inline-flex; align-items: center; gap: 12px; }
.name-cell a { color: var(--text); font-weight: 700; }

/* 등급 */
.rar-common { color: var(--r-common); }
.rar-rare { color: var(--r-rare); }
.rar-saga { color: var(--r-saga); }
.rar-epic { color: var(--r-epic); }
.rar-legendary { color: var(--r-legendary); }
.rar-unique { color: var(--r-unique); }
.rar-absolute { color: var(--r-absolute); font-weight: 700; }
.ico.rb-rare { border-color: var(--r-rare); }
.ico.rb-saga { border-color: var(--r-saga); }
.ico.rb-epic { border-color: var(--r-epic); }
.ico.rb-legendary { border-color: var(--r-legendary); box-shadow: 0 0 14px rgba(224, 134, 46, .3); }
.ico.rb-unique { border-color: var(--r-unique); box-shadow: 0 0 16px rgba(240, 198, 74, .34); }
.ico.rb-absolute { border-color: var(--r-absolute); box-shadow: 0 0 18px rgba(255, 77, 77, .45); }
.name-cell.rar-rare a { color: var(--r-rare); }
.name-cell.rar-saga a { color: var(--r-saga); }
.name-cell.rar-epic a { color: var(--r-epic); }
.name-cell.rar-legendary a { color: var(--r-legendary); }
.name-cell.rar-unique a { color: var(--r-unique); }
.name-cell.rar-absolute a { color: var(--r-absolute); }
.chip.rar-rare, .chip.rar-saga, .chip.rar-epic, .chip.rar-legendary, .chip.rar-unique, .chip.rar-absolute { background: color-mix(in srgb, currentColor 14%, transparent); border-color: color-mix(in srgb, currentColor 35%, transparent); }

/* 공식(양피지 결의 금빛 글) */
.formula { background: linear-gradient(180deg, rgba(232, 198, 110, .05), transparent), var(--s1); border: 1px solid rgba(232, 198, 110, .22); border-left: 3px solid var(--gold-2); border-radius: var(--radius-lg); padding: 20px 22px; font-size: 16px; line-height: 1.95; color: var(--sub); overflow-x: auto; white-space: pre-wrap; font-variant-numeric: tabular-nums; }
.formula::first-line { color: var(--text); font-weight: 700; font-size: 17.5px; }
.formula b { color: var(--gold); font-weight: 700; }
.note { display: flex; gap: 12px; padding: 14px 16px; border: 1px solid rgba(111, 179, 220, .25); border-left: 3px solid var(--sel); border-radius: var(--radius); background: var(--sel-soft); color: var(--sub); font-size: 15px; }
.note .i { margin-top: 2px; color: var(--sel); }
ul.plain, ol.plain { margin: 0; padding-left: 22px; }
ul.plain li + li, ol.plain li + li { margin-top: 10px; }
ul.plain li::marker { color: var(--gold-2); }
ol.plain li::marker { color: var(--gold); font-weight: 700; }
/* 보스 기믹 영상: 넓은 화면은 설명 왼쪽, 좁은 화면은 설명 위 */
ul.plain li.has-clip { display: flex; gap: 14px; align-items: flex-start; }
video.gclip { flex: none; width: 240px; aspect-ratio: 16 / 9; border: 1px solid var(--line-2); border-radius: var(--radius); background: #0d0f14; object-fit: cover; }
@media (max-width: 600px) { ul.plain li.has-clip { flex-direction: column; } video.gclip { width: 100%; } }
details { border: 1px solid var(--line); border-radius: var(--radius); background: var(--s2); padding: 4px 16px; }
details[open] { padding-bottom: 16px; }
details summary { cursor: pointer; font-weight: 700; color: var(--text); padding: 10px 0; }
details summary:hover { color: var(--gold); }

/* ── 홈 ── */
.hero { position: relative; overflow: visible; min-height: 380px; display: flex; align-items: flex-end; padding: 40px; background: var(--s1) center 35%/cover no-repeat; border: 1px solid var(--line-2); border-radius: var(--radius-lg); margin-bottom: 28px; isolation: isolate; }
.hero::before { content: ''; position: absolute; inset: 0; border-radius: inherit; z-index: -1; background: radial-gradient(520px 260px at 18% 100%, rgba(240, 138, 60, .26), transparent 70%), linear-gradient(180deg, rgba(10, 11, 14, .15) 0%, rgba(10, 11, 14, .7) 50%, rgba(10, 11, 14, .97) 100%); }
.hero::after { content: ''; position: absolute; left: 24px; right: 24px; bottom: -1px; height: 2px; background: linear-gradient(90deg, transparent, var(--gold-2), var(--ember), transparent); opacity: .7; }
.hero-in { width: 100%; max-width: 700px; }
.hero-logo { display: block; width: 210px; height: auto; margin: 0 0 6px -8px; filter: drop-shadow(0 0 24px rgba(240, 138, 60, .45)); }
.hero h1 { font-size: 40px; margin: 0 0 6px; text-shadow: 0 2px 12px rgba(0, 0, 0, .7); }
.hero p { margin: 0 0 20px; color: var(--sub); font-size: 17.5px; text-shadow: 0 1px 8px rgba(0, 0, 0, .8); }
.hero .search { max-width: none; margin: 0; }
.hero .search input { height: 58px; padding-left: 52px; font-size: 17px; background: rgba(17, 19, 24, .94); border-color: rgba(232, 198, 110, .4); }
.hero .search > .i { left: 18px; width: 22px; height: 22px; color: var(--gold); }
.hero-try { margin-top: 12px; align-items: center; }
.hero-try > span { font-size: 14px; color: var(--muted); margin-right: 4px; }
.hero-try a.chip { background: rgba(32, 36, 43, .88); color: var(--text); }
.home-sec { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin: 40px 0 14px; }
.home-sec h2 { margin: 0; font-size: 22px; display: flex; align-items: center; gap: 10px; }
.home-sec h2::before { content: ''; width: 8px; height: 8px; transform: rotate(45deg); background: var(--gold); box-shadow: 0 0 10px rgba(232, 198, 110, .55); }
.home-sec a { font-size: 14.5px; font-weight: 600; }
/* 처음이라면: 단계 카드 */
.path { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; counter-reset: step; }
.path a { position: relative; display: grid; gap: 4px; padding: 18px 18px 18px 64px; border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--s1); color: var(--text); }
.path a::before { counter-increment: step; content: counter(step); position: absolute; left: 18px; top: 18px; display: grid; place-items: center; width: 32px; height: 32px; transform: rotate(45deg); border: 1px solid var(--gold-2); background: var(--gold-soft); color: transparent; }
.path a::after { counter-increment: none; content: counter(step); position: absolute; left: 18px; top: 18px; width: 32px; height: 32px; display: grid; place-items: center; font-family: var(--display); font-weight: 700; color: var(--gold); }
.path a:hover { border-color: rgba(232, 198, 110, .45); background: var(--s2); text-decoration: none; }
.path b { font-size: 16.5px; }
.path span { color: var(--muted); font-size: 14px; line-height: 1.5; }
/* 분류 타일: 게임 메뉴 아이콘 */
.tiles { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.tile { display: flex; gap: 14px; align-items: center; padding: 16px; border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--s1); color: var(--text); transition: background .15s, border-color .15s, transform .15s; }
.tile:hover { text-decoration: none; background: var(--s2); border-color: rgba(232, 198, 110, .45); transform: translateY(-2px); }
.tile .ti { display: grid; place-items: center; width: 56px; height: 56px; flex: none; border: 1px solid var(--line-2); border-radius: var(--radius); background: radial-gradient(circle at 50% 40%, #2a2e37, #121419); }
.tile .ti img { width: 44px; height: 44px; object-fit: contain; filter: drop-shadow(0 2px 3px rgba(0, 0, 0, .7)); }
.tile:hover .ti { border-color: var(--gold-2); box-shadow: 0 0 14px rgba(232, 198, 110, .25); }
.tile b { display: block; font-size: 16.5px; }
.tile span { color: var(--muted); font-size: 13.5px; line-height: 1.5; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
@media (max-width: 1180px) { .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
/* 최근 업데이트 */
.news-list { display: grid; gap: 10px; }
.news-item { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 4px 16px; padding: 16px 18px; border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--s1); color: var(--text); }
a.news-item:hover { border-color: rgba(232, 198, 110, .45); background: var(--s2); text-decoration: none; }
.news-item .ver { grid-row: span 2; align-self: start; padding: 3px 9px; border: 1px solid rgba(232, 198, 110, .4); border-radius: 3px; background: var(--gold-soft); color: var(--gold); font-weight: 700; font-size: 13.5px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.news-item b { font-size: 16px; }
.news-item .date { color: var(--muted); font-weight: 500; font-size: 13.5px; margin-left: 8px; }
.news-item ul { margin: 2px 0 0; padding-left: 18px; color: var(--sub); font-size: 14.5px; }
.news-item li::marker { color: var(--gold-2); }
.kv { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 10px; }
.kv div { border: 1px solid var(--line); background: var(--s1); border-radius: var(--radius-lg); padding: 14px 16px; }
.kv dt { font-size: 13.5px; color: var(--muted); font-weight: 600; }
.kv dd { margin: 4px 0 0; font-size: 24px; font-weight: 800; color: var(--gold); letter-spacing: -0.01em; font-variant-numeric: tabular-nums; }
dl { margin: 0; }

/* 업데이트 소식 페이지 */
.patch { scroll-margin-top: calc(var(--top) + 16px); }
.patch + .patch { margin-top: 14px; }
.patch-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin-bottom: 10px; }
.patch-head h2 { margin: 0; font-size: 21px; }
.patch-sec + .patch-sec { margin-top: 14px; }
.patch-sec h3 { margin: 0 0 6px; font-size: 15.5px; color: var(--gold); }
.patch-sec ul { margin: 0; padding-left: 20px; }
.patch-sec li + li { margin-top: 4px; }
.patch-sec li::marker { color: var(--gold-2); }

/* 모험 길잡이 */
.road { position: relative; display: grid; gap: 12px; padding-left: 34px; }
.road::before { content: ''; position: absolute; left: 11px; top: 14px; bottom: 14px; width: 2px; background: linear-gradient(180deg, var(--gold-2), rgba(240, 138, 60, .6), rgba(111, 179, 220, .5)); }
.road-step { position: relative; }
.road-step::before { content: ''; position: absolute; left: -29px; top: 22px; width: 12px; height: 12px; transform: rotate(45deg); background: var(--bg); border: 2px solid var(--gold); box-shadow: 0 0 10px rgba(232, 198, 110, .5); }
.road-step .lv { display: inline-block; margin-bottom: 4px; font-family: var(--display); font-weight: 700; color: var(--gold); font-size: 15px; }
.road-step h3 { margin: 0 0 6px; }
.road-step p { margin: 0 0 8px; }

/* 검색 결과 */
.search.big { max-width: none; margin: 0 0 16px; }
.search.big input { height: 54px; font-size: 17px; background: var(--s1); }
.search.big > .i { color: var(--gold); }
.sr-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.sr-row { display: flex; align-items: center; gap: 14px; padding: 12px 16px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--s1); color: var(--text); }
.sr-row:hover { background: var(--s2); border-color: rgba(232, 198, 110, .4); text-decoration: none; }
.sr-row .sr-main .nm { font-size: 16.5px; white-space: normal; }
.sr-row .sr-main .snip { font-size: 14.5px; white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.sr-near { margin: 0 0 12px; color: var(--muted); font-size: 15px; }

/* 상세 */
.detail-head { display: flex; gap: 22px; align-items: center; margin-bottom: 24px; }
.detail-head h1 { margin-bottom: 10px; font-size: 36px; }
.stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 8px; }
.stat { border: 1px solid var(--line); background: var(--s1); border-radius: var(--radius); padding: 12px 14px; }
.card .stat { background: var(--s2); }
.stat dt { font-size: 13px; color: var(--muted); font-weight: 600; }
.stat dd { margin: 2px 0 0; font-size: 20px; font-weight: 800; color: var(--gold); letter-spacing: -0.01em; font-variant-numeric: tabular-nums; }

/* 직업 */
.class-card { display: flex; gap: 16px; align-items: center; box-shadow: inset 3px 0 0 var(--c, var(--gold)); transition: background .15s, border-color .15s; }
.class-card:hover { text-decoration: none; background: var(--s2); border-color: var(--line-2); }
.tree { display: grid; grid-template-columns: 180px 32px minmax(0, 1fr); align-items: stretch; }
.tree-root { align-self: center; }
.tree-lines { position: relative; }
.tree-lines::before { content: ''; position: absolute; left: 50%; top: 28px; bottom: 28px; border-left: 2px solid var(--s4); }
.branch { box-shadow: inset 3px 0 0 var(--c); }
.branch + .branch { margin-top: 12px; }
.branch h3 { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.skill-row { display: grid; grid-template-columns: 44px minmax(0, 1fr); gap: 14px; padding: 16px 0; border-top: 1px solid var(--line); }
.skill-row:first-of-type { border-top: 0; }
.skill-row > div > b { font-size: 16.5px; }
.skill-row .meta { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0; }
.skill-row .small { font-size: 15px; color: var(--sub); }
.skill-row ul { margin: 6px 0 0; padding-left: 20px; color: var(--muted); font-size: 14.5px; }
.skill-row.focus { background: var(--gold-soft); border-radius: var(--radius); padding-left: 12px; padding-right: 12px; }
.slot { display: inline-grid; place-items: center; width: 22px; height: 22px; border: 1px solid var(--line-2); border-radius: 3px; background: var(--s3); color: var(--gold); font-size: 12.5px; font-weight: 800; vertical-align: middle; }
.steps { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.step { padding: 10px 14px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--s1); font-size: 15px; }
.step b { color: var(--gold); }

/* 계산기 */
.calc { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.calc-form { display: grid; gap: 22px; }
.row { display: flex; flex-wrap: wrap; gap: 10px; align-items: end; }
.gear-row { display: grid; grid-template-columns: 60px minmax(0, 1fr) 88px; gap: 8px; align-items: center; font-size: 15px; font-weight: 600; }
.gear-row + .gear-row { margin-top: 8px; }
.gear-row select { width: 100%; }
.result-big { font-family: var(--display); font-size: 36px; font-weight: 700; color: var(--gold); letter-spacing: -0.01em; font-variant-numeric: tabular-nums; margin: 0 0 6px; text-shadow: 0 0 18px rgba(232, 198, 110, .25); }
.bar { height: 8px; border-radius: 2px; background: var(--s3); overflow: hidden; }
.bar > i { display: block; height: 100%; background: linear-gradient(90deg, var(--gold-2), var(--ember)); }

/* 피드백 게시판 */
.btn-primary:disabled { opacity: .55; cursor: default; filter: none; }
.pill-btn { display: inline-flex; align-items: center; gap: 6px; height: 42px; padding: 0 18px; border: 1px solid var(--line-2); border-radius: var(--radius); background: var(--s2); color: var(--sub); font: inherit; font-size: 15px; font-weight: 600; cursor: pointer; }
.pill-btn:hover { background: var(--s3); color: var(--text); }
.pill-btn:disabled { opacity: .55; cursor: default; }
textarea.field { display: block; width: 100%; min-height: 136px; padding: 14px 16px; border: 1px solid var(--line-2); border-radius: var(--radius); background: var(--s2); color: var(--text); font: inherit; font-size: 16px; line-height: 1.6; resize: vertical; }
textarea.field:focus { outline: none; border-color: var(--gold-2); }
textarea.field::placeholder, input.field::placeholder { color: var(--muted); }
.fb-form { position: relative; display: grid; gap: 14px; }
.fb-form .seg { justify-self: start; background: var(--s2); }
.fb-row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.fb-row input.field { flex: 0 1 220px; min-width: 0; }
.fb-row .count { font-size: 14px; font-variant-numeric: tabular-nums; }
.chip button { display: inline-grid; place-items: center; width: 22px; height: 22px; margin-right: -6px; padding: 0; border: 0; border-radius: 3px; background: none; color: inherit; cursor: pointer; }
.chip button:hover { background: var(--s2); color: var(--text); }
.chip.bad { background: color-mix(in srgb, var(--bad) 14%, transparent); border-color: color-mix(in srgb, var(--bad) 35%, transparent); color: var(--bad); }
.fb-hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.fb-msg { margin: 0; font-size: 14.5px; color: var(--good); }
.fb-msg.bad { color: var(--bad); }
.fb-msg:empty { margin-top: -14px; }
.fb-rules { margin: 12px 4px 28px; }
.fb-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.fb-post { padding: 16px 18px; border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--s1); }
.fb-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; min-height: 28px; font-size: 15px; }
.fb-meta time { font-size: 13.5px; }
.fb-del { width: 40px; height: 40px; margin: -6px -8px -6px auto; background: none; border: 0; color: var(--muted); }
.fb-del:hover { background: var(--s2); color: var(--bad); }
.fb-body { margin: 10px 0 0; color: var(--text); line-height: 1.65; white-space: pre-wrap; overflow-wrap: anywhere; }
.fb-page { display: inline-flex; align-items: center; gap: 6px; margin-top: 12px; font-size: 13.5px; color: var(--muted); }
.fb-page .i { width: 15px; height: 15px; }
.fb-page:hover { color: var(--gold); }
.fb-more { display: flex; justify-content: center; margin-top: 16px; }

* + .note, * + .table-wrap, * + .formula, .formula + *, .table-wrap + p, .table-wrap + ul, .note + * { margin-top: 16px; }

/* 반응형 */
@media (max-width: 960px) {
  .calc { grid-template-columns: 1fr; }
  .path { grid-template-columns: 1fr; }
}
@media (max-width: 900px) {
  .shell { grid-template-columns: minmax(0, 1fr); }
  .menu-btn { display: inline-grid; }
  .nav { position: fixed; top: var(--top); left: 0; bottom: 0; height: auto; width: 280px; z-index: 20; background: var(--bg); transform: translateX(-100%); transition: transform .2s ease; }
  .nav.open { transform: none; }
  .play span { display: none; }
  .play { padding: 0 12px; }
}
@media (max-width: 600px) {
  :root { --top: 58px; }
  body { font-size: 15.5px; }
  .top { gap: 8px; padding: 0 10px; }
  .brand-logo { height: 36px; }
  .brand-wiki { display: none; }
  .search-trigger { height: 40px; padding: 0 10px; font-size: 14.5px; }
  .search-trigger kbd { display: none; }
  .search input { padding-right: 12px; }
  .palette { margin: 0; width: 100vw; max-width: 100vw; height: 100dvh; max-height: 100dvh; border: 0; border-radius: 0; }
  .pal-box { max-height: 100dvh; height: 100%; }
  .pal-foot { display: none; }
  main { padding-top: 24px; }
  h1 { font-size: 28px; }
  h2 { font-size: 21px; margin-top: 44px; }
  h2 .anchor { opacity: 1; }
  .hero { min-height: 340px; padding: 20px; }
  .hero-logo { width: 160px; }
  .hero h1 { font-size: 30px; }
  .hero p { font-size: 15.5px; }
  .hero .search input { height: 52px; font-size: 16px; }
  .tiles { grid-template-columns: minmax(0, 1fr); }
  .tile .ti { width: 48px; height: 48px; }
  .tile .ti img { width: 38px; height: 38px; }
  .detail-head { align-items: flex-start; gap: 16px; }
  .detail-head h1 { font-size: 28px; }
  .ico.lg { width: 72px; height: 72px; }
  .card { padding: 16px; }
  .tree { grid-template-columns: 1fr; }
  .tree-lines { display: none; }
  .tree-root { margin-bottom: 14px; }
  th, td { padding: 11px 12px; }
  .kv dd { font-size: 21px; }
  .hide-sm { display: none; }
  .sr-row .kind { display: none; }
  .to-top { right: 14px; bottom: 14px; }
  .toc { margin-left: -16px; margin-right: -16px; padding-left: 16px; padding-right: 16px; }
  /* 칸이 많은 표(app.js labelTables가 .wide를 단다)는 줄마다 카드로 풀고 칸 이름을 붙인다 */
  .table-wrap table.wide thead { display: none; }
  .table-wrap table.wide tr { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 14px; padding: 14px 16px; border-bottom: 1px solid var(--line); }
  .table-wrap table.wide tr:last-child { border-bottom: 0; }
  .table-wrap table.wide tbody tr:nth-child(even) td, .table-wrap table.wide tbody tr:hover td { background: none; }
  .table-wrap table.wide tbody tr:nth-child(even) { background: rgba(255, 255, 255, .02); }
  .table-wrap table.wide td { display: block; padding: 0; border: 0; text-align: left; white-space: normal; }
  .table-wrap table.wide td:first-child { grid-column: 1 / -1; font-size: 16px; }
  .table-wrap table.wide td[data-label]:not(:first-child)::before { content: attr(data-label); display: block; font-size: 12px; font-weight: 600; color: var(--muted); }
  .table-wrap table.wide td:empty { display: none; }
  .isl-index { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .news-item { grid-template-columns: minmax(0, 1fr); }
  .news-item .ver { grid-row: auto; justify-self: start; }
}
@media (prefers-reduced-motion: reduce) {
  .tile, .nav { transition: none; }
  .tile:hover { transform: none; }
}
