:root {
  --bg-dark: #0a0c10;
  --bg-card: #121620;
  --bg-card-hover: #181f2e;
  --border-gold: #c5a059;
  --border-gold-glow: rgba(197, 160, 89, 0.4);
  --text-main: #f3f4f6;
  --text-muted: #9ca3af;
  --gold: #d4af37;
  --gold-light: #f3e5ab;
  --gold-dark: #aa7c11;
  --success: #10b981;
  --danger: #ef4444;
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  background-color: var(--bg-dark);
  color: var(--text-main);
  font-family: 'Montserrat', sans-serif;
  overflow-x: hidden;
  position: relative;
  line-height: 1.6;
}

/* Tipografía Cinzel para Títulos */
h1, h2, h3, h4, .brand-logo, .hero-title, .section-title {
  font-family: 'Cinzel', serif;
  letter-spacing: 0.05em;
}

/* Scrollbar Personalizada */
::-webkit-scrollbar {
  width: 8px;
}
::-webkit-scrollbar-track {
  background: var(--bg-dark);
}
::-webkit-scrollbar-thumb {
  background: var(--border-gold);
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--gold-light);
}

/* Efecto de Fondo Textura / Gradiente */
body::before {
  content: '';
  position: fixed;
  top: 0; left: 0; width: 100%; height: 100%;
  background: radial-gradient(circle at 50% 10%, rgba(212, 175, 55, 0.05) 0%, transparent 60%);
  pointer-events: none;
  z-index: 0;
}

/* Contenedor General */
.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.5rem;
  position: relative;
  z-index: 1;
}

/* Toast Notification System */
#toast-container {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.toast {
  background: var(--bg-card);
  border: 1px solid var(--border-gold);
  color: var(--text-main);
  padding: 1rem 1.5rem;
  border-radius: 8px;
  box-shadow: 0 10px 25px rgba(0,0,0,0.5), 0 0 15px var(--border-gold-glow);
  display: flex;
  align-items: center;
  gap: 0.75rem;
  animation: slideInRight 0.3s ease forwards, fadeOut 0.3s ease 2.7s forwards;
  max-width: 350px;
  font-weight: 500;
}

.toast.success { border-color: var(--success); box-shadow: 0 10px 25px rgba(0,0,0,0.5), 0 0 15px rgba(16, 185, 129, 0.3); }
.toast.error { border-color: var(--danger); box-shadow: 0 10px 25px rgba(0,0,0,0.5), 0 0 15px rgba(239, 68, 68, 0.3); }

@keyframes slideInRight {
  from { transform: translateX(100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

@keyframes fadeOut {
  from { opacity: 1; transform: translateX(0); }
  to { opacity: 0; transform: translateY(10px); }
}

/* Header & Navegación */
header {
  position: fixed;
  top: 0; left: 0; width: 100%;
  background: rgba(10, 12, 16, 0.85);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(197, 160, 89, 0.2);
  z-index: 1000;
  transition: var(--transition);
}

.nav-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 80px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
  color: var(--gold-light);
  font-size: 1.3rem;
  font-weight: 700;
}

.logo span {
  color: var(--gold);
}

.nav-links {
  display: flex;
  gap: 2rem;
  list-style: none;
  align-items: center;
}

.nav-links a {
  text-decoration: none;
  color: var(--text-main);
  font-size: 0.95rem;
  font-weight: 500;
  transition: var(--transition);
  position: relative;
}

.nav-links a::after {
  content: '';
  position: absolute;
  bottom: -4px; left: 0; width: 0; height: 2px;
  background: var(--gold);
  transition: var(--transition);
}

.nav-links a:hover, .nav-links a.active {
  color: var(--gold-light);
}

.nav-links a:hover::after, .nav-links a.active::after {
  width: 100%;
}

.discord-btn-nav {
  background: #5865F2;
  color: white !important;
  padding: 0.5rem 1rem;
  border-radius: 6px;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  transition: var(--transition);
}
.discord-btn-nav:hover {
  background: #4752C4;
  box-shadow: 0 0 15px rgba(88, 101, 242, 0.4);
}
.discord-btn-nav::after { display: none !important; }

.menu-toggle {
  display: none;
  background: none;
  border: none;
  color: var(--gold);
  font-size: 1.8rem;
  cursor: pointer;
}

/* Hero Banner */
.hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 120px 0 80px;
  position: relative;
  background: linear-gradient(180deg, rgba(10,12,16,0.5) 0%, var(--bg-dark) 100%),
              radial-gradient(ellipse at center, rgba(212, 175, 55, 0.1) 0%, transparent 70%);
  text-align: center;
}

.hero-content {
  max-width: 800px;
  margin: 0 auto;
}

.server-status-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--bg-card);
  border: 1px solid var(--border-gold);
  padding: 0.5rem 1.25rem;
  border-radius: 50px;
  margin-bottom: 1.5rem;
  font-size: 0.9rem;
  font-weight: 600;
  box-shadow: 0 0 15px var(--border-gold-glow);
}

