html,
body {
  overflow: auto;
}

body {
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  color: #222;
  margin: 0;
  padding: 0;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  text-decoration: none;
  font-size: 16px;
  line-height: 1.6;
}

a {
  text-decoration: none;
}

.site-header {
  border-bottom: 1px solid #eaeaea;
}
.site-header .container {
  max-width: 1240px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding: 12px;
}

.site-header .container .page-title {
  margin: 0 auto;
}

.site-header .logo-container {
  background-color: aliceblue;
  border-top-left-radius: 8px;
  border-top-right-radius: 8px;
}

.site-header .logo img {
  height: 140px;
  display: block;
}
.site-header .nav {
  margin-left: auto;
}
.site-header select {
  padding: 8px 10px;
  border: 1px solid #ddd;
  border-radius: 6px;
  background: #fff;
}
.site-desc {
  max-width: 1240px;
  margin: 0 auto;
  padding: 0px 16px 20px 16px;
  color: #000000;
  font-size: 14px;
  text-align: center;
  line-height: 1.6;
  font-size: 16px;
}

.container {
  max-width: 1240px;
  margin: 0 auto;
  padding: 16px 0;
}

.main-content {
  background-color: #fff;
  max-width: 1240px;
  margin: 24px auto;
  border-radius: 8px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.main-title {
  text-align: center;
  font-size: 22px;
  padding-top: 20px;
}

.category-nav {
  border-top: 1px solid #f0f0f0;
}
.category-nav .category-toggle {
  display: none !important;
}
.category-nav .nav-container {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px 16px;
  padding: 16px 12px;
  border-bottom-left-radius: 8px;
  border-bottom-right-radius: 8px;
}
.category-nav .category-links {
  display: flex;
  flex-wrap: inherit;
  justify-content: inherit;
  gap: inherit;
}
.category-nav .nav-link {
  color: #000000;
  text-decoration: none;
  font-size: 15px;
  font-weight: 500;
  padding: 8px 12px;
  border-radius: 6px;
  transition: background-color 0.2s ease, color 0.2s ease;
  font-size: 18px;
}
.category-nav .nav-link:hover {
  background-color: #f5f5f5;
}
.category-nav .nav-link.active {
  background: linear-gradient(109deg, #3f5bdb 0%, #764ba2 100%);
  color: #fff;
}

.category-nav .nav-link.active:hover {
  background-color: #542c9a;
}
.category-nav .nav-link-stats {
  background: linear-gradient(135deg, #f59e0b 0%, #ef4444 100%);
  color: white;
  font-weight: 600;
  margin-left: 8px;
}
.category-nav .nav-link-stats:hover {
  background: linear-gradient(135deg, #d97706 0%, #dc2626 100%);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3);
}

.ad-top-block {
  margin-bottom: 16px;
}

.ad-bottom-block {
  margin-top: 16px;
}

.ad-container {
    /* display: inline-block; */
    width: 100%;
    background: #ffffff;
    text-align: center;
    height: 300px;
    min-height: 300px;
    border-radius: 8px;
    padding: 10px 0;
}

.grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin: 32px auto 0 auto;
  max-width: 1240px;
  padding: 12px;
}
.grid .grid-title {
  padding-top: 12px;
  grid-column: 1 / -1;
}

.grid .grid-title h2 {
  text-align: center;
  margin: 0;
}

.game-card {
  border: 1px solid #d0c8e5;
  border-radius: 12px;
  padding: 8px;
  background: #fff;
  transition: box-shadow 0.15s ease;
}
.game-card:hover {
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.06);
}
.game-card .thumb {
  width: 100%;
  aspect-ratio: 1/1;
  max-width: 278px;
  height: auto;
  margin: 0 auto;
  overflow: hidden;
  background: #ddd;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  position: relative;
}
.game-card .thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
/* NEW badge in top-left corner of the thumb */
.game-card .thumb .new-badge {
  position: absolute;
  top: 0;
  left: 0;
  width: 97px;
  height: 97px;
  object-fit: contain;
  z-index: 20;
}
.game-card .title {
  font-size: 18px;
  margin: 20px 0 10px 0;
  color: #222;
  text-align: center;
}
.game-card .game-link {
  color: inherit;
  text-decoration: none;
  display: block;
}

.pagination {
  margin-top: 24px;
  padding-bottom: 20px;
  text-align: center;
}

.pagination .pages {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 2px;
}

.pagination .pages a,
.pagination .pages span {
  display: inline-block;
  padding: 6px 14px;
  margin: 0 3px;
  border-radius: 4px;
  border: 1px solid #ddd;
  text-decoration: none;
  color: #000000;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  font-weight: bold;
}
.pagination .pages .first,
.pagination .pages .prev,
.pagination .pages .next,
.pagination .pages .last {
  padding: 8px;
  width: 20px;
  height: 20px;
}
.pagination .pages a img,
.pagination .pages span img {
  width: 18px;
}
.pagination .pages .current {
  background: #673ab7;
  color: #fff;
  border-color: #673ab7;
}
.pagination .pages .disabled {
  opacity: 0.5;
  border-color: #f0f0f0;
  color: #999;
  cursor: not-allowed;
}

.game-detail {
  background: #fff;
  border: 1px solid #eee;
  max-width: 1220px;
  margin: 24px auto 32px auto;
  border-radius: 6px;
  padding: 10px;
}
.game-detail h1 {
  font-size: 20px;
  margin: 10px 10px 20px 10px;
  text-align: center;
}
.iframe-wrap {
  width: 100%;
  height: auto;
  margin: 0;
}

.iframe-wrap iframe {
  width: 100%;
  height: auto;
  padding: 0;
  margin: 0;
  border: none;
}

.iframe-fallback {
  background: #000;
  color: #fff;
  padding: 40px;
  text-align: center;
  border-radius: 6px;
  max-width: 1240px;
  margin: 16px auto;
}

.game-actions {
  text-align: center;
  margin: 16px 0;
}
.fullscreen-btn {
  display: inline-block;

  background: linear-gradient(338deg, #3f5bdb 0%, #764ba2 100%);
  color: #fff;
  border: none;
  padding: 12px 24px;
  border-radius: 6px;
  cursor: pointer;
  font-weight: bold;
  font-size: 16px;
  letter-spacing: 0.5px;
  transition: background-color 0.2s ease;
}
.fullscreen-btn:hover {
  background-color: #542c9a;
}

.game-meta {
  margin-top: 16px;
  color: #000000;
  font-size: 15px;
  line-height: 1.6;
  padding: 10px;
}
.game-meta p {
  font-size: 16px;
  margin: 0 0 12px;
}

.game-meta p:nth-child(1) {
  margin: 0 0 12px;
  font-size: 18px;
  font-weight: bold;
}

.game-meta a {
  color: #673ab7;
  text-decoration: none;
}
.game-meta a:hover {
  text-decoration: underline;
}

.site-footer {
  background-color: #1e1a3a;

  padding: 32px 12px;
  margin-top: 32px;
  color: #ffffff;
  font-size: 14px;
  text-align: center;
}
.site-footer .footer-description {
  max-width: 1240px;
  font-size: 16px;
  margin: 0 auto 16px auto;
  line-height: 1.6;
}
.site-footer .footer-nav {
  margin-bottom: 16px;
  font-size: 16px;
}
.site-footer .footer-nav a {
  color: #ffffff;
  text-decoration: none;
  margin: 0 8px;
}
.site-footer .footer-nav a:hover {
  text-decoration: underline;
}
.site-footer .copyright {
  font-size: 16px;
  margin: 0;
}

.static-page {
  max-width: 1200px;
  margin: 2rem auto;
  padding: 20px;
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 4px 8px rgba(0,0,0,0.05);
  line-height: 1.7;
}
.static-page h1 {
  font-size: 16px;
  margin-bottom: 1.5rem;
  border-bottom: 2px solid #eee;
  padding-bottom: 0.5rem;
}
.static-page h2 {
  font-size: 24px;
  margin-top: 2rem;
  margin-bottom: 1rem;
}
.static-page p, .static-page ul {
  margin-bottom: 16px;
}
.static-page ul {
  padding-left: 20px;
}


@media (max-width: 767px) {
  .main-content {
    margin: 16px;
  }

  .game-detail {
    margin: 16px;
  }

  .grid {
    grid-template-columns: 50% 50%;
  }
  .site-header .container {
    padding: 10px;
  }
  .site-header .logo img {
    width: 100%;
    height: auto;
  }

  .site-header .container .page-title {
    text-align: center;
  }

  .category-nav {
    padding: 0;
    border-bottom: none;
  }
  .category-nav .nav-container {
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 0;
  }
  .category-nav .category-toggle {
    display: block !important;
    width: 100%;
    padding: 14px 16px;
    font-size: 20px;
    font-weight: bold;
    color: #333;
    background-color: #fff;
    border: none;
    border-bottom: 1px solid #e5e5e5;
    cursor: pointer;
    border-radius: 6px;
  }
  .category-nav .category-toggle[aria-expanded="true"] {
    border-bottom-color: transparent;
  }
  .category-nav .category-links {
    display: none;
    flex-direction: column;
    gap: 0;
  }
  .category-nav .category-links.is-open {
    display: flex;
  }
  .category-nav .nav-link {
    border-radius: 0;
    padding: 12px 16px;
    border-top: 1px solid #f0f0f0;
  }
  .category-nav .nav-link.active {
    background: #f5f5f5;
    font-weight: bold;
    color: #111;
  }

  .pagination .pages a.first,
  .pagination .pages a.last,
  .pagination .pages span.first,
  .pagination .pages span.last {
    display: none;
  }
}

@media (max-width: 900px) {
  .grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 1024px) {
  .iframe-wrap iframe {
    max-width: 100%;
  }
}

@media (max-width: 1279px) {
  .main-content {
    margin: 16px;
  }

  .game-detail {
    margin: 16px;
  }

  .static-page {
    margin: 16px;
  }
}
