/* ── Design Tokens ── */
:root {
  --bg: #070b14;
  --bg-card: rgba(255,255,255,.04);
  --bg-hover: rgba(255,255,255,.08);
  --border: rgba(255,255,255,.08);
  --border-strong: rgba(255,255,255,.16);
  --text: #f0f3fa;
  --text-muted: #8b93a7;
  --accent: #6d9eff;
  --accent2: #a855f7;
  --neon: #00f5d4;
  --accent-grad: linear-gradient(135deg, #6d9eff, #a855f7);
  --neon-grad: linear-gradient(135deg, #00f5d4, #6d9eff);
  --success: #4ade80;
  --danger: #f87171;
  --warning: #fbbf24;
  --radius-sm: 8px;
  --radius: 16px;
  --radius-lg: 24px;
  --shadow: 0 4px 24px rgba(0,0,0,.4);
  --shadow-lg: 0 12px 48px rgba(0,0,0,.6);
  --font-display: 'Orbitron', monospace;
  --font-body: 'Inter', ui-sans-serif, system-ui, -apple-system, sans-serif;
  font-family: var(--font-body);
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
}
*,*::before,*::after { box-sizing: border-box; margin: 0; padding: 0; }
body { min-height: 100dvh; -webkit-font-smoothing: antialiased; overflow-x: hidden; }
a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }

/* ── Glow Background ── */
.glow-bg {
  position: fixed; inset: -40% -20% auto -20%; height: 80vh; pointer-events: none;
  background: radial-gradient(ellipse at 50% 0%, rgba(109,158,255,.2), transparent 55%),
              radial-gradient(ellipse at 30% 10%, rgba(168,85,247,.12), transparent 50%);
  z-index: 0;
}

/* ── Container ── */
.container { max-width: 1200px; margin: 0 auto; padding: 0 1.5rem; position: relative; z-index: 1; }

/* ── Navbar ── */
.navbar {
  position: sticky; top: 0; z-index: 50;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 2rem; height: 64px;
  background: rgba(7,11,20,.85); backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
}
.nav-logo {
  display: flex; align-items: center; gap: .5rem;
  font-family: var(--font-display);
  font-weight: 800; font-size: 1.15rem;
  background: var(--neon-grad);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.nav-logo svg { width: 28px; height: 28px; }
.nav-links { display: flex; align-items: center; gap: 1.5rem; }
.nav-link { color: var(--text-muted); font-size: .88rem; font-weight: 500; cursor: pointer; transition: color .2s; }
.nav-link:hover, .nav-link.active { color: var(--text); }

/* ── Hero Section ── */
.hero {
  text-align: center; padding: 5rem 1rem 4rem; position: relative; z-index: 1;
  min-height: 70vh; display: flex; flex-direction: column; align-items: center; justify-content: center;
}
.hero-badge {
  display: inline-flex; align-items: center; gap: .4rem;
  font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .12em;
  color: var(--neon); margin-bottom: 1.5rem;
  padding: .35rem 1rem; border-radius: 999px;
  border: 1px solid rgba(0,245,212,.2);
  background: rgba(0,245,212,.06);
}
.hero h1 {
  font-family: var(--font-display);
  font-size: clamp(2rem, 5.5vw, 3.75rem);
  font-weight: 900; letter-spacing: -.03em; line-height: 1.1;
  margin-bottom: 1.2rem;
  background: linear-gradient(135deg, #f0f3fa 40%, var(--accent) 70%, var(--neon) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.hero p { color: var(--text-muted); font-size: 1.1rem; max-width: 560px; margin: 0 auto 2.5rem; line-height: 1.7; }

/* ── Buttons ── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  padding: .7rem 1.6rem; border-radius: 999px; font-size: .9rem; font-weight: 600;
  cursor: pointer; border: none; text-decoration: none;
  transition: transform .15s ease, box-shadow .15s ease, opacity .15s;
  font-family: var(--font-body);
}
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn-primary {
  background: var(--accent-grad); color: #fff;
  box-shadow: 0 6px 28px rgba(109,158,255,.3);
}
.btn-primary:hover:not(:disabled) { transform: translateY(-2px); box-shadow: 0 10px 36px rgba(109,158,255,.45); }
.btn-neon {
  background: var(--neon-grad); color: #070b14;
  box-shadow: 0 0 24px rgba(0,245,212,.25);
  font-weight: 700;
}
.btn-neon:hover:not(:disabled) { transform: translateY(-2px); box-shadow: 0 0 40px rgba(0,245,212,.4); }
.btn-ghost { border: 1.5px solid var(--border-strong); color: var(--text); background: transparent; }
.btn-ghost:hover:not(:disabled) { background: var(--bg-hover); border-color: var(--accent); }
.btn-sm { padding: .45rem 1rem; font-size: .8rem; }
.btn-group { display: flex; gap: .75rem; flex-wrap: wrap; justify-content: center; }

/* ── Search & Filters ── */
.search-section { margin-bottom: 2.5rem; }
.search-bar {
  display: flex; gap: .75rem; align-items: center;
  background: rgba(255,255,255,.05); border: 1px solid var(--border);
  border-radius: 999px; padding: .4rem .4rem .4rem 1.25rem;
  max-width: 480px; margin: 0 auto 1rem;
  transition: border-color .2s, box-shadow .2s;
}
.search-bar:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(109,158,255,.15); }
.search-bar input {
  flex: 1; background: transparent; border: none; outline: none;
  color: var(--text); font-size: .9rem; font-family: var(--font-body);
}
.search-bar input::placeholder { color: var(--text-muted); }
.search-bar button {
  background: var(--accent-grad); border: none; border-radius: 999px;
  padding: .5rem 1rem; color: #fff; font-size: .8rem; font-weight: 600; cursor: pointer;
  transition: transform .15s;
}
.search-bar button:hover { transform: scale(1.05); }
.filter-row {
  display: flex; gap: .5rem; flex-wrap: wrap; justify-content: center;
  margin-top: .75rem;
}
.filter-chip {
  padding: .35rem .9rem; border-radius: 999px; font-size: .78rem; font-weight: 600;
  background: rgba(255,255,255,.05); border: 1px solid var(--border);
  color: var(--text-muted); cursor: pointer; transition: all .2s;
}
.filter-chip:hover { border-color: var(--accent); color: var(--text); }
.filter-chip.active { background: var(--accent-grad); color: #fff; border-color: transparent; }

/* ── Game Grid ── */
.game-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.5rem;
  padding: 0 0 3rem;
}

/* ── Game Card ── */
.game-card {
  position: relative; border-radius: var(--radius);
  background: var(--bg-card); border: 1px solid var(--border);
  overflow: hidden; cursor: pointer;
  transition: transform .3s ease, box-shadow .3s ease, border-color .3s ease;
}
.game-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 16px 48px rgba(0,0,0,.5), 0 0 24px rgba(109,158,255,.15);
  border-color: rgba(109,158,255,.3);
}
.game-card-image {
  width: 100%; aspect-ratio: 16/9; object-fit: cover;
  transition: transform .4s ease;
}
.game-card:hover .game-card-image { transform: scale(1.05); }
.game-card-overlay {
  position: absolute; inset: 0;
  background: linear-gradient(to top, rgba(7,11,20,.95) 0%, rgba(7,11,20,.3) 50%, transparent 70%);
  opacity: 0; transition: opacity .3s ease;
  display: flex; flex-direction: column; justify-content: flex-end;
  padding: 1.25rem;
}
.game-card:hover .game-card-overlay { opacity: 1; }
.game-card-info {
  padding: 1rem 1.1rem 1.1rem;
}
.game-card-title {
  font-size: 1rem; font-weight: 700; margin-bottom: .35rem;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.game-card-meta {
  display: flex; align-items: center; gap: .6rem;
  font-size: .78rem; color: var(--text-muted); margin-bottom: .5rem;
}
.game-card-genre {
  display: inline-flex; align-items: center; gap: .25rem;
  padding: .15rem .5rem; border-radius: 999px;
  background: rgba(109,158,255,.12); color: var(--accent);
  font-size: .7rem; font-weight: 600;
}
.game-card-rating {
  display: inline-flex; align-items: center; gap: .2rem;
  color: var(--warning); font-weight: 700;
}
.game-card-actions {
  display: flex; gap: .5rem; margin-top: .6rem;
}
.game-card-actions .btn { flex: 1; }

/* ── Modal / Popup ── */
.modal-overlay {
  position: fixed; inset: 0; z-index: 100;
  background: rgba(0,0,0,.7); backdrop-filter: blur(8px);
  display: flex; align-items: center; justify-content: center;
  padding: 1rem; animation: fadeIn .2s ease;
}
.modal {
  background: #0e1525; border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg); max-width: 560px; width: 100%;
  max-height: 90vh; overflow-y: auto;
  box-shadow: 0 24px 64px rgba(0,0,0,.6);
  animation: scaleIn .25s ease;
  position: relative;
}
.modal-img { width: 100%; aspect-ratio: 16/9; object-fit: cover; border-radius: var(--radius-lg) var(--radius-lg) 0 0; }
.modal-body { padding: 1.5rem; }
.modal-title { font-size: 1.35rem; font-weight: 800; margin-bottom: .5rem; }
.modal-meta { display: flex; gap: .75rem; flex-wrap: wrap; margin-bottom: 1rem; }
.modal-desc { color: var(--text-muted); font-size: .92rem; line-height: 1.7; margin-bottom: 1.5rem; }
.modal-close {
  position: absolute; top: 1rem; left: 1rem;
  width: 36px; height: 36px; border-radius: 50%;
  background: rgba(0,0,0,.5); border: 1px solid var(--border);
  color: var(--text); font-size: 1.2rem; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background .2s;
}
.modal-close:hover { background: rgba(255,255,255,.1); }

/* ── Animations ── */
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes scaleIn { from { opacity: 0; transform: scale(.92); } to { opacity: 1; transform: scale(1); } }
@keyframes fadeUp { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: none; } }
.fade-up { animation: fadeUp .5s ease forwards; }
.delay-1 { animation-delay: .1s; opacity: 0; }
.delay-2 { animation-delay: .2s; opacity: 0; }
.delay-3 { animation-delay: .3s; opacity: 0; }
.delay-4 { animation-delay: .4s; opacity: 0; }
.delay-5 { animation-delay: .5s; opacity: 0; }

/* ── Skeleton Loader ── */
.skeleton {
  background: linear-gradient(90deg, rgba(255,255,255,.04) 25%, rgba(255,255,255,.08) 50%, rgba(255,255,255,.04) 75%);
  background-size: 200%; animation: shimmer 1.4s infinite;
  border-radius: var(--radius);
}
.skeleton-card { height: 320px; }
@keyframes shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }

/* ── Stats Bar ── */
.stats-bar {
  display: flex; justify-content: center; gap: 2.5rem;
  padding: 1.5rem 0; margin-bottom: 1.5rem;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}
.stat-item { text-align: center; }
.stat-value { font-size: 1.5rem; font-weight: 800; font-family: var(--font-display); background: var(--neon-grad); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; }
.stat-label { font-size: .75rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: .08em; margin-top: .2rem; }

/* ── Footer ── */
.footer {
  text-align: center; padding: 2rem 1.5rem;
  border-top: 1px solid var(--border);
  color: var(--text-muted); font-size: .82rem;
}

/* ── Responsive ── */
@media (max-width: 768px) {
  .navbar { padding: 0 1rem; }
  .nav-links { display: none; }
  .hero { padding: 3rem 1rem 2.5rem; min-height: 60vh; }
  .game-grid { grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 1rem; }
  .stats-bar { gap: 1.5rem; flex-wrap: wrap; }
  .modal { max-width: 100%; margin: .5rem; }
}
@media (max-width: 480px) {
  .game-grid { grid-template-columns: 1fr; }
  .hero h1 { font-size: clamp(1.5rem, 8vw, 2rem); }
  .search-bar { flex-direction: column; border-radius: var(--radius); padding: .75rem; }
  .search-bar button { width: 100%; }
}