.status-dot {
  width: 10px;
  height: 100%;
  border-radius: 50%;
  background: var(--danger);
  box-shadow: 0 0 8px var(--danger);
  animation: pulseOffline 1.5s infinite;
}

.server-status-badge.online .status-dot {
  background: var(--success);
  box-shadow: 0 0 10px var(--success);
  animation: pulseOnline 1.5s infinite;
}

@keyframes pulseOnline {
  0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7); }
  70% { transform: scale(1); box-shadow: 0 0 0 8px rgba(16, 185, 129, 0); }
  100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

@keyframes pulseOffline {
  0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.7); }
  70% { transform: scale(1); box-shadow: 0 0 0 8px rgba(239, 68, 68, 0); }
  100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(239, 68, 68, 0); }
}

.hero-title {
  font-size: clamp(2.5rem, 5vw, 4.5rem);
  color: var(--gold-light);
  margin-bottom: 1rem;
  text-shadow: 0 5px 25px rgba(212, 175, 55, 0.3);
  line-height: 1.1;
}

.hero-subtitle {
  font-size: clamp(1rem, 2vw, 1.25rem);
  color: var(--text-muted);
  margin-bottom: 2.5rem;
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
}

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

/* Botones Interactivos con Brillo / Oro */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  padding: 0.875rem 2rem;
  border-radius: 6px;
  font-weight: 600;
  font-size: 1rem;
  text-decoration: none;
  cursor: pointer;
  transition: var(--transition);
  border: none;
  font-family: 'Montserrat', sans-serif;
}

.btn-primary {
  background: linear-gradient(135deg, var(--gold) 0%, var(--gold-dark) 100%);
  color: #000;
  box-shadow: 0 4px 20px rgba(212, 175, 55, 0.4);
  position: relative;
  overflow: hidden;
}

.btn-primary::after {
  content: '';
  position: absolute;
  top: -50%; left: -50%; width: 200%; height: 200%;
  background: linear-gradient(60deg, transparent, rgba(255,255,255,0.3), transparent);
  transform: rotate(45deg) translateX(-100%);
  transition: transform 0.6s ease;
}

.btn-primary:hover::after {
  transform: rotate(45deg) translateX(100%);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 25px rgba(212, 175, 55, 0.6);
}

.btn-outline {
  background: transparent;
  color: var(--gold-light);
  border: 1px solid var(--border-gold);
}

.btn-outline:hover {
  background: rgba(197, 160, 89, 0.1);
  border-color: var(--gold-light);
  color: #fff;
  transform: translateY(-2px);
  box-shadow: 0 0 15px var(--border-gold-glow);
}

/* Secciones Generales */
section {
  padding: 80px 0;
  position: relative;
}

.section-header {
  text-align: center;
  margin-bottom: 4rem;
}

.section-title {
  font-size: 2.5rem;
  color: var(--gold-light);
  margin-bottom: 0.75rem;
  position: relative;
  display: inline-block;
}

.section-title::after {
  content: '';
  position: absolute;
  bottom: -10px; left: 50%;
  transform: translateX(-50%);
  width: 80px; height: 3px;
  background: var(--gold);
  border-radius: 2px;
}

.section-desc {
  color: var(--text-muted);
  font-size: 1.1rem;
}

