@import url('https://fonts.googleapis.com/css2?family=Fredoka:wght@400&display=swap');

:root {
  --primary: #4167b1;
  --color2: #def0f9;
  --stars-color: #ffd700;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Trebuchet MS', 'Lucida Sans', sans-serif;
   background-color: #1a1a2e;
  min-height: 100vh;
  overflow-x: hidden;
}

html {
  overflow-x: hidden;
height: 100%;
}


.header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  background-color: var(--primary);
  padding: 5px;
  z-index: 999;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  margin: 0;
}

.header-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  max-width: 1200px;
  margin: 0 auto;
}

.logo {
  text-decoration: none;
  display: flex;
  align-items: center;
}
.logo p {
  font-size: 24px;
  font-weight: bold;
  color: white;
  margin-left: 10px;
}

.header-icons {
  display: flex;
  gap: 20px;
}

.header-icon {
  color: white;
  font-size: 20px;
  text-decoration: none;
  padding: 8px;
  border-radius: 50%;
  transition: all 0.3s;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
}

.category-icon {
  width: 24px;
  height: 24px;
  object-fit: contain;
  display: block;
}

.header-icon:active {
  transform: scale(0.95);
}


.search-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  display: none;
  z-index: 1000;
  backdrop-filter: blur(5px);
}

.search-container.active {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  padding-top: 90px;
}

.search-input {
  background: white;
  border-radius: 20px;
  padding: 20px;
  width: 90%;
  max-width: 500px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
  position: relative;
  min-height: 60px;
  margin-bottom: 0;
}

.search-input input {
  border: none;
  outline: none;
  width: 100%;
  padding: 0 50px 0 50px;
  font-size: 16px;
  background: transparent;
  height: 40px;
}

.search-icon {
  position: absolute;
  left: 20px;
  top: 50%;
  transform: translateY(-50%);
  color: #666;
  font-size: 18px;
}

.close-search {
  position: absolute;
  right: 20px;
  top: 50%;
  transform: translateY(-50%);
  color: #333;
  font-size: 20px;
  cursor: pointer;
  background: none;
  border: none;
  padding: 5px;
}

.search-results {
  position: static;
  background: white;
  border-radius: 20px;
  margin-top: 20px;
  max-height: 400px;
  overflow-y: auto;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
  z-index: 1001;
  display: none;
  border: 2px solid #ddd;
  min-height: 100px;
  width: 90%;
  max-width: 500px;
  padding: 20px;
}

.search-results.active {
  display: block;
}

.search-result-item {
  display: flex;
  align-items: center;
  padding: 15px;
  background: white;
  border-radius: 10px;
  margin-bottom: 10px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  text-decoration: none;
  color: inherit;
  transition: background-color 0.2s;
  border-bottom: 1px solid #f0f0f0;
}

.search-result-item:last-child {
  border-bottom: none;
  margin-bottom: 0;
}


.search-result-item img {
  width: 60px;
  height: 60px;
  border-radius: 8px;
  margin-right: 15px;
  object-fit: cover;
  flex-shrink: 0;
}

.search-result-info h4 {
  margin: 0 0 5px 0;
  color: #333;
  font-size: 16px;
  font-weight: bold;
}

.search-result-info p {
  margin: 0;
  color: #666;
  font-size: 14px;
  text-transform: capitalize;
}

.categories-menu {
  position: fixed;
  top: 48px;
  right: 0;
  background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
  width: 210px;
  height: calc(100vh - 60px);
  z-index: 998;
  box-shadow: -5px 0 25px rgba(0, 0, 0, 0.08);
  transform: translateX(100%);
  transition: transform 0.3s ease;
  overflow-y: auto;
  border-radius: 0;
}

.categories-menu.active {
  transform: translateX(0);
  animation: slideInRight 0.4s ease-out;
}

@keyframes slideInRight {
  0% {
    transform: translateX(100%);
    opacity: 0;
  }
  100% {
    transform: translateX(0);
    opacity: 1;
  }
}

.categories-header {
  padding: 10px 15px;
  border-bottom: 2px solid #f1f5f9;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: white;
  position: relative;
  height: 60px;
}

.categories-title {
  font-size: 22px;
  font-weight: 600;
  color: #1e293b;
  letter-spacing: 0.3px;
}

.close-categories {
  color: #64748b;
  cursor: pointer;
  font-size: 24px;
  padding: 8px;
  border-radius: 50%;
  transition: all 0.2s ease;
  font-weight: normal;
  background: #f1f5f9;
  border: none;
}


