.side-nav,
.side-nav * {
  box-sizing: border-box;
}

.side-nav {
  position: fixed;
  inset: 0 auto 0 0;
  width: 248px;
  height: 100vh;
  min-height: 0;
  padding: 26px 18px;
  z-index: 5;
  display: flex;
  flex-direction: column;
  gap: 14px;
  background: linear-gradient(180deg, rgba(17, 26, 32, 0.96), rgba(11, 16, 20, 0.98));
  border-right: 1px solid #31434a;
  box-shadow: 18px 0 42px rgba(0, 0, 0, 0.32);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 15px;
  overflow-y: auto;
  scrollbar-color: #54c6d2 rgba(8, 13, 17, 0.7);
  scrollbar-width: thin;
}

.home-link {
  display: block;
  min-height: 38px;
  padding: 8px 11px;
  background: #d99a37;
  color: #10100e;
  font-weight: 800;
  font-size: 15px;
  line-height: 1.42;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  text-decoration: none;
}

.login-link,
.logout-form {
  margin-top: auto;
  flex-shrink: 0;
}

.logout-form {
  display: block;
}

.logout-button {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  width: 100%;
  min-height: 38px;
  padding: 4px 8px 4px 11px;
  color: #10100e;
  background: #d99a37;
  border: 0;
  font: inherit;
  font-weight: 800;
  font-size: 15px;
  line-height: 1.42;
  text-align: left;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  cursor: pointer;
}

.logout-session-icon {
  display: block;
  width: 30px;
  height: 30px;
  justify-self: end;
  object-fit: contain;
  opacity: 0.94;
  filter: brightness(0.82) saturate(0.92) contrast(1.16) drop-shadow(0 0 2px rgba(16, 16, 14, 0.48));
}

.logout-button:hover {
  background: #b97822;
}

.logout-button:hover .logout-session-icon {
  opacity: 1;
}

.home-link:hover,
.brand:hover {
  background: #b97822;
}

.brand {
  display: block;
  width: 100%;
  min-height: 38px;
  padding: 8px 11px;
  background: #d99a37;
  color: #10100e;
  border: 1px solid transparent;
  font: inherit;
  font-weight: 800;
  font-size: 15px;
  line-height: 1.42;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  text-align: left;
  cursor: pointer;
  text-decoration: none;
}

.side-nav > .home-link,
.side-nav > .brand {
  font-weight: 800;
  font-synthesis: weight;
}

.navlinks a > span,
.nav-starmap > span {
  font-weight: 700;
  font-synthesis: weight;
}

.side-nav.games-open .games-toggle,
.side-nav.server-open .server-toggle,
.side-nav.apps-open .apps-toggle {
  background: #10100e;
  color: #d99a37;
  border-color: #d99a37;
}

.games-panel,
.server-panel,
.apps-panel {
  display: grid;
  gap: 8px;
  min-width: 0;
  overflow: visible;
  max-height: 2000px;
  min-height: max-content;
  flex-shrink: 0;
  flex-basis: auto;
  opacity: 1;
  transform: translateY(0);
  transition: max-height 190ms ease, opacity 160ms ease, transform 190ms ease;
}

.side-nav:not(.games-open) .games-panel,
.side-nav:not(.server-open) .server-panel,
.side-nav:not(.apps-open) .apps-panel {
  max-height: 0;
  opacity: 0;
  transform: translateY(-12px);
  pointer-events: none;
  display: none;
}

.navlinks {
  display: grid;
  gap: 8px;
  color: #eef7f8;
  font-size: 15px;
}

.navlinks a {
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr);
  gap: 8px;
  align-items: center;
  min-height: 36px;
  padding: 7px 9px;
  border-left: 2px solid transparent;
  color: inherit;
  text-decoration: none;
}

.navlinks a span {
  color: #d99a37;
  font-family: "Cascadia Mono", Consolas, monospace;
  font-size: 0.72rem;
}

.navlinks a:hover {
  color: #eef7f8;
  background: rgba(84, 198, 210, 0.12);
  border-left-color: #54c6d2;
}

.apps-panel .server-app-link.is-active-app {
  color: #f4e6cc;
  background: rgba(154, 92, 24, 0.22);
  border-left-color: #c98224;
}

.apps-panel .server-app-link.is-active-app:hover {
  background: rgba(154, 92, 24, 0.3);
  border-left-color: #d99a37;
}

.nav-starmap {
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr);
  gap: 8px;
  align-items: center;
  min-height: 38px;
  padding: 8px 9px;
  color: #eef7f8;
  background: rgba(84, 198, 210, 0.12);
  border: 1px solid rgba(84, 198, 210, 0.25);
  border-left: 2px solid transparent;
  font: inherit;
  font-size: 15px;
  line-height: 1.42;
  text-align: left;
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
}

.nav-starmap span {
  color: #d99a37;
  font-family: "Cascadia Mono", Consolas, monospace;
  font-size: 0.72rem;
  font-weight: 700;
}


.side-nav.menu-open .nav-game-starfield,
.side-nav.oncehuman-open .nav-game-oncehuman {
  background: rgba(84, 198, 210, 0.2);
  border-color: rgba(84, 198, 210, 0.46);
  border-left-color: #54c6d2;
}

.game-submenu {
  margin-left: 4px;
  padding-left: 8px;
  min-width: 0;
}

.game-submenu .nav-starmap {
  width: 100%;
}
.nav-mods,
.nav-projects,
.nav-external-links,
.nav-documentation,
.nav-installation,
.nav-maintenance {
  border-left-color: #54c6d2;
}

.nav-starmap:hover {
  background: rgba(217, 154, 55, 0.16);
  border-color: rgba(217, 154, 55, 0.42);
}

