:root {
  --bg: #0f1117;
  --bg-alt: #171a23;
  --card: #1c1f2b;
  --accent: #6c5ce7;
  --accent-2: #00d1b2;
  --text: #eceef5;
  --text-dim: #9096ab;
  --border: #2a2e3d;
  --radius: 14px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
}

a { color: inherit; text-decoration: none; }

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
}

/* ---------- Header ---------- */
header.site-header {
  background: var(--bg-alt);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 50;
}
.site-header .row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 24px;
  gap: 20px;
}
.logo {
  font-size: 22px;
  font-weight: 800;
  letter-spacing: 0.5px;
}
.logo span { color: var(--accent-2); }

.search-form {
  flex: 1;
  max-width: 480px;
  display: flex;
}
.search-form input[type="text"] {
  flex: 1;
  padding: 10px 14px;
  border-radius: 8px 0 0 8px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  outline: none;
}
.search-form button {
  padding: 10px 18px;
  border: none;
  border-radius: 0 8px 8px 0;
  background: var(--accent);
  color: #fff;
  cursor: pointer;
  font-weight: 600;
}

/* ---------- Banner ---------- */
.banner {
  background: linear-gradient(120deg, var(--accent), var(--accent-2));
  border-radius: var(--radius);
  margin: 24px;
  padding: 48px 40px;
  color: #fff;
}
.banner h1 { margin: 0 0 8px; font-size: 32px; }
.banner p { margin: 0; opacity: 0.9; font-size: 16px; }

/* ---------- Section headings ---------- */
.section { margin: 40px 0; }
.section h2 {
  font-size: 20px;
  margin-bottom: 16px;
  border-left: 4px solid var(--accent);
  padding-left: 10px;
}

/* ---------- Game grid ---------- */
.game-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 20px;
}
.game-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: transform .15s ease, border-color .15s ease;
  display: flex;
  flex-direction: column;
}
.game-card:hover { transform: translateY(-4px); border-color: var(--accent); }
.game-card img {
  width: 100%;
  aspect-ratio: 16/10;
  object-fit: cover;
  background: #000;
}
.game-card .body { padding: 12px 14px; flex: 1; display: flex; flex-direction: column; }
.game-card h3 { font-size: 15px; margin: 0 0 6px; }
.game-card .rating { color: #f5c542; font-size: 13px; margin-bottom: 6px; }
.game-card .desc {
  color: var(--text-dim);
  font-size: 13px;
  flex: 1;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.badge-featured {
  display: inline-block;
  background: var(--accent-2);
  color: #04211c;
  font-size: 11px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 20px;
  margin-bottom: 8px;
  width: fit-content;
}

.empty-state {
  text-align: center;
  color: var(--text-dim);
  padding: 40px;
}

/* ---------- Game detail page ---------- */
.game-detail {
  display: grid;
  grid-template-columns: 340px 1fr;
  gap: 30px;
  margin: 30px 0 50px;
}
.game-detail img {
  width: 100%;
  border-radius: var(--radius);
  border: 1px solid var(--border);
}
.game-detail h1 { margin-top: 0; }
.locker-box {
  margin-top: 20px;
  padding: 20px;
  background: var(--card);
  border: 1px dashed var(--accent);
  border-radius: var(--radius);
}
.locker-box h3 { margin-top: 0; }
.download-locked-content {
  margin-top: 16px;
}
.btn {
  display: inline-block;
  padding: 12px 22px;
  border-radius: 8px;
  background: var(--accent-2);
  color: #04211c;
  font-weight: 700;
  border: none;
  cursor: pointer;
}
.btn.secondary { background: var(--accent); color: #fff; }

footer.site-footer {
  text-align: center;
  padding: 30px;
  color: var(--text-dim);
  font-size: 13px;
  border-top: 1px solid var(--border);
  margin-top: 60px;
}

/* ---------- Admin ---------- */
.admin-wrap { max-width: 960px; margin: 40px auto; padding: 0 20px; }
.admin-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  margin-bottom: 24px;
}
.admin-card h2 { margin-top: 0; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-grid .full { grid-column: 1 / -1; }
label { display: block; font-size: 13px; color: var(--text-dim); margin-bottom: 6px; }
input[type=text], input[type=number], input[type=url], input[type=password],
textarea, select {
  width: 100%;
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  font-family: inherit;
}
textarea { resize: vertical; }
.admin-table { width: 100%; border-collapse: collapse; }
.admin-table th, .admin-table td {
  text-align: left;
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  font-size: 14px;
  vertical-align: middle;
}
.admin-table img { width: 56px; height: 36px; object-fit: cover; border-radius: 4px; }
.pill { padding: 3px 10px; border-radius: 20px; font-size: 12px; }
.pill.yes { background: #163; color: #7ee787; }
.pill.no { background: #422; color: #ff9b9b; }
.actions a { margin-right: 10px; font-size: 13px; }
.actions a.danger { color: #ff6b6b; }
.top-bar {
  display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px;
}
.msg { padding: 12px 16px; border-radius: 8px; margin-bottom: 20px; }
.msg.ok { background: #163; color: #7ee787; }
.msg.err { background: #422; color: #ff9b9b; }
.checkbox-row { display: flex; align-items: center; gap: 8px; }
.checkbox-row input { width: auto; }
.hint { font-size: 12px; color: var(--text-dim); margin-top: 4px; }

@media (max-width: 800px) {
  .game-detail { grid-template-columns: 1fr; }
  .form-grid { grid-template-columns: 1fr; }
  .site-header .row { flex-wrap: wrap; }
}
