/* Site layout and navigation helpers. */
[hidden] {
  display: none !important;
}

.site-brand {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  min-width: 0;
  text-decoration: none;
  white-space: nowrap;
}

.site-brand-mark,
.era-switcher-mark,
.era-switcher-fallback,
.site-brand-fallback,
.m-era-switch__logo,
.m-era-switch__logo span {
  display: grid;
  place-items: center;
}

.site-brand-mark {
  width: 2rem;
  height: 2rem;
  border-radius: 999px;
  border: 1px solid rgba(255, 0, 144, 0.35);
  background: rgba(255, 0, 144, 0.08);
  overflow: hidden;
  flex: 0 0 auto;
}

.site-brand-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.site-brand .font-display {
  line-height: 1;
  white-space: nowrap;
}

.site-brand-fallback {
  width: 100%;
  height: 100%;
  color: #ff4db8;
  font-family: "Share Tech Mono", monospace;
  font-size: 0.68rem;
  letter-spacing: 0.04em;
}

.era-switcher {
  align-items: center;
  gap: 0.5rem;
  color: #e5e5e5;
  text-decoration: none;
  height: 2.35rem;
  max-width: 9.5rem;
  padding: 0.25rem 0.65rem 0.25rem 0.35rem;
  border: 1px solid rgba(124, 58, 237, 0.4);
  border-radius: 999px;
  background: #111111;
  flex: 0 0 auto;
  overflow: hidden;
  transition: border-color 0.15s, background 0.15s;
}

.era-switcher:hover,
.era-switcher:focus-visible {
  border-color: rgba(255, 0, 144, 0.45);
  background: rgba(255, 0, 144, 0.08);
}

.era-switcher-logo,
.m-era-switch__logo img,
.m-era-switch__image {
  width: 1.55rem;
  height: 1.55rem;
  border-radius: 999px;
  object-fit: cover;
  flex: 0 0 auto;
}

.era-switcher-logo--image,
.m-era-switch__image {
  display: grid;
  place-items: center;
  overflow: hidden;
  background-color: rgba(255, 0, 144, 0.12);
  background-position: center;
  background-repeat: no-repeat;
  background-size: cover;
  border: 1px solid rgba(255, 0, 144, 0.28);
  color: transparent;
}

.era-switcher-logo--image .era-switcher-fallback {
  opacity: 0;
}

.era-switcher-fallback {
  width: 1.55rem;
  height: 1.55rem;
  border-radius: 999px;
  color: #ff4db8;
  background: rgba(255, 0, 144, 0.12);
  border: 1px solid rgba(255, 0, 144, 0.28);
  font-family: "Share Tech Mono", monospace;
  font-size: 0.62rem;
}

.era-switcher-copy {
  display: flex;
  flex-direction: column;
  min-width: 0;
  line-height: 1.05;
  overflow: hidden;
}

.era-switcher-copy span,
.m-era-switch__status {
  color: #6b7280;
  font-family: "Share Tech Mono", monospace;
  font-size: 0.6rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.era-switcher-copy strong {
  color: #e5e5e5;
  font-size: 0.88rem;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.nav-bar .max-w-7xl {
  gap: 0.75rem;
}

.nav-bar .nav-link,
.nav-character-link,
.nav-user-name {
  white-space: nowrap;
}

.nav-user-name {
  display: inline-block;
  max-width: 6rem;
  overflow: hidden;
  text-overflow: ellipsis;
  vertical-align: middle;
}

@media (max-width: 1360px) {
  .nav-bar .nav-link {
    padding-left: 0.6rem;
    padding-right: 0.6rem;
    font-size: 0.82rem;
  }

  .nav-bar .role-badge {
    display: none;
  }

  .nav-character-link {
    display: none !important;
  }
}

#mobile-menu {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 40;
  background: rgba(0, 0, 0, 0.95);
  flex-direction: column;
  padding: 5rem 2rem 2rem;
  gap: 0.25rem;
  overflow-y: auto;
}

#mobile-menu.open {
  display: flex;
}

#mobile-menu .m-nav-link {
  display: block;
  padding: 0.85rem 1rem;
  color: #9ca3af;
  font-size: 1rem;
  font-family: "Rajdhani", sans-serif;
  font-weight: 600;
  border-radius: 8px;
  border: 1px solid transparent;
  transition: all 0.15s;
  letter-spacing: 0.04em;
}

#mobile-menu .m-nav-link:hover,
#mobile-menu .m-nav-link.active {
  color: #ff0090;
  border-color: rgba(255, 0, 144, 0.2);
  background: rgba(255, 0, 144, 0.05);
}

#mobile-menu .m-nav-section {
  font-size: 0.65rem;
  color: #4b5563;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-family: "Share Tech Mono", monospace;
  padding: 1rem 1rem 0.25rem;
}

#mobile-menu .m-user-card {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1rem;
  background: #1a1a1a;
  border: 1px solid #2d2d2d;
  border-radius: 10px;
  margin-bottom: 1rem;
}

.m-era-switch {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.75rem;
  align-items: center;
  padding: 0.9rem 1rem;
  margin-bottom: 0.5rem;
  border: 1px solid rgba(255, 0, 144, 0.25);
  border-radius: 8px;
  background: rgba(255, 0, 144, 0.06);
  color: #e5e5e5;
  text-decoration: none;
}

.m-era-switch:hover {
  border-color: rgba(255, 0, 144, 0.45);
}

.m-era-switch__logos {
  display: flex;
  align-items: center;
}

.m-era-switch__logo {
  width: 2rem;
  height: 2rem;
  border-radius: 999px;
  border: 1px solid #2d2d2d;
  background: #111111;
  overflow: hidden;
}

.m-era-switch__logo + .m-era-switch__logo {
  margin-left: -0.35rem;
}

.m-era-switch__logo span {
  width: 100%;
  height: 100%;
  color: #ff4db8;
  font-family: "Share Tech Mono", monospace;
  font-size: 0.68rem;
}

.m-era-switch__image {
  width: 100%;
  height: 100%;
  color: transparent;
  font-family: "Share Tech Mono", monospace;
  font-size: 0.68rem;
}

.m-era-switch strong {
  display: block;
  font-size: 1rem;
  line-height: 1.1;
}

.m-era-switch__action {
  grid-column: 1 / -1;
  color: #a855f7;
  font-family: "Share Tech Mono", monospace;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

#mobile-menu .m-nav-link--admin {
  color: #ff0090;
}

#mobile-menu .m-nav-link--accent {
  color: #a855f7;
}

#mobile-menu .m-nav-link--muted {
  color: #6b7280;
}

.era-nav {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  padding: 0.75rem;
  border: 1px solid #2d2d2d;
  border-radius: 8px;
  background: #111111;
}

.era-nav-label {
  color: #6b7280;
  font-family: "Share Tech Mono", monospace;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-right: 0.25rem;
}

.era-nav a {
  color: #9ca3af;
  border: 1px solid #2d2d2d;
  border-radius: 6px;
  padding: 0.35rem 0.65rem;
  font-size: 0.82rem;
  font-weight: 600;
  transition: color 0.15s, border-color 0.15s, background 0.15s;
}

.era-nav a:hover,
.era-nav a.active {
  color: #ff0090;
  border-color: rgba(255, 0, 144, 0.45);
  background: rgba(255, 0, 144, 0.06);
}

.era-footer-link {
  color: #6b7280;
  transition: color 0.15s;
}

.era-footer-link:hover {
  color: #a855f7;
}
