/* Esports Ranking Platform Styles */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

:root {
  --bg-primary: #0a0a0a;
  --bg-secondary: #1a1a1a;
  --bg-tertiary: #2a2a2a;
  --text-primary: #ffffff;
  --text-secondary: #cccccc;
  --accent-blue: #3b82f6;
  --accent-purple: #8b5cf6;
  --accent-hover: #60a5fa;
  --border-color: #333333;
  --rank-gold: #ffd700;
  --rank-silver: #c0c0c0;
  --rank-bronze: #cd7f32;
  --glow-blue: rgba(59, 130, 246, 0.5);
  --glow-purple: rgba(139, 92, 246, 0.5);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Inter', sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

header {
  background-color: var(--bg-secondary);
  padding: 1rem 0;
  border-bottom: 1px solid var(--border-color);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--accent-blue);
  transition: color 0.2s;
}

.logo:hover {
  color: var(--accent-hover);
}

nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
}

.nav-left {
  display: flex;
  align-items: center;
  gap: 2rem;
  flex-wrap: wrap;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  flex-wrap: wrap;
}

.nav-links a {
  color: var(--text-secondary);
  text-decoration: none;
  transition: all 0.3s;
  position: relative;
  font-weight: 500;
}

.nav-links a:hover {
  color: var(--accent-blue);
}

.nav-user {
  color: var(--text-secondary);
  font-weight: 600;
  margin-right: 1rem;
}

.nav-right {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.logout-btn {
  display: flex;
  align-items: center;
  justify-content: center;

  background: #dc2626;
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.08);

  padding: 0.75rem 1.5rem;
  border-radius: 10px;
  cursor: pointer;

  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;

  transition: all 0.25s ease;
  box-shadow: 0 6px 18px rgba(239, 68, 68, 0.25);
}

.logout-btn:hover {
  background: #b91c1c;
}

.logout-btn:active {
  transform: translateY(0px);
  box-shadow: 0 4px 12px rgba(126, 24, 221, 0.2);
}
.nav-links a::after {
  content: '';
  position: absolute;
  width: 0;
  height: 2px;
  bottom: -5px;
  left: 0;
  background: var(--accent-blue);
  transition: width 0.3s;
}

.nav-links a:hover::after {
  width: 100%;
}

.nav-right {
  display: flex;
  align-items: center;
}

.cta-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--accent-purple), var(--accent-blue));
  color: var(--text-primary);
  padding: 0.8rem 1.4rem;
  border-radius: 999px;
  text-transform: uppercase;
  font-weight: 700;
  letter-spacing: 0.06em;
  transition: transform 0.3s, box-shadow 0.3s;
  white-space: nowrap;
}

.cta-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 24px rgba(59, 130, 246, 0.25);
}

main {
  padding: 2rem 0;
}

.messages-stack {
  display: grid;
  gap: 0.75rem;
  margin-bottom: 1.25rem;
}

.site-message {
  padding: 0.9rem 1rem;
  border-radius: 8px;
  border: 1px solid rgba(96, 165, 250, 0.28);
  background: rgba(59, 130, 246, 0.12);
  color: #dbeafe;
  font-weight: 650;
}

.site-message.success {
  border-color: rgba(34, 197, 94, 0.36);
  background: rgba(34, 197, 94, 0.14);
  color: #bbf7d0;
}

.site-message.error {
  border-color: rgba(239, 68, 68, 0.42);
  background: rgba(239, 68, 68, 0.14);
  color: #fecaca;
}

.site-message.warning {
  border-color: rgba(245, 158, 11, 0.42);
  background: rgba(245, 158, 11, 0.14);
  color: #fde68a;
}

.hero-card {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1.5rem;
  background: rgba(18, 24, 38, 0.95);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 20px;
  padding: 2rem;
  margin-bottom: 1.5rem;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
}

.hero-card.small {
  padding: 1.5rem 1.75rem;
}

.eyebrow {
  color: var(--accent-purple);
  text-transform: uppercase;
  letter-spacing: 0.3em;
  font-size: 0.75rem;
  margin-bottom: 0.75rem;
}

.hero-card h1 {
  font-size: clamp(2rem, 3vw, 3rem);
  margin-bottom: 0.75rem;
}

.hero-copy {
  max-width: 640px;
  color: var(--text-secondary);
}

.hero-btn {
  min-width: 190px;
}

.mode-tabs {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-bottom: 1.5rem;
}

