/* The menu on the right, outside the themes: infrastructure, not clothing.
   Mobile first: the items are targets for a thumb, their position is fixed and does not depend on how long the bar is. */

/* The bar's position (fixed/sticky) belongs to the theme: here we only anchor
   the dropdown to its own button, otherwise we would override the outfit. */
.menu {
  position: relative;
}

/* ── I due gruppi della barra: tavolo a sinistra, identità a destra ── */
.hud__l,
.hud__r {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  min-width: 0;
}

.hud__logo {
  width: 1.4em;
  height: 1.4em;
  flex: none;
  border-radius: 3px;
}

/* Il nickname è anche il pulsante del menu personale. */
.hud__user,
.hud__user:hover {
  color: var(--mag, oklch(65% 0.3 350));
  text-decoration: none;
}

/* Il LED del tavolo: verde fermo = nessuna serata aperta, rosso pulsante = si gioca.
   Classi di stato: battono il colore che il tema dà a .hud__dot, non la sua forma. */
.hud__dot.hud__dot--free {
  background: oklch(82% 0.24 150);
  box-shadow: 0 0 9px oklch(82% 0.24 150 / 0.8);
  animation: none;
}

.hud__dot.hud__dot--busy {
  background: oklch(62% 0.26 25);
  box-shadow: 0 0 9px oklch(62% 0.26 25);
}

.menu summary {
  list-style: none;
  cursor: pointer;
  padding: 0.35rem 0.45rem; /* il bottone non deve alzare la barra: riga sottile */
  border-radius: 999px;
  display: grid;
  place-items: center;
}

.menu summary::-webkit-details-marker {
  display: none;
}

.menu summary:focus-visible {
  outline: 2px solid currentColor;
  outline-offset: 2px;
}

.menu[open] summary {
  background: color-mix(in srgb, currentColor 15%, transparent);
}

.menu__items {
  position: absolute;
  right: 0.5rem;
  top: calc(100% + 4px);
  z-index: 10;
  margin: 0;
  padding: 0.4rem 0;
  list-style: none;
  min-width: 12rem;
  background: #16130f;
  color: #e8e0d4;
  border: 1px solid color-mix(in srgb, #e8e0d4 25%, transparent);
  border-radius: 0.6rem;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.45);
}

.menu__items a,
.menu__items button {
  display: block;
  width: 100%;
  padding: 0.7rem 1rem;
  color: inherit;
  background: none;
  border: 0;
  font: inherit;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
}

.menu__items a:hover,
.menu__items button:hover {
  background: color-mix(in srgb, #e8e0d4 12%, transparent);
}

.menu__logout {
  margin: 0;
}

/* Accesso esplicito alla scheda dalla campagna, anche senza una modalità in sessione. */
.tavolo__campagna {
  display: block;
  color: inherit;
  text-decoration: none;
}

.tavolo__scheda {
  display: block;
  padding: 0.8rem 1rem;
  border-top: 1px solid color-mix(in srgb, currentColor 25%, transparent);
  color: var(--acid, var(--gold, currentColor));
  font-weight: 700;
  text-align: center;
}

@media (prefers-reduced-motion: no-preference) {
  .menu__items {
    animation: menu-apri 120ms ease-out;
  }
}

@keyframes menu-apri {
  from {
    opacity: 0;
    transform: translateY(-4px);
  }
}
