/* ==== RESET CƠ BẢN ==== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: Arial, sans-serif;
  background-color: var(--over-bg);
  color: var(--site-text);
  padding-top: 85px;
  padding-bottom: 71px;
  display: flex;
  justify-content: center;
}

.wrapper {
  width: 100%;
  max-width: 480px;
  background-color: var(--site-bg);
  min-height: 100vh;
  position: relative;
  overflow: hidden;
}

/* ==== HEADER CHIA 2 KHỐI ==== */
#header {
  width: 100%;
  background-color: var(--header-bg);
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  display: flex;
  justify-content: center;
  padding: 0;
}

#header .header-inner {
  width: 100%;
  max-width: 480px;
  display: flex;
  flex-direction: column;
}

.header-content {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  padding: 0 10px;
}

.header-logo-block,
.header-btn-block {
  width: auto;
}

.logo img {
  max-height: 100%;
  max-width: 120px;
  height: auto;
}

.btn-left {
  display: flex;
  gap: 10px;
}

.btn-left .action-btn {
  position: relative;
  display: inline-block;
  padding: 10px 10px;
  background-color: var(--btn-bg, #ffcc00);
  color: var(--btn-text-color, #fff);
  border: 1px solid transparent;
  border-radius: 25px;
  font-weight: bold;
  font-size: 16px;
  text-decoration: none;
  overflow: hidden;
  z-index: 1;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}
@media (max-width: 480px) {
  .btn-left .action-btn {
    padding: 6px 6px;
    font-size: 16px;
  }
}
.btn-left .action-btn::before {
  content: "";
  position: absolute;
  top: -2px;
  left: -2px;
  right: -2px;
  bottom: -2px;
  background: linear-gradient(270deg, #5E35B1, #03A9F4, #2E7D32);
  background-size: 600% 600%;
  z-index: -1;
  border-radius: 28px;
  animation: borderRun 3s linear infinite;
}

.btn-left .action-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 0 12px rgba(255, 120, 0, 0.4);
}

.btn-left .action-btn:active {
  transform: scale(0.97);
  box-shadow: inset 0 3px 5px rgba(0, 0, 0, 0.2);
}

@keyframes borderRun {
  0% {
    background-position: 0% 50%;
  }
  50% {
    background-position: 100% 50%;
  }
  100% {
    background-position: 0% 50%;
  }
}

/* ==== MOBILE HEADER ==== */
@media (max-width: 480px) {
  #header .header-inner {
    flex-direction: column;
  }

  .header-content {
    flex-direction: column;
    padding: 0;
  }

  .header-logo-block {
    width: 100%;
    background-color: transparent;
    text-align: center;
    padding: 5px 0;
  }

  body {
    padding-top: 125px;
  }


/* Desktop và mobile chung */
.header-btn-block {
  display: flex;
  flex-direction: column;      /* Đảm bảo xếp dọc */
  align-items: center;
  justify-content: center;
  background: #ffcc00;
  padding: 2px 0;
  width: auto;
  min-height: 0;
}

  .logo img {
    max-width: 160px;
    height: auto;
  }

  .btn-left {
    display: flex;
    justify-content: center;
    gap: 10px;
    width: 100%;
  }

}

/* II. Banner */
#banner {
  width: 100%;
  max-width: 480px;
  /* Giá trị tối đa tuỳ ý */
  margin: 15px auto;
  position: relative;
  overflow: hidden;
  /* Sử dụng aspect-ratio để giữ tỉ lệ 407: 120 */
  aspect-ratio: 407 / 120;
}

.slides {
  position: relative;
  width: 100%;
  height: 100%;
}

.slide {
  position: absolute;
  width: 100%;
  height: 100%;
  opacity: 0;
  transition: opacity 0.5s ease-in-out;
}

.slide.active {
  opacity: 1;
}

#banner img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.slider-dots {
  position: absolute;
  bottom: 5px;
  width: 100%;
  text-align: center;
}

.dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  margin: 0 4px;
  background-color: #ccc;
  border-radius: 50%;
}

.dot.active {
  background-color: var(--primary-color);
}

