:root {
  color-scheme: dark;
  --bg: #0d131b;
  --surface: #151e29;
  --surface-alt: #192430;
  --line: #2a3949;
  --text: #f0f4fa;
  --muted: #a6b5c7;
  --accent: #99e6d4;
  --gold: #f4ce88;
  --loss: #f3a3ab;
  font: 14px/1.45 "Pretendard", "Malgun Gothic", "Apple SD Gothic Neo", system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
}
* { box-sizing: border-box; }
body { margin: 0; min-width: 310px; }
a { color: var(--accent); text-underline-offset: 3px; }
button { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button:focus-visible, a:focus-visible, [tabindex]:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
button {
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 5px 10px;
  color: var(--text);
  background: #1a2835;
  white-space: nowrap;
  cursor: pointer;
}
button:hover:not(:disabled) { border-color: var(--accent); background: #203743; }
button:disabled { color: #8191a3; opacity: .68; cursor: default; }
button span { color: var(--accent); }
h1, h2, p { margin: 0; }
.shell { max-width: 1512px; margin: 0 auto; padding-inline: 22px; }
.topbar { background: #111a24; border-bottom: 1px solid var(--line); }
.topbar-inner { display: flex; justify-content: space-between; align-items: center; gap: 16px; min-height: 58px; }
.brand { display: inline-flex; align-items: center; gap: 9px; color: var(--text); text-decoration: none; font-weight: 850; font-size: 17px; white-space: nowrap; }
.mark { display: flex; align-items: flex-end; justify-content: center; gap: 3px; padding-bottom: 7px; width: 30px; height: 30px; border: 1px solid #4d837f; border-radius: 7px; background: #1d393c; }
.mark i { width: 4px; height: 8px; background: var(--accent); border-radius: 2px 2px 0 0; }
.mark i:nth-child(2) { height: 13px; }
.mark i:nth-child(3) { height: 17px; }
#accounts { display: flex; flex-wrap: wrap; gap: 5px; }
#accounts button { font-size: 13px; font-weight: 650; background: transparent; }
#accounts button[aria-pressed="true"] { border-color: #507975; background: #1c373b; color: var(--accent); }
.notice { margin: 18px 0; padding: 13px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); }
.profile { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; padding: 16px 0 9px; }
h1 { font-size: clamp(21px, 2.3vw, 28px); font-weight: 850; letter-spacing: -.045em; }
h1 small { margin-left: 4px; font-size: .62em; color: var(--muted); font-weight: 650; letter-spacing: -.015em; }
#coverage { flex-shrink: 0; color: var(--muted); font-size: 12px; }
.metrics { display: grid; grid-template-columns: 1fr .82fr 1.6fr 1fr; gap: 8px; }
.metric { display: grid; align-content: start; gap: 2px; min-width: 0; padding: 9px 12px 10px; background: var(--surface); border: 1px solid var(--line); border-radius: 8px; font-variant-numeric: tabular-nums; }
.metric > span { color: var(--muted); font-weight: 650; font-size: 12px; }
.metric strong { font-size: clamp(22px, 3vw, 31px); line-height: 1.22; letter-spacing: -.039em; }
.metric small, .metric a { font-size: 11px; color: var(--muted); }
.rating { background: linear-gradient(130deg, #292722, #171e28 84%); border-color: #574b36; }
.rating strong { color: var(--gold); }
.rating strong.unavailable { font-size: clamp(16px, 2.4vw, 21px); line-height: 1.76; }
#kda { display: flex; align-items: center; gap: 6px; white-space: nowrap; font-size: clamp(16px, 2.8vw, 29px); }
.slash { font-weight: 400; color: #738297; }
.kills, .win { color: var(--accent); }
.deaths, .loss { color: var(--loss); }
.win-meter { width: 100%; height: 5px; margin-top: 7px; background: #65414d; border-radius: 8px; overflow: hidden; }
.win-meter div { background: var(--accent); height: 100%; }
.boards { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 8px; }
.panel { min-width: 0; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); overflow: hidden; }
.panel-head { display: flex; justify-content: space-between; align-items: center; min-height: 44px; gap: 6px; padding: 6px 10px; border-bottom: 1px solid var(--line); }
h2 { font-size: 15px; font-weight: 800; }
h2 span { margin-left: 4px; color: var(--accent); font-size: 11px; letter-spacing: .035em; white-space: nowrap; }
.panel-head button, .sort-label { font-size: 12px; }
.sort-label { color: var(--muted); }
table { border-collapse: collapse; width: 100%; font-variant-numeric: tabular-nums; }
th { background: #111b25; color: var(--muted); text-align: left; font-weight: 650; font-size: 11px; white-space: nowrap; }
th, td { padding: 4px 9px; }
tbody tr + tr { border-top: 1px solid #243140; }
tbody tr:nth-child(even) { background: var(--surface-alt); }
tbody tr:hover { background: #22333f; }
.ranking td { height: 34px; }
.ranking .rank { width: 29px; text-align: center; color: var(--muted); font-size: 12px; }
.ranking .rank-top { color: var(--gold); font-weight: 800; }
.ranking .number { text-align: right; width: 70px; white-space: nowrap; }
.ranking .count { width: 32%; }
.ranking .number b { font-weight: 800; }
.usage { display: flex; align-items: center; justify-content: flex-end; gap: 7px; }
.usage-track { flex: 1; max-width: 185px; height: 4px; overflow: hidden; background: #27384a; border-radius: 4px; }
.usage-track span { display: block; height: 100%; background: #73b8a7; border-radius: inherit; }
.augment-ranks .usage-track span { background: #aa9acf; }
.usage b { min-width: 22px; }
.identity { display: flex; align-items: center; gap: 7px; min-width: 0; }
.identity strong { font-size: 13px; font-weight: 680; }
.portrait { flex: 0 0 auto; display: block; width: 26px; height: 26px; object-fit: cover; border-radius: 5px; background: #263a49; }
.fallback { display: grid; place-items: center; font-size: 11px; font-weight: 700; color: var(--muted); }
.augment-icon { object-fit: contain; padding: 1px; background: #253348; }
.history { margin-top: 8px; }
.history-scroll { overflow-x: auto; }
.history td { min-height: 32px; vertical-align: middle; }
.history time { color: var(--muted); font-size: 12px; white-space: nowrap; }
.history .identity { min-width: max-content; }
.history .kda, .damage { text-align: right; white-space: nowrap; }
.history .kda { font-weight: 700; }
.result { display: inline-block; padding: 2px 5px; border-radius: 4px; min-width: 24px; text-align: center; font-size: 12px; font-weight: 750; }
.result.win { background: #25453e; }
.result.loss { background: #482f3b; }
.picks { display: flex; gap: 3px; flex-wrap: wrap; min-width: 140px; }
.pick { border-radius: 4px; padding: 2px 5px; color: #dce7f3; background: #263746; white-space: nowrap; font-size: 11px; }
.pagination { display: flex; justify-content: center; align-items: center; gap: 10px; padding: 7px; border-top: 1px solid var(--line); }
#page { min-width: 55px; padding: 5px; border: 1px solid var(--line); border-radius: 5px; background: #1a2835; color: var(--text); font: inherit; }
#page-total { color: var(--muted); font-variant-numeric: tabular-nums; }
.empty { padding: 10px; text-align: center; color: var(--muted); }
footer { display: flex; justify-content: space-between; gap: 8px; padding: 9px 0 12px; color: var(--muted); font-size: 11px; }
footer a { color: var(--muted); }
dialog { width: min(620px, calc(100% - 20px)); max-height: 85dvh; padding: 0; border: 1px solid #547274; border-radius: 9px; background: var(--surface); color: var(--text); overflow: auto; }
dialog .dialog-toolbar { position: sticky; top: 0; z-index: 1; background: var(--surface); }
.dialog-search:not([hidden]) { display: flex; align-items: center; gap: 8px; padding: 5px 9px; border-bottom: 1px solid var(--line); }
.dialog-search input { flex: 1; min-width: 0; padding: 5px 8px; border: 1px solid var(--line); border-radius: 5px; background: #111b25; color: var(--text); font: inherit; }
.dialog-search input:focus-visible { outline: 2px solid var(--accent); outline-offset: -1px; }
.dialog-search span { color: var(--muted); font-size: 12px; white-space: nowrap; }
dialog::backdrop { background: #070a11cf; }
@media (max-width: 780px) {
  .shell { padding-inline: 10px; }
  .topbar-inner { gap: 7px; flex-wrap: wrap; padding-block: 8px; }
  .profile { padding-top: 11px; }
  .metrics { grid-template-columns: 1fr 1fr; }
  .damage { display: none; }
  .history time { white-space: normal; }
}
@media (max-width: 540px) {
  .boards { grid-template-columns: minmax(0, 1fr); }
  .profile { flex-wrap: wrap; gap: 1px; }
  .picks { flex-wrap: nowrap; }
  #accounts button { padding-inline: 6px; font-size: 11px; }
}
@media (max-width: 435px) {
  .metrics { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .metric { padding-inline: 8px; }
  .combat { grid-row: 2; grid-column: 1 / -1; grid-template-columns: auto 1fr; align-items: center; }
  .combat strong { grid-row: span 2; justify-self: end; }
  .combat small { grid-column: 1; }
  .ranking .count { width: 24%; }
  .usage { gap: 4px; }
}
