/* ======================== */
/* == Site navigation == */

.site-nav {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 0 24px;
  height: 56px;

  position: sticky;
  top: 0;
  z-index: 100;

  background-color: rgba(6, 8, 12, 0.82);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.4);
}

/* Brand */
.site-nav .nav-brand {
  font-family: 'Orbitron', 'Inter', sans-serif;
  font-size: 0.95rem;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: #fff;
  text-decoration: none;
  white-space: nowrap;
  margin-right: 20px;
  transition: color 0.15s, text-shadow 0.15s;
}

.site-nav .nav-brand:hover {
  color: #9ecbff;
  text-shadow: 0 0 18px rgba(122, 178, 255, 0.45);
}

/* Link cluster */
.site-nav .nav-links {
  display: flex;
  align-items: center;
  gap: 4px;
}

/* Base link / trigger button (shared) */
.site-nav .nav-link {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 12px;
  border: none;
  border-radius: 8px;
  background: none;
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.72);
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  transition: background-color 0.15s, color 0.15s;
}

.site-nav .nav-link:hover {
  background-color: rgba(255, 255, 255, 0.1);
  color: #fff;
}

.site-nav .nav-link.is-active {
  color: #fff;
  background-color: rgba(255, 255, 255, 0.07);
  box-shadow: inset 0 -2px 0 rgba(122, 178, 255, 0.85);
}

/* ========================== */
/* == Games dropdown == */

.site-nav .nav-dropdown {
  position: relative;
}

.site-nav .nav-caret {
  color: inherit;
  transition: transform 0.15s ease;
}

.site-nav .nav-dropdown.is-open .nav-caret {
  transform: rotate(180deg);
}

.site-nav .nav-dropdown-menu {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  min-width: 220px;
  padding: 6px;
  display: flex;
  flex-direction: column;
  gap: 2px;

  background-color: #0f141b;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.55);

  opacity: 0;
  visibility: hidden;
  transform: translateY(-6px);
  transition: opacity 0.16s ease, transform 0.16s ease, visibility 0.16s;
  z-index: 130;
}

.site-nav .nav-dropdown.is-open .nav-dropdown-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.site-nav .nav-dropdown-item {
  display: block;
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 0.9rem;
  color: rgba(255, 255, 255, 0.75);
  text-decoration: none;
  transition: background-color 0.15s, color 0.15s;
}

.site-nav .nav-dropdown-item:hover {
  background-color: rgba(255, 255, 255, 0.08);
  color: #fff;
}

.site-nav .nav-dropdown-item.is-active {
  color: #fff;
  font-weight: 600;
  background-color: rgba(122, 178, 255, 0.12);
}

/* ========================== */
/* == Right side: user + auth == */

.site-nav .nav-right {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 8px;
}

.site-nav .nav-user {
  font-size: 0.8rem;
  color: rgba(255, 255, 255, 0.5);
  max-width: 200px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ========================== */
/* == Mobile toggle (hidden on desktop) == */

.site-nav .nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 4px;
  width: 38px;
  height: 38px;
  padding: 8px;
  border: none;
  border-radius: 8px;
  background: none;
  cursor: pointer;
}

.site-nav .nav-toggle-bar {
  display: block;
  height: 2px;
  width: 100%;
  border-radius: 2px;
  background-color: rgba(255, 255, 255, 0.85);
  transition: background-color 0.15s;
}

.site-nav .nav-toggle:hover .nav-toggle-bar {
  background-color: #fff;
}

/* ========================== */
/* == Responsive == */

@media (max-width: 820px) {
  .site-nav {
    padding: 0 16px;
  }

  .site-nav .nav-toggle {
    display: flex;
    margin-left: auto;
  }

  .site-nav .nav-right {
    margin-left: 0;
  }

  /* Links collapse into a panel below the bar */
  .site-nav .nav-links {
    position: absolute;
    top: 56px;
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 2px;
    padding: 8px 16px 14px;
    display: none;

    background-color: rgba(6, 8, 12, 0.98);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 16px 32px rgba(0, 0, 0, 0.5);
  }

  .site-nav .nav-links.is-open {
    display: flex;
  }

  .site-nav .nav-link {
    padding: 10px 12px;
    font-size: 0.95rem;
  }

  /* Dropdown becomes an inline list on mobile */
  .site-nav .nav-dropdown {
    display: flex;
    flex-direction: column;
  }

  .site-nav .nav-dropdown-menu {
    position: static;
    min-width: 0;
    padding: 0 0 2px 8px;
    border: none;
    box-shadow: none;
    background: none;
    gap: 0;
    display: none;
    opacity: 1;
    visibility: visible;
    transform: none;
  }

  .site-nav .nav-dropdown.is-open .nav-dropdown-menu {
    display: flex;
  }

  /* Hide user email on very small screens */
  @media (max-width: 480px) {
    .site-nav .nav-user {
      display: none;
    }
  }
}
