/* ============================================
   CỔNG GAME PAGE — CSS riêng
   Theme: afk-26
   ============================================ */

/* ===== PAGE WRAPPER ===== */
body {
    background-color: #0f1220 !important;
}
.cong-game-page {
  background: #0f1220;
  color: #e1e4ff;
  padding-bottom: 40px;
}
.container {
	width: 100% !important;
}
.mobile-top {
    max-width: unset !important;
}
/* ===== THỂ LOẠI GAME NAV ===== */
.cg-theloai-nav {
  padding: 20px 0 8px;
}

.cg-theloai-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
    gap: 30px;
    max-width: 1050px;
    margin: 20px auto;
}

.cg-theloai-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 20px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 12px;
  text-decoration: none;
  color: #c0c4e0;
  transition: all 0.2s ease;
}

.cg-theloai-item:hover {
  background: rgba(139, 123, 255, 0.1);
  border-color: rgba(139, 123, 255, 0.3);
  color: #fff;
  transform: translateY(-2px);
}

.cg-theloai-item.is-active {
  background: linear-gradient(135deg, rgba(139, 123, 255, 0.15), rgba(93, 220, 255, 0.15));
  border-color: rgba(139, 123, 255, 0.4);
  color: #fff;
}

.cg-theloai-icon {
  font-size: 22px;
  line-height: 1;
  flex-shrink: 0;
}

.cg-theloai-name {
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

@media (max-width: 1024px) {
  .cg-theloai-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

@media (max-width: 768px) {
  .cg-theloai-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
  }

  .cg-theloai-item {
    padding: 10px 12px;
    gap: 8px;
  }

  .cg-theloai-icon {
    font-size: 18px;
  }

  .cg-theloai-name {
    font-size: 13px;
  }
}

@media (max-width: 480px) {
  .cg-theloai-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 6px;
  }
}

/* ===== WELCOME SECTION ===== */
.cg-welcome {
  background: linear-gradient(135deg, #0b0e1a 0%, #161b35 50%, #0f1220 100%);
  padding: 28px 0;
  margin-bottom: 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);

  .cg-welcome-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
  }

  .cg-welcome-left {
    display: flex;
    align-items: center;
    gap: 16px;

    h2 {
      font-size: 22px;
      font-weight: 800;
      color: #ffffff;
      line-height: 1.25;
      margin: 0;

      span {
        background: linear-gradient(135deg, #8b7bff, #5ddcff);
        -webkit-background-clip: text;
        background-clip: text;
        -webkit-text-fill-color: transparent;
      }
    }
  }

  .cg-welcome-logo {
    width: 52px;
    height: 52px;
    background: linear-gradient(135deg, #8b7bff, #5ddcff);
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    box-shadow: 0 4px 20px rgba(139, 123, 255, 0.3);

    i {
      font-size: 24px;
      color: #ffffff;
    }
  }

  .cg-welcome-features {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 24px;

    li {
      display: flex;
      align-items: center;
      gap: 8px;
      color: #c0c4e0;
      font-size: 14px;
      white-space: nowrap;
      transition: color 0.2s;

      &:hover {
        color: #fff;
      }
    }

    i {
      font-size: 20px;
      background: linear-gradient(135deg, #8b7bff, #5ddcff);
      -webkit-background-clip: text;
      background-clip: text;
      -webkit-text-fill-color: transparent;
    }
  }

  @media (max-width: 1024px) {
    .cg-welcome-inner {
      flex-direction: column;
      align-items: flex-start;
    }

    .cg-welcome-features {
      flex-wrap: wrap;
      gap: 14px;
    }
  }

  @media (max-width: 640px) {
    padding: 20px 0;

    .cg-welcome-left h2 {
      font-size: 18px;
    }
  }
}


/* ===== GAME CARD COMPONENT ===== */
.cg-game-card {
  display: block;
  position: relative;
  border-radius: 14px;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: #171a2f;
  transition: transform 0.25s ease, box-shadow 0.25s ease;

  &.short {
    aspect-ratio: 2 / 3;
  }

  &.square {
    aspect-ratio: 1 / 1;

    .cg-game-card-thumb img {
      object-fit: contain;
      object-position: center;
    }
  }

  &:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.4);

    .cg-game-card-title {
      opacity: 1;
      transform: translateY(0);
    }
  }

  .cg-game-card-link {
    display: block;
    width: 100%;
    height: 100%;
    text-decoration: none;
    color: #fff;
  }

  .cg-game-card-thumb {
    width: 100%;
    height: 100%;
    position: relative;

    img {
      width: 100%;
      height: 100%;
      object-fit: cover;
      display: block;
      transition: transform 0.35s ease;
    }

    &::after {
      content: '';
      position: absolute;
      bottom: 0;
      left: 0;
      right: 0;
      height: 60%;
      background: linear-gradient(180deg, transparent 0%, rgba(0, 0, 0, 0.75) 100%);
      pointer-events: none;
    }
  }

  &:hover .cg-game-card-thumb img {
    transform: scale(1.05);
  }

  .cg-game-card-title {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 10px 12px;
    font-size: 13px;
    font-weight: 700;
    line-height: 1.3;
    color: #fff;
    margin: 0;
    z-index: 2;
    opacity: 0;
    transform: translateY(6px);
    transition: opacity 0.25s ease, transform 0.25s ease;

    /* Luôn hiện trên mobile */
    @media (max-width: 768px) {
      opacity: 1;
      transform: translateY(0);
      font-size: 12px;
      padding: 8px 10px;
    }
  }
}