.submenu {
  display: grid;
  gap: 4px;
  margin-left: 8px;
  padding-left: 8px;
  min-width: 0;
  border-left: 1px solid rgba(84, 198, 210, 0.28);
  overflow: hidden;
  max-height: 420px;
  min-height: max-content;
  flex-shrink: 0;
  flex-basis: auto;
  transition: max-height 180ms ease, opacity 160ms ease;
}

.submenu.is-open {
  max-height: 2000px;
  overflow: visible;
}

.submenu:not(.is-open) {
  max-height: 0;
  opacity: 0;
  pointer-events: none;
  display: none;
}

.submenu a {
  display: block;
  min-height: 34px;
  padding: 7px 9px;
  color: #9fb1b5;
  border-left: 2px solid transparent;
  background: rgba(84, 198, 210, 0.06);
  text-decoration: none;
  font-size: 15px;
  line-height: 1.42;
  white-space: nowrap;
}



.submenu a.server-document-link {
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr);
  gap: 8px;
  align-items: center;
}
.submenu a.server-document-link.plain-menu-link {
  display: block;
}
.submenu a.server-app-link {
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr);
  gap: 8px;
  align-items: center;
}

.server-app-menu-icon {
  display: block;
  width: 24px;
  height: 24px;
  justify-self: center;
  object-fit: contain;
  transform: translateY(2px);
}

.server-app-menu-icon--domseye {
  width: 28px;
  height: 20px;
  object-fit: cover;
  object-position: center;
}

.submenu .nav-starmap {
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr);
  gap: 8px;
  align-items: center;
  min-height: 38px;
  padding: 8px 9px;
  color: #eef7f8;
  background: rgba(84, 198, 210, 0.12);
  border: 1px solid rgba(84, 198, 210, 0.25);
  border-left: 2px solid transparent;
}
.submenu .nav-starmap:hover {
  background: rgba(217, 154, 55, 0.16);
  border-color: rgba(217, 154, 55, 0.42);
}
.submenu.nested-submenu {
  width: 100%;
  max-width: 100%;
  margin-left: 0;
  padding-left: 8px;
  justify-self: stretch;
}

.submenu.nested-submenu > a {
  width: 100%;
  max-width: 100%;
  min-width: 0;
}

.submenu a:hover {
  color: #eef7f8;
  background: rgba(84, 198, 210, 0.12);
  border-left-color: #54c6d2;
}

.side-nav a.is-scroll-active,
.side-nav a.nav-starmap.is-scroll-active {
  color: #dce9df;
  background: rgba(75, 119, 80, 0.22);
  border-left-color: rgba(116, 164, 120, 0.86);
}

.side-nav a.nav-starmap.is-scroll-active {
  border-color: rgba(94, 143, 99, 0.38);
  border-left-color: rgba(116, 164, 120, 0.86);
}

.side-nav a.is-scroll-active:hover,
.side-nav a.nav-starmap.is-scroll-active:hover {
  color: #f0f6f1;
  background: rgba(75, 119, 80, 0.3);
}

.menu-scroll-progress[hidden] {
  display: none;
}

.menu-scroll-progress {
  display: grid;
  gap: 5px;
  margin: 8px 4px 2px;
  padding: 8px 9px;
  color: #9eb3a1;
  background: rgba(7, 16, 11, 0.72);
  border: 1px solid rgba(101, 151, 106, 0.24);
  border-radius: 4px;
}

.menu-scroll-progress-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  font-family: "Cascadia Mono", Consolas, monospace;
  font-size: 0.68rem;
  line-height: 1.2;
  text-transform: uppercase;
}

.menu-scroll-progress-meta output {
  color: #82a987;
  font: inherit;
}

.menu-scroll-progress-track {
  height: 6px;
  overflow: hidden;
  background: rgba(17, 31, 20, 0.88);
  border: 1px solid rgba(101, 151, 106, 0.18);
  border-radius: 4px;
}

.menu-scroll-progress-track > span {
  display: block;
  width: 0;
  height: 100%;
  background: rgba(101, 151, 106, 0.72);
  border-radius: inherit;
  box-shadow: 0 0 8px rgba(101, 151, 106, 0.18);
  transition: width 100ms linear;
}

@media (max-width: 1040px) {
  .side-nav {
    position: sticky;
    top: 0;
    width: 100%;
    height: 100vh;
    min-height: 0;
    padding: 14px clamp(18px, 4vw, 56px);
    background: rgba(11, 16, 20, 0.94);
    border-right: 0;
    border-bottom: 1px solid #31434a;
    backdrop-filter: blur(12px);
  }

  .home-link { align-self: flex-start; }

  .navlinks {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
  }

  .navlinks a,
  .nav-starmap {
    grid-template-columns: auto minmax(0, 1fr);
    min-height: 36px;
    padding: 7px 9px;
    border-left: 0;
    border-bottom: 2px solid transparent;
  }

  .nav-mods,
  .nav-external-links { border-bottom-color: #54c6d2; }

  .nav-maintenance,
  .nav-projects { border-bottom-color: #54c6d2; }

  .navlinks a:hover,
  .nav-starmap:hover { border-bottom-color: #54c6d2; }

  .side-nav a.is-scroll-active,
  .side-nav a.nav-starmap.is-scroll-active {
    border-left: 0;
    border-bottom-color: rgba(116, 164, 120, 0.86);
  }

  .submenu {
    flex-basis: 100%;
    margin-left: 10px;
  }

  .menu-scroll-progress {
    flex: 0 0 100%;
    width: min(260px, 100%);
  }
}

@media (max-width: 560px) {
  .side-nav { gap: 14px; }

  .navlinks a span,
  .nav-starmap span { display: none; }
}













