/* ============================================================
   theme.css — 사이트 무드 (2026-09-30 고정: 화이트 + 토스 느낌 박스, 다크 모드)
   style.css · v2.css 뒤에 얹어 :root 토큰과 박스 모양만 덮어쓴다(구조·클래스 불변).
   다크 모드: <html data-theme="dark"> 일 때만. 따로 고른 적이 없으면 index.html <head> 스크립트와
   js/theme.js 가 기기(시스템) 설정을 data-theme 로 옮겨 준다 → 다크 색은 아래 한 곳에만 둔다.
   ============================================================ */

/* ── 라이트 (기본) ───────────────────────────────────── */
:root {
  color-scheme: light;
  --bg-base: #F2F4F6; --bg-elevated: #FFFFFF; --bg-card: #FFFFFF; --bg-card-hover: #F9FAFB; --bg-overlay: rgba(0,0,0,.4);
  --border-subtle: #EEF0F3; --border-strong: #DDE1E6;
  --text-primary: #191F28; --text-secondary: #4E5968; --text-tertiary: #8B95A1; --text-muted: #B0B8C1;
  --accent-gold: #3182F6; --accent-purple: #6B5CF6; --accent-rose: #6B5CF6; --accent-aqua: #3182F6; --danger: #F04452;
  --on-accent: #FFFFFF; --on-danger: #2a0606; --on-boss: #1a1102; --accent-hover: #1B64DA; --btn-grad-text: #FFFFFF;
  --glow-rgb: 49, 130, 246; --shade-rgb: 242, 244, 246; --hairline-rgb: 0, 0, 0; --ink-rgb: 0, 0, 0; --danger-rgb: 239, 68, 68;
  --card-filter: none; --overlay-filter: none;
  --page-bg: #F2F4F6; --page-bg-attachment: fixed;
  --radius-sm: 10px; --radius-md: 14px; --radius-lg: 20px;
  --shadow-sm: 0 1px 2px rgba(20,20,40,.06); --shadow-md: 0 6px 18px rgba(20,20,40,.08); --shadow-lg: 0 18px 46px rgba(20,20,40,.16);
  --font-base: 'Pretendard Variable', Pretendard, system-ui, sans-serif;
}

:root { --tag-plain-bg: #E5E8EB; --tag-plain-ink: #4E5968; }
:root { --fill-1: rgba(var(--hairline-rgb), 0.045); --fill-2: rgba(var(--hairline-rgb), 0.08); --fill-3: rgba(var(--hairline-rgb), 0.12); }

/* ── 다크 ────────────────────────────────────────────── */
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg-base: #17171C; --bg-elevated: #26262E; --bg-card: #202027; --bg-card-hover: #2A2A33; --bg-overlay: rgba(0, 0, 0, 0.6);
  --border-subtle: #2C2C35; --border-strong: #3A3A45;
  --text-primary: #F2F4F6; --text-secondary: #C3C8CF; --text-tertiary: #8B95A1; --text-muted: #4E5968;
  --accent-gold: #3182F6; --accent-purple: #8C7CFF; --accent-rose: #8C7CFF; --accent-aqua: #4593FC; --danger: #F66570;
  --on-accent: #FFFFFF; --accent-hover: #4593FC; --btn-grad-text: #FFFFFF;
  --glow-rgb: 69, 147, 252; --shade-rgb: 0, 0, 0; --hairline-rgb: 255, 255, 255;
  --page-bg: #17171C;
  --tag-plain-bg: #3A3A45; --tag-plain-ink: #C3C8CF;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4); --shadow-md: 0 6px 18px rgba(0, 0, 0, 0.35); --shadow-lg: 0 18px 46px rgba(0, 0, 0, 0.5);
}

/* ── 박스 모양 (토스 느낌: 테두리 대신 면, 큰 둥근 모서리) ── */
.page-header { border-bottom: none; }
.page-title { font-size: 26px; font-weight: 800; letter-spacing: -0.02em; }

/* 큰 박스 */
.v2-section {
  border: none;
  border-radius: 24px;
  padding: 24px 26px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.04);
}
.v2-section-head { margin-bottom: 18px; }
.v2-section-title { font-size: 19px; font-weight: 800; letter-spacing: -0.02em; }

/* 순위 막대 */
.v2-rank-list { gap: 12px; }
.v2-rank-bar { height: 10px; background: var(--fill-2); }

/* 기간 탭 → 세그먼트 */
.v2-tabs { background: var(--fill-2); padding: 3px; border-radius: 12px; gap: 2px; }
.v2-tab { border: none; border-radius: 9px; padding: 6px 14px; font-weight: 600; }
.v2-tab.active { box-shadow: 0 1px 4px rgba(0, 0, 0, 0.12); }

/* 기록 카드 */
.v2-run-list { gap: 16px; }
.v2-run-card { border: none; border-radius: 20px; background: var(--fill-1); padding: 18px 20px; gap: 10px; }
.v2-run-total { font-size: 19px; font-weight: 800; letter-spacing: -0.02em; }
.v2-boss-entry { border-top: none; padding: 14px; border-radius: 14px; background: var(--fill-1); }
.member-chip { border: none; background: var(--fill-2); padding: 4px 11px; font-weight: 600; }