/* ===== SECTION TITLES ===== */
.cg-section-title {
  font-size: 22px;
  font-weight: 800;
  color: #fff;
  margin: 0 0 16px 0;
  text-transform: uppercase;
}

.cg-block-title {
  font-size: 22px;
  font-weight: 800;
  color: #fff;
  margin: 0 0 14px 0;
  text-transform: uppercase;
  display: flex;
  align-items: center;
  gap: 12px;

  a {
    color: #fff;
    text-decoration: none;
    transition: color 0.2s;

    &:hover {
      color: #8b7bff;
    }
  }

  .cg-more-btn {
    font-size: 13px;
    font-weight: 600;
    color: #8b7bff;
    margin-left: auto;

    i {
      margin-left: 2px;
    }

    &:hover {
      color: #5ddcff;
    }
  }
}


/* ===== TOP PICKS SWIPER ===== */
.cg-top-picks {
  padding: 16px 0 24px;

  .swiper {
    padding-bottom: 10px;
  }

  .swiper-slide {
    display: flex;
    height: auto;

    &:not(.is-group) {
      .cg-game-card {
        width: 100%;
        aspect-ratio: 16 / 9;
      }
    }
  }

  /* Grouped slide: 2×2 grid */
  .swiper-slide.is-group {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 14px;

    .cg-game-card {
      aspect-ratio: 16 / 9;
    }
  }

  .swiper-button-prev,
  .swiper-button-next {
    color: #fff;
    width: 40px;
    height: 40px;
    background: rgba(15, 18, 32, 0.7);
    border-radius: 50%;
    backdrop-filter: blur(4px);

    &::after {
      font-size: 16px;
    }
  }

  @media (max-width: 768px) {
    .swiper-button-prev,
    .swiper-button-next {
      display: none;
    }
  }
}


/* ===== GAME SWIPER BLOCK (Trending, H5) ===== */
.cg-swiper-block {
  padding: 16px 0 24px;

  .swiper {
    padding-bottom: 10px;
  }

  .swiper-slide {
    height: auto;
  }

  .swiper-button-prev,
  .swiper-button-next {
    color: #fff;
    width: 36px;
    height: 36px;
    background: rgba(15, 18, 32, 0.6);
    border-radius: 50%;

    &::after {
      font-size: 14px;
    }
  }

  @media (max-width: 768px) {
    .swiper-button-prev,
    .swiper-button-next {
      display: none;
    }
  }
}


/* ===== MINI GAME GRID ===== */
.cg-minigame-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 14px;
}

@media (max-width: 1024px) {
  .cg-minigame-grid {
    grid-template-columns: repeat(5, 1fr);
  }
}

@media (max-width: 768px) {
  .cg-minigame-grid {
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
  }
}

@media (max-width: 480px) {
  .cg-minigame-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
  }
}

.cg-minigame-item {
  position: relative;
  border-radius: 14px;
  overflow: hidden;
  background: #171a2f;
  aspect-ratio: 16 / 9;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.cg-minigame-item:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.4);
}

