/* 카르베일 공식 홈페이지 — 1차 시안 공용 스타일
   결: 어두운 고딕(검정 · 짙은 붉은 · 낡은 금). 도트 그림은 흐리지 않게(pixelated · 정수 배율).
   휴대폰(390px)이 먼저 — 가로 넘침 없음. 게임과 같은 결이라 일부러 어두운 한 가지 모습만 쓴다. */
:root {
  color-scheme: dark;
  --bg: #0a070b;
  --bg2: #110c10;
  --panel: #161015;
  --panel2: #1d151b;
  --line: #2e2128;
  --line2: #4a2f36;
  --text: #ebe2d6;
  --muted: #a3958d;
  --dim: #75685f;
  --blood: #c8323f;
  --blood2: #8e1d2a;
  --blood3: #4c0f18;
  --gold: #c9a35a;
  --gold2: #8c703c;
  --display: 'Nanum Myeongjo', 'Batang', 'AppleMyungjo', serif;
  --body: 'Gowun Dodum', 'Malgun Gothic', 'Apple SD Gothic Neo', system-ui, sans-serif;
  --max: 1160px;
}
* { box-sizing: border-box; }
html { background: var(--bg); -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 15px/1.65 var(--body); overflow-x: hidden; }
a { color: inherit; text-decoration: none; }
img.px, .px img { image-rendering: pixelated; image-rendering: crisp-edges; }
.wrap { max-width: var(--max); margin: 0 auto; padding: 0 16px; }
.ex { display: inline-block; font-size: 11px; color: var(--gold2); border: 1px solid var(--gold2); border-radius: 3px; padding: 0 5px; margin-left: 6px; vertical-align: 2px; letter-spacing: .02em; }

