:root {
  color-scheme: dark;
  --ink: #f0f5ec;
  --muted: #aab7aa;
  --panel: rgba(24, 35, 27, 0.9);
  --panel-edge: rgba(181, 223, 154, 0.14);
  --moss: #8dc46e;
  --moss-bright: #b7ea91;
  --earth: #8d6848;
  --danger: #ffba72;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }

body {
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  background:
    linear-gradient(180deg, rgba(8, 14, 10, 0.22), #101712 78%),
    repeating-linear-gradient(90deg, transparent 0 31px, rgba(255,255,255,.012) 31px 32px),
    #101712;
}

.sky {
  position: fixed;
  inset: 0 0 auto;
  height: 24rem;
  pointer-events: none;
  background:
    radial-gradient(circle at 18% 26%, rgba(140, 198, 110, .18), transparent 30%),
    radial-gradient(circle at 84% 0%, rgba(82, 142, 126, .22), transparent 36%);
  mask-image: linear-gradient(#000 60%, transparent);
}

.shell {
  position: relative;
  width: min(1120px, calc(100% - 2rem));
  margin: 0 auto;
  padding: 4.5rem 0 3rem;
}

.hero {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 2rem;
  margin-bottom: 2.5rem;
}

.eyebrow {
  margin: 0 0 .6rem;
  color: var(--moss-bright);
  font-size: .74rem;
  font-weight: 800;
  letter-spacing: .18em;
}

h1, h2, p { margin-top: 0; }
h1 {
  max-width: 12ch;
  margin-bottom: .7rem;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(3rem, 8vw, 6.2rem);
  font-weight: 500;
  letter-spacing: -.055em;
  line-height: .88;
}

.intro { margin-bottom: 0; color: var(--muted); font-size: 1.05rem; }

.status {
  display: flex;
  align-items: center;
  flex: 0 0 auto;
  gap: .65rem;
  padding: .72rem 1rem;
  border: 1px solid var(--panel-edge);
  border-radius: 999px;
  background: rgba(11, 18, 13, .72);
  color: var(--muted);
  font-size: .82rem;
}

.status-dot {
  width: .58rem;
  height: .58rem;
  border-radius: 2px;
  background: var(--moss);
  box-shadow: 0 0 16px rgba(141, 196, 110, .55);
}

.status.loading .status-dot { animation: pulse 1.3s infinite; }
.status.stale .status-dot, .status.error .status-dot { background: var(--danger); box-shadow: none; }

.summary {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  overflow: hidden;
  margin-bottom: 3rem;
  border: 1px solid var(--panel-edge);
  border-radius: 18px;
  background: rgba(18, 27, 21, .72);
  box-shadow: 0 24px 80px rgba(0, 0, 0, .2);
}

.summary article { padding: 1.4rem 1.6rem; }
.summary article + article { border-left: 1px solid var(--panel-edge); }
.summary-label { display: block; margin-bottom: .35rem; color: var(--muted); font-size: .78rem; }
.summary strong { font-family: Georgia, serif; font-size: 1.8rem; font-weight: 500; }

.section-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}

.section-heading h2 { margin-bottom: 0; font-size: 1.15rem; letter-spacing: -.02em; }
.section-heading p { margin-bottom: 0; color: var(--muted); font-size: .78rem; }

.table-frame {
  overflow: hidden;
  border: 1px solid var(--panel-edge);
  border-radius: 18px;
  background: var(--panel);
  box-shadow: 0 20px 55px rgba(0, 0, 0, .16);
}

table {
  width: 100%;
  border-collapse: collapse;
  font-variant-numeric: tabular-nums;
}

th, td { padding: 1rem 1.1rem; border-bottom: 1px solid var(--panel-edge); text-align: left; white-space: nowrap; }
th { color: var(--muted); background: rgba(11,18,13,.4); font-size: .68rem; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; }
.sort-button {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  min-height: 2rem;
  padding: 0;
  border: 0;
  color: inherit;
  background: transparent;
  font: inherit;
  letter-spacing: inherit;
  text-transform: inherit;
  cursor: pointer;
}
.numeric .sort-button { justify-content: flex-end; width: 100%; }
.sort-button::after { content: "↕"; color: #6f7d70; font-size: .72rem; }
th[aria-sort="ascending"] .sort-button,
th[aria-sort="descending"] .sort-button { color: var(--moss-bright); }
th[aria-sort="ascending"] .sort-button::after { content: "↑"; color: var(--moss-bright); }
th[aria-sort="descending"] .sort-button::after { content: "↓"; color: var(--moss-bright); }
.sort-button:focus-visible { border-radius: 3px; outline: 2px solid var(--moss-bright); outline-offset: 4px; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr { transition: background-color .18s ease; }
tbody tr:hover { background: rgba(141,196,110,.045); }
.numeric { text-align: right; }
.emphasis { color: var(--moss-bright); font-weight: 750; }
.player-cell { display: flex; align-items: center; gap: .75rem; }
.login-time { color: var(--muted); font-size: .8rem; }
.avatar {
  display: grid;
  flex: 0 0 auto;
  width: 2.25rem;
  height: 2.25rem;
  place-items: center;
  border: 1px solid rgba(183,234,145,.26);
  border-radius: 8px;
  background: rgba(141,196,110,.1);
  color: var(--moss-bright);
  font-family: ui-monospace, monospace;
  font-weight: 800;
  text-transform: uppercase;
}

.player-name, .player-subtitle { display: block; }
.player-name { font-size: .9rem; }
.player-subtitle { margin-top: .1rem; color: var(--muted); font-size: .65rem; }
.no-data, .table-error { color: var(--muted); font-size: .8rem; }
.table-error { padding: 2rem; text-align: center; }

.footnote { margin: 1.5rem 0 0; color: #839083; font-size: .72rem; }

.skeleton-row td {
  height: 4.5rem;
  background: linear-gradient(105deg, rgba(24,35,27,.75) 35%, rgba(47,64,49,.75) 48%, rgba(24,35,27,.75) 61%);
  background-size: 220% 100%;
  animation: shimmer 1.5s infinite;
}

@keyframes shimmer { to { background-position-x: -220%; } }
@keyframes pulse { 50% { opacity: .35; } }

@media (max-width: 700px) {
  .shell { padding-top: 2.5rem; }
  .hero { align-items: flex-start; flex-direction: column; }
  .summary { grid-template-columns: 1fr; }
  .summary article + article { border-top: 1px solid var(--panel-edge); border-left: 0; }
  .section-heading { align-items: flex-start; flex-direction: column; gap: .25rem; }
  .table-frame { overflow-x: auto; }
  table { min-width: 1040px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; }
}