/* III. Marquee */
#marquee {
  width: 90%;
  max-width: 480px;
  overflow: hidden;
  white-space: nowrap;
  margin: 8px auto;
  background-color: transparent;
  padding: 1px;
  font-size: 20px;
}

.marquee-content {
  display: inline-block;
  padding-left: 100%;
  animation: marquee 25s linear infinite;
}

@keyframes marquee {
  from { transform: translateX(0);
}

to {
  transform: translateX(-100%);
}

}

/* IV. Quảng cáo thu hút (Advertisement) */
#ad {
  width: 95%;
  max-width: 480px;
  margin: 5px auto;
  /* Giữ tỉ lệ 407: 94 */
  aspect-ratio: 407 / 94;
  background-image: url('qc1.avif');
  /* Thay bằng ảnh nền thực tế */
  background-size: cover;
  background-position: center;
  position: relative;
  /* Để có thể định vị phần counter tuyệt đối bên trong */
  overflow: hidden;
}

/* Phần số đếm (counter) với các biến để tùy chỉnh kích thước, màu sắc và vị trí */
#ad #counter {
  position: absolute;
  /* Vị trí có thể điều chỉnh qua biến CSS, mặc định nằm ở giữa */
  top: var(--counter-top, 90%);
  left: var(--counter-left, 50%);
  transform: translate(-50%, -50%);
  /* Kích thước và màu sắc */
  font-size: var(--counter-font-size, 20px);
  font-weight: var(--counter-font-weight, bold);
  color: var(--counter-color, var(--secondary-color));
}

/* V. Phần hiển thị các nút */
#buttons-section {
  width: 90%;
  max-width: 480px;
  margin: 10px auto;
  display: flex;
}

.btn-left {
  margin-left: auto;        /* đẩy nhóm nút sang phải */
  display: flex;
  gap: 8px;                 /* khoảng cách giữa nút Registro và Login */
}


/* VI. Phần hiển thị ảnh */
#image-section {
  width: 90%;
  max-width: 480px;
  margin: 10px auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: center;
}

.square-img {
  width: 100%;
  /* Để giữ tỷ lệ vuông, sử dụng padding-top hoặc thuộc tính aspect-ratio */
  aspect-ratio: 1 / 1;
  object-fit: cover;
}

/* ✨ Video responsive vuông 720×720 với viền vàng và bo góc */
#intro-video .video-container {
  width:100%; max-width:720px; aspect-ratio:1/1;
  margin:0 auto 20px; overflow:hidden;
  border:5px solid #FFD700; border-radius:12px;
  box-shadow:0 4px 8px rgba(0,0,0,0.2);
}
#intro-video .video-container video {
  width:100%; height:100%; object-fit:cover; display:block;
}

/* ✨ Ảnh banner 1020×300 responsive */
#banner-image {
  width: 100%;
  max-width: 1020px;     /* giới hạn chiều ngang */
  aspect-ratio: 1020 / 300; /* giữ đúng tỉ lệ */
  margin: 0 auto 20px;    /* canh giữa, cách dưới 20px */
  overflow: hidden;
}

#banner-image .banner-img {
  width: 100%;
  height: 100%;
  object-fit: cover;      /* cắt gọn nếu ảnh khác tỉ lệ */
  display: block;
}

/* VII. Thông tin trang */
#page-info {
  width: 90%;
  max-width: 480px;
  margin: 10px auto;
  font-size: 18px;
  line-height: 1.5;
  text-align: justify;
}

/* ==== FOOTER ==== */
#footer {
  width: 100%;
  background-color: var(--footer-bg);
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  display: flex;
  justify-content: center;
  z-index: 1000;
}

#footer .footer-inner {
  width: 100%;
  max-width: 480px;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  align-items: center;
  height: 60px;
}

.footer-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  font-size: 12px;
}

.footer-item img {
  width: 30px;
  height: 30px;
  object-fit: cover;
  margin-bottom: 2px;
}
.footer-item span {
  color: var(--footer-itemtext);
}
/* Container cho slider icon */
#icon-slider {
  width: 100%;
  max-width: 480px;
  /* bạn có thể điều chỉnh phù hợp */
  margin: 10px auto;
  overflow: hidden;
}

