/* Header of the server pages (header.html). One menu for all widths: a bar with dropdowns, below 576px a
   menu button with a panel. Scoped to .mcc-header because the old header.css still styles plain nav/ul/li
   elements (the footer uses them). */
:root { --mcc-header-h: 64px; }

.mcc-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  width: 100% !important;
  margin: 0 !important;
  z-index: 999;
  background: #0b0f0d;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  font-family: var(--font-body, sans-serif);
}
.mcc-header .mcc-nav {
  display: flex;
  align-items: center;
  box-sizing: border-box;
  max-width: 1240px;
  height: var(--mcc-header-h);
  margin: 0 auto !important;
  padding: 0 20px !important;
  background: transparent;
}

/* brand (logo + server name) */
.mcc-header .mh-bar { display: flex; align-items: center; gap: 10px; flex: none; min-width: 0; margin-right: 24px; }
.mcc-header .mh-logo { display: flex; flex: none; }
.mcc-header .mh-logo img { width: 38px; height: 38px; }
.mcc-header .mh-title {
  color: #fff;
  font-family: var(--font-heading, sans-serif);
  font-weight: 700;
  font-size: 19px;
  letter-spacing: 0.01em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 220px;
  text-decoration: none;
}
.mcc-header .mh-toggle { display: none; }
.mcc-header .st-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* the entries: hover/open = a faint surface, the current page = green text with a line under it */
.mcc-header #nav-bar {
  display: flex;
  align-items: center;
  gap: 2px;
  flex: 1;
  margin: 0 !important;
  padding: 0 !important;
  list-style: none;
}
.mcc-header #nav-bar > li { display: block; margin: 0; position: relative; }
.mcc-header .nav-top {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 38px;
  padding: 0 12px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: rgba(255, 255, 255, 0.78);
  font-family: var(--font-heading, sans-serif);
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.01em;
  line-height: 1;
  text-decoration: none;
  cursor: pointer;
  white-space: nowrap;
  transition: background-color 0.15s ease, color 0.15s ease;
}
.mcc-header .nav-top:hover, .mcc-header .nav-group:hover > .nav-top, .mcc-header .nav-top[aria-expanded="true"] {
  color: #fff;
  background: rgba(255, 255, 255, 0.06);
}
.mcc-header .nav-top.current, .mcc-header .nav-top.current:hover { color: #00e676; }
.mcc-header .nav-top.current::after {
  content: "";
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: -13px;
  height: 2px;
  border-radius: 2px 2px 0 0;
  background: #00e676;
}
.mcc-header .nav-top:focus-visible, .mcc-header .nav-menu a:focus-visible, .mcc-header .theme-switch:focus-visible {
  outline: 2px solid #00e676;
  outline-offset: 2px;
}
.mcc-header .nav-chev {
  width: 6px;
  height: 6px;
  margin-top: -3px;
  border-right: 1.8px solid currentColor;
  border-bottom: 1.8px solid currentColor;
  transform: rotate(45deg);
  opacity: 0.6;
  transition: transform 0.15s ease, margin 0.15s ease;
}
/* the arrow points up whenever the menu is open, by click or by hover */
.mcc-header .nav-top[aria-expanded="true"] .nav-chev { transform: rotate(225deg); margin-top: 3px; }
@media (hover: hover) and (min-width: 576px) {
  .mcc-header .nav-group:hover > .nav-top .nav-chev { transform: rotate(225deg); margin-top: 3px; }
}

/* dropdowns: dark like the bar in both color schemes, hover on devices with a mouse, click everywhere */
.mcc-header .nav-menu {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  min-width: 270px;
  padding: 6px;
  margin-top: 4px;
  background: #141917;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  box-shadow: 0 24px 48px -12px rgba(0, 0, 0, 0.7), 0 4px 12px rgba(0, 0, 0, 0.35);
  z-index: 10;
}
.mcc-header .nav-menu::before { content: ""; position: absolute; left: 0; right: 0; top: -6px; height: 6px; }  /* hover bridge */
.mcc-header .nav-menu-right { left: auto; right: 0; }
@media (hover: hover) and (min-width: 576px) {
  .mcc-header .nav-group:hover > .nav-menu { display: block; }
}
.mcc-header .nav-top[aria-expanded="true"] + .nav-menu { display: block; }
.mcc-header .nav-menu a {
  display: grid;
  grid-template-columns: 22px 1fr;
  column-gap: 10px;
  align-items: start;
  padding: 9px 10px;
  border-radius: 8px;
  color: rgba(255, 255, 255, 0.9);
  text-decoration: none;
  line-height: 1.3;
}
.mcc-header .nav-ico { grid-row: span 2; margin-top: 1px; color: rgba(255, 255, 255, 0.5); }
.mcc-header .nav-menu a b { display: block; font-family: var(--font-heading, sans-serif); font-size: 15px; font-weight: 600; }
.mcc-header .nav-menu a span { display: block; margin-top: 2px; color: rgba(255, 255, 255, 0.5); font-size: 13px; }
.mcc-header .nav-menu a:hover { background: rgba(255, 255, 255, 0.06); }
.mcc-header .nav-menu a:hover .nav-ico { color: #fff; }
.mcc-header .nav-menu a[aria-current="page"] { background: rgba(0, 230, 118, 0.1); }
.mcc-header .nav-menu a[aria-current="page"] b, .mcc-header .nav-menu a[aria-current="page"] .nav-ico { color: #00e676; }
.mcc-header .nav-menu a.mh-logout b, .mcc-header .nav-menu a.mh-logout .nav-ico { color: #ff8a8a; }
.mcc-header .nav-sep { display: block; height: 1px; margin: 6px 10px; background: rgba(255, 255, 255, 0.08); }
.mcc-header .nav-sep:last-child, .mcc-header .nav-sep:first-child { display: none; }

/* right side: color scheme and account */
.mcc-header .theme-item { order: 1; margin-left: auto !important; display: flex; align-items: center; }
.mcc-header .mh-account { order: 2; margin-left: 12px !important; }
.mcc-header .mh-theme-label { display: none; }

/* day/night switch (the one of t-auer.com): a sky-blue pill with sun and cloud, at night dark blue with moon and stars */
.mcc-header .dn-switch {
  position: relative;
  box-sizing: content-box;
  width: 56px;
  height: 28px;
  padding: 0;
  border: 2.5px solid #65c0e7;
  border-radius: 100px;
  background: #9cd6ef;
  cursor: pointer;
  overflow: hidden;
  flex: none;
}
.mcc-header .dn-art { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.mcc-header .dn-sun, .mcc-header .dn-cloud, .mcc-header .dn-moon, .mcc-header .dn-star { transform-box: fill-box; transform-origin: center; }
.mcc-header .dn-sun, .mcc-header .dn-cloud { transform: translateX(15px); opacity: 1; }
.mcc-header .dn-moon { transform: translateX(35px) rotate(0deg); opacity: 0; }
.mcc-header .dn-star { transform: translate(35px, -5px); opacity: 0; }
:root[data-dark] .mcc-header .dn-switch { background: #224f6d; border-color: #cad4d8; }
:root[data-dark] .mcc-header .dn-sun { transform: translateX(-157px); opacity: 0; }
:root[data-dark] .mcc-header .dn-cloud { opacity: 0; }
:root[data-dark] .mcc-header .dn-moon { transform: translateX(-157px) rotate(-360deg); opacity: 1; }
:root[data-dark] .mcc-header .dn-star { opacity: 1; }
/* animated only after a click, not when a page opens in its scheme */
.mcc-header .dn-switch.dn-animate { transition: background-color 1s ease-in-out, border-color 1s ease-in-out; }
.mcc-header .dn-animate .dn-sun, .mcc-header .dn-animate .dn-moon { transition: transform 1s ease-in-out, opacity 1s ease-in-out; }
.mcc-header .dn-animate .dn-cloud, .mcc-header .dn-animate .dn-star { transition: opacity 0.5s ease-in-out; }
@media (prefers-reduced-motion: reduce) {
  .mcc-header .dn-switch.dn-animate, .mcc-header .dn-animate .dn-sun, .mcc-header .dn-animate .dn-moon,
  .mcc-header .dn-animate .dn-cloud, .mcc-header .dn-animate .dn-star { transition: none; }
}

/* account: avatar, name and arrow as one block */
.mcc-header .nav-me {
  height: 40px;
  padding: 0 10px 0 4px;
  gap: 8px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 10px;
}
.mcc-header .nav-me:hover, .mcc-header .nav-group:hover > .nav-me, .mcc-header .nav-me[aria-expanded="true"] {
  border-color: rgba(255, 255, 255, 0.18);
}
.mcc-header .nav-me img { width: 30px; height: 30px; border-radius: 6px; image-rendering: pixelated; }
.mcc-header .nav-me-name { max-width: 140px; overflow: hidden; text-overflow: ellipsis; }
.mcc-header .nav-me.current::after { display: none; }
.mcc-header .mh-login {
  display: inline-flex;
  align-items: center;
  height: 38px;
  padding: 0 18px;
  border-radius: 8px;
  background: #2fbf62;
  color: #fff;
  font-family: var(--font-heading, sans-serif);
  font-weight: 700;
  text-decoration: none;
}
.mcc-header .mh-login:hover { background: #1f8f47; }

/* medium screens: names get shorter instead of wrapping */
@media (max-width: 1100px) {
  .mcc-header .mh-title { display: none; }
  .mcc-header .nav-me-name { display: none; }
}
@media (max-width: 760px) {
  .mcc-header .mcc-nav { padding: 0 10px !important; }
  .mcc-header .mh-bar { margin-right: 6px; }
  .mcc-header .nav-top { padding: 0 8px; font-size: 15px; }
  .mcc-header .nav-chev { display: none; }
}

/* ---------------------------------------------------------------- phones: bar + panel */
.mcc-header .mh-toggle-icon { display: flex; flex-direction: column; gap: 4px; }
.mcc-header .mh-toggle-icon i { display: block; width: 18px; height: 2px; border-radius: 1px; background: currentColor; }
@media (max-width: 575px) {
  :root { --mcc-header-h: 56px; }
  .mcc-header .mcc-nav { display: block; height: auto; padding: 0 !important; }
  .mcc-header .mh-bar { height: 56px; margin: 0; padding: 0 8px 0 16px; box-sizing: border-box; }
  .mcc-header .mh-title { display: block; flex: 1; max-width: none; text-align: center; font-size: 17px; }
  .mcc-header .mh-toggle {
    flex: none;
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 48px;
    height: 44px;
    padding: 0 10px;
    border: 1px solid rgba(255, 255, 255, 0.25);
    border-radius: 10px;
    background: transparent;
    color: #fff;
    font: inherit;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
  }
  .mcc-header .mh-toggle[aria-expanded="true"] { background: rgba(255, 255, 255, 0.12); }
  .mcc-header .mh-toggle-icon i { transition: transform 0.15s ease, opacity 0.15s ease; }
  .mcc-header .mh-toggle[aria-expanded="true"] .mh-toggle-icon i:nth-child(1) { transform: translateY(6px) rotate(45deg); }
  .mcc-header .mh-toggle[aria-expanded="true"] .mh-toggle-icon i:nth-child(2) { opacity: 0; }
  .mcc-header .mh-toggle[aria-expanded="true"] .mh-toggle-icon i:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

  .mcc-header #nav-bar {
    display: none;
    width: 100%;
    max-height: calc(100vh - 56px);
    max-height: calc(100dvh - 56px);
    overflow-y: auto;
    overscroll-behavior: contain;
    padding: 4px 0 20px !important;
    box-sizing: border-box;
    background: #0f1512;
    border-top: 1px solid rgba(255, 255, 255, 0.12);
  }
  .mcc-header #nav-bar.menueToggle { display: block !important; }
  .mcc-header #nav-bar > li { display: block; }

  /* top level links and group headings; the groups are always open */
  .mcc-header .nav-top {
    display: flex;
    width: 100%;
    height: auto;
    min-height: 48px;
    padding: 12px 20px;
    border-radius: 0;
    font-size: 17px;
    text-align: left;
  }
  .mcc-header .nav-top.current::after { display: none; }
  .mcc-header .nav-group > .nav-top {
    min-height: 0;
    padding: 18px 20px 6px;
    font-size: 12px;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.55);
    background: none;
    pointer-events: none;
  }
  .mcc-header .nav-chev { display: none; }
  .mcc-header .nav-menu, .mcc-header .nav-top[aria-expanded="true"] + .nav-menu {
    display: block;
    position: static;
    min-width: 0;
    margin: 0;
    padding: 0;
    border: 0;
    border-radius: 0;
    box-shadow: none;
    background: transparent !important;
  }
  .mcc-header .nav-menu a {
    display: flex;
    gap: 12px;
    align-items: center;
    min-height: 48px;
    padding: 0 20px 0 32px;
    border-radius: 0;
    color: #fff !important;
  }
  .mcc-header .nav-menu a b { font-family: var(--font-body, sans-serif); font-size: 17px; font-weight: 400; }
  .mcc-header .nav-menu a span { display: none; }
  .mcc-header .nav-menu a:hover, .mcc-header .nav-menu a:active { background: rgba(255, 255, 255, 0.08) !important; }
  .mcc-header .nav-menu a[aria-current="page"] { background: transparent; }
  .mcc-header .nav-menu a[aria-current="page"] b { color: #53ffb1; font-weight: 700; }
  .mcc-header .nav-sep { margin: 4px 20px 4px 32px; background: rgba(255, 255, 255, 0.12) !important; }

  /* account: the player's head and name as the heading, then the links */
  .mcc-header .mh-account {
    margin: 12px 0 0 !important;
    padding-top: 8px;
    border-top: 1px solid rgba(255, 255, 255, 0.12);
  }
  .mcc-header .mh-account > .nav-me {
    height: auto;
    border: 0;
    padding: 10px 20px;
    font-size: 17px;
    letter-spacing: 0;
    text-transform: none;
    color: #fff;
  }
  .mcc-header .nav-me-name { display: inline; max-width: none; }
  .mcc-header .nav-menu a.mh-logout b { color: #ff8a8a; }
  .mcc-header .mh-login { display: flex; justify-content: center; height: 48px; margin: 8px 20px; }

  .mcc-header #nav-bar > li.theme-item {
    display: flex;
    justify-content: space-between;
    min-height: 48px;
    margin: 0 !important;
    padding: 4px 20px;
  }
  .mcc-header .mh-theme-label { display: inline; color: rgba(255, 255, 255, 0.7); font-size: 15px; }

  /* the page behind an open menu does not scroll */
  html.mh-open, html.mh-open body { overflow: hidden; }
  .content { margin-top: 56px; }  /* old pages without the srv layout (player page) */
}
@media (prefers-reduced-motion: reduce) { .mcc-header .mh-toggle-icon i { transition: none; } }

/* number of open tickets next to "Tickets" (moderators) */
.mcc-header .nav-count {
  margin-left: 6px;
  padding: 0 7px;
  border-radius: 999px;
  background: #e5484d;
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  line-height: 18px;
}
.mcc-header .nav-count[hidden] { display: none; }
