/* ============================================
   MATHDEN STYLESHEET — v1
   ============================================ */

/* Reset + Base */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --bg: #0a0a0f;
  --bg-card: #15151f;
  --bg-card-hover: #1e1e2d;
  --border: #2a2a3a;
  --text: #ffffff;
  --text-dim: #8a8a9a;
  --accent: #00ff9d;
  --accent-glow: rgba(0, 255, 157, 0.15);
  --radius: 16px;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.5;
}

/* ============================================
   HEADER
   ============================================ */
header {
  position: sticky;
  top: 0;
  background: rgba(10, 10, 15, 0.85);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  padding: 16px 24px;
  z-index: 100;
}

.header-inner {
  max-width: 1400px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 24px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.5px;
  color: var(--text);
  text-decoration: none;
  white-space: nowrap;
}

.logo-emoji {
  font-size: 28px;
}

.search-bar {
  flex: 1;
  max-width: 500px;
  position: relative;
}

.search-bar input {
  width: 100%;
  padding: 12px 18px 12px 44px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--text);
  font-size: 15px;
  transition: all 0.2s;
}

.search-bar input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

.search-bar input::placeholder {
  color: var(--text-dim);
}

.search-icon {
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-dim);
  pointer-events: none;
}

/* ============================================
   MAIN LAYOUT
   ============================================ */
main {
  max-width: 1400px;
  margin: 0 auto;
  padding: 32px 24px 80px;
}

.section-title {
  font-size: 24px;
  font-weight: 700;
  margin-bottom: 20px;
  letter-spacing: -0.3px;
}

/* ============================================
   GAME GRID
   ============================================ */
.game-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
}

@media (max-width: 1024px) {
  .game-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 720px) {
  .game-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
  }
}

/* ============================================
   GAME CARD
   ============================================ */
.game-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  cursor: pointer;
  transition: all 0.2s ease;
  text-decoration: none;
  color: inherit;
  display: block;
}

.game-card:hover {
  transform: translateY(-4px);
  background: var(--bg-card-hover);
  border-color: var(--accent);
  box-shadow: 0 8px 24px var(--accent-glow);
}

.game-card-thumb {
  width: 100%;
  aspect-ratio: 16/10;
  background: var(--bg);
  object-fit: cover;
  display: block;
}

.game-card-body {
  padding: 12px 14px;
}

.game-card-title {
  font-size: 15px;
  font-weight: 600;
  margin-bottom: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.game-card-tag {
  font-size: 12px;
  color: var(--text-dim);
}

/* ============================================
   EMPTY STATE
   ============================================ */
.empty-state {
  text-align: center;
  padding: 80px 20px;
  color: var(--text-dim);
}
/* ============================================
   CATEGORY TABS
   ============================================ */
.category-tabs {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 12px;
  margin-bottom: 28px;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.category-tabs::-webkit-scrollbar {
  display: none;
}

.category-tab {
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text-dim);
  padding: 10px 18px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s;
  font-family: inherit;
}

.category-tab:hover {
  color: var(--text);
  border-color: var(--accent);
}

.category-tab.active {
  background: var(--accent);
  color: #000;
  border-color: var(--accent);
}

/* Section spacing */
section {
  margin-bottom: 40px;
}

/* ============================================
   FOOTER
   ============================================ */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 32px 24px;
  background: var(--bg-card);
  color: var(--text-dim);
  font-size: 13px;
  margin-top: 60px;
}

.footer-inner {
  max-width: 1400px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
}

.footer-links {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
}

.footer-links a {
  color: var(--text-dim);
  text-decoration: none;
  transition: color 0.2s;
}

.footer-links a:hover {
  color: var(--accent);
}

/* ============================================
   MOBILE REFINEMENTS
   ============================================ */
@media (max-width: 480px) {
  .header-inner {
    gap: 12px;
  }

  .logo span:last-child {
    display: none;
  }

  .logo-emoji {
    font-size: 30px;
  }

  .search-bar input {
    padding: 10px 16px 10px 40px;
    font-size: 14px;
  }

  .section-title {
    font-size: 20px;
  }

  main {
    padding: 20px 16px 60px;
  }

  .category-tab {
    padding: 8px 14px;
    font-size: 13px;
  }

  .footer-inner {
    flex-direction: column;
    text-align: center;
  }
}
/* ============================================
   TEXT PAGES (About, Privacy, Terms)
   ============================================ */
