@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+KR:wght@300;400;500;700&display=swap');

*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

:root {
  --bg:    #000;
  --bg2:   #0a0a0a;
  --bg3:   #111;
  --line:  rgba(255,255,255,.08);
  --text:  #f5f5f7;
  --muted: rgba(245,245,247,.5);
  --accent: #7ec8a0;       /* soft green */
  --accent2: #a0c4ff;      /* soft blue for secondary accent */
  --r: 18px;

  /* 라운드 스케일 + 포인트 컬러 소프트 글로우 그림자 (bunnyf.kr UI 패턴 참고, 다크 톤으로 재구성) */
  --r-sm: 10px;
  --r-md: 16px;
  --r-lg: 22px;
  --r-xl: 28px;
  --shadow-sm: 0 2px 14px rgba(126,200,160,.08);
  --shadow:    0 10px 32px rgba(126,200,160,.14);
  --shadow-lg: 0 18px 52px rgba(126,200,160,.2);
}

html { scroll-behavior: smooth; }

body {
  font-family: 'Noto Sans KR', -apple-system, BlinkMacSystemFont, sans-serif;
  /* 오버레이가 100% 불투명으로 수렴하지 않게 해서, fixed 배경이 스크롤 위치와 무관하게
     뷰포트 어디서든 항상 은은하게 비치도록 유지 (예전엔 88%부터 완전 검정이라 스크롤하면
     화면 하단이 통째로 까맣게 보였음) */
  background:
    linear-gradient(rgba(0,0,0,.55), rgba(0,0,0,.42) 45%, rgba(0,0,0,.6) 100%),
    var(--bg) url('../images/background.webp') center top / cover no-repeat fixed;
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* ── NAV ── */
nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 200;
  height: 52px;
  display: flex; align-items: center;
  padding: 0 28px;
  background: #161616;
  border-bottom: 1px solid rgba(255,255,255,.1);
  box-shadow: 0 2px 24px rgba(0,0,0,.7);
}
.nav-logo {
  font-size: .95rem; font-weight: 600; letter-spacing: .5px;
  color: var(--text);
  text-decoration: none;
  position: relative; z-index: 1;
}
.nav-menu {
  position: absolute; left: 0; right: 0;
  display: flex; gap: 6px; list-style: none;
  justify-content: center; align-items: center;
  pointer-events: none;
}
.nav-menu > li { position: relative; pointer-events: all; }
.nav-menu > li > a,
.nav-menu > li > .nav-drop-btn {
  display: flex; align-items: center; gap: 4px;
  font-size: .8rem; color: var(--text); text-decoration: none;
  letter-spacing: .3px; transition: color .2s;
  background: none; border: none; font-family: inherit; cursor: pointer;
  padding: 8px 10px;
}
.nav-menu > li > a:hover,
.nav-menu > li > .nav-drop-btn:hover,
.nav-menu > li.open > .nav-drop-btn { color: var(--accent); }
.nav-drop-btn .chev { width: 10px; height: 10px; transition: transform .2s; flex-shrink: 0; }
.nav-menu > li.open .nav-drop-btn .chev { transform: rotate(180deg); }

.nav-dropdown {
  position: absolute; top: calc(100% + 10px); left: 50%;
  min-width: 200px;
  background: #161616;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  padding: 8px;
  box-shadow: 0 12px 32px rgba(0,0,0,.55);
  opacity: 0; visibility: hidden;
  transform: translateX(-50%) translateY(-6px);
  transition: opacity .18s, transform .18s, visibility .18s;
}
.nav-menu > li.open .nav-dropdown {
  opacity: 1; visibility: visible;
  transform: translateX(-50%) translateY(0);
}
.nav-dropdown a {
  display: block;
  font-size: .82rem; color: var(--muted); text-decoration: none;
  padding: 9px 12px; border-radius: 8px;
  transition: background .15s, color .15s;
  white-space: nowrap;
}
.nav-dropdown a:hover { background: rgba(255,255,255,.06); color: var(--text); }

/* ── NAV MOBILE (burger + panel) ── */
.nav-burger {
  display: none;
  width: 32px; height: 32px;
  border: none; background: none; cursor: pointer;
  align-items: center; justify-content: center;
  position: relative; z-index: 1;
  margin-left: 10px; flex-shrink: 0;
}
.nav-burger span {
  display: block; width: 18px; height: 2px; background: var(--text);
  position: relative; transition: background .2s;
}
.nav-burger span::before, .nav-burger span::after {
  content: ''; position: absolute; left: 0; width: 18px; height: 2px; background: var(--text);
  transition: transform .2s, top .2s, opacity .2s;
}
.nav-burger span::before { top: -6px; }
.nav-burger span::after { top: 6px; }
.nav-burger.open span { background: transparent; }
.nav-burger.open span::before { top: 0; transform: rotate(45deg); }
.nav-burger.open span::after { top: 0; transform: rotate(-45deg); }

