:root {
  --bg: #0b1020;
  --card: #111a33;
  --ink: #0b1020;
  --paper: #f7f7fb;
  --muted: rgba(255,255,255,.7);
  --border: rgba(255,255,255,.15);
  --pink: #ff5bd6;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  background: radial-gradient(circle at 20% 10%, #233a7a, var(--bg));
  color: white;
}

.wrap { max-width: 1760px; margin: 0 auto; padding: 18px 28px; }

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 14px 14px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: rgba(0,0,0,.25);
  backdrop-filter: blur(8px);
}
h1 { margin: 0; font-size: 20px; }
.sub { margin-top: 6px; font-size: 13px; color: var(--muted); }

.actions button{
  cursor: pointer;
  border: 1px solid var(--border);
  background: rgba(255,255,255,.08);
  color: white;
  padding: 10px 12px;
  border-radius: 12px;
}
.actions button:hover { background: rgba(255,255,255,.14); }

.grid {
  display: grid;
  grid-template-columns: 0.85fr 0.85fr 1.3fr;
  gap: 16px;
  margin-top: 18px;
  align-items: stretch;
}

.card {
  position: relative;
  border-radius: 18px;
  overflow: hidden;
  border: 1px solid var(--border);
  padding: 16px;
  min-height: 520px;
  height: 100%;
  text-align: center;
}
.card.light {
  background: var(--paper);
  color: var(--ink);
  border-color: rgba(0,0,0,.12);
}
.card.dark {
  background: rgba(0,0,0,.25);
  color: white;
}
.card.chart {
  background: rgba(0,0,0,.2);
}

.title { margin: 0 0 14px; letter-spacing: .08em; }
.title.neon { color: var(--pink); text-shadow: 0 0 10px rgba(255,91,214,.25); }
.trophy-pixel {
  display: inline-block;
  width: 70px;
  height: 70px;
  vertical-align: middle;
  image-rendering: pixelated;
  background-repeat: no-repeat;
  background-size: contain;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' shape-rendering='crispEdges'%3E%3Crect x='3' y='1' width='10' height='1' fill='%231f2147'/%3E%3Crect x='2' y='2' width='12' height='1' fill='%231f2147'/%3E%3Crect x='2' y='3' width='1' height='6' fill='%231f2147'/%3E%3Crect x='13' y='3' width='1' height='6' fill='%231f2147'/%3E%3Crect x='3' y='9' width='10' height='1' fill='%231f2147'/%3E%3Crect x='6' y='10' width='1' height='3' fill='%231f2147'/%3E%3Crect x='9' y='10' width='1' height='3' fill='%231f2147'/%3E%3Crect x='5' y='13' width='6' height='1' fill='%231f2147'/%3E%3Crect x='4' y='14' width='8' height='1' fill='%231f2147'/%3E%3Crect x='3' y='15' width='10' height='1' fill='%231f2147'/%3E%3Crect x='0' y='4' width='1' height='4' fill='%231f2147'/%3E%3Crect x='1' y='3' width='1' height='1' fill='%231f2147'/%3E%3Crect x='1' y='8' width='1' height='1' fill='%231f2147'/%3E%3Crect x='14' y='3' width='1' height='1' fill='%231f2147'/%3E%3Crect x='14' y='8' width='1' height='1' fill='%231f2147'/%3E%3Crect x='15' y='4' width='1' height='4' fill='%231f2147'/%3E%3Crect x='3' y='2' width='10' height='1' fill='%23f7d34d'/%3E%3Crect x='3' y='3' width='10' height='1' fill='%23eaa629'/%3E%3Crect x='3' y='4' width='10' height='4' fill='%23f5c63f'/%3E%3Crect x='4' y='8' width='8' height='1' fill='%23eaa629'/%3E%3Crect x='1' y='4' width='2' height='1' fill='%23f5c63f'/%3E%3Crect x='1' y='5' width='1' height='2' fill='%23f5c63f'/%3E%3Crect x='1' y='7' width='2' height='1' fill='%23f5c63f'/%3E%3Crect x='13' y='4' width='2' height='1' fill='%23f5c63f'/%3E%3Crect x='14' y='5' width='1' height='2' fill='%23f5c63f'/%3E%3Crect x='13' y='7' width='2' height='1' fill='%23f5c63f'/%3E%3Crect x='4' y='3' width='2' height='1' fill='%23fff0a8'/%3E%3Crect x='4' y='4' width='1' height='3' fill='%23fff0a8'/%3E%3Crect x='6' y='4' width='4' height='4' fill='%23f7f7f2'/%3E%3Crect x='7' y='5' width='2' height='1' fill='%23c9842d'/%3E%3Crect x='8' y='6' width='1' height='2' fill='%23c9842d'/%3E%3Crect x='7' y='7' width='2' height='1' fill='%23c9842d'/%3E%3Crect x='10' y='5' width='1' height='3' fill='%23f7f7f2'/%3E%3Crect x='7' y='10' width='2' height='3' fill='%23c9842d'/%3E%3Crect x='5' y='14' width='6' height='1' fill='%23f5c63f'/%3E%3C/svg%3E");
}
.trophy-corner {
  position: absolute;
  right: 18px;
  top: 14px;
  margin-left: 0;
  z-index: 2;
}
.trophy-pixel[hidden] {
  display: none !important;
}

.metric .label { font-size: 16px; opacity: .85; }
.metric .value { margin-top: 10px; font-size: 54px; font-weight: 800; }
.metric .value.pink { color: var(--pink); text-shadow: 0 0 10px rgba(255,91,214,.25); }

.times {
  margin-top: 12px;
  font-size: 16px;
  display: grid;
  gap: 8px;
  justify-items: center;
}
.times .k { font-weight: 700; }

.leaderboard { margin-top: 18px; }
.leaderboard h3 { margin: 0 0 10px; }
.leaderboard ol {
  margin: 0 auto;
  padding-left: 0;
  list-style: none;
  display: grid;
  gap: 6px;
}
.leaderboard li {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 10px;
  border-radius: 12px;
}
.card.light .leaderboard li { background: rgba(0,0,0,.06); }
.card.dark  .leaderboard li { background: rgba(255,255,255,.06); }

.chart-sub {
  margin: 0 0 8px;
  color: var(--muted);
  font-size: 14px;
  text-align: center;
}
.legend {
  display: flex;
  gap: 14px;
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 10px;
  justify-content: center;
}
.legend span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  display: inline-block;
}
.dot.non { background: #7dc4ff; }
.dot.gam { background: var(--pink); }

.chart-svg {
  width: 100%;
  height: 420px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: linear-gradient(180deg, rgba(255,255,255,.02), rgba(255,255,255,.01));
}
.chart-scale {
  margin-top: 8px;
  font-size: 13px;
  color: var(--muted);
  text-align: center;
}

.foot { margin-top: 12px; color: var(--muted); font-size: 13px; }

@media (max-width: 1400px) {
  .grid { grid-template-columns: 1fr 1fr 1.15fr; }
}

@media (max-width: 1200px) {
  .wrap { padding: 18px; }
  .grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 900px) {
  .grid { grid-template-columns: 1fr; }
  .card { min-height: unset; }
}
