* {
  box-sizing: border-box;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

body {
  margin: 0;
  min-height: 100vh;
  background: radial-gradient(circle at top, #1e293b, #020617);
  color: #e5e7eb;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Container */
.container {
  width: 100%;
  max-width: 760px;
  background: #020617cc;
  border-radius: 18px;
  padding: 36px;
  box-shadow: 0 0 40px rgba(0,0,0,0.6);
}

h1 {
  margin-top: 0;
  text-align: center;
  font-size: 2rem;
  margin-bottom: 26px;
}

/* Upload */
.upload {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

input[type="file"] {
  background: #020617;
  color: #e5e7eb;
  padding: 14px;
  border-radius: 10px;
  border: 1px solid #334155;
}

button {
  padding: 14px;
  font-size: 1rem;
  border-radius: 12px;
  border: none;
  background: linear-gradient(135deg, #22d3ee, #38bdf8);
  color: #020617;
  cursor: pointer;
  font-weight: 700;
}

button:hover {
  filter: brightness(1.1);
}

/* Tabs */
.tabs {
  display: flex;
  justify-content: center;
  gap: 16px;
  margin-bottom: 26px;
}

.tab {
  display: none;
}

.tab.active {
  display: block;
}

/* Results */
.results {
  margin-top: 28px;
  display: grid;
  gap: 24px;
}

.card {
  background: #020617;
  border-radius: 16px;
  padding: 20px;
  border: 1px solid #1e293b;
}

.card h2 {
  margin: 0 0 16px;
  font-size: 1.2rem;
  color: #38bdf8;
}

.stat {
  display: flex;
  justify-content: space-between;
  padding: 8px 0;
  font-size: 1rem;
}

.label {
  color: #94a3b8;
}

/* Leaderboard */
.leaderboard-container {
  max-height: 460px;
  overflow-y: auto;
  margin-top: 16px;
  border: 1px solid #1e293b;
  border-radius: 14px;
}

table {
  width: 100%;
  border-collapse: collapse;
}

th, td {
  padding: 16px 14px;
  border-bottom: 1px solid #334155;
}

th {
  text-align: left;
  color: #7dd3fc;
  font-weight: 600;
}

/* Ranking */
.rank {
  font-weight: 700;
  width: 48px;
}

.rank-1 {
  background: linear-gradient(90deg, #b89f00, transparent);
}
.rank-2 {
  background: linear-gradient(90deg, #2f3440, transparent);
}
.rank-3 {
  background: linear-gradient(90deg, #3a2416, transparent);
}

.rank-1 td,
.rank-2 td,
.rank-3 td {
  font-weight: 700;
}

/* Scrollbar */
.leaderboard-container::-webkit-scrollbar {
  width: 8px;
}
.leaderboard-container::-webkit-scrollbar-thumb {
  background: #38bdf8;
  border-radius: 10px;
}
.leaderboard-container::-webkit-scrollbar-track {
  background: #020617;
}

/* Replay Path Helper */
.replay-help {
  margin-top: 24px;
  padding: 16px;
  background: rgba(2, 6, 23, 0.7);
  border: 1px solid #1e293b;
  border-radius: 12px;
  font-size: 0.9rem;
}

.replay-help h3 {
  margin: 0 0 8px;
  font-size: 1rem;
  color: #7dd3fc;
}

.replay-help p {
  margin: 6px 0;
  color: #cbd5f5;
}

.replay-help code {
  display: block;
  margin: 10px 0;
  padding: 10px;
  background: #020617;
  border-radius: 8px;
  border: 1px solid #334155;
  font-family: monospace;
  color: #38bdf8;
  word-break: break-all;
}

.replay-help .hint {
  font-size: 0.85rem;
  color: #94a3b8;
}