.nav-mobile-panel {
  display: none;
  position: fixed; top: 52px; left: 0; right: 0; z-index: 199;
  max-height: calc(100vh - 52px);
  overflow-y: auto;
  background: #161616;
  border-bottom: 1px solid var(--line);
  padding: 4px 20px 24px;
  box-shadow: 0 16px 32px rgba(0,0,0,.5);
}
.nav-mobile-panel.open { display: block; }
.nav-mobile-panel > a,
.nav-mobile-group-btn {
  display: flex; align-items: center; justify-content: space-between;
  width: 100%;
  font-size: .9rem; color: var(--text); text-decoration: none;
  padding: 15px 2px; border-bottom: 1px solid var(--line);
  background: none; border-left: none; border-right: none; border-top: none;
  font-family: inherit; text-align: left; cursor: pointer;
}
.nav-mobile-group .chev { width: 11px; height: 11px; transition: transform .2s; }
.nav-mobile-group.open .chev { transform: rotate(180deg); }
.nav-mobile-sub { display: none; padding-left: 12px; }
.nav-mobile-group.open .nav-mobile-sub { display: block; }
.nav-mobile-sub a {
  display: block;
  font-size: .85rem; color: var(--muted); text-decoration: none;
  padding: 13px 2px; border-bottom: 1px solid rgba(255,255,255,.05);
}
.nav-mobile-sub a:last-child { border-bottom: none; }
.nav-mobile-social-inner { display: flex; align-items: center; gap: 10px; }
.nav-mobile-social-inner svg { width: 16px; height: 12px; flex-shrink: 0; fill: #8b93f7; }
.nav-cta {
  display: inline-block;
  font-size: .8rem; font-weight: 500; color: var(--accent);
  background: rgba(126,200,160,.12);
  border: 1px solid rgba(126,200,160,.3);
  border-radius: 20px; padding: 6px 18px;
  cursor: pointer; font-family: inherit;
  text-decoration: none;
  transition: background .2s, border-color .2s;
}
.nav-cta:hover { background: rgba(126,200,160,.22); border-color: rgba(126,200,160,.6); }

/* ── NAV AUTH (right end) ── */
.nav-auth {
  margin-left: auto;
  display: flex; align-items: center; gap: 12px;
  position: relative; z-index: 1;
}
.nav-user {
  display: flex; align-items: center; gap: 10px;
  font-size: .8rem; color: var(--text);
}
.nav-user-name { font-weight: 500; }
.nav-logout {
  font-size: .75rem; color: var(--muted); text-decoration: none;
  transition: color .2s;
}
.nav-logout:hover { color: var(--text); }

/* ── SOCIAL TOOLBAR (우측 고정 커뮤니티 메뉴, 닫기/다시 열기 가능) ── */
.social-toolbar {
  position: fixed; right: 20px; top: 50%; z-index: 150;
  transform: translateY(-50%);
  width: 176px;
  background: rgba(10,10,10,.72);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255,255,255,.14);
  border-radius: var(--r-lg);
  padding: 10px;
  box-shadow: 0 12px 32px rgba(0,0,0,.4);
}
.social-toolbar-head {
  display: flex; align-items: center; justify-content: space-between;
  font-size: .68rem; font-weight: 600; letter-spacing: .5px;
  color: var(--muted); text-transform: uppercase;
  padding: 2px 4px 10px;
  margin-bottom: 6px;
  border-bottom: 1px solid var(--line);
}
.social-toolbar-close {
  background: none; border: none; color: var(--muted); cursor: pointer;
  font-size: .85rem; line-height: 1; padding: 2px;
  transition: color .2s;
}
.social-toolbar-close:hover { color: var(--text); }
.social-toolbar-item {
  display: flex; align-items: center; gap: 10px;
  padding: 8px;
  border-radius: var(--r-sm);
  text-decoration: none;
  color: var(--text);
  font-size: .82rem; font-weight: 600;
  transition: background .2s;
}
.social-toolbar-item:hover { background: rgba(88,101,242,.14); }
.social-toolbar-icon {
  width: 28px; height: 28px; flex-shrink: 0;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: rgba(88,101,242,.18);
}
.social-toolbar-icon svg { width: 13px; height: 10px; fill: #8b93f7; display: block; }

.social-toolbar-reopen {
  position: fixed; right: 20px; top: 50%; z-index: 150;
  transform: translateY(-50%);
  width: 44px; height: 44px;
  border-radius: 50%;
  background: rgba(10,10,10,.72);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255,255,255,.14);
  box-shadow: 0 10px 26px rgba(0,0,0,.4);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  transition: transform .15s, background .2s;
}
.social-toolbar-reopen svg { width: 16px; height: 12px; fill: #8b93f7; }
/* [hidden]과 명시적 display 규칙의 우선순위(specificity)가 같으면 나중에 쓰인 규칙이 이겨서
   hidden 속성이 무시되고 두 요소가 동시에 겹쳐 보이는 문제가 있었음 - 명시적으로 다시 감춘다 */
.social-toolbar[hidden],
.social-toolbar-reopen[hidden] { display: none; }
.social-toolbar-reopen:hover { transform: translateY(-50%) scale(1.08); background: rgba(20,20,20,.82); }

/* ── HERO ── */
#hero {
  min-height: 100vh;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  text-align: center;
  padding: 120px 24px 80px;
  position: relative;
  overflow: hidden;
}

