/* Gemeinsame NavBar aller Play-Apps – Portal wie Games. Die Grundstruktur ist
   identisch mit der NavBar aus dem Drachenplasma-Repo; rechts vom Logo haengen
   die Games ihre eigenen Werte und Aktionen ein (.navbar-slot).
   Eingebunden: Portal per <link>, Games ueber @shared/navbar.css. */

.main-navbar {
  position: fixed;
  inset: 0 0 auto;
  z-index: 50;
  height: 56px;
  display: flex;
  justify-content: center;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  background: #111317;
  font-family: "Iceberg", ui-sans-serif, system-ui, sans-serif;
  color: #f8f7ff;
}

/* Tower Rush blendet die Leiste waehrend einer Partie aus */
.main-navbar[hidden] {
  display: none;
}

.navbar-grid {
  position: relative;
  z-index: 10;
  width: 100%;
  height: 56px;
  padding: 0 24px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 80rem) minmax(0, 1fr);
  align-items: center;
}

.navbar-content {
  grid-column: 2;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand {
  min-width: 0;
  flex-shrink: 0;
  padding: 4px 0;
  display: flex;
  align-items: center;
  gap: 10px;
  border: 0;
  border-radius: 8px;
  color: inherit;
  text-decoration: none;
  cursor: pointer;
  background: none;
}

.brand img {
  width: 28px;
  height: 28px;
  flex: 0 0 auto;
  object-fit: contain;
  filter: drop-shadow(0 0 8px rgba(139, 92, 246, 0.45));
}

.brand span {
  overflow: hidden;
  font-size: 0.875rem;
  font-weight: 400;
  letter-spacing: 0.04em;
  white-space: nowrap;
  text-overflow: ellipsis;
  color: transparent;
  background: linear-gradient(90deg, #f0abfc, #c4b5fd, #67e8f9);
  background-clip: text;
  -webkit-background-clip: text;
}

.navbar-spacer {
  min-width: 0;
  flex: 1;
}

/* Spielspezifischer Bereich: Werte (Punkte, Wellen, …) und Aktionsknoepfe */
.navbar-slot {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 6px;
  overflow: hidden;
}

.navbar-stat {
  min-height: 32px;
  padding: 0 10px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex: 0 0 auto;
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 10px;
  color: #aeb6d2;
  font-size: 0.74rem;
  white-space: nowrap;
  background: rgba(255, 255, 255, 0.045);
}

.navbar-stat b {
  color: #fff;
  font-weight: 400;
}

.navbar-action {
  width: 32px;
  height: 32px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  border: 1px solid transparent;
  border-radius: 10px;
  color: #b8c4d8;
  font-size: 0.95rem;
  cursor: pointer;
  background: none;
  transition:
    border-color 0.2s ease,
    background 0.2s ease,
    color 0.2s ease;
}

.navbar-action:hover,
.navbar-action:focus-visible {
  border-color: rgba(255, 255, 255, 0.12);
  color: #fff;
  background: rgba(255, 255, 255, 0.06);
  outline: none;
}

.profile-link {
  position: relative;
  width: 32px;
  height: 32px;
  flex: 0 0 auto;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.04);
  box-shadow: 0 0 12px rgba(139, 92, 246, 0.25);
  transition:
    transform 0.2s ease,
    border-color 0.2s ease,
    box-shadow 0.2s ease;
}

.profile-link::before {
  position: absolute;
  inset: 0;
  content: "";
  border-radius: inherit;
  background: linear-gradient(135deg, rgba(217, 70, 239, 0.8), rgba(139, 92, 246, 0.8), rgba(6, 182, 212, 0.8));
}

.profile-link img {
  position: relative;
  width: 28px;
  height: 28px;
  border-radius: 999px;
  object-fit: cover;
}

.profile-link:hover,
.profile-link:focus-visible {
  transform: scale(1.05);
  border-color: rgba(103, 232, 249, 0.35);
  box-shadow: 0 0 18px rgba(34, 211, 238, 0.35);
  outline: none;
}

@media (max-width: 720px) {
  .navbar-grid {
    padding: 0 14px;
  }

  /* Auf schmalen Schirmen weicht zuerst der Schriftzug, dann die Werte */
  .brand span {
    display: none;
  }

  .navbar-stat {
    padding: 0 7px;
    font-size: 0.68rem;
  }
}
