/* FMHY adds more categories than the legacy single-row launcher supported. */
#categoryMenu.menu-category {
  justify-content: center;
  flex-wrap: wrap;
  gap: 6px;
  max-width: 500px;
  margin: 0 auto 0 -24px;
}

#categoryMenu .button-container {
  flex: 0 0 50px;
  height: 76px;
  position: relative;
  z-index: 1;
}

#categoryMenu .button-container:hover {
  z-index: 100;
}

#categoryMenu .button > .button-content {
  height: auto;
  left: 50%;
  padding: 0;
  text-align: center;
  transform: translateX(-50%);
  width: 90px;
}

#categoryMenu .fmhy-icon {
  align-items: center;
  background: #1f2326;
  border-radius: 50%;
  display: flex;
  height: 50px;
  justify-content: center;
  margin: 0 auto;
  width: 50px;
}

#categoryMenu .fmhy-icon svg {
  height: 24px;
  width: 24px;
}

#categoryMenu .fmhy-icon-label {
  background: rgba(0, 0, 0, 0.78);
  border-radius: 3px;
  color: #fff;
  display: inline-block;
  font-size: 10px;
  line-height: 1.2;
  margin-top: 3px;
  padding: 2px 4px;
  text-shadow: 0 1px 3px #000;
  white-space: nowrap;
}

.fmhy-context-menu {
  --fmhy-accent: #009fff;
  background: rgba(0, 0, 0, 0.78);
  display: block;
  height: auto;
  max-height: calc(100dvh - 205px);
  overflow-x: hidden;
  overflow-y: auto;
  position: relative;
  overflow: visible;
  text-shadow: 0 1px 3px #000;
  z-index: 101;
}

.fmhy-submenu-item {
  position: relative;
  min-width: 210px;
}

.fmhy-submenu-trigger {
  align-items: center;
  background: transparent;
  border: 0;
  color: #fff;
  cursor: pointer;
  display: flex;
  font: inherit;
  justify-content: space-between;
  padding: 5px 8px;
  text-align: left;
  width: 100%;
}

.fmhy-submenu-trigger:hover,
.fmhy-submenu-item:hover > .fmhy-submenu-trigger {
  background: rgba(0, 159, 255, 0.14);
}

.fmhy-submenu-trigger span {
  color: var(--fmhy-accent);
  font-size: 1.35em;
  line-height: 0.8;
}

.fmhy-submenu {
  background: rgba(0, 0, 0, 0.82);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.45);
  display: none;
  left: 100%;
  list-style: none;
  margin: 0;
  max-height: calc(100dvh - 205px);
  min-width: 280px;
  overflow-y: auto;
  padding: 4px 0;
  position: absolute;
  top: 0;
  z-index: 102;
}

.fmhy-context-menu.menu-link {
  height: auto;
  max-height: calc(100dvh - 205px);
  width: min(300px, calc(100vw - 48px));
}

.fmhy-submenu {
  height: auto;
  max-height: calc(100dvh - 205px);
}

.fmhy-submenu-item:hover > .fmhy-submenu,
.fmhy-submenu-item:focus-within > .fmhy-submenu {
  display: block;
}

.fmhy-context-menu .menu-link-item a label {
  background: rgba(0, 0, 0, 0.65);
  color: var(--fmhy-accent);
}

.fmhy-tone-green { --fmhy-accent: #10ffa3; }
.fmhy-tone-blue { --fmhy-accent: #009fff; }
.fmhy-tone-purple { --fmhy-accent: #cc55ff; }
.fmhy-tone-cyan { --fmhy-accent: #0ad6ff; }
.fmhy-tone-pink { --fmhy-accent: #ff69b4; }
.fmhy-tone-orange { --fmhy-accent: #ff9800; }
.fmhy-tone-yellow { --fmhy-accent: #ffd200; }
.fmhy-tone-red { --fmhy-accent: #ff5b63; }

.fmhy-star {
  color: #ffd200;
  font-size: 1.1em;
}

.fmhy-related-links {
  list-style: none;
  margin: -1px 0 4px -4px;
  padding: 0 0 0 12px;
}

.fmhy-related-links li {
  line-height: 1.45;
}

.fmhy-related-links a {
  background: rgba(0, 26, 42, 0.76);
  border-left: 2px solid #009fff;
  color: #8cd7ff;
  display: inline-block;
  font-family: Consolas, "Courier New", monospace;
  font-size: 0.9em;
  padding: 1px 4px;
}

.fmhy-related-links a:hover {
  color: #fff;
}

.fmhy-related-arrow {
  color: var(--fmhy-accent);
  margin-right: 4px;
}

@media screen and (max-width: 500px) {
  #categoryMenu.menu-category {
    flex-direction: row;
    margin-left: 0;
    max-width: 350px;
  }

  .fmhy-context-menu { width: min(280px, calc(100vw - 32px)); }

  .fmhy-submenu {
    left: auto;
    right: 100%;
  }
}