/* subtle radial glow */
#hero::before {
  content: '';
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -60%);
  width: 800px; height: 600px;
  background: radial-gradient(ellipse, rgba(126,200,160,.12) 0%, transparent 70%);
  pointer-events: none;
}

/* ensure all hero children stack above the ::before overlay */
#hero > * { position: relative; z-index: 1; }

.hero-eyebrow {
  font-size: .75rem; font-weight: 500; letter-spacing: 3px;
  text-transform: uppercase; color: var(--accent);
  margin-bottom: 24px;
}

.hero-title {
  font-size: clamp(3.2rem, 9vw, 7.5rem);
  font-weight: 700;
  line-height: 1.02;
  letter-spacing: -2px;
  color: var(--text);
  margin-bottom: 24px;
}
.hero-title em {
  font-style: normal;
  background: linear-gradient(90deg, #7ec8a0, #a0c4ff);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-sub {
  font-size: clamp(.95rem, 2vw, 1.25rem);
  color: var(--muted);
  max-width: 520px;
  line-height: 1.7;
  margin-bottom: 48px;
  font-weight: 300;
}

.hero-actions { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; }

.btn-fill {
  display: inline-block;
  background: var(--text);
  color: #000;
  padding: 13px 32px;
  border-radius: 30px;
  font-size: .9rem; font-weight: 700;
  cursor: pointer; border: none; font-family: inherit;
  transition: opacity .2s, transform .15s;
  letter-spacing: .3px;
}
.btn-fill:hover { opacity: .85; transform: scale(1.02); }

.btn-ghost {
  display: inline-block;
  background: transparent;
  color: var(--accent);
  padding: 13px 32px;
  border-radius: 30px;
  font-size: .9rem; font-weight: 500;
  cursor: pointer;
  border: 1px solid rgba(126,200,160,.4);
  font-family: inherit;
  transition: border-color .2s, background .2s, transform .15s;
}
.btn-ghost:hover { border-color: var(--accent); background: rgba(126,200,160,.08); transform: scale(1.02); }

/* IP chip */
.ip-chip {
  margin-top: 60px;
  display: inline-flex; align-items: center; gap: 10px;
  background: rgba(255,255,255,.05);
  border: 1px solid var(--line);
  border-radius: 30px;
  padding: 10px 22px;
  font-size: .82rem;
  cursor: pointer;
  transition: border-color .2s, background .2s;
  color: var(--muted);
}
.ip-chip:hover { border-color: rgba(255,255,255,.2); background: rgba(255,255,255,.08); color: var(--text); box-shadow: var(--shadow-sm); }
.ip-chip .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); flex-shrink: 0; animation: pulse 2.5s infinite; }
.ip-chip .addr { color: var(--text); font-weight: 500; }
@keyframes pulse { 0%,100%{opacity:1;} 50%{opacity:.4;} }

/* 바니팜(bunnyf.kr) 히어로의 "hero-side-card" (아이콘 + 제목 + 부제) 패턴을 다크 톤으로 재구성.
   히어로 배경 사진 위에 얹히므로 terms-article/rank-card와 같은 반투명 유리 카드 톤(blur+어두운 배경)으로
   대비를 확보한다 - 처음엔 거의 투명해서 배경 사진에 묻혀 잘 안 보이는 문제가 있었음. */
.hero-side-card {
  margin-top: 18px;
  display: inline-flex; align-items: center; gap: 14px;
  background: rgba(10,10,10,.62);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255,255,255,.16);
  border-radius: var(--r-lg);
  padding: 12px 22px 12px 14px;
  text-decoration: none;
  box-shadow: 0 8px 28px rgba(0,0,0,.4), var(--shadow-sm);
  transition: border-color .2s, background .2s, transform .15s, box-shadow .2s;
}
.hero-side-card:hover {
  border-color: rgba(88,101,242,.55);
  background: rgba(14,14,14,.78);
  transform: translateY(-2px);
  box-shadow: 0 12px 34px rgba(0,0,0,.45), var(--shadow);
}
.hero-side-icon {
  width: 40px; height: 40px; flex-shrink: 0;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: rgba(88,101,242,.24);
}
.hero-side-body { display: flex; flex-direction: column; align-items: flex-start; gap: 1px; }
.hero-side-title { font-size: .88rem; font-weight: 700; color: var(--text); }
.hero-side-sub { font-size: .7rem; color: var(--muted); }

/* ── DIVIDER ── */
.divider { border: none; border-top: 1px solid var(--line); margin: 0; }

