/* =========================================
   1. VARIABLES & RESET
   ========================================= */
:root {
  --bg-body: #181a20;
  --bg-card: #23252b;
  --bg-header: #2b2e36;
  --bg-input: #121316;
  --text-main: #e6eaff;
  --text-muted: #9fa6b2;
  --accent-primary: #66c0f4;
  --accent-hover: #1976d2;
  --accent-green: #a4d007;
  --accent-orange: #ffb347;
  --accent-red: #ff5252;
  --shadow-sm: 0 2px 8px rgba(0,0,0,0.2);
  --shadow-md: 0 8px 24px rgba(0,0,0,0.3);
  --radius: 12px;
  --header-height: 64px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  height: 100%; /* Wichtig für Sticky Footer */
}

body {
  background-color: var(--bg-body);
  color: var(--text-main);
  font-family: 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  display: flex;
  flex-direction: column; /* Stapelt Nav, Main, Footer */
}

a { text-decoration: none; color: inherit; transition: color 0.2s; }

/* =========================================
   2. HEADER & NAVIGATION
   ========================================= */
nav {
  background-color: var(--bg-header);
  height: var(--header-height);
  display: flex;
  align-items: center;
  padding: 0 2rem;
  box-shadow: 0 2px 10px rgba(0,0,0,0.3);
  position: sticky;
  top: 0;
  z-index: 1000;
  gap: 1rem;
}

nav a {
  color: var(--text-muted);
  font-weight: 600;
  padding: 0 1rem;
  height: 100%;
  display: flex;
  align-items: center;
  font-size: 0.95rem;
  border-bottom: 3px solid transparent;
}

nav a:hover { color: #fff; background-color: rgba(255, 255, 255, 0.05); }
nav a.active { color: var(--accent-primary); border-bottom-color: var(--accent-primary); }
nav a:last-child { margin-left: auto; }

/* =========================================
   3. MAIN LAYOUT (STICKY FOOTER LOGIC)
   ========================================= */
main {
  flex: 1 0 auto; /* Lässt Content wachsen, drückt Footer nach unten */
  max-width: 1400px;
  margin: 0 auto;
  padding: 2rem;
  width: 100%;
}

h1 { margin-bottom: 1.5rem; font-size: 2rem; border-bottom: 2px solid var(--bg-card); padding-bottom: 0.5rem; }

/* =========================================
   4. GAMES GRID & CARDS (GROSSE BILDER)
   ========================================= */
.games {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 2rem;
}

.game {
  background: var(--bg-card);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: transform 0.3s ease;
  display: flex;
  flex-direction: column;
  border: 1px solid rgba(255,255,255,0.05);
}

.game:hover { transform: translateY(-5px); border-color: var(--accent-primary); }

.game img {
  width: 100%;
  height: 180px;
  object-fit: cover;
}

.game-info {
  padding: 1.2rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.game-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: #fff;
  margin-bottom: 4px;
}

/* Badges & Tags */
.badge-container {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 8px;
}

.badge {
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
}

.played .status-badge { background: rgba(164, 208, 7, 0.15); color: var(--accent-green); border: 1px solid rgba(164, 208, 7, 0.3); }
.not-played .status-badge { background: rgba(255, 179, 71, 0.15); color: var(--accent-orange); border: 1px solid rgba(255, 179, 71, 0.3); }
.deadline-badge { background: rgba(255, 179, 71, 0.15); color: var(--accent-orange); border: 1px solid rgba(255, 179, 71, 0.3); }

.tags {
  font-size: 0.85rem;
  color: var(--text-muted);
  background: rgba(0,0,0,0.2);
  padding: 8px;
  border-radius: 6px;
}

/* =========================================
   5. ADMIN & TABLES (AUS DEINER ALTEN DATEI)
   ========================================= */
.admin-table { width: 100%; border-collapse: collapse; background: var(--bg-card); border-radius: var(--radius); overflow: hidden; }
.admin-table th, .admin-table td { padding: 1rem; text-align: left; border-bottom: 1px solid rgba(255,255,255,0.05); }
.admin-form { background: var(--bg-card); padding: 1.5rem; border-radius: var(--radius); display: flex; gap: 1rem; margin-bottom: 2rem; }

input[type="text"], input[type="date"] { background: var(--bg-input); border: 1px solid #444; color: #fff; padding: 0.6rem; border-radius: 6px; }
button { background: var(--accent-primary); color: #1a2634; font-weight: 700; border: none; padding: 0.6rem 1.2rem; border-radius: 6px; cursor: pointer; }

/* =========================================
   6. FOOTER (Ganz unten & sauber)
   ========================================= */
footer {
  flex-shrink: 0; /* Verhindert, dass der Footer schrumpft */
  background-color: var(--bg-header);
  padding: 2rem;
  text-align: center;
  border-top: 1px solid rgba(255,255,255,0.1);
}

.footer-links { display: flex; justify-content: center; gap: 2rem; margin-bottom: 1rem; }
.footer-links a { color: var(--accent-primary); font-size: 0.9rem; text-decoration: underline; }
.footer-text { color: #555; font-size: 0.8rem; }

/* =========================================
   7. MODALS & WISHLIST
   ========================================= */
.modal { display: none; position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.8); z-index: 2000; justify-content: center; align-items: center; }
.modal.active { display: flex; }
.modal-content { background: var(--bg-card); padding: 2rem; border-radius: var(--radius); text-align: center; }
.wishlist-item { display: flex; align-items: center; background: var(--bg-card); padding: 1rem; border-radius: var(--radius); margin-bottom: 1rem; }
.wishlist-item img { width: 120px; margin-right: 1rem; }