.mode-pill {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--text-primary);
  padding: 0.85rem 1.2rem;
  border-radius: 999px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s;
}

.mode-pill.active,
.mode-pill:hover {
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.18), rgba(139, 92, 246, 0.18));
  border-color: rgba(59, 130, 246, 0.4);
  color: var(--text-primary);
}

.search-row {
  margin-bottom: 1.5rem;
}

.search-wrapper {
  display: flex;
  max-width: 560px;
  width: 100%;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.03);
  overflow: hidden;
}

.home-panels {
  display: grid;
  grid-template-columns: 1.5fr 1fr;
  gap: 1.5rem;
  margin-bottom: 1.5rem;
}

.section-card {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 22px;
  padding: 1.5rem;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.25);
}

.section-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
}

.section-header h2 {
  margin: 0 0 0.5rem;
}

.section-header p {
  color: var(--text-secondary);
  margin-bottom: 1.25rem;
}

.section-link {
  color: var(--accent-blue);
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
}

.section-link:hover {
  color: var(--accent-hover);
}

.section-list,
.server-list {
  display: grid;
  gap: 0.9rem;
}

.tier-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 0.9rem;
}

.tier-link-card {
  display: block;
}

.tier-card {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  min-height: 86px;
  padding: 1rem;
  position: relative;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px;
  color: inherit;
  text-decoration: none;
  transition: transform 0.25s, border-color 0.25s, background 0.25s;
}

.tier-card:hover {
  transform: translateY(-2px);
  border-color: rgba(59, 130, 246, 0.35);
  background: rgba(59, 130, 246, 0.08);
}

.tier-color-bar {
  width: 5px;
  align-self: stretch;
  border-radius: 999px;
  background: var(--tier-color);
  box-shadow: 0 0 14px var(--tier-color);
}

.tier-icon-wrap {
  width: 52px;
  height: 52px;
  flex: 0 0 52px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  background: rgba(0, 0, 0, 0.22);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.tier-icon {
  width: 38px;
  height: 38px;
  object-fit: contain;
}

.tier-swatch {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--tier-color);
  box-shadow: 0 0 16px rgba(255, 255, 255, 0.14);
}

.tier-name {
  font-weight: 800;
  margin-bottom: 0.2rem;
}

.tier-range {
  color: var(--text-secondary);
  font-size: 0.95rem;
}

.tiers-browser {
  padding: 0;
  overflow: hidden;
}

.tier-table-header {
  display: grid;
  grid-template-columns: minmax(240px, 1fr) 180px 140px;
  gap: 1rem;
  padding: 1rem 1.25rem;
  background: rgba(29, 38, 56, 0.95);
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.15em;
  font-size: 1rem;
  font-weight: 900;
  justify-items: center;
  text-align: center;
}

.tier-table-header span:first-child {
  justify-self: start;
  text-align: left;
}

.tier-table-header span:last-child {
  justify-self: end;
  text-align: right;
}

