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

/* DESKTOP CSS */
html,
body {
  height: 100%;
  margin: 0;
  padding: 0;
  font-family: "Montserrat", Arial, Helvetica, sans-serif;
}

.menu-container {
  display: flex;
  flex-direction: column;
  width: 100%;
  padding: 22px 38px;
  padding-bottom: 20px;
}

.desktop {
  position: relative;
  width: 100%;
  height: 100vh;
  overflow: hidden;
  background: url("../image/bg-pc.webp") no-repeat center center;
  background-size: cover;
  background-color: #161920;
}

/* Canvas thiết kế cố định 1920px.
   Toàn bộ layout desktop bên trong giữ nguyên position/px như thiết kế gốc.
   JS (cuối index.html) tính scale = min(viewportW/1920, viewportH/chiềuCaoNộiDung)
   và áp transform: translate(...) scale(...) → mọi vị trí co giãn theo đúng tỷ lệ
   trên mọi laptop/tablet, không cần media query cho từng thiết bị. */
.desktop-scaler {
  position: absolute;
  top: 0;
  left: 0;
  width: 1920px;
  transform-origin: top left;
}

.title-group {
  width: 100%;
  text-align: center;
  margin-top: 22px;
  margin-bottom: -72px;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0vh;
}

.title-img {
  width: 20%;
  height: auto;
  margin-bottom: 11px;
}

.games-container {
  max-width: 1200px;
  position: relative;
  margin: 0 auto;
}

.games-frame {
  position: relative;
  width: 100%;
  margin-top: 56px;
}

.games-title {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.carousel-wrapper {
  width: 90%;
  overflow: hidden;
  margin-top: -124px;
  padding: 0px 60px;
  margin-left: 50px;
}

.carousel-wrapper::before,
.carousel-wrapper::after {
  content: "";
  position: absolute;
  top: 0;
  width: 60px;
  height: 100%;
  z-index: 5;
  pointer-events: none;
}

.carousel-wrapper::before {
  left: 0;
}

.carousel-wrapper::after {
  right: 0;
}

.carousel {
  display: flex;
  position: relative;
  animation: scroll 60s linear infinite;
}

.carousel:hover {
  animation-play-state: paused;
}

.game-item {
  /* Kích thước cố định theo canvas 1920px — scale bằng transform, không theo vw */
  flex: 0 0 120px;
  aspect-ratio: 1;
  border-radius: 12px;
  overflow: hidden;
  cursor: pointer;
  transition: transform 0.3s ease;
}

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

.game-item img {
  width: 90%;
  height: 90%;
  object-fit: cover;
}

@keyframes scroll {
  0% {
    transform: translateX(0);
  }
  100% {
    /* 11 item × (120px + 16px) = 1496px */
    transform: translateX(-1496px);
  }
}

.linkbox-section {
  position: relative;
  z-index: 2;
  height: auto;
  max-width: 1200px;
  margin: auto;
  display: grid;
  margin-top: 50px;
  grid-template-columns: repeat(2, 1fr);
}
.frame-section img {
  width: 1200px;
  height: 370px;
  margin-top: 40px;
}

.info-container {
  position: absolute;
  top: 10px;
  left: 80%;
  transform: translateX(-50%);
  z-index: 5;
}

.info-container img {
  width: 200%;
  height: auto;
  margin-left: -167px;
}

.qr-container {
  position: absolute;
  top: 10px;
  left: 80%;
  transform: translateX(-50%);
  z-index: 5;
}

.qr-container img {
  width: 60%;
  height: auto;
  margin-top: 225px;
  margin-left: -86px;
}

.button-download-1 {
  position: absolute;
  top: 10px;
  left: 80%;
  transform: translateX(-50%);
  z-index: 99999;
}

.button-download-1 img {
  width: 72%;
  height: auto;
  margin-top: 218px;
  margin-left: 90px;
}

.button-download-2 {
  position: absolute;
  top: 10px;
  left: 80%;
  transform: translateX(-50%);
  z-index: 99;
}

.button-download-2 img {
  width: 72%;
  height: auto;
  margin-top: 300px;
  margin-left: 90px;
}

.container {
  position: relative;
  display: flex;
  gap: 20px;
  justify-content: center;
  max-width: 1200px;
}

.link-section {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
  justify-content: center;
  max-width: 1200px;
}

.circle-item {
  position: relative;
  width: 190px;
  height: 185px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  cursor: pointer;
  transition: transform 0.3s ease;
}

.circle-item img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.circle-content {
  position: absolute;
  text-align: center;
  color: white;
  z-index: 10;
  display: flex;
  flex-direction: column;
  gap: 5px;
  margin-top: 25px;
}

.circle-content .title {
  font-weight: bold;
  font-size: 24px;
  text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5);
}

