/* ── TOKENS ── */
:root {
  --bg: #0a0a0f;
  --surface: #13131a;
  --surface2: #1c1c28;
  --accent: #7c3aed;
  --accent2: #06b6d4;
  --neon: #a855f7;
  --text: #f1f0ff;
  --muted: #8b8aa0;
  --card-border: #2a2a3d;
  --radius: 12px;
  --font-display: 'Oxanium', sans-serif;
  --font-body: 'Inter', sans-serif;
}

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

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  min-height: 100vh;
}

/* ── HEADER ── */
header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(10,10,15,0.92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--card-border);
  padding: 0 24px;
}

.header-inner {
  max-width: 1280px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 32px;
  height: 64px;
}

.logo {
  font-family: var(--font-display);
  font-size: 1.4rem;
  font-weight: 800;
  white-space: nowrap;
  color: var(--text);
}

.logo span { color: var(--neon); }

nav {
  display: flex;
  gap: 4px;
  flex: 1;
}

nav a {
  color: var(--muted);
  text-decoration: none;
  font-size: 0.875rem;
  font-weight: 500;
  padding: 6px 12px;
  border-radius: 8px;
  transition: all 0.2s;
  white-space: nowrap;
}

nav a:hover {
  color: var(--text);
  background: var(--surface2);
}

.search-bar {
  display: flex;
  align-items: center;
  background: var(--surface2);
  border: 1px solid var(--card-border);
  border-radius: 8px;
  overflow: hidden;
  min-width: 220px;
}

.search-bar input {
  background: none;
  border: none;
  outline: none;
  color: var(--text);
  padding: 8px 12px;
  font-size: 0.875rem;
  width: 100%;
  font-family: var(--font-body);
}

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

.search-bar button {
  background: var(--accent);
  border: none;
  padding: 8px 12px;
  cursor: pointer;
  font-size: 1rem;
  transition: background 0.2s;
}

.search-bar button:hover { background: var(--neon); }

/* ── HERO ── */
.hero {
  position: relative;
  padding: 80px 24px;
  text-align: center;
  overflow: hidden;
}

.hero-bg {
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse 80% 60% at 50% 0%, rgba(124,58,237,0.25) 0%, transparent 70%),
              radial-gradient(ellipse 60% 40% at 80% 50%, rgba(6,182,212,0.1) 0%, transparent 60%);
  pointer-events: none;
}

.hero-content { position: relative; z-index: 1; }

.hero h1 {
  font-family: var(--font-display);
  font-size: clamp(2.5rem, 6vw, 5rem);
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.02em;
  margin-bottom: 16px;
}

.hero h1 span {
  background: linear-gradient(135deg, var(--accent2), var(--neon));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero p {
  color: var(--muted);
  font-size: 1.2rem;
  margin-bottom: 32px;
}

.cta-btn {
  display: inline-block;
  background: linear-gradient(135deg, var(--accent), var(--neon));
  color: white;
  text-decoration: none;
  padding: 14px 32px;
  border-radius: 50px;
  font-weight: 600;
  font-size: 1rem;
  transition: transform 0.2s, box-shadow 0.2s;
  box-shadow: 0 0 30px rgba(124,58,237,0.4);
}

.cta-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 0 40px rgba(124,58,237,0.6);
}

/* ── AD SLOTS ── */
.ad-slot {
  max-width: 1280px;
  margin: 0 auto;
  padding: 12px 24px;
}

.ad-placeholder {
  background: var(--surface);
  border: 1px dashed var(--card-border);
  border-radius: var(--radius);
  text-align: center;
  color: var(--muted);
  font-size: 0.75rem;
  padding: 20px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.ad-placeholder.small { padding: 10px; }

/* ── SECTIONS ── */
.section {
  max-width: 1280px;
  margin: 0 auto;
  padding: 40px 24px;
}

.section-title {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 24px;
  display: flex;
  align-items: center;
  gap: 10px;
}

/* ── GAMES GRID ── */
.games-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 16px;
}

.game-card {
  background: var(--surface);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  overflow: hidden;
  cursor: pointer;
  transition: transform 0.2s, border-color 0.2s, box-shadow 0.2s;
  position: relative;
}

.game-card:hover {
  transform: translateY(-4px);
  border-color: var(--accent);
  box-shadow: 0 8px 30px rgba(124,58,237,0.25);
}

.game-thumb {
  width: 100%;
  aspect-ratio: 16/10;
  object-fit: cover;
  display: block;
  background: var(--surface2);
  font-size: 3rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.game-info {
  padding: 12px;
}

.game-title {
  font-family: var(--font-display);
  font-size: 0.9rem;
  font-weight: 600;
  margin-bottom: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.game-tag {
  font-size: 0.7rem;
  color: var(--muted);
  background: var(--surface2);
  padding: 2px 8px;
  border-radius: 20px;
  display: inline-block;
}

.play-overlay {
  position: absolute;
  inset: 0;
  background: rgba(124,58,237,0.85);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.2s;
  font-size: 2.5rem;
}

.game-card:hover .play-overlay { opacity: 1; }

/* ── MODAL ── */
.modal {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 1000;
  width: 90vw;
  max-width: 960px;
  background: var(--surface);
  border: 1px solid var(--card-border);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 25px 80px rgba(0,0,0,0.8);
}

.modal.hidden { display: none; }

.overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.85);
  z-index: 999;
  backdrop-filter: blur(4px);
}

.overlay.hidden { display: none; }

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--card-border);
}

.modal-header h3 {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 700;
}

.close-btn {
  background: var(--surface2);
  border: 1px solid var(--card-border);
  color: var(--text);
  padding: 6px 14px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 0.875rem;
  transition: background 0.2s;
}

.close-btn:hover { background: #ef4444; border-color: #ef4444; }

.modal-ad { padding: 8px 20px; }

#gameFrame {
  width: 100%;
  height: 520px;
  border: none;
  display: block;
  background: #000;
}

/* ── FOOTER ── */
footer {
  border-top: 1px solid var(--card-border);
  padding: 40px 24px;
  margin-top: 40px;
}

.footer-inner {
  max-width: 1280px;
  margin: 0 auto;
  text-align: center;
}

.footer-inner p {
  color: var(--muted);
  margin: 12px 0;
  font-size: 0.875rem;
}

.footer-links {
  display: flex;
  justify-content: center;
  gap: 24px;
  margin: 16px 0;
}

.footer-links a {
  color: var(--muted);
  text-decoration: none;
  font-size: 0.875rem;
  transition: color 0.2s;
}

.footer-links a:hover { color: var(--neon); }

.copy { font-size: 0.75rem !important; }

/* ── RESPONSIVE ── */
@media (max-width: 768px) {
  nav { display: none; }
  .header-inner { gap: 16px; }
  .search-bar { min-width: 160px; }
  .games-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
  #gameFrame { height: 320px; }
}

/* ── HIDDEN SEARCH RESULTS ── */
#searchResults {
  max-width: 1280px;
  margin: 0 auto;
  padding: 20px 24px 0;
}

#searchResults h2 {
  font-family: var(--font-display);
  font-size: 1.2rem;
  margin-bottom: 16px;
  color: var(--muted);
}
