/* ══════════════════════════════════════════════
   나이트 서브사이트 — 밝은 테마 (네이버/구글 스타일)
   도시의 밤을 지배하라 | 밤키
   ══════════════════════════════════════════════ */
:root {
  --bg: #FFFFFF;
  --bg-page: #F5F5F5;
  --bg-card: #FFFFFF;
  --text: #111111;
  --text-sub: #333333;
  --text-dim: #555555;
  --accent: #8B5CF6;
  --accent-hover: #7C3AED;
  --cyan: #06B6D4;
  --purple: #8B5CF6;
  --border: #D1D5DB;
  --border-hover: #9CA3AF;
  --shadow: 0 1px 3px rgba(0,0,0,0.08);
  --shadow-hover: 0 4px 12px rgba(0,0,0,0.12);
  --radius: 16px;
  --font: 'Noto Sans KR', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { background: var(--bg-page); }
body {
  max-width: 480px;
  margin: 0 auto;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.75;
  letter-spacing: -0.02em;
  word-break: keep-all;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.sr-only { position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0; }

/* ══════════ TOP BANNER (밤키 유도) ══════════ */
.bamki-banner {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: var(--purple);
  padding: 10px 16px;
  text-align: center;
}
.bamki-banner a {
  color: #fff;
  font-size: 14px;
  font-weight: 700;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.bamki-banner .star { color: #FFD700; font-size: 16px; }

/* ══════════ NAV ══════════ */
.top-nav {
  background: #fff;
  border-bottom: 1px solid var(--border);
}
.top-nav-inner {
  display: flex;
  gap: 2px;
  overflow-x: auto;
  scrollbar-width: none;
  padding: 0 12px;
}
.top-nav-inner::-webkit-scrollbar { display: none; }
.top-nav-link {
  flex-shrink: 0;
  padding: 10px 14px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-dim);
  text-decoration: none;
  white-space: nowrap;
  border-bottom: 2px solid transparent;
  transition: color .2s, border-color .2s;
}
.top-nav-link:hover { color: var(--text); }
.top-nav-link.active { color: var(--accent); border-bottom-color: var(--accent); }

/* ══════════ HERO ══════════ */
.hero {
  background: linear-gradient(180deg, #F8F7FF 0%, #FFFFFF 100%);
  padding: 44px 20px 36px;
  text-align: center;
}
.hero-badge {
  display: inline-block;
  background: var(--accent);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 2px;
  padding: 4px 14px;
  border-radius: 999px;
  margin-bottom: 16px;
}
.hero-title {
  font-size: 28px;
  font-weight: 900;
  color: var(--text);
  line-height: 1.3;
  margin-bottom: 8px;
}
.neon { color: var(--accent); }
.hero-sub {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 4px;
  color: var(--text-dim);
  margin-bottom: 14px;
}
.hero-desc {
  font-size: 15px;
  color: var(--text-sub);
  margin-bottom: 20px;
  line-height: 1.7;
}
.hero-stat {
  margin-top: 14px;
  font-size: 13px;
  color: var(--accent);
  font-weight: 600;
  text-align: center;
}

/* ══════════ SEARCH ══════════ */
.search-box { position: relative; }
.search-box input {
  width: 100%;
  padding: 13px 20px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: #F9FAFB;
  color: var(--text);
  font-size: 15px;
  font-family: var(--font);
  outline: none;
  transition: border-color .2s, box-shadow .2s;
}
.search-box input::placeholder { color: #767676; }
.search-box input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(139,92,246,0.1); }
.search-dropdown {
  position: absolute;
  top: calc(100% + 4px);
  left: 0; right: 0;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 8px 32px rgba(0,0,0,0.12);
  overflow: hidden;
  display: none;
  z-index: 200;
}
.search-dropdown.open { display: block; }
.dd-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  cursor: pointer;
  transition: background .15s;
  text-decoration: none;
  color: inherit;
}
.dd-item:hover { background: #F3F4F6; }
.dd-info { display: flex; flex-direction: column; min-width: 0; }
.dd-name { font-size: 14px; font-weight: 600; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dd-region { font-size: 12px; color: var(--text-dim); }
.dd-arrow { margin-left: auto; color: var(--accent); font-weight: 700; }

/* ══════════ FILTERS ══════════ */
.filters {
  position: sticky;
  top: 38px;
  z-index: 100;
  background: rgba(255,255,255,0.95);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  padding: 10px 0;
}
.filters-inner {
  padding: 0 12px;
  display: flex;
  gap: 6px;
  overflow-x: auto;
  scrollbar-width: none;
}
.filters-inner::-webkit-scrollbar { display: none; }
.filter-btn {
  flex-shrink: 0;
  padding: 7px 14px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: #fff;
  color: var(--text-dim);
  font-size: 13px;
  font-weight: 500;
  font-family: var(--font);
  cursor: pointer;
  transition: all .2s;
  white-space: nowrap;
}
.filter-btn:hover { border-color: var(--accent); color: var(--accent); }
.filter-btn.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
  font-weight: 700;
}

/* ══════════ SECTIONS ══════════ */
.section { padding: 28px 16px; }
.section-inner { max-width: 480px; margin: 0 auto; }
.section-title {
  font-size: 19px;
  font-weight: 800;
  color: var(--text);
  margin-bottom: 18px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.accent-dot {
  width: 8px; height: 8px;
  background: var(--accent);
  border-radius: 50%;
  display: inline-block;
}

/* ══════════ RANKINGS ══════════ */
.ranking-section { padding: 28px 16px; }
.rank-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 8px;
  cursor: pointer;
  transition: all .2s;
  text-decoration: none;
  color: inherit;
  box-shadow: var(--shadow);
}
.rank-card:hover { border-color: var(--border-hover); box-shadow: var(--shadow-hover); transform: translateY(-1px); }
.rank-badge {
  flex-shrink: 0;
  width: 32px; height: 32px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 900;
  color: #fff;
  background: var(--accent);
}
.rank-badge.gold { background: linear-gradient(135deg, #F59E0B, #D97706); }
.rank-badge.silver { background: linear-gradient(135deg, #94A3B8, #64748B); }
.rank-badge.bronze { background: linear-gradient(135deg, #CD7F32, #A0522D); }
.rank-name { font-size: 15px; font-weight: 700; color: var(--text); flex: 1; }
.rank-region { font-size: 12px; color: var(--text-dim); margin-right: 4px; }
.rank-arrow { color: var(--accent); font-weight: 700; }
.rank-cta {
  display: block;
  margin-top: 12px;
  padding: 14px;
  background: #F8F7FF;
  border: 1px dashed var(--accent);
  border-radius: var(--radius);
  text-align: center;
  color: var(--accent);
  font-size: 14px;
  font-weight: 700;
  text-decoration: none;
  transition: all .2s;
}
.rank-cta:hover { background: #EDE9FE; }

/* ══════════ PREMIUM CARDS ══════════ */
.premium-section { padding: 28px 16px; }
.premium-card {
  background: #fff;
  border: 1px solid #D1D5DB;
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 12px;
  position: relative;
  overflow: hidden;
  transition: all .2s;
  min-height: 280px;
  box-shadow: var(--shadow);
}
.premium-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 3px;
  background: linear-gradient(90deg, var(--purple), var(--cyan));
}
.premium-card:hover { box-shadow: var(--shadow-hover); transform: translateY(-2px); }
.premium-badge {
  display: inline-block;
  background: var(--purple);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1px;
  padding: 3px 10px;
  border-radius: 6px;
  margin-bottom: 10px;
}
.premium-name { font-size: 18px; font-weight: 800; color: var(--text); margin-bottom: 4px; }
.premium-type { font-size: 13px; color: var(--accent); font-weight: 600; margin-bottom: 8px; }
.premium-hook { font-size: 14px; color: var(--text-sub); line-height: 1.7; margin-bottom: 12px; }
.premium-nickname { font-size: 13px; color: var(--text-dim); margin-bottom: 4px; }
.premium-phone {
  display: block;
  font-size: 22px;
  font-weight: 900;
  color: var(--accent);
  text-decoration: none;
  letter-spacing: 1px;
  margin-bottom: 12px;
}
.premium-phone:hover { color: var(--accent-hover); }
.premium-detail-btn {
  display: block;
  padding: 10px;
  text-align: center;
  background: var(--accent);
  color: #fff;
  font-size: 14px;
  font-weight: 700;
  border-radius: 8px;
  text-decoration: none;
  transition: background .2s;
}
.premium-detail-btn:hover { background: var(--accent-hover); }
.premium-tags { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 10px; }

/* ══════════ GRID ══════════ */
.grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}
.listing-count { font-size: 13px; color: var(--text-dim); margin-bottom: 16px; }
.no-results { text-align: center; padding: 48px 0; color: var(--text-dim); font-size: 15px; }

/* ══════════ CARD ══════════ */
.card-link { display: block; color: inherit; text-decoration: none; }
.card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: all .2s;
  cursor: pointer;
  box-shadow: var(--shadow);
}
.card:hover { border-color: var(--border-hover); box-shadow: var(--shadow-hover); transform: translateY(-2px); }
.card-body { padding: 16px; display: flex; flex-direction: column; min-height: 200px; }
.card-meta { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.card-region {
  flex-shrink: 0;
  font-size: 11px;
  font-weight: 700;
  color: #fff;
  background: var(--accent);
  padding: 2px 10px;
  border-radius: 999px;
}
.card-type { font-size: 11px; color: var(--cyan); font-weight: 600; }
.card-name { font-size: 16px; font-weight: 800; color: var(--text); margin-bottom: 6px; line-height: 1.3; word-break: keep-all; overflow-wrap: break-word; }
.card-hook {
  font-size: 14px;
  color: var(--text-sub);
  line-height: 1.7;
  margin-bottom: 8px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.card-value { font-size: 12px; color: var(--text-dim); margin-bottom: 8px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card-tags { display: flex; flex-wrap: nowrap; gap: 4px; overflow: hidden; margin-top: auto; }
.card-tag {
  flex-shrink: 0;
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 999px;
  background: #F3F4F6;
  border: 1px solid #E5E7EB;
  color: var(--text-dim);
  white-space: nowrap;
}
.card-detail-btn {
  display: block;
  margin-top: 10px;
  padding: 8px 0;
  text-align: center;
  background: var(--accent);
  color: #fff;
  font-size: 14px;
  font-weight: 700;
  border-radius: 8px;
  transition: all .2s;
}
.card:hover .card-detail-btn { background: var(--accent-hover); }

/* ══════════ CTA SECTIONS ══════════ */
.cta-section { padding: 20px 16px; }
.cta-box {
  background: #F8F7FF;
  border: 1px solid #E5E7EB;
  border-radius: var(--radius);
  padding: 24px 20px;
  text-align: center;
}
.cta-icon { font-size: 28px; margin-bottom: 8px; }
.cta-title { font-size: 17px; font-weight: 800; color: var(--text); margin-bottom: 8px; }
.cta-desc { font-size: 14px; color: var(--text-dim); margin-bottom: 14px; line-height: 1.7; }
.cta-btn {
  display: inline-block;
  padding: 11px 28px;
  background: var(--accent);
  color: #fff;
  font-size: 14px;
  font-weight: 700;
  border-radius: 999px;
  text-decoration: none;
  transition: all .2s;
}
.cta-btn:hover { background: var(--accent-hover); transform: translateY(-1px); box-shadow: 0 4px 12px rgba(139,92,246,0.3); }
.cta-btn.purple { background: var(--purple); }
.cta-btn.purple:hover { background: #7C3AED; }
.cta-btn.cyan { background: var(--cyan); }
.cta-btn.cyan:hover { background: #0891B2; }

/* ══════════ DAILY PICK ══════════ */
.daily-card {
  background: #F0FDFA;
  border: 1px solid #99F6E4;
  border-radius: var(--radius);
  padding: 24px 20px;
  text-align: center;
}
.daily-emoji { font-size: 32px; margin-bottom: 8px; }
.daily-title { font-size: 17px; font-weight: 800; color: var(--text); margin-bottom: 8px; }
.daily-desc { font-size: 14px; color: var(--text-dim); margin-bottom: 14px; }

/* ══════════ LARGE CTA ══════════ */
.large-cta {
  margin: 16px;
  padding: 28px 20px;
  background: linear-gradient(135deg, var(--purple), #6366F1);
  border-radius: var(--radius);
  text-align: center;
}
.large-cta-title { font-size: 19px; font-weight: 900; color: #fff; margin-bottom: 12px; line-height: 1.4; }
.large-cta-btn {
  display: inline-block;
  padding: 12px 36px;
  background: #fff;
  color: var(--accent);
  font-size: 15px;
  font-weight: 800;
  border-radius: 999px;
  text-decoration: none;
  transition: all .2s;
}
.large-cta-btn:hover { transform: translateY(-2px); box-shadow: 0 8px 24px rgba(0,0,0,0.2); }

/* ══════════ AD BANNER ══════════ */
.ad-banner {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 16px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  text-decoration: none;
  margin-bottom: 20px;
  transition: all .2s;
  flex-wrap: wrap;
  justify-content: center;
  box-shadow: var(--shadow);
}
.ad-banner:hover { border-color: var(--accent); box-shadow: var(--shadow-hover); }
.ad-badge { background: var(--accent); color: #fff; font-size: 10px; font-weight: 900; padding: 3px 6px; border-radius: 4px; letter-spacing: 1px; }
.ad-title { color: var(--text); font-size: 16px; font-weight: 800; }
.ad-kakao { color: var(--accent); font-size: 14px; font-weight: 700; }
.ad-btn { background: #fee500; color: #3B1E1E; font-size: 13px; font-weight: 800; padding: 8px 16px; border-radius: 20px; white-space: nowrap; }

/* ══════════ FOOTER ══════════ */
.footer {
  background: #F9FAFB;
  border-top: 1px solid var(--border);
  color: var(--text-dim);
  padding: 32px 16px;
  text-align: center;
}
.footer-brand { font-size: 12px; font-weight: 700; letter-spacing: 4px; color: #595959; margin-bottom: 10px; }
.footer-copy { font-size: 12px; color: #595959; line-height: 1.7; }
.footer-slogan { font-size: 14px; color: var(--accent); font-weight: 600; margin-bottom: 16px; }

/* ══════════ SLIDE-UP POPUP ══════════ */
.slideup-popup {
  position: fixed;
  bottom: -100%;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 480px;
  background: #fff;
  border-top: 2px solid var(--accent);
  padding: 20px;
  text-align: center;
  z-index: 900;
  transition: bottom .5s ease;
  box-shadow: 0 -4px 20px rgba(0,0,0,0.1);
}
.slideup-popup.show { bottom: 0; }
.slideup-popup .close-btn {
  position: absolute;
  top: 8px; right: 12px;
  background: none;
  border: none;
  color: var(--text-dim);
  font-size: 20px;
  cursor: pointer;
}
.slideup-title { font-size: 16px; font-weight: 800; color: var(--text); margin-bottom: 8px; }
.slideup-desc { font-size: 14px; color: var(--text-dim); margin-bottom: 12px; }

/* ══════════ SCROLL BANNER ══════════ */
.scroll-banner {
  position: fixed;
  bottom: -100px;
  left: 50%;
  transform: translateX(-50%);
  width: calc(100% - 32px);
  max-width: 448px;
  background: linear-gradient(135deg, var(--accent), var(--cyan));
  padding: 14px 20px;
  border-radius: var(--radius);
  text-align: center;
  z-index: 800;
  transition: bottom .4s ease;
  box-shadow: 0 4px 20px rgba(139,92,246,0.3);
}
.scroll-banner.show { bottom: 100px; }
.scroll-banner a { color: #fff; font-size: 14px; font-weight: 700; text-decoration: none; }

/* ══════════ CATEGORY HERO ══════════ */
.cat-hero {
  background: linear-gradient(180deg, #F8F7FF 0%, #FFFFFF 100%);
  padding: 40px 20px 32px;
  text-align: center;
}
.cat-hero-title { font-size: 24px; font-weight: 900; color: var(--text); margin-bottom: 8px; }
.cat-hero-count { font-size: 14px; color: var(--text-dim); }

/* ══════════ POPULAR TAGS ══════════ */
.popular-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: center;
  margin-top: 14px;
}
.ptag {
  font-size: 13px;
  padding: 4px 12px;
  border-radius: 999px;
  background: #F3F4F6;
  border: 1px solid #E5E7EB;
  color: var(--text-dim);
  cursor: pointer;
  transition: all .2s;
}
.ptag:hover { border-color: var(--accent); color: var(--accent); background: #F8F7FF; }

/* ══════════ ANIMATIONS ══════════ */
@keyframes slideIn {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}
.card { animation: slideIn .3s ease forwards; }

/* ══════════ FIXED BOTTOM BARS (전화 + 메인링크만) ══════════ */
.phone-bar {
  position: fixed;
  bottom: 48px;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 480px;
  height: 44px;
  background: #111;
  color: #fff;
  font-size: 20px;
  font-weight: 900;
  text-align: center;
  line-height: 44px;
  z-index: 49;
  text-decoration: none;
  display: block;
  letter-spacing: 0.5px;
  text-shadow: 0 1px 2px rgba(0,0,0,0.3);
}
.phone-bar:hover { background: #222; }
.main-link-bar {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 480px;
  height: 48px;
  background: #8B5CF6;
  color: #fff;
  font-size: 16px;
  font-weight: 700;
  text-align: center;
  line-height: 48px;
  z-index: 50;
  text-decoration: none;
  display: block;
}
.main-link-bar:hover { background: #7C3AED; }

/* body에 하단 바 공간 확보 (48+44=92px) */
body { padding-bottom: 100px; }

/* ══════════ [K1] SCROLL PROGRESS BAR ══════════ */
.scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  width: 0%;
  height: 3px;
  background: linear-gradient(90deg, var(--accent), var(--cyan));
  z-index: 9999;
  transition: width 0.1s linear;
}

/* ══════════ RESPONSIVE ══════════ */
@media (max-width: 380px) {
  .hero { padding: 32px 14px 28px; }
  .hero-title { font-size: 24px; }
  .search-box input { padding: 11px 16px; font-size: 14px; }
  .filter-btn { padding: 6px 12px; font-size: 12px; }
  .premium-name { font-size: 16px; }
  .premium-phone { font-size: 20px; }
}

/* ══════════ TOUCH TARGETS (최소 44px) ══════════ */
.top-nav-link { min-height: 44px; display: inline-flex; align-items: center; }
.filter-btn { min-height: 44px; }
.ptag { min-height: 44px; display: inline-flex; align-items: center; padding: 8px 14px; }
.dd-item { min-height: 44px; }

/* ══════════ PC (768px+) — 2열 카드 그리드 + 넓은 레이아웃 ══════════ */
@media (min-width: 768px) {
  body { max-width: 960px; }
  .grid { grid-template-columns: 1fr 1fr; gap: 16px; }
  .hero-title { font-size: 36px; }
  .hero-desc { font-size: 17px; }
  .section { padding: 36px 24px; }
  .card-body { min-height: 220px; }
  .premium-card { padding: 24px; }
  .scroll-banner.show { bottom: 100px; }
  .slideup-popup.show { bottom: 96px; }
}

/* ══════════ PC 대형 (1200px+) — 3열 ══════════ */
@media (min-width: 1200px) {
  body { max-width: 1200px; }
  .grid { grid-template-columns: 1fr 1fr 1fr; }
}

/* ══════════ MOBILE — 바 겹침 방지 ══════════ */
@media (max-width: 767px) {
  .scroll-banner.show { bottom: 100px; }
  .slideup-popup.show { bottom: 96px; }
  #autoNext { bottom: 100px !important; }
  #engageBadge { position: static; }
}

/* ══════════ SMOOTH SCROLL + 성능 최적화 ══════════ */
html { scroll-behavior: smooth; }
.card, .premium-card, .rank-card { will-change: transform; }
img, svg { content-visibility: auto; }

/* ══════════ 다크모드 (시스템 설정 따름) ══════════ */
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0F0F0F;
    --bg-page: #000000;
    --bg-card: #1A1A1A;
    --text: #F0F0F0;
    --text-sub: #CCCCCC;
    --text-dim: #999999;
    --border: #333333;
    --border-hover: #555555;
    --shadow: 0 1px 3px rgba(0,0,0,0.3);
    --shadow-hover: 0 4px 12px rgba(0,0,0,0.4);
  }
  .card, .premium-card, .rank-card { background: var(--bg-card); }
  .hero { background: linear-gradient(180deg, #1A1028 0%, var(--bg) 100%); }
  .search-box input { background: #1A1A1A; color: var(--text); border-color: #333; }
  .search-box input::placeholder { color: #666; }
  .search-dropdown { background: #1A1A1A; border-color: #333; }
  .dd-item:hover { background: #222; }
  .filters { background: rgba(15,15,15,0.95); }
  .filter-btn { background: #1A1A1A; border-color: #333; }
  .footer { background: #0A0A0A; }
  .bamki-banner { background: #2D1B69; }
  .top-nav { background: #0F0F0F; }
  .cta-box, .daily-card { background: #1A1028; border-color: #333; }
  .ad-banner { background: #1A1A1A; }
  .card-tag { background: #222; border-color: #333; }
  .info-table th { background: #1A1A1A; }
}
