:root {
  --bg: #08090d;
  --bg-elevated: #111319;
  --bg-card: rgba(255, 255, 255, 0.03);
  --bg-card-hover: rgba(255, 255, 255, 0.055);
  --border: rgba(255, 255, 255, 0.09);
  --border-hover: rgba(255, 255, 255, 0.18);
  --text: #eef0f6;
  --text-muted: #949bab;
  --brand: #5865f2;
  --brand-2: #9b6bff;
  --brand-hover: #6d78ff;
  --accent: #22d3ee;
  --success: #57f287;
  --danger: #ed4245;
  --warning: #fee75c;
  --radius: 14px;
  --radius-sm: 10px;
  --shadow-glow: 0 0 0 1px rgba(255, 255, 255, 0.04), 0 8px 30px rgba(0, 0, 0, 0.45);
}

* { box-sizing: border-box; }

::selection { background: rgba(88, 101, 242, 0.35); color: #fff; }

::-webkit-scrollbar { width: 11px; height: 11px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.12); border-radius: 999px; border: 3px solid var(--bg); }
::-webkit-scrollbar-thumb:hover { background: rgba(255, 255, 255, 0.22); }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: 'Sora', 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  line-height: 1.55;
  letter-spacing: -0.01em;
  position: relative;
  overflow-x: hidden;
}

/* Fondo: rejilla sutil + halos de color difuminados, fijos, puramente decorativos */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: -2;
  background-image:
    radial-gradient(circle at 15% 8%, rgba(88, 101, 242, 0.22), transparent 42%),
    radial-gradient(circle at 88% 18%, rgba(34, 211, 238, 0.14), transparent 40%),
    radial-gradient(circle at 50% 100%, rgba(155, 107, 255, 0.14), transparent 45%);
  pointer-events: none;
}
body::after {
  content: '';
  position: fixed;
  inset: 0;
  z-index: -1;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.025) 1px, transparent 1px);
  background-size: 42px 42px;
  mask-image: radial-gradient(ellipse 80% 60% at 50% 0%, black 40%, transparent 100%);
  pointer-events: none;
}

a { color: var(--accent); text-decoration: none; transition: color 0.15s ease; }
a:hover { color: #6ee7f7; text-decoration: none; }

h1, h2, h3 { font-weight: 700; letter-spacing: -0.02em; }

.gradient-text {
  background: linear-gradient(100deg, #fff 10%, var(--brand-2) 55%, var(--accent) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.topbar {
  background: rgba(8, 9, 13, 0.72);
  backdrop-filter: blur(14px) saturate(140%);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 10;
}
.topbar-inner {
  max-width: 1140px;
  margin: 0 auto;
  padding: 14px 24px;
  display: flex;
  align-items: center;
  gap: 22px;
}
.brand { font-weight: 800; font-size: 1.08rem; color: var(--text); display: flex; align-items: center; gap: 8px; }
.brand:hover { text-decoration: none; opacity: 0.88; }
.nav-links { flex: 1; display: flex; gap: 6px; flex-wrap: wrap; }
.nav-links a {
  color: var(--text-muted);
  font-weight: 600;
  font-size: 0.9rem;
  padding: 7px 12px;
  border-radius: 999px;
  transition: color 0.15s ease, background 0.15s ease;
}
.nav-links a.active { color: var(--text); background: rgba(255, 255, 255, 0.07); }
.nav-links a:hover { color: var(--text); background: rgba(255, 255, 255, 0.05); text-decoration: none; }

.user-chip { display: flex; align-items: center; gap: 10px; }
.user-chip img { width: 30px; height: 30px; border-radius: 50%; box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.1); }

.btn-primary, .btn-outline, .btn-danger, button.btn-primary, button.btn-outline, button.btn-danger {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font: inherit;
  cursor: pointer;
  padding: 10px 18px;
  border-radius: 999px;
  border: 1px solid transparent;
  font-weight: 600;
  font-size: 0.9rem;
  transition: transform 0.15s ease, box-shadow 0.15s ease, opacity 0.15s ease, border-color 0.15s ease, background 0.15s ease;
}
.btn-primary {
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  color: white;
  box-shadow: 0 4px 18px rgba(88, 101, 242, 0.35);
}
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 6px 24px rgba(88, 101, 242, 0.5); text-decoration: none; }
.btn-primary:active { transform: translateY(0); }
.btn-outline { background: rgba(255, 255, 255, 0.03); border-color: var(--border); color: var(--text); }
.btn-outline:hover { border-color: var(--border-hover); background: rgba(255, 255, 255, 0.06); text-decoration: none; }
.btn-danger { background: rgba(237, 66, 69, 0.08); border-color: rgba(237, 66, 69, 0.4); color: var(--danger); }
.btn-danger:hover { background: var(--danger); border-color: var(--danger); color: white; text-decoration: none; }
.btn-sm { padding: 6px 13px; font-size: 0.8rem; }

.container { max-width: 1140px; margin: 0 auto; padding: 36px 24px 72px; }

