/* =====================================================================
   Kopfleiste der Konto-, Kauf-, Verwaltungs- und Rechtsseiten (Kim 02.11.2026, RM#48)
   Gilt in Game und Classic, hell und dunkel. Eine feste Ordnung auf jedem Bildschirm:
   - ab 1180 px eine Zeile: Logo, Bereiche, Abmelden | Zum Spiel, Hell/Dunkel, Game/Classic.
   - darunter zwei Zeilen: oben das Logo und rechts Zum Spiel, Hell/Dunkel, Game/Classic;
     unten über die ganze Breite die Bereiche und rechts Abmelden.
   Die Bereiche brechen nie mitten in der Zeile um. Reicht der Platz auf sehr schmalen Handys
   nicht, lässt sich die Zeile seitlich schieben.
   Farben, Schriften und die Schalter selbst kommen weiter aus auth.css, theme.css, mode.css
   und classic-site.css; hier steht nur die Anordnung.
   ===================================================================== */
html[data-mode] body.site { --bar-pad: var(--pad); }
html[data-mode] body.site .site-bar__inner {
  display: flex; flex-wrap: wrap; align-items: center; gap: 0 12px; min-height: 0;
  padding: 12px var(--bar-pad);
}
html[data-mode] body.site .site-bar:has(.site-bar__nav) .site-bar__inner { padding-bottom: 0; }
html[data-mode] body.site .site-bar__brand { order: 0; margin: 0 auto 0 0; }
html[data-mode] body.site .site-bar__play { order: 1; margin: 0; }
html[data-mode] body.site .site-bar__theme { order: 2; margin: 0; }
html[data-mode] body.site .site-bar__mode { order: 3; margin: 0; }

/* Bereiche: eigene Zeile über die ganze Breite, Abmelden rechts. */
html[data-mode] body.site .site-bar__nav {
  order: 4; flex: 1 0 100%; display: flex; flex-wrap: nowrap; align-items: center; gap: 4px; min-width: 0;
  margin: 12px calc(-1 * var(--bar-pad)) 0; padding: 6px var(--bar-pad);
  border-top: 1px solid var(--line); overflow-x: auto; scrollbar-width: none;
}
html[data-mode] body.site .site-bar__nav::-webkit-scrollbar { display: none; }
html[data-mode] body.site .site-bar__nav > * { flex: none; white-space: nowrap; }
html[data-mode] body.site .site-bar__logout { margin: 0 0 0 auto; padding-left: 8px; }

/* Logo: groß genug zum Erkennen, ohne die Leiste aufzublähen. */
html[data-mode='game'] body.site .site-bar .quest-brand__logo { width: 150px; height: auto; }

/* ---------- Breiter Bildschirm: alles in einer Zeile ---------- */
@media (min-width: 1180px) {
  html[data-mode] body.site .site-bar__inner { flex-wrap: nowrap; gap: 16px; }
  html[data-mode] body.site .site-bar:has(.site-bar__nav) .site-bar__inner { padding-bottom: 12px; }
  html[data-mode] body.site .site-bar__brand { margin-right: 8px; }
  html[data-mode] body.site .site-bar__nav { order: 1; flex: 1 1 auto; margin: 0; padding: 0; border-top: 0; overflow: visible; }
  html[data-mode] body.site .site-bar__play { order: 2; }
  html[data-mode] body.site .site-bar__theme { order: 3; }
  html[data-mode] body.site .site-bar__mode { order: 4; }
  html[data-mode='game'] body.site .site-bar .quest-brand__logo { width: 180px; }
}

/* ---------- Handy ---------- */
@media (max-width: 700px) {
  html[data-mode] body.site { --bar-pad: 16px; }
  html[data-mode] body.site .site-bar__inner { gap: 0 8px; padding-top: 10px; padding-bottom: 10px; }
  html[data-mode] body.site .site-bar__nav { margin-top: 10px; gap: 2px; }
  html[data-mode] body.site .site-bar__nav a { min-height: 36px; padding: 0 10px; font-size: 15px; }
  html[data-mode] body.site .site-bar__logout .btn--quiet { min-height: 36px; padding: 0 12px; font-size: 14.5px; border-width: 1px; }
  html[data-mode] body.site .site-bar__play { min-height: 38px; padding: 0 14px; font-size: 15px; }
  html[data-mode='game'] body.site .site-bar .quest-brand__logo { width: 118px; }
}
@media (max-width: 600px) {
  /* „Zum Hauptmenü“ heißt hier kurz „Hauptmenü“, damit die Bereiche in eine Zeile passen. */
  html[data-mode] body.site .site-bar__long { display: none; }
}
@media (max-width: 440px) {
  html[data-mode] body.site .site-bar__nav { padding-inline: 8px; }
  html[data-mode] body.site .site-bar__nav a { padding: 0 6px; font-size: 14.5px; }
  html[data-mode] body.site .site-bar__logout { padding-left: 4px; }
  html[data-mode] body.site .site-bar__logout .btn--quiet { padding: 0 10px; font-size: 14px; }
  html[data-mode] body.site .site-bar__play { padding: 0 12px; font-size: 14.5px; }
  html[data-mode] body.site .site-bar__play :is(.ui-icon, .site-ci) { display: none; }
  html[data-mode='game'] body.site .site-bar .quest-brand__logo { width: 104px; }
}
@media (max-width: 380px) {
  html[data-mode] body.site .site-bar__inner { gap: 0 6px; }
  html[data-mode] body.site .site-bar__nav { gap: 0; }
  html[data-mode] body.site .site-bar__nav a { padding: 0 4px; font-size: 14px; }
  html[data-mode] body.site .site-bar__logout .btn--quiet { padding: 0 8px; font-size: 13.5px; }
  html[data-mode] body.site .site-bar__play { padding: 0 10px; font-size: 14px; }
  html[data-mode='game'] body.site .site-bar .quest-brand__logo { width: 92px; }
}
@media (max-width: 340px) {
  /* Auf den kleinsten Handys heißt „Mein Konto“ kurz „Konto“. */
  html[data-mode] body.site .site-bar__long--narrow { display: none; }
  html[data-mode] body.site .site-bar__nav { padding-inline: 4px; }
  html[data-mode] body.site .site-bar__nav a { font-size: 13.5px; }
  html[data-mode] body.site .site-bar__inner { gap: 0 5px; }
  html[data-mode] body.site .site-bar__play { padding: 0 8px; font-size: 13.5px; }
  html[data-mode='game'] body.site .site-bar .quest-brand__logo { width: 80px; }
}

/* ---------- Einstiegsseiten mit Musikknopf (Login, Registrieren) ----------
   Der Musikknopf sitzt oben rechts. Am Handy steht das Logo deshalb allein in der ersten Zeile,
   darunter „Zum Spiel“ links und rechts Hell/Dunkel, dann Game/Classic. */
@media (max-width: 700px) {
  html[data-mode] body.site:has(#welcomeMusic) .site-bar__inner { row-gap: 10px; padding-right: 16px; }
  html[data-mode] body.site:has(#welcomeMusic) .site-bar__brand { width: var(--brand-w, 118px); margin-right: calc(100% - var(--brand-w, 118px)); }
  html[data-mode='game'] body.site:has(#welcomeMusic) .site-bar .quest-brand__logo { width: 118px; }
  html[data-mode] body.site:has(#welcomeMusic) .site-bar__play { margin-right: auto; }
}
