/* Basic Reset and Theme */
* {
  box-sizing: border-box;
}
:root {
  --bg: #0e0f14;
  --bg-soft: #151824;
  --text: #e8ecf1;
  --muted: #a7b0bd;
  --primary: #58c4ff;
  --primary-600: #2bb3ff;
  --error: #ff5577;
  --surface: #1b1f2e;
  --accent: #9d7dff;
}
html,
body {
  height: 100%;
}
body.theme-dark {
  margin: 0;
  background: var(--bg);
  /* Fixed decorative background formerly on .hero */
  background-image: radial-gradient(
      1200px 600px at 80% -10%,
      rgba(88, 196, 255, 0.25),
      transparent 55%
    ),
    radial-gradient(
      800px 400px at 10% 10%,
      rgba(157, 125, 255, 0.18),
      transparent 50%
    );
  background-attachment: fixed, fixed;
  background-repeat: no-repeat, no-repeat;
  background-size: cover, cover;
  color: var(--text);
  font: 16px/1.6 "Inter", system-ui, -apple-system, "Segoe UI", Roboto, Ubuntu,
    Cantarell, "Noto Sans", Arial, sans-serif;
  scroll-padding-top: 69px; /* desktop header height */
}
/* Prevent background scrolling when mobile menu open */
.no-scroll {
  overflow: hidden;
}
img {
  max-width: 100%;
  display: block;
  height: auto;
}
a {
  color: var(--primary);
  text-decoration: none;
}
a:hover {
  text-decoration: underline;
}
.container {
  width: min(1120px, 92%);
  margin-inline: auto;
}
.flex {
  display: flex;
}
.between {
  justify-content: space-between;
}
.center-v {
  align-items: center;
}
.btn {
  display: inline-block;
  background: var(--primary);
  color: #001521;
  border: none;
  border-radius: 10px;
  padding: 0.75rem 1rem;
  font-weight: 700;
  letter-spacing: 0.2px;
  transition: 0.2s ease;
  box-shadow: 0 6px 14px rgba(43, 179, 255, 0.18);
}
.btn:hover {
  background: var(--primary-600);
  text-decoration: none;
  transform: translateY(-1px);
}
.btn.outline {
  background: transparent;
  border: 1px solid var(--primary);
  color: var(--text);
}

/* Header */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  background: rgba(14, 15, 20, 0.8);
  backdrop-filter: saturate(150%) blur(6px);
  z-index: 140; /* keep above mobile menu */
  border-bottom: 1px solid #1f2434;
  padding: 14px 0; /* increase header height on desktop */
}
.logo {
  font-weight: 900;
  color: var(--text);
  font-size: 1.1rem;
}
.main-nav .nav-toggle {
  display: none;
  background: transparent;
  border: 1px solid #2a3248;
  color: var(--text);
  border-radius: 8px;
  padding: 0.4rem 0.6rem;
}

@media (max-width: 820px) {
  .site-header {
    padding: 10px 0;
  } /* slightly smaller on mobile */
}
.nav-list {
  display: flex;
  gap: 1rem;
  list-style: none;
  margin: 0;
  padding: 0;
}
.nav-link {
  padding: 0.6rem 0.8rem;
  border-radius: 8px;
  color: var(--text);
}
.nav-link:hover {
  background: var(--bg-soft);
}
/* Fullscreen mobile menu styles */
@media (max-width: 820px) {
  .main-nav .nav-toggle {
    display: inline-block;
  }
  .nav-list {
    display: none;
  }
}

/* Header visual enhancements */
.site-header {
  background: rgba(14, 15, 20, 0.7);
  backdrop-filter: saturate(150%) blur(8px);
  z-index: 100;
}
.logo {
  letter-spacing: 0.3px;
}

/* Burger button bars */
.main-nav .nav-toggle {
  position: relative;
  width: 44px;
  height: 36px;
  border: none;
}
.main-nav .nav-toggle .bar {
  position: absolute;
  left: 10px;
  right: 10px;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: transform 0.35s ease, opacity 0.25s ease, top 0.35s ease;
}
.main-nav .nav-toggle .bar:nth-child(1) {
  top: 12px;
}
.main-nav .nav-toggle .bar:nth-child(2) {
  top: 18px;
}
.main-nav .nav-toggle .bar:nth-child(3) {
  top: 24px;
}
.main-nav .nav-toggle.open .bar:nth-child(1) {
  top: 18px;
  transform: rotate(45deg);
}
.main-nav .nav-toggle.open .bar:nth-child(2) {
  opacity: 0;
}
.main-nav .nav-toggle.open .bar:nth-child(3) {
  top: 18px;
  transform: rotate(-45deg);
}

/* Mobile full-screen menu */
.mobile-menu {
  position: fixed;
  left: 0;
  right: 0;
  top: 61px;
  bottom: 0;
  background: rgba(10, 12, 18, 0.96);
  backdrop-filter: blur(6px);
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 1rem;
  z-index: 130;
  opacity: 0;
  transform: translateY(-10px);
  transition: opacity 0.28s ease, transform 0.32s ease;
}
.mobile-menu.open {
  display: flex;
  opacity: 1;
  transform: translateY(0);
}
.mobile-menu .nav-link {
  font-size: 1.4rem;
  padding: 0.8rem 1.2rem;
}