.category-item {
  padding: 10px 15px;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: relative;
  background: transparent;
  border-bottom: 1px solid #f1f5f9;
  height: 50px;
}


.category-item.active {
  background: #e6f7f6;
  border-left: 3px solid var(--primary);
  font-weight: 600;
}

.category-item:last-child {
  border-bottom: none;
  margin-bottom: 0;
}

.category-name {
  color: #334155;
  text-transform: capitalize;
  font-size: 16px;
  font-weight: 500;
  letter-spacing: 0.2px;
}

.category-count {
  background: var(--primary);
  color: white;
  padding: 6px 12px;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 600;
  min-width: 32px;
  text-align: center;
}


.main-content {
  margin-top: 0;
  padding: 15px;
  max-width: 950px;
  margin-left: auto;
  margin-right: auto;
  position: relative;
  z-index: 1;
  box-shadow: none;
}


.footer {
  margin-top: auto;
}

.footer-links {
  background-color: var(--primary);
  padding: 15px;
  text-align: center;
  border-radius: 10px;
  margin: 10px;
}

.footer-links a {
  display: inline-block;
  color: white;
  text-decoration: none;
  font-size: 14px;
  margin: 0 8px;
  transition: opacity 0.3s;
}

.footer-links a:not(:last-child)::after {
  content: '|';
  margin-left: 8px;
  color: rgba(255, 255, 255, 0.5);
}


.footer-copyright {
  padding: 20px;
  text-align: center;
  color: #fff;
}

.footer-copyright-text {
  color: #9ca3af;
  font-size: 14px;
  line-height: 24px;
}


.no-results {
  text-align: center;
  padding: 60px 20px;
  color: #666;
}

.no-results h3 {
  margin-bottom: 10px;
  color: #333;
}


.category-section {
  margin-bottom: 20px;
}

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  background: white;
  padding: 10px  0;
  border-bottom: 2px solid #f0f0f0;
  width: 100%;
}

.section-title {
  font-size: 24px;
  font-weight: bold;
  color: #333;
  margin: 0;
}

.section-more {
  color: var(--primary);
  text-decoration: none;
  font-weight: bold;
  text-transform: uppercase;
  font-size: 16px;
  border-radius: 20px;
  transition: all 0.2s;
}


.section-right {
  display: flex;
  align-items: center;
  gap: 15px;
}

.game-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 9px;
}


.game-card {
  cursor: pointer;
  text-decoration: none;
  border-radius:14px;
  overflow: hidden;
  transition: transform 0.2s;
}

.game-card:hover {
  transform: scale(1.02);
}

.game-card img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
}

.game-card.large {
  grid-column: span 2;
  grid-row: span 2;
}

.game-card.large img {
  width: 100%;
  height: 100%;
  aspect-ratio: auto;
  object-fit: cover;
}

.game-rating {
  display: flex;
  align-items: center;
  gap: 4px;
}

.game-download {
  display: flex;
  align-items: center;
  gap: 4px;
}

.zan-icon {
  width: 14px;
  height: 14px;
  background-image: url('../zan.png');
  background-size: contain;
  background-repeat: no-repeat;
  display: inline-block;
}

.download-icon {
  width: 16px;
  height: 16px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cellipse cx='12' cy='18' rx='8' ry='4' fill='%234a4a4a'/%3E%3Ccircle cx='12' cy='10' r='5' fill='%23e74c3c'/%3E%3Ccircle cx='12' cy='10' r='3' fill='%23c0392b'/%3E%3Ccircle cx='12' cy='8' r='1' fill='%23fff' opacity='0.5'/%3E%3C/svg%3E");
  background-size: contain;
  background-repeat: no-repeat;
  display: inline-block;
}

.download-icon::before {
  content: '';
}

.stars {
  color: var(--stars-color);
}




.fun-games-section {
  margin: 20px 0;
}

.fun-games-title {
  font-size: 20px;
  font-weight: bold;
  color: var(--primary);
  margin-bottom: 15px;
  padding-bottom: 5px;
  border-bottom: 2px solid var(--primary);
}


.fun-games-container {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  scroll-behavior: smooth;
  padding-bottom: 10px;
  -webkit-overflow-scrolling: touch;
}

.fun-games-container::-webkit-scrollbar {
  height: 8px;
}

.fun-games-container::-webkit-scrollbar-track {
  background: #f0f0f0;
  border-radius: 4px;
}

