:root {
  --bg: #0f1220;
  --bg-alt: #161a2e;
  --card: #1b2039;
  --text: #eef0fb;
  --text-muted: #a2a8c3;
  --primary: #7c5cff;
  --primary-dark: #5f3fe0;
  --accent: #34d1a1;
  --danger: #ff5c72;
  --warning: #ffb443;
  --radius: 12px;
  --max-width: 1180px;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.55;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; display: block; }

.navbar {
  background: rgba(15, 18, 32, 0.95);
  border-bottom: 1px solid #262c4a;
  position: sticky; top: 0; z-index: 50;
}
.navbar-inner {
  max-width: var(--max-width); margin: 0 auto; padding: 14px 20px;
  display: flex; align-items: center; justify-content: space-between;
}
.brand { font-size: 1.3rem; font-weight: 800; color: var(--text); }
.nav-links { display: flex; align-items: center; gap: 18px; }
.nav-links a { color: var(--text-muted); font-weight: 500; }
.nav-links a:hover { color: var(--text); text-decoration: none; }
.nav-toggle { display: none; background: none; border: none; color: var(--text); font-size: 1.5rem; cursor: pointer; }

.site-main { max-width: var(--max-width); margin: 0 auto; padding: 28px 20px 60px; min-height: 60vh; }

