:root {
  --first: #ffe45e;
  --second: #d9e2ec;
  --third: #d6a26a;
  --default: #1f2937;
  --bg: #0f172a;
  --panel: rgba(15, 23, 42, 0.82);
  --panel-soft: rgba(30, 41, 59, 0.78);
  --text: #f8fafc;
  --muted: #94a3b8;
  --line: rgba(148, 163, 184, 0.18);
}

* { box-sizing: border-box; }
body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background:
    radial-gradient(circle at top left, rgba(56, 189, 248, 0.24), transparent 34rem),
    radial-gradient(circle at bottom right, rgba(250, 204, 21, 0.16), transparent 28rem),
    var(--bg);
  display: grid;
  grid-template-columns: 285px 1fr;
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 24px 18px 16px;
  background: rgba(2, 6, 23, 0.76);
  border-right: 1px solid var(--line);
  backdrop-filter: blur(18px);
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.brand {
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: linear-gradient(135deg, rgba(255, 228, 94, 0.14), rgba(56, 189, 248, 0.10));
}
.brand h1 {
  margin: 0;
  font-size: 20px;
  letter-spacing: -0.035em;
}
.brand p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 12px;
}

nav {
  overflow-y: auto;
  padding-right: 4px;
}
.category-title {
  margin: 22px 6px 10px;
  color: #fff7c2;
  font-size: 15px;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-weight: 1000;
  padding: 9px 11px;
  border-radius: 13px;
  background: linear-gradient(135deg, rgba(255, 228, 94, 0.18), rgba(56, 189, 248, 0.08));
  border: 1px solid rgba(255, 228, 94, 0.24);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.03);
}
.topic-link {
  width: 100%;
  display: block;
  color: var(--muted);
  background: transparent;
  border: 0;
  border-radius: 15px;
  text-align: left;
  padding: 10px 12px;
  cursor: pointer;
  font-size: 12.5px;
  transition: 0.18s ease;
}
.topic-link:hover, .topic-link.active {
  color: var(--text);
  background: rgba(148, 163, 184, 0.14);
  transform: translateX(4px);
}

footer {
  margin-top: auto;
  color: rgba(203, 213, 225, 0.76);
  font-size: 12px;
  text-align: center;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.content {
  padding: 34px;
  display: grid;
  align-content: start;
  gap: 20px;
}
.hero, .ranking-card {
  border: 1px solid var(--line);
  background: var(--panel);
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.28);
  border-radius: 30px;
}
.hero { padding: 24px 28px; }
.hero-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}
.next-update {
  color: #e2e8f0;
  font-size: 12px;
  font-weight: 800;
  padding: 8px 11px;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.13);
  border: 1px solid var(--line);
  white-space: nowrap;
}
.eyebrow {
  margin: 0;
  color: #67e8f9;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-weight: 900;
}
.hero h2 {
  margin: 0;
  font-size: clamp(20px, 2.6vw, 34px);
  letter-spacing: -0.055em;
}
#winner-text {
  margin: 12px 0 0;
  font-size: clamp(13px, 1.25vw, 17px);
  font-weight: 900;
}

.ranking-card { overflow: hidden; }
.ranking-header, .ranking-row {
  display: grid;
  grid-template-columns: 78px 1fr 170px;
  gap: 14px;
  align-items: center;
}
.ranking-header {
  padding: 14px 20px;
  color: var(--muted);
  font-size: 12px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-weight: 900;
  border-bottom: 1px solid var(--line);
}
.ranking-list { padding: 12px; }
.ranking-row {
  margin: 8px 0;
  padding: 12px 16px;
  border-radius: 20px;
  background: var(--panel-soft);
  border: 1px solid var(--line);
  animation: pop 0.28s ease both;
}
.ranking-row.top-three {
  color: #111827;
  font-size: 1.02rem;
  font-weight: 950;
  border: 0;
  transform: scale(1.01);
}
.rank-badge {
  width: 38px;
  height: 38px;
  display: inline-grid;
  place-items: center;
  border-radius: 12px;
  background: rgba(255,255,255,0.14);
  font-weight: 950;
}
.player-cell { display: flex; align-items: center; gap: 12px; min-width: 0; }
.trend {
  width: 20px;
  display: inline-grid;
  place-items: center;
  font-size: 18px;
  font-weight: 950;
  flex: 0 0 auto;
}
.trend-up { color: #22c55e; }
.trend-down { color: #ef4444; }
.trend-same { color: #94a3b8; }
.top-three .trend-up { color: #047857; }
.top-three .trend-down { color: #b91c1c; }
.top-three .trend-same { color: #4b5563; }
.player-head { width: 36px; height: 36px; border-radius: 9px; image-rendering: pixelated; box-shadow: 0 6px 16px rgba(0,0,0,0.22); flex: 0 0 auto; }
.player-name { font-size: 16px; font-weight: 850; }
.player-uuid { display: block; margin-top: 2px; font-size: 11px; opacity: 0.62; }
.value { text-align: right; font-size: 17px; font-weight: 950; }
.empty {
  padding: 40px;
  text-align: center;
  color: var(--muted);
}


.mobile-menu-button, .mobile-backdrop { display: none; }

@keyframes pop {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 880px) {
  body { display: block; padding-top: 64px; overflow-x: hidden; }
  .mobile-menu-button {
    display: inline-grid;
    position: fixed;
    top: 14px;
    left: 14px;
    z-index: 1200;
    width: 44px;
    height: 44px;
    place-items: center;
    border-radius: 14px;
    border: 1px solid var(--line);
    background: rgba(2, 6, 23, 0.92);
    color: var(--text);
    font-size: 24px;
    font-weight: 900;
    box-shadow: 0 16px 40px rgba(0,0,0,0.35);
  }
  .mobile-backdrop {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 1000;
    background: rgba(2, 6, 23, 0.62);
    backdrop-filter: blur(3px);
  }
  .mobile-backdrop[hidden] { display: none; }
  .sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 1100;
    width: min(82vw, 330px);
    height: 100vh;
    transform: translateX(-105%);
    transition: transform 0.22s ease;
    border-right: 1px solid var(--line);
    border-bottom: 0;
  }
  body.nav-open .sidebar { transform: translateX(0); }
  .content { padding: 18px; }
  .hero, .ranking-card { border-radius: 22px; }
  .hero { padding: 18px; }
  .hero-top { align-items: flex-start; flex-direction: column; }
  .next-update { white-space: normal; }
  .ranking-header { display: none; }
  .ranking-list { padding: 10px; }
  .ranking-row {
    grid-template-columns: 50px 1fr;
    gap: 10px;
    padding: 12px;
  }
  .ranking-row .value {
    grid-column: 2;
    text-align: left;
    font-size: 15px;
  }
  .player-cell { gap: 8px; }
  .trend { width: 16px; font-size: 16px; }
  .player-head { width: 32px; height: 32px; }
  .player-name { font-size: 15px; }
  .player-uuid { display: none; }
  .rank-badge { width: 34px; height: 34px; }
}
