/* ============================================================
   GAME HUB — style.css
   Dark premium arcade aesthetic.
   Fonts: Rajdhani (display) + DM Sans (body)
   Palette: Deep navy base · Cyan accent · Violet secondary
   ============================================================ */

/* ── Custom Properties ── */
:root {
  /* Core palette */
  --bg-base:        #080c14;
  --bg-surface:     #0d1320;
  --bg-card:        #111928;
  --bg-card-hover:  #161f30;
  --border:         rgba(255, 255, 255, 0.07);
  --border-hover:   rgba(0, 212, 255, 0.35);

  /* Accents */
  --cyan:           #00d4ff;
  --cyan-dim:       rgba(0, 212, 255, 0.12);
  --cyan-glow:      rgba(0, 212, 255, 0.25);
  --violet:         #7c5cfc;
  --violet-dim:     rgba(124, 92, 252, 0.15);
  --violet-glow:    rgba(124, 92, 252, 0.3);
  --emerald:        #00e5a0;
  --amber:          #ffb830;
  --rose:           #ff4f7b;

  /* Text */
  --text-primary:   #eef2f9;
  --text-secondary: #7a8ba8;
  --text-muted:     #465670;

  /* Fonts */
  --font-display:   'Rajdhani', sans-serif;
  --font-body:      'DM Sans', sans-serif;

  /* Spacing & shape */
  --radius-sm:      6px;
  --radius:         12px;
  --radius-lg:      18px;
  --radius-pill:    100px;
  --nav-height:     64px;
  --transition:     0.22s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ── Reset & Base ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
  font-size: 16px;
  scroll-behavior: smooth;
  scrollbar-color: var(--bg-card) var(--bg-base);
}

body {
  background-color: var(--bg-base);
  color: var(--text-primary);
  font-family: var(--font-body);
  font-weight: 400;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  /* Staggered fade-in on load */
  animation: page-fade 0.5s ease both;
}

@keyframes page-fade {
  from { opacity: 0; }
  to   { opacity: 1; }
}

a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; border: none; background: none; }
img { display: block; max-width: 100%; }
ul { list-style: none; }

/* ── Scanline overlay ── */
.scanlines {
  position: fixed;
  inset: 0;
  background: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 2px,
    rgba(0, 0, 0, 0.06) 2px,
    rgba(0, 0, 0, 0.06) 4px
  );
  pointer-events: none;
  z-index: 999;
  mix-blend-mode: overlay;
}

/* ════════════════════════════════════
   NAV
   ════════════════════════════════════ */
.nav {
  position: sticky;
  top: 0;
  z-index: 200;
  background: rgba(8, 12, 20, 0.85);
  backdrop-filter: blur(16px) saturate(180%);
  -webkit-backdrop-filter: blur(16px) saturate(180%);
  border-bottom: 1px solid var(--border);
  transition: box-shadow var(--transition);
}

.nav.scrolled {
  box-shadow: 0 4px 32px rgba(0, 0, 0, 0.5);
}

.nav-inner {
  max-width: 1280px;
  margin: 0 auto;
  height: var(--nav-height);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
}

/* Logo */
.nav-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: 0.5px;
  color: var(--text-primary);
  transition: color var(--transition);
}

.nav-logo:hover { color: var(--cyan); }

.nav-logo span em { font-style: normal; color: var(--cyan); }

.logo-icon {
  width: 28px;
  height: 24px;
  color: var(--cyan);
  flex-shrink: 0;
}

/* Desktop links */
.nav-links {
  display: flex;
  align-items: center;
  gap: 4px;
}

.nav-link {
  font-family: var(--font-display);
  font-size: 0.95rem;
  font-weight: 500;
  letter-spacing: 0.5px;
  color: var(--text-secondary);
  padding: 6px 14px;
  border-radius: var(--radius-pill);
  transition: color var(--transition), background var(--transition);
}

.nav-link:hover,
.nav-link.active {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.06);
}

/* Mobile hamburger */
.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  padding: 6px;
  border-radius: var(--radius-sm);
  transition: background var(--transition);
}

.nav-toggle:hover { background: rgba(255,255,255,0.06); }

.nav-toggle span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--text-primary);
  border-radius: 2px;
  transition: transform var(--transition), opacity var(--transition);
}

/* Hamburger → X */
.nav-toggle.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle.open span:nth-child(2) { opacity: 0; transform: scaleX(0); }
.nav-toggle.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* Mobile drawer */
.nav-drawer {
  display: none;
  flex-direction: column;
  gap: 2px;
  padding: 12px 16px 16px;
  border-top: 1px solid var(--border);
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease, padding 0.3s ease;
}

