:root {
  --bg: #0f0d0b;
  --bg2: #17130f;
  --panel: #1d1813;
  --line: #3a2f22;
  --text: #e9e1d3;
  --muted: #a89a85;
  --gold: #d6a84a;
  --gold2: #f0cd7a;
  --red: #c4513f;
  --green: #6fbf73;
  --radius: 10px;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 15px/1.7 "Noto Sans KR", "Malgun Gothic", sans-serif;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--gold2); text-decoration: none; }
a:hover { text-decoration: underline; }
code { background: #2a2219; padding: 1px 6px; border-radius: 4px; font-size: .92em; color: var(--gold2); }
.wrap { max-width: 1080px; margin: 0 auto; padding: 0 16px; }
.wrap.narrow { max-width: 800px; }

/* 상단 */
.top { position: sticky; top: 0; z-index: 10; background: rgba(15,13,11,.92); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); }
.top-in { display: flex; align-items: center; gap: 20px; min-height: 60px; flex-wrap: wrap; }
.logo { font: 900 22px "Noto Serif KR", serif; color: var(--text); letter-spacing: .02em; }
.logo span { color: var(--gold); }
.logo:hover { text-decoration: none; }
.menu { display: flex; gap: 4px; flex: 1; flex-wrap: wrap; }
.menu a { color: var(--muted); padding: 6px 10px; border-radius: 6px; font-weight: 500; }
.menu a:hover { color: var(--text); background: #221c15; text-decoration: none; }
.menu a.on { color: var(--gold2); background: #2a2116; }
.status { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); white-space: nowrap; }
.status i { width: 9px; height: 9px; border-radius: 50%; background: #666; }
.status.on i { background: var(--green); box-shadow: 0 0 8px var(--green); }
.status.off i { background: var(--red); }

/* 홈 */
.hero {
  padding: 110px 0 100px; text-align: center; border-bottom: 1px solid var(--line);
  background:
    radial-gradient(ellipse at 50% 0%, rgba(214,168,74,.18), transparent 60%),
    radial-gradient(ellipse at 50% 120%, rgba(120,40,20,.35), transparent 60%),
    linear-gradient(#14100c, #0f0d0b);
}
.hero-kicker { color: var(--gold); letter-spacing: .4em; font-size: 13px; margin: 0 0 12px; }
.hero h1 { font: 900 clamp(34px, 6vw, 60px)/1.25 "Noto Serif KR", serif; margin: 0; text-shadow: 0 2px 24px rgba(214,168,74,.25); }
.hero-sub { font: 500 clamp(17px, 2.6vw, 24px) "Noto Serif KR", serif; color: var(--gold2); margin: 14px 0 36px; }
.hero-btns { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; margin: 40px 0; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; }
.card h3 { font: 700 18px "Noto Serif KR", serif; margin: 0 0 8px; color: var(--gold2); }
.card p { margin: 0; color: var(--muted); }
.home-boards { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 16px; margin-bottom: 50px; }
.mini { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; }
.mini h4 { margin: 0 0 8px; display: flex; justify-content: space-between; font: 700 16px "Noto Serif KR", serif; }
.mini h4 a { font: 400 13px "Noto Sans KR", sans-serif; color: var(--muted); }
.mini ul { list-style: none; margin: 0; padding: 0; }
.mini li { display: flex; justify-content: space-between; gap: 10px; padding: 5px 0; border-top: 1px dashed #2c241a; font-size: 14px; }
.mini li:first-child { border-top: 0; }
.mini li a { color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mini li span { color: var(--muted); font-size: 12px; white-space: nowrap; }
.mini .empty { color: var(--muted); font-size: 14px; }

/* 버튼 */
.btn { display: inline-block; border: 1px solid var(--line); background: #241d15; color: var(--text); padding: 10px 20px; border-radius: 8px; font: 700 15px "Noto Sans KR", sans-serif; cursor: pointer; text-align: center; }
.btn:hover { text-decoration: none; border-color: var(--gold); }
.btn.gold { background: linear-gradient(#e2b75a, #b98a2f); color: #1a1208; border-color: #e2b75a; }
.btn.gold:hover { background: linear-gradient(#f0cd7a, #c99a3c); }
.btn.ghost { background: transparent; }
.btn.small { padding: 6px 14px; font-size: 14px; }
.btn.big { padding: 16px 26px; font-size: 17px; }
.btn.drive { background: #1f2a1f; border-color: #3d5a3d; }
.btn.drive.pending { background: repeating-linear-gradient(45deg, #3a2a10, #3a2a10 10px, #2c200c 10px, #2c200c 20px); border: 2px dashed var(--gold); color: var(--gold2); cursor: not-allowed; }
.btn.disabled { opacity: .45; pointer-events: none; }

/* 공통 제목 */
.page { display: none; }
.page.show { display: block; }
.title { font: 900 30px "Noto Serif KR", serif; margin: 40px 0 20px; }
.sub { font: 700 20px "Noto Serif KR", serif; color: var(--gold2); margin: 36px 0 12px; padding-left: 12px; border-left: 3px solid var(--gold); }
.desc { color: var(--muted); margin: 0 0 12px; }
.desc.small { font-size: 13px; margin-top: 8px; }

/* 다운로드 */
.dl-box { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; }
.dl-file b { display: block; font-size: 18px; }
.dl-file span { color: var(--muted); font-size: 14px; }
.dl-btns { display: flex; gap: 12px; margin: 18px 0 8px; flex-wrap: wrap; }
.dl-btns .btn { flex: 1 1 240px; }
.dl-note { color: var(--muted); font-size: 13px; margin: 6px 0 0; }
.steps { padding-left: 22px; }
.steps li { margin: 6px 0; }
.warn { margin-top: 18px; background: #2a1712; border: 1px solid #6a3226; border-left: 4px solid var(--red); border-radius: 8px; padding: 14px 18px; }

/* 표 */
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); }
.t { width: 100%; border-collapse: collapse; font-size: 14px; background: var(--panel); }
.t th, .t td { padding: 9px 12px; border-bottom: 1px solid #2c241a; white-space: nowrap; }
.t tr:last-child td, .t tr:last-child th { border-bottom: 0; }
.t thead th { background: #261f17; color: var(--gold2); font-weight: 700; }
.t.center td, .t.center th { text-align: center; }
.t td.cls, .t.center td.cls { text-align: left; font-weight: 700; color: var(--text); }
.t.kv th { text-align: left; width: 220px; color: var(--muted); font-weight: 500; background: #1a1511; }
.t.kv td { white-space: normal; }
.t .avg { color: var(--muted); font-size: 12px; }
.t .bonus { color: var(--gold2); font-weight: 700; }

/* 계산기 */
.calc { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; display: flex; gap: 14px; flex-wrap: wrap; align-items: flex-end; }
.calc label { display: flex; flex-direction: column; font-size: 13px; color: var(--muted); gap: 4px; }
.calc input, .calc select { width: 110px; }
.calc-out { flex-basis: 100%; font-size: 15px; }
.calc-out b { color: var(--gold2); }

/* 입력 */
input, select, textarea { background: #120f0c; color: var(--text); border: 1px solid var(--line); border-radius: 6px; padding: 9px 11px; font: 15px "Noto Sans KR", sans-serif; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--gold); }
textarea { resize: vertical; width: 100%; }
.form label { display: flex; flex-direction: column; gap: 5px; margin-bottom: 14px; color: var(--muted); font-size: 14px; }
.form label small { color: #7d705d; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.form-btns { display: flex; gap: 10px; }
.form-msg { color: var(--red); min-height: 1.5em; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; }

/* 게시판 */
.board-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; flex-wrap: wrap; }
.board-head .title { margin-bottom: 14px; }
.board-tools { display: flex; gap: 8px; margin-bottom: 16px; flex-wrap: wrap; }
.search { display: flex; gap: 6px; }
.search input { width: 180px; padding: 6px 10px; }
.intro { background: #1b1610; border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 18px; margin-bottom: 14px; color: var(--muted); font-size: 14px; }
.intro b { color: var(--text); }
.intro ul { margin: 6px 0 0; padding-left: 20px; }
.list { border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.item { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-bottom: 1px solid #2c241a; background: var(--panel); }
.item:last-child { border-bottom: 0; }
.item:hover { background: #231d16; }
.item .no { width: 46px; color: var(--muted); font-size: 13px; text-align: center; flex-shrink: 0; }
.item .tt { flex: 1; min-width: 0; }
.item .tt a { color: var(--text); font-weight: 500; }
.item .tt .cc { color: var(--gold); font-size: 13px; margin-left: 4px; }
.item .meta { color: var(--muted); font-size: 13px; white-space: nowrap; }
.item.pinned { background: #262014; }
.tag { display: inline-block; font-size: 11px; padding: 1px 7px; border-radius: 10px; margin-right: 6px; vertical-align: 2px; border: 1px solid; }
.tag.pin { color: var(--gold2); border-color: var(--gold); }
.tag.ok { color: var(--green); border-color: var(--green); }
.tag.wait { color: var(--muted); border-color: #5a4d3b; }
.nick.admin { color: var(--gold2); font-weight: 700; }
.empty-list { padding: 40px; text-align: center; color: var(--muted); background: var(--panel); }
.pager { display: flex; justify-content: center; gap: 4px; margin: 18px 0 50px; flex-wrap: wrap; }
.pager a { padding: 4px 11px; border-radius: 6px; color: var(--muted); border: 1px solid transparent; }
.pager a.on { color: var(--gold2); border-color: var(--gold); }

.post { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); margin: 30px 0 16px; }
.post-head { padding: 18px 22px; border-bottom: 1px solid var(--line); }
.post-head h2 { margin: 0 0 6px; font: 700 22px "Noto Serif KR", serif; word-break: break-all; }
.post-head .meta { color: var(--muted); font-size: 13px; display: flex; gap: 14px; flex-wrap: wrap; }
.post-extra { padding: 12px 22px; border-bottom: 1px solid var(--line); background: #1a1511; font-size: 14px; display: grid; gap: 4px; }
.post-extra a { word-break: break-all; }
.post-body { padding: 22px; white-space: pre-wrap; word-break: break-word; min-height: 120px; }
.post-btns { display: flex; gap: 8px; justify-content: space-between; flex-wrap: wrap; margin-bottom: 26px; }
.post-btns div { display: flex; gap: 8px; flex-wrap: wrap; }
.comments h3 { font: 700 17px "Noto Serif KR", serif; margin: 0 0 10px; }
.cmt { padding: 12px 0; border-bottom: 1px solid #2c241a; }
.cmt .h { display: flex; gap: 10px; font-size: 13px; color: var(--muted); align-items: center; }
.cmt .h .del { margin-left: auto; color: var(--muted); cursor: pointer; background: none; border: 0; font-size: 12px; }
.cmt .b { white-space: pre-wrap; word-break: break-word; margin-top: 3px; }
.cmt-form { margin: 16px 0 60px; }
.cmt-form .row2 { margin-bottom: 8px; }
.cmt-form .row2 input { width: 100%; }

.foot { border-top: 1px solid var(--line); color: #7d705d; font-size: 13px; padding: 24px 0 40px; text-align: center; }
.foot p { margin: 4px 0; }
.foot a { color: #7d705d; }

dialog { background: var(--panel); color: var(--text); border: 1px solid var(--gold); border-radius: var(--radius); padding: 22px; width: min(360px, 90vw); }
dialog::backdrop { background: rgba(0,0,0,.6); }
dialog input { width: 100%; margin-bottom: 14px; }
dialog p { margin: 0 0 12px; }

@media (max-width: 640px) {
  .top-in { gap: 8px; padding-top: 8px; padding-bottom: 8px; }
  .menu { order: 3; flex-basis: 100%; overflow-x: auto; flex-wrap: nowrap; }
  .menu a { white-space: nowrap; }
  .status { margin-left: auto; }
  .hero { padding: 70px 0 60px; }
  .row2 { grid-template-columns: 1fr; gap: 0; }
  .item .no { display: none; }
  .item { flex-wrap: wrap; gap: 4px 12px; }
  .item .tt { flex-basis: 100%; }
  .t.kv th { width: auto; }
  .search input { width: 130px; }
}

/* 로그인·사용자 */
.userbox { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; white-space: nowrap; }
.userbox .who { color: var(--gold2); font-weight: 700; }
.userbox .who small { color: var(--muted); font-weight: 400; margin-left: 4px; }
.userbox a.plain { color: var(--muted); font-size: 13px; }
.login-box { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; max-width: 460px; }
.char-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; }
.char-card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; cursor: pointer; text-align: left; color: var(--text); font: inherit; }
.char-card:hover, .char-card.on { border-color: var(--gold); }
.char-card b { display: block; font-size: 17px; color: var(--gold2); }
.char-card span { color: var(--muted); font-size: 13px; }
.nick.verified::after { content: "✔"; color: var(--green); font-size: 11px; margin-left: 3px; }

/* 홍보 링크 확인 결과 */
.plinks { display: grid; gap: 6px; }
.plink { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.plink .why { color: var(--muted); font-size: 12px; }
.plink .btn { padding: 2px 10px; font-size: 12px; }

/* 채팅 */
.chat { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.tabs { display: flex; border-bottom: 1px solid var(--line); }
.tabs button { flex: 1; background: transparent; border: 0; color: var(--muted); padding: 12px; font: 700 15px "Noto Sans KR", sans-serif; cursor: pointer; border-bottom: 2px solid transparent; position: relative; }
.tabs button small { color: #7d705d; margin-left: 3px; }
.tabs button.on { color: var(--gold2); border-bottom-color: var(--gold); background: #231d15; }
.tabs button.new::after { content: ""; position: absolute; top: 10px; right: 18px; width: 7px; height: 7px; border-radius: 50%; background: var(--red); }
.chat-log { height: 460px; overflow-y: auto; padding: 12px 16px; font-size: 14px; line-height: 1.6; background: #120f0c; }
.chat-log .ln { word-break: break-all; }
.chat-log .tm { color: #6d6252; font-size: 11px; margin-right: 6px; }
.chat-log .g { color: #f2e2bd; }
.chat-log .w { color: #c9a0ff; }
.chat-log .c { color: #8fd18f; }
.chat-log .web { color: #7fc8ff; }
.chat-log .sys { color: var(--muted); font-style: italic; }
.chat-input { display: flex; gap: 8px; padding: 10px; border-top: 1px solid var(--line); }
.chat-input #chatMsg { flex: 1; min-width: 0; }
.chat-input #chatTarget { width: 150px; }
.chat + .desc, .chat ~ .desc { margin-top: 10px; }
#chatMsgErr { padding: 0 12px; margin: 0; }
@media (max-width: 640px) {
  .chat-log { height: 55vh; }
  .chat-input { flex-wrap: wrap; }
  .chat-input #chatTarget { width: 100%; }
  .userbox { order: 2; }
}

/* 홍보 주소 입력·운영자 확인 */
.link-list label { margin-bottom: 8px; }
#wAddLink { margin-bottom: 14px; }
.menu .count { background: var(--red); color: #fff; border-radius: 9px; padding: 0 6px; font-size: 11px; margin-left: 2px; }
.menu .count:empty { display: none; }
.item.rv { align-items: flex-start; }
.rv .rv-url { color: #6d6252; font-size: 12px; word-break: break-all; }
.rv-btns { display: flex; gap: 6px; flex-shrink: 0; align-items: center; flex-wrap: wrap; max-width: 280px; }

/* 게임 정보 추가 (11-12) */
.notes { color: var(--muted); font-size: 14px; padding-left: 20px; margin: 10px 0 0; }
.notes li { margin: 4px 0; }
.notes b { color: var(--text); }
.calc2 { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; }
.calc-top { display: flex; gap: 14px; flex-wrap: wrap; align-items: flex-end; margin-bottom: 12px; }
.calc-top label { display: flex; flex-direction: column; font-size: 13px; color: var(--muted); gap: 4px; }
.calc-top input, .calc-top select { width: 110px; }
.calc-t input { width: 70px; text-align: center; padding: 5px; }
.calc-pool { font-size: 14px; color: var(--muted); margin: 12px 0; }
.calc-pool b { color: var(--text); }
.warn-t { color: var(--red); font-weight: 700; }
.calc-res { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 8px; }
.calc-res div { background: #120f0c; border: 1px solid #2c241a; border-radius: 8px; padding: 10px 12px; display: flex; flex-direction: column; }
.calc-res span { color: var(--muted); font-size: 12px; }
.calc-res b { color: var(--gold2); font-size: 18px; }
.calc-res small { color: #6d6252; font-size: 11px; }
.stepper { white-space: nowrap; }
.stepper button { width: 28px; height: 28px; border-radius: 6px; border: 1px solid var(--line); background: #241d15; color: var(--text); font-size: 16px; line-height: 1; cursor: pointer; }
.stepper button:hover:not(:disabled) { border-color: var(--gold); }
.stepper button:disabled { opacity: .3; cursor: default; }
.stepper b { display: inline-block; min-width: 34px; text-align: center; color: var(--gold2); }
.calc-pool b.left { color: var(--green); }
.foot .legal { max-width: 720px; margin: 8px auto; line-height: 1.6; font-size: 12px; color: #6d6252; }

/* 홍보 문구 복사 */
.promo-copy { border: 1px solid var(--gold); border-radius: var(--radius); margin-bottom: 14px; background: #1b1610; overflow: hidden; }
.promo-copy-head { display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.promo-copy-head b { color: var(--gold2); }
.promo-copy-head span { color: var(--muted); font-size: 13px; flex: 1; }
.promo-copy pre { margin: 0; padding: 14px; max-height: 260px; overflow: auto; white-space: pre-wrap; word-break: break-word; font: 14px/1.7 "Noto Sans KR", "Malgun Gothic", sans-serif; color: var(--text); cursor: copy; }
.promo-copy pre:hover { background: #221b13; }
