/* Public navigation, shared by community pages and the player portal. */
.beybapp-header.public-topbar {
  --nav-header-height: 156px;
  position: sticky; top: 0; z-index: 60;
  display: grid; grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center; gap: 0 26px; height: auto; min-height: 76px;
  width: 100%; max-width: 1440px; margin: 0 auto; padding: 12px 28px;
  border-bottom: 1px solid #273953; background: rgba(8,15,28,.98);
  backdrop-filter: blur(18px);
}
.beybapp-header *, .beybapp-header *::before, .beybapp-header *::after { box-sizing: border-box; }
.beybapp-header .beybapp-brand { grid-column: 1; grid-row: 1; width: 212px; min-width: 0; flex: initial; }
.beybapp-header .beybapp-brand img { display: block; width: 100%; height: auto; }
.beybapp-header .beybapp-primary-nav { display: flex; justify-content: center; align-items: center; gap: 4px; min-width: 0; margin: 0; padding: 0; }
.beybapp-header summary { list-style: none; cursor: pointer; }
.beybapp-header summary::-webkit-details-marker { display: none; }
.beybapp-header .nav-primary-link {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 44px; padding: 10px 14px; border: 1px solid transparent;
  border-radius: 10px; color: #b7c9df; font-size: 14px; font-weight: 700; white-space: nowrap;
}
.beybapp-header .nav-primary-link:hover, .beybapp-header .nav-primary-link.is-active { background: #172b45; color: #f5f9ff; border-color: #345579; }
.beybapp-header .nav-chevron { flex: 0 0 auto; transition: transform .15s ease; }
.beybapp-header details[open] > summary > .nav-chevron { transform: rotate(180deg); }
.beybapp-header .beybapp-account { grid-column: 3; grid-row: 1; display: flex; align-items: center; gap: 8px; min-width: 0; margin: 0; padding: 0; border: 0; background: none; box-shadow: none; }
.beybapp-header .beybapp-account-link { display: flex; align-items: center; justify-content: center; gap: 8px; min-height: 42px; max-width: 190px; padding: 9px 12px; border: 1px solid #3e6088; border-radius: 11px; background: #152943; color: #eef7ff; font-size: 13px; font-weight: 700; }
.beybapp-header .beybapp-account-guest .beybapp-account-link { background: linear-gradient(115deg,#1e527e,#443c80); border-color: #5788b3; }
.beybapp-header .beybapp-account-link svg { flex: 0 0 auto; }
.beybapp-header .beybapp-account-name { display: block; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.beybapp-header .beybapp-notification-bell { flex: 0 0 auto; width: 40px; min-width: 40px; height: 40px; min-height: 40px; }
.beybapp-header .beybapp-menu { display: none; }
.beybapp-header .community-context { grid-column: 1 / -1; display: flex; align-items: center; gap: 24px; min-width: 0; padding-top: 9px; margin-top: 10px; border-top: 1px solid #23374f; }
.beybapp-header .community-switcher { flex: 0 0 auto; position: relative; max-width: 270px; }
.beybapp-header .community-switcher > summary { display: flex; align-items: center; gap: 8px; min-height: 38px; padding: 4px 10px; border: 1px solid #355578; border-radius: 10px; background: #132841; color: #e7f4ff; font-size: 13px; font-weight: 750; }
.beybapp-header .community-switcher > summary > span:not(.community-logo) { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.beybapp-header .community-switcher .community-logo { position: static; width: 27px; height: 27px; flex: 0 0 auto; }
.beybapp-header .community-switcher-panel { position: absolute; left: 0; top: calc(100% + 8px); z-index: 90; display: grid; gap: 3px; width: 260px; padding: 8px; border: 1px solid #405e82; border-radius: 13px; background: #0d1b2e; box-shadow: 0 20px 50px rgba(0,0,0,.4); }
.beybapp-header .community-switcher-panel a { display: flex; align-items: center; gap: 10px; min-height: 44px; padding: 8px 10px; border-radius: 8px; color: #c7daef; font-size: 13px; }
.beybapp-header .community-switcher-panel a:hover, .beybapp-header .community-switcher-panel a.is-selected { background: #1c3654; color: white; }
.beybapp-header .community-section-nav { display: flex; gap: 6px; flex: 1; min-width: 0; margin: 0; padding: 0; overflow-x: auto; overscroll-behavior-x: contain; scrollbar-width: none; }
.beybapp-header .community-section-nav::-webkit-scrollbar { display: none; }
.beybapp-header .community-section-nav a { flex: 0 0 auto; min-height: 40px; display: flex; align-items: center; padding: 8px 12px; border-radius: 9px; color: #98aec9; font-size: 12px; font-weight: 700; white-space: nowrap; }
.beybapp-header .community-section-nav a:hover, .beybapp-header .community-section-nav a.is-active { color: #f2f8ff; background: #1b3350; }
.beybapp-header a:focus-visible, .beybapp-header button:focus-visible, .beybapp-header summary:focus-visible { outline: 3px solid #8fd2ff; outline-offset: 3px; }
@media (max-width: 1099px) {
  .beybapp-header.public-topbar { grid-template-columns: minmax(0,1fr) auto auto; gap: 0 10px; min-height: 68px; padding: 10px 18px; }
  .beybapp-header .beybapp-brand { width: 200px; }
  .beybapp-header .beybapp-primary-nav { display: none !important; }
  .beybapp-header .beybapp-account { grid-column: 2; }
  .beybapp-header .beybapp-menu { display: block; position: static; grid-column: 3; grid-row: 1; justify-self: end; margin: 0; }
  .beybapp-header .beybapp-menu > summary { display: flex; align-items: center; justify-content: center; gap: 7px; min-height: 42px; width: auto; height: auto; padding: 9px 12px; border: 1px solid #3c5b7e; border-radius: 11px; background: #162b44; color: #edf5ff; font-size: 13px; box-shadow: none; }
  .beybapp-header .beybapp-menu > summary b { font-weight: 700; }
  .beybapp-header .beybapp-menu[open] > summary { border-color: #78aed9; background: #204365; }
  .beybapp-header .beybapp-menu-panel { position: absolute; left: 12px; right: 12px; top: calc(100% + 8px); z-index: 90; display: block; width: auto; max-height: calc(100dvh - var(--nav-header-height) - 20px); overflow-y: auto; overscroll-behavior: contain; margin: 0; padding: 12px; border: 1px solid #456488; border-radius: 18px; background: #0c1a2d; box-shadow: 0 24px 64px rgba(0,0,0,.5); }
  .beybapp-header .nav-mobile-heading { display: flex; align-items: center; justify-content: space-between; padding: 0 4px 7px 8px; color: #8faac7; font-size: 11px; font-weight: 750; letter-spacing: .04em; text-transform: uppercase; }
  .beybapp-header .nav-mobile-heading button { display: grid; place-items: center; width: 36px; min-height: 36px; padding: 0; border: 1px solid #365372; border-radius: 9px; background: #162b44; color: #cfdef0; font-size: 25px; cursor: pointer; }
  .beybapp-header .nav-mobile-link { display: flex; align-items: center; justify-content: space-between; gap: 16px; width: 100%; min-height: 46px; padding: 11px 12px; border: 1px solid transparent; border-radius: 10px; color: #dceafb; font-size: 14px; font-weight: 700; }
  .beybapp-header .nav-mobile-link + .nav-mobile-link { margin-top: 3px; }
  .beybapp-header .nav-mobile-link > span:first-child { white-space: nowrap; }
  .beybapp-header .nav-mobile-link .nav-link-arrow { flex: 0 0 auto; color: #82aed6; }
  .beybapp-header .nav-mobile-link.is-active, .beybapp-header .nav-mobile-link:hover { border-color: #345579; background: #19324f; color: #f4f9ff; }
  .beybapp-header .community-context { gap: 12px; padding-top: 8px; margin-top: 8px; }
}
@media (max-width: 679px) {
  .beybapp-header.public-topbar { gap: 0 8px; padding: 9px 14px; min-height: 64px; }
  .beybapp-header .beybapp-brand { width: clamp(132px, 40vw, 190px); }
  .beybapp-header .beybapp-account-name { display: none; }
  .beybapp-header .beybapp-account-link { min-height: 40px; width: 40px; padding: 8px; border-radius: 10px; }
  .beybapp-header .beybapp-account { gap: 5px; }
  .beybapp-header .beybapp-notification-bell { width: 40px; min-width: 40px; height: 40px; }
  .beybapp-header .beybapp-menu > summary { min-height: 40px; padding: 8px 10px; }
  .beybapp-header .community-context { display: block; padding-top: 8px; margin-top: 7px; }
  .beybapp-header .community-switcher { max-width: 100%; width: max-content; }
  .beybapp-header .community-switcher > summary { min-height: 34px; font-size: 12px; padding: 3px 8px; }
  .beybapp-header .community-switcher .community-logo { width: 24px; height: 24px; }
  .beybapp-header .community-section-nav { display: flex !important; gap: 3px; margin-top: 4px; }
  .beybapp-header .community-section-nav a { min-height: 36px; font-size: 11px; padding: 8px 10px; }
}
@media (max-width: 359px) {
  .beybapp-header.public-topbar { gap: 0 6px; padding-left: 11px; padding-right: 11px; }
  .beybapp-header .beybapp-brand { width: 132px; }
  .beybapp-header .beybapp-menu > summary b { display: none; }
  .beybapp-header .beybapp-menu > summary { width: 40px; padding: 8px; }
}
@media (prefers-reduced-motion: reduce) { .beybapp-header .nav-chevron { transition: none; } }


/* Session actions stay outside the four-link menu at every viewport. */
.beybapp-header .beybapp-logout { margin:0; flex:0 0 auto; }
.beybapp-header .beybapp-logout button { display:inline-flex; align-items:center; justify-content:center; min-height:40px; padding:8px 11px; border:1px solid #526480; border-radius:10px; background:#18283e; color:#e5eefb; font:inherit; font-size:13px; font-weight:700; cursor:pointer; }
@media(max-width:679px) {
 .beybapp-header .beybapp-brand { width:min(40vw,156px); }
 .beybapp-header .beybapp-account-guest .beybapp-account-name { display:block; }
 .beybapp-header .beybapp-account-guest .beybapp-account-link { width:auto; gap:5px; padding:8px; }
 .beybapp-header .beybapp-account-guest .beybapp-account-link svg { display:none; }
 .beybapp-header .beybapp-notification-bell { width:36px; min-width:36px; }
 .beybapp-header .beybapp-logout button { padding:8px; font-size:12px; }
 .beybapp-header .beybapp-menu > summary b { display:none; }
 .beybapp-header .beybapp-menu > summary { width:40px; padding:8px; }
}
@media(max-width:359px) {
 .beybapp-header .beybapp-brand { width:110px; }
 .beybapp-header .beybapp-account { gap:3px; }
 .beybapp-header .beybapp-account-link { width:36px; }
}