.tier-detail-card {
  display: grid;
  grid-template-columns: minmax(240px, 1fr) 180px 140px;
  align-items: center;
  gap: 1rem;
  padding: 1.25rem;
  background: rgba(255, 255, 255, 0.02);
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.tier-detail-main {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.tier-detail-icon {
  width: 64px;
  height: 64px;
  flex-basis: 64px;
}

.tier-detail-card h2 {
  margin: 0 0 0.25rem;
  font-size: 1rem;
}

.tier-page-badge {
  font-size: 0.95rem;
}

.tier-detail-card p {
  color: var(--text-secondary);
  margin: 0;
}

.tier-color-value {
  color: var(--text-primary);
  font-weight: 700;
}

.tier-detail-range {
  color: var(--accent-blue);
  font-weight: 800;
}

.tier-player-count {
  text-align: right;
}

.tier-player-count a {
  display: inline-block;
  color: inherit;
  text-decoration: none;
  padding: 0.35rem 0.55rem;
  border-radius: 8px;
  transition: background 0.25s, transform 0.25s;
}

.tier-player-count a:hover {
  background: rgba(59, 130, 246, 0.12);
  transform: translateY(-1px);
}

.tier-player-count span {
  display: block;
  color: var(--accent-purple);
  font-size: 2rem;
  font-weight: 800;
  line-height: 1;
}

.tier-player-count small {
  color: var(--text-secondary);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

@media (max-width: 720px) {
  .section-header,
  .tier-detail-card,
  .tier-table-header {
    grid-template-columns: 1fr;
  }

  .section-header,
  .tier-detail-card {
    align-items: stretch;
  }

  .tier-table-header {
    display: none;
  }

  .tier-detail-range,
  .tier-player-count {
    text-align: left;
  }
}

.section-item {
  display: grid;
  grid-template-columns: 48px 1fr 96px;
  align-items: center;
  gap: 1rem;
  padding: 1rem 1rem;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 16px;
}

.section-rank {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: rgba(59, 130, 246, 0.18);
  color: var(--text-primary);
  font-weight: 700;
}

.section-player {
  font-weight: 700;
}

.section-meta {
  color: var(--text-secondary);
  font-size: 0.95rem;
}

.section-value {
  font-weight: 700;
  color: var(--accent-purple);
  text-align: right;
}

.server-card {
  display: block;
  padding: 1rem 1.1rem;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  text-decoration: none;
  color: inherit;
  transition: transform 0.3s, border-color 0.3s;
}

.server-card:hover {
  transform: translateY(-2px);
  border-color: rgba(59, 130, 246, 0.35);
}

.server-name {
  font-weight: 700;
  margin-bottom: 0.35rem;
}

.server-desc {
  color: var(--text-secondary);
  font-size: 0.96rem;
}

.empty-state {
  color: var(--text-secondary);
  padding: 0.75rem 0;
}

.admin-note {
  margin-top: 1rem;
  color: var(--text-secondary);
  font-size: 0.95rem;
}

.search-wrapper input {
  flex: 1;
  border: none;
  background: transparent;
  color: var(--text-primary);
  padding: 0.9rem 1.2rem;
  font-size: 1rem;
}

.search-wrapper input::placeholder {
  color: var(--text-secondary);
}

.search-wrapper input:focus {
  outline: none;
}

.search-btn {
  border: none;
  background: linear-gradient(135deg, var(--accent-blue), var(--accent-purple));
  color: var(--text-primary);
  padding: 0 1.4rem;
  cursor: pointer;
  font-weight: 700;
}

.leaderboard-table {
  background: linear-gradient(145deg, rgba(15, 23, 42, 0.96), rgba(17, 24, 39, 0.98));
  border-radius: 18px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.35);
}

.table-header,
.table-row {
  display: grid;
  grid-template-columns: 80px minmax(240px, 1fr) 140px;
  align-items: center;
  gap: 1rem;
  padding: 1rem 1.5rem;
}

.table-header {
  background: rgba(29, 38, 56, 0.95);
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--text-secondary);
  font-size: 0.82rem;
}

.table-row {
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  transition: background 0.3s, transform 0.3s;
}

.table-row:hover {
  background: rgba(59, 130, 246, 0.08);
  transform: translateY(-1px);
}

.table-cell a {
  color: inherit;
  text-decoration: none;
}

.rank-cell {
  display: flex;
  align-items: center;
}

.player-cell {
  font-weight: 600;
}

.score-cell {
  font-weight: 700;
  color: var(--accent-blue);
  text-align: right;
}

.score-head {
  text-align: right;
}

.rank-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  text-align: center;
  line-height: 1;
  font-weight: 700;
  margin-right: 0.75rem;
  transition: transform 0.3s, box-shadow 0.3s;
}

@media (max-width: 940px) {
  .table-header,
  .table-row {
    grid-template-columns: 60px 1fr 120px;
  }
}

@media (max-width: 720px) {
  .hero-card,
  .hero-card.small {
    flex-direction: column;
    text-align: left;
  }

  .mode-tabs {
    justify-content: center;
  }

  .table-header,
  .table-row {
    grid-template-columns: 1fr;
    padding: 0.95rem 1.2rem;
  }

  .table-row {
    gap: 0.8rem;
  }

  .score-cell {
    text-align: left;
  }

  .score-head {
    text-align: left;
  }

}