.circle-content .timing {
  font-size: 20px;
  font-weight: bold;
  text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5);
}

.signal-bar {
  height: 20px;
  display: flex;
  justify-content: center;
  align-items: center;
}

.signal-bar img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  margin-top: 10px;
}

.grid-container {
  position: absolute;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 26px;
  top: 35px;
  right: 180px;
}

.card-item-pc {
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
  font-family: "Montserrat", Arial, Helvetica, sans-serif;
  justify-content: center;
}

.signal-strengh {
  z-index: 1;
  position: absolute;
  font-size: 20px;
  color: #3dff4a;
  font-weight: bold;
  top: 53px;
  left: 207px;
}

.link-button-pc {
  position: absolute;
  display: flex;
  align-items: center;
  gap: 10px;
  width: 300px;
  top: 58px;
  left: -4px;

  .link-icon-pc {
    position: absolute;
    height: auto;
    width: 20px;
    top: 45px;
    left: 200px;
  }
  .link-text {
    position: absolute;
    font-size: 16px;
    font-weight: bold;
    color: #ffffff;
    text-decoration: none;
    top: 45px;
    left: 230px;
  }
}

.card-item-pc img {
  width: 100%;
  height: 100px;
}

.download-btn {
  position: absolute;
  top: 398px;
  left: 536px;

  .btn-ios-pc {
    position: absolute;
    width: auto;
    height: 40px;
    left: 242px;
    top: -40px;
  }
  .btn-android-pc {
    position: absolute;
    width: auto;
    height: 40px;
    left: 380px;
    top: -40px;
  }
}

.social-icons {
  /* absolute theo canvas 1920px (fixed không dùng được trong phần tử đã transform) */
  position: absolute;
  right: 38px;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  flex-direction: column;
  z-index: 100;
}

.social-icon {
  width: 70px;
  height: 70px;
  cursor: pointer;
  transition: transform 0.3s ease;
}

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

.social-icon img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}


/* TABLET: vị trí cột social icons do JS tự tính theo phần canvas bị crop
   (xem fitDesktop trong index.html) — luôn bám mép phải màn hình */

/* END DESSKTOP CSS */

.mobile {
  display: none;
}

