/* === 프리서버 홍보 커뮤니티 — CSS 전면 재작성 === */

/* 테마: dark (겜터) */
:root, [data-theme="dark"] {
  --bg: #121218; --bg2: #1a1a24; --bg3: #22222e; --border: #2e2e3e;
  --text: #d4d4dc; --text2: #8e8e9e; --text3: #5e5e6e;
  --accent: #5b7ff5; --accent2: #7b9fff;
  --gold: #e8a820; --red: #e05050; --green: #40b060;
}
[data-theme="blue"] {
  --bg: #0c1220; --bg2: #142030; --bg3: #1c2d42; --border: #2a4060;
  --accent: #3b9eff; --accent2: #60b4ff;
}
[data-theme="green"] {
  --bg: #0e1610; --bg2: #162218; --bg3: #1e3020; --border: #2e4830;
  --accent: #45b860; --accent2: #65d880;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
body {
  font-family: 'Pretendard', -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
  background: var(--bg); color: var(--text); font-size: 14px; line-height: 1.5;
}
a { color: var(--text); text-decoration: none; }
a:hover { color: var(--accent2); }

/* ===== 레이아웃 ===== */
.container { max-width: 900px; margin: 0 auto; padding: 0 16px; }

/* 헤더 — fixed */
.header {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  background: var(--bg2); border-bottom: 1px solid var(--border); padding: 10px 0;
}
.header .container { max-width: 900px; }
.header-inner { display: flex; justify-content: space-between; align-items: center; }
.logo {
  font-size: 1.4rem; font-weight: 800;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
}
.header-nav { display: flex; gap: 4px; flex-wrap: wrap; }
.nav-link { padding: 4px 10px; font-size: 12px; color: var(--text2); border-radius: 3px; }
.nav-link:hover { background: var(--bg3); color: var(--text); }
.nav-more { color: var(--accent); }
.header-auth { display: flex; gap: 8px; align-items: center; }
.user-nick { font-size: 12px; color: var(--accent2); font-weight: 600; }
.auth-link { font-size: 12px; color: var(--text2); padding: 3px 8px; }
.auth-link:hover { color: var(--text); }
.auth-register { background: var(--accent); color: #fff !important; border-radius: 3px; }

/* 햄버거 */
.hamburger { display: none; background: none; border: none; padding: 6px; cursor: pointer; }
.hamburger span { display: block; width: 20px; height: 2px; background: var(--text2); margin: 4px 0; }
.mobile-menu { display: none; background: var(--bg2); border-bottom: 1px solid var(--border); padding: 8px 16px; }
.mobile-menu.open { display: block; }
.mobile-menu a { display: block; padding: 6px 0; color: var(--text2); font-size: 13px; }

/* 상단 배너 — fixed (헤더 바로 아래) */
.top-banner-wrap {
  position: fixed; top: 46px; left: 0; right: 0; z-index: 99;
  background: var(--bg); padding: 4px 0;
}
.top-banner-wrap .container { max-width: 900px; }
.top-banner {
  display: flex; justify-content: space-between; align-items: center;
  background: linear-gradient(135deg, #1a1a2e, #16213e, #1a1a2e);
  border: 1px solid rgba(91,127,245,0.25); border-radius: 6px; padding: 12px 20px;
}
.top-banner-left { display: flex; flex-direction: column; gap: 4px; }
.top-banner-line1 { display: flex; align-items: center; gap: 8px; }
.top-banner-line1 strong { color: #fff; font-size: 15px; font-weight: 800; }
.top-banner-sub { color: var(--text2); font-size: 12px; }
.top-banner-right { flex-shrink: 0; }
.top-banner-contact {
  display: inline-block; color: #fff; font-size: 13px; font-weight: 700;
  background: var(--accent); padding: 8px 18px; border-radius: 6px;
}
.top-banner-contact:hover { background: #4a6ee0; color: #fff; }

/* 좌우 고정 노출 — fixed (상단배너 bottom ≈122px 아래, banner-prime sticky와 일관) */
.fixed-ad {
  position: fixed; top: 130px; width: 160px; z-index: 50;
  max-height: calc(100vh - 150px);
  overflow: hidden;
}
.fixed-ad-left { left: calc(50% - 450px - 180px); }
.fixed-ad-right { right: calc(50% - 450px - 180px); }


/* 본문 시작 여백 (헤더46 + 상단배너 실측 ~80 + 안전 4px = 130px) */
.page-content { padding-top: 130px; }

/* ===== 배너 ===== */
.banner-slot {
  background: linear-gradient(135deg, rgba(91,127,245,0.06), rgba(69,184,96,0.04));
  border: 1px solid rgba(91,127,245,0.15); border-radius: 6px;
  padding: 12px; text-align: center; margin-bottom: 8px;
  min-height: 50px; display: flex; align-items: center; justify-content: center;
  position: relative;
}
/* 위치별 차별화된 placeholder */
.banner-slot::before {
  content: '✦ 후원 노출 자리'; position: absolute; top: 50%; left: 50%;
  transform: translate(-50%, -50%); font-size: 10px; color: var(--text3); opacity: 0.5;
  white-space: nowrap;
}
.banner-top::before { content: '◆ 상단 대형 노출'; font-size: 12px; }
.banner-mid::before { content: '◆ 중간 노출'; font-size: 11px; }
.banner-side::before { content: '◆ 사이드 노출'; font-size: 10px; }
.banner-third::before { content: '◇ 중형 노출'; font-size: 10px; }
.banner-inline::before { content: '◇ 인라인 노출'; font-size: 10px; }
.banner-prime::before {
  content: '★ 프리미엄 단독 — 모든 페이지 상단 노출';
  font-size: 13px; color: var(--gold); opacity: 0.85; font-weight: 700;
}

.banner-slot img { max-width: 100%; }
.banner-label { color: var(--text3); font-size: 11px; display: none; }
.banner-top { min-height: 70px; margin: 8px 0; }
.banner-mid { min-height: 60px; }
.banner-side { min-height: 160px; margin-bottom: 8px; }
.banner-inline { min-height: 40px; margin: 0; border: none; }
.banner-row { display: flex; gap: 8px; margin-bottom: 8px; }
.banner-half { flex: 1; min-height: 50px; }
.banner-third { flex: 1; min-height: 50px; }
.banner-in-table td { padding: 4px !important; border: none !important; }

/* ===== 프리미엄 노출 (모든 페이지 상단 sticky — F2 정식) ===== */
/* 주의: sticky 부모 = .container (본문 전체 높이). 래퍼 사용 금지 */
.banner-prime {
  position: sticky;
  top: 130px;  /* 헤더46 + 상단배너~80 + 안전4 */
  z-index: 60;
  min-height: 90px;
  margin-bottom: 16px;
  /* 불투명 배경 — 콘텐츠 비침 방지 */
  background: var(--bg2);
  border: 2px solid rgba(232, 168, 32, 0.5);
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
}

/* ===== 하단 노출 영역 (모든 페이지 동일 위치 자연흐름) ===== */
.bottom-ads-zone {
  margin-top: 32px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}
.bottom-ads-zone::before {
  content: '— 하단 노출 영역 —';
  display: block;
  text-align: center;
  font-size: 11px;
  color: var(--text3);
  margin-bottom: 12px;
  letter-spacing: 0.05em;
}

/* 태그 */
.ad-banner-tag {
  display: inline-block; padding: 2px 8px;
  background: var(--accent); color: #fff; border-radius: 3px;
  font-size: 10px; font-weight: 600;
}

/* ===== 서비스 카드 ===== */
.service-cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin-bottom: 8px; }
.service-card {
  background: var(--bg2); border: 1px solid var(--border); border-radius: 6px;
  padding: 10px 12px; text-decoration: none; color: var(--text); transition: border-color 0.2s;
}
.service-card:hover { border-color: var(--accent); color: var(--text); }
.service-icon { font-size: 22px; margin-bottom: 6px; }
.service-title { font-size: 13px; font-weight: 700; margin-bottom: 4px; }
.service-desc { font-size: 11px; color: var(--text2); line-height: 1.5; }

/* ===== 게시판 네비 ===== */
.board-nav { margin-bottom: 8px; }
.board-nav h2 { font-size: 14px; color: var(--text2); margin-bottom: 6px; font-weight: 700; }
.board-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 6px; }
.board-item { white-space: nowrap; overflow: hidden; }
.board-item {
  display: flex; justify-content: space-between; padding: 8px 10px;
  background: var(--bg2); border: 1px solid var(--border); border-radius: 4px; font-size: 12px;
}
.board-item:hover { border-color: var(--accent); background: rgba(91,127,245,0.08); }
.board-item:hover .board-name { color: var(--accent2); }
.board-name { color: var(--text); }
.board-count { color: var(--text3); font-size: 11px; }

/* ===== 섹션 헤더 ===== */
.section-header {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 8px; padding-bottom: 8px; border-bottom: 1px solid var(--border);
}
.section-header h2 { font-size: 16px; font-weight: 800; }

/* ===== 글 테이블 ===== */
.post-table {
  width: 100%; border-collapse: collapse; background: var(--bg2);
  border: 1px solid var(--border); border-radius: 4px; overflow: hidden;
  margin-bottom: 12px; table-layout: fixed;
}
.post-table thead { background: var(--bg3); }
.post-table th {
  padding: 6px 10px; font-size: 12px; color: var(--text2);
  font-weight: 700; text-align: left; border-bottom: 1px solid var(--border);
}
.post-table td { padding: 6px 10px; font-size: 13px; border-bottom: 1px solid var(--border); }
.col-title a { font-size: 14px; font-weight: 500; }
.post-table tbody tr:hover { background: rgba(91,127,245,0.08); }
.post-table tbody tr:hover .col-title a { color: var(--accent2); }
.post-table tbody tr.pinned { background: rgba(91,127,245,0.05); }
.post-table tbody tr.pinned td { color: var(--accent2); }

.col-num { width: 45px; text-align: center; color: var(--text3); white-space: nowrap; }
.col-board { width: 80px; white-space: nowrap; }
.col-title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.col-author { width: 70px; color: var(--text2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.col-date { width: 55px; color: var(--text3); font-size: 12px; white-space: nowrap; }
.col-views { width: 40px; text-align: center; color: var(--text3); font-size: 12px; white-space: nowrap; }

.board-tag {
  display: inline-block; padding: 2px 6px; background: var(--bg3);
  border-radius: 3px; font-size: 11px; color: var(--text2); white-space: nowrap; font-weight: 600;
}
.board-tag[data-board="lineage"] { background: rgba(239,68,68,0.15); color: #f87171; }
.board-tag[data-board="lineage2"] { background: rgba(168,85,247,0.15); color: #c084fc; }
.board-tag[data-board="mu"] { background: rgba(59,130,246,0.15); color: #60a5fa; }
.board-tag[data-board="maplestory"] { background: rgba(251,146,60,0.15); color: #fb923c; }
.board-tag[data-board="wow"] { background: rgba(234,179,8,0.15); color: #facc15; }
.board-tag[data-board="aion"] { background: rgba(56,189,248,0.15); color: #38bdf8; }
.board-tag[data-board="darkeden"] { background: rgba(139,92,246,0.15); color: #a78bfa; }
.board-tag[data-board="baram"] { background: rgba(45,212,191,0.15); color: #2dd4bf; }
.board-tag[data-board="dunfighter"] { background: rgba(249,115,22,0.15); color: #f97316; }
.board-tag[data-board="diablo"] { background: rgba(220,38,38,0.15); color: #ef4444; }
.board-tag[data-board="other"] { background: rgba(107,114,128,0.15); color: #9ca3af; }
.pin-badge {
  display: inline-block; padding: 1px 4px; background: var(--accent);
  color: #fff; border-radius: 2px; font-size: 10px; margin-right: 4px;
}
.new-badge {
  display: inline-block; padding: 1px 4px;
  background: linear-gradient(135deg, #e05050, #ff6b6b);
  color: #fff; border-radius: 3px; font-size: 9px; margin-left: 4px; font-weight: 700;
}
.empty-msg { text-align: center; padding: 40px; color: var(--text3); }

/* 페이징 */
.pagination { display: flex; justify-content: center; gap: 4px; margin: 12px 0; }
.pagination a {
  padding: 4px 10px; background: var(--bg2); border: 1px solid var(--border);
  border-radius: 3px; font-size: 13px; color: var(--text2);
}
.pagination a:hover { border-color: var(--accent); }
.pagination a.active { background: var(--accent); color: #fff; border-color: var(--accent); }

/* 글쓰기 버튼 */
.btn-write {
  padding: 6px 14px; background: var(--accent); color: #fff;
  border-radius: 3px; font-size: 13px; font-weight: 600; transition: all 0.15s;
}
.btn-write:hover { background: #4a6ee0; color: #fff; transform: translateY(-1px); }

/* ===== 글쓰기 폼 ===== */
.write-form { background: var(--bg2); border: 1px solid var(--border); border-radius: 4px; padding: 20px; }
.form-row { margin-bottom: 12px; }
.form-row label { display: block; font-size: 12px; color: var(--text2); margin-bottom: 4px; font-weight: 600; }
.form-control {
  width: 100%; padding: 8px 10px; background: var(--bg); border: 1px solid var(--border);
  border-radius: 3px; color: var(--text); font-size: 13px;
}
.form-control:focus { outline: none; border-color: var(--accent); }
.form-sm { max-width: 200px; }
textarea.form-control { resize: vertical; font-family: inherit; }
.form-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 16px; }
.btn-cancel { padding: 8px 16px; background: var(--bg3); color: var(--text2); border-radius: 3px; font-size: 13px; }
.btn-submit {
  padding: 8px 20px; background: var(--accent); color: #fff; border: none;
  border-radius: 3px; font-size: 13px; font-weight: 600; cursor: pointer;
}
.btn-submit:hover { background: #4a6ee0; }
.alert { padding: 10px 14px; border-radius: 3px; margin-bottom: 12px; font-size: 13px; }
.alert-error { background: rgba(224,80,80,0.12); border: 1px solid rgba(224,80,80,0.3); color: #f0a0a0; }

/* ===== 글 상세 ===== */
.post-view { background: var(--bg2); border: 1px solid var(--border); border-radius: 4px; margin-bottom: 12px; }
.post-view-header { padding: 16px 20px; border-bottom: 1px solid var(--border); }
.post-view-header h1 { font-size: 18px; font-weight: 700; margin-bottom: 8px; }
.post-view-meta { display: flex; gap: 16px; font-size: 12px; color: var(--text3); }
.post-view-content {
  padding: 20px; white-space: pre-wrap; line-height: 1.9; min-height: 200px;
  word-break: break-word; font-size: 13.5px; color: var(--text);
}
.post-view-content a { color: var(--accent2); text-decoration: underline; }
.post-view-content a:hover { color: var(--accent); }
.post-view-actions { display: flex; gap: 8px; padding: 12px 20px; border-top: 1px solid var(--border); }
.btn-copy {
  padding: 6px 14px; background: var(--green); color: #fff; border: none;
  border-radius: 3px; font-size: 13px; cursor: pointer;
}
.btn-copy:hover { opacity: 0.8; }
.btn-list { padding: 6px 14px; background: var(--bg3); color: var(--text2); border-radius: 3px; font-size: 13px; }
.btn-delete { padding: 6px 10px; background: var(--red); color: #fff; border: none; border-radius: 3px; font-size: 12px; cursor: pointer; }

/* 사이드바 (게시판 페이지 좌측 fixed에 포함) */
.sidebar-boards { background: var(--bg2); border: 1px solid var(--border); border-radius: 4px; padding: 10px; margin-bottom: 8px; }
.sidebar-boards h3 { font-size: 12px; color: var(--text3); margin-bottom: 6px; padding-bottom: 6px; border-bottom: 1px solid var(--border); }
.sidebar-boards a { display: block; padding: 4px 8px; font-size: 13px; color: var(--text2); border-radius: 3px; }
.sidebar-boards a:hover { background: var(--bg3); color: var(--text); }
.sidebar-boards a.active { color: var(--accent2); background: rgba(91,127,245,0.12); border-left: 2px solid var(--accent); padding-left: 10px; }

/* ===== 팝업 ===== */
.popup-overlay {
  position: fixed; top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.7); z-index: 9999;
  display: flex; align-items: center; justify-content: center;
}
.popup-box {
  background: var(--bg2); border: 1px solid var(--border); border-radius: 12px;
  padding: 32px 28px; max-width: 400px; width: 90%; text-align: center;
  position: relative; box-shadow: 0 20px 60px rgba(0,0,0,0.5);
}
.popup-close { position: absolute; top: 12px; right: 16px; background: none; border: none; color: var(--text3); font-size: 22px; cursor: pointer; }
.popup-badge { display: inline-block; padding: 4px 14px; background: linear-gradient(135deg, #5b7ff5, #45b860); color: #fff; border-radius: 20px; font-size: 12px; font-weight: 700; margin-bottom: 12px; }
.popup-title { font-size: 20px; font-weight: 800; margin-bottom: 10px; }
.popup-desc { font-size: 13px; color: var(--text2); line-height: 1.6; margin-bottom: 14px; }
.popup-list { list-style: none; text-align: left; margin: 0 auto 16px; max-width: 280px; }
.popup-list li { font-size: 13px; color: var(--text2); padding: 4px 0; }
.popup-cta { padding: 12px; background: var(--bg); border-radius: 6px; margin-bottom: 14px; }
.popup-btn { width: 100%; padding: 10px; background: var(--accent); color: #fff; border: none; border-radius: 6px; font-size: 14px; font-weight: 600; cursor: pointer; margin-bottom: 8px; }
.popup-check { font-size: 11px; color: var(--text3); cursor: pointer; }

/* ===== Auth ===== */
.auth-box { max-width: 360px; margin: 40px auto; background: var(--bg2); border: 1px solid var(--border); border-radius: 4px; padding: 24px; }
.auth-box h2 { font-size: 16px; margin-bottom: 16px; text-align: center; }

/* ===== Footer ===== */
.footer {
  background: var(--bg2); border-top: 1px solid var(--border);
  padding: 16px 0; text-align: center; color: var(--text3); font-size: 12px; margin-top: 24px;
}

/* 404 */
.not-found { text-align: center; padding: 80px 20px; }
.not-found h1 { font-size: 3rem; color: var(--accent); }

/* ===== 반응형 ===== */
@media (max-width: 1300px) {
  .fixed-ad { display: none; }
}
/* 768px 이하: 상단 배너 column 레이아웃 → padding-top 보강 */
@media (max-width: 768px) {
  .header-nav { display: none; }
  .hamburger { display: block; }
  .board-grid { grid-template-columns: repeat(3, 1fr); }
  .col-author, .col-date { display: none; }
  .service-cards { grid-template-columns: 1fr; }
  .top-banner { flex-direction: column; gap: 8px; text-align: center; }
  .top-banner-line1 { justify-content: center; }
  .page-content { padding-top: 180px; }
}