/* Layout offset for fixed header */
main {
  padding-top: 69px;
}

/* Responsive offsets for mobile header height */
@media (max-width: 820px) {
  body.theme-dark {
    scroll-padding-top: 61px;
  }
  main {
    padding-top: 61px;
  }
}

/* Sections */
.hero {
  padding: 3rem 0 2rem;
}
.hero h1 {
  margin: 0 0 0.5rem;
  font-size: 2.2rem;
}
.hero h2 {
  margin: 0.2rem 0 1rem;
  color: var(--muted);
}

.games-section {
  padding: 2.5rem 0;
}
.games-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
}
@media (max-width: 900px) {
  .games-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}
@media (max-width: 580px) {
  .games-grid {
    grid-template-columns: 1fr;
  }
}
.game-card {
  background: var(--surface);
  border: 1px solid #2a3248;
  border-radius: 14px;
  padding: 0; /* remove padding to let image be full-bleed */
  display: flex;
  flex-direction: column;
  gap: 0;
  overflow: hidden; /* clip child corners */
}
/* Full-width, centered button with spacing */
.game-card .btn {
  display: block;
  width: calc(100% - 1.8rem);
  margin: 0.9rem;
  text-align: center;
  align-self: stretch;
}
/* Maintain spacing between cards */
.games-grid {
  gap: 1rem;
}
.game-logo {
  height: auto; /* let content define height */
  border-radius: 14px 14px 0 0; /* round only top corners */
  background: linear-gradient(135deg, #22283a, #171c2b);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  color: #c5d1e0;
  overflow: hidden; /* clip child image corners */
}
/* Ensure images never overflow the card; no rounding on image itself */
.game-logo img {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 0;
}

.about-section,
.reviews-section,
.faq-section,
.contact-section {
  padding: 2.5rem 0;
}
.features {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.5rem 1rem;
}
@media (max-width: 720px) {
  .features {
    grid-template-columns: 1fr;
  }
}
.reviews {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
  list-style: none;
  padding: 0;
  margin: 0;
}
/* If reviews count is odd, make the last item span full width on >= 721px */
@media (min-width: 721px) {
  .reviews > :last-child:nth-child(odd) {
    grid-column: 1 / -1;
  }
}
@media (max-width: 720px) {
  .reviews {
    grid-template-columns: 1fr;
  }
}
.reviews blockquote {
  margin: 0;
  background: var(--surface);
  border: 1px solid #2a3248;
  padding: 1rem;
  border-radius: 14px;
}
.reviews cite {
  display: block;
  margin-top: 0.5rem;
  color: var(--muted);
  font-style: normal;
}

/* FAQ */
details {
  background: var(--surface);
  border: 1px solid #2a3248;
  border-radius: 12px;
  padding: 0.75rem 1rem;
  margin: 0.6rem 0;
}
details > summary {
  cursor: pointer;
  font-weight: 700;
}

/* Contact */
.form-field {
  margin: 1rem 0;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}
input,
textarea {
  background: #0f1322;
  border: 1px solid #2a3248;
  color: var(--text);
  border-radius: 10px;
  padding: 0.75rem;
}
/* Prevent manual resizing of textarea */
textarea {
  resize: none;
}
input::placeholder,
textarea::placeholder {
  color: #69748a;
}
input.error,
textarea.error {
  border-color: var(--error);
  box-shadow: 0 0 0 3px rgba(255, 85, 119, 0.15);
}
small.error {
  color: var(--error);
  min-height: 1.1em;
}

/* Popup */
/* Ensure hidden attribute fully hides popup regardless of base display */
.popup[hidden] {
  display: none !important;
}
.popup {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  background: rgba(0, 0, 0, 0.55);
}
.popup-content {
  background: var(--surface);
  border: 1px solid #2a3248;
  border-radius: 14px;
  padding: 1.25rem;
  max-width: 420px;
  width: 92%;
  text-align: center;
}

/* Footer */
.site-footer {
  padding: 2rem 0;
  border-top: 1px solid #1f2434;
  background: #0b0c12;
}
.site-footer h4 {
  margin-top: 0;
}
.rg-links {
  list-style: none;
  padding: 0;
  margin: 1rem 0;
  display: grid;
  gap: 0.4rem;
}
.footer-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin: 1rem 0;
}
/* Footer logos styled like badges */
.footer-logos {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: stretch;
  margin: 0.5rem 0 1rem;
}
.footer-logos a,
.footer-logos span.badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 4px 10px;
  border: 1px solid #3a425a;
  border-radius: 6px;
  background: transparent;
  text-decoration: none;
}
.footer-logos img {
  height: 18px;
  width: auto;
  filter: none;
  opacity: 0.95;
  transition: opacity 0.2s ease, border-color 0.2s ease;
}
.footer-logos a:hover {
  border-color: #4a5270;
}
.badges {
  display: flex;
  gap: 0.5rem;
}
.badge {
  display: inline-block;
  padding: 0.2rem 0.5rem;
  border: 1px solid #3a425a;
  border-radius: 6px;
  color: #c7d3e6;
}

/* Utility images policy: avoid cartoony imagery */
/* Use simple gradients/placeholders for game logos per requirement. */
