/* ─── Vanilla Tiers Website Styles ─── */

:root {
  --bg-primary: #0a0a0f;
  --bg-secondary: #12121a;
  --bg-card: #1a1a2e;
  --bg-card-hover: #22223a;
  --text-primary: #e8e8f0;
  --text-secondary: #9090a8;
  --text-muted: #606078;
  --accent: #7c3aed;
  --accent-light: #a78bfa;
  --accent-glow: rgba(124, 58, 237, 0.3);
  --success: #22c55e;
  --error: #ef4444;
  --warning: #f59e0b;
  --border: #2a2a3e;
  --border-light: #3a3a52;
  --gradient-1: linear-gradient(135deg, #7c3aed, #ec4899);
  --gradient-2: linear-gradient(135deg, #3b82f6, #8b5cf6);
  --shadow: 0 4px 24px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 8px 40px rgba(0, 0, 0, 0.6);
  --radius: 12px;
  --radius-sm: 8px;
}

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

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
}

a { color: var(--accent-light); text-decoration: none; }
a:hover { color: var(--accent); }

/* ─── Navbar ─── */
.navbar {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(10, 10, 15, 0.85);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
}

.nav-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.5rem;
  height: 64px;
  display: flex;
  align-items: center;
  gap: 2rem;
}

.logo {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--text-primary);
}

.logo-icon { font-size: 1.5rem; }

.nav-links {
  display: flex;
  gap: 0.25rem;
  flex: 1;
}

.nav-link {
  padding: 0.5rem 1rem;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-weight: 500;
  font-size: 0.9rem;
  transition: all 0.2s;
}

.nav-link:hover, .nav-link.active {
  color: var(--text-primary);
  background: var(--bg-card);
}

.nav-status {
  font-size: 0.75rem;
  color: var(--success);
  white-space: nowrap;
}

/* ─── Container ─── */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* ─── Sections ─── */
.section { display: none; padding: 2rem 0 4rem; }
.section.active { display: block; }

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
  gap: 1rem;
}

.section-header h2 {
  font-size: 1.5rem;
  font-weight: 700;
}

/* ─── Hero ─── */
.hero {
  text-align: center;
  padding: 5rem 1.5rem 3rem;
  max-width: 800px;
  margin: 0 auto;
}

.hero-title {
  font-size: 3.5rem;
  font-weight: 800;
  line-height: 1.1;
  margin-bottom: 1rem;
}

.gradient {
  background: var(--gradient-1);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-sub {
  font-size: 1.15rem;
  color: var(--text-secondary);
  margin-bottom: 2.5rem;
}

.hero-stats {
  display: flex;
  gap: 1.5rem;
  justify-content: center;
  margin-bottom: 2.5rem;
  flex-wrap: wrap;
}

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem 2rem;
  min-width: 150px;
  transition: transform 0.2s, border-color 0.2s;
}

.stat-card:hover {
  transform: translateY(-2px);
  border-color: var(--accent);
}