/* 작은 버튼 · 헤더 버튼 → 채운 알약 */
.btn-mini { border: none; background: var(--fill-2); border-radius: 10px; padding: 6px 12px; font-weight: 600; }
.btn-mini:hover { background: var(--fill-3); color: var(--text-primary); }
.btn-mini.btn-primary { background: var(--accent-gold); color: var(--on-accent); }
.icon-btn { border: none; background: var(--fill-2); border-radius: 12px; font-weight: 600; }
.btn { border-radius: 14px; }
.btn-ghost { border: none; background: var(--fill-2); color: var(--text-primary); }
.btn-ghost:hover { background: var(--fill-3); }

/* 창 */
.modal { border: none; border-radius: 28px; }
.modal-actions { border-top: none; }

/* 입력칸 → 채운 면, 누르면 강조색 테두리 */
.text-input, .select-input { border: 1.5px solid transparent; background-color: var(--fill-2); border-radius: 12px; }
.text-input:focus, .select-input:focus { border-color: var(--accent-gold); background-color: var(--bg-elevated); }

/* 기록 창 안 */
.v2-boss-block { border: none; background: var(--fill-1); border-radius: 18px; }
.v2-pick-char, .v2-loot-chip { border: none; background: var(--fill-2); font-weight: 500; }
@media (hover: hover) {
  .v2-pick-char:not(.active):hover, .v2-loot-chip:hover { background: var(--fill-3); }
}
.v2-loot-row + .v2-loot-row { border-top: none; }

/* 관리 페이지 카드 */
.v2-manage-card { border: none; background: var(--fill-1); border-radius: 18px; padding: 16px; }

@media (max-width: 720px) {
  .page-title { font-size: 22px; }
  .v2-section { padding: 18px 16px; border-radius: 20px; }
}

/* ── 크기 통일 — 칩·작은 버튼·헤더 버튼은 어디에 있든 같은 높이 (그리드에 늘어나지 않게) ── */
.member-chip, .btn-mini {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  align-self: start;
  height: 28px;
  padding: 0 12px;
  line-height: 1;
  white-space: nowrap;
  font-size: 12px;
}
.member-chip { height: 26px; padding: 0 11px; }
/* 작은 버튼이 너무 작아 못 찾는다는 지적(정혁님 11-13) → 누르기 쉬운 크기로 */
.btn-mini { height: 36px; padding: 0 14px; font-size: 14px; border-radius: 12px; }
.v2-run-members, .v2-run-actions { align-items: center; }
.v2-run-card, .v2-boss-entry { align-content: start; }

.header-actions { align-items: center; flex-wrap: wrap; }
.header-actions > .icon-btn, .header-actions > .btn {
  display: inline-flex;
  align-items: center;
  height: 38px;
  padding: 0 16px;
  font-size: 14px;
  line-height: 1;
  white-space: nowrap;
}
@media (max-width: 720px) {
  .header-actions > .icon-btn, .header-actions > .btn { height: 34px; padding: 0 12px; font-size: 13px; }
}

/* 캐릭터 이름 옆 직업 글씨 간격 */
.v2-pick-char small, .v2-manage-row small, .v2-manage-card-head small { margin-left: 5px; font-size: 11px; color: var(--text-tertiary); }
.v2-pick-char.active small { color: var(--on-accent); opacity: 0.8; }

/* ── 스크롤바 숨김 — 스크롤은 그대로 되고 막대만 안 보인다 ── */
* { scrollbar-width: none; }
*::-webkit-scrollbar { display: none; }

/* ── 드롭다운 화살표 — 기본 화살표 대신 오른쪽 끝에서 조금 안쪽(14px)에 ── */
select.select-input {
  -webkit-appearance: none;
  appearance: none;
  padding-right: 38px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5l5 5 5-5' fill='none' stroke='%238B95A1' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  background-size: 12px 8px;
  cursor: pointer;
}
select.select-input:disabled { cursor: not-allowed; opacity: 0.55; border-style: solid; background: var(--fill-2) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5l5 5 5-5' fill='none' stroke='%238B95A1' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") no-repeat right 14px center / 12px 8px; }

/* ── X 버튼 — 아이콘을 동그라미 한가운데, 줄 높이 가운데에 ── */
.icon-btn-sm, .icon-btn-close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  align-self: center;
  justify-self: center;
  width: 28px;
  height: 28px;
  padding: 0;
  border-radius: 50%;
  line-height: 0;
}
.icon-btn-close { width: 34px; height: 34px; }
.icon-btn-close svg { width: 14px; height: 14px; }

/* ── 하위 보스 태그 — 회색 단색 (주요 보스 색은 js/v2/boss-tag.js) ── */
.v2-boss-tag-plain { background: var(--tag-plain-bg); color: var(--tag-plain-ink); }
.run-boss-badge { display: inline-flex; align-items: center; height: 24px; padding: 0 10px; font-weight: 700; white-space: nowrap; }
