:root {
  --bg: #0a0a0b;
  --surface: #111113;
  --border: #222226;
  --text: #f4f4f5;
  --muted: #9a9aa2;
  --nav-h: 72px;
}

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

html, body {
  min-height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  height: var(--nav-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 0 32px;
  background: rgba(10, 10, 11, 0.85);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}

.brand { display: flex; align-items: center; flex-shrink: 0; }
.brand img { height: 36px; width: auto; display: block; }

.site-nav { display: flex; align-items: center; gap: 8px; }

.site-nav a {
  color: var(--text);
  text-decoration: none;
  font-size: 15px;
  font-weight: 500;
  padding: 8px 14px;
  border-radius: 8px;
  white-space: nowrap;
  transition: color 0.15s, background 0.15s;
}

.site-nav a:hover { color: var(--text); background: var(--surface); }
.site-nav a[aria-current="page"] { color: var(--text); }

main { min-height: calc(100vh - var(--nav-h)); }

.page { padding: 48px 32px; max-width: 1200px; margin: 0 auto; }

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

.game-card {
  display: block;
  color: var(--text);
  text-decoration: none;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  transition: transform 0.15s, border-color 0.15s;
}

a.game-card:hover { transform: translateY(-3px); border-color: #3a3a40; }

.game-cover { display: block; width: 100%; aspect-ratio: 16 / 9; object-fit: cover; image-rendering: pixelated; }

.game-info {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 18px;
}

.game-info h2 { font-size: 17px; font-weight: 800; letter-spacing: 0.5px; }

.game-action {
  font-size: 13px;
  font-weight: 600;
  padding: 6px 12px;
  border-radius: 999px;
  background: var(--text);
  color: var(--bg);
  white-space: nowrap;
}

/* Full-screen game page: the banner on top, the game frame fills the rest. */
body.game-page { height: 100vh; height: 100dvh; display: flex; flex-direction: column; overflow: hidden; }
body.game-page .site-header { position: relative; flex-shrink: 0; }
.game-frame-wrap { flex: 1 1 auto; min-height: 0; display: flex; }
.game-frame { flex: 1 1 auto; width: 100%; border: 0; display: block; background: #000; }

/* Ad placeholders: drop the ad network's tag inside each .ad-slot. */
.ad-rail span, .ad-banner span {
  display: block;
  margin-bottom: 6px;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: #5a5a62;
  text-align: center;
}

.ad-slot { background: var(--surface); border: 1px dashed var(--border); }

.ad-rail {
  position: fixed;
  top: calc(var(--nav-h) + 48px);
  width: 160px;
}
.ad-rail-left { left: 24px; }
.ad-rail-right { right: 24px; }
.ad-skyscraper { width: 160px; height: 600px; }

.ad-banner { margin: 40px auto 0; max-width: 728px; }
.ad-leaderboard { width: 100%; height: 90px; }

@media (max-width: 1599px) { .ad-rail { display: none; } }

.is-soon .game-action { background: transparent; color: var(--muted); border: 1px solid var(--border); }

@media (max-width: 720px) {
  :root { --nav-h: auto; }
  .site-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
    padding: 14px 16px;
  }
  .brand img { height: 30px; }
  .site-nav { gap: 2px; margin-left: -10px; flex-wrap: wrap; }
  .site-nav a { font-size: 14px; padding: 6px 10px; }
  main { min-height: 70vh; }
  .page { padding: 24px 16px; }
  .game-grid { grid-template-columns: 1fr; }
  .ad-leaderboard { height: 100px; max-width: 320px; margin: 0 auto; }
  .ad-banner { margin-top: 24px; }
}
