* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: #f5f7fa;
  color: #333;
  min-height: 100vh;
}

.container {
  max-width: 1000px;
  margin: 0 auto;
  padding: 2rem 1rem;
}

header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2rem;
  padding-bottom: 1rem;
  border-bottom: 2px solid #e1e8ed;
}

h1 {
  font-size: 2rem;
  color: #1a1a2e;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 1rem;
}

#user-display {
  font-weight: 600;
  color: #667eea;
}

button, a {
  padding: 0.5rem 1rem;
  background: #667eea;
  color: white;
  border: none;
  border-radius: 6px;
  text-decoration: none;
  cursor: pointer;
  font-size: 0.9rem;
  transition: background 0.3s ease;
}

button:hover, a:hover {
  background: #764ba2;
}

.controls {
  margin-bottom: 2rem;
  display: flex;
  align-items: center;
  gap: 1rem;
}

label {
  font-weight: 600;
  color: #666;
}

select {
  padding: 0.5rem 1rem;
  border: 1px solid #ddd;
  border-radius: 6px;
  font-size: 1rem;
  cursor: pointer;
  background: white;
  min-width: 200px;
}

.leaderboard-section {
  background: white;
  border-radius: 12px;
  padding: 2rem;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  margin-bottom: 2rem;
}

h2 {
  font-size: 1.5rem;
  margin-bottom: 1rem;
  color: #1a1a2e;
}

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

thead {
  background: #f9f9f9;
}

th {
  padding: 1rem;
  text-align: left;
  font-weight: 600;
  color: #666;
  border-bottom: 2px solid #e1e8ed;
}

td {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid #f0f0f0;
}

tbody tr:hover {
  background: #fafbfc;
}

tbody tr.highlight {
  background: #e8f4f8;
  font-weight: 600;
}

.loading {
  text-align: center;
  color: #999;
}

.player-stats {
  background: white;
  border-radius: 12px;
  padding: 2rem;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  margin-bottom: 2rem;
}

.player-stats h3 {
  margin-bottom: 1rem;
  color: #1a1a2e;
}

#stats-content {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1rem;
}

.stat-card {
  background: #f9f9f9;
  padding: 1rem;
  border-radius: 8px;
  border-left: 4px solid #667eea;
}

.stat-card h4 {
  font-size: 0.9rem;
  color: #999;
  margin-bottom: 0.5rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.stat-card .value {
  font-size: 1.5rem;
  font-weight: 700;
  color: #1a1a2e;
}

.back-link {
  text-align: center;
  margin-top: 2rem;
  font-size: 0.9rem;
}

.back-link a {
  color: #667eea;
  text-decoration: none;
  background: none;
  padding: 0;
  display: inline-block;
}

.back-link a:hover {
  color: #764ba2;
  background: none;
}

@media (max-width: 600px) {
  header {
    flex-direction: column;
    gap: 1rem;
    align-items: flex-start;
  }

  h1 {
    font-size: 1.5rem;
  }

  .controls {
    flex-direction: column;
    align-items: flex-start;
  }

  select {
    width: 100%;
  }

  .leaderboard-table {
    font-size: 0.9rem;
  }

  th, td {
    padding: 0.5rem;
  }
}