/* Sử dụng flex để xếp icon theo hàng ngang */
.icon-container {
  display: flex;
  gap: 20px;
  transition: transform 0.3s ease;
  font-size: 16px;
}

/* Đặt kích thước cố định cho mỗi icon */
.icon-item {
  min-width: 100px;
  text-align: center;
  cursor: pointer;
}

.icon-item img {
  width: 40px;
  height: 30px;
  object-fit: cover;
  display: block;
  margin: 0 auto;
  /* Kích thước icon */
  height: 30px;
}

/* Phần ảnh gallery */
#gallery {
  width: 100%;
  max-width: 480px;
  margin: 20px auto;
  text-align: center;
}

#gallery img {
  width: 100%;
  max-width: 480px;
  height: auto;
}

/* Đảm bảo body tràn đầy màn hình */
body {
  font-family: sans-serif;
}

/* Khu vực slider icon */
#icon-slider {
  width: 100%;
  max-width: 480px;
  /* Để chỉ hiển thị khoảng 5 icon, bạn điều chỉnh phù hợp */
  margin: 10px auto;
  overflow-x: auto;
  /* Cho phép cuộn ngang */
  -webkit-overflow-scrolling: touch;
}

.icon-container {
  display: flex;
  gap: 10px;
  /* Nếu muốn animation trượt, có thể dùng transition transform */
  transition: transform 0.3s ease;
}

.icon-item {
  min-width: 80px;
  text-align: center;
  cursor: pointer;
}

.icon-link {
  display: inline-block;
  text-decoration: none;
  color: #333;
}

/* Cấu hình cho section ảnh */
section[id^="image"] {
  width: 90%;
  margin: 10px auto;
  /* Giảm khoảng cách trên dưới */
  text-align: center;
}

/* Cấu hình cho các ảnh bên trong section */
section[id^="image"] img {
  width: 100%;
  height: auto;
  min-height: 220px;
  margin-bottom: 10px;
  border: none;
}

.image-with-label {
  display: flex;
  align-items: center;
  margin-left: 10px;
}

.image-with-label img {
  width: 40px;
  height: 30px;
  object-fit: cover;
}

.image-with-label span {
  margin-left: 10px;
  /* Khoảng cách giữa ảnh và văn bản */
  font-size: 18px;
  /* Có thể điều chỉnh kích thước chữ */
  color: var(--site-text);
}


/* Đồng bộ lại icon-item để tránh lệch */
.icon-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-width: 80px;
}

.icon-item img {
  width: 40px;
  height: 30px;
  object-fit: contain;
  display: block;
  margin: 0 auto;
}

.icon-item span {
  margin-top: 4px;
  font-size: 16px;
  line-height: 1.2;
}
/* Banner */
#fixed-banner-container {
  position: fixed;
  bottom: 70px;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 480px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  align-items: flex-end; /* Căn nút về bên phải */
}

#fixed-banner {
  width: 100%;
  background: #000;
  border-radius: 2px;
  overflow: hidden;
  box-shadow: 0 0 10px rgba(0,0,0,0.3);
  margin-top: 5px; /* Để nút Close Ads nằm trên banner */
}

#fixed-banner video {
  width: 100%;
  height: auto;
  display: block;
}

#close-banner {
  background-color: #000;
  color: #fff;
  border: none;
  padding: 2px 2px;
  border-radius: 5px;
  font-size: 12px;
  cursor: pointer;
  margin-right: 5px;
}

#view-ads {
  position: fixed;
  bottom: 70px;
  left: 50%;
  /* (max-width của wrapper) / 2 - nút sẽ nằm sát phải của wrapper */
  transform: translateX(calc(240px - 100%));
  /* 240px = 480px / 2, nếu wrapper là 480px */
  background-color: #000;
  color: #fff;
  border: none;
  padding: 2px 2px;
  border-radius: 5px;
  font-size: 12px;
  cursor: pointer;
  z-index: 9999;
}

/* Đảm bảo trên mobile (màn hình nhỏ) nút vẫn sát phải */
@media (max-width: 480px) {
  #view-ads {
    left: auto;
    right: 10px;
    transform: none;
  }
}

