/* ============================================
   DEADLOCK MÉXICO — Navbar
   ============================================ */

.navbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 1000;
  height: 64px;
  background: linear-gradient(180deg, #11151f 0%, #0c0f17 100%);
  border-bottom: 1px solid rgba(192, 124, 58, 0.35);
  box-shadow: inset 0 1px 0 rgba(224, 160, 96, 0.10), inset 0 -1px 0 rgba(0,0,0,0.6), 0 2px 16px rgba(0,0,0,0.4);
  transition: box-shadow var(--transition), border-color var(--transition);
}
/* filo de latón superior */
.navbar::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(224,160,96,0.55) 25%, rgba(224,160,96,0.55) 75%, transparent);
  pointer-events: none;
}
.navbar.scrolled {
  box-shadow: inset 0 1px 0 rgba(224,160,96,0.12), 0 6px 30px rgba(0,0,0,0.6);
  border-bottom-color: rgba(192, 124, 58, 0.55);
}
.navbar-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* Logo */
.navbar-logo {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: inherit;
  flex-shrink: 0;
}
.navbar-logo-icon {
  width: 40px; height: 40px;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1.5px solid rgba(192, 124, 58, 0.5);
  border-radius: 8px;
  background: radial-gradient(circle at 35% 28%, rgba(224,160,96,0.14), rgba(0,0,0,0.35) 75%);
  box-shadow: inset 0 1px 1px rgba(224,160,96,0.18), inset 0 -2px 4px rgba(0,0,0,0.5);
  transition: border-color var(--transition), box-shadow var(--transition);
}
.navbar-logo:hover .navbar-logo-icon {
  border-color: rgba(224, 160, 96, 0.85);
  box-shadow: inset 0 1px 1px rgba(224,160,96,0.28), 0 0 14px rgba(47,232,154,0.25);
}
.navbar-logo-icon svg { width: 28px; height: 28px; }
.navbar-logo-img {
  height: 40px; width: 40px;
  object-fit: contain;
  border: 1.5px solid rgba(192,124,58,0.5);
  border-radius: 8px;
  padding: 3px;
  background: radial-gradient(circle at 35% 28%, rgba(224,160,96,0.12), rgba(0,0,0,0.3) 75%);
  box-shadow: inset 0 1px 1px rgba(224,160,96,0.16), inset 0 -2px 4px rgba(0,0,0,0.45);
}
.navbar-logo-text {
  font-family: var(--font-head);
  font-size: 21px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  line-height: 1;
  background: linear-gradient(180deg, #f0d4ac 0%, #c07c3a 100%);
  -webkit-background-clip: text;
          background-clip: text;
  -webkit-text-fill-color: transparent;
}
.navbar-logo-text span {
  -webkit-text-fill-color: var(--cyan);
  color: var(--cyan);
}
.navbar-logo-sub {
  display: flex;
  align-items: center;
  gap: 5px;
  font-family: var(--font-mono);
  font-size: 9px;
  color: var(--cyan);
  letter-spacing: 0.3em;
  text-transform: uppercase;
  margin-top: 3px;
  width: 100%;        /* ocupa el ancho del contenedor (el div del wordmark) */
  justify-content: center;  /* centra el texto entre las dos líneas */
}
.navbar-logo-sub::before,
.navbar-logo-sub::after {
  content: '';
  height: 1px;
  flex: 1;            /* ambas líneas iguales → texto perfectamente centrado */
  background: rgba(192, 124, 58, 0.5);
}
/* eliminar el override de flex:1 solo en ::after que causaba el descentrado */

/* Nav links */
.navbar-nav {
  display: flex;
  align-items: center;
  gap: 4px;
  list-style: none;
}
.navbar-nav a {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  font-family: var(--font-head);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--text-muted);
  text-decoration: none;
  transition: all var(--transition);
  position: relative;
}
.navbar-nav a:hover {
  color: var(--text-primary);
  background: rgba(224,160,96,0.08);
}
.navbar-nav a.active {
  color: #f0d4ac;
  background: rgba(192,124,58,0.12);
}
.navbar-nav a.active::after {
  content: '';
  position: absolute;
  bottom: 3px; left: 12px; right: 12px;
  height: 2px;
  background: linear-gradient(90deg, var(--bronze), var(--bronze-light));
  border-radius: 1px;
}

/* Online indicator in nav */
.nav-online {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 20px;
  background: rgba(0, 232, 120, 0.08);
  border: 1px solid rgba(0, 232, 120, 0.2);
  font-family: var(--font-mono);
  font-size: 11px;
  color: #00e878;
  white-space: nowrap;
}

