:root {
  --bg: #fffdf5;
  --card: #ffeead;
  --accent: #ff7f50;
  --muted: #6b7280;
  --brand: #3b82f6;
}
/* Base */
*,
*::before,
*::after {
  box-sizing: border-box;
}
html,
body {
  height: 100%;
  margin: 0;
  font-family: "Nunito", system-ui, Arial, sans-serif;
  background: var(--bg);
  color: #111;
}
img,
svg,
canvas,
video {
  max-width: 100%;
  height: auto;
}
.site-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 18px;
  background: linear-gradient(90deg, #fff 0, #fff0 100%);
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.06);
  position: sticky;
  top: 0;
  z-index: 100;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
}
.brand-logo {
  width: 48px;
  height: 48px;
  object-fit: contain;
  border-radius: 8px;
}
.brand-text {
  font-weight: 800;
  color: var(--brand);
  font-size: 20px;
}
.small-btn {
  padding: 8px 16px;
  border-radius: 8px;
  border: 1px solid #d1d5db;
  background: #e2e8f0;
  color: #2563eb;
  font-weight: 700;
  margin-left: 12px;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.04);
  cursor: pointer;
  transition:
    background 0.18s,
    color 0.18s;
}
.small-btn:hover,
.small-btn:focus {
  background: #dbeafe;
  color: #1d4ed8;
}
.hero {
  padding: 18px;
  text-align: center;
}
.hero h1 {
  margin: 0 0 8px;
  font-size: 22px;
}
.games-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 12px;
  padding: 12px;
}
.game-tile {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 14px;
  border-radius: 12px;
  background: var(--card);
  text-decoration: none;
  color: inherit;
  box-shadow: 0 6px 14px rgba(59, 130, 246, 0.08);
  min-height: 120px;
}
.tile-icon {
  width: 64px;
  height: 64px;
  object-fit: contain;
  margin-bottom: 8px;
}
.tile-title {
  font-weight: 700;
}
.ad-banner {
  height: 60px;
  background: linear-gradient(90deg, #fff, #fafafa);
  border-top: 1px solid #eee;
  display: flex;
  align-items: center;
  justify-content: center;
}
.dark-footer {
  background: #111;
  color: #fff;
  padding: 0;
  border-top: 1px solid #222;
  font-family: "Nunito", system-ui, Arial, sans-serif;
}
.footer-main {
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  align-items: flex-start;
  justify-content: space-between;
  max-width: none;
  width: 100%;
  margin: 0;
  gap: 146px;
  padding: 41px 32px 24px 32px;
}
.footer-col {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 160px;
}
.footer-brand-col {
  min-width: 220px;
  max-width: 260px;
  gap: 16px;
}
.footer-logo-row {
  display: flex;
  align-items: center;
  gap: 12px;
}
.footer-logo {
  width: 48px;
  height: 48px;
  border-radius: 10px;
}
.footer-brand {
  font-size: 1.5rem;
  font-weight: 900;
  color: #fff;
  letter-spacing: 1px;
}
.footer-tagline {
  font-size: 1.05rem;
  color: #e5e7eb;
  margin-bottom: 8px;
}
.footer-social-row {
  display: flex;
  gap: 10px;
  margin-bottom: 8px;
}
.footer-icon.dark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: #18181b;
  box-shadow: 0 1px 4px #0002;
  transition:
    box-shadow 0.18s,
    transform 0.18s;
}
.footer-icon.dark:hover {
  box-shadow: 0 2px 12px #0006;
  transform: translateY(-2px) scale(1.08);
}
.footer-copyright {
  font-size: 0.98rem;
  color: #aaa;
  margin-top: 10px;
}
.footer-col-title {
  font-weight: 800;
  font-size: 1.1rem;
  margin-bottom: 6px;
  color: #fff;
}
.footer-col a {
  color: #e5e7eb;
  text-decoration: none;
  font-size: 1rem;
  transition: color 0.18s;
}
.footer-col a:hover {
  color: #fff;
  text-decoration: underline;
}
/* 1200px: tighten spacing */
@media (max-width: 1200px) {
  .footer-main {
    gap: 72px;
    padding: 36px 20px 20px;
  }
  .brand-logo {
    width: 44px;
    height: 44px;
  }
  .brand-text {
    font-size: 19px;
  }
}
/* 1024px: wrap footer, soften header */
@media (max-width: 1024px) {
  .site-header {
    padding: 10px 14px;
  }
  .brand {
    gap: 8px;
  }
  .brand-logo {
    width: 40px;
    height: 40px;
  }
  .brand-text {
    font-size: 18px;
  }
  .games-grid {
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    gap: 10px;
    padding: 10px;
  }
  .ad-banner {
    height: 52px;
  }
  .footer-main {
    flex-wrap: wrap;
    gap: 32px;
    justify-content: flex-start;
  }
  .footer-brand-col {
    flex: 1 1 100%;
    max-width: 100%;
  }
  .footer-col {
    flex: 1 1 220px;
    min-width: 0;
  }
}
/* 768px: stack and reduce sizes */
@media (max-width: 768px) {
  .site-header {
    padding: 8px 12px;
  }
  .brand-text {
    font-size: 16px;
  }
  .games-grid {
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 10px;
    padding: 10px;
  }
  .tile-icon {
    width: 56px;
    height: 56px;
  }
  .ad-banner {
    height: 48px;
  }
}
/* Tablet footer layout (<=768px): brand centered, 3 columns in one row, copyright below */
@media (max-width: 768px) {
  .dark-footer .footer-main {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 20px;
    justify-items: start;
    align-items: start;
  }
  .dark-footer .footer-brand-col {
    grid-column: 1 / -1;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    margin: 0 auto 6px;
  }
  .dark-footer .footer-logo-row { justify-content: center; }
  .dark-footer .footer-social-row { justify-content: center; }
  .dark-footer .footer-tagline { text-align: center; }
  /* grid items: three columns */
  .dark-footer .footer-col { min-width: 0; }
  /* Copyright row (injected as a sibling div) */
  .dark-footer > div:last-child { text-align: center; padding-left: 16px; padding-right: 16px; }
}
@media (max-width: 900px) {
  .footer-main {
    flex-direction: column;
    align-items: flex-start;
    gap: 24px;
    padding: 32px 12px 18px 12px;
  }
  .footer-col,
  .footer-brand-col {
    min-width: 0;
    max-width: 100%;
  }
}
/* modal */
.modal {
  position: fixed;
  left: 0;
  top: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
}
.modal.hidden {
  display: none;
}
.modal-content {
  background: white;
  padding: 18px;
  border-radius: 10px;
  min-width: 300px;
}
.modal-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  margin-top: 12px;
}
button {
  background: var(--accent);
  color: white;
  padding: 10px 16px;
  border-radius: 10px;
  border: none;
  font-weight: 700;
}
button.secondary {
  background: #e2e8f0;
  color: #111;
}

