/* PaceLeague 공용 디자인 시스템 (C-1) — index/login/post/crew/territory 가 공유.
   페이지별 고유 스타일은 각 HTML의 <style>에 그대로 둔다(이 파일 다음에 로드되어 우선). */

* { margin: 0; padding: 0; box-sizing: border-box; }
body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Malgun Gothic', sans-serif;
  background: #eef0f3;
  color: #1c2024;
  min-height: 100vh;
}
a { color: #e5342f; text-decoration: none; }
a:hover { color: #b8281f; }

/* ── 상단 다크 슬림 헤더 ─────────────────────────────────────────────── */
.topbar { background: #14161a; position: sticky; top: 0; z-index: 50; }
.topbar-inner { max-width: 1180px; margin: 0 auto; display: flex; align-items: center; gap: 22px; padding: 12px 20px; }
.brand { display: flex; align-items: center; gap: 9px; text-decoration: none; flex-shrink: 0; }
.brand:hover { color: inherit; }
.brand-mark { width: 28px; height: 28px; border-radius: 7px; display: block; flex-shrink: 0; object-fit: contain; }
.brand-name { font-size: 17px; font-weight: 700; letter-spacing: 0.4px; color: #fff; }
.header-nav { display: flex; gap: 4px; }
.navlink { font-size: 14px; font-weight: 600; color: #c8cbd0; text-decoration: none; border-radius: 8px; padding: 8px 16px; white-space: nowrap; }
.navlink:hover { background: #23262b; color: #fff; }
.navlink.active { color: #14161a; background: #fff; font-weight: 700; }
.header-actions { margin-left: auto; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.header-nick { color: #c8cbd0; font-size: 13px; margin-right: 2px; }

.btn {
  background: #e5342f; color: #fff; text-decoration: none; border: none;
  padding: 8px 16px; border-radius: 18px; font-size: 13px; font-weight: 700; cursor: pointer; line-height: 1;
  display: inline-block;
}
.btn:hover { background: #c62828; color: #fff; }
.btn.ghost { background: transparent; color: #e6e7e9; border: 1px solid #3a3f46; font-weight: 600; }
.btn.ghost:hover { background: #23262b; color: #fff; }
.btn.sm { padding: 6px 12px; font-size: 12px; }
.btn:disabled { opacity: 0.4; cursor: default; }

/* 밝은 배경(카드 안) 위에서 쓰는 고스트 버튼 */
.card .btn.ghost, .post-box .btn.ghost { color: #4a4e56; border-color: #d7dade; }
.card .btn.ghost:hover, .post-box .btn.ghost:hover { background: #f2f3f5; color: #1c2024; }

#lang-select {
  background: #1e2126; color: #c8cbd0; border: 1px solid #33373d; border-radius: 8px;
  padding: 6px 9px; font-size: 12px; cursor: pointer;
}

/* ── 모바일 하단 탭바 (데스크톱 숨김) ──────────────────────────────────── */
.bottom-nav {
  display: none; position: fixed; left: 0; right: 0; bottom: 0; z-index: 50;
  background: #fff; border-top: 1px solid #e3e5e9; padding: 7px 0 10px;
}
.bnav { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 3px; text-decoration: none; color: #9aa0a8; }
.bnav:hover { color: #6a6f78; }
.bnav svg { color: currentColor; }
.bnav-label { font-size: 10.5px; font-weight: 600; }
.bnav.active { color: #e5342f; }
.bnav.active .bnav-label { font-weight: 700; }

/* ── 공용 컨테이너 ─────────────────────────────────────────────────── */
.page { max-width: 1180px; margin: 0 auto; padding: 20px; }

/* ── 카드 / 텍스트 ─────────────────────────────────────────────────── */
.card { background: #fff; border: 1px solid #eceef1; border-radius: 14px; padding: 16px; margin-bottom: 12px; box-shadow: 0 1px 3px rgba(22,24,28,0.05); }
.card h2 { font-size: 15px; font-weight: 700; margin-bottom: 12px; color: #1c2024; }
.muted { color: #8a8e96; font-size: 13px; }
.msg { font-size: 13px; margin: 8px 0; min-height: 18px; }
.msg.err { color: #d02b22; }
.msg.ok { color: #1f8a4c; }
.hidden { display: none !important; }
.empty { text-align: center; color: #9aa0a8; padding: 36px 20px; }

/* ── 폼 컨트롤 (라이트) ─────────────────────────────────────────────── */
input[type=text], input[type=search], input[type=password], input[type=email], textarea, select:not(#lang-select) {
  width: 100%; background: #fff; border: 1px solid #d7dade; color: #1c2024;
  padding: 10px; border-radius: 8px; font-size: 14px;
}
textarea { min-height: 70px; resize: vertical; }
input:focus, textarea:focus, select:focus, [contenteditable]:focus { outline: none; border-color: #e5342f; }

/* ── 티어 배지 ─────────────────────────────────────────────────────── */
.author-tier, .tier-badge {
  display: inline-block; border-radius: 10px; padding: 1px 8px; font-size: 11px; font-weight: 700;
  background: #e9ebee; color: #5b616a;
}
.tier-BRONZE { background: #efe0d2; color: #7a4a12; }
.tier-SILVER { background: #e6e8ec; color: #5b616a; }
.tier-GOLD { background: linear-gradient(180deg,#ffe08a,#efb63a); color: #7a5600; }
.tier-PLATINUM { background: #dbe6ef; color: #3f5b73; }
.tier-DIAMOND { background: #d6ecf2; color: #1f6b7d; }
.tier-MASTER { background: #e7ddf5; color: #5b3ba0; }
.tier-CHALLENGER { background: #ffe0e0; color: #b3261e; }
.leader-badge { background: #fdeceb; color: #c62828; border-radius: 10px; padding: 1px 8px; font-size: 11px; font-weight: 700; }

/* 크루/게시글 작성자 옆 크루 배지 */
.crew-badge { display: inline-flex; align-items: center; gap: 3px; background: #edefff; color: #4a52c4; border-radius: 10px; padding: 1px 7px; font-size: 11px; font-weight: 600; }
.crew-badge img { width: 12px; height: 12px; border-radius: 3px; object-fit: cover; }

/* ── 순위 메달칩 (1·2·3위) ─────────────────────────────────────────── */
.top10-rank {
  width: 19px; height: 19px; flex-shrink: 0; display: inline-flex; align-items: center; justify-content: center;
  border-radius: 6px; font-weight: 700; font-variant-numeric: tabular-nums; color: #9aa0a8;
}
.top10-rank.rank-1 { background: linear-gradient(180deg,#ffe08a,#efb63a); color: #7a5600; }
.top10-rank.rank-2 { background: #dcdfe4; color: #5b616a; }
.top10-rank.rank-3 { background: #ecd3ad; color: #7a4a12; }

@media (max-width: 760px) {
  .header-nav { display: none; }
  .bottom-nav { display: flex; }
  .page { padding-bottom: 62px; }
  .topbar-inner { gap: 8px; padding: 10px 12px; }
  .brand-name { font-size: 14px; }
  .header-actions { gap: 6px; flex-wrap: nowrap; }
  .header-nick { display: none; }
  .btn { padding: 6px 10px; font-size: 11px; border-radius: 14px; }
  .btn.sm { padding: 5px 9px; }
  #lang-select { width: 52px; padding: 5px 4px; font-size: 11px; }
}