/* ── 머리줄 ── */
.top { position: sticky; top: 0; z-index: 20; background: rgba(10, 7, 11, .92); border-bottom: 1px solid var(--line); backdrop-filter: blur(6px); }
.top .wrap { display: flex; align-items: center; gap: 14px; height: 58px; }
.brand { display: flex; align-items: center; gap: 10px; flex: none; }
.brand img { width: 36px; height: 36px; border-radius: 50%; box-shadow: 0 0 0 1px var(--blood3), 0 0 14px rgba(200, 50, 63, .35); }
.brand b { font: 800 19px/1 var(--display); letter-spacing: .14em; color: #f0d9d0; }
.brand small { display: block; font: 11px/1 var(--body); color: var(--muted); letter-spacing: .3em; margin-top: 4px; }
.nav { display: flex; gap: 2px; margin-left: 12px; }
.nav a { padding: 8px 11px; color: var(--muted); font-size: 14.5px; border-radius: 4px; white-space: nowrap; }
.nav a:hover, .nav a.on { color: var(--text); background: var(--panel2); }
.nav a.on { box-shadow: inset 0 -2px 0 var(--blood); }
.top .sp { flex: 1; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 40px; padding: 0 16px; border-radius: 4px; font: 700 14px/1 var(--body); border: 1px solid var(--line2); background: var(--panel2); color: var(--text); white-space: nowrap; }
.btn.red { background: linear-gradient(#b02a37, #7a1622); border-color: #d2404c; color: #fff3ee; box-shadow: 0 0 18px rgba(200, 50, 63, .25); }
.btn.gold { border-color: var(--gold2); color: #f1dcae; background: rgba(201, 163, 90, .08); }
.menu-btn { display: none; width: 40px; height: 40px; border: 1px solid var(--line2); background: var(--panel); border-radius: 4px; color: var(--text); font-size: 18px; }
.login { color: var(--muted); font-size: 14px; }

/* ── 제목 ── */
h1, h2, h3 { font-family: var(--display); font-weight: 800; margin: 0; letter-spacing: .02em; }
.sec { padding: 46px 0 8px; }
.sec-h { display: flex; align-items: baseline; gap: 12px; margin-bottom: 18px; }
.sec-h h2 { font-size: 24px; color: #f2e4da; }
.sec-h h2::before { content: ''; display: inline-block; width: 8px; height: 8px; background: var(--blood); transform: rotate(45deg); margin: 0 12px 4px 2px; box-shadow: 0 0 10px var(--blood); }
.sec-h .more { margin-left: auto; color: var(--gold); font-size: 14px; }
.lead { color: var(--muted); }

/* ── 첫 화면 큰 그림 ── */
.hero { position: relative; background: #050306; border-bottom: 1px solid var(--line); overflow: hidden; }
.hero .art { display: block; width: 100%; max-width: 1400px; margin: 0 auto; aspect-ratio: 1024 / 500; object-fit: cover; }
.hero::after { content: ''; position: absolute; inset: auto 0 0 0; height: 45%; background: linear-gradient(transparent, var(--bg)); pointer-events: none; }
.hero-copy { position: relative; z-index: 2; margin-top: -92px; padding-bottom: 8px; }
.hero-copy p { font: 400 19px/1.6 var(--display); color: #e8d6cc; margin: 0 0 18px; text-shadow: 0 2px 12px #000; }
.hero-copy .row { display: flex; gap: 10px; flex-wrap: wrap; }

/* ── 소식 ── */
.news { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: 6px; }
.news .card { padding: 16px 18px; }
.tag { display: inline-block; font-size: 12px; padding: 1px 8px; border-radius: 3px; background: var(--blood3); color: #ffb9bd; border: 1px solid var(--blood2); }
.tag.g { background: rgba(201, 163, 90, .1); color: var(--gold); border-color: var(--gold2); }
.tag.v { background: #1d1626; color: #c8b3e3; border-color: #3d2c52; }
.news h3 { font: 700 16px/1.45 var(--body); margin: 10px 0 6px; }
.news p { margin: 0; color: var(--muted); font-size: 14px; }
.news time { display: block; margin-top: 10px; color: var(--dim); font-size: 12.5px; }

/* ── 직업 ── */
.classes { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.cls { padding: 18px; position: relative; overflow: hidden; }
.cls h3 { font-size: 20px; color: #f3e1d3; }
.cls em { font-style: normal; color: var(--gold); font-size: 13px; letter-spacing: .1em; }
.cls p { margin: 8px 0 0; color: var(--muted); font-size: 14px; }
.cls::before { content: ''; position: absolute; inset: 0 auto 0 0; width: 3px; background: var(--c, var(--blood)); }

/* ── 백과 타일 ── */
.dex { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.dex a { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 18px 10px 16px; text-align: center; transition: border-color .15s; }
.dex a:hover { border-color: var(--gold2); }
.dex .pic { height: 144px; display: flex; align-items: flex-end; justify-content: center; }
.dex b { font: 800 18px/1.2 var(--display); }
.dex span { color: var(--gold); font-size: 13px; }

/* ── 보스 한 마리 ── */
.spot { display: grid; grid-template-columns: 360px 1fr; gap: 0; overflow: hidden; }
.stage { position: relative; display: flex; align-items: flex-end; justify-content: center; padding: 18px 10px 26px; min-height: 260px;
  background: radial-gradient(ellipse 60% 22% at 50% 88%, rgba(200, 50, 63, .28), transparent 70%), radial-gradient(circle at 50% 40%, #241820, #0c080b 70%); border-right: 1px solid var(--line); }
.stage::after { content: ''; position: absolute; left: 22%; right: 22%; bottom: 22px; height: 10px; border-radius: 50%; background: rgba(0, 0, 0, .55); filter: blur(2px); z-index: 0; }
.stage img { position: relative; z-index: 1; }
.spot .info { padding: 22px 24px; }
.spot h3 { font-size: 26px; color: #f6e2d6; }
.spot .sub { color: var(--muted); margin: 4px 0 14px; }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 6px 16px; font-size: 14px; margin: 0 0 14px; }
.kv dt { color: var(--dim); }
.kv dd { margin: 0; }
.skills { display: flex; flex-wrap: wrap; gap: 6px; margin: 0; padding: 0; list-style: none; }
.skills li { font-size: 13px; padding: 3px 10px; border: 1px solid var(--line2); border-radius: 3px; background: var(--bg2); }

/* ── 커뮤니티 ── */
.comm { display: grid; grid-template-columns: 1.3fr 1fr; gap: 14px; }
.board { padding: 6px 0; }
.board li { display: flex; gap: 10px; align-items: center; padding: 10px 16px; border-top: 1px solid var(--line); font-size: 14.5px; }
.board li:first-child { border-top: 0; }
.board ul { list-style: none; margin: 0; padding: 0; }
.board .t { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.board .n { color: var(--blood); font-size: 13px; }
.board .w { color: var(--dim); font-size: 12.5px; white-space: nowrap; }
.chat { display: flex; flex-direction: column; }
.chat .head { display: flex; align-items: center; gap: 8px; padding: 12px 16px; border-bottom: 1px solid var(--line); font-size: 14px; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: #5fbf7a; box-shadow: 0 0 8px #5fbf7a; }
.chat .log { padding: 10px 16px; font-size: 14px; display: grid; gap: 6px; flex: 1; }
.chat .log b { color: var(--gold); font-weight: 400; margin-right: 6px; }
.chat .log .gm b { color: #ff8f96; }
.chat .say { display: flex; gap: 8px; padding: 10px 12px; border-top: 1px solid var(--line); }
.chat .say span { flex: 1; height: 38px; border: 1px solid var(--line2); border-radius: 4px; background: var(--bg); color: var(--dim); font-size: 13.5px; display: flex; align-items: center; padding: 0 12px; }

/* ── 다운로드 ── */
.dl { display: flex; align-items: center; gap: 22px; padding: 22px 24px; background: linear-gradient(90deg, rgba(142, 29, 42, .25), transparent 60%), var(--panel); }
.dl img { width: 84px; height: 84px; border-radius: 16px; flex: none; }
.dl h3 { font-size: 22px; }
.dl p { margin: 4px 0 12px; color: var(--muted); }
.dl .row { display: flex; gap: 10px; flex-wrap: wrap; }

/* ── 바닥줄 ── */
.foot { margin-top: 56px; border-top: 1px solid var(--line); padding: 26px 0 40px; color: var(--dim); font-size: 13px; }
.foot nav { display: flex; flex-wrap: wrap; gap: 6px 18px; margin-bottom: 10px; color: var(--muted); }

/* ── 백과 목록 ── */
.page-h { padding: 30px 0 6px; }
.page-h h1 { font-size: 30px; }
.crumb { color: var(--dim); font-size: 13px; margin-bottom: 6px; }
.crumb a { color: var(--muted); }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin: 18px 0 16px; overflow-x: auto; scrollbar-width: none; }
.tabs a { padding: 10px 16px; color: var(--muted); white-space: nowrap; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tabs a.on { color: var(--text); border-bottom-color: var(--blood); }
.tabs a small { color: var(--gold); margin-left: 4px; }
.filters { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 16px; }
.chip { height: 34px; padding: 0 14px; display: inline-flex; align-items: center; border: 1px solid var(--line2); border-radius: 17px; color: var(--muted); font-size: 13.5px; background: var(--panel); }
.chip.on { color: #fff0ea; border-color: var(--blood); background: var(--blood3); }
.search { margin-left: auto; height: 38px; min-width: 240px; border: 1px solid var(--line2); border-radius: 4px; background: var(--bg2); color: var(--dim); font-size: 14px; display: flex; align-items: center; padding: 0 12px; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(168px, 1fr)); gap: 12px; }
.mob { display: flex; flex-direction: column; overflow: hidden; transition: border-color .15s; }
.mob:hover { border-color: var(--gold2); }
.mob .stage { min-height: 0; height: 150px; padding: 10px 6px 16px; border-right: 0; border-bottom: 1px solid var(--line); overflow: hidden; }
.mob .stage::after { bottom: 12px; height: 7px; }
.mob .meta { padding: 9px 12px 11px; }
.mob .meta b { display: block; font-size: 14.5px; line-height: 1.35; }
.mob .meta span { color: var(--muted); font-size: 12.5px; }
.lv { color: var(--gold); font-size: 12.5px; }
.boss-badge { position: absolute; top: 8px; left: 8px; z-index: 2; font-size: 11px; padding: 0 6px; border-radius: 3px; background: var(--blood2); color: #ffe; }
.count-line { color: var(--muted); font-size: 13.5px; margin: -4px 0 12px; }

/* ── 몬스터 상세 ── */
.detail { display: grid; grid-template-columns: 420px 1fr; gap: 18px; align-items: start; }
.detail .stage { min-height: 380px; border-right: 0; border-radius: 6px; border: 1px solid var(--line); }
.detail .stage .frame { position: absolute; left: 12px; top: 10px; font-size: 12px; color: var(--dim); z-index: 2; }
.d-head h1 { font-size: 32px; color: #f6e4d8; }
.tags { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0 16px; }
.d-desc { font-size: 15.5px; color: #dccfc4; margin: 0 0 18px; padding: 14px 16px; border-left: 3px solid var(--blood2); background: var(--panel); border-radius: 0 6px 6px 0; }
.box { padding: 16px 18px; margin-bottom: 14px; }
.box h3 { font: 700 15px/1.3 var(--body); color: var(--gold); margin: 0 0 12px; letter-spacing: .04em; }
.drops { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.drop { display: flex; align-items: center; gap: 10px; padding: 6px 8px; border: 1px solid var(--line); border-radius: 4px; background: var(--bg2); font-size: 13.5px; }
.drop img { width: 48px; height: 48px; flex: none; background: #0d090c; border: 1px solid #2a1d24; border-radius: 3px; }
.places li { margin: 4px 0; }
.note { color: var(--dim); font-size: 12.5px; margin: 10px 0 0; }

/* ── 휴대폰 ── */
@media (max-width: 900px) {
  .nav, .login { display: none; }
  .menu-btn { display: inline-flex; align-items: center; justify-content: center; }
  .news, .classes { grid-template-columns: 1fr; }
  .dex { grid-template-columns: repeat(2, 1fr); }
  .spot, .comm, .detail { grid-template-columns: 1fr; }
  .spot .stage { border-right: 0; border-bottom: 1px solid var(--line); }
  .search { margin-left: 0; min-width: 0; width: 100%; }
}
@media (max-width: 520px) {
  body { font-size: 14.5px; }
  br.pc { display: none; }
  .dex a { padding-left: 4px; padding-right: 4px; }
  .top .wrap { height: 54px; gap: 10px; }
  .brand b { font-size: 17px; }
  .top .btn.red { height: 36px; padding: 0 12px; font-size: 13px; }
  .hero .art { aspect-ratio: 1024 / 500; }
  .hero-copy { margin-top: -26px; }
  .hero-copy p { font-size: 16.5px; }
  .hero-copy .btn { flex: 1; }
  .sec { padding-top: 34px; }
  .sec-h h2 { font-size: 21px; }
  .grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .mob .stage { height: 128px; }
  .dl { flex-direction: column; align-items: flex-start; }
  .detail .stage { min-height: 300px; }
  .d-head h1 { font-size: 27px; }
  .board .w { display: none; }
}

/* ═════════ 2단계(실제 사이트) 더한 것 ═════════ */
button { font: inherit; color: inherit; cursor: pointer; }
.btn { cursor: pointer; }
.btn.sm { height: 32px; padding: 0 12px; font-size: 13px; }
.btn[disabled] { opacity: .45; cursor: not-allowed; }
.auth { display: flex; align-items: center; gap: 8px; font-size: 14px; color: var(--muted); }
.auth b { color: var(--text); font-weight: 400; }
.auth .adm { color: #ff8f96; }
.auth button.link { background: none; border: 0; color: var(--muted); padding: 6px 4px; }
.auth button.link:hover { color: var(--text); }
/* 폰 메뉴(☰) — 누르면 아래로 펼침 */
.drawer { display: none; border-top: 1px solid var(--line); background: var(--bg2); }
.drawer a { display: block; padding: 13px 18px; border-bottom: 1px solid var(--line); color: var(--text); }
.drawer a.on { color: #fff; box-shadow: inset 3px 0 0 var(--blood); }
.drawer .auth { padding: 12px 18px; }
body.nav-open .drawer { display: block; }
@media (min-width: 901px) { body.nav-open .drawer { display: none; } }
@media (max-width: 900px) { .top .auth { display: none; } }

/* 목록 거르기 */
.filters input.search, .filters select { background: var(--bg2); color: var(--text); border: 1px solid var(--line2); border-radius: 4px; height: 38px; padding: 0 12px; font-size: 14px; }
.filters input.search { margin-left: auto; min-width: 240px; }
.filters input.search::placeholder { color: var(--dim); }
button.chip { cursor: pointer; }
.empty { color: var(--dim); padding: 30px 0; text-align: center; }
.hide { display: none !important; }

/* 아이템 */
.igrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 10px; }
.item { display: flex; gap: 12px; align-items: center; padding: 10px 12px; transition: border-color .15s; }
.item:hover { border-color: var(--gold2); }
.item img, .ico { width: 48px; height: 48px; flex: none; background: #0d090c; border: 1px solid #2a1d24; border-radius: 3px; }
.item b { display: block; font-size: 14.5px; line-height: 1.35; }
.item span { color: var(--muted); font-size: 12.5px; }
/* 등급 색 — 게임 data.js GRADE_PALETTE 와 같은 값 */
.g-normal { color: #bdbdbd !important; } .g-fine { color: #6fe07a !important; } .g-rare { color: #5fa8ff !important; } .g-hero { color: #ff5e5e !important; } .g-legend { color: #c98bff !important; } .g-unique { color: #4dffc8 !important; }
.item.f-normal img { border-color: #7a7a7a; } .item.f-fine img { border-color: #3f9c4c; } .item.f-rare img { border-color: #2f6fd6; } .item.f-hero img { border-color: #c9303a; } .item.f-legend img { border-color: #8a45e0; } .item.f-unique img { border-color: #16d99a; }
.drop b { font-weight: 400; }
a.drop:hover { border-color: var(--gold2); }
.big-ico { width: 96px; height: 96px; image-rendering: pixelated; background: #0d090c; border: 1px solid #3a2830; border-radius: 6px; }

/* 지역 */
.maps { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.map { padding: 14px 16px; display: block; transition: border-color .15s; }
.map:hover { border-color: var(--gold2); }
.map h3 { font: 700 16px/1.35 var(--body); color: #f1e2d6; }
.map p { margin: 4px 0 0; color: var(--muted); font-size: 13px; }
.map .faces { display: flex; gap: 4px; align-items: flex-end; height: 64px; margin-top: 10px; overflow: hidden; }
.area { margin-bottom: 22px; }
.area h3 { font: 700 17px/1.4 var(--body); margin: 0 0 10px; color: #f1e2d6; }
.area h3 small { color: var(--gold); font-weight: 400; font-size: 13px; margin-left: 6px; }

/* 소식 */
.notes { list-style: none; margin: 0; padding: 0; }
.notes li { padding: 4px 0 4px 18px; position: relative; }
.notes li::before { content: ''; position: absolute; left: 2px; top: 13px; width: 6px; height: 6px; background: var(--blood); transform: rotate(45deg); }
.article { max-width: 760px; }
.article .meta { color: var(--dim); font-size: 13px; margin: 6px 0 18px; }
.news-list .card { display: block; padding: 18px 20px; margin-bottom: 12px; }
.news-list h3 { font: 700 17px/1.45 var(--body); margin: 8px 0 4px; }
.news-list p { margin: 0; color: var(--muted); font-size: 14px; }

/* 커뮤니티 */
.testbar { display: flex; flex-wrap: wrap; gap: 8px 14px; align-items: center; padding: 10px 14px; margin: 14px 0; border: 1px dashed var(--gold2); border-radius: 6px; background: rgba(201, 163, 90, .06); color: #e9d6aa; font-size: 13.5px; }
.testbar b { color: #ffd98a; }
.testbar label { display: inline-flex; gap: 6px; align-items: center; cursor: pointer; }
.testbar .sp { flex: 1; }
.form { display: grid; gap: 10px; padding: 16px; margin-bottom: 16px; }
.form input[type=text], .form textarea, .form select, .modal input[type=text] { width: 100%; background: var(--bg2); color: var(--text); border: 1px solid var(--line2); border-radius: 4px; padding: 10px 12px; font: inherit; }
.form textarea { min-height: 140px; resize: vertical; }
.form .row { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.posts { list-style: none; margin: 0; padding: 0; }
.posts li { border-top: 1px solid var(--line); }
.posts li:first-child { border-top: 0; }
.posts a.row { display: flex; gap: 10px; align-items: center; padding: 12px 16px; }
.posts a.row:hover { background: var(--panel2); }
.posts .t { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.posts .n { color: var(--blood); font-size: 13px; margin-left: 4px; }
.posts .w { color: var(--dim); font-size: 12.5px; white-space: nowrap; }
.posts .pin { background: var(--blood2); color: #fff; }
.post-view { padding: 18px 20px; margin-bottom: 14px; }
.post-view h2 { font: 700 21px/1.4 var(--body); margin: 8px 0 4px; }
.post-view .meta { color: var(--dim); font-size: 13px; margin-bottom: 14px; }
.post-view .body { white-space: pre-wrap; word-break: break-word; line-height: 1.75; }
.post-view .acts { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--line); }
.folded { color: var(--dim); font-style: italic; }
.status { font-size: 12px; padding: 1px 8px; border-radius: 3px; border: 1px solid var(--line2); color: var(--muted); }
.status.done { border-color: #3f7a4e; color: #9fe0ae; background: rgba(63, 122, 78, .15); }
.cmts { list-style: none; margin: 0; padding: 0; }
.cmts li { padding: 10px 0; border-top: 1px solid var(--line); font-size: 14.5px; }
.cmts li .who { color: var(--gold); margin-right: 8px; }
.cmts li.adm .who { color: #ff8f96; }
.cmts li .x { color: var(--dim); font-size: 12px; margin-left: 8px; }
.cmts li .x button { background: none; border: 0; color: var(--dim); padding: 0 4px; font-size: 12px; }
.cmts li .x button:hover { color: var(--text); }
.cmts li p { margin: 4px 0 0; white-space: pre-wrap; word-break: break-word; }
.chatbox { display: flex; flex-direction: column; height: min(68vh, 640px); }
.chatlog { flex: 1; overflow-y: auto; padding: 12px 16px; display: grid; align-content: start; gap: 7px; font-size: 14.5px; }
.chatlog .m b { color: var(--gold); font-weight: 400; margin-right: 6px; }
.chatlog .m.adm b { color: #ff8f96; }
.chatlog .m time { color: var(--dim); font-size: 11.5px; margin-left: 6px; }
.chatlog .m button { background: none; border: 0; color: var(--dim); font-size: 12px; padding: 0 4px; }
.chatsay { display: flex; gap: 8px; padding: 10px 12px; border-top: 1px solid var(--line); }
.chatsay input { flex: 1; min-width: 0; height: 40px; background: var(--bg); color: var(--text); border: 1px solid var(--line2); border-radius: 4px; padding: 0 12px; font: inherit; }
.chatsay input:disabled { opacity: .55; }
.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 60; max-width: calc(100% - 32px); padding: 11px 18px; border-radius: 6px; background: #2a1a20; border: 1px solid var(--blood2); color: #ffe6e2; font-size: 14px; box-shadow: 0 8px 28px rgba(0, 0, 0, .6); }
.modal-bg { position: fixed; inset: 0; z-index: 50; background: rgba(0, 0, 0, .7); display: flex; align-items: center; justify-content: center; padding: 16px; }
.modal { width: 100%; max-width: 420px; background: var(--panel); border: 1px solid var(--line2); border-radius: 8px; padding: 20px; display: grid; gap: 12px; }
.modal h3 { font-size: 20px; }
.modal p { margin: 0; color: var(--muted); font-size: 14px; }
.modal label { display: flex; gap: 8px; align-items: flex-start; font-size: 14px; color: var(--muted); }
.modal .row { display: flex; gap: 8px; justify-content: flex-end; }
.modal form { display: grid; gap: 12px; }
.board li { padding: 0; }
.board li a.row { display: flex; gap: 10px; align-items: center; flex: 1; min-width: 0; padding: 10px 16px; }
.board li a.row:hover { background: var(--panel2); }
.board li.empty { display: block; padding: 24px 16px; }
.modal select { background: var(--bg2); color: var(--text); border: 1px solid var(--line2); border-radius: 4px; height: 40px; padding: 0 10px; font: inherit; }
/* 백과 첫 화면 찾기 */
.finder { position: relative; margin: 6px 0 22px; }
.finder input { width: 100%; height: 46px; background: var(--bg2); color: var(--text); border: 1px solid var(--line2); border-radius: 6px; padding: 0 14px; font: inherit; font-size: 15px; }
.finder ul { list-style: none; margin: 6px 0 0; padding: 0; }
.finder li a { display: flex; gap: 10px; align-items: center; padding: 9px 12px; border-bottom: 1px solid var(--line); }
.finder li a:hover { background: var(--panel2); }
.finder li small { color: var(--dim); margin-left: auto; font-size: 12px; }
.note-card { padding: 20px 22px; }
.note-card h2 { font: 700 20px/1.4 var(--body); margin: 8px 0 12px; }
.note-lead { margin: -6px 0 14px; color: var(--muted); }
.note-h { font: 700 16px/1.4 var(--body); color: #f1dcae; margin: 20px 0 6px; padding-bottom: 6px; border-bottom: 1px solid var(--line); }
.note-h:first-of-type { margin-top: 6px; }
.steps { margin: 0; padding-left: 20px; } .steps li { margin: 6px 0; }
.policy ol { padding-left: 20px; } .policy li { margin: 8px 0; }
.mini-faces img { margin-right: 2px; }
@media (max-width: 900px) { .filters input.search { margin-left: 0; min-width: 0; width: 100%; } }
@media (max-width: 520px) {
  .igrid { grid-template-columns: 1fr; }
  .posts .w { display: none; }
  .chatbox { height: 70vh; }
}

/* ── 배경음악 단추(bgm.js) — 오른쪽 아래, 어두운 바탕 · 금 테두리 ── */
.bgm { position: fixed; right: 16px; bottom: 16px; z-index: 45; display: flex; align-items: center; gap: 8px; padding: 5px 12px 5px 5px; border: 1px solid var(--gold2); border-radius: 26px; background: rgba(16, 11, 15, .93); box-shadow: 0 6px 22px rgba(0, 0, 0, .55), inset 0 0 0 1px rgba(201, 163, 90, .07); backdrop-filter: blur(4px); }
.bgm-btn { position: relative; display: inline-flex; align-items: center; justify-content: center; width: 38px; height: 38px; padding: 0; border-radius: 50%; border: 1px solid var(--gold2); background: radial-gradient(circle at 50% 35%, #2b1d22, #120c10); color: #f1dcae; font: 800 19px/1 var(--display); cursor: pointer; }
.bgm-btn:hover { border-color: var(--gold); }
.bgm-btn:focus-visible, .bgm-more:focus-visible, .bgm-vol:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
.bgm-ic { transform: translateY(1px); }
.bgm[data-on="1"] .bgm-btn { box-shadow: 0 0 14px rgba(201, 163, 90, .4); }
.bgm[data-on="0"] .bgm-btn { color: var(--muted); }
.bgm[data-on="0"] .bgm-btn::after { content: ''; position: absolute; left: 8px; right: 8px; top: 50%; height: 2px; margin-top: -1px; border-radius: 1px; background: var(--blood); box-shadow: 0 0 0 1px #120c10; transform: rotate(-45deg); }
.bgm.wait .bgm-btn::before { content: ''; position: absolute; top: 2px; right: 2px; width: 7px; height: 7px; border-radius: 50%; background: var(--gold); box-shadow: 0 0 6px var(--gold); }
.bgm-vol { width: 92px; height: 20px; margin: 0; accent-color: var(--gold); cursor: pointer; background: transparent; }
.bgm-more { display: none; height: 30px; padding: 0 10px; border: 1px solid var(--line2); border-radius: 15px; background: var(--panel2); color: var(--muted); font: 700 12px/1 var(--body); cursor: pointer; }
.bgm.open .bgm-more { color: #f1dcae; border-color: var(--gold2); }
.bgm-tip { position: absolute; right: 0; bottom: calc(100% + 8px); padding: 5px 11px; border: 1px solid var(--gold2); border-radius: 4px; background: #23171c; color: #f1dcae; font-size: 12.5px; white-space: nowrap; opacity: 0; transform: translateY(4px); transition: opacity .15s, transform .15s; pointer-events: none; }
.bgm-tip.show { opacity: 1; transform: none; }
.bgm.none { padding: 5px; opacity: .55; }
.bgm.none .bgm-btn { cursor: not-allowed; }
.bgm.none .bgm-vol, .bgm.none .bgm-more, .bgm.fixedvol .bgm-vol, .bgm.fixedvol .bgm-more { display: none; }
.foot { padding-bottom: 84px; }   /* 바닥줄 글자가 단추에 가리지 않게 */
@media (max-width: 600px), (hover: none) {
  .bgm { right: 12px; bottom: 12px; padding-right: 6px; }
  .bgm-btn { width: 42px; height: 42px; }
  .bgm-vol { display: none; width: 110px; }
  .bgm.open .bgm-vol { display: block; }
  .bgm-more { display: inline-flex; align-items: center; }
  .bgm.open { padding-right: 12px; }
}
@media (prefers-reduced-motion: reduce) { .bgm-tip { transition: none; } }