/* responsive tweaks */
@media (max-width: 420px) {
  .games-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* Large screens: scale tiles to utilize space */
@media (min-width: 1600px) {
  .games-grid { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 16px; padding: 20px 24px; }
  .game-tile { min-height: 150px; }
  .tile-icon { width: 72px; height: 72px; }
  /* Footer expands at 4K */
  .footer-main { max-width: 1600px; gap: 120px; padding-left: 48px; padding-right: 48px; }
  .dark-footer > div:last-child { max-width: 1600px !important; padding-left: 48px; padding-right: 48px; }
}
@media (min-width: 2000px) {
  .games-grid { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 18px; padding: 24px 28px; }
  .game-tile { min-height: 160px; }
  .tile-icon { width: 80px; height: 80px; }
    /* Footer expands further on ultra-wide */
    .footer-main { max-width: 1800px; gap: 140px; }
    .dark-footer > div:last-child { max-width: 1800px !important; }
}

/* Informational pages (privacy, help, about, terms) */
.content-wrap { display:flex; justify-content:center; align-items:flex-start; min-height:80vh; padding:40px 0 60px; }
.content-card { max-width: 640px; width:100%; }
@media (min-width: 1600px){ .content-card{ max-width: 880px; } }
@media (min-width: 2000px){ .content-card{ max-width: 1040px; } }