@media (max-width: 767px) {
  .desktop {
    display: none !important;
  }

  .mobile {
    display: block;
    width: 100%;
    position: relative;
    overflow: hidden;
    background: url("../image/bg-mobile.webp") no-repeat center center;
    background-size: cover;
    font-family: "Montserrat", Arial, Helvetica, sans-serif;
    /* height do JS đặt = chiều cao canvas × scale */
  }

  /* Canvas thiết kế mobile cố định 430px — JS scale theo bề rộng viewport,
     mọi position/top px bên trong giữ nguyên tỷ lệ trên mọi điện thoại */
  .mobile-scaler {
    position: relative;
    width: 430px;
    transform-origin: top left;
    padding: 210px 0px;
  }

  .mobile-title-img {
    position: relative;
    margin: 0 auto;
    width: 40%;
    max-width: 300px;
    height: auto;
  }

  .card-item-mobile img {
    width: 100%;
    height: auto;
  }

  .mobile-character-img {
    padding: 10px;
    width: 90%;
    filter: drop-shadow(0 8px 20px rgba(0, 0, 0, 0.5));
  }

  .mobile-container {
    width: 100%;
    display: grid;
    grid-template-rows: repeat(5, 1fr);
    flex-direction: column;
    align-items: center;
    padding: 0px 10px;
    position: relative;
    box-sizing: border-box;
    gap: 15px 0;
    /* Chiều cao thiết kế cố định theo canvas (không dùng vh) */
    min-height: 1000px;
  }

  .mobile-section-1 {
    width: 100%;
    text-align: center;
    position: absolute;
    display: flex;
    align-self: center;
    top: -195px;
  }

  .mobile-section-4 {
    width: 100%;
    text-align: center;
    position: absolute;
    z-index: 2;
    top: -136px;
  }

  .download-btn-mobile {
    position: absolute;
    top: 409px;
    left: -207px;
  }

  .card-item-mobile {
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    font-family: "Montserrat", Arial, Helvetica, sans-serif;
    justify-content: center;
  }

  .grid-container-mobile {
    position: relative;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px 8px;
    margin-top: -284px;
    padding: 10px;
  }

  .mobile-section-5 {
    grid-template-columns: repeat(2, 1fr);
    max-width: 100%;
    position: absolute;
    top: 296px;
    display: flex;
    padding: 20px;
    gap: 10px;
  }
  .ios-mobile img {
    width: 190px;
    height: auto;
  }

  .android-mobile img {
    width: 190px;
    height: auto;
  }

  /* .mobile-section-5 img {
    width: 50%;
    height: auto;
  } */

  .mobile-social-grid {
    position: absolute;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    margin: 0 auto;
    top: 890px;
    left: 0px;
    padding: 10px;
  }

  .mobile-carousel-section {
    max-width: 100%;
    position: absolute;
    top: 430px;
  }

  .game-frame-mobile {
    position: relative;
    width: 100%;
    margin-top: 340px;
  }

  .carousel-wrapper-mobile {
    width: 74%;
    overflow: hidden;
    padding: 0px 60px;
    margin-top: -95px;
    margin-left: 44px;
  }

  .carousel-wrapper-mobile::before,
  .carousel-wrapper-mobile::after {
    content: "";
    position: absolute;
    top: 0;
    width: 60px;
    height: 100%;
    z-index: 5;
    pointer-events: none;
  }

  .carousel-wrapper-mobile::before {
    left: 0;
  }

  .carousel-wrapper-mobile::after {
    right: 0;
  }

  .carousel-mobile {
    display: flex;
    position: relative;
    animation: scroll 60s linear infinite;
  }

  .carousel-mobile:hover {
    animation-play-state: paused;
  }

  .game-item-mobile {
    /* Cố định theo canvas 430px — scale bằng transform, không theo vw */
    flex: 0 0 80px;
    aspect-ratio: 1;
    border-radius: 12px;
    overflow: hidden;
    cursor: pointer;
    transition: transform 0.3s ease;
  }

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

  .game-item-mobile img {
    width: 80%;
    height: 80%;
    object-fit: cover;
  }

  @keyframes scroll {
    0% {
      transform: translateX(0);
    }
    100% {
      /* 11 item × (80px + 9px) ≈ 979px */
      transform: translateX(-979px);
    }
  }

  .frame-carousel {
    padding: 10px;
    width: 100%;
  }

  .link-access-frame-mobile {
    width: 100%;
    max-width: 90%;
    padding: 0;
    margin: auto;
  }

  .link-buttons-container-mobile {
    position: absolute;
    top: 56%;
    left: 50%;
    transform: translate(-50%, -50%);
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    width: 80%;
    max-width: 320px;
    z-index: 10;
  }

  .frame-download {
    width: 100%;
    height: auto;
  }

  .frame-item {
    position: absolute;
  }

  .mobile-social-btn {
    display: block;
    transition: transform 0.3s ease;
  }

  .mobile-social-btn img {
    width: 100%;
    height: auto;
    display: block;
  }

  .mobile-social-btn:hover {
    transform: scale(1.05);
  }

  .mobile-social-btn:active {
    transform: scale(0.95);
  }

  .link-mobile-section {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0px;
    max-width: 900px;
    width: 100%;
    position: absolute;
    padding: 10px;
    top: 367px;
  }

  .circle-item-mobile {
    position: relative;
    width: 100%;
    aspect-ratio: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    transition: transform 0.3s ease;
  }

  .circle-item-mobile img.circle-bg-mobile {
    position: absolute;
    width: 85%;
    height: 100%;
    object-fit: contain;
    z-index: 1;
  }

  .circle-content-mobile {
    position: absolute;
    text-align: center;
    color: white;
    z-index: 10;
    display: flex;
    flex-direction: column;
    gap: 8px;
    width: 100%;
    height: 100%;
    justify-content: center;
    align-items: center;
    padding: 20px;
  }

  .circle-content-mobile .title-mobile {
    font-weight: bold;
    font-size: 17px;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5);
  }

  .circle-content-mobile .timing-mobile {
    font-size: 15px;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5);
  }

  .signal-bar-mobile {
    width: 50px;
    height: 35px;
    display: flex;
    justify-content: center;
    align-items: center;
  }

  .signal-bar-mobile img {
    width: 100%;
    height: 100%;
    object-fit: contain;
  }
}