.cg-minigame-item:hover .cg-game-card-title {
  opacity: 1;
  transform: translateY(0);
}

.cg-minigame-item:hover .cg-game-card-thumb img {
  transform: scale(1.05);
}

.cg-minigame-item .cg-game-card-link {
  display: block;
  width: 100%;
  height: 100%;
  text-decoration: none;
  color: #fff;
}

.cg-minigame-item .cg-game-card-thumb {
  width: 100%;
  height: 100%;
  position: relative;
}

.cg-minigame-item .cg-game-card-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.35s ease;
}

.cg-minigame-item .cg-game-card-thumb::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 60%;
  background: linear-gradient(180deg, transparent 0%, rgba(0, 0, 0, 0.75) 100%);
  pointer-events: none;
}

.cg-minigame-item .cg-game-card-title {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 6px 8px;
  font-size: 11px;
  font-weight: 700;
  line-height: 1.3;
  color: #fff;
  margin: 0;
  z-index: 2;
  opacity: 0;
  transform: translateY(6px);
  transition: opacity 0.25s ease, transform 0.25s ease;
}

@media (max-width: 768px) {
  .cg-minigame-item .cg-game-card-title {
    opacity: 1;
    transform: translateY(0);
    font-size: 10px;
    padding: 4px 6px;
  }
}

/* ===== PAGINATION ===== */
.cg-pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  padding: 24px 0 8px;
  flex-wrap: wrap;
}

.cg-page-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 40px;
  height: 40px;
  padding: 0 12px;
  background: #1c2240;
  color: #c0c4e0;
  font-size: 14px;
  font-weight: 700;
  border: 2px solid transparent;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.cg-page-btn:hover {
  background: #252b50;
  color: #fff;
  border-color: rgba(139, 123, 255, 0.4);
}

.cg-page-btn.is-active {
  background: linear-gradient(135deg, #8b7bff, #5ddcff);
  color: #fff;
  border-color: transparent;
  pointer-events: none;
}


/* ===== GAME LIST (Mobile Games) ===== */
.cg-game-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.cg-game-list-item {
  display: flex;
  align-items: center;
  gap: 16px;
  background: #161b30;
  border-radius: 14px;
  padding: 14px;
  transition: background 0.2s ease, transform 0.2s ease;

  &:hover {
    background: #1c2240;
    transform: translateX(4px);
  }

  .cg-game-list-thumb {
    flex-shrink: 0;
    width: 72px;
    height: 72px;
    border-radius: 16px;
    overflow: hidden;

    img {
      width: 100%;
      height: 100%;
      object-fit: cover;
      display: block;
    }
  }

  .cg-game-list-info {
    flex: 1;
    min-width: 0;
  }

  .cg-game-list-title {
    font-size: 15px;
    font-weight: 700;
    margin: 0 0 4px 0;
    line-height: 1.3;

    a {
      color: #fff;
      text-decoration: none;

      &:hover {
        color: #8b7bff;
      }
    }
  }

  .cg-game-list-meta {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 12px;
    color: #7f849e;
    margin-bottom: 4px;

    a {
      color: #8b7bff;
      text-decoration: none;

      &:hover {
        color: #5ddcff;
      }
    }
  }

  .cg-game-list-excerpt {
    font-size: 12px;
    color: #8e93b0;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;

    p {
      margin: 0;
    }
  }

  .cg-game-list-action {
    flex-shrink: 0;
  }

  .cg-btn-download {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 12px;
    background: linear-gradient(135deg, #8b7bff, #5ddcff);
    color: #fff;
    font-size: 16px;
    text-decoration: none;
    transition: transform 0.2s ease, box-shadow 0.2s ease;

    &:hover {
      transform: scale(1.1);
      box-shadow: 0 4px 16px rgba(139, 123, 255, 0.4);
    }
  }

  @media (max-width: 640px) {
    padding: 12px;

    .cg-game-list-thumb {
      width: 60px;
      height: 60px;
      border-radius: 14px;
    }

    .cg-game-list-title {
      font-size: 14px;
    }

    .cg-game-list-excerpt {
      display: none;
    }
  }
}


/* ===== RESPONSIVE CONTAINER ===== */
@media (max-width: 768px) {
  .cg-section-title {
    font-size: 18px;
  }

  .cg-block-title {
    font-size: 17px;
  }
}
