body {
  margin: 0;
  background: #fff6e3;
  color: #ffffff;
}
header,
footer {
  background: #a95dff;
  color: #ffffff;
  padding: 0 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 80px;
}

header {
  justify-content: flex-start;
}
.ads{
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}
.show {
  display: block !important;
}

.hide {
  display: none !important;
}

header img {
  height: auto;
  width: 200px;
  cursor: pointer;
}

header .search {
  width: 234px;
  height: 34px;
  display: flex;
  align-items: center;
  border-radius: 8px;
  box-sizing: border-box;
  overflow: hidden;
  margin: 0 100px;
}

header .search .search_logo {
  display: none;
  width: 100%;
}

header .search .search_input {
  flex: 1;
  background: #fff;
  height: 100%;
}
header .search input {
  width: 100%;
  background: transparent;
  border: none;
  outline: none;
  padding: 0 10px;
  height: 100%;
}
header .search .search_icon {
  width: 34px;
  height: 34px;
  background: #dfdfdf;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

header .search .search_icon img {
  width: 28px;
  max-width: 100%;
}

header nav {
  display: flex;
  align-items: center;
  position: relative;
}

#categories {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
}

#categories #categories_close {
  display: none;
}

#categories li {
  margin: 0 15px;
  cursor: pointer;
}

header #menu-toggle,
header #search-toggle {
  display: none;
  background: none;
  border: none;
  color: #ffffff;
  cursor: pointer;
}

main {
  padding: 20px 50px;
  display: flex;
  flex-wrap: wrap;
  /* justify-content: space-between; */
  min-height: calc(100vh - 200px);
  box-sizing: border-box;
  position: relative;
}

.category-main {
  flex-direction: column;
  align-items: center;
}

.category-main h2 {
  font-weight: bold;
  font-size: 2.5em;
  margin: 50px;
}

.category-block {
  width: 100%;
  order: -1;
}

.category-block h2 {
  font-weight: bold;
  font-size: 1.5em;
}

.category-content {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-start;
}

.game-icon {
  width: calc(25% - 10px);
  margin: 5px;
  position: relative;
  overflow: hidden;
  transition: transform 0.3s;
  align-content: center;
  box-sizing: border-box;
  padding: 5px;
  border-radius: 12px;
}

.game-icon:hover {
  transform: scale(1.1);
}

.game-icon img {
  width: 100%;
  height: auto;
  display: block;
  object-fit: cover;
  background: #fff;
  border-radius: 12px;
}

.game-icon .game-name {
  position: absolute;
  bottom: 0;
  width: 100%;
  padding: 5px;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.8), rgba(0, 0, 0, 0));
  color: #ffffff;
  text-align: center;
  transform: translateY(100%);
  transition: transform 0.3s;
}

.game-icon:hover .game-name {
  transform: translateY(0);
}

footer {
  text-align: center;
  flex-direction: column;
  align-items: center;
  padding: 20px;
}

footer a {
  color: #ffffff;
  text-decoration: none;
  margin: 0 10px;
}

footer a:hover {
  color: #bdc3c7;
  text-decoration: underline;
}

.back-button {
  background: none;
  border: none;
  color: #ffffff;
  font-size: 24px;
  cursor: pointer;
  display: none;
}

.category-content.index .game-icon {
  width: calc(25% - 10px);
}

.category-content.details .game-icon {
  width: calc(12.5% - 10px);
  max-width: 1280px;
}

.category-content.details {
  max-width: 1280px;
}

/* .category-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
} */

.no-result {
  text-align: center;
  font-size: 24px;
  color: #333;
  width: 100%;
  margin-top: 100px;
}

#category-title {
  font-size: 24px;
  color: #a95dff;
  margin: 10px 0;
}

.category-content .game-icon {
  width: calc(16.66% - 10px);
}

.game_content {
  width: 80%;
  margin: 0 auto;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  height: 100%;
  position: absolute;
  overflow: hidden;
}

.game_bg {
  position: absolute;
  filter: brightness(50%) blur(10px);
  width: 200vh;
  height: 120%;
  left: -10%;
  top: -10%;
  padding: 10%;
}

.game_cover {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
}
.game_pic {
  width: 160px;
  border: 1px solid #a95dff;
  border-radius: 15px;
  aspect-ratio: 1 / 1;
  height: auto;
  object-fit: cover;
  object-position: top;
  cursor: pointer;
  box-shadow: 3px 4px 5px #9e9e9e, 0 0 #012f47;
}
.game_play {
  width: 210px;
  height: 42px;
  line-height: 42px;
  text-align: center;
  font-size: 14px;
  font-weight: 700;
  color: #fff;
  background: #a95dff;
  border-radius: 10px;
  margin-top: 42px;
  cursor: pointer;
}

@media (max-width: 768px) {
  header {
    padding: 0px 10px;
    display: flex;
    align-items: center;
  }

  #categories {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    background: #a95dff;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.5);
    width: 50vw;
    height: 100vh;
    z-index: 1000;
    flex-direction: column;
    padding: 60px 0 0 30px;
    box-sizing: border-box;
  }

  #categories.active {
    display: flex;
  }

  #categories #categories_close {
    display: block;
    position: absolute;
    left: 10px;
    top: 10px;
    width: 24px;
    height: 24px;
  }
  #categories #categories_close img {
    width: 100%;
    height: 100%;
  }

  #categories li {
    padding: 15px 0;
  }

  header .logo {
    display: none;
  }

  header #menu-toggle,
  header #search-toggle {
    display: block;
  }

  header #menu-toggle img,
  header #search-toggle img {
    width: 24px;
  }
  header .search {
    margin: 0;
    flex: 1;
    margin: 0 20px;
    overflow: visible;
  }

  header .search .search_input {
    display: none;
    border-radius: 10px;
  }

  header .search .search_logo {
    align-items: center;
    justify-content: center;
    display: flex;
  }

  header .search .search_icon {
    display: none;
  }

  main {
    flex-direction: column;
    align-items: center;
    padding: 10px;
  }

  .category-main {
    margin: 0 0 30px 0;
  }

  .category-block {
    width: 100%;
  }

  .category-content.index .game-icon {
    width: calc(25% - 10px);
  }

  .category-content.details .game-icon {
    width: calc(33.33% - 10px);
  }

  .back-button {
    display: block;
  }

  .more-link-top {
    visibility: hidden;
  }
  .more-link-bottom {
    visibility: visible;
  }

  .category-content .game-icon {
    width: calc(33.33% - 10px); /* 3 icons per row on mobile */
    padding: 0;
  }
  .game_content{
    width: 100%;
  }
}
