/* ============================================
  quickplayspot - main stylesheet
  Dark game theme with neon purple styling
  ============================================ */

/* ---------- CSS variables ---------- */
:root {
  --bg-primary:    #fff9f4;
  --bg-secondary:  #fffdf9;
  --bg-card:       #ffffff;
  --bg-card-hover: #fff3e8;
  --accent:        #d97745;
  --accent-dark:   #bf6233;
  --accent-light:  #f0a47a;
  --text-primary:  #3f2a1f;
  --text-secondary:#735647;
  --text-muted:    #9a7b69;
  --border:        #f0dfd2;
  --shadow:        0 10px 32px rgba(101, 67, 43, 0.12);
  --glow:          0 12px 28px rgba(217, 119, 69, 0.2);
  --brand-grad-start: #f6bf8f;
  --brand-grad-mid: #e79568;
  --brand-grad-end: #c77045;
  --section-accent-start: #f0a97c;
  --section-accent-end: #d97745;
  --radius:        12px;
  --transition:    0.25s ease;
}

/* Dark theme override */
[data-theme='dark'] {
  --bg-primary:    #0d0d1a;
  --bg-secondary:  #121225;
  --bg-card:       #1a1a35;
  --bg-card-hover: #21215e;
  --accent:        #7c3aed;
  --accent-dark:   #5b21b6;
  --accent-light:  #a78bfa;
  --text-primary:  #e2e8f0;
  --text-secondary:#94a3b8;
  --text-muted:    #64748b;
  --border:        #2d2d5a;
  --shadow:        0 4px 24px rgba(0, 0, 0, 0.5);
  --glow:          0 0 24px rgba(124, 58, 237, 0.35);
  --brand-grad-start: #a78bfa;
  --brand-grad-mid: #7c3aed;
  --brand-grad-end: #4f46e5;
  --section-accent-start: #a78bfa;
  --section-accent-end: #7c3aed;
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
}

a { color: inherit; text-decoration: none; }
ul { list-style: none; }
img { max-width: 100%; display: block; }
button { cursor: pointer; font-family: inherit; }

/* ---------- Container ---------- */
.container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 24px;
}

/* ============================================
  Ad slot styles
  ============================================ */
.ad-slot {
  width: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  background: var(--bg-secondary);
  border: 1px dashed var(--border);
}

.ad-placeholder {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  width: 100%;
  height: 100%;
  padding: 12px;
}

