:root {
  color-scheme: dark;
  --bg: #101113;
  --panel: #191b1e;
  --line: #303238;
  --text: #f5f2ee;
  --muted: #afb2b9;
  --orange: #ffad72;
  --green: #97d6b6;
  font-family: "Inter", "Microsoft YaHei UI", system-ui, sans-serif;
  color: var(--text);
  background: var(--bg);
}
* { box-sizing: border-box; }
body { margin: 0; }
.frame { width: min(1240px, calc(100% - 72px)); margin-inline: auto; }
.topbar { border-bottom: 1px solid var(--line); background: #141517; }
.header-inner { display: flex; align-items: center; min-height: 74px; gap: 42px; }
.brand { display: flex; align-items: center; gap: 12px; color: var(--text); text-decoration: none; font-weight: 800; letter-spacing: .06em; }
.brand small { display: block; color: var(--muted); font: 600 9px/1.6 "IBM Plex Mono", Consolas, monospace; letter-spacing: .12em; margin-top: 3px; }
.emblem { width: 37px; height: 37px; display: grid; place-items: center; border: 1px solid #805739; border-radius: 8px; background: #292019; }
.emblem i { width: 16px; height: 16px; transform: rotate(45deg); border: 2px solid var(--orange); position: relative; }
.emblem i::after { content: ""; position: absolute; inset: 4px; background: var(--orange); }
nav { display: flex; align-self: stretch; gap: 28px; }
nav a { display: flex; align-items: center; color: var(--muted); text-decoration: none; font-size: 14px; border-bottom: 2px solid transparent; }
nav a[aria-current] { color: var(--orange); border-bottom-color: var(--orange); }
.connection { margin-left: auto; color: var(--muted); font-size: 13px; white-space: nowrap; }
.connection::before { content: ""; display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: currentColor; margin: 0 8px 2px 0; }
.connection[data-state="ok"] { color: var(--green); }
.connection[data-state="error"] { color: #ff9b95; }
.hero { position: relative; display: flex; align-items: center; min-height: 263px; margin-top: 30px; overflow: hidden; border: 1px solid var(--line); border-radius: 14px; background: linear-gradient(90deg,#181717 2%,rgba(24,23,23,.94) 24%,rgba(24,23,23,.22) 74%), url("/facility.webp") center 54%/cover, radial-gradient(ellipse at 74% 48%,#433027,#202129 50%,#171819); }
.hero-content { padding: 34px 46px; }
.eyebrow { color: var(--orange); font-size: 13px; font-weight: 750; letter-spacing: .18em; }
h1 { font-size: clamp(38px,5.2vw,66px); letter-spacing: .02em; margin: 9px 0 13px; line-height: 1.12; }
.hero-content > p:last-child { color: #c3c0bc; margin-bottom: 0; }
.metrics { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 14px; margin: 18px 0 33px; }
.metrics article { display: flex; flex-direction: column; gap: 7px; background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 18px 21px; }
.metrics span { font-size: 14px; color: var(--muted); }
.metrics strong { font: 600 clamp(22px,3vw,35px)/1.2 "IBM Plex Mono", Consolas, monospace; overflow-wrap: anywhere; }
.metrics article:last-child strong { color: var(--orange); }
.metrics small { color: var(--muted); font-size: 12px; }
.records { border: 1px solid var(--line); background: var(--panel); border-radius: 12px; overflow: hidden; }
.section-heading { display: flex; align-items: center; justify-content: space-between; padding: 19px 22px 10px; }
h2 { margin: 0; font-size: 22px; }
form { display: flex; gap: 12px; align-items: end; padding: 6px 22px 18px; }
.field { display: grid; gap: 7px; }
.field.search { width: min(440px,100%); }
label { font-size: 13px; color: var(--muted); }
input, select, button { font: inherit; min-height: 44px; padding: 8px 13px; background: #111214; color: var(--text); border: 1px solid #3e4148; border-radius: 7px; }
input { min-width: 0; width: 100%; }
input::placeholder { color: #a1a4ad; }
button { cursor: pointer; font-size: 14px; white-space: nowrap; }
button:hover:not(:disabled) { border-color: var(--orange); }
button:disabled { cursor: default; opacity: .5; }
.primary { background: var(--orange); color: #1c130e; border-color: var(--orange); font-weight: 750; min-width: 78px; }
:focus-visible { outline: 2px solid var(--orange); outline-offset: 3px; }
.message { color: var(--muted); padding: 0 22px; font-size: 14px; }
.message:not(:empty) { padding-bottom: 15px; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; text-align: left; font-size: 14px; }
th, td { padding: 13px 14px; border-top: 1px solid var(--line); vertical-align: middle; }
th { background: #202226; color: #c6c9ce; font-weight: 650; white-space: nowrap; }
td:first-child, th:first-child { padding-left: 22px; }
td:last-child, th:last-child { padding-right: 22px; }
.player-cell { min-width: 170px; overflow-wrap: anywhere; }
.rank-cell { width: 1%; text-align: center; }
.rank-number { display: inline-grid; place-items: center; min-width: 2.5em; padding: 4px 6px; border-radius: 6px; font: 650 14px/1.25 "IBM Plex Mono", Consolas, monospace; color: var(--muted); }
.rank-number[data-place="1"] { color: #ffd487; background: #46361c; }
.rank-number[data-place="2"] { color: #dbe3ed; background: #323a45; }
.rank-number[data-place="3"] { color: #ffbe9d; background: #473027; }
.ranking-metric { color: var(--orange); font-weight: 700; white-space: nowrap; }
.ranking-metric[aria-sort="descending"]::after { content: " ↓"; }
.field[hidden] { display: none; }
td:nth-child(3) { overflow-wrap: anywhere; }
tr:hover td { background: #1e2024; }
td small { display: block; margin-top: 4px; color: var(--muted); }
.status { display: inline-block; padding: 4px 8px; border-radius: 5px; color: var(--muted); background: #2b2d31; white-space: nowrap; }
.status.active { color: var(--orange); background: #3b2b22; }
.pagination { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 12px 22px; border-top: 1px solid var(--line); color: var(--muted); font-size: 13px; }
.pagination div { display: flex; gap: 8px; }
footer { display: flex; justify-content: space-between; padding: 23px 0 32px; color: var(--muted); font-size: 12px; }
@media (max-width: 700px) {
  .frame { width: calc(100% - 28px); }
  .header-inner { gap: 14px; flex-wrap: wrap; padding-top: 14px; }
  nav { order: 3; width: 100%; min-height: 44px; }
  .hero { min-height: 210px; margin-top: 17px; }
  .hero-content { padding: 26px 20px; }
  .metrics { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 9px; margin-bottom: 22px; }
  .metrics article { padding: 14px; }
  .section-heading, form, .pagination { padding-left: 13px; padding-right: 13px; }
  form { display: grid; grid-template-columns: minmax(0,1fr) auto; }
  .ranking-filters { display: flex; }
  .field.search { grid-column: span 2; width: 100%; }
}
