.sidebar-container {
  position: absolute;
  left: 1vw;
  top: 50vh;
  width: 11vw;
  height: 50vh; /* feste Höhe, nicht max-height */
  padding: 1vh 1vw;
  background-color: #1a1a1a;
  border: 0.25vh solid #c9a735;
  border-radius: 1em;
  box-shadow: 0 0.8vh 2vh rgba(0, 0, 0, 0.6);
  z-index: 1;

  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.sidebar {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto; /* flex-grow & shrink damit es die Höhe nutzt */
  gap: 0.3vh;

  overflow-y: auto;    /* aktivierte Scrollbar bei Überlauf */
  overflow-x: hidden;
  padding-right: 0.5vw; /* Platz für Scrollbar */
  box-sizing: border-box;
  height: 100%;         /* volle Höhe vom Container */
}

.sidebar-button {
  flex-shrink: 0;
  flex-grow: 0;

  background-color: #d4af37;
  color: white;
  border: none;
  padding: 0.45em 0.6em;
  font-size: clamp(0.65rem, 0.9vw, 0.95rem);
  font-weight: bold;
  border-radius: 1em;
  cursor: pointer;
  text-align: left;
  width: 100%;
  box-sizing: border-box;
  transition: background-color 0.2s ease-in-out, box-shadow 0.2s ease-in-out;
  box-shadow: 0 0.5vh 1vh rgba(0, 0, 0, 0.5);

  display: flex;
  align-items: center;
  white-space: normal;
  word-break: break-word;

  max-height: 4em;      /* Maximalhöhe, damit nicht zu groß */
  overflow: hidden;     /* Abschneiden bei Überlauf */
  line-height: 1.2em;
}

@media (max-width: 768px) {
  .sidebar-container {
    position: fixed;
    bottom: 2vh;
    left: 50%;
    transform: translateX(-50%);
    width: 90vw;
    height: auto;
    max-height: 60vh;
    padding: 2vh 3vw;
    border-radius: 1em;
    overflow-y: auto;
    z-index: 1001;
  }

  .sidebar {
    flex-direction: column;
    gap: 1vh;
    max-height: 100%;
    padding-right: 0;
    overflow-y: auto;
  }

  .sidebar-button {
    font-size: 1em;
    padding: 0.7em 1em;
    max-height: none;
    white-space: normal;
    word-break: break-word;
  }
}

/* Standardmäßig nicht sichtbar – nur auf Mobilgeräten */
.sidebar-toggle-button {
  display: none;
  position: fixed;
  top: 2vh;
  left: 2vw;
  padding: 0.6em 1em;
  font-size: 1.2em;
  background-color: #d4af37;
  color: white;
  border: none;
  border-radius: 0.5em;
  z-index: 1001;
  cursor: pointer;
}

/* Auf kleineren Geräten aktivieren */
@media (max-width: 768px) {
  .sidebar-container {
    display: none;
    flex-direction: column;
    position: fixed;
    top: 6vh;
    left: 50%;
    transform: translateX(-55%);
    width: 80vw;
    max-height: 80vh;
    overflow-y: auto;
    overflow-x: hidden;
    background-color: #1e1e1e;
    padding: 1em;
    border-radius: 0.5em;
    z-index: 1000;
    box-sizing: border-box;
  }

  .sidebar-container.active {
    display: flex;
  }

  .sidebar-container button {
    width: 100%;
    text-align: left;
    padding: 0.75em 1em;
    margin-bottom: 0.5em;
    border: none;
    border-radius: 0.4em;
    background-color: #2a2a2a;
    color: white;
    font-size: 0.9rem;
    box-sizing: border-box;
  }

  .sidebar-toggle-button {
    display: block;
    position: fixed;
    top: 2vh;
    left: 5vw;
    z-index: 1001;

    /* Neue kompakte Darstellung */
    font-size: 1.2rem;
    padding: 0.3em 0.5em;
    width: 2.2em;
    height: 2.2em;
    text-align: center;
    border-radius: 0.5em;
    background-color: #d4af37;
    color: #1e1e1e;
    font-weight: bold;
    box-shadow: 0 0.3vh 0.8vh rgba(0, 0, 0, 0.5);
    border: none;
  }
}
