/* ===== BASE ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg: #0d0d1a;
  --bg2: #12121f;
  --bg3: #1a1a2e;
  --border: #1e1e3a;
  --accent: #e94560;
  --accent2: #0f3460;
  --text: #ffffff;
  --text-muted: #888;
  --text-dim: #aaa;
  --radius: 12px;
  --radius-sm: 8px;

  --cat-classic: #f39c12;
  --cat-action: #e74c3c;
  --cat-sports: #27ae60;
  --cat-casino: #9b59b6;
  --cat-trending: #3498db;
}

html { scroll-behavior: smooth; }

body {
  font-family: 'Rubik', system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.5;
}

a { text-decoration: none; color: inherit; }
button { font-family: inherit; }
img { display: block; max-width: 100%; }

.container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 20px;
}

/* ===== HEADER ===== */
.header {
  position: sticky; top: 0; z-index: 100;
  background: rgba(13, 13, 26, 0.95);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}

.header-inner {
  max-width: 1280px; margin: 0 auto;
  display: flex; align-items: center; gap: 16px;
  padding: 12px 20px;
}

.logo {
  display: flex; align-items: center; gap: 8px;
  flex-shrink: 0; text-decoration: none;
}
.logo-icon { font-size: 28px; }
.logo-text {
  font-size: 20px; font-weight: 800;
  background: linear-gradient(135deg, #e94560, #f39c12);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* Search */
.search-wrap {
  flex: 1; max-width: 480px; position: relative;
}
.search-input {
  width: 100%; padding: 10px 44px 10px 16px;
  background: var(--bg3); border: 1px solid var(--border);
  border-radius: 24px; color: var(--text); font-size: 14px;
  font-family: inherit; outline: none; transition: border-color 0.2s, box-shadow 0.2s;
}
.search-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(233,69,96,0.15);
}
.search-input::placeholder { color: var(--text-muted); }
.search-icon {
  position: absolute; right: 14px; top: 50%; transform: translateY(-50%);
  width: 18px; height: 18px; color: var(--text-muted); pointer-events: none;
}

.search-results {
  position: absolute; top: calc(100% + 8px); left: 0; right: 0;
  background: var(--bg2); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: 0 8px 32px rgba(0,0,0,0.4); z-index: 200; overflow: hidden;
  max-height: 400px; overflow-y: auto;
}
.search-results.hidden { display: none; }
.search-result-item {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 14px; cursor: pointer; transition: background 0.15s;
  text-decoration: none; color: var(--text);
}
.search-result-item:hover { background: var(--bg3); }
.search-result-thumb {
  width: 40px; height: 40px; border-radius: 8px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center; font-size: 20px;
}
.search-result-info { min-width: 0; }
.search-result-title { font-size: 14px; font-weight: 500; }
.search-result-cat { font-size: 12px; color: var(--text-muted); }
.search-no-results { padding: 20px; text-align: center; color: var(--text-muted); font-size: 14px; }

/* Nav */
.nav {
  display: flex; align-items: center; gap: 4px; flex-shrink: 0;
}
.nav-link {
  padding: 7px 12px; border-radius: 8px; font-size: 14px; font-weight: 500;
  color: var(--text-muted); transition: color 0.2s, background 0.2s;
  white-space: nowrap;
}
.nav-link:hover { color: var(--text); background: var(--bg3); }
.nav-link.active { color: var(--text); background: var(--bg3); }

/* Hamburger */
.hamburger {
  display: none; flex-direction: column; gap: 5px;
  background: none; border: none; cursor: pointer; padding: 4px;
}
.hamburger span {
  display: block; width: 22px; height: 2px;
  background: var(--text); border-radius: 2px; transition: transform 0.2s, opacity 0.2s;
}
.hamburger.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.hamburger.open span:nth-child(2) { opacity: 0; }
.hamburger.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ===== HERO ===== */
.hero {
  position: relative; overflow: hidden;
  padding: 64px 0 56px;
  background: linear-gradient(180deg, #12121f 0%, #0d0d1a 100%);
}
.hero-bg {
  position: absolute; inset: 0;
  background:
    radial-gradient(ellipse 60% 80% at 20% 50%, rgba(233,69,96,0.12) 0%, transparent 70%),
    radial-gradient(ellipse 50% 60% at 80% 30%, rgba(52,152,219,0.10) 0%, transparent 70%);
}
.hero-content { position: relative; text-align: center; }
.hero-title {
  font-size: clamp(36px, 6vw, 64px); font-weight: 800;
  line-height: 1.1; margin-bottom: 16px;
  background: linear-gradient(135deg, #fff 30%, #e94560 100%);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  background-clip: text;
}
.hero-sub { font-size: clamp(15px, 2vw, 18px); color: var(--text-muted); margin-bottom: 32px; }
.hero-stats { display: flex; justify-content: center; gap: 40px; }
.stat { display: flex; flex-direction: column; align-items: center; gap: 2px; }
.stat-num { font-size: 28px; font-weight: 800; color: var(--text); }
.stat-label { font-size: 13px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 1px; }

/* ===== SECTIONS ===== */
.section { padding: 48px 0; }
.section + .section { padding-top: 0; }

.section-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 20px;
}
.section-title {
  font-size: 22px; font-weight: 700;
  display: flex; align-items: center; gap: 10px;
}
.see-all {
  font-size: 14px; color: var(--text-muted);
  transition: color 0.2s; white-space: nowrap;
}
.see-all:hover { color: var(--accent); }

/* Category badges */
.cat-badge {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 10px; border-radius: 20px; font-size: 13px; font-weight: 600;
}
.cat-classic { background: rgba(243,156,18,0.15); color: var(--cat-classic); }
.cat-action  { background: rgba(231,76,60,0.15);  color: var(--cat-action); }
.cat-sports  { background: rgba(39,174,96,0.15);  color: var(--cat-sports); }
.cat-casino  { background: rgba(155,89,182,0.15); color: var(--cat-casino); }
.cat-trending{ background: rgba(52,152,219,0.15); color: var(--cat-trending); }

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

.game-card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
  text-decoration: none;
  display: block;
}
.game-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 32px rgba(0,0,0,0.4);
  border-color: rgba(255,255,255,0.12);
}

