/* Shared logged-in navigation treatment. Keep the avatar visible while the
   account label yields space to Chat, language, and social controls. */
.nav-profile-wrapper {
  position: relative;
  width: clamp(124px, 12vw, 156px);
  min-width: 124px;
  max-width: 156px;
  flex: 0 0 clamp(124px, 12vw, 156px);
}

.nav-user-slot .nav-profile-wrapper,
#profileDropdownWrapper {
  width: clamp(124px, 12vw, 156px);
  min-width: 124px;
  max-width: 156px;
  flex: 0 0 clamp(124px, 12vw, 156px);
}

.nav-user-slot .nav-profile-trigger,
#profileDropdownWrapper .nav-profile-trigger {
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  gap: 7px;
  width: 100%;
  min-width: 0;
  max-width: 156px;
  height: 38px;
  min-height: 38px;
  flex: 1 1 auto;
  padding: 4px 8px 4px 5px;
  overflow: hidden;
}

.nav-profile-trigger .profile-avatar {
  width: 28px;
  height: 28px;
  flex: 0 0 28px;
}

.nav-profile-trigger .profile-name,
.nav-profile-trigger > span[id="profileNameNav"] {
  min-width: 0;
  max-width: 100%;
  flex: 1 1 auto;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-align: left;
}

.nav-profile-trigger .profile-dropdown-arrow {
  flex: 0 0 auto;
  margin-left: auto;
}

.mobile-nav-user-summary {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  min-height: 48px;
  padding: 9px 12px;
  border: 1px solid rgba(237, 77, 149, 0.24);
  border-radius: 14px;
  color: rgba(255,255,255,.92);
  background: rgba(237, 77, 149, 0.08);
}

.mobile-nav-user-summary .profile-avatar {
  width: 32px;
  height: 32px;
  flex: 0 0 32px;
}

.mobile-nav-user-summary__name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 13px;
  font-weight: 700;
}

@media (max-width: 1180px) {
  .nav-profile-wrapper,
  .nav-user-slot .nav-profile-wrapper,
  #profileDropdownWrapper {
    width: 124px;
    min-width: 124px;
    flex-basis: 124px;
  }

  .nav-user-slot .nav-profile-trigger,
  #profileDropdownWrapper .nav-profile-trigger {
    width: 100%;
    min-width: 0;
  }
}

@media (max-width: 768px) {
  /* Logged-in mobile menu order: account first, then social links, then
     language choices. The direct-link selectors cover the account page,
     while the cluster selectors cover home and character pages. */
  .mobile-nav-menu > #mobileNavUserGroup {
    order: 1;
  }

  .mobile-nav-menu > .mobile-nav-social-cluster,
  .mobile-nav-menu > .mobile-nav-item--creator,
  .mobile-nav-menu > .mobile-nav-item--discord,
  .mobile-nav-menu > .mobile-nav-item--telegram,
  .mobile-nav-menu > .mobile-nav-item.twitter-btn {
    order: 2;
  }

  .mobile-nav-menu > .mobile-nav-language-cluster,
  .mobile-nav-menu > .mobile-language-group {
    order: 3;
  }

  .mobile-nav-menu > #mobileLoginBtn {
    order: 4;
  }

  .nav-profile-wrapper,
  .nav-user-slot .nav-profile-wrapper,
  #profileDropdownWrapper,
  .nav-user-slot .nav-profile-trigger,
  #profileDropdownWrapper .nav-profile-trigger {
    width: auto;
    min-width: 0;
    flex: 0 1 auto;
    max-width: none;
  }

  /* Keep a small avatar trigger visible in the mobile/chat header after
     login. The long label remains available inside the menu. */
  .nav .nav-right > #profileDropdownWrapper.is-authenticated {
    display: inline-flex !important;
    width: 34px;
    max-width: 34px;
    min-width: 34px;
  }

  .nav .nav-right > #profileDropdownWrapper.is-authenticated .nav-profile-trigger {
    width: 34px !important;
    min-width: 34px !important;
    max-width: 34px !important;
    height: 34px;
    min-height: 34px;
    padding: 2px;
    justify-content: center;
    gap: 0;
  }

  .nav .nav-right > #profileDropdownWrapper.is-authenticated .nav-profile-trigger .profile-name,
  .nav .nav-right > #profileDropdownWrapper.is-authenticated .nav-profile-trigger .profile-dropdown-arrow {
    display: none;
  }
}
