.nav {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 32px;
  height: 60px;
  border-bottom: 1px solid var(--glass-border);
  flex-shrink: 0;
}

.logo img {
  height: 32px;
  display: block;
}

/* ── Центральное меню (desktop) ───────────────────────────── */
.menu {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  display: flex;
  align-items: center;
  gap: 8px;
}

.menuLink {
  position: relative;
  padding: 8px 14px;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-secondary);
  text-decoration: none;
  border-radius: 8px;
  transition: color 0.15s, background 0.15s;
}

.menuLink:hover {
  color: var(--text-primary);
  background: var(--glass-bg);
}

.menuLinkActive {
  color: var(--text-primary);
}

.menuLinkActive::after {
  content: '';
  position: absolute;
  left: 14px;
  right: 14px;
  bottom: 0;
  height: 2px;
  border-radius: 2px;
  background: var(--interactive);
}

/* ── Правая часть ─────────────────────────────────────────── */
.right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.accountWrapper {
  position: relative;
}

.account {
  display: flex;
  align-items: center;
  gap: 10px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
}

.account span {
  color: var(--text-secondary);
  font-size: 14px;
  font-weight: 500;
}

.avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: linear-gradient(135deg, #3d2a8e, #5b3db8);
  flex-shrink: 0;
}

.dropdown {
  position: absolute;
  top: calc(100% + 12px);
  right: 0;
  background: var(--bg-card, #1a1a2e);
  border: 1px solid var(--glass-border);
  border-radius: 10px;
  overflow: hidden;
  min-width: 160px;
  z-index: 100;
  display: flex;
  flex-direction: column;
  animation: dropdownIn 0.16s ease;
}

@keyframes dropdownIn {
  from {
    opacity: 0;
    transform: translateY(-6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.dropdownItem {
  display: block;
  padding: 12px 16px;
  font-size: 14px;
  color: var(--text-secondary);
  text-decoration: none;
  background: none;
  border: none;
  cursor: pointer;
  text-align: left;
  width: 100%;
  transition: background 0.15s, color 0.15s;
}

.dropdownItem:hover {
  background: var(--glass-border);
  color: var(--text-primary);
}

.dropdownItem.danger:hover {
  color: var(--error);
}

/* ── Бургер ───────────────────────────────────────────────── */
.burger {
  display: none;
  position: relative;
  width: 28px;
  height: 22px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  z-index: 1100; /* выше полноэкранного меню — крестик всегда сверху */
}

/* Все три полоски позиционируются по одной модели (top: 50% + translate),
   чтобы рендер был идентичным и они не выглядели по-разному. */
.burger span {
  position: absolute;
  left: 0;
  top: 50%;
  width: 100%;
  height: 2px;
  border-radius: 2px;
  background: var(--text-primary);
  transition: transform 0.3s ease, opacity 0.2s ease;
}

.burger span:nth-child(1) {
  transform: translateY(-50%) translateY(-8px);
}

.burger span:nth-child(2) {
  transform: translateY(-50%);
}

.burger span:nth-child(3) {
  transform: translateY(-50%) translateY(8px);
}

.burgerOpen span:nth-child(1) {
  transform: translateY(-50%) rotate(45deg);
}

.burgerOpen span:nth-child(2) {
  transform: translateY(-50%) scaleX(0);
  opacity: 0;
}

.burgerOpen span:nth-child(3) {
  transform: translateY(-50%) rotate(-45deg);
}

/* ── Мобильное меню (на весь экран, поверх шапки) ──────────── */
.mobileMenu {
  display: none;
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  flex-direction: column;
  justify-content: center;
  gap: 8px;
  padding: 80px 24px 40px;
  background: var(--bg-deep);
  z-index: 1000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.mobileMenuOpen {
  opacity: 1;
  pointer-events: auto;
}

.mobileLink {
  display: block;
  padding: 16px;
  font-size: 20px;
  font-weight: 600;
  color: var(--text-secondary);
  text-decoration: none;
  background: none;
  border: none;
  border-radius: 12px;
  cursor: pointer;
  text-align: center;
  width: 100%;
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.3s ease, transform 0.3s ease, background 0.15s, color 0.15s;
}

.mobileMenuOpen .mobileLink {
  opacity: 1;
  transform: translateY(0);
}

.mobileLink:hover {
  background: var(--glass-bg);
  color: var(--text-primary);
}

.mobileLinkActive {
  color: var(--text-primary);
  background: var(--glass-bg);
}

.mobileLink.danger {
  margin-top: 8px;
  color: var(--error);
}

/* ── Адаптив ──────────────────────────────────────────────── */
@media (max-width: 900px) {
  .nav {
    padding: 0 16px;
  }
}

@media (max-width: 768px) {
  .menu {
    display: none;
  }

  .account span {
    display: none;
  }

  .burger {
    display: block;
  }

  .mobileMenu {
    display: flex;
  }
}
