* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  background: linear-gradient(135deg, #0f172a 0%, #1e293b 50%, #0f172a 100%);
  min-height: 100vh;
  padding: 20px;
  color: #1e293b;
}

.container {
  max-width: 1000px;
  margin: 0 auto;
  background: white;
  border-radius: 16px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  overflow: hidden;
}

.header {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  padding: 40px 30px;
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 30px;
  flex-wrap: wrap;
}

.header-content h1 {
  font-size: 2.8em;
  margin-bottom: 8px;
  font-weight: 700;
}

.subtitle {
  font-size: 1.1em;
  opacity: 0.9;
  font-weight: 300;
}

.search-container {
  position: relative;
  flex: 1;
  min-width: 250px;
  max-width: 350px;
}

.search-bar {
  width: 100%;
  padding: 12px 45px 12px 16px;
  border: none;
  border-radius: 10px;
  font-size: 1em;
  background: rgba(255, 255, 255, 0.95);
  transition: all 0.3s ease;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.search-bar:focus {
  outline: none;
  background: white;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
  transform: translateY(-2px);
}

.search-icon {
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  width: 20px;
  height: 20px;
  color: #94a3b8;
  pointer-events: none;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 20px;
  padding: 30px;
  background: #f8fafc;
  border-bottom: 1px solid #e2e8f0;
}

.stat-card {
  background: white;
  padding: 20px;
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
  text-align: center;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.stat-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.1);
}

.stat-label {
  font-size: 0.9em;
  color: #64748b;
  font-weight: 600;
  margin-bottom: 10px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.stat-value {
  font-size: 2em;
  font-weight: 700;
  color: #667eea;
}

.loading {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 60px 20px;
  text-align: center;
  color: #64748b;
}

.spinner {
  width: 50px;
  height: 50px;
  border: 4px solid #e2e8f0;
  border-top-color: #667eea;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin-bottom: 20px;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.leaderboard-wrapper {
  overflow-x: auto;
  padding: 0;
}

.leaderboard {
  width: 100%;
  border-collapse: collapse;
  padding: 0;
}

.leaderboard thead {
  background: #f8fafc;
  border-bottom: 2px solid #e2e8f0;
}

.leaderboard th {
  padding: 16px;
  text-align: left;
  font-weight: 600;
  color: #475569;
  font-size: 0.9em;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.rank-col { width: 80px; }
.player-col { width: 200px; }
.stat-col { width: 100px; }
.ratio-col { width: 100px; }

.leaderboard tbody tr {
  border-bottom: 1px solid #e2e8f0;
  transition: background-color 0.2s ease;
}

.leaderboard tbody tr:hover {
  background: #f8fafc;
}

.leaderboard td {
  padding: 16px;
  color: #1e293b;
}

.rank {
  font-weight: 700;
  font-size: 1.2em;
  color: #667eea;
}

.rank.gold { color: #f59e0b; }
.rank.silver { color: #9ca3af; }
.rank.bronze { color: #d97706; }

.player-name {
  font-weight: 600;
  color: #1e293b;
}

.kills {
  color: #10b981;
  font-weight: 600;
  font-size: 1.05em;
}

.deaths {
  color: #ef4444;
  font-weight: 500;
}

.kd {
  font-weight: 700;
  color: #f59e0b;
  font-size: 1.05em;
}

.no-results {
  padding: 60px 20px;
  text-align: center;
  color: #94a3b8;
  font-size: 1.1em;
}

.footer {
  padding: 20px 30px;
  background: #f8fafc;
  border-top: 1px solid #e2e8f0;
  text-align: center;
  color: #94a3b8;
  font-size: 0.9em;
}

@media (max-width: 768px) {
  .header {
    flex-direction: column;
    align-items: stretch;
  }

  .search-container {
    min-width: 100%;
    max-width: 100%;
  }

  .header-content h1 {
    font-size: 2em;
  }

  .stats-grid {
    grid-template-columns: 1fr;
  }

  .leaderboard th,
  .leaderboard td {
    padding: 12px;
    font-size: 0.9em;
  }

  .rank-col { width: 60px; }
  .player-col { width: 150px; }
  .stat-col { width: 80px; }
  .ratio-col { width: 80px; }
}