/* 킬각 발로란트 — 허브/메이플/배그와 같은 팔레트, 액센트만 발로란트 카드색(#ff4655) */
:root {
  --bg: #0f1117;
  --bg-2: #171a23;
  --card: #1c2029;
  --card-2: #232833;
  --line: #2b313d;
  --text: #e7eaf0;
  --muted: #8a93a6;
  --accent: #ff4655;
  --accent-2: #ff7a85;
  --blue: #4a90ff;
  --good: #43d17a;
  --bad: #ff5b5b;
  --radiant: #ffe680;
  --radius: 12px;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body {
  margin: 0;
  font-family: "Pretendard", -apple-system, BlinkMacSystemFont, "Malgun Gothic", sans-serif;
  background: var(--bg); color: var(--text); line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
.wrap { max-width: 1080px; margin: 0 auto; padding: 0 16px; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.pad { padding: 20px; }

/* 헤더 */
.site-header {
  background: rgba(15,17,23,.9); border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 50; backdrop-filter: blur(8px);
}
.header-inner { display: flex; align-items: center; gap: 14px; height: 58px; }
.logo { font-size: 20px; font-weight: 800; letter-spacing: -.5px; white-space: nowrap; }
.logo span { color: var(--accent); }
.hub-link {
  font-size: 13px; color: var(--muted); border: 1px solid var(--line);
  padding: 5px 10px; border-radius: 999px; white-space: nowrap;
}
.hub-link:hover, .hub-link.on { color: var(--text); border-color: var(--accent); }
.header-spacer { flex: 1; }

/* 히어로 */
.hero {
  padding: 44px 0 32px;
  background: radial-gradient(900px 320px at 50% -40px, rgba(255,70,85,.16), transparent 70%), var(--bg-2);
  border-bottom: 1px solid var(--line); text-align: center;
}
.hero-title { font-size: 31px; font-weight: 800; margin: 0 0 8px; letter-spacing: -1px; }
.hero-title b { color: var(--accent); }
.hero-sub { color: var(--muted); margin: 0 0 20px; font-size: 15px; }

.search-box { display: flex; gap: 8px; max-width: 620px; margin: 0 auto; }
.shard-sel, .search-box input {
  background: var(--card); border: 1px solid var(--line); color: var(--text);
  border-radius: 10px; height: 46px; font-size: 14px;
}
.shard-sel { padding: 0 12px; cursor: pointer; }
.search-box input { flex: 1; min-width: 0; padding: 0 14px; }
.search-box input:focus { outline: none; border-color: var(--accent); }
.search-box button {
  height: 46px; padding: 0 22px; border: 0; border-radius: 10px; cursor: pointer;
  background: var(--accent); color: #fff; font-weight: 800; font-size: 15px;
}
.search-box button:hover { background: var(--accent-2); }

/* 공통 */
.section-title {
  font-size: 17px; font-weight: 700; margin: 26px 0 12px;
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
}
.section-title .muted { font-size: 12px; font-weight: 400; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; }
.notice { padding: 40px 20px; text-align: center; color: var(--muted); }
.notice.err { color: var(--bad); }
.spinner {
  width: 26px; height: 26px; margin: 0 auto 12px;
  border: 3px solid var(--line); border-top-color: var(--accent);
  border-radius: 50%; animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* 스탯 타일 */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 10px; }
.stat { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; text-align: center; }
.stat .v { font-size: 20px; font-weight: 800; letter-spacing: -.5px; }
.stat .k { font-size: 12px; color: var(--muted); margin-top: 3px; }
.stat .v.hl { color: var(--accent); }

/* 표 */
.table-wrap { overflow-x: auto; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); }
table { width: 100%; border-collapse: collapse; font-size: 13px; min-width: 640px; }
th, td { padding: 11px 12px; text-align: right; white-space: nowrap; }
th:first-child, td:first-child, th:nth-child(2), td:nth-child(2) { text-align: left; }
thead th { color: var(--muted); font-weight: 600; font-size: 12px; border-bottom: 1px solid var(--line); }
tbody tr + tr td { border-top: 1px solid var(--line); }
tbody tr:hover { background: var(--card-2); cursor: pointer; }

/* 순위 */
.rk { font-weight: 800; color: var(--muted); }
.rk.top { color: var(--radiant); }
.pname { font-weight: 700; }
.ptag { color: var(--muted); font-size: 12px; font-weight: 400; }
.tier-pill {
  display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 700;
  padding: 3px 9px; border-radius: 999px; border: 1px solid var(--line);
}
.tier-dot { width: 8px; height: 8px; border-radius: 50%; }
.delta { font-size: 12px; font-weight: 700; }
.delta.up { color: var(--good); }
.delta.down { color: var(--bad); }
.delta.flat { color: var(--muted); font-weight: 400; }

/* 필터 */
.filters { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 12px; }
.filters button {
  background: var(--card); border: 1px solid var(--line); color: var(--muted);
  border-radius: 999px; padding: 6px 12px; font-size: 12.5px; cursor: pointer;
}
.filters button.on { color: var(--text); border-color: var(--accent); background: var(--card-2); }
.pager { display: flex; gap: 8px; justify-content: center; align-items: center; margin-top: 14px; }
.pager button {
  background: var(--card-2); border: 1px solid var(--line); color: var(--text);
  border-radius: 8px; padding: 7px 14px; font-size: 13px; cursor: pointer;
}
.pager button:disabled { opacity: .4; cursor: default; }

/* 도감 카드 */
.grid { display: grid; gap: 12px; }
.grid.agents { grid-template-columns: repeat(auto-fill, minmax(132px, 1fr)); }
.grid.maps { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
.grid.weapons { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
.ac { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.ac:hover { border-color: var(--accent); }
.ac .thumb { background: linear-gradient(160deg, var(--card-2), var(--card)); aspect-ratio: 1; }
.ac .thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ac .body { padding: 10px 12px 12px; }
.ac .nm { font-size: 13.5px; font-weight: 700; }
.ac .abil { display: flex; gap: 4px; margin-top: 7px; }
.ac .abil img { width: 20px; height: 20px; object-fit: contain; opacity: .85; }
.mapc .thumb { aspect-ratio: 16 / 9; }
.mapc .thumb img { object-fit: cover; }
.wc .thumb { aspect-ratio: 16 / 7; display: flex; align-items: center; justify-content: center; padding: 8px; }
.wc .thumb img { width: 100%; height: 100%; object-fit: contain; }

/* 플레이어 상세 */
.profile-head {
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 18px; margin-top: 20px;
}
.pf-rank {
  width: 60px; height: 60px; border-radius: 12px; flex: 0 0 60px;
  background: var(--card-2); border: 1px solid var(--line);
  display: flex; align-items: center; justify-content: center;
  font-size: 19px; font-weight: 800; color: var(--radiant);
}
.pf-name { font-size: 22px; font-weight: 800; margin: 0; }
.pf-meta { color: var(--muted); font-size: 13px; display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.pf-actions { margin-left: auto; }
.btn {
  background: var(--card-2); border: 1px solid var(--line); color: var(--text);
  border-radius: 8px; padding: 8px 14px; font-size: 13px; cursor: pointer;
}
.btn:hover { border-color: var(--accent); color: var(--accent); }

/* RR 추이 그래프 (SVG) */
.chart { width: 100%; height: 200px; display: block; }
.chart .line { fill: none; stroke: var(--accent); stroke-width: 2; }
.chart .area { fill: rgba(255,70,85,.12); }
.chart .grid-l { stroke: var(--line); stroke-width: 1; }
.chart text { fill: var(--muted); font-size: 10px; }

/* 안내 카드 */
.info-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 12px; }
.info-card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; }
.info-card .ic { font-size: 22px; margin-bottom: 8px; }
.info-card h3 { margin: 0 0 6px; font-size: 15px; }
.info-card p { margin: 0; font-size: 13px; color: var(--muted); line-height: 1.6; }

/* 푸터 */
.site-footer {
  border-top: 1px solid var(--line); margin-top: 48px; padding: 22px 0 34px;
  color: var(--muted); font-size: 12px; text-align: center;
}
.site-footer a { color: var(--muted); }
.site-footer a:hover { color: var(--accent); }
.site-footer nav { display: flex; gap: 12px; justify-content: center; margin-bottom: 8px; flex-wrap: wrap; }
.disclaimer { max-width: 780px; margin: 10px auto 0; line-height: 1.6; opacity: .8; }

@media (max-width: 640px) {
  .hero { padding: 32px 0 24px; }
  .hero-title { font-size: 23px; }
  .search-box { flex-wrap: wrap; }
  .shard-sel { flex: 0 0 100px; }
  .search-box input { flex: 1 1 140px; }
  .search-box button { flex: 1 1 100%; }
  .pf-actions { margin-left: 0; width: 100%; }
}
