:root {
  --bg: #0b0b12;
  --surface: #161622;
  --surface-2: #1e1e2e;
  --border: rgba(255,255,255,0.08);
  --text: #f0f0f5;
  --muted: #8b8ba0;
  --accent: #00d4aa;
  --accent-2: #7c4dff;
  --danger: #f87171;
  --radius: 16px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.container { max-width: 1120px; margin: 0 auto; padding: 0 1.5rem; }

.header {
  background: rgba(22,22,34,0.8);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  padding: 1rem 0;
  position: sticky;
  top: 0;
  z-index: 100;
}

.header .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo {
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--text);
  text-decoration: none;
  letter-spacing: -0.5px;
}

.logo span {
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.header nav { display: flex; align-items: center; gap: 1.25rem; }
.user { color: var(--muted); font-size: 0.9rem; }
.nav-link { color: var(--muted); text-decoration: none; font-weight: 500; }
.nav-link:hover { color: var(--text); }

.btn-sm, .btn-primary {
  background: var(--accent);
  color: #000;
  font-weight: 600;
  padding: 0.5rem 1rem;
  border-radius: 10px;
  text-decoration: none;
  border: none;
  cursor: pointer;
  font-size: 0.9rem;
}

.btn-primary { padding: 0.75rem 1.25rem; width: 100%; font-size: 1rem; }

.hero {
  text-align: center;
  padding: 4.5rem 0 3rem;
}

.hero h1 {
  font-size: 3.2rem;
  font-weight: 800;
  letter-spacing: -1.5px;
  background: linear-gradient(90deg, #fff, var(--accent));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: 0.75rem;
}

.hero p { font-size: 1.15rem; color: var(--muted); }

.games-section { padding: 1rem 0 4rem; }

.game-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.5rem;
}

.game-card {
  background: var(--surface);
  border-radius: var(--radius);
  overflow: hidden;
  text-decoration: none;
  color: inherit;
  border: 1px solid var(--border);
  transition: transform 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
}

.game-card:hover {
  transform: translateY(-6px);
  border-color: var(--accent);
  box-shadow: 0 20px 40px rgba(0,212,170,0.12);
}

.cover {
  height: 180px;
  background-size: cover;
  background-position: center;
  background-color: #111;
  position: relative;
}

.cover-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0,0,0,0.6), transparent 50%);
}

.card-body { padding: 1.25rem; }
.card-body h3 { font-size: 1.25rem; margin-bottom: 0.4rem; }
.card-body p { color: var(--muted); font-size: 0.92rem; line-height: 1.4; }

.empty-state {
  text-align: center;
  padding: 4rem 1rem;
  color: var(--muted);
}

.empty-icon { font-size: 3rem; margin-bottom: 1rem; }

.auth-wrapper {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 3rem 1rem;
}

.auth-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2.5rem;
  width: 100%;
  max-width: 420px;
}

.auth-card h1 { font-size: 1.8rem; margin-bottom: 0.5rem; }
.subtitle { color: var(--muted); margin-bottom: 1.5rem; font-size: 0.95rem; }

.auth-card input {
  width: 100%;
  padding: 0.85rem 1rem;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--text);
  font-size: 1rem;
  margin-bottom: 0.75rem;
}

.auth-card input:focus {
  outline: none;
  border-color: var(--accent);
}

.error {
  background: rgba(248,113,113,0.15);
  color: var(--danger);
  padding: 0.75rem 1rem;
  border-radius: 8px;
  margin-bottom: 1rem;
  font-size: 0.9rem;
}

.auth-footer { text-align: center; margin-top: 1.25rem; color: var(--muted); font-size: 0.9rem; }
.auth-footer a { color: var(--accent); text-decoration: none; }

.footer {
  margin-top: auto;
  padding: 2rem 0;
  text-align: center;
  color: var(--muted);
  border-top: 1px solid var(--border);
  font-size: 0.9rem;
}

.flashes {
  background: rgba(0,212,170,0.1);
  border: 1px solid rgba(0,212,170,0.3);
  color: var(--accent);
  padding: 0.9rem 1.2rem;
  border-radius: 10px;
  margin: 1.5rem 0;
}

.admin-page { padding: 2rem 0 4rem; }
.admin-page h1 { margin-bottom: 1.5rem; font-size: 2rem; }

.admin-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
  margin-bottom: 1.5rem;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
}

.card h2 { font-size: 1.2rem; margin-bottom: 0.75rem; }
.card p, .muted { color: var(--muted); font-size: 0.92rem; margin-bottom: 1rem; }

.upload-form input[type="file"] {
  margin-bottom: 1rem;
  color: var(--muted);
}

.game-list { list-style: none; }
.game-list li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--border);
}
.game-list li:last-child { border-bottom: none; }
.slug { color: var(--muted); font-size: 0.85rem; }
.actions a { color: var(--accent); text-decoration: none; margin-left: 0.75rem; font-size: 0.9rem; }

table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 0.75rem 0.5rem; border-bottom: 1px solid var(--border); }
th { color: var(--muted); font-weight: 500; font-size: 0.85rem; }

.role {
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
}
.role.admin { background: rgba(0,212,170,0.15); color: var(--accent); }
.role.user { background: rgba(255,255,255,0.08); color: var(--muted); }

.btn-sm.danger { background: var(--danger); color: #000; margin-left: 0.5rem; }

@media (max-width: 768px) {
  .hero h1 { font-size: 2.4rem; }
  .admin-grid { grid-template-columns: 1fr; }
  .game-grid { grid-template-columns: 1fr; }
}
