:root {
  color-scheme: dark;
  --bg: #10120f;
  --panel: #181b17;
  --panel-2: #20241e;
  --line: #343a30;
  --text: #f3f5ed;
  --muted: #a5ac9d;
  --accent: #d8f24b;
  --gold: #f2c75c;
  --silver: #c9d1cb;
  --bronze: #d58f5c;
}

* { box-sizing: border-box; }
html { background: var(--bg); }
body {
  margin: 0;
  min-width: 320px;
  color: var(--text);
  background:
    linear-gradient(rgba(255,255,255,.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.025) 1px, transparent 1px),
    var(--bg);
  background-size: 48px 48px;
  font-family: Inter, "Noto Sans SC", "Noto Sans JP", "Noto Sans KR", "Microsoft YaHei", system-ui, sans-serif;
  letter-spacing: 0;
}

button, input, select { font: inherit; letter-spacing: 0; }
.topbar {
  height: 72px;
  padding: 0 max(24px, calc((100% - 1180px) / 2));
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
  background: rgba(16,18,15,.92);
  position: sticky;
  top: 0;
  z-index: 10;
  backdrop-filter: blur(12px);
}
.brand { display: flex; align-items: center; gap: 12px; color: inherit; text-decoration: none; }
.brand-mark { width: 38px; height: 38px; display: grid; place-items: center; border: 1px solid var(--accent); color: var(--accent); font-weight: 800; font-size: 13px; }
.brand strong, .brand small { display: block; }
.brand strong { font-size: 15px; }
.brand small { color: var(--muted); font-size: 11px; margin-top: 2px; }
.top-actions { display: flex; align-items: center; gap: 10px; }
.language-label { color: var(--muted); font-size: 12px; }
select, .icon-button, .search { border: 1px solid var(--line); background: var(--panel); color: var(--text); }
select { height: 38px; padding: 0 30px 0 12px; border-radius: 4px; }
.icon-button { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 4px; cursor: pointer; }
.icon-button:hover, select:hover { border-color: #68725f; }
.icon-button svg, .search svg { width: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.icon-button.loading svg { animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

main { width: min(1180px, calc(100% - 48px)); margin: 0 auto; }
.summary { min-height: 290px; display: flex; align-items: flex-end; justify-content: space-between; gap: 48px; padding: 72px 0 48px; border-bottom: 1px solid var(--line); }
.eyebrow { display: flex; align-items: center; gap: 8px; margin: 0 0 16px; color: var(--accent); font: 700 11px/1 system-ui; }
.live-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 5px rgba(216,242,75,.1); }
h1 { margin: 0; font-size: clamp(42px, 7vw, 82px); line-height: .95; font-weight: 800; }
.lede { color: var(--muted); margin: 20px 0 0; font-size: 16px; }
.stats { margin: 0; min-width: 410px; display: grid; grid-template-columns: repeat(3, 1fr); border: 1px solid var(--line); }
.stats div { padding: 22px 20px; }
.stats div + div { border-left: 1px solid var(--line); }
.stats dt { color: var(--muted); font-size: 11px; margin-bottom: 10px; }
.stats dd { margin: 0; font-size: 24px; font-weight: 750; font-variant-numeric: tabular-nums; }

.podium { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; padding: 28px 0; }
.podium-card { min-height: 154px; padding: 22px; border: 1px solid var(--line); background: var(--panel); position: relative; overflow: hidden; }
.podium-card::after { content: attr(data-rank); position: absolute; right: 10px; bottom: -25px; color: rgba(255,255,255,.035); font-size: 120px; line-height: 1; font-weight: 900; }
.podium-card[data-rank="1"] { border-top: 3px solid var(--gold); }
.podium-card[data-rank="2"] { border-top: 3px solid var(--silver); }
.podium-card[data-rank="3"] { border-top: 3px solid var(--bronze); }
.podium-rank { color: var(--muted); font-size: 11px; text-transform: uppercase; }
.podium-name { margin: 18px 0 8px; font-size: 20px; font-weight: 700; overflow-wrap: anywhere; }
.podium-meta { color: var(--muted); font-size: 12px; }

.ranking { border-top: 1px solid var(--line); padding: 32px 0 40px; }
.ranking-toolbar { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; margin-bottom: 22px; }
h2 { margin: 0 0 7px; font-size: 22px; }
.ranking-toolbar p { margin: 0; color: var(--muted); font-size: 12px; }
.search { width: 280px; height: 42px; padding: 0 12px; display: flex; align-items: center; gap: 9px; border-radius: 4px; }
.search:focus-within { border-color: var(--accent); }
.search svg { color: var(--muted); flex: none; }
.search input { width: 100%; min-width: 0; border: 0; outline: 0; color: var(--text); background: transparent; }
.search input::placeholder { color: #747b6f; }
.table-wrap { overflow-x: auto; border: 1px solid var(--line); }
table { width: 100%; border-collapse: collapse; min-width: 720px; }
th { height: 42px; padding: 0 18px; text-align: left; color: var(--muted); background: var(--panel-2); font-size: 10px; font-weight: 700; text-transform: uppercase; }
td { height: 58px; padding: 0 18px; border-top: 1px solid var(--line); font-size: 13px; }
tbody tr { background: rgba(24,27,23,.72); }
tbody tr:hover { background: #22261f; }
.rank-cell { width: 80px; color: var(--muted); font: 700 14px/1 system-ui; }
.top-rank { color: var(--gold); }
.player-cell { font-weight: 650; max-width: 350px; overflow-wrap: anywhere; }
.muted-cell { color: var(--muted); font-variant-numeric: tabular-nums; }
.number { text-align: right; font-variant-numeric: tabular-nums; }
.balance-cell {
  color: var(--balance-text, var(--accent));
  white-space: nowrap;
  font-weight: 720;
  text-shadow:
    -1px -1px 0 var(--balance-outline, #10120f),
     1px -1px 0 var(--balance-outline, #10120f),
    -1px  1px 0 var(--balance-outline, #10120f),
     1px  1px 0 var(--balance-outline, #10120f);
}
.balance-cell .times { display: inline-block; margin: 0 .38em; font-size: .76em; color: var(--muted); text-shadow: none; }
.balance-cell .power { display: inline-flex; align-items: flex-start; gap: .08em; }
.balance-cell sup { position: relative; top: -.08em; font-size: .64em; line-height: 1; }
.balance-band-0 { --balance-text: #ff7373; --balance-outline: #380a0a; }
.balance-band-1 { --balance-text: #73ff9c; --balance-outline: #0a3818; }
.balance-band-2 { --balance-text: #c573ff; --balance-outline: #250a38; }
.balance-band-3 { --balance-text: #ffee73; --balance-outline: #38320a; }
.balance-band-4 { --balance-text: #73e8ff; --balance-outline: #0a3038; }
.balance-band-5 { --balance-text: #ff73bf; --balance-outline: #380a23; }
.balance-band-6 { --balance-text: #96ff73; --balance-outline: #16380a; }
.balance-band-7 { --balance-text: #7973ff; --balance-outline: #0c0a38; }
.balance-band-8 { --balance-text: #ffa273; --balance-outline: #38190a; }
.balance-band-9 { --balance-text: #73ffcb; --balance-outline: #0a3827; }
.balance-band-10 { --balance-text: #f373ff; --balance-outline: #340a38; }
.balance-band-11 { --balance-text: #e2ff73; --balance-outline: #2e380a; }
.balance-band-12 { --balance-text: #73b9ff; --balance-outline: #0a2138; }
.balance-band-13 { --balance-text: #ff7390; --balance-outline: #380a14; }
.balance-band-14 { --balance-text: #73ff7f; --balance-outline: #0a380e; }
.balance-band-15 { --balance-text: #a873ff; --balance-outline: #1b0a38; }
.balance-band-16 { --balance-text: #ffd173; --balance-outline: #38290a; }
.balance-band-17 { --balance-text: #73fff9; --balance-outline: #0a3836; }
.balance-band-18 { --balance-text: #ff73dc; --balance-outline: #380a2c; }
.balance-band-19 { --balance-text: #b3ff73; --balance-outline: #1f380a; }
.balance-band-20 { --balance-text: #738aff; --balance-outline: #0a1238; }
.balance-band-21 { --balance-text: #ff8573; --balance-outline: #38100a; }
.balance-band-22 { --balance-text: #73ffae; --balance-outline: #0a381d; }
.balance-band-23 { --balance-text: #d773ff; --balance-outline: #2b0a38; }
.balance-band-24 { --balance-text: #ffff73; --balance-outline: #38380a; }
.state, .empty { padding: 54px 18px; text-align: center; color: var(--muted); }
.empty { border: 1px solid var(--line); border-top: 0; }

footer { width: min(1180px, calc(100% - 48px)); margin: 0 auto; padding: 24px 0 36px; display: flex; justify-content: space-between; gap: 20px; color: #747b6f; font-size: 11px; border-top: 1px solid var(--line); }

@media (max-width: 820px) {
  .summary { align-items: flex-start; flex-direction: column; min-height: 0; padding-top: 54px; }
  .stats { width: 100%; min-width: 0; }
  .podium { grid-template-columns: 1fr; }
  .ranking-toolbar { align-items: stretch; flex-direction: column; }
  .search { width: 100%; }
}
@media (max-width: 560px) {
  main, footer { width: min(100% - 28px, 1180px); }
  .topbar { padding: 0 14px; }
  .language-label, .brand small { display: none; }
  .summary { padding: 44px 0 32px; gap: 34px; }
  .stats div { padding: 16px 10px; }
  .stats dt { min-height: 30px; }
  .stats dd { font-size: 18px; }
  .podium-card { min-height: 128px; }
  footer { flex-direction: column; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; } }