/* Tarjetas 3D Hover */
.card-3d {
  background: var(--bg-card);
  border: 1px solid rgba(197, 160, 89, 0.2);
  border-radius: 12px;
  padding: 2rem;
  transition: transform 0.4s cubic-bezier(0.2, 0.8, 0.2, 1), box-shadow 0.4s ease, border-color 0.3s ease;
  transform-style: preserve-3d;
  will-change: transform;
}

.card-3d:hover {
  border-color: var(--border-gold);
  box-shadow: 0 15px 35px rgba(0,0,0,0.6), 0 0 20px var(--border-gold-glow);
  transform: translateY(-5px);
}

/* 1. Noticias / Novedades */
.news-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 2rem;
}

.news-card {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.news-date {
  color: var(--gold);
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 0.75rem;
  display: block;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.news-card h3 {
  font-size: 1.4rem;
  color: #fff;
  margin-bottom: 1rem;
}

.news-card p {
  color: var(--text-muted);
  font-size: 0.95rem;
  margin-bottom: 1.5rem;
}

/* 2. Normativa / Reglas (Acordeón) */
.rules-container {
  max-width: 800px;
  margin: 0 auto;
}

.rules-category {
  margin-bottom: 2rem;
}

.rules-category h3 {
  font-size: 1.3rem;
  color: var(--gold);
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.accordion-item {
  background: var(--bg-card);
  border: 1px solid rgba(197, 160, 89, 0.2);
  border-radius: 8px;
  margin-bottom: 0.75rem;
  overflow: hidden;
  transition: var(--transition);
}

.accordion-item:hover {
  border-color: rgba(197, 160, 89, 0.5);
}

.accordion-header {
  width: 100%;
  padding: 1.25rem 1.5rem;
  background: none;
  border: none;
  color: var(--text-main);
  text-align: left;
  font-size: 1rem;
  font-weight: 600;
  font-family: 'Montserrat', sans-serif;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.accordion-header i {
  color: var(--gold);
  transition: transform 0.3s ease;
}

.accordion-item.active .accordion-header i {
  transform: rotate(180deg);
}

.accordion-body {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease-out, padding 0.3s ease;
  padding: 0 1.5rem;
  color: var(--text-muted);
  font-size: 0.95rem;
}

.accordion-item.active .accordion-body {
  max-height: 300px;
  padding: 0 1.5rem 1.25rem 1.5rem;
}

/* 3. Staff Oficial */
.staff-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 2rem;
}

.staff-card {
  text-align: center;
  padding: 2.5rem 1.5rem;
}

.staff-avatar {
  width: 90px;
  height: 90px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--gold) 0%, var(--gold-dark) 100%);
  margin: 0 auto 1.25rem;
  display: grid;
  place-items: center;
  font-size: 2.2rem;
  color: #000;
  font-weight: 700;
  box-shadow: 0 0 20px var(--border-gold-glow);
}

.staff-card h3 {
  font-size: 1.25rem;
  color: #fff;
  margin-bottom: 0.25rem;
}

.staff-role {
  color: var(--gold);
  font-size: 0.85rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 1rem;
  display: inline-block;
  background: rgba(212, 175, 55, 0.1);
  padding: 0.25rem 0.75rem;
  border-radius: 50px;
}

.staff-card p {
  color: var(--text-muted);
  font-size: 0.9rem;
}

/* 4. Leaderboard / Ranking */
.leaderboard-section {
  background: linear-gradient(180deg, var(--bg-dark) 0%, var(--bg-card) 50%, var(--bg-dark) 100%);
}

.leaderboard-tabs {
  display: flex;
  justify-content: center;
  gap: 1rem;
  margin-bottom: 2.5rem;
}

.tab-btn {
  background: var(--bg-card);
  border: 1px solid rgba(197, 160, 89, 0.3);
  color: var(--text-muted);
  padding: 0.75rem 1.75rem;
  border-radius: 6px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  font-family: 'Montserrat', sans-serif;
}

.tab-btn.active, .tab-btn:hover {
  background: var(--gold);
  color: #000;
  border-color: var(--gold);
  box-shadow: 0 0 15px var(--border-gold-glow);
}

.leaderboard-table-container {
  max-width: 900px;
  margin: 0 auto;
  background: var(--bg-card);
  border: 1px solid var(--border-gold);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 10px 30px rgba(0,0,0,0.5);
}

.leaderboard-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}