.stat-value {
  font-size: 2rem;
  font-weight: 800;
  background: var(--gradient-2);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.stat-label {
  font-size: 0.8rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-top: 0.25rem;
}

.hero-actions {
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
}

/* ─── Buttons ─── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  border: none;
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-primary {
  background: var(--accent);
  color: white;
}
.btn-primary:hover {
  background: #6d28d9;
  transform: translateY(-1px);
  box-shadow: 0 4px 16px var(--accent-glow);
}

.btn-secondary {
  background: var(--bg-card);
  color: var(--text-primary);
  border: 1px solid var(--border);
}
.btn-secondary:hover {
  background: var(--bg-card-hover);
  border-color: var(--accent);
}

.btn-sm { padding: 0.4rem 0.8rem; font-size: 0.8rem; }

/* ─── Search Box ─── */
.quick-search {
  max-width: 600px;
  margin: 3rem auto;
  text-align: center;
}

.quick-search h2 { margin-bottom: 1rem; font-size: 1.25rem; }

.search-box {
  display: flex;
  gap: 0.5rem;
}

.search-box.large {
  max-width: 700px;
  margin: 0 auto 2rem;
}

.search-box input {
  flex: 1;
  padding: 0.85rem 1.25rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-family: inherit;
  font-size: 1rem;
  outline: none;
  transition: border-color 0.2s;
}

.search-box input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

.search-box input::placeholder { color: var(--text-muted); }

/* ─── Leaderboard ─── */
.leaderboard-controls {
  display: flex;
  gap: 0.5rem;
}

.leaderboard-controls select {
  padding: 0.5rem 1rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-family: inherit;
  font-size: 0.85rem;
  cursor: pointer;
  outline: none;
}

.leaderboard-table {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.lb-row {
  display: grid;
  grid-template-columns: 60px 50px 1fr 100px 120px;
  align-items: center;
  padding: 0.85rem 1.25rem;
  border-bottom: 1px solid var(--border);
  transition: background 0.15s;
  cursor: pointer;
}

.lb-row:hover { background: var(--bg-card-hover); }

.lb-row.header {
  background: var(--bg-card);
  font-weight: 600;
  font-size: 0.8rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  cursor: default;
}

.lb-row.header:hover { background: var(--bg-card); }

.lb-rank {
  font-weight: 700;
  font-size: 0.95rem;
}

.lb-rank.top-1 { color: #ffd700; }
.lb-rank.top-2 { color: #c0c0c0; }
.lb-rank.top-3 { color: #cd7f32; }

.lb-medal { font-size: 1.1rem; }

.lb-name {
  font-weight: 600;
}

.lb-region {
  font-size: 0.8rem;
  padding: 0.2rem 0.6rem;
  background: var(--bg-card);
  border-radius: 100px;
  text-align: center;
  color: var(--text-secondary);
}

.lb-points {
  text-align: right;
  font-weight: 700;
  color: var(--accent-light);
}

/* ─── Search Results ─── */
.search-results {
  max-width: 700px;
  margin: 0 auto;
}

.player-card {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem 1.25rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 0.75rem;
  cursor: pointer;
  transition: all 0.2s;
}

.player-card:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.player-card-avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--gradient-1);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  font-weight: 800;
  color: white;
  flex-shrink: 0;
}

.player-card-info { flex: 1; }

.player-card-name {
  font-weight: 700;
  font-size: 1.05rem;
}

.player-card-meta {
  font-size: 0.8rem;
  color: var(--text-secondary);
}

.player-card-points {
  font-weight: 700;
  color: var(--accent-light);
  font-size: 1.1rem;
}

.muted {
  text-align: center;
  color: var(--text-muted);
  padding: 3rem 0;
}

.loading {
  text-align: center;
  color: var(--text-muted);
  padding: 3rem 0;
  animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 0.5; }
  50% { opacity: 1; }
}

/* ─── Modal ─── */
.modal {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(8px);
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
}

.modal.open { display: flex; }

.modal-content {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  max-width: 700px;
  width: 100%;
  max-height: 85vh;
  overflow-y: auto;
  padding: 2rem;
  position: relative;
  box-shadow: var(--shadow-lg);
}

.modal-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 50%;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.2s;
}

.modal-close:hover {
  background: var(--error);
  color: white;
  border-color: var(--error);
}

/* ─── Player Profile ─── */
.profile-header {
  display: flex;
  gap: 1.5rem;
  align-items: center;
  margin-bottom: 2rem;
  flex-wrap: wrap;
}

.profile-avatar {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: var(--gradient-1);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  font-weight: 800;
  color: white;
  flex-shrink: 0;
}

.profile-name {
  font-size: 1.75rem;
  font-weight: 800;
}

.profile-meta {
  color: var(--text-secondary);
  font-size: 0.9rem;
}

.profile-points {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--accent-light);
}

.profile-best {
  margin-top: 0.5rem;
  padding: 0.4rem 1rem;
  background: var(--gradient-1);
  border-radius: 100px;
  font-weight: 700;
  font-size: 0.9rem;
  display: inline-block;
}

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

.tier-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 1rem;
  transition: border-color 0.2s;
}

.tier-card:hover { border-color: var(--accent); }

.tier-gamemode {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.35rem;
}

.tier-value {
  font-size: 1.25rem;
  font-weight: 800;
}

.tier-value.ht1 { color: #ff4444; }
.tier-value.lt1 { color: #ff8844; }
.tier-value.ht2 { color: #ffaa44; }
.tier-value.lt2 { color: #ffcc44; }
.tier-value.ht3 { color: #aaff44; }
.tier-value.lt3 { color: #44ff88; }
.tier-value.ht4 { color: #44aaff; }
.tier-value.lt4 { color: #4488ff; }
.tier-value.ht5 { color: #8844ff; }
.tier-value.lt5 { color: #aa44ff; }

.tier-date {
  font-size: 0.7rem;
  color: var(--text-muted);
  margin-top: 0.35rem;
}

/* ─── Footer ─── */
.footer {
  text-align: center;
  padding: 2rem;
  color: var(--text-muted);
  font-size: 0.8rem;
  border-top: 1px solid var(--border);
  margin-top: 2rem;
}

/* ─── Responsive ─── */
@media (max-width: 768px) {
  .hero-title { font-size: 2.25rem; }
  .hero-stats { gap: 0.75rem; }
  .stat-card { min-width: 120px; padding: 1rem 1.25rem; }
  .stat-value { font-size: 1.5rem; }
  .lb-row { grid-template-columns: 45px 40px 1fr 60px; }
  .lb-region { display: none; }
  .search-box { flex-direction: column; }
  .leaderboard-controls { flex-direction: column; gap: 0.5rem; }
  .nav-status { display: none; }
}
