:root {
  --bg: #0f172a;
  --card-bg: #1e293b;
  --card-border: #334155;
  --text-main: #f1f5f9;
  --text-sub: #94a3b8;
  --shadow: rgba(0, 0, 0, 0.4);
  --input-bg: #1e293b;
  --input-border: #334155;
  --input-text: #f1f5f9;
  --star-color: #fbbf24;
  --star-empty: #475569;
  --header-bg: #1e293b;
}

html.light-mode {
  --bg: #f4f4f4;
  --card-bg: #ffffff;
  --card-border: #e5e5e5;
  --text-main: #222222;
  --text-sub: #555555;
  --shadow: rgba(0, 0, 0, 0.1);
  --input-bg: #ffffff;
  --input-border: #cccccc;
  --input-text: #222222;
  --star-color: #f5a300;
  --star-empty: #cccccc;
  --header-bg: #ffffff;
}

* {
  box-sizing: border-box;
}

body {
  font-family: Arial, sans-serif;
  background: var(--bg);
  color: var(--text-main);
  margin: 0;
  padding: 20px;
  transition: background 0.2s ease, color 0.2s ease;
}

.top-bar {
  display: flex;
  justify-content: center;
  align-items: center;
  position: relative;
  margin-bottom: 10px;
}

h1 {
  text-align: center;
  margin: 0;
}

.theme-toggle {
  position: absolute;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  background: var(--card-bg);
  color: var(--text-main);
  border: 1px solid var(--card-border);
  border-radius: 20px;
  padding: 8px 16px;
  font-size: 0.9rem;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease;
}

.theme-toggle:hover {
  filter: brightness(1.15);
}

.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 20px;
  background: var(--header-bg);
  padding: 15px;
  border-radius: 10px;
  box-shadow: 0 2px 4px var(--shadow);
}

.filters input,
.filters select {
  background: var(--input-bg);
  color: var(--input-text);
  border: 1px solid var(--input-border);
  border-radius: 6px;
  padding: 6px 8px;
}

.filters label {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--text-main);
}

.game-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 15px;

  /* So breit wie der Bildschirm */
  width: 100%;

  /* Normaler vertikaler Scroll */
  overflow-y: auto;

  /* Optional: maximale Höhe, falls du nur einen Teil anzeigen willst */
  /* max-height: calc(100vh - 200px); */

}
.game-card {
background: var(--card-bg);
padding: 15px;
border-radius: 10px;
box-shadow: 0 2px 5px var(--shadow);
border: 1px solid var(--card-border);
display: flex;
flex-direction: column;
align-items: center;   /* alles zentriert */
text-align: center;
position: relative;    /* nötig für absolut positionierten Stern */
transition: background 0.2s ease, border-color 0.2s ease;
}
.game-card h3 {
  margin: 16px 0 16px 0;   /* Titel etwas kompakter */
}

.game-card p {
  margin: 6px 0px;         /* kleinerer Abstand zwischen Zeilen */
  color: var(--text-main);
}

.game-card img {
  width: 150px;
  height: 150px;
  object-fit: contain;
  display: block;
  margin-bottom: 10px;
  border-radius: 8px;
}

.game-card .rating {
  margin-top: auto;
  padding-top: 10px;
  width: 100%;
}

.rating .stars {
  letter-spacing: 2px;
  font-size: 1.1rem;
}

.rating .stars .filled {
  color: var(--star-color);
}

.rating .stars .empty {
  color: var(--star-empty);
}

#gameCount {
  font-size: 0.9rem;
  color: var(--text-sub);
  margin-bottom: 10px;
}

.fav-btn {
  position: absolute;
  top: 8px;
  right: 8px;
  background: none;
  border: none;
  font-size: 24px;
  cursor: pointer;
  color: var(--star-color);
}

.fav-btn:hover {
  transform: scale(1.2);
}