/* Popup overlay: bao phủ toàn màn hình */
#popup {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5); /* overlay mờ */
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 10000;
}


/* Nút đóng Popup */
#popup-close {
  position: absolute;
  top: 0px;
  right: 0px;
  background: #fff;
  border: 1px solid black;
  border-radius: 50%;
  width: 30px;
  height: 30px;
  cursor: pointer;
  font-weight: bold;
}

/* Đảm bảo ảnh trong popup co giãn đúng */
#popup-content img {
  display: block;
  max-width: 100%;
  height: auto;
}
#popup-content video {
  display: block;
  max-width: 100%;
  height: auto;
  margin: 0 auto;
}

/* Hai khối riêng biệt trong header */
.header-logo-block,
.header-btn-block {
  width: auto;
}

/* MOBILE: Chia thành 2 khối với nền riêng biệt */
@media (max-width: 480px) {
  #header {
    height: auto;
    padding: 0;
    flex-direction: column;
  }

  .header-content {
    flex-direction: column;
    padding: 0;
  }

  .header-btn-block {
    width: 100%;
    padding: 6px 0; /* Nếu muốn cao hơn xíu trên mobile */
  }


  .logo img {
    max-width: 160px;
    height: auto;
  }

  .btn-left {
    display: flex;
    justify-content: center;
    gap: 10px;
    width: 100%;
  }

}
@media (min-width: 480px) {
  #header {
    height: 85px; /* hoặc giá trị bạn thích, ví dụ 75px, 90px */
    min-height: 80px;
  }
  .header-content {
    height: 85px;
    min-height: 80px;
    align-items: center;
  }
}
body {
  background: var(--over-bg); /* hoặc màu tuỳ ý */
}

.wrapper {
  width: 100%;
  max-width: 480px;
  background-color: var(--site-bg);
  min-height: 100vh;
  margin: 0 auto;
  position: relative;
  overflow: hidden;
  /* Tạo bóng nếu muốn nổi bật khối chính: */
  box-shadow: 0 0 16px 0 rgba(0,0,0,0.05);
}

#header, #footer {
  /* KHÔNG đặt background-color ở đây nữa! */
  width: 100%;
  display: flex;
  justify-content: center;
  left: 0;
  background: transparent; /* hoặc xoá dòng background-color */
  position: fixed;
  z-index: 1000;
}

.header-inner, .footer-inner {
  width: 100%;
  max-width: 480px;
  margin: 0 auto;
  padding-left: 0;
  padding-right: 0;
  background-color: var(--header-bg); 

}
.footer-inner {
  background-color: var(--footer-bg);
}

.btn-below {
  display: flex;
  gap: 10px;
  margin-top: 6px;
  justify-content: center;
}