.rank-badge {
  display: inline-block;
  width: 35px;
  height: 35px;
  border-radius: 50%;
  text-align: center;
  line-height: 35px;
  font-weight: 700;
  margin-right: 10px;
  transition: all 0.3s;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.rank-1 { 
  background: linear-gradient(45deg, var(--rank-gold), #ffed4e);
  color: #000; 
  animation: pulse 2s infinite;
}

.rank-2 { 
  background: linear-gradient(45deg, var(--rank-silver), #e8e8e8);
  color: #000; 
}

.rank-3 { 
  background: linear-gradient(45deg, var(--rank-bronze), #daa520);
  color: #000; 
}

.rank-other { 
  background: linear-gradient(45deg, var(--accent-blue), var(--accent-purple));
}

.rank-badge:hover {
  transform: scale(1.1);
  box-shadow: 0 4px 15px rgba(59, 130, 246, 0.4);
}

@keyframes pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.05); }
}

.username {
  flex: 1;
  font-weight: 500;
  transition: color 0.3s;
}

.username a {
  color: inherit;
  text-decoration: none;
}

.username a:hover {
  color: var(--accent-blue);
  text-shadow: 0 0 8px var(--glow-blue);
}

.score {
  font-weight: 600;
  color: var(--accent-blue);
  font-size: 1.1em;
}

.btn {
  background: linear-gradient(45deg, var(--accent-purple), var(--accent-blue));
  color: var(--text-primary);
  border: none;
  padding: 0.75rem 1.5rem;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.3s;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  box-shadow: 0 4px 15px rgba(139, 92, 246, 0.3);
}

.btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(139, 92, 246, 0.4);
  background: linear-gradient(45deg, var(--accent-blue), var(--accent-purple));
}

.form-group {
  margin-bottom: 1.5rem;
}

label {
  display: block;
  margin-bottom: 0.5rem;
  color: var(--text-secondary);
  font-weight: 500;
}

input[type="text"],
input[type="password"],
input[type="email"] {
  width: 100%;
  padding: 0.875rem;
  background-color: var(--bg-tertiary);
  border: 2px solid var(--border-color);
  border-radius: 8px;
  color: var(--text-primary);
  font-size: 1rem;
  transition: all 0.3s;
}

input[type="text"]:focus,
input[type="password"]:focus,
input[type="email"]:focus {
  outline: none;
  border-color: var(--accent-blue);
  box-shadow: 0 0 0 3px var(--glow-blue);
  background-color: var(--bg-secondary);
}

.profile {
  text-align: center;
  background: linear-gradient(145deg, var(--bg-secondary), var(--bg-tertiary));
  padding: 2rem;
  border-radius: 12px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
  border: 1px solid var(--border-color);
}

.profile-avatar {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  background: linear-gradient(45deg, var(--accent-purple), var(--accent-blue));
  margin: 0 auto 1.5rem;
  box-shadow: 0 4px 20px rgba(139, 92, 246, 0.4);
  position: relative;
}

.profile-avatar::before {
  content: '';
  position: absolute;
  top: -2px;
  left: -2px;
  right: -2px;
  bottom: -2px;
  border-radius: 50%;
  background: linear-gradient(45deg, var(--accent-blue), var(--accent-purple));
  z-index: -1;
  animation: rotate 3s linear infinite;
}

.profile-panel {
  display: grid;
  grid-template-columns: 1fr 360px;
  gap: 2rem;
  align-items: start;
  margin-top: 1.5rem;
}

.profile-card {
  background: linear-gradient(145deg, var(--bg-secondary), var(--bg-tertiary));
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 24px;
  padding: 2rem;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.35);
}

.profile-card h2 {
  margin-top: 1rem;
  margin-bottom: 1rem;
  color: var(--text-primary);
}

.profile-detail {
  color: var(--text-secondary);
  margin-bottom: 0.85rem;
  font-size: 1rem;
}

.profile-detail span {
  color: var(--text-primary);
  font-weight: 700;
}

.profile-actions {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.profile-actions .btn {
  width: 100%;
  text-align: center;
}

@keyframes rotate {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

.profile h1 {
  margin-bottom: 1rem;
  color: var(--accent-blue);
  text-shadow: 0 0 10px var(--glow-blue);
}

.profile p {
  margin-bottom: 0.5rem;
  font-size: 1.1rem;
}

footer {
  background-color: var(--bg-secondary);
  padding: 1rem 0;
  text-align: center;
  border-top: 1px solid var(--border-color);
  margin-top: 2rem;
  box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.3);
}

/* Responsive Design */
@media (max-width: 768px) {
  nav ul {
    flex-direction: column;
    gap: 1rem;
  }
  
  .leaderboard-row {
    flex-direction: column;
    text-align: center;
    gap: 0.5rem;
  }
  
  .rank {
    width: auto;
  }
  
  .username, .score {
    flex: none;
  }
}
