/* ===== Reset & Base ===== */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  height: 100%;
}

body {
  font-family: 'Nunito', sans-serif;
  background: linear-gradient(135deg, #1a0a2e 0%, #16213e 40%, #0f3460 100%);
  color: #f0e6ff;
  display: flex;
  flex-direction: column;
  align-items: center;
  min-height: 100vh;
}

/* ===== Container ===== */
.leaderboard-container {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.5rem;
  padding: 2rem 1rem 5rem;
  max-width: 900px;
  width: 100%;
}

/* ===== Hero ===== */
.hero {
  margin-bottom: 0.25rem;
}

.title {
  font-family: 'Fredoka One', cursive;
  font-size: 2.5rem;
  background: linear-gradient(90deg, #ff6ec7, #ffde59, #00e5ff);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  letter-spacing: 2px;
  filter: drop-shadow(0 0 10px rgba(255, 110, 199, 0.4));
}

/* ===== Search Bar ===== */
.search-bar {
  width: 100%;
}

.search-input {
  width: 100%;
  font-family: 'Nunito', sans-serif;
  font-size: 1rem;
  padding: 0.75rem 1rem;
  border: 2px solid rgba(255, 110, 199, 0.3);
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.search-input:focus {
  border-color: #00e5ff;
  box-shadow: 0 0 0 3px rgba(0, 229, 255, 0.2), 0 0 12px rgba(0, 229, 255, 0.1);
}

.search-input::placeholder {
  color: #a78bcc;
}

/* ===== Table Wrapper ===== */
.table-wrapper {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  background: rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 110, 199, 0.25);
  border-radius: 4px;
  padding: 0.25rem;
}

.leaderboard-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
}

.leaderboard-table thead th {
  font-family: 'Fredoka One', cursive;
  font-weight: 400;
  font-size: 0.9rem;
  color: #ffde59;
  background: rgba(255, 110, 199, 0.15);
  padding: 0.75rem 0.75rem;
  text-align: left;
  white-space: nowrap;
  border-bottom: 2px solid rgba(255, 110, 199, 0.3);
  user-select: none;
}

.leaderboard-table thead th:first-child {
  border-radius: 4px 0 0 0;
}

.leaderboard-table thead th:last-child {
  border-radius: 0 4px 0 0;
}

/* Sortable columns */
.leaderboard-table thead th.sortable {
  cursor: pointer;
  transition: background-color 0.2s, color 0.2s;
}

.leaderboard-table thead th.sortable:hover {
  background: rgba(255, 110, 199, 0.25);
  color: #fff;
}

.leaderboard-table thead th.sortable.active {
  background: #ff6ec7;
  color: #fff;
}

.sort-arrow {
  font-size: 0.75rem;
  margin-left: 0.25rem;
}

/* Body rows */
.leaderboard-table tbody td {
  padding: 0.65rem 0.75rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  white-space: nowrap;
  color: #e0c3fc;
}

.leaderboard-table tbody tr:nth-child(even) {
  background: rgba(255, 110, 199, 0.04);
}

.leaderboard-table tbody tr:hover {
  background: rgba(255, 110, 199, 0.1);
}

.leaderboard-table tbody tr:last-child td:first-child {
  border-radius: 0 0 0 4px;
}

.leaderboard-table tbody tr:last-child td:last-child {
  border-radius: 0 0 4px 0;
}

/* ===== Loading & Empty ===== */
.loading,
.empty-state {
  font-family: 'Fredoka One', cursive;
  font-size: 1.15rem;
  color: #ff6ec7;
  padding: 2rem;
  text-align: center;
}

/* ===== Pagination ===== */
.pagination {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.page-indicator {
  font-weight: 700;
  font-size: 0.95rem;
  color: #e0c3fc;
  min-width: 100px;
  text-align: center;
}

.btn-secondary,
.btn-page {
  font-family: 'Fredoka One', cursive;
  font-size: 0.95rem;
  border: 2px solid #00e5ff;
  border-radius: 4px;
  padding: 0.6rem 1.25rem;
  cursor: pointer;
  color: #00e5ff;
  box-shadow: 0 0 8px rgba(0, 229, 255, 0.1);
  transition: transform 0.15s, box-shadow 0.2s, background-color 0.2s;
}

.btn-secondary:hover:not(:disabled),
.btn-page:hover:not(:disabled) {
  background: rgba(0, 229, 255, 0.15);
  border-color: #40efff;
  transform: translateY(-2px);
  box-shadow: 0 4px 16px rgba(0, 229, 255, 0.25);
}

.btn-secondary:active:not(:disabled),
.btn-page:active:not(:disabled) {
  transform: translateY(0);
}

.btn-secondary:disabled,
.btn-page:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

/* ===== Nav Links ===== */
.nav-links a {
  font-weight: 700;
  color: #ffde59;
  text-decoration: none;
  font-size: 1.05rem;
  transition: color 0.2s, text-shadow 0.2s;
}

.nav-links a:hover {
  color: #fff;
  text-shadow: 0 0 10px rgba(255, 222, 89, 0.6);
  text-decoration: underline;
}

/* ===== Footer ===== */
.footer {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  text-align: center;
  padding: 0.75rem;
  font-size: 0.85rem;
  color: #a78bcc;
  background: rgba(26, 10, 46, 0.9);
  backdrop-filter: blur(4px);
  border-top: 1px solid rgba(255, 110, 199, 0.2);
}

/* ===== Responsive ===== */
@media (max-width: 600px) {
  .title {
    font-size: 1.8rem;
  }

  .leaderboard-container {
    padding: 1.25rem 0.5rem 5rem;
  }

  .table-wrapper {
    border-radius: 4px;
  }

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

  .leaderboard-table thead th,
  .leaderboard-table tbody td {
    padding: 0.5rem 0.5rem;
  }

  .pagination {
    gap: 0.5rem;
  }

  .btn-page {
    font-size: 0.85rem;
    padding: 0.5rem 0.85rem;
  }

  .page-indicator {
    font-size: 0.85rem;
    min-width: auto;
  }

  .nav-links a {
    font-size: 1rem;
    min-height: 44px;
    display: inline-flex;
    align-items: center;
  }
}