.nav-drawer.open {
  max-height: 200px;
}

.nav-drawer .nav-link {
  padding: 10px 14px;
}

/* ════════════════════════════════════
   HERO
   ════════════════════════════════════ */
.hero {
  position: relative;
  min-height: 540px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  padding: 80px 24px 0;
  overflow: hidden;
}

/* Decorative BG */
.hero-bg {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

/* Perspective grid */
.hero-grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(0,212,255,0.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0,212,255,0.06) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(ellipse 80% 70% at 50% 60%, black 30%, transparent 100%);
}

/* Ambient glows */
.hero-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(90px);
}

.orb-cyan {
  width: 600px; height: 600px;
  top: -200px; left: -100px;
  background: radial-gradient(circle, rgba(0,212,255,0.13) 0%, transparent 70%);
}

.orb-violet {
  width: 500px; height: 500px;
  top: -100px; right: -80px;
  background: radial-gradient(circle, rgba(124,92,252,0.15) 0%, transparent 70%);
}

.orb-mid {
  width: 400px; height: 300px;
  bottom: 0; left: 50%;
  transform: translateX(-50%);
  background: radial-gradient(circle, rgba(0,212,255,0.07) 0%, transparent 70%);
}

/* Hero content */
.hero-content {
  position: relative;
  z-index: 1;
  max-width: 680px;
}

.hero-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-display);
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--cyan);
  margin-bottom: 18px;
  animation: slide-up 0.6s 0.1s ease both;
}

.eyebrow-dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--cyan);
  box-shadow: 0 0 8px var(--cyan);
  animation: pulse-dot 2s ease infinite;
}

@keyframes pulse-dot {
  0%, 100% { opacity: 1; box-shadow: 0 0 8px var(--cyan); }
  50%       { opacity: 0.5; box-shadow: 0 0 4px var(--cyan); }
}

.hero-title {
  font-family: var(--font-display);
  font-size: clamp(2.8rem, 6vw, 4.8rem);
  font-weight: 700;
  line-height: 1.05;
  letter-spacing: -0.5px;
  color: var(--text-primary);
  margin-bottom: 20px;
  animation: slide-up 0.6s 0.2s ease both;
}

.hero-accent {
  background: linear-gradient(135deg, var(--cyan) 0%, var(--violet) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-sub {
  font-size: 1.05rem;
  color: var(--text-secondary);
  max-width: 480px;
  margin: 0 auto 36px;
  line-height: 1.7;
  animation: slide-up 0.6s 0.3s ease both;
}

/* Search bar */
.search-wrap {
  position: relative;
  max-width: 480px;
  margin: 0 auto;
  animation: slide-up 0.6s 0.4s ease both;
}

.search-icon {
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  width: 18px; height: 18px;
  color: var(--text-muted);
  pointer-events: none;
  transition: color var(--transition);
}

.search-input {
  width: 100%;
  height: 52px;
  padding: 0 48px 0 48px;
  background: rgba(255,255,255,0.05);
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 0.95rem;
  outline: none;
  transition: border-color var(--transition), background var(--transition), box-shadow var(--transition);
  /* Remove browser default search styling */
  -webkit-appearance: none;
}

.search-input::placeholder { color: var(--text-muted); }

.search-input:focus {
  border-color: var(--cyan);
  background: rgba(0,212,255,0.05);
  box-shadow: 0 0 0 3px rgba(0,212,255,0.1), 0 4px 20px rgba(0,0,0,0.3);
}

.search-input:focus + .search-kbd { opacity: 0; }
.search-input:focus ~ .search-icon,
.search-wrap:focus-within .search-icon { color: var(--cyan); }

/* Remove default X on search inputs */
.search-input::-webkit-search-cancel-button { -webkit-appearance: none; }

.search-kbd {
  position: absolute;
  right: 16px;
  top: 50%;
  transform: translateY(-50%);
  font-family: var(--font-display);
  font-size: 0.8rem;
  color: var(--text-muted);
  background: rgba(255,255,255,0.07);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 2px 7px;
  transition: opacity var(--transition);
  pointer-events: none;
}

/* Hero stats strip */
.hero-stats {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 0;
  margin-top: 56px;
  padding: 20px 48px;
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--border);
  border-bottom: none;
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  max-width: 640px;
  width: 100%;
  animation: slide-up 0.6s 0.5s ease both;
}

.stat {
  flex: 1;
  text-align: center;
}

.stat strong {
  display: block;
  font-family: var(--font-display);
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--cyan);
  line-height: 1;
  margin-bottom: 4px;
}

