/* Reset */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: system-ui, sans-serif;
}

/* Layout */
body {
  background: #fdfdfd;
  color: #111;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

header {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 0.8rem;
  position: relative;
}

header h1 {
  font-size: 1.3rem;   /* etwas kleiner */
  text-align: center;
  margin: 0 auto;
}


.back-arrow,
.menu-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  font-size: 1.4rem;
  cursor: pointer;
  color: inherit;
}

.back-arrow {
  left: 1rem;
  text-decoration: none;
}

.menu-btn {
  right: 1rem;
}


#game {
  flex: 1;
  display: flex;
  gap: 0;
  padding: 1rem;
  justify-content: center;
}

.column {
  display: flex;
  flex-direction: column;
  flex: 1;
  max-width: 220px;
}
button {
  flex: 1;
  padding: 1rem;
  border: 1px solid #ddd;
  background: #fff;
  font-size: 1rem;
  cursor: pointer;
  transition: 0.2s;
  text-align: center;
  max-height: 80px;   /* Deckel nach oben */
  height: auto;       /* passt sich Inhalt an */

  /* Karten eng übereinander */
  margin: 0;
  border-radius: 0;
  color: inherit;           /* übernimmt die Textfarbe von body */
  -webkit-appearance: none; /* entfernt iOS Button-Styles */
  appearance: none;         /* entfernt Standard-Button-Styling */
}


button:hover {
  background: #d0d0d0;
}

button.selected {
  background: #ffd54f;
}

button.correct {
  background: #81c784;
  color: white;
}

button:disabled {
  opacity: 0.9;
  cursor: not-allowed;
}

/* Overlay */
#overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  display: flex;
  justify-content: center;
  align-items: center;
}

#overlay.hidden {
  display: none;
}

.overlay-content {
  background: white;
  padding: 2rem;
  border-radius: 10px;
  max-width: 400px;
  text-align: center;
}

.overlay-content ul {
  text-align: left;
  margin: 1rem 0;
  padding-left: 1.2rem;
}

/* Mobile */
@media (max-width: 500px) {
  #game {
    flex-direction: row;       /* bleibt nebeneinander */
    padding: 0.5rem;
  }

  .column {
    max-width: 45%;            /* beide Spalten teilen sich die Breite */
  }

  button {
    font-size: 0.75rem;   /* kleinere Schrift */
    padding: 0.4rem;      /* weniger Innenabstand */
    min-height: 40px;     /* kompaktere Höhe */
    max-height: 60px;  /* neu */
  
}
  header h1 {
    font-size: 1rem; /* Titel auch kleiner */
  }

}

/* Sehr kleine Screens (z. B. iPhone SE) */
@media (max-width: 360px) {
  button {
    font-size: 0.7rem;
    padding: 0.3rem;
    min-height: 36px;
    max-height: 50px;  /* neu */
  }  

  header h1 {
    font-size: 0.9rem;
  }
}

/* Dark Mode */
@media (prefers-color-scheme: dark) {
  body {
    background: #0f1923;
    color: #fdfdfd;
  }

  button {
    background: #1c2733;
    color: #fdfdfd;
  }

  button:hover {
    background: #2e4054;      /* heller / klarerer Hover */
    border-color: #3b4a5c;    /* leichte Umrandung */
  }

    button.selected {
    background: #fbc02d;      /* kräftiger Gelbton */
    color: #111;              /* Schwarz auf Gelb → klare Lesbarkeit */
  }

    button.correct {
    background: #388e3c;      /* satteres Grün */
    color: #fff;
  }

  .overlay-content {
    background: #1c2733;
    color: #fdfdfd;
  }
}

#menu-dropdown {
  position: absolute;
  top: 3rem;
  right: 1rem;
  background: white;
  border: 1px solid #ddd;
  border-radius: 8px;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding: 0.5rem;
  z-index: 100;
}

#menu-dropdown.hidden {
  display: none;
}

#menu-dropdown button {
  padding: 0.5rem 1rem;
  font-size: 0.9rem;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  background: #f5f5f5;
  color: inherit;           /* neu */
  -webkit-appearance: none; /* neu */
  appearance: none;         /* neu */

}

#menu-dropdown button:hover {
  background: #e0e0e0;
}

/* Dark Mode */
@media (prefers-color-scheme: dark) {
  #menu-dropdown {
    background: #1c2733;
    border: 1px solid #2c3e50;
  }
  #menu-dropdown button {
    background: #22303f;
    color: #fdfdfd;
  }
  #menu-dropdown button:hover {
    background: #2e4054;
  }
}
