:root {
  --bg: #050814;
  --bg-alt: #0c1020;
  --card-bg: #111522;
  --card-bg-alt: #151a2a;
  --border-subtle: #22283a;
  --accent: #4ade80;
  --accent-soft: rgba(74, 222, 128, 0.1);
  --accent-strong: #22c55e;
  --text-main: #f9fafb;
  --text-muted: #9ca3af;
  --text-soft: #6b7280;
  --danger: #f97373;
  --font-sans: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

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

html,
body {
  margin: 0;
  padding: 0;
  background: radial-gradient(circle at top, #111827 0, #020617 55%, #000 100%);
  color: var(--text-main);
  font-family: var(--font-sans);
}

/* Layout helpers */

.container {
  width: 100%;
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

.section {
  padding: 3.5rem 0;
}

.section-alt {
  background: linear-gradient(to bottom, rgba(15, 23, 42, 0.9), rgba(2, 6, 23, 0.9));
}

.section h2 {
  margin: 0 0 0.75rem;
  font-size: clamp(1.6rem, 3vw, 2rem);
}

.section-subtitle {
  margin: 0 0 1.5rem;
  color: var(--text-muted);
  max-width: 640px;
}

/* Header */

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  backdrop-filter: blur(14px);
  background: linear-gradient(to bottom, rgba(15, 23, 42, 0.95), rgba(15, 23, 42, 0.4));
  border-bottom: 1px solid rgba(148, 163, 184, 0.1);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 0;
}

.logo-link {
  text-decoration: none;
  color: inherit;
  transition: transform 0.2s ease;
}

.logo-link:hover {
  transform: translateY(-1px);
}

.logo {
  display: flex;
  align-items: center;
  gap: 0.55rem;
}

.logo-mark {
  width: 32px;
  height: 32px;
  border-radius: 0.9rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 1.1rem;
  background: radial-gradient(circle at 20% 0, #4ade80, #22c55e 45%, #0f172a 100%);
  box-shadow: 0 0 18px rgba(34, 197, 94, 0.5);
}

.logo-text {
  font-weight: 600;
  letter-spacing: 0.03em;
  font-size: 0.95rem;
}

.main-nav {
  display: flex;
  gap: 1rem;
  align-items: center;
  font-size: 0.9rem;
}

.main-nav a {
  text-decoration: none;
  color: var(--text-muted);
  padding: 0.3rem 0.4rem;
  border-radius: 0.45rem;
  transition: color 0.18s ease, background-color 0.18s ease;
}

.main-nav a:hover {
  color: var(--text-main);
  background-color: rgba(15, 23, 42, 0.8);
}

/* Buttons */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.6rem 1.2rem;
  border-radius: 999px;
  border: none;
  cursor: pointer;
  font-weight: 600;
  font-size: 0.9rem;
  letter-spacing: 0.02em;
  background: linear-gradient(135deg, var(--accent), var(--accent-strong));
  color: #022c22;
  text-decoration: none;
  box-shadow: 0 0 18px rgba(34, 197, 94, 0.5);
  transition: transform 0.12s ease, box-shadow 0.12s ease, filter 0.12s ease;
}

.btn:hover {
  transform: translateY(-1px);
  filter: brightness(1.05);
  box-shadow: 0 0 22px rgba(34, 197, 94, 0.7);
}

.btn-outline {
  background: transparent;
  border: 1px solid rgba(148, 163, 184, 0.7);
  color: var(--text-main);
  box-shadow: none;
}

.btn-outline:hover {
  border-color: var(--accent);
  box-shadow: 0 0 14px rgba(34, 197, 94, 0.4);
}

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

/* Hero */

.hero {
  padding: 2.5rem 0 3.25rem;
}

.hero-inner {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(0, 1.1fr);
  gap: 2.25rem;
  align-items: center;
}

.hero-text h1 {
  font-size: clamp(2rem, 4vw, 2.6rem);
  margin: 0 0 0.7rem;
}

.hero-text p {
  margin: 0 0 1.25rem;
  color: var(--text-muted);
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-bottom: 0.85rem;
}

.hero-meta {
  font-size: 0.85rem;
  color: var(--text-soft);
}

/* Hero card */

.hero-card {
  background: radial-gradient(circle at 0 0, rgba(74, 222, 128, 0.12), transparent 55%),
    var(--card-bg);
  border-radius: 1.25rem;
  padding: 1.25rem 1.3rem;
  border: 1px solid rgba(148, 163, 184, 0.25);
  box-shadow: 0 18px 50px rgba(15, 23, 42, 0.8);
}

.hero-card h2 {
  margin: 0 0 1rem;
  font-size: 1.1rem;
}

.server-highlight {
  display: flex;
  gap: 1rem;
  align-items: center;
  padding: 0.8rem 0.9rem;
  border-radius: 1rem;
  background: rgba(15, 23, 42, 0.9);
  border: 1px solid rgba(148, 163, 184, 0.25);
}

.server-rank-badge {
  width: 44px;
  height: 44px;
  border-radius: 1rem;
  background: linear-gradient(135deg, var(--accent), var(--accent-strong));
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  color: #022c22;
  box-shadow: 0 0 18px rgba(34, 197, 94, 0.7);
}

.server-main h3 {
  margin: 0 0 0.2rem;
  font-size: 1rem;
}

.server-ip {
  margin: 0;
  font-size: 0.88rem;
  color: var(--text-muted);
}

.server-ip span {
  font-family: monospace;
  background: rgba(15, 23, 42, 0.9);
  padding: 0.05rem 0.35rem;
  border-radius: 0.35rem;
}

.server-modes,
.server-stats {
  margin: 0.3rem 0 0;
  font-size: 0.86rem;
  color: var(--text-soft);
}

.hero-card-note {
  margin: 0.8rem 0 0;
  font-size: 0.85rem;
  color: var(--text-soft);
}

.hero-card-note a {
  color: var(--accent);
  text-decoration: none;
}

.hero-card-note a:hover {
  text-decoration: underline;
}

/* Badges */

.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.18rem 0.55rem;
  border-radius: 999px;
  font-size: 0.7rem;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  font-weight: 600;
}

.badge-gold {
  background: linear-gradient(135deg, #facc15, #f97316);
  color: #111827;
}

.badge-silver {
  background: linear-gradient(135deg, #e5e7eb, #9ca3af);
  color: #020617;
}

.badge-bronze {
  background: linear-gradient(135deg, #f97316, #b45309);
  color: #111827;
}

.badge-country {
  background: rgba(15, 23, 42, 0.9);
  border: 1px solid rgba(148, 163, 184, 0.4);
}

/* Recommended servers */

.recommended-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1.2rem;
}

.server-card {
  background: var(--card-bg);
  border-radius: 1.1rem;
  padding: 1rem 1rem 0.9rem;
  border: 1px solid rgba(148, 163, 184, 0.25);
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.server-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.3rem;
}

.server-card h3 {
  margin: 0;
  font-size: 0.98rem;
}

.server-ip {
  font-size: 0.82rem;
  color: var(--accent);
  font-family: monospace;
}

.server-modes-small {
  margin: 0;
  font-size: 0.82rem;
  color: var(--text-muted);
}

.server-stats-small {
  margin: 0;
  font-size: 0.8rem;
  color: var(--text-soft);
}

.server-card-footer {
  margin-top: 0.55rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

/* Table */

.table-wrapper {
  margin-top: 1.75rem;
  border-radius: 1.1rem;
  border: 1px solid rgba(148, 163, 184, 0.25);
  background: radial-gradient(circle at top left, rgba(74, 222, 128, 0.08), transparent 60%),
    rgba(15, 23, 42, 0.9);
  overflow: hidden;
}

.server-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
}

.server-table thead {
  background: rgba(15, 23, 42, 0.9);
}

.server-table th,
.server-table td {
  padding: 0.55rem 0.85rem;
  text-align: left;
  border-bottom: 1px solid rgba(31, 41, 55, 0.8);
}

.server-table th {
  font-weight: 600;
  color: var(--text-muted);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.server-table tbody tr:nth-child(even) {
  background: rgba(15, 23, 42, 0.35);
}

.server-table tbody tr:hover {
  background: rgba(15, 23, 42, 0.7);
}

.server-table code {
  font-family: monospace;
  font-size: 0.8rem;
  background: rgba(15, 23, 42, 0.9);
  padding: 0.05rem 0.25rem;
  border-radius: 0.3rem;
}

/* Server List */

.server-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-top: 1.75rem;
}

.server-list-item {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  padding: 1.5rem;
  background: var(--card-bg);
  border: 1px solid var(--border-subtle);
  border-radius: 0.75rem;
  transition: all 0.3s ease;
}

.server-list-item:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 30px rgba(74, 222, 128, 0.08);
  border-color: rgba(74, 222, 128, 0.2);
}

.server-rank {
  flex-shrink: 0;
  width: 50px;
  height: 50px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.rank-number {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--accent);
  text-shadow: 0 0 20px rgba(74, 222, 128, 0.5);
}

.server-list-item:nth-child(1) .rank-number {
  font-size: 1.8rem;
  color: #ffd700;
  text-shadow: 0 0 20px rgba(255, 215, 0, 0.5);
}

.server-list-item:nth-child(2) .rank-number {
  color: #c0c0c0;
  text-shadow: 0 0 20px rgba(192, 192, 192, 0.5);
}

.server-list-item:nth-child(3) .rank-number {
  color: #cd7f32;
  text-shadow: 0 0 20px rgba(205, 127, 50, 0.5);
}

.server-banner {
  flex-shrink: 0;
  width: 150px;
  height: 100px;
}

.banner-placeholder {
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, var(--card-bg-alt) 0%, var(--border-subtle) 100%);
  border-radius: 0.5rem;
  border: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
}

.server-logo {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 0.5rem;
}

.server-info {
  flex: 1;
  min-width: 0;
}

.server-name {
  margin: 0 0 0.75rem;
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--text-main);
}