.stat span {
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--text-muted);
}

.stat-rule {
  width: 1px;
  height: 36px;
  background: var(--border);
  flex-shrink: 0;
}

/* ════════════════════════════════════
   MAIN / GAME GRID AREA
   ════════════════════════════════════ */
.main {
  max-width: 1280px;
  margin: 0 auto;
  padding: 48px 24px 80px;
}

/* Section heading row */
.section-header {
  display: flex;
  align-items: baseline;
  gap: 16px;
  margin-bottom: 20px;
}

.section-title {
  font-family: var(--font-display);
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: 0.5px;
}

.visible-count {
  font-size: 0.8rem;
  color: var(--text-muted);
  font-weight: 400;
}

/* Filter pills */
.filter-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 36px;
}

.pill {
  font-family: var(--font-display);
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.5px;
  padding: 6px 16px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  background: transparent;
  cursor: pointer;
  transition: all var(--transition);
}

.pill:hover {
  color: var(--text-primary);
  border-color: rgba(255,255,255,0.2);
  background: rgba(255,255,255,0.05);
}

.pill.active {
  background: var(--cyan-dim);
  border-color: var(--cyan);
  color: var(--cyan);
  box-shadow: 0 0 12px rgba(0,212,255,0.1);
}

/* ════════════════════════════════════
   GAME CARDS
   ════════════════════════════════════ */
.game-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(288px, 1fr));
  gap: 20px;
}

/* Individual card */
.game-card {
  position: relative;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  cursor: pointer;
  transition:
    transform var(--transition),
    border-color var(--transition),
    box-shadow var(--transition),
    background var(--transition);
  /* Staggered entrance animation applied via JS */
  opacity: 0;
  transform: translateY(16px);
  animation: card-in 0.45s ease forwards;
  display: flex;
  flex-direction: column;
  outline: none;
}

@keyframes card-in {
  to { opacity: 1; transform: translateY(0); }
}

.game-card:hover,
.game-card:focus-visible {
  transform: translateY(-4px);
  background: var(--bg-card-hover);
  border-color: var(--border-hover);
  box-shadow:
    0 0 0 1px rgba(0,212,255,0.15),
    0 8px 32px rgba(0,0,0,0.4),
    0 0 40px rgba(0,212,255,0.08);
}

/* Accent color line at top — colored per genre via data-attr */
.game-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: var(--card-accent, var(--cyan));
  opacity: 0;
  transition: opacity var(--transition);
}

.game-card:hover::before,
.game-card:focus-visible::before { opacity: 1; }

/* Thumbnail area */
.card-thumb {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: var(--card-thumb-bg, #111928);
  overflow: hidden;
  flex-shrink: 0;
}

.card-thumb-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease, filter 0.4s ease;
  filter: brightness(0.85) saturate(1.1);
}

.game-card:hover .card-thumb-img {
  transform: scale(1.04);
  filter: brightness(1) saturate(1.2);
}

/* Thumbnail placeholder (used when no real image) */
.card-thumb-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: var(--card-thumb-bg, #111928);
  transition: transform 0.4s ease;
}

.game-card:hover .card-thumb-placeholder { transform: scale(1.04); }

.thumb-emoji {
  font-size: 3rem;
  line-height: 1;
  transition: transform 0.3s ease;
}

.game-card:hover .thumb-emoji { transform: scale(1.15) rotate(-3deg); }

.thumb-label {
  font-family: var(--font-display);
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--text-muted);
}

/* Genre badge on thumbnail */
.card-badge {
  position: absolute;
  top: 10px;
  left: 10px;
  font-family: var(--font-display);
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  padding: 3px 9px;
  border-radius: var(--radius-pill);
  background: rgba(0,0,0,0.6);
  border: 1px solid var(--card-accent, var(--cyan));
  color: var(--card-accent, var(--cyan));
  backdrop-filter: blur(8px);
}

/* Card body */
.card-body {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 18px 20px 20px;
  flex: 1;
}

.card-title {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: 0.3px;
  color: var(--text-primary);
  line-height: 1.2;
  transition: color var(--transition);
}

.game-card:hover .card-title { color: var(--cyan); }

.card-desc {
  font-size: 0.83rem;
  color: var(--text-secondary);
  line-height: 1.55;
  flex: 1;
}