.game-thumb {
  width: 100%; aspect-ratio: 4/3;
  display: flex; align-items: center; justify-content: center;
  position: relative; overflow: hidden; font-size: 52px;
  background: var(--bg3);
}
.game-thumb img {
  width: 100%; height: 100%; object-fit: cover;
  transition: transform 0.3s;
}
.game-card:hover .game-thumb img { transform: scale(1.05); }
.game-thumb-emoji {
  font-size: 52px; line-height: 1;
  filter: drop-shadow(0 2px 8px rgba(0,0,0,0.4));
}
.game-thumb-overlay {
  position: absolute; inset: 0;
  background: rgba(0,0,0,0);
  display: flex; align-items: center; justify-content: center;
  transition: background 0.2s;
}
.game-card:hover .game-thumb-overlay { background: rgba(0,0,0,0.3); }
.play-icon {
  width: 48px; height: 48px;
  background: rgba(233,69,96,0.9); border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  opacity: 0; transform: scale(0.8); transition: opacity 0.2s, transform 0.2s;
}
.game-card:hover .play-icon { opacity: 1; transform: scale(1); }
.play-icon svg { width: 20px; height: 20px; fill: #fff; margin-left: 2px; }

.game-info { padding: 10px 12px 12px; }
.game-title {
  font-size: 14px; font-weight: 600; color: var(--text);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  margin-bottom: 4px;
}
.game-meta-row {
  display: flex; align-items: center; justify-content: space-between;
}
.game-year { font-size: 12px; color: var(--text-muted); }
.game-plays { font-size: 12px; color: var(--text-muted); }
.game-rating {
  font-size: 11px; color: #f1c40f;
  display: flex; align-items: center; gap: 2px;
}

/* Show more */
.show-more-btn {
  display: block; margin: 24px auto 0;
  padding: 10px 28px; background: var(--bg3);
  border: 1px solid var(--border); border-radius: 24px;
  color: var(--text-muted); font-size: 14px; cursor: pointer;
  transition: border-color 0.2s, color 0.2s, background 0.2s;
}
.show-more-btn:hover { border-color: var(--accent); color: var(--text); background: var(--bg2); }

/* ===== FOOTER ===== */
.footer {
  background: var(--bg2); border-top: 1px solid var(--border);
  padding: 48px 0 0;
}
.footer-inner {
  display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 40px;
  padding-bottom: 40px;
}
.footer-brand .logo-text { font-size: 22px; }
.footer-brand p { color: var(--text-muted); font-size: 14px; margin-top: 12px; line-height: 1.7; }
.footer-links h4 {
  font-size: 13px; color: var(--text-muted); text-transform: uppercase;
  letter-spacing: 1px; margin-bottom: 14px;
}
.footer-links a {
  display: block; color: var(--text-dim); font-size: 14px;
  margin-bottom: 8px; transition: color 0.2s;
}
.footer-links a:hover { color: var(--accent); }
.footer-bottom {
  border-top: 1px solid var(--border); padding: 16px 20px;
  text-align: center; color: var(--text-muted); font-size: 13px;
}
.footer-bottom a { color: var(--accent); }

/* ===== HIDDEN UTIL ===== */
.hidden { display: none !important; }

/* ===== RESPONSIVE ===== */
@media (max-width: 1024px) {
  .nav { display: none; }
  .hamburger { display: flex; }
  .nav.open {
    display: flex; flex-direction: column; align-items: flex-start;
    position: fixed; top: 60px; left: 0; right: 0;
    background: var(--bg2); border-bottom: 1px solid var(--border);
    padding: 16px 20px; gap: 4px; z-index: 99;
  }
  .nav.open .nav-link { width: 100%; padding: 10px 14px; }
}

@media (max-width: 768px) {
  .hero { padding: 40px 0 36px; }
  .hero-stats { gap: 24px; }
  .stat-num { font-size: 22px; }
  .games-grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 12px; }
  .footer-inner { grid-template-columns: 1fr 1fr; }
  .footer-brand { grid-column: 1 / -1; }
}

