/* 워독스 전적 — 어두운 바탕 · 주황(카키) 강조. OP.GG 식 배치(위 검색 · 왼쪽 요약 · 오른쪽 상세) */
:root {
  color-scheme: dark;
  --bg: #12151b; --bg2: #191d25; --card: #1e232d; --card2: #252b37; --line: #2e3542;
  --tx: #e6e9ef; --tx2: #a3abba; --tx3: #6d7586;
  --acc: #e8a33d; --acc2: #f2c27a; --ok: #4cc38a; --warn: #e8b13d; --bad: #e5534b;
  --win: #5383e8; --lose: #e84057;
  --r: 8px;
  --font: "Pretendard", "Apple SD Gothic Neo", "Malgun Gothic", system-ui, -apple-system, sans-serif;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--tx); font: 14px/1.5 var(--font); }
a { color: inherit; text-decoration: none; }
a:hover { color: var(--acc2); }
.wrap { max-width: 1080px; margin: 0 auto; padding: 0 16px; }
.muted { color: var(--tx2); }
.small { font-size: 12px; }
.hl { color: var(--acc); }
b { font-weight: 700; }

/* 머리 */
.top { background: var(--bg2); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 20; }
.top-in { max-width: 1080px; margin: 0 auto; padding: 0 16px; height: 56px; display: flex; align-items: center; gap: 20px; }
.logo { display: flex; align-items: center; gap: 8px; font-size: 16px; white-space: nowrap; }
.logo b { color: var(--acc); }
.logo-m { background: var(--acc); color: var(--bg); font-weight: 800; border-radius: 6px; padding: 2px 6px; font-size: 13px; }
.nav { display: flex; gap: 4px; }
.nav a { padding: 6px 10px; border-radius: 6px; color: var(--tx2); white-space: nowrap; }
.nav a.on, .nav a:hover { color: var(--tx); background: var(--card); }
.top-search { margin-left: auto; width: 300px; }
body.is-home .top-search { visibility: hidden; }

/* 검색창 */
.search { position: relative; display: flex; background: var(--card); border: 1px solid var(--line); border-radius: var(--r); }
.search:focus-within { border-color: var(--acc); }
.search input { flex: 1; min-width: 0; background: none; border: 0; color: var(--tx); padding: 8px 12px; font: inherit; outline: none; }
.search button { background: none; border: 0; color: var(--tx2); padding: 0 12px; font: inherit; cursor: pointer; }
.search.big { border-radius: 28px; }
.search.big input { padding: 15px 22px; font-size: 16px; }
.search.big button { background: var(--acc); color: var(--bg); font-weight: 700; border-radius: 0 28px 28px 0; padding: 0 22px; }
.ac { position: absolute; top: calc(100% + 4px); left: 0; right: 0; background: var(--card2); border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; z-index: 30; box-shadow: 0 8px 24px #0008; }
.ac a { display: flex; align-items: center; gap: 8px; padding: 8px 12px; }
.ac a small { margin-left: auto; color: var(--tx3); }
.ac a:hover, .ac a.on { background: var(--line); color: var(--tx); }

/* 홈 */
.hero { text-align: center; padding: 56px 0 28px; max-width: 640px; margin: 0 auto; }
.hero h1 { font-size: 32px; margin: 0 0 4px; letter-spacing: -0.5px; }
.hero h1 b { color: var(--acc); }
.hero > p { margin: 0 0 20px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; align-items: center; margin-top: 12px; }
.chip { display: inline-flex; align-items: center; gap: 6px; background: var(--card); border: 1px solid var(--line); border-radius: 20px; padding: 3px 10px 3px 4px; font-size: 13px; }
.chip .ava { border-radius: 50%; }
.home-grid { display: grid; grid-template-columns: 1.2fr 1fr 1fr; gap: 12px; align-items: start; }

/* 동접 크게 */
.live { margin: 0 auto 28px; }
.live-lbl { display: inline-flex; align-items: center; color: var(--tx2); font-size: 14px; letter-spacing: .5px; }
.live-num { font-size: 72px; font-weight: 800; line-height: 1.05; letter-spacing: -2px; color: var(--acc); font-variant-numeric: tabular-nums; }
.live-num span { font-size: 24px; font-weight: 600; color: var(--tx2); margin-left: 6px; letter-spacing: 0; }
.live-sub { display: flex; flex-wrap: wrap; gap: 4px 16px; justify-content: center; color: var(--tx2); font-size: 13px; margin-top: 6px; }
.live-sub b { color: var(--tx); }
.hero-note { margin: 10px auto 0; max-width: 520px; line-height: 1.6; }
.hero-note a { color: var(--acc2); }
.top-live { margin-left: auto; display: inline-flex; align-items: center; gap: 2px; font-size: 13px; color: var(--tx2); white-space: nowrap; background: var(--card); border-radius: 14px; padding: 3px 10px; }
.top-live b { color: var(--acc); margin-right: 2px; }
.top-live + .top-search { margin-left: 0; }
.pulse { animation: pulse 1.6s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .35; } }
@media (prefers-reduced-motion: reduce) { .pulse { animation: none; } }