.text-page {
  max-width: 760px;
  margin: 0 auto;
  padding: 60px 24px 80px;
  line-height: 1.7;
}

.text-page h1 {
  font-size: 38px;
  margin-bottom: 16px;
  letter-spacing: -0.5px;
}

.text-page h2 {
  font-size: 22px;
  margin: 40px 0 12px;
  color: var(--text);
}

.text-page .lead {
  font-size: 18px;
  color: var(--text-dim);
  margin-bottom: 32px;
}

.text-page p,
.text-page ul {
  color: #c8c8d0;
  margin-bottom: 16px;
}

.text-page ul {
  padding-left: 24px;
}

.text-page li {
  margin-bottom: 8px;
}

.text-page a {
  color: var(--accent);
  text-decoration: none;
}

.text-page a:hover {
  text-decoration: underline;
}

@media (max-width: 480px) {
  .text-page h1 {
    font-size: 28px;
  }
  
  .text-page h2 {
    font-size: 18px;
  }
  
  .text-page {
    padding: 40px 16px 60px;
  }
}
/* ============================================
   AD SLOTS
   ============================================ */
.ad-slot {
  max-width: 1400px;
  margin: 20px auto;
  padding: 0 24px;
  text-align: center;
  min-height: 90px;
  display: flex;
  justify-content: center;
  align-items: center;
}

/* When slot is empty (no ad loaded), hide it */
.ad-slot:empty {
  display: none;
}

/* Ads inside fill nicely */
.ad-slot iframe,
.ad-slot ins,
.ad-slot > div {
  max-width: 100%;
}

/* Spacing tweaks for each placement */
.ad-top {
  margin-top: 8px;
  margin-bottom: 24px;
}

.ad-middle {
  margin: 40px auto;
}

.ad-below-game {
  margin: 16px auto 32px;
}

@media (max-width: 480px) {
  .ad-slot {
    padding: 0 16px;
    min-height: 60px;
    margin: 16px auto;
  }
}
/* TEMPORARY: show ad slot positions for development */
.ad-slot:empty {
  display: flex;
  background: rgba(0, 255, 157, 0.05);
  border: 2px dashed var(--accent);
  border-radius: 8px;
  color: var(--accent);
  font-size: 12px;
  opacity: 0.4;
}

.ad-slot:empty::before {
  content: "AD SLOT — " attr(data-slot);
}

/* ============================================
   ADSTERRA MOBILE STICKY BANNER (320x50)
   Shows only on phones, fixed at bottom
   ============================================ */
.ad-mobile-sticky {
  display: none;
}

@media (max-width: 768px) {
  .ad-mobile-sticky {
    display: block;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--bg-card);
    border-top: 1px solid var(--border);
    z-index: 9999;
    text-align: center;
    padding: 4px 0;
    min-height: 56px;
  }

  /* Push site content up so footer/last cards aren't covered */
  body {
    padding-bottom: 64px;
  }
}
/* ============================================
   LOAD MORE
   ============================================ */
.load-more-wrap {
  text-align: center;
  margin: 40px auto 20px;
  padding: 0 24px;
}

.load-more-count {
  color: var(--text-dim);
  font-size: 13px;
  margin: 0 0 12px;
}

.load-more-btn {
  background: var(--accent);
  color: #000;
  border: none;
  padding: 14px 32px;
  border-radius: 999px;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
  transition: transform 0.1s, box-shadow 0.1s;
}

.load-more-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(0, 255, 157, 0.3);
}

.load-more-btn:active {
  transform: translateY(0);
}

@media (max-width: 480px) {
  .load-more-btn {
    padding: 12px 28px;
    font-size: 14px;
    width: 100%;
    max-width: 280px;
  }
}
/* ============================================
   HEADER NAV
   ============================================ */
.header-nav {
  display: flex;
  gap: 24px;
  align-items: center;
}

.header-nav-link {
  color: var(--text-dim);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  padding: 8px 4px;
  transition: color 0.15s;
}

.header-nav-link:hover {
  color: var(--accent);
}

@media (max-width: 600px) {
  .header-nav {
    gap: 16px;
  }
  .header-nav-link {
    font-size: 13px;
  }
}