@media (max-width: 480px) {
  .header-inner { padding: 10px 14px; gap: 10px; }
  .logo-text { display: none; }
  .games-grid { grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 10px; }
  .footer-inner { grid-template-columns: 1fr; }
  .section { padding: 32px 0; }
}

/* ===== SCROLLBAR ===== */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #2e2e5a; }

/* ===== AD SLOTS ===== */
.ad-section { background: var(--bg); padding: 8px 0; }

.ad-slot { display: none; width: 100%; text-align: center; }
.ad-slot.ad-active { display: block; }

.ad-label {
  display: block; font-size: 10px; color: var(--text-muted);
  text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 4px;
}

/* Placeholder box shown before AdSense approval */
.ad-slot .adsbygoogle {
  min-height: 90px; background: var(--bg3);
  border: 1px dashed var(--border); border-radius: var(--radius-sm);
  display: block;
}

.ad-slot.ad-sidebar .adsbygoogle {
  min-height: 200px; margin-bottom: 16px;
}

/* ===== COOKIE BANNER ===== */
.cookie-banner {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 9999;
  background: var(--bg2); border-top: 1px solid var(--border);
  padding: 14px 20px;
}
.cookie-banner.hidden { display: none; }

.cookie-inner {
  max-width: 1280px; margin: 0 auto;
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; flex-wrap: wrap;
}
.cookie-inner p { font-size: 13px; color: var(--text-dim); flex: 1; min-width: 200px; }
.cookie-inner p a { color: var(--accent); text-decoration: underline; }

.cookie-actions { display: flex; gap: 8px; flex-shrink: 0; }
.cookie-actions button {
  padding: 8px 18px; border-radius: var(--radius-sm);
  border: 1px solid var(--border); background: var(--bg3);
  color: var(--text-dim); cursor: pointer; font-size: 13px;
  font-family: inherit; transition: background 0.2s, color 0.2s;
}
.cookie-actions button:hover { background: var(--bg); color: var(--text); }
.cookie-actions .cookie-accept {
  background: var(--accent); color: #fff; border-color: var(--accent);
}
.cookie-actions .cookie-accept:hover { background: #c73652; border-color: #c73652; }