/* ── SECTION BASE ── */
section { padding: 120px 24px; }
.container { max-width: 980px; margin: 0 auto; }
.container-sm { max-width: 660px; margin: 0 auto; }

.label {
  font-size: .72rem; font-weight: 500; letter-spacing: 3px;
  text-transform: uppercase; color: var(--accent);
  margin-bottom: 14px;
}
.big-title {
  font-size: clamp(2rem, 5vw, 3.4rem);
  font-weight: 700; letter-spacing: -1px;
  line-height: 1.1; margin-bottom: 18px;
}
.body-text {
  font-size: 1rem; color: var(--muted);
  line-height: 1.8; font-weight: 300;
}

/* ── TERMS ── */
.terms-header {
  padding: 160px 24px 60px;
  text-align: center;
  background: linear-gradient(rgba(0,0,0,.35), rgba(0,0,0,.55));
  border-bottom: 1px solid var(--line);
}
.terms-meta {
  font-size: .82rem; color: var(--muted);
  margin-top: 10px;
}
.policy-crosslinks {
  display: flex; flex-wrap: wrap; gap: 8px;
  justify-content: center;
  margin-top: 22px;
}
.policy-pill {
  font-size: .72rem; color: var(--muted);
  background: rgba(255,255,255,.05);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 5px 14px;
  text-decoration: none;
  transition: border-color .2s, color .2s, background .2s;
}
.policy-pill:hover { color: var(--text); border-color: rgba(255,255,255,.2); background: rgba(255,255,255,.08); }
.policy-pill.active {
  color: var(--accent);
  border-color: rgba(126,200,160,.35);
  background: rgba(126,200,160,.1);
}
.terms-body { padding: 80px 24px 140px; }
.terms-chapter {
  font-size: 1.4rem; font-weight: 700; color: var(--text);
  letter-spacing: -.5px;
  margin: 72px 0 28px;
  padding: 10px 16px;
  border-bottom: 2px solid var(--accent);
  background: rgba(0,0,0,.4);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  border-radius: 10px 10px 0 0;
  text-shadow: 0 2px 12px rgba(0,0,0,.6);
}
.terms-chapter:first-child { margin-top: 0; }
.terms-article {
  background: rgba(8,8,8,.68);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 16px;
  padding: 28px 30px;
  box-shadow: 0 8px 28px rgba(0,0,0,.35);
}
.rule-table-wrap {
  overflow-x: auto;
  margin: 18px 0 8px;
  background: rgba(0,0,0,.35);
  border: 1px solid rgba(255,255,255,.14);
  border-radius: 10px;
}
.rule-table {
  width: 100%;
  border-collapse: collapse;
  font-size: .83rem;
  min-width: 560px;
}
.rule-table caption {
  caption-side: top;
  text-align: left;
  font-size: .78rem; font-weight: 700; color: var(--text);
  background: rgba(255,255,255,.05);
  padding: 11px 14px;
  border-bottom: 1px solid rgba(255,255,255,.12);
}
.rule-table th, .rule-table td {
  border-bottom: 1px solid rgba(255,255,255,.1);
  border-right: 1px solid rgba(255,255,255,.1);
  padding: 11px 14px;
  text-align: left;
  color: rgba(245,245,247,.72);
  vertical-align: top;
  font-weight: 300;
  word-break: keep-all;
  overflow-wrap: break-word;
}
.rule-table th:last-child, .rule-table td:last-child { border-right: none; }
.rule-table tr:last-child td { border-bottom: none; }
.rule-table thead th {
  background: rgba(255,255,255,.06);
  color: var(--text);
  font-weight: 700;
  font-size: .76rem;
  letter-spacing: .2px;
}
.rule-table tbody tr:nth-child(even) {
  background: rgba(255,255,255,.02);
}
.rule-table tbody tr:hover {
  background: rgba(255,255,255,.045);
}
.rule-table td.penalty { color: var(--text); font-weight: 500; }
.rule-table td.penalty em { color: #e59aa0; font-style: normal; font-weight: 600; }
.rule-table-note {
  font-size: .78rem; color: var(--muted);
  margin: 6px 0 0; line-height: 1.6;
}
/* 랭킹 페이지 - 홈페이지 본문 카드(class-card/bento-cell)와 같은 톤(--bg3/--line/--r)으로 맞춤 */
.rank-header {
  padding: 64px 24px 0;
  text-align: center;
}
.rank-header-sub {
  font-size: .9rem; color: var(--muted);
  margin-top: 4px;
}
.rank-body { padding: 32px 24px 100px; }
.rank-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 20px;
}
.rank-card {
  background: rgba(10,10,10,.5);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid var(--line);
  border-radius: var(--r);
  overflow: hidden;
}
.rank-card-header {
  display: flex; align-items: center; gap: 10px;
  padding: 18px 20px;
  background: rgba(0,0,0,.2);
  border-bottom: 1px solid var(--line);
}
.rank-card-icon { font-size: 1.15rem; line-height: 1; }
.rank-card-header h2 {
  font-size: 1rem; font-weight: 700; color: var(--text);
  margin: 0;
}
.rank-list { display: flex; flex-direction: column; }
.rank-row {
  display: flex; align-items: center; gap: 14px;
  padding: 13px 20px;
  border-bottom: 1px solid rgba(255,255,255,.06);
  transition: background .2s;
  text-decoration: none; color: inherit; cursor: pointer;
}
.rank-row:last-child { border-bottom: none; }
.rank-row:hover { background: rgba(255,255,255,.05); }
.rank-badge {
  flex-shrink: 0;
  width: 26px; height: 26px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: .8rem; font-weight: 700;
  background: rgba(255,255,255,.08); color: var(--muted);
}
.rank-badge-1 { background: #f0c14b; color: #2a1e00; }
.rank-badge-2 { background: #cdd6dd; color: #1c2226; }
.rank-badge-3 { background: #d6935f; color: #2a1200; }
.rank-head-icon {
  width: 34px; height: 34px;
  border-radius: 8px;
  image-rendering: pixelated;
  background: rgba(255,255,255,.06);
  flex-shrink: 0;
  object-fit: cover;
}
.rank-name {
  flex: 1;
  min-width: 0;
  font-size: .92rem; font-weight: 600; color: var(--text);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.rank-stat { text-align: right; flex-shrink: 0; }
.rank-stat-value { font-size: 1rem; font-weight: 700; color: var(--accent); line-height: 1.3; }
.rank-stat-label { font-size: .7rem; color: var(--muted); }
.rank-empty, .rank-error {
  padding: 28px 20px; text-align: center;
  font-size: .85rem; color: var(--muted);
}

/* 순위에서 플레이어를 클릭했을 때 이동하는 플레이어 정보 페이지(player.html) */
.player-back-link { color: var(--accent); text-decoration: none; font-size: .85rem; }
.player-back-link:hover { text-decoration: underline; }
.player-content { padding: 24px; }
.dashboard-head { display: flex; align-items: center; gap: 14px; margin-bottom: 20px; }
.dashboard-icon {
  width: 56px; height: 56px; border-radius: 12px;
  image-rendering: pixelated;
  background: rgba(255,255,255,.06);
  object-fit: cover; flex-shrink: 0;
}
.dashboard-name { font-size: 1.2rem; font-weight: 700; color: var(--text); }
.dashboard-rank { font-size: .85rem; color: var(--accent); margin-top: 3px; }
.dashboard-bio {
  font-size: .85rem; color: var(--muted); line-height: 1.6;
  padding: 12px 14px;
  background: rgba(255,255,255,.04);
  border-radius: 10px;
  margin-bottom: 14px;
}
.dashboard-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.dashboard-stats-1 { grid-template-columns: 1fr; }
.dashboard-stats-3 { grid-template-columns: 1fr 1fr 1fr; }
.dashboard-stat {
  text-align: center;
  padding: 14px 10px;
  background: rgba(255,255,255,.04);
  border-radius: 10px;
}
.dashboard-stat-value { font-size: 1.05rem; font-weight: 700; color: var(--accent); }
.dashboard-stat-value.is-private { color: var(--muted); font-weight: 500; font-size: .85rem; }
.dashboard-stat-label { font-size: .72rem; color: var(--muted); margin-top: 4px; }

/* 바니팜 "소셜" 카드처럼 원형 아이콘 + 라벨/값/설명 텍스트를 가로로 배치하는 스탯 박스 */
.dashboard-stat-row {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 14px;
  background: rgba(255,255,255,.04);
  border-radius: 10px;
  min-width: 0;
}
.dashboard-stat-row-icon {
  width: 38px; height: 38px;
  border-radius: 50%;
  background: rgba(255,255,255,.06);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.05rem;
  flex-shrink: 0;
}
.dashboard-stat-row-text { min-width: 0; flex: 1; }
.dashboard-stat-row-label { font-size: .68rem; color: var(--muted); }
.dashboard-stat-row-value {
  font-size: .95rem; font-weight: 700; color: var(--text);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.dashboard-stat-row-caption {
  font-size: .66rem; color: var(--muted); margin-top: 1px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

/* 바니팜 플레이어 페이지처럼 섹션마다 제목이 있는 카드로 나눠 보여준다(재화/소셜/채집 기록/수집품 등) */
.dashboard-section {
  background: rgba(0,0,0,.15);
  border: 1px solid var(--line);
  border-radius: 10px;
  margin-bottom: 14px;
  overflow: hidden;
}
.dashboard-section:last-child { margin-bottom: 0; }
.dashboard-section-header {
  display: flex; align-items: center; gap: 8px;
  padding: 12px 16px;
  background: rgba(0,0,0,.15);
  border-bottom: 1px solid var(--line);
}
.dashboard-section-icon { font-size: .95rem; line-height: 1; }
.dashboard-section-header h2 {
  flex: 1;
  font-size: .82rem; font-weight: 700; color: var(--text);
  margin: 0;
}
.dashboard-section-badge { font-size: .7rem; font-weight: 500; color: var(--muted); }
.dashboard-section-body { padding: 14px 16px; }
.dashboard-tools-empty { font-size: .8rem; color: var(--muted); text-align: center; padding: 8px 0; }
.dashboard-tools-notice {
  font-size: .72rem; color: var(--muted);
  background: rgba(255,255,255,.03);
  border-radius: 6px;
  padding: 6px 10px;
  margin-bottom: 8px;
}
.dashboard-tool-row {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 0;
  border-bottom: 1px solid rgba(255,255,255,.06);
  font-size: .8rem;
}
.dashboard-tool-row:last-child { border-bottom: none; }
.dashboard-tool-name { color: var(--text); font-weight: 600; }
.dashboard-tool-icon {
  width: 24px; height: 24px;
  border-radius: 6px;
  image-rendering: pixelated;
  background: rgba(255,255,255,.06);
  object-fit: cover;
  flex-shrink: 0;
}
.dashboard-tool-icon-empty { background: transparent; }
.dashboard-loading, .dashboard-error {
  text-align: center; padding: 20px 0;
  font-size: .85rem; color: var(--muted);
}

/* 순위 행 클릭 시(관리자 등) 페이지 이동 없이 잠깐 띄우는 경고 토스트 */
.rank-warning-toast {
  position: fixed;
  top: 90px; left: 50%;
  transform: translateX(-50%) translateY(-10px);
  background: var(--bg3);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 12px 20px;
  font-size: .85rem; color: var(--text);
  box-shadow: 0 8px 24px rgba(0,0,0,.35);
  opacity: 0; pointer-events: none;
  transition: opacity .2s, transform .2s;
  z-index: 2000;
}
.rank-warning-toast.is-visible {
  opacity: 1; transform: translateX(-50%) translateY(0);
}
.terms-article { margin-bottom: 44px; }
.terms-article:last-child { margin-bottom: 0; }
.terms-article h2 {
  font-size: 1.15rem; font-weight: 700;
  color: var(--text);
  margin-bottom: 14px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}
.terms-article p {
  font-size: .92rem; color: var(--muted);
  line-height: 1.85; font-weight: 300;
  margin-bottom: 10px;
}
.terms-article ol,
.terms-article ul {
  margin: 14px 0 0;
  padding-left: 0;
  list-style: none;
  display: flex; flex-direction: column; gap: 10px;
}
.terms-article li {
  font-size: .9rem; color: var(--muted);
  line-height: 1.75; font-weight: 300;
  padding-left: 26px;
  position: relative;
}
.terms-article ol { counter-reset: terms-counter; }
.terms-article ol > li { counter-increment: terms-counter; }
.terms-article ol > li::before {
  content: counter(terms-counter) ".";
  position: absolute; left: 0; top: 0;
  color: var(--accent); font-weight: 600;
  font-size: .85rem;
}
.terms-article ul > li::before {
  content: '·';
  position: absolute; left: 6px; top: 0;
  color: var(--accent); font-weight: 700;
}
.terms-article li strong { color: var(--text); font-weight: 600; }
.terms-chat-box {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-top: 16px;
}
.terms-chat-card {
  background: var(--bg3);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 22px 24px;
}
.terms-chat-card .chat-tag {
  display: inline-block;
  font-size: .68rem; letter-spacing: 1.5px;
  text-transform: uppercase;
  padding: 3px 10px; border-radius: 20px;
  background: rgba(126,200,160,.1);
  color: var(--accent);
  border: 1px solid rgba(126,200,160,.2);
  margin-bottom: 12px;
}
.terms-chat-card h3 {
  font-size: .95rem; font-weight: 700; color: var(--text);
  margin-bottom: 8px;
}
.terms-chat-card p {
  font-size: .85rem; color: var(--muted);
  line-height: 1.7; font-weight: 300;
  margin: 0;
}
@media (max-width: 700px) {
  .terms-chat-box { grid-template-columns: 1fr; }
}

/* ── FEATURE BENTO ── */
#features { background: rgba(0,0,0,.55); }
.bento {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2px;
}
.bento-cell {
  background: var(--bg3);
  padding: 52px 40px;
  transition: background .25s, box-shadow .25s;
}
.bento-cell:hover { background: #161616; box-shadow: var(--shadow-sm); }
.bento-cell:first-child { border-radius: var(--r) 0 0 0; }
.bento-cell:nth-child(3) { border-radius: 0 var(--r) 0 0; }
.bento-cell:nth-child(4) { border-radius: 0 0 0 var(--r); }
.bento-cell:last-child { border-radius: 0 0 var(--r) 0; }

.cell-icon {
  font-size: 2rem;
  margin-bottom: 20px;
  display: block;
  line-height: 1;
}
.cell-title {
  font-size: 1.05rem; font-weight: 700;
  margin-bottom: 10px; color: var(--text);
}
.cell-desc {
  font-size: .88rem; color: var(--muted);
  line-height: 1.75; font-weight: 300;
}

/* wide cell */
.bento-cell.wide { grid-column: span 2; }

/* ── RPG STORY ── */
#story {
  background: rgba(10,10,10,.55);
}
.story-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 80px;
  align-items: center;
}
.story-visual {
  aspect-ratio: 1;
  border-radius: var(--r-xl);
  background: var(--bg3);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-sm);
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: 8px;
  position: relative;
  overflow: hidden;
}
/* pixel-ish map graphic */
.story-visual::before {
  content: '';
  position: absolute; inset: 0;
  background:
    repeating-linear-gradient(0deg, rgba(255,255,255,.02) 0 1px, transparent 1px 40px),
    repeating-linear-gradient(90deg, rgba(255,255,255,.02) 0 1px, transparent 1px 40px);
}
.pixel-map {
  position: relative; z-index: 1;
  display: grid;
  grid-template-columns: repeat(7, 32px);
  grid-template-rows: repeat(7, 32px);
  gap: 3px;
}
.pm { border-radius: 4px; }
.g  { background: #2d6a35; }
.g2 { background: #3a8445; }
.w  { background: #1b4d7a; }
.s  { background: #5c4a2a; }
.m  { background: #4a4a4a; }
.t  { background: #7a5a2a; }
.e  { background: rgba(255,255,255,.04); border: 1px solid rgba(255,255,255,.06); }

/* ── CLASS SELECT ── */
#classes { background: rgba(0,0,0,.55); }
.class-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}
.class-card {
  background: var(--bg3);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 32px 20px 28px;
  text-align: center;
  cursor: default;
  box-shadow: var(--shadow-sm);
  transition: border-color .25s, background .25s, transform .2s, box-shadow .25s;
}
.class-card:hover { border-color: rgba(126,200,160,.35); background: #141414; transform: translateY(-4px); box-shadow: var(--shadow); }
.class-emoji { font-size: 2.4rem; margin-bottom: 16px; display: block; }
.class-name { font-size: 1rem; font-weight: 700; margin-bottom: 8px; }
.class-desc { font-size: .8rem; color: var(--muted); line-height: 1.65; font-weight: 300; }
.class-tag {
  display: inline-block;
  margin-top: 14px;
  font-size: .65rem; letter-spacing: 2px;
  text-transform: uppercase;
  padding: 3px 10px; border-radius: 20px;
  background: rgba(126,200,160,.1);
  color: var(--accent);
  border: 1px solid rgba(126,200,160,.2);
}

/* 직업별로 색을 다르게 주는 뱃지 톤 (bunnyf.kr의 tint 배지 시스템을 다크 톤으로 재구성) */
.tag-green  { background: rgba(93,187,111,.14);  color: #8fe0a5; border-color: rgba(93,187,111,.32); }
.tag-blue   { background: rgba(79,195,247,.14);   color: #8bd7fb; border-color: rgba(79,195,247,.32); }
.tag-sky    { background: rgba(135,206,235,.14);  color: #aee3f5; border-color: rgba(135,206,235,.32); }
.tag-amber  { background: rgba(212,160,23,.16);   color: #e9c26a; border-color: rgba(212,160,23,.34); }
.tag-rose   { background: rgba(226,96,60,.16);    color: #f2a488; border-color: rgba(226,96,60,.34); }
.tag-red    { background: rgba(231,76,60,.16);    color: #f29b90; border-color: rgba(231,76,60,.34); }
.tag-purple { background: rgba(168,85,247,.16);   color: #cfa8fa; border-color: rgba(168,85,247,.34); }

/* ── JOIN ── */
#join {
  background: var(--bg2);
  text-align: center;
}
.join-ip-box {
  display: inline-flex; align-items: center; gap: 16px;
  background: var(--bg3);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 24px 36px;
  margin: 44px 0 56px;
  flex-wrap: wrap; justify-content: center;
}
.join-label { font-size: .72rem; color: var(--muted); letter-spacing: 1px; }
.join-addr  { font-size: 1.5rem; font-weight: 700; letter-spacing: 2px; color: var(--text); }

/* launcher grid */
.launcher-label {
  font-size: .72rem; font-weight: 500; letter-spacing: 3px;
  text-transform: uppercase; color: var(--muted);
  margin-bottom: 20px;
}
.launcher-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  max-width: 860px;
  margin: 0 auto;
}
.launcher-card {
  background: var(--bg3);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  padding: 24px 16px 20px;
  text-align: center;
  transition: border-color .2s, background .2s, box-shadow .2s;
}
.launcher-card:hover { border-color: rgba(255,255,255,.18); background: #161616; box-shadow: var(--shadow-sm); }
.launcher-card.supported { border-color: rgba(126,200,160,.25); }
.launcher-card.supported:hover { border-color: var(--accent); box-shadow: var(--shadow); }
.launcher-icon { font-size: 1.8rem; margin-bottom: 10px; display: block; }
.launcher-name { font-size: .88rem; font-weight: 700; margin-bottom: 4px; }
.launcher-status {
  font-size: .68rem; letter-spacing: 1.5px; text-transform: uppercase;
  margin-bottom: 16px; font-weight: 500;
}
.launcher-status.ok  { color: var(--accent); }
.launcher-status.no  { color: rgba(255,255,255,.25); }
.launcher-btn {
  display: inline-block; width: 100%;
  padding: 9px 0;
  border-radius: 20px;
  font-size: .78rem; font-weight: 700;
  cursor: pointer; border: none; font-family: inherit;
  text-decoration: none;
  transition: opacity .2s;
}
.launcher-btn.primary { background: var(--accent); color: #000; }
.launcher-btn.primary:hover { opacity: .8; }
.launcher-btn.secondary {
  background: transparent;
  color: var(--text);
  border: 1px solid rgba(255,255,255,.15);
}
.launcher-btn.secondary:hover { border-color: rgba(255,255,255,.4); }
.copy-btn {
  background: var(--accent);
  color: #000;
  border: none; border-radius: 20px;
  padding: 9px 22px;
  font-size: .82rem; font-weight: 700;
  cursor: pointer; font-family: inherit;
  transition: opacity .2s;
}
.copy-btn:hover { opacity: .8; }

@media (max-width: 700px) {
  .launcher-grid { grid-template-columns: repeat(2, 1fr); }
}

/* ── EVENTS / BINGO ── */
.event-note {
  border: 1px dashed rgba(126,200,160,.35);
  background: rgba(126,200,160,.05);
}
.bingo-progress {
  font-size: .85rem; font-weight: 600; color: var(--accent);
  margin-bottom: 16px;
}
.bingo-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 6px;
  margin-bottom: 18px;
}
.bingo-cell {
  aspect-ratio: 1;
  display: flex; align-items: center; justify-content: center;
  text-align: center;
  padding: 6px;
  font-size: .68rem; line-height: 1.35; font-weight: 500;
  color: var(--muted);
  background: var(--bg3);
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  cursor: pointer;
  transition: background .2s, border-color .2s, color .2s, transform .15s, box-shadow .2s;
  user-select: none;
}
.bingo-cell:hover { border-color: rgba(255,255,255,.25); transform: translateY(-2px); box-shadow: var(--shadow-sm); }
.bingo-cell.free { color: var(--accent); font-weight: 700; }
.bingo-cell.done {
  background: rgba(126,200,160,.16);
  border-color: rgba(126,200,160,.55);
  color: var(--text);
  box-shadow: var(--shadow-sm);
}
.bingo-cell.bingo-line {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent) inset;
}
.bingo-reset {
  background: transparent;
  color: var(--muted);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 8px 20px;
  font-size: .78rem; font-family: inherit;
  cursor: pointer;
  transition: border-color .2s, color .2s;
}
.bingo-reset:hover { color: var(--text); border-color: rgba(255,255,255,.3); }
@media (max-width: 480px) {
  .bingo-cell { font-size: .6rem; padding: 4px; }
}

/* ── FOOTER ── */
footer {
  border-top: 1px solid var(--line);
  background: rgba(0,0,0,.65);
  padding: 60px 24px;
}
.footer-inner {
  max-width: 980px; margin: 0 auto;
  display: flex; justify-content: space-between; align-items: flex-start;
  flex-wrap: wrap; gap: 32px;
}
.footer-logo { font-size: 1rem; font-weight: 500; color: var(--text); }
.footer-sub  { font-size: .78rem; color: var(--muted); margin-top: 6px; font-weight: 300; }
.footer-copy { font-size: .72rem; color: rgba(245,245,247,.25); }

/* ── REVEAL ── */
.r { opacity: 0; transform: translateY(24px); transition: opacity .7s ease, transform .7s ease; }
.r.show { opacity: 1; transform: translateY(0); }

/* ── RESPONSIVE ── */
@media (max-width: 800px) {
  .bento { grid-template-columns: 1fr; }
  .bento-cell.wide { grid-column: span 1; }
  .bento-cell:first-child { border-radius: var(--r) var(--r) 0 0; }
  .bento-cell:nth-child(3) { border-radius: 0; }
  .bento-cell:nth-child(4) { border-radius: 0; }
  .bento-cell:last-child { border-radius: 0 0 var(--r) var(--r); }
  .story-layout { grid-template-columns: 1fr; gap: 40px; }
  .class-grid { grid-template-columns: repeat(2, 1fr); }
  .nav-menu { display: none; }
  .nav-burger { display: flex; }
  .social-toolbar, .social-toolbar-reopen { display: none; }
}
@media (max-width: 480px) {
  .class-grid { grid-template-columns: 1fr; }
}
@media (max-width: 360px) {
  .nav-user-name { max-width: 70px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
}
