/* ===== GOAT Hall of Fame ===== */

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

:root {
  --bg: #0f0f14;
  --surface: #1a1a24;
  --surface2: #22222e;
  --border: #2a2a3a;
  --text: #e0e0e0;
  --text-dim: #888;
  --accent: #a78bfa;
  --accent-hover: #7c3aed;
  --gold: #ffd700;
  --silver: #c0c0c0;
  --bronze: #cd7f32;
  --success: #4fc34f;
  --warning: #ffab00;
  --danger: #f87171;
  --radius: 10px;
  --radius-lg: 16px;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
}

/* ─── Header ─── */

.goat-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 20px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
}

.back-link {
  font-size: 24px;
  text-decoration: none;
  opacity: 0.7;
  transition: opacity 0.2s;
}
.back-link:hover { opacity: 1; }

.header-title h1 {
  font-size: 24px;
  font-weight: 800;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 8px;
}
.header-title .trophy { font-size: 28px; }
.header-title .subtitle {
  font-weight: 500;
  font-size: 16px;
  color: var(--text-dim);
}
.tagline {
  font-size: 12px;
  color: var(--accent);
  font-weight: 600;
  letter-spacing: 2px;
  text-transform: uppercase;
  margin-top: 2px;
}

.header-stats { margin-left: auto; }

.total-badge {
  background: var(--surface2);
  border: 1px solid var(--border);
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-dim);
}

/* ─── Sort Bar ─── */

.sort-bar {
  max-width: 900px;
  margin: 0 auto;
  padding: 10px 12px 0;
  display: flex;
  align-items: center;
  gap: 8px;
}

.sort-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 1px;
  flex-shrink: 0;
}

.sort-select {
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 6px 12px;
  font-size: 13px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  outline: none;
  transition: border-color 0.2s;
}
.sort-select:hover,
.sort-select:focus {
  border-color: var(--accent);
}
.sort-select option,
.sort-select optgroup {
  background: var(--surface);
  color: var(--text);
}

/* ─── Player List ─── */

.player-list {
  max-width: 900px;
  margin: 0 auto;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

/* ─── Loading ─── */

.loading-state {
  text-align: center;
  padding: 80px 20px;
  color: var(--text-dim);
}
.spinner {
  width: 32px;
  height: 32px;
  border: 3px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin: 0 auto 12px;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ─── Player Card ─── */

.player-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 10px 14px;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.player-card:hover {
  border-color: #3a3a4a;
}

/* Top row: rank + avatar + name + coins */
.card-top {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}

.rank {
  font-size: 15px;
  font-weight: 800;
  min-width: 36px;
  text-align: center;
  color: var(--text-dim);
  flex-shrink: 0;
}
.rank.gold { color: var(--gold); }
.rank.silver { color: var(--silver); }
.rank.bronze { color: var(--bronze); }

.avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--surface2);
  border: 2px solid var(--border);
  flex-shrink: 0;
  object-fit: cover;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  overflow: hidden;
}
.avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.player-identity {
  flex: 1;
  min-width: 0;
}
.player-name {
  font-size: 14px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.player-title {
  font-size: 11px;
  font-weight: 600;
  margin-top: 1px;
}

.sort-badge {
  font-size: 12px;
  font-weight: 700;
  color: var(--accent);
  white-space: nowrap;
  flex-shrink: 0;
  background: rgba(167, 139, 250, 0.12);
  padding: 2px 8px;
  border-radius: 10px;
}
.sort-badge-label {
  font-size: 10px;
  font-weight: 600;
  opacity: 0.7;
  margin-right: 2px;
}

.coin-badge {
  font-size: 13px;
  font-weight: 700;
  color: var(--warning);
  white-space: nowrap;
  flex-shrink: 0;
}
.coin-badge .coin-icon { margin-right: 3px; }

/* Stats row */
.card-stats {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 8px;
}

.stat-group {
  display: flex;
  flex-direction: column;
  gap: 1px;
}
.stat-group-label {
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--accent);
  margin-bottom: 1px;
}

.stat-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 11px;
  line-height: 1.4;
}
.stat-row .stat-name {
  color: var(--text-dim);
}
.stat-row .stat-val {
  font-weight: 600;
  color: var(--text);
}
.stat-row .stat-val.income-val {
  color: #f59e0b;
}

/* Cosmetic pills - compact inline flow */
.cosmetics-wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 3px;
}
.cosmetic-pill {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 10px;
  padding: 1px 6px;
  border-radius: 8px;
  background: rgba(255,255,255,0.04);
  white-space: nowrap;
}
.cosmetic-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  flex-shrink: 0;
}
.cosmetic-label {
  color: var(--text-dim);
  font-weight: 500;
}

/* Empty state for stat groups */
.stat-empty {
  font-size: 10px;
  color: #555;
  font-style: italic;
}

/* ─── Member Since ─── */
.member-since {
  font-size: 10px;
  color: #555;
  margin-top: 2px;
}

/* ─── Pagination ─── */

.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 6px;
  padding: 24px 16px 40px;
}
.pagination.hidden { display: none; }

.page-btn {
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text-dim);
  padding: 8px 14px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
  font-family: inherit;
}
.page-btn:hover {
  background: var(--surface2);
  border-color: #3a3a4a;
  color: var(--text);
}
.page-btn.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}
.page-btn:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}
.page-ellipsis {
  color: var(--text-dim);
  padding: 0 4px;
  font-size: 13px;
}

/* ─── Error State ─── */

.error-state {
  text-align: center;
  padding: 80px 20px;
  color: var(--danger);
}
.error-state p { margin-top: 8px; color: var(--text-dim); font-size: 14px; }

/* ─── Responsive ─── */

@media (max-width: 640px) {
  .goat-header {
    padding: 10px 12px;
    gap: 8px;
  }
  .header-title h1 { font-size: 16px; }
  .header-title .subtitle { font-size: 12px; }
  .header-title .trophy { font-size: 20px; }
  .tagline { font-size: 9px; }

  .player-list { padding: 8px; gap: 4px; }

  .player-card { padding: 8px 10px; }

  .card-top { gap: 6px; }
  .rank { font-size: 13px; min-width: 28px; }
  .avatar { width: 30px; height: 30px; font-size: 14px; }
  .player-name { font-size: 13px; }
  .coin-badge { font-size: 12px; }

  .card-stats {
    grid-template-columns: 1fr;
    gap: 6px;
  }
  .stat-group {
    background: var(--surface2);
    padding: 6px 8px;
    border-radius: 6px;
  }
}
