/* RESET + GLOBAL */
body {
  font-family: "Courier New", Courier, monospace;
  margin: 0;
  background: #f5f5f5;
  padding-top: 70px;
}
.hometext a {
  text-decoration: none;
  color: white;
}
#grid a {
  text-decoration: none;
  color: #222;
}
html {
  scroll-behavior: smooth;
}

/* HEADER */
header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 5%;
  z-index: 1001;

  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;

  padding: 15px 30px;
  background: #222;
  color: #fff;
}

header div {
  margin-left: 5%;
  margin-right: 10%;
}

header img {
  height: 30px;
  width: 100px;
}

header .righttext {
  display: flex;
  align-items: center;
  gap: 15px;
}

header .hometext {
  font-size: 15px;
  transition: 0.3s;
}

header .hometext:hover {
  transform: scale(1.1);
}

/* LAYOUT */
.container {
  display: flex;
  padding: 20px;
}

/* SIDEBAR */
.sidebar {
  position: fixed;
  top: 80px;
  left: 0;

  width: 210px;
  height: calc(100vh - 100px);

  background: #222;
  color: white;
  padding: 15px;
  border-radius: 0 10px 10px 0;

  overflow-y: auto;
  z-index: 1000;
}

.sidebar input {
  width: 70%;
  padding: 5px;
  border-radius: 10px;
  height: 1rem;
}

.sidebar button {
  padding: 5px 10px;
  border-radius: 8px;
  transition: 0.3s;
}

.sidebar button:hover {
  background-color: white;
  transform: scale(1.1);
}

/* CATEGORY */
.category {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.category .genge {
  border-radius: 8px;
  cursor: pointer;
}

.category .genge:hover {
  transform: scale(1.1);
}
#selectTags {
  border-radius: 8px;
  height: 2rem;
}
/* MAIN */
.main {
  flex: 1;
  margin-left: 230px;
}

.section-title {
  font-weight: bold;
  margin: 20px 0 10px;
}

/* GRID GAME */
.grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 15px;
}
.gridB {
  display: flex;
  flex-direction: row;
  gap: 15px;
  width: 80vw;
}
/* CARD */
.card {
  background: #fff;
  border-radius: 10px;
  padding: 10px;
  text-align: center;
  transition: transform 0.3s ease;
}

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

.card img {
  width: 90%;
  height: 140px;
  object-fit: cover;
}
.track img {
  width: 80%;
  height: 100px;
  object-fit: cover;
}
.besttrack {
  text-decoration: none;
  color: #222;
}

/* PRICE */
.price {
  color: green;
  font-weight: bold;
}

/* LOAD MORE */
.loadmore {
  text-align: center;
  margin: 20px;
  cursor: pointer;
  padding: 10px;
  background: #ddd;
  border-radius: 8px;
}

/* BEST SLIDER */
#best {
  overflow: hidden;
}

#best .track {
  display: flex;
  flex-direction: column;
  gap: 15px;
  animation: scrollX 10s linear infinite;
}

#best .track {
  min-width: 250px;
  flex-shrink: 0;
}

#best .track :hover {
  transform: scale(1.05);
}
.game-detail {
  display: flex;
  flex-direction: row;
  align-items: center;
  width: 60vw;
  gap: 20px;
}

.game-detail img {
  width: 300px;
  height: auto;
  object-fit: cover;
  border-radius: 10px;
}

.game-detail .info {
  margin-left: 10%;
}
/* ANIMATION */
@keyframes scrollX {
  0% {
    transform: translateX(0);
  }
  100% {
    transform: translateX(-50%);
  }
}

/* DETAIL */
.detail {
  margin-top: 40px;
  background: #fff;
  padding: 20px;
  border-radius: 10px;
}

.news-item {
  display: flex;
  gap: 15px;
  margin-bottom: 20px;
}

.news-img {
  width: 150px;
  height: 100px;
  background: #ccc;
}

/* SCROLLBAR */
.sidebar::-webkit-scrollbar,
.grid::-webkit-scrollbar {
  width: 6px;
}

.sidebar::-webkit-scrollbar-thumb,
.grid::-webkit-scrollbar-thumb {
  background: #888;
  border-radius: 10px;
}

/* RESPONSIVE */

/* Tablet */
@media (max-width: 768px) {
  .container {
    flex-direction: column;
  }

  .sidebar {
    position: static;
    width: 95%;
    height: auto;
    border-radius: 10px;
  }

  .main {
    margin-left: 0;
  }

  .grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* Mobile */
@media (max-width: 400px) {
  header {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }

  .grid {
    grid-template-columns: 1fr;
  }

  .news-item {
    flex-direction: column;
  }

  .news-img {
    width: 100%;
    height: 150px;
  }

  .sidebar input,
  .sidebar button {
    width: 100%;
    margin-bottom: 10px;
  }
}
/* DESKTOP */
.game-detail {
  display: flex;
  flex-direction: row;
  align-items: center;
  width: 60vw;
  gap: 20px;
  margin: 40px auto;
}

.game-detail img {
  width: 350px;
  height: auto;
  object-fit: cover;
  border-radius: 10px;
}

.game-detail .info {
  flex: 1;
}

/* TABLET */
@media (max-width: 768px) {
  .game-detail {
    width: 90vw;
    flex-direction: column; /* 🔥 đổi sang dọc */
    text-align: center;
  }

  .game-detail img {
    width: 80%;
  }

  .game-detail .info {
    margin-left: 0;
  }
}

/* MOBILE */
@media (max-width: 400px) {
  .game-detail {
    width: 95vw;
    gap: 15px;
  }

  .game-detail img {
    width: 100%;
  }

  .game-detail .info h2 {
    font-size: 18px;
  }

  .game-detail .price {
    font-size: 16px;
  }

  #backBtn {
    width: 100%;
  }
}
.game-detail {
  animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.fade-enter {
  opacity: 0;
  transform: translateY(20px);
}

.fade-enter-active {
  opacity: 1;
  transform: translateY(0);
  transition: all 0.4s ease;
}
