:root {
  color-scheme: dark;
  --bg: #0d131b;
  --surface: #151e29;
  --surface-alt: #192430;
  --line: #2a3949;
  --text: #f0f4fa;
  --muted: #a6b5c7;
  --accent: #99e6d4;
  --gold: #f4ce88;
  --loss: #f3a3ab;
  font: 13px/1.36 "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, select: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: 1780px; margin: 0 auto; padding-inline: 12px; }
.topbar { background: #111a24; border-bottom: 1px solid var(--line); }
.topbar-inner { display: flex; align-items: center; gap: 13px; min-height: 42px; }
.brand { display: inline-flex; align-items: center; gap: 6px; color: var(--text); text-decoration: none; font-weight: 850; font-size: 15px; white-space: nowrap; }
.mark { display: flex; align-items: flex-end; justify-content: center; gap: 2px; padding-bottom: 5px; width: 23px; height: 23px; border: 1px solid #4d837f; border-radius: 5px; background: #1d393c; }
.mark i { width: 3px; height: 6px; background: var(--accent); border-radius: 2px 2px 0 0; }
.mark i:nth-child(2) { height: 9px; }
.mark i:nth-child(3) { height: 12px; }
#accounts { display: flex; gap: 4px; }
#accounts button { min-width: 0; padding: 4px 9px; font-size: 12px; font-weight: 650; background: transparent; }
#accounts button[aria-pressed="true"] { border-color: #507975; background: #1c373b; color: var(--accent); }
.updated { margin-left: auto; color: var(--muted); white-space: nowrap; font-size: 11px; font-variant-numeric: tabular-nums; }
.notice { margin: 18px 0; padding: 13px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); }
.summary { display: grid; grid-template-columns: minmax(196px, 22%) minmax(0, 1fr); margin-block: 7px; overflow: hidden; border: 1px solid var(--line); border-radius: 7px; background: var(--surface); }
.profile { display: grid; align-content: center; gap: 3px; min-width: 0; padding: 7px 11px; box-shadow: inset 3px 0 #589788; }
h1 { font-size: clamp(16px, 1.65vw, 23px); font-weight: 850; letter-spacing: -.035em; overflow-wrap: anywhere; }
h1 small { margin-left: 4px; font-size: .62em; color: var(--muted); font-weight: 650; letter-spacing: -.015em; }
#coverage { color: var(--muted); font-size: 11px; font-variant-numeric: tabular-nums; }
.metrics { display: grid; grid-template-columns: 1fr .86fr 1.75fr 1fr; }
.metric { display: grid; align-content: start; gap: 1px; min-width: 0; padding: 5px 10px 6px; border-left: 1px solid var(--line); font-variant-numeric: tabular-nums; }
.metric > span { color: var(--muted); font-weight: 650; font-size: 11px; }
.metric strong { font-size: clamp(20px, 2.15vw, 28px); line-height: 1.14; letter-spacing: -.035em; }
.metric small, .metric a { font-size: 11px; color: var(--muted); }
.metric a { justify-self: start; white-space: nowrap; }
.rating { background: linear-gradient(130deg, #292722, #171e28 84%); }
.rating strong { color: var(--gold); }
.rating strong.unavailable { font-size: clamp(14px, 1.6vw, 20px); line-height: 1.58; }
#kda { display: flex; align-items: center; gap: 5px; white-space: nowrap; font-size: clamp(15px, 2vw, 27px); }
.slash { font-weight: 400; color: #738297; }
.kills, .win { color: var(--accent); }
.deaths, .loss { color: var(--loss); }
.win-meter { width: 100%; max-width: 140px; height: 4px; margin-top: 4px; background: #65414d; border-radius: 8px; overflow: hidden; }
.win-meter div { background: var(--accent); height: 100%; }
.workspace { display: grid; grid-template-columns: clamp(300px, 26vw, 410px) minmax(0, 1fr); gap: 7px; }
.boards { display: grid; gap: 7px; align-content: start; }
.panel { min-width: 0; border: 1px solid var(--line); border-radius: 7px; background: var(--surface); overflow: hidden; }
.panel-head { display: flex; justify-content: space-between; align-items: center; min-height: 34px; gap: 6px; padding: 3px 7px; background: #182432; border-bottom: 1px solid var(--line); }
h2 { font-size: 14px; font-weight: 800; }
h2 span { margin-left: 4px; color: var(--accent); font-size: 11px; letter-spacing: .035em; white-space: nowrap; }
.panel-head button { padding: 3px 7px; font-size: 11px; }
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: 3px 7px; }
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: 26px; padding-block: 2px; }
.ranking .rank { width: 25px; text-align: center; color: var(--muted); font-size: 11px; }
.ranking .rank-top { color: var(--gold); font-weight: 800; }
.ranking .number { text-align: right; width: 62px; white-space: nowrap; }
.ranking .count { width: 25%; }
.ranking .number b { font-weight: 800; }
.compact-rate { display: none; }
.usage { display: flex; align-items: center; justify-content: flex-end; gap: 5px; }
.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: 5px; min-width: 0; }
.identity strong { min-width: 0; font-size: 12px; font-weight: 680; line-height: 1.18; overflow-wrap: anywhere; word-break: keep-all; }
.portrait { flex: 0 0 auto; display: block; width: 21px; height: 21px; object-fit: cover; border-radius: 4px; 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 { display: flex; min-height: 0; flex-direction: column; }
.history-scroll { flex: 1 1 auto; min-height: 0; overflow: auto; }
.history-scroll:focus-visible { outline-offset: -2px; }
.history thead th { position: sticky; top: 0; z-index: 1; }
.history thead th:nth-child(-n + 5) { width: 1%; }
.history th:nth-child(3), .history td:nth-child(3) { text-align: center; }
.history th:nth-child(4) { text-align: right; }
.history td { height: 28px; vertical-align: middle; }
.history time { color: var(--muted); font-size: 11px; 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: 1px 4px; border-radius: 4px; min-width: 20px; text-align: center; font-size: 11px; font-weight: 750; }
.result.win { background: #25453e; }
.result.loss { background: #482f3b; }
.picks { display: flex; gap: 2px; flex-wrap: wrap; min-width: 120px; }
.pick { border-radius: 4px; padding: 1px 4px; color: #dce7f3; background: #263746; white-space: nowrap; font-size: 11px; }
.pagination { display: flex; align-items: center; gap: 5px; }
.pagination button { padding: 0 5px; min-width: 25px; height: 25px; font-size: 19px; line-height: 1; }
#page { min-width: 43px; height: 25px; padding: 0 3px; border: 1px solid var(--line); border-radius: 5px; background: #1a2835; color: var(--text); font: inherit; }
#page-total { color: var(--muted); font-size: 11px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.empty { padding: 10px; text-align: center; color: var(--muted); }
footer { display: flex; justify-content: flex-end; padding: 5px 0 8px; color: var(--muted); font-size: 10px; }
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 (min-width: 1100px) {
  .history-scroll { contain: size; scrollbar-gutter: stable; }
  .history thead th:last-child { width: 48%; }
  .boards .ranking td { height: clamp(22px, calc((100dvh - 280px) / 20), 32px); padding-block: 1px; }
  .boards .portrait { width: 19px; height: 19px; }
}
@media (max-width: 1099px) {
  .workspace { grid-template-columns: minmax(0, 1fr); }
  .boards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 780px) {
  .shell { padding-inline: 8px; }
  .summary { display: block; }
  .profile { display: flex; justify-content: space-between; align-items: baseline; flex-wrap: wrap; gap: 1px 7px; padding: 5px 8px; border-bottom: 1px solid var(--line); }
  .metric:first-child { border-left: 0; }
}
@media (min-width: 621px) and (max-width: 1099px) {
  .topbar-inner { min-height: 0; flex-wrap: wrap; gap: 4px 6px; padding-block: 4px; }
  #accounts { flex: 1 0 100%; order: 3; flex-wrap: wrap; }
}
@media (max-width: 620px) {
  .shell { padding-inline: 6px; }
  .topbar-inner { min-height: 0; gap: 4px 6px; flex-wrap: wrap; padding-block: 4px; }
  .brand { font-size: 14px; }
  .updated { font-size: 10px; }
  #accounts { order: 3; flex: 1 0 100%; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  #accounts button { padding: 3px; font-size: 11px; white-space: normal; overflow-wrap: anywhere; }
  .summary { margin-block: 5px; }
  #coverage { font-size: 10px; }
  .metrics { grid-template-columns: 1fr .85fr 1fr; }
  .metric { padding-inline: 6px; }
  .combat { grid-row: 2; grid-column: 1 / -1; grid-template-columns: auto 1fr; align-items: center; padding-block: 3px; border-top: 1px solid var(--line); border-left: 0; }
  .combat strong { grid-row: span 2; justify-self: end; }
  .combat small { grid-column: 1; }
  #kda { font-size: clamp(14px, 4vw, 20px); }
  .workspace, .boards { gap: 5px; }
  .boards .panel-head { min-height: 31px; padding-inline: 4px; gap: 3px; }
  .boards h2 { font-size: 12px; }
  .boards h2 span { margin-left: 2px; font-size: 9px; }
  .boards .panel-head button { padding-inline: 4px; font-size: 10px; }
  .boards th, .boards td { padding-inline: 4px; }
  .boards .ranking .rank { width: 19px; }
  .boards .ranking .count { width: 39px; }
  .boards .rate, .boards .usage-track { display: none; }
  .boards .compact-rate { display: block; color: var(--muted); font-size: 10px; line-height: 1.05; }
  .boards .identity { gap: 4px; }
  .boards .identity strong { font-size: 11px; }
  .boards .portrait { width: 18px; height: 18px; }
  .history-scroll { overflow: visible; }
  .history table, .history tbody { display: block; }
  .history thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  .history tbody tr { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; align-items: center; gap: 1px 6px; padding: 3px 6px; }
  .history td { padding: 0; height: auto; }
  .history td:nth-child(1) { grid-area: 2 / 1 / 3 / 3; }
  .history td:nth-child(2) { grid-area: 1 / 1; }
  .history td:nth-child(3) { grid-area: 1 / 2; }
  .history td:nth-child(4) { grid-area: 1 / 3; }
  .history td:nth-child(5) { grid-area: 2 / 3; font-size: 11px; color: var(--muted); }
  .history td:nth-child(5)::before { content: "피해 "; }
  .history td:nth-child(6) { grid-area: 3 / 1 / 4 / -1; }
  .history td[colspan] { grid-area: auto / 1 / auto / -1; }
  .history .identity { min-width: 0; }
  .history time { white-space: normal; }
  .history .picks { min-width: 0; }
}