.btn {
  display: inline-block; padding: 10px 20px; border-radius: 999px; font-weight: 600;
  border: 1px solid transparent; cursor: pointer; font-size: 0.95rem;
}
.btn:hover { text-decoration: none; }
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); }
.btn-outline { background: transparent; border-color: var(--primary); color: var(--primary); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-secondary { background: var(--bg-alt); color: var(--text); border-color: #2c3357; }
.btn-sm { padding: 6px 14px; font-size: 0.85rem; }
.btn-link { color: var(--text-muted); font-weight: 500; }

.hero {
  text-align: center; padding: 60px 20px; background: linear-gradient(160deg, #221d4c, #12142a);
  border-radius: var(--radius); margin-bottom: 40px;
}
.hero h1 { font-size: 2.6rem; margin: 0 0 12px; letter-spacing: 1px; }
.hero p { color: var(--text-muted); font-size: 1.1rem; max-width: 560px; margin: 0 auto 26px; }
.hero-actions { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; }

.section { margin-bottom: 48px; }
.section-header { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 18px; }
.section-header h2 { font-size: 1.4rem; margin: 0; }
.section-header a { font-size: 0.9rem; }

.grid {
  display: grid; gap: 20px;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
}

.game-card {
  background: var(--card); border-radius: var(--radius); overflow: hidden;
  border: 1px solid #262c4a; transition: transform .15s ease, border-color .15s ease;
}
.game-card:hover { transform: translateY(-3px); border-color: var(--primary); }
.game-card a { text-decoration: none; color: inherit; }
.game-card .thumb { width: 100%; aspect-ratio: 16/10; object-fit: cover; background: #232848; }
.game-card .info { padding: 14px; }
.game-card .title { font-weight: 700; margin: 0 0 4px; font-size: 1.02rem; }
.game-card .cat { font-size: 0.78rem; color: var(--accent); text-transform: uppercase; letter-spacing: .5px; }
.game-card .desc { font-size: 0.85rem; color: var(--text-muted); margin-top: 6px; }
.game-card .play-btn { display: block; text-align: center; padding: 10px; background: var(--primary); color: #fff; font-weight: 600; }
.game-card .play-btn:hover { background: var(--primary-dark); text-decoration: none; }

.categories-list { display: flex; flex-wrap: wrap; gap: 10px; }
.category-pill {
  background: var(--bg-alt); border: 1px solid #2c3357; padding: 8px 16px; border-radius: 999px;
  font-size: 0.88rem; color: var(--text);
}
.category-pill:hover { border-color: var(--primary); text-decoration: none; }

.filters-bar { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 24px; }
.filters-bar input, .filters-bar select {
  background: var(--card); border: 1px solid #2c3357; color: var(--text);
  padding: 9px 12px; border-radius: 8px; font-size: 0.9rem;
}
.filters-bar input[type=text] { flex: 1; min-width: 180px; }

.pagination { display: flex; gap: 8px; justify-content: center; margin-top: 30px; flex-wrap: wrap; }
.pagination a, .pagination span {
  padding: 8px 14px; border-radius: 8px; background: var(--card); border: 1px solid #2c3357;
  color: var(--text-muted); font-size: 0.9rem;
}
.pagination .active { background: var(--primary); color: #fff; border-color: var(--primary); }

.card-panel {
  background: var(--card); border: 1px solid #262c4a; border-radius: var(--radius); padding: 24px;
}

form.form-box { max-width: 480px; }
.form-group { margin-bottom: 16px; }
.form-group label { display: block; margin-bottom: 6px; font-weight: 600; font-size: 0.9rem; }
.form-group input[type=text], .form-group input[type=email], .form-group input[type=password],
.form-group input[type=file], .form-group select, .form-group textarea {
  width: 100%; padding: 10px 12px; border-radius: 8px; border: 1px solid #2c3357;
  background: var(--bg-alt); color: var(--text); font-size: 0.95rem;
}
.form-group textarea { min-height: 110px; resize: vertical; }
.form-hint { font-size: 0.8rem; color: var(--text-muted); margin-top: 4px; }
.form-error { color: var(--danger); font-size: 0.85rem; margin-top: 4px; }

.flash { padding: 12px 16px; border-radius: 8px; margin-bottom: 18px; font-size: 0.92rem; }
.flash-success { background: rgba(52, 209, 161, 0.12); border: 1px solid var(--accent); color: var(--accent); }
.flash-error { background: rgba(255, 92, 114, 0.12); border: 1px solid var(--danger); color: var(--danger); }
.flash-info { background: rgba(124, 92, 255, 0.12); border: 1px solid var(--primary); color: var(--primary); }

table.data-table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
table.data-table th, table.data-table td { padding: 10px 12px; border-bottom: 1px solid #262c4a; text-align: left; }
table.data-table th { color: var(--text-muted); font-weight: 600; font-size: 0.8rem; text-transform: uppercase; }

.badge { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: 0.75rem; font-weight: 700; }
.badge-published { background: rgba(52,209,161,.15); color: var(--accent); }
.badge-pending { background: rgba(255,180,67,.15); color: var(--warning); }
.badge-approved { background: rgba(52,209,161,.15); color: var(--accent); }
.badge-rejected { background: rgba(255,92,114,.15); color: var(--danger); }
.badge-draft { background: rgba(162,168,195,.15); color: var(--text-muted); }
.badge-unpublished { background: rgba(162,168,195,.15); color: var(--text-muted); }

.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px,1fr)); gap: 16px; margin-bottom: 30px; }
.stat-box { background: var(--card); border: 1px solid #262c4a; border-radius: var(--radius); padding: 20px; text-align: center; }
.stat-box .num { font-size: 1.8rem; font-weight: 800; color: var(--primary); }
.stat-box .label { color: var(--text-muted); font-size: 0.85rem; margin-top: 4px; }

.admin-layout { display: flex; gap: 26px; }
.admin-sidebar { width: 210px; flex-shrink: 0; }
.admin-sidebar a { display: block; padding: 10px 14px; border-radius: 8px; color: var(--text-muted); margin-bottom: 4px; font-weight: 500; }
.admin-sidebar a:hover, .admin-sidebar a.active { background: var(--card); color: var(--text); text-decoration: none; }
.admin-content { flex: 1; min-width: 0; }

.game-play-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; flex-wrap: wrap; gap: 10px; }
.game-frame-wrap { background: #000; border-radius: var(--radius); overflow: hidden; border: 1px solid #262c4a; }
.game-frame-wrap iframe { width: 100%; height: 640px; border: none; display: block; }

.error-page { text-align: center; padding: 80px 20px; }
.error-page h1 { font-size: 4rem; margin: 0; color: var(--primary); }

.site-footer { border-top: 1px solid #262c4a; margin-top: 60px; padding: 24px 20px; text-align: center; color: var(--text-muted); font-size: 0.85rem; }

@media (max-width: 720px) {
  .nav-toggle { display: block; }
  .nav-links { display: none; position: absolute; top: 100%; left: 0; right: 0; background: var(--bg); flex-direction: column; padding: 14px 20px; border-bottom: 1px solid #262c4a; }
  .nav-links.open { display: flex; }
  .admin-layout { flex-direction: column; }
  .admin-sidebar { width: 100%; display: flex; overflow-x: auto; gap: 6px; }
  .hero h1 { font-size: 2rem; }
  .game-frame-wrap iframe { height: 420px; }
}
