/* Reset and base styles */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen,
    Ubuntu, sans-serif;
  line-height: 1.6;
  color: #333;
  background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
  min-height: 100vh;
}

/* Navigation */
nav {
  background: rgba(0, 0, 0, 0.3);
  backdrop-filter: blur(10px);
  padding: 1rem 2rem;
  position: sticky;
  top: 0;
  z-index: 100;
}

.nav-container {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo {
  font-size: 1.5rem;
  font-weight: bold;
  color: #fff;
  text-decoration: none;
}

.nav-links {
  list-style: none;
  display: flex;
  gap: 2rem;
}

.nav-links a {
  color: #fff;
  text-decoration: none;
  transition: color 0.3s;
}

.nav-links a:hover {
  color: #4fc3f7;
}

/* Main content */
main {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem;
}

/* Hero section */
.hero {
  text-align: center;
  padding: 4rem 2rem;
  color: #fff;
}

.hero h1 {
  font-size: 3rem;
  margin-bottom: 1rem;
  background: linear-gradient(90deg, #4fc3f7, #81c784);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero p {
  font-size: 1.25rem;
  opacity: 0.9;
}

/* Features section */
.features {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 2rem;
  padding: 2rem 0;
}

.feature-card {
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
  border-radius: 12px;
  padding: 2rem;
  color: #fff;
  transition: transform 0.3s, box-shadow 0.3s;
}

.feature-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.feature-card h3 {
  font-size: 1.5rem;
  margin-bottom: 0.5rem;
}

.feature-card p {
  opacity: 0.8;
}

/* Content section (for about page) */
.content {
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
  border-radius: 12px;
  padding: 3rem;
  color: #fff;
}

.content h1 {
  font-size: 2.5rem;
  margin-bottom: 1rem;
  color: #4fc3f7;
}

.content h2 {
  font-size: 1.5rem;
  margin: 2rem 0 1rem;
  color: #81c784;
}

.content p {
  margin-bottom: 1rem;
  opacity: 0.9;
}

.content ul {
  margin-left: 2rem;
  margin-bottom: 1rem;
}

.content li {
  margin-bottom: 0.5rem;
  opacity: 0.9;
}

/* Leaderboard section */
.leaderboard {
  margin: 3rem 0;
}

.leaderboard-header {
  margin-bottom: 1.5rem;
}

.leaderboard-header h2 {
  color: #fff;
  font-size: 2rem;
  text-align: center;
  background: linear-gradient(90deg, #ffd700, #ffaa00);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.leaderboard-content {
  background: rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(10px);
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

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

#leaderboard-table thead {
  background: rgba(0, 0, 0, 0.3);
}

#leaderboard-table th {
  padding: 1rem 1.5rem;
  text-align: left;
  color: #4fc3f7;
  font-weight: 600;
  text-transform: uppercase;
  font-size: 0.85rem;
  letter-spacing: 0.5px;
}

#leaderboard-table td {
  padding: 1rem 1.5rem;
  color: #fff;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

#leaderboard-table tbody tr {
  transition: background 0.2s;
}

#leaderboard-table tbody tr:hover {
  background: rgba(255, 255, 255, 0.08);
}

#leaderboard-table tbody tr:nth-child(1) td:first-child {
  color: #ffd700;
  font-weight: bold;
}

#leaderboard-table tbody tr:nth-child(2) td:first-child {
  color: #c0c0c0;
  font-weight: bold;
}

#leaderboard-table tbody tr:nth-child(3) td:first-child {
  color: #cd7f32;
  font-weight: bold;
}

.player-link {
  color: #fff;
  text-decoration: none;
  transition: color 0.2s;
}

.player-link:hover {
  color: #4fc3f7;
  text-decoration: underline;
}

.rank-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  font-weight: bold;
  font-size: 0.9rem;
}