/* Play button */
.card-cta {
  margin-top: 14px;
}

.btn-play {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  justify-content: center;
  padding: 10px 20px;
  border-radius: var(--radius);
  font-family: var(--font-display);
  font-size: 0.9rem;
  font-weight: 700;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  color: var(--bg-base);
  background: var(--card-accent, var(--cyan));
  border: none;
  cursor: pointer;
  transition:
    background var(--transition),
    box-shadow var(--transition),
    transform var(--transition);
  position: relative;
  overflow: hidden;
}

.btn-play::after {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(255,255,255,0);
  transition: background var(--transition);
}

.btn-play:hover::after { background: rgba(255,255,255,0.12); }
.btn-play:active { transform: scale(0.97); }

.btn-play:hover {
  box-shadow: 0 0 20px rgba(0,212,255,0.3), 0 4px 12px rgba(0,0,0,0.3);
}

.btn-play-icon {
  font-size: 0.85rem;
  transition: transform var(--transition);
}

.btn-play:hover .btn-play-icon { transform: translateX(3px); }

/* Card shimmer on hover */
.game-card::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(
    135deg,
    rgba(255,255,255,0.03) 0%,
    transparent 50%,
    rgba(255,255,255,0.02) 100%
  );
  pointer-events: none;
  opacity: 0;
  transition: opacity var(--transition);
}

.game-card:hover::after { opacity: 1; }

/* ════════════════════════════════════
   EMPTY STATE
   ════════════════════════════════════ */
.empty-state {
  text-align: center;
  padding: 80px 24px;
}

.empty-icon {
  font-size: 3.5rem;
  display: block;
  margin-bottom: 20px;
  filter: grayscale(0.4);
}

.empty-state h3 {
  font-family: var(--font-display);
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 8px;
}

.empty-state p {
  font-size: 0.88rem;
  color: var(--text-secondary);
  margin-bottom: 24px;
}

.btn-reset-search {
  padding: 10px 28px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--cyan);
  color: var(--cyan);
  font-family: var(--font-display);
  font-size: 0.88rem;
  font-weight: 600;
  background: transparent;
  cursor: pointer;
  transition: background var(--transition), color var(--transition);
}

.btn-reset-search:hover {
  background: var(--cyan);
  color: var(--bg-base);
}

/* ════════════════════════════════════
   ABOUT SECTION
   ════════════════════════════════════ */
.about {
  background: var(--bg-surface);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  padding: 80px 24px;
}

.about-inner {
  max-width: 640px;
  margin: 0 auto;
}

.about-eyebrow {
  font-family: var(--font-display);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: var(--violet);
  margin-bottom: 12px;
}

.about-title {
  font-family: var(--font-display);
  font-size: clamp(1.8rem, 3vw, 2.8rem);
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 24px;
  line-height: 1.1;
}

.about-body {
  font-size: 0.95rem;
  color: var(--text-secondary);
  line-height: 1.8;
  margin-bottom: 16px;
}

.about-body strong { color: var(--text-primary); }
.about-body code {
  font-family: 'Courier New', monospace;
  font-size: 0.85em;
  background: rgba(255,255,255,0.07);
  padding: 1px 6px;
  border-radius: 4px;
  color: var(--cyan);
}

/* ════════════════════════════════════
   FOOTER
   ════════════════════════════════════ */
.footer {
  padding: 28px 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  background: var(--bg-base);
}

.footer-logo {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-muted);
  letter-spacing: 1px;
}

.footer-copy {
  font-size: 0.78rem;
  color: var(--text-muted);
}

/* ════════════════════════════════════
   SHARED ANIMATIONS
   ════════════════════════════════════ */
@keyframes slide-up {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ════════════════════════════════════
   RESPONSIVE
   ════════════════════════════════════ */
@media (max-width: 768px) {
  /* Show hamburger, hide desktop links */
  .nav-links { display: none; }
  .nav-toggle { display: flex; }
  .nav-drawer { display: flex; }
  .nav-drawer.open { display: flex; }

  .hero {
    padding: 60px 16px 0;
    min-height: 480px;
  }

  .hero-stats {
    padding: 16px 24px;
    gap: 0;
  }

  .stat strong { font-size: 1.4rem; }

  .main { padding: 36px 16px 60px; }

  .game-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .section-header { flex-direction: column; gap: 4px; }
}

@media (min-width: 560px) and (max-width: 900px) {
  .game-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* Reduce motion for accessibility */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}
