:root {
  color-scheme: light;
  --blue: #1a3fbf;
  --blue-soft: #eaf0ff;
  --ink: #26324a;
  --muted: #778096;
  --background: #f3f5f9;
  --surface: #fff;
  --line: #e3e7ef;
  --shadow: 0 14px 36px rgba(36, 52, 90, .09);
}

* { box-sizing: border-box; }
body { margin: 0; background: var(--background); color: var(--ink); font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; }
.site-header { background: var(--surface); border-bottom: 1px solid var(--line); }
.header-inner { width: min(1120px, calc(100% - 32px)); height: 96px; margin: auto; display: flex; align-items: center; gap: 16px; }
.brand-icon { width: 62px; height: 62px; border-radius: 18px; box-shadow: 0 8px 18px rgba(26, 63, 191, .2); }
.eyebrow { margin: 0 0 2px; color: var(--blue); font-size: .7rem; font-weight: 800; letter-spacing: .14em; }
h1 { margin: 0; font-size: 1.75rem; line-height: 1; }
.live-pill { margin-left: auto; display: flex; align-items: center; gap: 7px; padding: 8px 12px; border-radius: 999px; background: #eef9f1; color: #288348; font-weight: 700; font-size: .8rem; }
.live-pill span { width: 8px; height: 8px; border-radius: 50%; background: #39a85e; box-shadow: 0 0 0 4px rgba(57,168,94,.14); }
main { width: min(1120px, calc(100% - 32px)); margin: 42px auto; }
.intro { display: flex; justify-content: space-between; align-items: end; gap: 20px; margin-bottom: 24px; }
.intro h2 { margin: 0 0 8px; font-size: clamp(1.7rem, 4vw, 2.5rem); }
.intro p { margin: 0; color: var(--muted); }
.updated { white-space: nowrap; font-size: .8rem; }
.download-banner { display: flex; align-items: center; gap: 18px; margin-bottom: 18px; padding: 20px; border: 1px solid rgba(26,63,191,.15); border-radius: 22px; background: linear-gradient(135deg, #fff 0%, var(--blue-soft) 100%); box-shadow: var(--shadow); }
.download-mark { width: 52px; height: 52px; flex: none; display: grid; place-items: center; border-radius: 16px; background: var(--blue); color: #fff; font-size: 1.7rem; font-weight: 900; }
.download-copy { min-width: 0; }
.download-copy h2 { margin: 1px 0 5px; font-size: 1.25rem; }
.download-copy p:last-child { margin: 0; color: var(--muted); font-size: .84rem; }
.download-button { width: auto; height: 46px; margin-left: auto; padding: 0 20px; display: inline-flex; align-items: center; justify-content: center; flex: none; border-radius: 13px; background: var(--blue); color: #fff; text-decoration: none; font-weight: 800; transition: filter .15s ease, transform .15s ease; }
.download-button:hover { filter: brightness(1.08); transform: translateY(-1px); }
.download-button:focus-visible { outline: 3px solid rgba(26,63,191,.22); outline-offset: 3px; }
.filters { display: grid; grid-template-columns: repeat(3, minmax(140px, 1fr)) minmax(210px, 1.4fr) auto; gap: 12px; padding: 18px; margin-bottom: 18px; border-radius: 20px; background: var(--surface); box-shadow: var(--shadow); }
label span { display: block; margin: 0 0 6px 3px; color: var(--muted); font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; }
select, input, button { width: 100%; height: 46px; border: 1px solid var(--line); border-radius: 13px; background: #fafbfe; color: var(--ink); font: inherit; }
select, input { padding: 0 13px; }
select:focus, input:focus, button:focus-visible { outline: 3px solid rgba(26,63,191,.17); border-color: var(--blue); }
button { align-self: end; padding: 0 18px; border-color: var(--blue); background: var(--blue); color: #fff; cursor: pointer; font-weight: 750; }
button:hover { filter: brightness(1.08); }
button.loading { opacity: .65; pointer-events: none; }
.board-card { overflow: hidden; min-height: 280px; border-radius: 22px; background: var(--surface); box-shadow: var(--shadow); }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th { padding: 17px 20px; background: #f8f9fc; color: var(--muted); font-size: .72rem; text-align: left; text-transform: uppercase; letter-spacing: .07em; }
td { padding: 15px 20px; border-top: 1px solid var(--line); vertical-align: middle; }
tbody tr { transition: background .15s ease; }
tbody tr:hover { background: #fafbff; }
.rank { width: 96px; font-size: 1.05rem; font-weight: 850; }
.player { display: flex; align-items: center; gap: 12px; min-width: 190px; font-weight: 700; }
.avatar { width: 40px; height: 40px; flex: none; display: grid; place-items: center; border-radius: 50%; background: var(--blue-soft); color: var(--blue); object-fit: cover; font-weight: 800; }
.difficulty { display: inline-flex; padding: 6px 10px; border-radius: 999px; background: var(--blue-soft); color: var(--blue); font-size: .76rem; font-weight: 800; }
.score { color: var(--blue); font-size: 1.05rem; font-weight: 850; }
.empty, .error { padding: 58px 20px; text-align: center; }
.empty-grid { width: 52px; height: 52px; margin: 0 auto 14px; display: grid; place-items: center; border: 3px solid var(--blue); border-radius: 13px; color: var(--blue); font-size: 1.5rem; font-weight: 900; }
.empty h3 { margin: 0 0 6px; }
.empty p, .error { color: var(--muted); }
.error { color: #b83434; }
footer { padding: 30px 16px 42px; color: var(--muted); text-align: center; font-size: .78rem; }

@media (max-width: 880px) {
  .filters { grid-template-columns: repeat(2, 1fr); }
  button { grid-column: span 2; }
}
@media (max-width: 580px) {
  .header-inner { height: 78px; }
  .brand-icon { width: 50px; height: 50px; border-radius: 14px; }
  h1 { font-size: 1.4rem; }
  main { margin-top: 28px; }
  .intro { align-items: start; flex-direction: column; }
  .download-banner { align-items: flex-start; flex-wrap: wrap; padding: 17px; border-radius: 18px; }
  .download-mark { width: 46px; height: 46px; border-radius: 14px; }
  .download-copy { width: calc(100% - 64px); }
  .download-button { width: 100%; margin-left: 0; }
  .filters { grid-template-columns: 1fr; padding: 14px; border-radius: 17px; }
  button { grid-column: auto; }
  th, td { padding: 13px 12px; }
  th:nth-child(3), td:nth-child(3) { display: none; }
  .rank { width: 70px; }
}