.server-ip-container {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}

.ip-label {
  font-size: 0.875rem;
  color: var(--text-muted);
  font-weight: 500;
}

.ip-copy-wrapper {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  background: rgba(74, 222, 128, 0.08);
  padding: 0.25rem 0.5rem;
  border-radius: 0.375rem;
  border: 1px solid rgba(74, 222, 128, 0.15);
  transition: all 0.2s ease;
}

.ip-copy-wrapper:hover {
  background: rgba(74, 222, 128, 0.15);
  border-color: rgba(74, 222, 128, 0.3);
}

.server-ip-text {
  font-family: 'Courier New', monospace;
  font-size: 0.875rem;
  color: var(--accent);
  font-weight: 500;
}

.copy-btn {
  background: transparent;
  border: none;
  cursor: pointer;
  color: var(--accent);
  padding: 0.125rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.copy-btn:hover {
  transform: scale(1.1);
  color: var(--accent-strong);
}

.copy-btn.copied {
  color: var(--accent-strong);
}

.copy-btn.copied::after {
  content: '✓';
  position: absolute;
  font-weight: bold;
  animation: fadeInOut 2s ease;
}

@keyframes fadeInOut {
  0% { opacity: 0; }
  50% { opacity: 1; }
  100% { opacity: 0; }
}

.server-details {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.detail-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.625rem;
  background: var(--card-bg-alt);
  border: 1px solid var(--border-subtle);
  border-radius: 0.375rem;
  font-size: 0.875rem;
  color: var(--text-muted);
}

.server-social {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.social-link {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 0.5rem;
  background: var(--card-bg-alt);
  border: 1px solid var(--border-subtle);
  transition: all 0.2s ease;
}

.social-link:hover {
  transform: translateY(-2px);
  border-color: rgba(74, 222, 128, 0.3);
}

.social-link.discord {
  color: #5865F2;
}

.social-link.discord:hover {
  background: rgba(88, 101, 242, 0.1);
  border-color: #5865F2;
}

.btn-vote {
  background: var(--accent);
  color: var(--bg);
  font-weight: 600;
}

.btn-vote:hover {
  background: var(--accent-strong);
  transform: translateY(-2px);
}

.vote-link {
  font-size: 0.78rem;
  text-decoration: none;
  color: var(--accent);
  font-weight: 600;
}

.vote-link:hover {
  text-decoration: underline;
}

/* News */

.news-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1.25rem;
}

.news-card {
  background: var(--card-bg-alt);
  border-radius: 1.1rem;
  padding: 1rem;
  border: 1px solid rgba(148, 163, 184, 0.25);
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.news-card h3 {
  margin: 0;
  font-size: 0.98rem;
}

.news-meta {
  margin: 0;
  font-size: 0.78rem;
  color: var(--text-soft);
}

.news-card p {
  margin: 0;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.news-link {
  margin-top: 0.45rem;
  font-size: 0.8rem;
  color: var(--accent);
  text-decoration: none;
}

.news-link:hover {
  text-decoration: underline;
}

/* Add server form */

.add-server-form {
  background: var(--card-bg);
  border-radius: 1.1rem;
  padding: 1.1rem 1rem 1rem;
  border: 1px solid rgba(148, 163, 184, 0.25);
}

.form-row {
  display: flex;
  gap: 1rem;
  margin-bottom: 0.8rem;
}

.form-field {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.form-field-full {
  flex: 1 1 100%;
}

.add-server-form label {
  font-size: 0.8rem;
  color: var(--text-soft);
}

.add-server-form input,
.add-server-form textarea {
  padding: 0.55rem 0.6rem;
  border-radius: 0.55rem;
  border: 1px solid rgba(55, 65, 81, 0.9);
  background: rgba(15, 23, 42, 0.9);
  color: var(--text-main);
  font-size: 0.85rem;
  outline: none;
}

.add-server-form input:focus,
.add-server-form textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px rgba(34, 197, 94, 0.5);
}

.form-hint {
  margin-top: 0.7rem;
  font-size: 0.78rem;
  color: var(--text-soft);
}

/* Footer */

.site-footer {
  border-top: 1px solid rgba(30, 64, 175, 0.6);
  background: rgba(2, 6, 23, 0.98);
  padding: 1.2rem 0 1.4rem;
  margin-top: 1.5rem;
}

.footer-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.8rem;
  color: var(--text-soft);
}

.footer-links {
  display: flex;
  gap: 0.8rem;
}

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

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

/* Responsive */

@media (max-width: 900px) {
  .hero-inner {
    grid-template-columns: minmax(0, 1fr);
  }

  .hero-card {
    order: -1;
  }

  .main-nav {
    display: none; /* versión simple; podrías hacer menú móvil más adelante */
  }

  .recommended-grid,
  .news-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .table-wrapper {
    border-radius: 0.75rem;
  }

  .server-table th:nth-child(5),
  .server-table td:nth-child(5) {
    display: none; /* esconder "Modos" en pantallas pequeñas para que quepa mejor */
  }
  
  /* Responsive server list */
  .server-list-item {
    flex-wrap: wrap;
    gap: 1rem;
    padding: 1rem;
  }
  
  .server-rank {
    width: 40px;
    height: 40px;
  }
  
  .rank-number {
    font-size: 1.25rem;
  }
  
  .server-list-item:nth-child(1) .rank-number {
    font-size: 1.4rem;
  }
  
  .server-banner {
    width: 100px;
    height: 75px;
  }
  
  .server-info {
    width: 100%;
    flex: none;
  }
  
  .server-social {
    width: 100%;
    justify-content: space-between;
  }
}

@media (max-width: 640px) {
  .form-row {
    flex-direction: column;
  }

  .footer-inner {
    flex-direction: column;
    align-items: flex-start;
  }
}
