.leaderboard-page {
  


  max-width: 1100px;
  margin: 0 auto;
  padding: 32px 24px 64px;
}

.leaderboard-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
  gap: 16px;
}

.leaderboard-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.leaderboard-search {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  padding: 12px 14px;
  color: #fff;
  min-width: 260px;
  font-size: 16px; 
  font-weight: 600;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.leaderboard-search::placeholder {
  color: var(--text-subtle);
}

.leaderboard-search:focus {
  outline: none;
  border-color: var(--accent-glow-strong);
  box-shadow: 0 0 0 4px rgba(139, 92, 246, 0.15);
}

.leaderboard-title {
  font-size: 32px;
  font-weight: 800;
}

.leaderboard-subtitle {
  color: var(--text);
  margin-top: 8px;
}

.leaderboard-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 12px 0;
  overflow: hidden;
}

.leaderboard-row {
  display: grid;
  grid-template-columns: 80px 1fr repeat(3, 150px);
  align-items: center;
  padding: 14px 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  transition: background 0.2s ease, transform 0.2s ease;
}

.leaderboard-row:last-child {
  border-bottom: none;
}

.leaderboard-row:hover {
  background: rgba(139, 92, 246, 0.08);
  transform: translateY(-2px);
}

.rank-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  font-weight: 800;
  background: rgba(59, 130, 246, 0.15);
  color: #3b82f6;
}

.rank-1 {
  background: linear-gradient(135deg, var(--warning), #f59e0b);
  color: #0b1020;
}

.rank-2 {
  background: linear-gradient(135deg, #e5e7eb, var(--text-muted));
  color: #0b1020;
}

.rank-3 {
  background: linear-gradient(135deg, #f97316, #ea580c);
  color: #0b1020;
}

.player-name {
  color: #fff;
  font-weight: 700;
  text-decoration: none;
}

.player-identity {
  display: flex;
  align-items: center;
  gap: 12px;
}

.player-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 2px solid var(--border-strong);
  object-fit: cover;
  background: rgba(255, 255, 255, 0.05);
}

.player-name:hover {
  color: var(--accent-light);
}




.rating-chip,
.stat-chip,
.winrate-chip {
  display: inline-flex;
  align-items: baseline;
  justify-content: center;
  gap: 6px;
  font-weight: 700;
  white-space: nowrap;
  min-width: 0;
}

.stat-cell-value {
  font-size: 17px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  color: #e2e8f0;
}

.rating-chip .stat-cell-value {
  color: var(--accent-soft);
}

.winrate-chip .stat-cell-value {
  color: #6ee7b7;
}

.stat-cell-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-subtle);
}

.empty-state {
  text-align: center;
  padding: 32px 0;
  color: var(--text);
}

.error-state {
  color: #fca5a5;
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid rgba(239, 68, 68, 0.3);
  padding: 16px;
  border-radius: 12px;
  margin-top: 16px;
}

.friends-empty-state {
  display: grid;
  justify-items: center;
  gap: 14px;
}

.friends-empty-state p {
  margin: 0;
}

.friends-discover-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 9px 15px;
  border: 1px solid rgba(167, 139, 250, 0.42);
  border-radius: 10px;
  background: rgba(109, 40, 217, 0.16);
  color: #ede9fe;
  font-size: 13px;
  font-weight: 800;
  text-decoration: none;
  transition: background .2s ease, border-color .2s ease, transform .2s ease;
}

.friends-discover-btn:hover {
  border-color: rgba(196, 181, 253, 0.72);
  background: rgba(109, 40, 217, 0.3);
  transform: translateY(-1px);
}

.friends-discover-btn:focus-visible {
  outline: 3px solid rgba(196, 181, 253, 0.9);
  outline-offset: 3px;
}

.friend-requests-section {
  margin-bottom: 24px;
}

.friend-requests-heading {
  font-size: 20px;
  font-weight: 800;
  margin-bottom: 12px;
}

.friend-request-row {
  grid-template-columns: 1fr 150px auto;
  gap: 12px;
}

.friend-request-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}

.friend-request-btn {
  min-height: 38px;
  padding: 8px 16px;
  border-radius: 10px;
  font-weight: 700;
  font-size: 13px;
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease;
}

.friend-request-btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.friend-request-btn:focus-visible {
  outline: 3px solid rgba(196, 181, 253, 0.9);
  outline-offset: 2px;
}

.friend-request-btn.accept {
  background: var(--accent);
  border: 1px solid var(--accent);
  color: #fff;
}

.friend-request-btn.accept:hover:not(:disabled) {
  background: var(--accent-light);
  border-color: var(--accent-light);
}

.friend-request-btn.decline {
  background: rgba(239, 68, 68, 0.12);
  border: 1px solid rgba(239, 68, 68, 0.35);
  color: #fca5a5;
}

.friend-request-btn.decline:hover:not(:disabled) {
  background: rgba(239, 68, 68, 0.22);
  border-color: var(--danger);
}

@media (max-width: 900px) {
  .leaderboard-page {
    padding: 24px 16px 48px;
  }

  

  .leaderboard-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px 12px;
    padding: 14px 16px;
  }

  .leaderboard-row:hover {
    transform: none;
  }

  .rank-badge {
    width: 40px;
    height: 40px;
  }

  .player-identity {
    
    flex: 1;
    min-width: min(220px, 62vw);
  }

  .player-name {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .player-avatar {
    width: 32px;
    height: 32px;
  }

  .leaderboard-row .stat-cell-value {
    font-size: 15px;
  }

  .leaderboard-row .stat-cell-label {
    font-size: 10px;
  }

  .leaderboard-search {
    min-width: 0;
    width: 100%;
  }

  .leaderboard-actions {
    width: 100%;
    flex-wrap: wrap;
  }

  .leaderboard-title {
    font-size: 26px;
  }

  .friend-request-actions {
    margin-left: auto;
  }
}