/* 카드 */
.card { background: var(--card); border-radius: var(--r); padding: 14px 16px; margin-bottom: 12px; }
.card-h { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; margin-bottom: 10px; }
.card-h h2 { font-size: 14px; margin: 0; }
.card-h a { font-size: 12px; color: var(--tx2); }
.empty { color: var(--tx2); padding: 16px 0; text-align: center; }
.empty-big { text-align: center; padding: 36px 20px; }
.empty-big p { margin: 0 0 10px; }
.loading { color: var(--tx2); padding: 40px; text-align: center; display: flex; gap: 10px; justify-content: center; align-items: center; }
.loading span { width: 16px; height: 16px; border: 2px solid var(--line); border-top-color: var(--acc); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.page-h { font-size: 20px; margin: 24px 0 12px; }
.page-h small { font-size: 13px; color: var(--tx2); font-weight: 400; margin-left: 6px; }

.btn { display: inline-block; background: var(--acc); color: var(--bg); border: 0; border-radius: 6px; padding: 7px 14px; font: inherit; font-weight: 700; cursor: pointer; white-space: nowrap; }
.btn:hover { background: var(--acc2); color: var(--bg); }
.btn.ghost { background: var(--card2); color: var(--tx); font-weight: 500; border: 1px solid var(--line); }
.btn.ghost:hover { border-color: var(--acc); color: var(--tx); }

.ava { border-radius: 6px; object-fit: cover; flex: none; background: var(--card2); display: inline-block; }

/* 계급 뱃지 — 병·부사관·위관·영관·장성 */
.grade { display: inline-block; font-size: 12px; font-weight: 700; padding: 1px 8px; border-radius: 10px; white-space: nowrap; }
.grade.sm { font-size: 11px; padding: 0 6px; }
.g-enl { background: #3a4150; color: #c9d0dc; }
.g-nco { background: #2f4a3a; color: #8fe0b0; }
.g-off { background: #2a3d63; color: #9dbbff; }
.g-fld { background: #4f3a1c; color: #f2c27a; }
.g-gen { background: #5a2430; color: #ff9fae; }

/* 상태 */
.status .st-main { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; margin-bottom: 10px; }
.pill { font-size: 12px; font-weight: 700; padding: 2px 10px; border-radius: 10px; }
.pill.ok { background: #1f3d2f; color: var(--ok); } .pill.warn { background: #45391c; color: var(--warn); }
.pill.bad { background: #4a2224; color: var(--bad); } .pill.unk { background: var(--card2); color: var(--tx2); }
.st-now b { font-size: 26px; } .st-now span { color: var(--tx2); margin-left: 4px; }
.st-usual { width: 100%; font-size: 12px; color: var(--tx2); }
.up { color: var(--ok); } .down { color: var(--bad); }
.st-list { list-style: none; padding: 0; margin: 0 0 12px; }
.st-list li { display: flex; justify-content: space-between; padding: 5px 0; border-top: 1px solid var(--line); font-size: 13px; }
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 6px; }
.dot.ok { background: var(--ok); } .dot.warn { background: var(--warn); } .dot.bad { background: var(--bad); } .dot.unk { background: var(--tx3); }
.hourly-h, .hourly-x { display: flex; justify-content: space-between; font-size: 11px; color: var(--tx3); }
.hourly svg { width: 100%; height: 80px; display: block; margin: 4px 0; }
.hourly rect { fill: #3a4252; } .hourly rect.last { fill: var(--acc); } .hourly rect:hover { fill: var(--acc2); }

.mini-row { display: flex; align-items: center; gap: 8px; padding: 6px 0; border-top: 1px solid var(--line); }
.mini-row:first-of-type { border-top: 0; }
.mini-rank { width: 20px; color: var(--tx3); font-size: 12px; text-align: center; }
.mini-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mini-lv { color: var(--tx2); font-size: 12px; width: 48px; text-align: right; }

/* 검색 결과 */
.list { padding: 4px 16px; }
.s-row { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-top: 1px solid var(--line); }
.s-row:first-child { border-top: 0; }
.s-name { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.s-name small { color: var(--tx3); font-size: 11px; }
.s-lv, .s-rank { color: var(--tx2); font-size: 13px; min-width: 52px; text-align: right; }

/* 프로필 */
.prof-head { display: flex; gap: 20px; align-items: center; padding: 20px; margin-top: 24px; }
.ph-ava { position: relative; flex: none; }
.ph-ava .ava { border-radius: 14px; }
.ph-lv { position: absolute; left: 50%; bottom: -8px; transform: translateX(-50%); background: var(--bg); border: 1px solid var(--acc); color: var(--acc2); font-size: 12px; font-weight: 700; padding: 0 8px; border-radius: 10px; }
.ph-info { min-width: 0; }
.ph-info h1 { margin: 0 0 4px; font-size: 24px; word-break: break-all; }
.clan { color: var(--acc); }
.ph-meta { display: flex; flex-wrap: wrap; gap: 4px 8px; font-size: 13px; margin-bottom: 12px; }
.ph-btns { display: flex; flex-wrap: wrap; gap: 6px; }
.cols { display: grid; grid-template-columns: 332px 1fr; gap: 12px; align-items: start; }
.rk { display: flex; align-items: center; gap: 14px; margin-bottom: 12px; }
.rk-emb { width: 72px; height: 72px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 18px; font-weight: 800; flex: none; }
.rk-txt { display: flex; flex-direction: column; }
.rk-txt b { font-size: 18px; }
.bar { height: 6px; background: var(--card2); border-radius: 3px; overflow: hidden; }
.bar i { display: block; height: 100%; background: var(--acc); }
.bar-cap { display: flex; justify-content: space-between; font-size: 11px; color: var(--tx3); margin-top: 4px; }
.kv { list-style: none; margin: 0; padding: 0; }
.kv li { display: flex; justify-content: space-between; padding: 6px 0; border-top: 1px solid var(--line); }
.kv li:first-child { border-top: 0; }
.kv span { color: var(--tx2); }
.frames { list-style: none; margin: 0; padding: 0; }
.frames li { display: flex; justify-content: space-between; align-items: baseline; padding: 6px 0; border-top: 1px solid var(--line); }
.frames li:first-child { border-top: 0; }
.frames li.on b { color: var(--acc); }

.roles { display: flex; flex-direction: column; }
.role-row { display: grid; grid-template-columns: 32px 64px 52px 1fr 108px; gap: 10px; align-items: center; padding: 7px 0; border-top: 1px solid var(--line); }
.role-row:first-child { border-top: 0; }
.role-ic { width: 32px; height: 32px; border-radius: 8px; display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 14px; color: #fff; }
.r-assault { background: #b5523b; } .r-medic { background: #3b9b6d; } .r-recon { background: #5a6ab8; }
.r-support { background: #a7843a; } .r-driver { background: #6d6f78; } .r-pilot { background: #3a8db5; }
.role-n { font-weight: 700; }
.role-lv { color: var(--tx2); font-size: 13px; }
.role-bar { height: 8px; background: var(--card2); border-radius: 4px; overflow: hidden; }
.role-bar i { display: block; height: 100%; background: linear-gradient(90deg, var(--acc), var(--acc2)); }
.role-xp { text-align: right; font-size: 13px; }
.role-xp small { color: var(--tx3); margin-left: 4px; }
.notice { border-left: 3px solid var(--acc); }
.notice p { margin: 0 0 6px; }
.notice a { color: var(--acc2); }
.ul-g h3 { font-size: 13px; color: var(--tx2); margin: 10px 0 8px; font-weight: 500; }
.ul-g h3 small { color: var(--tx3); }
.ul-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: 6px; }
.ul-it { background: var(--card2); border-radius: 6px; padding: 6px; text-align: center; font-size: 11px; display: flex; flex-direction: column; align-items: center; gap: 4px; min-width: 0; }
.ul-it img { width: 100%; height: 48px; object-fit: contain; }
.ul-it span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%; color: var(--tx2); }
.ul-ph { width: 48px; height: 48px; display: flex; align-items: center; justify-content: center; color: var(--tx3); font-size: 20px; }

/* 로그인 */
.top-user { display: inline-flex; align-items: center; gap: 6px; background: var(--acc); color: var(--bg); font-weight: 700; font-size: 13px; border-radius: 16px; padding: 4px 12px; white-space: nowrap; }
.top-user .ava { border-radius: 50%; }
.top-user:hover { color: var(--bg); background: var(--acc2); }
.me-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.tog { display: inline-flex; align-items: center; gap: 6px; margin-right: 8px; cursor: pointer; }
.btn.danger { color: var(--bad); border-color: #5a2b2e; }
.btn.danger:hover { border-color: var(--bad); color: var(--bad); }

/* 병과 선호 */
.pref-row { display: grid; grid-template-columns: 20px 32px 64px 1fr 120px; gap: 10px; align-items: center; padding: 8px 0; border-top: 1px solid var(--line); }
.pref-row:first-child { border-top: 0; }
.pref-rank { color: var(--tx3); text-align: center; font-size: 12px; }
.pref-v { text-align: right; display: flex; flex-direction: column; }
.pref-v b { font-size: 16px; }
.pref-v small { color: var(--tx3); font-size: 11px; }
@media (max-width: 640px) { .pref-row { grid-template-columns: 20px 32px 1fr 96px; } .pref-row .role-bar { display: none; } }

/* 표 */
.tabs { display: flex; gap: 4px; margin-bottom: 12px; overflow-x: auto; }
.tabs a { padding: 6px 14px; border-radius: 6px; background: var(--card); color: var(--tx2); white-space: nowrap; }
.tabs a.on { background: var(--acc); color: var(--bg); font-weight: 700; }
.tbl-wrap { padding: 0; overflow-x: auto; }
.tbl { width: 100%; border-collapse: collapse; }
.tbl th, .tbl td { padding: 9px 12px; text-align: left; border-top: 1px solid var(--line); white-space: nowrap; }
.tbl thead th { border-top: 0; font-size: 12px; color: var(--tx2); font-weight: 500; background: var(--bg2); }
.tbl .num { text-align: right; font-variant-numeric: tabular-nums; }
.tbl tbody tr:hover { background: var(--card2); }
.c-rank { width: 48px; color: var(--tx2); }
.c-name a { display: flex; align-items: center; gap: 10px; max-width: 280px; }
.c-name span { overflow: hidden; text-overflow: ellipsis; }
.pager { display: flex; justify-content: space-between; align-items: center; margin: 4px 0 24px; }
.kd-5 { color: #ff8b3d; font-weight: 700; } .kd-3 { color: #1f8ecd; font-weight: 700; } .kd-1 { color: var(--tx); } .kd-0 { color: var(--tx3); }
.tbl.vs th, .tbl.vs td { text-align: center; }
.tbl.vs tr > th:first-child { text-align: left; color: var(--tx2); font-weight: 500; background: var(--bg2); }
.vs-h { display: flex; flex-direction: column; align-items: center; gap: 4px; margin-bottom: 4px; font-weight: 700; }
.tbl td.best { color: var(--acc); font-weight: 700; }

/* 서버 */
.srv-form { display: flex; gap: 8px; margin-bottom: 12px; }
.srv-form input { flex: 1; min-width: 0; background: var(--card); border: 1px solid var(--line); color: var(--tx); border-radius: 6px; padding: 8px 12px; font: inherit; }
.srv-form input:focus { border-color: var(--acc); outline: none; }
.srv-name { padding: 10px 16px; }
.srv-sum { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.stat { display: flex; flex-direction: column; }
.stat span { color: var(--tx2); font-size: 12px; }
.stat b { font-size: 22px; }
.stat small { color: var(--tx3); font-size: 11px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* 바닥 */
.foot { border-top: 1px solid var(--line); margin-top: 40px; padding-top: 16px; padding-bottom: 40px; font-size: 12px; }
.foot a { color: var(--acc2); text-decoration: underline; }
.foot p { margin: 0 0 6px; }

/* 좁은 화면 */
@media (max-width: 900px) {
  .home-grid { grid-template-columns: 1fr; }
  .cols { grid-template-columns: 1fr; }
  .top-search { width: auto; flex: 1; }
  .srv-sum { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 640px) {
  .top-in { gap: 10px; height: auto; flex-wrap: wrap; padding: 8px 16px; }
  .nav { order: 3; width: 100%; overflow-x: auto; }
  .top-search { order: 2; }
  body.is-home .top-search { display: none; }
  .hero { padding: 32px 0 20px; }
  .hero h1 { font-size: 26px; }
  .live-num { font-size: 52px; }
  .top-live { order: 1; margin-left: auto; }
  .prof-head { flex-direction: column; text-align: center; }
  .ph-meta, .ph-btns { justify-content: center; }
  .hide-m { display: none; }
  .role-row { grid-template-columns: 32px 1fr 48px 84px; }
  .role-bar { display: none; }
}