.flash { padding: 12px 0; }
.flash-inner {
  max-width: 1140px;
  margin: 12px auto 0;
  padding: 13px 20px;
  border-radius: var(--radius-sm);
  font-weight: 500;
  backdrop-filter: blur(8px);
  animation: slide-in 0.25s ease;
}
@keyframes slide-in { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: translateY(0); } }
.flash-exito { background: rgba(87, 242, 135, 0.1); border: 1px solid rgba(87, 242, 135, 0.35); color: var(--success); }
.flash-error { background: rgba(237, 66, 69, 0.1); border: 1px solid rgba(237, 66, 69, 0.35); color: var(--danger); }

.hero { text-align: center; padding: 110px 20px 90px; position: relative; }
.hero .pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 0.8rem;
  font-weight: 600;
  margin-bottom: 22px;
}
.hero .pill .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--success); box-shadow: 0 0 8px var(--success); }
.hero h1 { font-size: clamp(2.2rem, 5vw, 3.4rem); margin: 0 0 16px; line-height: 1.1; }
.hero p { color: var(--text-muted); font-size: 1.12rem; max-width: 600px; margin: 0 auto 34px; }
.hero .cta-row { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; }

.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
  backdrop-filter: blur(10px);
  box-shadow: var(--shadow-glow);
  transition: background 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}
.card:hover { background: var(--bg-card-hover); border-color: var(--border-hover); }
.card h2, .card h3 { margin-top: 0; }
.card + .card { margin-top: 18px; }

.feature-grid { margin-bottom: 40px; }
.feature-card { text-align: left; }
.feature-card:hover { transform: translateY(-3px); }
.feature-icon {
  width: 46px; height: 46px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.35rem;
  border-radius: 12px;
  background: linear-gradient(135deg, rgba(88, 101, 242, 0.18), rgba(155, 107, 255, 0.18));
  border: 1px solid var(--border);
  margin-bottom: 14px;
}
.feature-card h3 { font-size: 1rem; margin: 0 0 6px; }
.feature-card p { color: var(--text-muted); font-size: 0.88rem; margin: 0; }

.guild-card { display: flex; align-items: center; gap: 14px; }
.guild-card:hover { transform: translateY(-2px); }
.guild-card img.icon { width: 48px; height: 48px; border-radius: 50%; background: var(--bg-elevated); box-shadow: 0 0 0 2px var(--border); }
.guild-card .icon-fallback {
  width: 48px; height: 48px; border-radius: 50%;
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  display: flex; align-items: center; justify-content: center; font-weight: 700; color: white;
  box-shadow: 0 0 0 2px var(--border);
}
.guild-card .info { flex: 1; min-width: 0; }
.guild-card .info .name { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.guild-card .badge { font-size: 0.75rem; color: var(--text-muted); }

.section-title { display: flex; align-items: center; justify-content: space-between; margin: 40px 0 16px; }
.section-title h2 { margin: 0; font-size: 1.15rem; }

label { display: block; font-size: 0.85rem; color: var(--text-muted); margin: 16px 0 7px; font-weight: 600; }
input[type="text"], input[type="number"], input[type="url"], select, textarea {
  width: 100%;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 13px;
  color: var(--text);
  font: inherit;
  transition: border-color 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
}
input[type="text"]:focus, input[type="number"]:focus, input[type="url"]:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--brand);
  background: rgba(255, 255, 255, 0.05);
  box-shadow: 0 0 0 3px rgba(88, 101, 242, 0.18);
}
textarea { resize: vertical; min-height: 70px; }
.hint { font-size: 0.78rem; color: var(--text-muted); margin-top: 5px; }
.form-row { display: flex; gap: 14px; flex-wrap: wrap; }
.form-row > div { flex: 1; min-width: 180px; }
.form-actions { margin-top: 20px; display: flex; gap: 10px; align-items: center; }

.checkbox-row { display: flex; align-items: center; gap: 8px; margin: 14px 0; }
.checkbox-row input { width: auto; }
.checkbox-row label { margin: 0; }

table { width: 100%; border-collapse: collapse; margin-top: 10px; }
th, td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--border); font-size: 0.9rem; }
th { color: var(--text-muted); font-weight: 700; font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.04em; }
tbody tr { transition: background 0.15s ease; }
tbody tr:hover { background: rgba(255, 255, 255, 0.025); }

.empty-state { color: var(--text-muted); text-align: center; padding: 46px 20px; font-size: 0.95rem; }

.tag { display: inline-flex; align-items: center; gap: 5px; padding: 3px 10px; border-radius: 999px; font-size: 0.72rem; font-weight: 700; }
.tag-on { background: rgba(87, 242, 135, 0.12); color: var(--success); }
.tag-off { background: rgba(148, 155, 171, 0.12); color: var(--text-muted); }

.owner-badge {
  background: linear-gradient(135deg, rgba(88, 101, 242, 0.2), rgba(155, 107, 255, 0.2));
  color: #b8c0ff;
  padding: 3px 12px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 700;
  border: 1px solid rgba(88, 101, 242, 0.3);
}

.footer { text-align: center; padding: 36px; color: var(--text-muted); font-size: 0.8rem; opacity: 0.7; }

@media (max-width: 640px) {
  .topbar-inner { flex-wrap: wrap; }
  .nav-links { order: 3; width: 100%; }
  .hero { padding: 70px 16px 60px; }
}
