/* ===========================================================
   BanG Dream! Song Sorter — common.css (공용)
   변수/리셋/베이스 · 헤더 · 랭크 팝업 · 면책. PC·모바일 공통.
   ⚠ 로드 순서 고정: common.css → desktop.css → mobile.css
   (원본 style.css를 섹션 경계로 3분할 · 캐스케이드 순서 보존)
=========================================================== */

/* ===========================
   BanG Dream! Song Sorter — style.css

   1. Variables / Base
   2. Header (진행률)
   3. App Layout (grid)
   4. A. Band Selector
   5. B. Song List (+ 필터칩, 프레스 피드백)
   6. C. YouTube
   7. D/E. Right Panel (히스토그램 / 히트맵)
   8. Bottom Bar
   9. Rank Popup (modal)
   10. Disclaimer / Capture
   11. 반응형 (≤1023px)
=========================== */

/* ===========================
   1. Variables / Base
=========================== */
:root {
  --bg: #0e0e14;
  --surface: #16161f;
  --surface2: #1e1e2a;
  --border: #2a2a3a;
  --text: #e8e8f0;
  --text-sub: #7a7a9a;
  --accent: #c084fc;
  --header-h: 52px;

  --tier-1: #ff6b9d;
  --tier-2: #ff9f6b;
  --tier-3: #ffd06b;
  --tier-4: #6bcfff;
  --tier-5: #9d9dbd;
}

* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Inter', -apple-system, sans-serif;
  height: 100vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }

/* ===========================
   2. Header
=========================== */
header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 20px;
  height: var(--header-h);
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
  z-index: 10;
}
.logo-emoji { font-size: 1.2rem; }
header h1 {
  font-family: 'M PLUS Rounded 1c', sans-serif;
  font-size: 1.1rem;
  font-weight: 800;
  background: linear-gradient(135deg, #c084fc, #ff6b9d);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  letter-spacing: 0.02em;
}
.header-progress {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.75rem;
  color: var(--text-sub);
}
.progress-bar {
  width: 120px;
  height: 4px;
  background: var(--border);
  border-radius: 2px;
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #c084fc, #ff6b9d);
  border-radius: 2px;
  transition: width 0.4s ease;
}


/* ===== (공용) Rank Popup + Disclaimer/Capture — 원본 §9-10 ===== */
/* ===========================
   9. Rank Popup (modal)
=========================== */
.popup-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.7);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s;
}
.popup-overlay[hidden] { display: none; }
.popup-overlay.open { opacity: 1; pointer-events: auto; }
.popup {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 20px;
  width: min(340px, 92vw);
  transform: translateY(12px) scale(0.97);
  transition: transform 0.2s cubic-bezier(0.34,1.56,0.64,1);
}
.popup-overlay.open .popup { transform: translateY(0) scale(1); }
.popup-band { font-size: 0.72rem; color: var(--text-sub); margin-bottom: 4px; }
.popup-title {
  font-family: 'M PLUS Rounded 1c', sans-serif;
  font-size: 1rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 16px;
  word-break: break-word;
}
.rank-buttons { display: flex; gap: 6px; }
.rank-btn {
  flex: 1;
  padding: 10px 4px;
  border-radius: 10px;
  border: 2px solid var(--border);
  background: var(--surface2);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  transition: all 0.15s;
}
.rank-btn:hover { transform: translateY(-2px); border-color: var(--text-sub); }
.rank-btn.active { border-color: var(--accent); background: rgba(192,132,252,0.16); }
.rk-icon { font-size: 1.2rem; }
.rk-label { font-size: 0.58rem; font-weight: 700; font-family: 'M PLUS Rounded 1c', sans-serif; }
.popup-comment {
  margin-top: 12px;
  width: 100%;
  min-height: 52px;
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface2);
  color: var(--text);
  font-family: inherit;
  font-size: 0.78rem;
  line-height: 1.4;
  resize: vertical;
  transition: border-color 0.12s;
}
.popup-comment::placeholder { color: var(--text-sub); }
.popup-comment:focus { outline: none; border-color: var(--accent); }
.popup-cancel {
  margin-top: 14px;
  width: 100%;
  padding: 9px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-sub);
  font-size: 0.72rem;
  cursor: pointer;
  transition: background 0.12s;
}
.popup-cancel:hover { background: var(--surface2); }

/* 곡 코멘트 툴팁 (body 고정 배치 · JS가 위치 계산) */
#comment-tip {
  position: fixed;
  z-index: 200;
  max-width: 260px;
  padding: 8px 11px;
  border-radius: 9px;
  background: var(--surface2);
  border: 1px solid var(--accent);
  color: var(--text);
  font-size: 0.74rem;
  line-height: 1.45;
  white-space: pre-wrap;
  word-break: break-word;
  box-shadow: 0 6px 20px rgba(0,0,0,0.5);
  pointer-events: none;
}
#comment-tip[hidden] { display: none; }

/* ===========================
   10. Disclaimer / Capture
=========================== */
.disclaimer {
  flex-shrink: 0;
  padding: 12px 18px;
  background: var(--bg);
  border-top: 1px solid var(--border);
  color: #55556a;
  font-size: 0.6rem;
  line-height: 1.6;
}
.disclaimer p { margin: 0 0 4px 0; }
.disclaimer p:last-child { margin-bottom: 0; }

/* Download 캡처용 오프스크린 (레이아웃 유지, 화면 밖) */
#capture-area {
  position: fixed;
  left: -99999px;
  top: 0;
  pointer-events: none;
}