.leaderboard-table th, .leaderboard-table td {
  padding: 1.25rem 1.5rem;
}

.leaderboard-table th {
  background: rgba(197, 160, 89, 0.1);
  color: var(--gold-light);
  font-family: 'Cinzel', serif;
  font-size: 1.05rem;
  border-bottom: 1px solid var(--border-gold);
}

.leaderboard-table tr:not(:last-child) td {
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.leaderboard-table tr:hover td {
  background: var(--bg-card-hover);
}

.rank-badge {
  display: inline-grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  font-weight: 700;
  font-size: 0.9rem;
}

.rank-1 { background: linear-gradient(135deg, #ffd700, #ffa500); color: #000; box-shadow: 0 0 10px rgba(255,215,0,0.5); }
.rank-2 { background: linear-gradient(135deg, #e0e0e0, #9e9e9e); color: #000; }
.rank-3 { background: linear-gradient(135deg, #cd7f32, #8b4513); color: #fff; }
.rank-other { background: rgba(255,255,255,0.05); color: var(--text-muted); }

/* Formularios (Registro y Postulación) */
.forms-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
  gap: 3rem;
}

.form-card {
  background: var(--bg-card);
  border: 1px solid var(--border-gold);
  border-radius: 12px;
  padding: 2.5rem;
  box-shadow: 0 15px 35px rgba(0,0,0,0.5);
}

.form-card h3 {
  font-size: 1.75rem;
  color: var(--gold-light);
  margin-bottom: 0.5rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.form-card p {
  color: var(--text-muted);
  font-size: 0.95rem;
  margin-bottom: 2rem;
}

.form-group {
  margin-bottom: 1.5rem;
}

.form-group label {
  display: block;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-main);
  margin-bottom: 0.5rem;
}

.form-control {
  width: 100%;
  padding: 0.875rem 1rem;
  background: var(--bg-dark);
  border: 1px solid rgba(197, 160, 89, 0.3);
  border-radius: 6px;
  color: #fff;
  font-family: 'Montserrat', sans-serif;
  font-size: 1rem;
  transition: var(--transition);
}

.form-control:focus {
  outline: none;
  border-color: var(--gold);
  box-shadow: 0 0 10px var(--border-gold-glow);
}

textarea.form-control {
  resize: vertical;
  min-height: 120px;
}

.form-hint {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 0.35rem;
  display: block;
}

/* Footer */
footer {
  background: #05070a;
  border-top: 1px solid rgba(197, 160, 89, 0.2);
  padding: 4rem 0 2rem;
  text-align: center;
}

.footer-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.5rem;
  margin-bottom: 3rem;
}

.footer-logo {
  font-size: 1.8rem;
  font-family: 'Cinzel', serif;
  color: var(--gold-light);
  text-decoration: none;
}

.footer-links {
  display: flex;
  gap: 2rem;
  list-style: none;
}

.footer-links a {
  color: var(--text-muted);
  text-decoration: none;
  transition: var(--transition);
}

.footer-links a:hover {
  color: var(--gold);
}

.footer-bottom {
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  padding-top: 2rem;
  color: var(--text-muted);
  font-size: 0.85rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
}

.footer-bottom a {
  color: var(--gold);
  text-decoration: none;
}

/* Responsive Design */
@media (max-width: 768px) {
  .nav-links {
    display: none;
    flex-direction: column;
    position: absolute;
    top: 80px; left: 0; width: 100%;
    background: var(--bg-card);
    padding: 2rem;
    border-bottom: 1px solid var(--border-gold);
    box-shadow: 0 10px 20px rgba(0,0,0,0.5);
  }

  .nav-links.active {
    display: flex;
  }

  .menu-toggle {
    display: block;
  }

  .hero {
    padding: 100px 0 60px;
  }

  .forms-grid {
    grid-template-columns: 1fr;
  }

  .footer-bottom {
    flex-direction: column;
    text-align: center;
  }
}