.ad-label {
  color: var(--text-muted);
  font-size: 11px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

/* Top banner ad */
.ad-top-banner {
  min-height: 100px;
  border-top: none;
}

/* In-feed ad */
.ad-infeed {
  min-height: 100px;
  border-radius: var(--radius);
  margin: 28px 0;
}

/* Sidebar 300x250 ad */
.ad-sidebar {
  min-height: 260px;
  width: 100%;
  border-radius: var(--radius);
}

/* Sidebar 300x600 ad */
.ad-sidebar-tall {
  min-height: 610px;
  width: 100%;
  border-radius: var(--radius);
}

/* Footer banner ad */
.ad-footer-banner {
  min-height: 100px;
  border-bottom: none;
}

/* ============================================
  Header
  ============================================ */
.site-header {
  background: color-mix(in oklab, var(--bg-secondary) 88%, transparent);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 1000;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.header-inner {
  display: flex;
  align-items: center;
  gap: 24px;
  padding: 14px 0;
  flex-wrap: wrap;
  row-gap: 10px;
}

/* Logo */
.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.logo-icon { font-size: 26px; }

.logo-text {
  font-size: clamp(18px, 1.8vw, 22px);
  font-weight: 800;
  line-height: 1.1;
  background: linear-gradient(135deg, var(--brand-grad-start) 0%, var(--brand-grad-mid) 50%, var(--brand-grad-end) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* Main navigation */
.main-nav {
  display: flex;
  gap: 4px;
  flex: 1 1 100%;
  order: 10;
  min-width: 0;
  overflow-x: visible;
  flex-wrap: wrap;
  padding-top: 8px;
  border-top: 1px solid var(--border);
  scrollbar-width: none;
}

.main-nav::-webkit-scrollbar { display: none; }

.nav-link {
  color: var(--text-secondary);
  padding: 7px 16px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  white-space: nowrap;
  transition: color var(--transition), background var(--transition);
}

.nav-link:hover,
.nav-link.active {
  color: var(--text-primary);
  background: var(--border);
}

/* Search bar */
.header-search {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-left: auto;
}

.header-search input {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 16px;
  color: var(--text-primary);
  font-size: 14px;
  width: 200px;
  outline: none;
  transition: border-color var(--transition);
}

.header-search input:focus {
  border-color: var(--accent);
}

.search-btn {
  background: var(--accent);
  border: none;
  border-radius: 8px;
  padding: 8px 12px;
  font-size: 14px;
  color: white;
  transition: background var(--transition);
}

.search-btn:hover { background: var(--accent-dark); }

.theme-btn {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 12px;
  color: var(--text-primary);
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  transition: border-color var(--transition), background var(--transition), color var(--transition);
}

.theme-btn:hover {
  border-color: var(--accent);
  background: var(--bg-card-hover);
}

/* Mobile menu button (hidden by default) */
.menu-btn {
  display: none;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 12px;
  color: var(--text-primary);
  font-size: 18px;
  margin-left: auto;
}

/* ============================================
  Hero section
  ============================================ */
.hero {
  text-align: center;
  padding: 56px 20px 36px;
}

.hero h1 {
  font-size: 52px;
  font-weight: 900;
  line-height: 1.15;
  background: linear-gradient(135deg, color-mix(in oklab, var(--brand-grad-start) 70%, #fff 30%) 0%, var(--brand-grad-mid) 40%, var(--brand-grad-end) 80%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 14px;
}

.hero p {
  font-size: 18px;
  color: var(--text-secondary);
}

/* ============================================
  Content layout
  ============================================ */
.content-layout {
  display: flex;
  gap: 28px;
  align-items: flex-start;
  padding-bottom: 60px;
}

.main-content { flex: 1; min-width: 0; }

.sidebar {
  width: 300px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  gap: 20px;
  position: sticky;
  top: 70px;
}

/* ============================================
  Section titles
  ============================================ */
.section-title {
  font-size: 20px;
  font-weight: 700;
  margin-bottom: 18px;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 10px;
}

.section-title::before {
  content: '';
  display: inline-block;
  width: 4px;
  height: 20px;
  background: linear-gradient(to bottom, var(--section-accent-start), var(--section-accent-end));
  border-radius: 2px;
  flex-shrink: 0;
}

/* ============================================
  Category filter buttons
  ============================================ */
.category-filter {
  display: none;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 24px;
}

.filter-btn {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 7px 20px;
  color: var(--text-secondary);
  font-size: 14px;
  font-weight: 500;
  transition: all var(--transition);
}

.filter-btn:hover {
  border-color: var(--accent);
  color: var(--accent-light);
}

.filter-btn.active {
  background: var(--accent);
  border-color: var(--accent);
  color: white;
}

/* ============================================
  Game card grid
  ============================================ */
.games-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 18px;
  margin-bottom: 28px;
}

/* Game card */
.game-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  display: block;
  color: inherit;
  transition: transform var(--transition), border-color var(--transition), box-shadow var(--transition);
  cursor: pointer;
  position: relative;
}

.game-card:hover {
  transform: translateY(-5px);
  border-color: var(--accent);
  box-shadow: var(--glow);
}

/* Coming-soon game card */
.game-card.coming-soon {
  opacity: 0.65;
  cursor: default;
}

.game-card.coming-soon:hover {
  transform: none;
  box-shadow: none;
  border-color: var(--border);
}

/* Game thumbnail */
.game-thumbnail {
  width: 100%;
  height: 135px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 56px;
  position: relative;
  overflow: hidden;
}

/* Thumbnail image */
.game-thumbnail img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.35s ease;
}
.game-card:hover .game-thumbnail img {
  transform: scale(1.06);
}

.game-thumbnail::after {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.15);
}

/* Coming soon badge */
.badge-soon {
  position: absolute;
  top: 10px;
  right: 10px;
  background: rgba(0,0,0,0.7);
  color: var(--text-muted);
  font-size: 10px;
  padding: 3px 8px;
  border-radius: 10px;
  z-index: 1;
}

/* Game info */
.game-info { padding: 12px 14px 14px; }

.game-title {
  font-size: 15px;
  font-weight: 700;
  margin-bottom: 6px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.game-desc {
  font-size: 12px;
  color: var(--text-secondary);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 36px;
}

.game-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 10px;
  font-size: 11px;
  color: var(--text-muted);
}

.game-badge {
  padding: 2px 9px;
  border-radius: 10px;
  font-size: 11px;
  font-weight: 600;
}

.badge-puzzle  { background: #0c4a6e; color: #7dd3fc; }
.badge-classic { background: #064e3b; color: #6ee7b7; }
.badge-action  { background: #450a0a; color: #fca5a5; }
.badge-arcade  { background: #3b220a; color: #fcd34d; }

/* Empty state */
.no-results {
  text-align: center;
  padding: 48px 20px;
  color: var(--text-muted);
  font-size: 15px;
  grid-column: 1 / -1;
}

/* ============================================
  Sidebar widgets
  ============================================ */
.sidebar-widget {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
}

.sidebar-widget h3 {
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 14px;
  color: var(--text-primary);
}

.popular-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.popular-list li a {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--text-secondary);
  font-size: 14px;
  transition: color var(--transition);
}

.popular-list li a:hover { color: var(--accent-light); }

.popular-rank {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  flex-shrink: 0;
}

.popular-rank.gold   { background: #d97706; color: #fff; }
.popular-rank.silver { background: #64748b; color: #fff; }
.popular-rank.bronze { background: #92400e; color: #fff; }

.popular-icon { font-size: 18px; flex-shrink: 0; }

/* ============================================
  Footer
  ============================================ */
.site-footer {
  background: var(--bg-secondary);
  border-top: 1px solid var(--border);
  padding: 48px 0 0;
}

.footer-inner {
  display: flex;
  gap: 60px;
  margin-bottom: 40px;
  align-items: flex-start;
}

.footer-brand { flex: 1; }

.footer-brand .logo-icon { font-size: 28px; }

.footer-brand .logo-text {
  font-size: 20px;
  font-weight: 800;
  background: linear-gradient(135deg, var(--brand-grad-start), var(--brand-grad-mid));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  display: block;
  margin-top: 4px;
  margin-bottom: 10px;
}

.footer-brand p {
  font-size: 14px;
  color: var(--text-secondary);
}

.footer-links {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 140px;
}

.footer-links h4 {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.footer-links a {
  color: var(--text-secondary);
  font-size: 14px;
  transition: color var(--transition);
}

.footer-links a:hover { color: var(--accent-light); }

.footer-bottom {
  border-top: 1px solid var(--border);
  padding: 18px 0;
  text-align: center;
  color: var(--text-muted);
  font-size: 13px;
}

/* ============================================
  Shared game page styles (reused under games/)
  ============================================ */
.game-page-header {
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border);
  padding: 14px 24px;
  display: flex;
  align-items: center;
  gap: 16px;
}

.back-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 16px;
  color: var(--text-secondary);
  font-size: 14px;
  transition: all var(--transition);
  cursor: pointer;
}

.back-btn:hover {
  border-color: var(--accent);
  color: var(--accent-light);
}

/* ============================================
  Static pages (About / Privacy / Contact)
  ============================================ */
.static-page {
  max-width: 800px;
  margin: 48px auto 64px;
}

.static-page-header {
  text-align: center;
  margin-bottom: 40px;
  padding-bottom: 28px;
  border-bottom: 2px solid var(--border);
}

.static-page-header h1 {
  font-size: clamp(1.8rem, 4vw, 2.6rem);
  font-weight: 800;
  background: linear-gradient(135deg, var(--section-accent-start), var(--section-accent-end));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 10px;
}

.static-page-subtitle {
  color: var(--text-secondary);
  font-size: 1rem;
}

.static-section {
  margin-bottom: 36px;
}

.static-section h2 {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--accent);
  margin-bottom: 12px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--border);
}

.static-section h3 {
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text-primary);
  margin: 16px 0 8px;
}

.static-section p {
  color: var(--text-secondary);
  line-height: 1.8;
  margin-bottom: 12px;
}

.static-link {
  color: var(--accent);
  text-decoration: underline;
  transition: color var(--transition);
}

.static-link:hover {
  color: var(--accent-dark);
}

.static-list {
  list-style: none;
  padding: 0;
  margin-bottom: 12px;
}

.static-list li {
  color: var(--text-secondary);
  line-height: 1.8;
  padding: 4px 0 4px 8px;
  border-left: 3px solid var(--accent-light);
  margin-bottom: 6px;
  padding-left: 14px;
}

.static-ordered-list {
  padding-left: 24px;
  margin-bottom: 12px;
}

.static-ordered-list li {
  color: var(--text-secondary);
  line-height: 1.8;
  margin-bottom: 6px;
}

/* Contact form */
.contact-form {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-group label {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-primary);
}

.form-group input,
.form-group select,
.form-group textarea {
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-card);
  color: var(--text-primary);
  font-family: inherit;
  font-size: 0.95rem;
  transition: border-color var(--transition), box-shadow var(--transition);
  outline: none;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(217, 119, 69, 0.15);
}

.form-group textarea {
  resize: vertical;
  min-height: 120px;
}

.contact-submit-btn {
  align-self: flex-start;
  padding: 12px 32px;
  background: linear-gradient(135deg, var(--section-accent-start), var(--section-accent-end));
  color: #fff;
  border: none;
  border-radius: var(--radius);
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  transition: opacity var(--transition), transform var(--transition);
}

.contact-submit-btn:hover {
  opacity: 0.9;
  transform: translateY(-1px);
}

.form-note {
  font-size: 0.875rem;
  margin-top: -8px;
}

.contact-info-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 20px;
  margin-top: 12px;
}

.contact-info-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px 20px;
  text-align: center;
  box-shadow: var(--shadow);
}

.contact-info-icon {
  font-size: 2rem;
  display: block;
  margin-bottom: 10px;
}

.contact-info-card h3 {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 8px;
}

.contact-info-card p {
  color: var(--text-secondary);
  font-size: 0.9rem;
  line-height: 1.6;
  margin-bottom: 6px;
}

/* ============================================
  Responsive layout
  ============================================ */
@media (max-width: 1100px) {
  .sidebar { width: 260px; }
}

@media (max-width: 1240px) {
  .main-nav { gap: 8px; }
}

@media (max-width: 900px) {
  .content-layout { flex-direction: column; }

  .sidebar {
    width: 100%;
    flex-direction: row;
    flex-wrap: wrap;
    position: static;
    gap: 16px;
  }

  .sidebar > * { flex: 1 1 280px; }

  .ad-sidebar,
  .ad-sidebar-tall { min-height: 100px; }

  .games-grid {
    grid-template-columns: repeat(auto-fill, minmax(165px, 1fr));
  }
}

@media (max-width: 700px) {
  .hero h1 { font-size: 36px; }
  .hero p  { font-size: 15px; }

  .header-inner { flex-wrap: wrap; }

  .main-nav { display: none; }
  .category-filter { display: flex; }
  .menu-btn { display: flex; }
  .theme-btn { font-size: 12px; padding: 7px 10px; margin-left: auto; }

  .header-inner { gap: 10px; }
  .header-search {
    order: 3;
    width: 100%;
  }
  .header-search input { width: 100%; }
  .search-btn { flex-shrink: 0; }

  .footer-inner {
    flex-direction: column;
    gap: 32px;
  }

  .games-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 14px;
  }
}

@media (max-width: 420px) {
  .container { padding: 0 14px; }

  .games-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
  }

  .game-thumbnail { height: 110px; font-size: 44px; }
}

@media (max-width: 560px) {
  .hero {
    padding: 38px 12px 24px;
  }

  .section-title {
    font-size: 18px;
    margin-bottom: 14px;
  }

  .category-filter {
    gap: 8px;
    margin-bottom: 18px;
  }

  .filter-btn {
    padding: 6px 14px;
    font-size: 13px;
  }
}

@media (max-width: 380px) {
  .header-inner {
    gap: 8px;
  }

  .logo-text {
    font-size: 18px;
  }

  .theme-btn {
    padding: 6px 8px;
    font-size: 11px;
  }

  .menu-btn {
    padding: 6px 10px;
  }

  .games-grid {
    gap: 8px;
  }

  .game-info {
    padding: 10px 10px 12px;
  }

  .game-title {
    font-size: 13px;
  }

  .game-desc {
    font-size: 11px;
    min-height: 32px;
  }
}