/* Auth buttons */
.navbar-auth {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

/* Mobile menu button */
.navbar-burger {
  display: none;
  flex-direction: column;
  gap: 5px;
  padding: 8px;
  cursor: pointer;
  background: none;
  border: none;
}
.navbar-burger span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--text-muted);
  border-radius: 1px;
  transition: all 250ms ease;
}
.navbar-burger.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.navbar-burger.open span:nth-child(2) { opacity: 0; }
.navbar-burger.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* Mobile menu */
.navbar-mobile {
  display: none;
  position: fixed;
  top: 64px; left: 0; right: 0;
  background: rgba(9, 12, 20, 0.98);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
  padding: 16px 24px 24px;
  z-index: 999;
}
.navbar-mobile.open { display: block; }
.navbar-mobile nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.navbar-mobile nav a {
  display: block;
  padding: 10px 12px;
  border-radius: var(--radius-md);
  font-family: var(--font-head);
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--text-muted);
  text-decoration: none;
  transition: all var(--transition);
}
.navbar-mobile nav a:hover {
  color: var(--cyan);
  background: var(--cyan-glow);
}
.navbar-mobile-footer {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
  display: flex;
  gap: 8px;
}
.navbar-mobile-footer .btn { flex: 1; justify-content: center; }

/* Spacer */
.navbar-spacer { height: 64px; }

/* Responsive — desktop angosto (901–1500px): nav en segunda fila para que no se desborde */
@media (max-width: 1500px) and (min-width: 901px) {
  .navbar {
    height: auto !important;
  }
  .navbar-inner {
    flex-wrap: wrap;
    height: auto;
    padding: 10px 20px 0;
    row-gap: 0;
  }
  /* Logo + acciones en primera fila */
  .navbar-logo   { order: 1; }
  .navbar-auth   { order: 2; flex-shrink: 0; }
  /* Nav links en segunda fila, scrollable si hacen falta */
  .navbar-nav {
    order: 3;
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding: 6px 0 8px;
    border-top: 1px solid var(--border);
    margin-top: 8px;
    flex-wrap: nowrap;
    gap: 2px;
  }
  .navbar-nav::-webkit-scrollbar { display: none; }
  .navbar-spacer { height: 108px; }
}

/* Responsive móvil — ocultar nav y auth, asegurar burger accesible */
@media (max-width: 900px) {
  .navbar-nav, .navbar-auth { display: none; }
  .navbar-burger { display: flex; }
  .navbar-inner {
    width: 100%;
    max-width: 100%;
    padding: 0 16px;
    box-sizing: border-box;
    gap: 8px;
  }
  /* el logo puede encogerse; el burger nunca */
  .navbar-logo { order: 1; min-width: 0; overflow: hidden; }
  .navbar-burger {
    order: 2;
    flex-shrink: 0;
    margin-left: auto;
    position: relative;
    z-index: 1001;
  }
  /* el wordmark se recorta con elegancia en pantallas muy estrechas */
  .navbar-logo-text { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
}
/* Pantallas muy estrechas: prioridad absoluta al ícono + burger */
@media (max-width: 380px) {
  .navbar-logo-text { font-size: 17px; }
  .navbar-logo-sub  { display: none; }
  .navbar-inner { padding: 0 12px; }
}

/* ── Online users dropdown ── */
.nav-online-wrap {
  position: relative;
}
.nav-online {
  background: none;
  border: 1px solid rgba(0,232,120,0.2);
  cursor: pointer;
  font-family: var(--font-mono);
  font-size: 11px;
  color: #00e878;
  padding: 4px 10px;
  border-radius: 20px;
  background: rgba(0,232,120,0.08);
  display: flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
  transition: background var(--transition);
}
.nav-online:hover { background: rgba(0,232,120,0.15); }

.nav-online-dropdown {
  display: none;
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 12px 16px;
  min-width: 200px;
  box-shadow: 0 8px 30px rgba(0,0,0,0.5);
  z-index: 200;
}
.nav-online-dropdown.show { display: block; }
.nav-online-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
  padding: 5px 0;
  color: var(--text-muted);
  gap: 16px;
}
.nav-online-row span:last-child {
  font-family: var(--font-mono);
  color: var(--text-primary);
}
.nav-online-divider {
  height: 1px;
  background: var(--border);
  margin: 6px 0;
}