.action-btn-nohu {
  position: relative;
  display: inline-block;
  padding: 8px 16px;
  background: linear-gradient(135deg, #D32F2F 0%, #E53935 100%);
  color: #ffffff;
  border: none;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  overflow: hidden;
  transition: transform 0.25s ease, box-shadow 0.25s ease, background 0.5s ease;
  box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

.action-btn-nohu::after {
  content: "";
  position: absolute;
  top: 0; left: -100%;
  width: 100%; height: 100%;
  background: rgba(255,255,255,0.2);
  transform: skewX(-20deg);
  transition: left 0.5s ease;
}

.action-btn-nohu:hover::after {
  left: 200%;
}

.action-btn-nohu:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 16px rgba(0,0,0,0.2);
  background: linear-gradient(135deg, #E53935 0%, #D70404 100%);
}

.action-btn-nohu:active {
  transform: translateY(0);
  box-shadow: inset 0 4px 6px rgba(0,0,0,0.2);
}

.action-btn-89bet {
  position: relative;
  display: inline-block;
  padding: 8px 16px;
  background: linear-gradient(135deg, #000000 0%, #111111 100%);
  color: #FFD700; /* vàng ánh kim */
  border: none;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  overflow: hidden;
  transition: transform 0.25s ease, box-shadow 0.25s ease, background 0.5s ease;
  box-shadow: 0 4px 8px rgba(0,0,0,0.3);
}

.action-btn-89bet::after {
  content: "";
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: rgba(255, 215, 0, 0.15); /* ánh vàng nhạt */
  transform: skewX(-20deg);
  transition: left 0.5s ease;
}

.action-btn-89bet:hover::after {
  left: 200%;
}

.action-btn-89bet:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 16px rgba(255, 215, 0, 0.3);
  background: linear-gradient(135deg, #111111 0%, #000000 100%);
}

.action-btn-89bet:active {
  transform: translateY(0);
  box-shadow: inset 0 4px 6px rgba(255, 215, 0, 0.3);
}

.action-btn-ev99 {
  position: relative;
  display: inline-block;
  padding: 8px 16px;
  background: linear-gradient(135deg, #1C9F72 0%, #167E5D 100%);
  color: #ffffff; /* trắng để tương phản */
  border: none;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  overflow: hidden;
  transition: transform 0.25s ease, box-shadow 0.25s ease, background 0.5s ease;
  box-shadow: 0 4px 8px rgba(28, 159, 114, 0.3);
}

.action-btn-ev99::after {
  content: "";
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: rgba(255, 255, 255, 0.2); /* ánh trắng nhẹ cho hiệu ứng */
  transform: skewX(-20deg);
  transition: left 0.5s ease;
}

.action-btn-ev99:hover::after {
  left: 200%;
}

.action-btn-ev99:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 16px rgba(28, 159, 114, 0.5);
  background: linear-gradient(135deg, #167E5D 0%, #1C9F72 100%);
}

.action-btn-ev99:active {
  transform: translateY(0);
  box-shadow: inset 0 4px 6px rgba(28, 159, 114, 0.4);
}

.action-btn-i9bet {
  position: relative;
  display: inline-block;
  padding: 8px 16px;
  background: linear-gradient(135deg, #1266DD 0%, #0F52B2 100%);
  color: #ffffff;
  border: none;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  overflow: hidden;
  transition: transform 0.25s ease, box-shadow 0.25s ease, background 0.5s ease;
  box-shadow: 0 4px 8px rgba(18, 102, 221, 0.3);
}

.action-btn-i9bet::after {
  content: "";
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: rgba(255, 255, 255, 0.2);
  transform: skewX(-20deg);
  transition: left 0.5s ease;
}

.action-btn-i9bet:hover::after {
  left: 200%;
}

.action-btn-i9bet:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 16px rgba(18, 102, 221, 0.5);
  background: linear-gradient(135deg, #0F52B2 0%, #1266DD 100%);
}

.action-btn-i9bet:active {
  transform: translateY(0);
  box-shadow: inset 0 4px 6px rgba(18, 102, 221, 0.4);
}


.wrapper {
  position: relative; /* rất quan trọng */
}
.wrapper {
  position: relative;
  max-width: 480px;
  margin: 0 auto;
}

#popup {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.5);
  z-index: 10000;
  justify-content: center;
  align-items: center; /* ✅ căn giữa dọc thay vì flex-start */
}

#popup-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;             /* 🔼 từ 92% → 96% */
  max-width: 420px;       /* 🔼 từ 360px → 420px */
  max-height: 90vh;       /* 🔼 nếu muốn chiều cao cao thêm một chút */
  background: #fff;
  border-radius: 10px;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.25);
  overflow-y: auto;
  position: relative;
  padding: 10px;
}

#popup-content a {
  width: 100%;
  height: auto;
  padding: 8px 0;
  flex: 0 0 auto;
  display: block;
  border-top: 1px solid #eee;
}

#popup-content video {
  width: 100%;
  height: auto; /* ✅ Để video co theo chiều ngang, giữ đúng tỷ lệ */
  max-height: 180px; /* ✅ Giới hạn nếu cần */
  object-fit: contain;
  border-radius: 8px;
  display: block;
}


}

#popup-close {
  position: absolute;
  top: 0px;
  right: 0px;
  background: #fff;
  color: #000;
  border: 1px solid #000;
  border-radius: 50%;
  width: 40px;
  height: 40px;
  font-weight: bold;
  cursor: pointer;
  z-index: 100;
}