.fun-games-container::-webkit-scrollbar-thumb {
  background: var(--primary);
  border-radius: 4px;
}

.fun-games-container::-webkit-scrollbar-thumb:hover {
  background: #1a3352;
}

.fun-game-card {
  flex-shrink: 0;
  width: 130px;
  height: 143px;
 background: linear-gradient(180deg, #16213e, #0f3460);
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid #2d4a6f;
  text-decoration: none;
  color: inherit;
  transition: transform 0.2s;
}

.fun-game-card:hover {
  transform: scale(1.05);
}

.fun-game-card img {
  width: 100%;
  height: 100px;
  object-fit: cover;
}

.fun-game-name {
  padding: 8px;
  font-size: 12px;
  font-weight: 500;
  color: white;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.surprise-games-section {
  margin: 20px 0;
}

.surprise-games-title {
  font-size: 20px;
  font-weight: bold;
  color: var(--primary);
  margin: 20px 0 15px 0;
  padding-bottom: 5px;
  border-bottom: 2px solid var(--primary);
}

.surprise-games-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 15px;
}

.surprise-games-ad {
  grid-column: 1 / -1;
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
}

.surprise-games-ad > div {
  width: 100%;
  max-width: 300px;
}

.surprise-game-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 15px;
  background: linear-gradient(145deg, #533483, #3d2b5c);
  border: 1px solid #6b4c9a;
  border-radius: 12px;
  text-decoration: none;
  color: inherit;
  transition: all 0.2s;
}

.surprise-game-card:hover {
  border-color: var(--primary);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.surprise-game-image {
  width: 80px;
  height: 80px;
  margin-bottom: 10px;
}

.surprise-game-img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid #f0f0f0;
}

.surprise-game-name {
  font-size: 13px;
  font-weight: 500;
  color: white;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}


.top-games-section {
  margin: 20px 0;
  padding: 15px;
  background: linear-gradient(180deg, #16213e, #0f3460);
  border: 1px solid #2d4a6f;
  border-radius: 10px;
}

.top-games-title {
  font-size: 20px;
  font-weight: bold;
  color: var(--primary);
  margin-bottom: 15px;
  padding-bottom: 5px;
  border-bottom: 1px solid var(--primary);
}

.top-games-list {
  display: flex;
  flex-direction: column;
}

.top-game-card {
  display: flex;
  align-items: center;
  padding: 12px;
  border-bottom: 1px solid #2d4a6f;
  text-decoration: none;
  color: inherit;
  transition: all 0.3s ease;
}

.top-game-card:last-child {
  border-bottom: none;
}

.top-game-card:hover {
  border-color: #007bff;
  box-shadow: 0 2px 10px rgba(0, 123, 255, 0.1);
}

.top-game-img {
  width: 50px;
  height: 50px;
  border-radius: 8px;
  object-fit: cover;
  flex-shrink: 0;
}

.top-game-info {
  display: flex;
  flex-direction: column;
  gap: 5px;
  flex: 1;
  min-width: 0;
  margin-left: 10px;
}

.top-game-name {
  font-size: 16px;
  font-weight: bold;
  color: white;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.top-game-rank {
  font-size: 12px;
  color: #41cca3;
}

.online-games-section {
  margin: 20px 0;
}

.online-games-title {
  font-size: 20px;
  font-weight: bold;
  color: var(--primary);
  margin-bottom: 15px;
  padding-bottom: 5px;
  border-bottom: 2px solid var(--primary);
}

.online-games-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.online-game-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  background: linear-gradient(135deg, #0f3460, #16213e);
  border: 1px solid #2d4a6f;
  border-radius: 10px;
  text-decoration: none;
  color: inherit;
  transition: all 0.2s;
}

.online-game-card:hover {
  border-color: var(--primary);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.online-game-img {
  width: 100%;
  height: 160px;
  object-fit: cover;
}

.online-game-info {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  text-align: left;
  width: 100%;
  padding: 12px;
}

.online-game-name {
  font-size: 14px;
  font-weight: 600;
  color: white;
  margin-bottom: 10px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.online-game-meta {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

.online-game-download {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  color: #41cca3;
}

.download-label {
  font-size: 12px;
  color: #41cca3;
}

.ads {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
  grid-column: 1 / -1;
}

.ads>div {
  width: 100%;
  max-width: 300px;
  display: flex;
  justify-content: center;
  align-items: center;
}


.game-detail-container {
  border-radius: 6px;
  margin-bottom: 30px;
  overflow: hidden;
  display: flex;
  flex-wrap: wrap;
  gap: 15px;
}

.game-header {
  flex-shrink: 0;
  width: 72px;
  height: 72px;
  border-radius: 6px;
  overflow: hidden;
  border: 2px solid white;
}

.game-icon {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.game-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
}


.detail-page .main-content {
  margin-top: 48px;
  background-color: var(--color2);
}

.game-detail-container .game-title {
  font-size: 24px;
  font-weight: bold;
  color: #2c2c2c;
  margin-bottom: 10px;
  line-height: 1.2;
}

.game-category {
  display: inline-block;
  color: #333;
  font-size: 15px;
  max-width: 100%;
}

.game-detail-container .game-rating {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 18px;
}

.game-detail-container .stars {
  color: var(--stars-color);
  font-size: 16px;
}

.rating-text {
  display: inline;
  margin-left: 5px;
  font-size: 14px;
  color: #666;
}

.game-meta-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  margin-top: 8px;
}

.game-meta-row .game-rating {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 0 !important;
}

.game-meta-row .game-download {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 14px;
  color: #666;
  margin-left: auto;
  flex-shrink: 0;
  background: #f0f0f0;
  padding: 6px 12px;
  border-radius: 20px;
}

.description-section {
  margin: 20px 0;
  border-radius: 6px;
}

.description-title {
  font-size: 18px;
  font-weight: bold;
  color: white;
  background-color: var(--primary);
  margin-bottom: 10px;
  padding: 8px;
}

.game-description {
  color: #555;
  line-height: 1.6;
  font-size: 15px;
  margin: 0;
}

.tags-wrapper {
  margin-top: 15px;
  padding-top: 15px;
}

.tags-title {
  font-size: 18px;
  font-weight: bold;
  color: white;
  margin-bottom: 10px;
  background-color: var(--primary);
  padding: 8px;
}

.tags-container {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tag-item {
  background: #f1f1f1;
  color: #666;
  padding: 6px 12px;
  border-radius: 5px;
  font-size: 13px;
}

.play-button-container {
  text-align: center;
  margin-bottom: 10px;
}

@keyframes trembling {
  0%, 70%, 95%, 100% {
    transform: rotate(0deg);
  }
  75%, 85% {
    transform: rotate(-5deg);
  }
  80%, 90% {
    transform: rotate(5deg);
  }
}

.play-button {
  width: 100%;
  max-width: 340px;
  background: var(--primary);
  color: white;
  padding: 8px;
  border-radius: 25px;
  text-decoration: none;
  font-weight: bold;
  font-size: 25px;
  display: inline-block;
  animation: trembling 3s ease-in-out infinite;
}


.recommended-section {
  margin-bottom: 30px;
}

.recommended-section .section-title {
  font-size: 22px;
  font-weight: bold;
  color: white;
  margin-bottom: 20px;
  padding: 10px;
  background-color: var(--primary);
}

.recommended-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}

.recommended-game {
  width: 82px;
  height: 82px;
  cursor: pointer;
}


.recommended-game img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 12px;
}

.recommended-game h3 {
  font-size: 12px;
  font-weight: bold;
  color: #333;
  margin: 0;
  line-height: 1.3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}


.category-header {
  margin-top: 30px;
}

.category-title-section {
  margin-bottom: 10px;
}

.category-title {
  font-size: 18px;
  font-weight: bold;
  color: var(--primary);
  border-bottom: 1px solid var(--primary);
  margin: 10px 0;
  padding: 10px 0;
  }

.privacy-content,
.terms-content {
  margin-top: 60px;
  border-radius: 20px;
  padding: 20px;
  margin-bottom: 40px;
  line-height: 1.6;
}

.privacy-section,
.terms-section {
  margin-bottom: 30px;
}

.privacy-section h2,
.terms-section h2 {
  color: var(--primary);
  font-size: 24px;
  margin-bottom: 15px;
  border-bottom: 2px solid var(--primary);
  padding-bottom: 10px;
}

.privacy-section h3,
.terms-section h3 {
  color: white;
  font-size: 18px;
  margin: 20px 0 10px 0;
}

.privacy-section p,
.terms-section p {
  color: white;
  margin-bottom: 15px;
}

.privacy-section ul,
.terms-section ul {
  color: white;
  margin-bottom: 15px;
  padding-left: 20px;
}

.privacy-section li,
.terms-section li {
  margin-bottom: 8px;
}
