:root {
  --color-primary: #7BC74D;
  --color-primary-dark: #5AA832;
  --color-primary-light: #E8F5E0;
  --color-primary-bg: #F4FAF0;
  --color-text-dark: #2C2C2A;
  --color-text-muted: #888780;
  --color-text-light: #5F5E5A;
  --color-bg-white: #FFFFFF;
  --color-bg-card: #FFFFFF;
  --color-bg-page: #F7F9F5;
  --color-border: #E0E0D8;
  --color-shadow: rgba(0,0,0,0.08);
  --font-sans: 'Segoe UI', system-ui, -apple-system, sans-serif;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 20px;
}

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

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-sans);
  background: var(--color-bg-page);
  color: var(--color-text-dark);
  line-height: 1.6;
  min-height: 100vh;
}

/* === HEADER / NAV === */
.site-header {
  background: var(--color-bg-white);
  border-bottom: 1px solid var(--color-border);
  padding: 12px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 8px var(--color-shadow);
}

.header-logo {
  display: flex;
  align-items: center;
  gap: 10px;
}

.header-logo img {
  height: 40px;
  width: auto;
}

.header-logo-text {
  font-size: 18px;
  font-weight: 700;
  color: var(--color-primary-dark);
  letter-spacing: -0.5px;
}

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

.nav-link {
  padding: 6px 14px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 500;
  color: var(--color-text-dark);
  text-decoration: none;
  transition: all 0.2s;
}

.nav-link:hover {
  background: var(--color-primary-light);
  color: var(--color-primary-dark);
}

.nav-link.active {
  background: var(--color-primary);
  color: var(--color-bg-white);
}

/* === HERO / BANNER === */
.hero-section {
  background: linear-gradient(135deg, var(--color-primary-bg) 0%, #F0F7E6 40%, #E8F5E0 100%);
  padding: 40px 20px 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  max-width: 100%;
}

.hero-banner {
  max-width: 900px;
  width: 100%;
  border-radius: var(--radius-xl);
  overflow: hidden;
  box-shadow: 0 8px 24px rgba(124,199,77,0.2);
}

.hero-banner img {
  width: 100%;
  height: auto;
  display: block;
}

/* === SECTION TITLES === */
.section-title {
  font-size: 20px;
  font-weight: 700;
  color: var(--color-text-dark);
  padding: 20px 20px 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.section-title .icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  background: var(--color-primary);
  color: var(--color-bg-white);
  border-radius: var(--radius-sm);
  font-size: 14px;
}

/* === GAME GRID === */
.games-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 16px;
  padding: 8px 20px 24px;
}

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

.game-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 20px var(--color-shadow);
}

.game-thumb {
  width: 100%;
  aspect-ratio: 16/10;
  object-fit: cover;
  display: block;
  background: var(--color-primary-light);
}

.game-info {
  padding: 10px 12px;
}

.game-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--color-text-dark);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.game-category {
  font-size: 12px;
  color: var(--color-text-muted);
  margin-top: 2px;
}

/* === CATEGORIES BAR === */
.categories-bar {
  display: flex;
  gap: 8px;
  padding: 16px 20px;
  flex-wrap: wrap;
}

.cat-tag {
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 500;
  background: var(--color-bg-white);
  color: var(--color-text-dark);
  border: 1px solid var(--color-border);
  cursor: pointer;
  transition: all 0.2s;
  text-decoration: none;
}

.cat-tag:hover {
  background: var(--color-primary);
  color: var(--color-bg-white);
  border-color: var(--color-primary);
}

/* === FOOTER === */
.site-footer {
  background: var(--color-text-dark);
  color: rgba(255,255,255,0.7);
  padding: 32px 20px;
  text-align: center;
}

.footer-brand {
  font-size: 24px;
  font-weight: 700;
  color: var(--color-primary);
  margin-bottom: 4px;
}

.footer-slogan {
  font-size: 14px;
  color: rgba(255,255,255,0.5);
  letter-spacing: 2px;
  margin-bottom: 16px;
}

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

.footer-links a {
  color: rgba(255,255,255,0.6);
  text-decoration: none;
  font-size: 13px;
  transition: color 0.2s;
}

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

.footer-copy {
  font-size: 12px;
  color: rgba(255,255,255,0.35);
}

/* === AD SLOTS === */
.ad-slot {
  background: var(--color-bg-white);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  min-height: 100px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-text-muted);
  font-size: 11px;
  margin: 16px auto;
  max-width: 970px;
  overflow: hidden;
  position: relative;
  padding: 20px;
}

.ad-slot-top {
  min-height: 90px;
  margin: 16px auto 8px;
}

.ad-slot-middle {
  min-height: 90px;
  margin: 24px auto;
}

.ad-slot-bottom {
  min-height: 90px;
  margin: 16px auto 24px;
}

/* Hide ad placeholder text once ad loads */
.ad-slot:not(:empty) {
  border: none;
  background: transparent;
}

.ad-slot::before {
  content: 'Advertisement';
  position: absolute;
  font-size: 10px;
  color: var(--color-text-muted);
  opacity: 0.5;
}

.ad-slot:not(:empty)::before {
  display: none;
}

/* === GAME PLAY PAGE === */
.game-play-container {
  max-width: 100%;
  padding: 16px;
}

.game-play-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 0;
  margin-bottom: 8px;
}

.game-play-header h1 {
  font-size: 18px;
  font-weight: 700;
}

.game-play-header .back-btn {
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  background: var(--color-primary);
  color: white;
  font-size: 13px;
  font-weight: 500;
  text-decoration: none;
  transition: background 0.2s;
}

.game-play-header .back-btn:hover {
  background: var(--color-primary-dark);
}

.game-iframe-wrapper {
  position: relative;
  width: 100%;
  max-width: 800px;
  margin: 0 auto;
  aspect-ratio: 4/3;
  background: #000;
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: 0 4px 16px rgba(0,0,0,0.15);
}

.game-iframe-wrapper iframe {
  width: 100%;
  height: 100%;
  border: none;
  display: block;
}

.game-description {
  max-width: 800px;
  margin: 16px auto;
  padding: 16px;
  background: var(--color-bg-white);
  border-radius: var(--radius-md);
  border: 1px solid var(--color-border);
}

.game-description h2 {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 8px;
}

.game-description p {
  font-size: 14px;
  color: var(--color-text-light);
  line-height: 1.6;
}

/* === RESPONSIVE === */
@media (max-width: 768px) {
  .site-header {
    padding: 10px 12px;
  }

  .header-logo img {
    height: 32px;
  }

  .header-logo-text {
    font-size: 15px;
  }

  .header-nav {
    gap: 4px;
  }

  .nav-link {
    padding: 5px 10px;
    font-size: 13px;
  }

  .hero-section {
    padding: 20px 12px 16px;
  }

  .games-grid {
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 10px;
    padding: 8px 12px 20px;
  }

  .section-title {
    font-size: 17px;
    padding: 16px 12px 8px;
  }

  .categories-bar {
    padding: 12px;
    gap: 6px;
  }

  .cat-tag {
    padding: 6px 12px;
    font-size: 12px;
  }

  .game-iframe-wrapper {
    aspect-ratio: 16/12;
  }
}

@media (max-width: 480px) {
  .games-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
    padding: 8px 10px 16px;
  }

  .hero-banner {
    border-radius: var(--radius-md);
  }
}