.rank-1 {
  background: linear-gradient(135deg, #ffd700, #ffaa00);
  color: #1a1a2e;
}
.rank-2 {
  background: linear-gradient(135deg, #c0c0c0, #a0a0a0);
  color: #1a1a2e;
}
.rank-3 {
  background: linear-gradient(135deg, #cd7f32, #b87333);
  color: #1a1a2e;
}

/* Player profile page */
.player-profile {
  background: rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(10px);
  border-radius: 16px;
  padding: 2rem;
  margin: 2rem 0;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.player-header {
  display: flex;
  align-items: center;
  gap: 2rem;
  margin-bottom: 2rem;
  padding-bottom: 2rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.player-name {
  font-size: 2.5rem;
  color: #fff;
  margin: 0;
}

.player-elo {
  font-size: 1.5rem;
  color: #4fc3f7;
}

.player-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 1rem;
  margin-bottom: 2rem;
}

.stat-card {
  background: rgba(0, 0, 0, 0.2);
  border-radius: 12px;
  padding: 1.5rem;
  text-align: center;
}

.stat-value {
  font-size: 2rem;
  font-weight: bold;
  color: #81c784;
}

.stat-label {
  font-size: 0.9rem;
  color: rgba(255, 255, 255, 0.7);
  margin-top: 0.5rem;
}

.match-history h3 {
  color: #fff;
  margin-bottom: 1rem;
}

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

.match-history-table th,
.match-history-table td {
  padding: 0.75rem 1rem;
  text-align: left;
  color: #fff;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.match-history-table th {
  color: #4fc3f7;
  font-weight: 600;
  text-transform: uppercase;
  font-size: 0.8rem;
}

.match-win {
  color: #81c784;
}
.match-loss {
  color: #e57373;
}

.back-link {
  display: inline-block;
  color: #4fc3f7;
  text-decoration: none;
  margin-bottom: 1rem;
  transition: color 0.2s;
}

.back-link:hover {
  color: #81c784;
}

.player-rank {
  font-size: 1.2rem;
  color: #ffd700;
  font-weight: 600;
  margin-top: 0.5rem;
}

.player-profile h3 {
  color: #fff;
  margin: 2rem 0 1rem;
  font-size: 1.3rem;
}

.player-profile h3:first-of-type {
  margin-top: 0;
}

/* Avatar Performance Section */
.avatar-section {
  margin: 2rem 0;
}

.avatar-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 1rem;
}

.avatar-card {
  background: rgba(0, 0, 0, 0.3);
  border-radius: 12px;
  padding: 1rem;
  text-align: center;
  border: 1px solid rgba(255, 255, 255, 0.1);
  transition: transform 0.2s, border-color 0.2s;
}

.avatar-card:hover {
  transform: translateY(-3px);
  border-color: rgba(79, 195, 247, 0.5);
}

.avatar-name {
  font-size: 0.95rem;
  font-weight: 600;
  color: #fff;
  margin-bottom: 0.5rem;
}

.avatar-record {
  font-size: 1.1rem;
  margin-bottom: 0.25rem;
}

.avatar-winrate {
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.6);
}

/* Replay link */
.replay-link {
  color: #4fc3f7;
  text-decoration: none;
  transition: color 0.2s;
}

.replay-link:hover {
  color: #81c784;
  text-decoration: underline;
}

/* Avatar Stats Page */
.avatar-stats-section {
  margin: 2rem 0;
}

.avatar-stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 1.5rem;
}

.avatar-stats-card {
  background: rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(10px);
  border-radius: 16px;
  padding: 1.5rem;
  text-align: center;
  border: 1px solid rgba(255, 255, 255, 0.1);
  transition: transform 0.2s, border-color 0.2s;
  position: relative;
}

.avatar-stats-card:hover {
  transform: translateY(-5px);
  border-color: rgba(79, 195, 247, 0.5);
}

.avatar-stats-rank {
  position: absolute;
  top: 0.75rem;
  left: 0.75rem;
  font-size: 0.8rem;
  color: rgba(255, 255, 255, 0.5);
  font-weight: 600;
}

.avatar-stats-name {
  font-size: 1.2rem;
  font-weight: 700;
  color: #fff;
  margin-bottom: 0.75rem;
  margin-top: 0.5rem;
}

.avatar-stats-winrate {
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
}

.avatar-stats-winrate.rate-high {
  color: #81c784;
}

.avatar-stats-winrate.rate-neutral {
  color: #ffd54f;
}

.avatar-stats-winrate.rate-low {
  color: #e57373;
}

.avatar-stats-record {
  font-size: 1.1rem;
  margin-bottom: 0.25rem;
}

.avatar-stats-total {
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.5);
}

.no-data {
  color: rgba(255, 255, 255, 0.6);
  text-align: center;
  padding: 3rem;
  font-size: 1.1rem;
}

/* Footer */
footer {
  text-align: center;
  padding: 2rem;
  color: rgba(255, 255, 255, 0.6);
  margin-top: auto;
}

/* Responsive */
@media (max-width: 768px) {
  .hero h1 {
    font-size: 2rem;
  }

  .nav-container {
    flex-direction: column;
    gap: 1rem;
  }

  .nav-links {
    gap: 1rem;
  }
}
