/* ================= RESET & CƠ BẢN ================= */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
}

body {
  background-color: #f2f5fa;
  color: #333;
  overflow-x: hidden;
}

a {
  text-decoration: none;
  color: inherit;
}

ul {
  list-style: none;
}

img {
  display: block;
  max-width: 100%;
}

/* ================= HEADER ================= */
.site-header {
  background: linear-gradient(90deg, #0052d4, #1a75ff);
  position: sticky;
  top: 0;
  z-index: 1000;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
}

.header-container {
  max-width: 1250px;
  margin: 0 auto;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 15px;
}

.logo img {
  height: 40px;
  object-fit: contain;
}

.logo-text {
  font-size: 28px;
  font-weight: 900;
  color: #fff;
  letter-spacing: 1px;
  font-style: italic;
}

.logo-text i {
  color: #ffcc00;
}

/* Form đăng nhập Desktop */
.desktop-auth {
  display: flex;
  align-items: center;
  gap: 8px;
}

.input-group {
  background: #fff;
  border-radius: 6px;
  height: 36px;
  display: flex;
  align-items: center;
  padding: 0 10px;
  gap: 6px;
  color: #666;
  font-size: 13px;
}

.input-group input {
  border: none;
  outline: none;
  font-size: 13px;
  width: 115px;
}

.input-group .divider {
  color: #ccc;
}

.btn {
  height: 36px;
  padding: 0 16px;
  border-radius: 6px;
  font-weight: 600;
  font-size: 13px;
  cursor: pointer;
  border: none;
  transition: opacity 0.2s;
}

.btn:hover {
  opacity: 0.9;
}

.btn-login-pc {
  background: rgba(255, 255, 255, 0.2);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.5);
}

.btn-register-pc {
  background: #fff;
  color: #0052d4;
}

.btn-bell {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.2);
  color: #fff;
  border: none;
  cursor: pointer;
}

/* Nút đăng nhập Mobile */
.mobile-auth {
  display: none;
  align-items: center;
  gap: 8px;
}

.btn-register-mb {
  background: #fff;
  color: #0052d4;
  font-weight: 700;
}

.btn-login-mb {
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.7);
  font-weight: 700;
}

.btn-app-grid {
  background: transparent !important;
  background-color: transparent !important;
  border: none !important;
  outline: none !important;
  padding: 0 !important;
  margin-left: 4px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.btn-app-grid img,
.mobile-auth img {
  width: 28px;
  height: 28px;
  object-fit: contain;
  background: transparent !important;
}

/* Thanh Nav ngang trên Máy tính */
.desktop-nav {
  background: #fff;
  border-bottom: 1px solid #e2e8f0;
}

.nav-list {
  max-width: 1250px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 46px;
  padding: 0 15px;
}

.nav-list li a {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 600;
  color: #444;
  padding: 8px 6px;
  transition: color 0.2s;
}

.nav-list li a:hover {
  color: #0052d4;
}

.nav-list li a img {
  width: 20px;
  height: 20px;
  object-fit: contain;
}

/* ================= BANNER SLIDER ================= */
.banner-section {
  width: 100%;
  overflow: hidden;
  background: #002b80;
}

.bannerSwiper {
  width: 100%;
  aspect-ratio: 1920 / 440;
}

.bannerSwiper .swiper-slide img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.swiper-pagination-bullet {
  background: #fff !important;
  opacity: 0.6;
}

.swiper-pagination-bullet-active {
  background: #ffcc00 !important;
  opacity: 1;
}

/* ================= THANH CHẠY CHỮ (MARQUEE) ================= */
.marquee-wrapper {
  background: #1464f4;
  color: #fff;
  height: 36px;
  display: flex;
  align-items: center;
}

.marquee-container {
  max-width: 1250px;
  width: 100%;
  margin: 0 auto;
  padding: 0 15px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.marquee-icon {
  color: #ffcc00;
  font-size: 16px;
  flex-shrink: 0;
}

.marquee-content {
  overflow: hidden;
  white-space: nowrap;
  flex: 1;
  font-size: 13px;
}

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

.marquee-chat-mb {
  display: none;
}

@keyframes marquee {
  0% { transform: translate(0, 0); }
  100% { transform: translate(-100%, 0); }
}

/* ================= GIAO DIỆN CHÍNH MÁY TÍNH ================= */
.desktop-main {
  max-width: 1060px;
  margin: 65px auto 40px; /* Chừa khoảng trống phía trên cho đầu nhân vật nhô lên */
  padding: 0 15px;
}

/* --- Hàng trên: 2 thẻ lớn --- */
.pc-top-banners {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
  margin-bottom: 24px;
}

.pc-hero-card {
  position: relative;
  height: 210px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  padding: 24px;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.08);
  transition: transform 0.25s ease;
  /* Không dùng overflow: hidden ở đây để đầu nhân vật nhô cao lên khỏi khung */
}

.pc-hero-card:hover {
  transform: translateY(-4px);
}

/* Ảnh nền bo góc (Hình 2 & Hình 4) */
.hero-bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 14px;
  z-index: 1;
}

/* Khối chữ và nhãn Hot bên trái */
.hero-content {
  position: relative;
  z-index: 3;
  color: #ffffff;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  margin-top: 15px;
}

.hot-badge {
  position: absolute;
  top: -45px;
  left: 0;
  background: #ff4757;
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  padding: 4px 12px;
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.hero-title {
  font-size: 36px;
  font-weight: 800;
  letter-spacing: 0.5px;
  line-height: 1.1;
  margin-bottom: 6px;
  text-shadow: 0 2px 6px rgba(0, 0, 0, 0.25);
}

.hero-sub {
  font-size: 16px;
  font-weight: 700;
  text-transform: uppercase;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.25);
}

/* Ảnh nhân vật tách nền nhô lên khỏi khung (Hình 3 & Hình 5) */
.hero-char {
  position: absolute;
  bottom: 0;
  right: 15px;
  height: 265px; /* Cao hơn khung 210px để đầu nhân vật nhô ra ngoài */
  width: auto;
  object-fit: contain;
  z-index: 2;
  pointer-events: none;
  transition: transform 0.3s ease;
}

.pc-hero-card:hover .hero-char {
  transform: scale(1.04);
}

/* --- Hàng dưới: 6 ô vuông danh mục --- */
.pc-bottom-categories {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 20px;
}

.pc-cat-card {
  position: relative;
  aspect-ratio: 1 / 1;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  transition: transform 0.25s ease;
}

.pc-cat-card:hover {
  transform: translateY(-5px);
}

.pc-cat-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Chữ đè lên đáy của 6 ô vuông */
.cat-title {
  position: absolute;
  bottom: 12px;
  left: 0;
  width: 100%;
  text-align: center;
  color: #ffffff;
  font-size: 18px;
  font-weight: 800;
  text-transform: uppercase;
  text-shadow: 0 2px 5px rgba(0, 0, 0, 0.45);
  z-index: 2;
  padding: 0 5px;
  line-height: 1.15;
}

/* ================= GIAO DIỆN CHÍNH ĐIỆN THOẠI (ẨN TRÊN PC) ================= */
.mobile-main {
  display: none;
}

.mobile-bottom-nav {
  display: none;
}

/* ================= NÚT NỔI BÊN PHẢI ================= */
.floating-right-pc {
  position: fixed;
  right: 0;
  top: 40%;
  transform: translateY(-50%);
  display: flex;
  flex-direction: column;
  gap: 4px;
  z-index: 999;
}

.float-btn {
  width: 40px;
  height: 40px;
  background: #1a75ff;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px 0 0 8px;
  box-shadow: -2px 2px 6px rgba(0, 0, 0, 0.15);
  font-size: 18px;
}

.floating-event {
  position: fixed;
  right: 25px;
  bottom: 90px;
  z-index: 999;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.btn-scroll-top {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: #ff6600;
  color: #fff;
  border: none;
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(0,0,0,0.2);
}

.event-badge {
  position: relative;
  width: 68px;
  height: 68px;
}

.event-fallback {
  width: 68px;
  height: 68px;
  border-radius: 50%;
  background: radial-gradient(circle, #2b580c, #112205);
  border: 3px solid #ffcc00;
  color: #ffcc00;
  font-weight: 900;
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.close-event {
  position: absolute;
  top: -8px;
  left: -8px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #777;
  color: #fff;
  border: none;
  font-size: 11px;
  cursor: pointer;
}

/* ================= RESPONSIVE ĐIỆN THOẠI (<= 768px) ================= */
@media (max-width: 768px) {
  body {
    background-color: #f4f7fc;
    padding-bottom: 70px;
  }

  .desktop-auth,
  .desktop-nav,
  .desktop-main,
  .floating-right-pc {
    display: none !important;
  }

  .mobile-auth {
    display: flex;
  }

  .header-container {
    height: 52px;
    padding: 0 10px;
  }

  .logo img {
    height: 32px;
  }

  .btn {
    height: 32px;
    padding: 0 12px;
    font-size: 12px;
  }

  /* Tỷ lệ banner trên điện thoại cao hơn */
  .bannerSwiper {
    aspect-ratio: 16 / 6;
  }

  /* Thanh thông báo bo tròn kiểu Mobile */
  .marquee-wrapper {
    background: transparent;
    padding: 8px 10px 4px;
    height: auto;
  }

  .marquee-container {
    background: #fff;
    color: #222;
    border-radius: 20px;
    height: 34px;
    padding: 0 12px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.06);
  }

  .marquee-content {
    font-weight: 600;
    font-size: 13px;
  }

  .marquee-chat-mb {
    display: block;
    color: #7b8a9b;
    font-size: 18px;
  }

  /* Bố cục 2 cột trên Điện thoại: Thanh cuộn dọc trái + Lưới game phải */
  .mobile-main {
    display: flex;
    gap: 10px;
    padding: 8px 10px;
    height: calc(100vh - 225px);
    min-height: 460px;
  }

  /* Thanh cuộn dọc bên trái */
  .mobile-sidebar {
    width: 76px;
    flex-shrink: 0;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding-right: 2px;
    scrollbar-width: none;
  }

  .mobile-sidebar::-webkit-scrollbar {
    display: none;
  }

  .sidebar-item {
    background: #fff;
    border-radius: 12px;
    padding: 10px 4px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.04);
    cursor: pointer;
    border: 1px solid #e6ecf5;
    transition: all 0.2s;
  }

  .sidebar-item img {
    width: 34px;
    height: 34px;
    object-fit: contain;
  }

  .sidebar-item span {
    font-size: 11px;
    font-weight: 700;
    color: #3b5998;
    text-align: center;
  }

  .sidebar-item.active {
    background: linear-gradient(180deg, #0072ff, #0052d4);
    border-color: #0052d4;
  }

  .sidebar-item.active span {
    color: #fff;
  }

  /* Lưới game 3 cột cuộn dọc bên phải */
  .mobile-game-list {
    flex: 1;
    overflow-y: auto;
    scrollbar-width: none;
  }

  .mobile-game-list::-webkit-scrollbar {
    display: none;
  }

  .mb-game-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
  }

  .mb-game-card {
    display: block;
    border-radius: 10px;
    overflow: hidden;
    background: transparent;
    transition: transform 0.15s ease;
  }

  .mb-game-card:active {
    transform: scale(0.96); /* Hiệu ứng lún nhẹ khi chạm tay trên điện thoại */
  }

  .mb-game-card img {
    width: 100%;
    height: auto;
    display: block;
    object-fit: contain; /* Giữ nguyên vẹn 100% khung viền và chữ có sẵn trong ảnh */
  }

  /* Thanh điều hướng cố định dưới đáy */
  .mobile-bottom-nav {
    display: flex;
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 68px;
    background: linear-gradient(180deg, #ffffff 0%, #f4f6f9 75%, #e6e9ef 100%);
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.06);
    justify-content: space-around;
    align-items: flex-end;
    padding-bottom: 8px;
    z-index: 1000;
  }

  .bottom-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-end;
    gap: 5px;
    color: #707784;
    font-size: 11.5px;
    font-weight: 600;
    flex: 1;
    height: 100%;
    letter-spacing: -0.2px;
  }

  .bottom-nav-item .nav-icon {
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .bottom-nav-item.active {
    color: #21599c;
    font-weight: 700;
  }

  /* Nút Nạp Rút tròn nổi ở giữa */
  .bottom-nav-item.center-deposit {
    position: relative;
  }

  .deposit-circle {
    width: 58px;
    height: 58px;
    border-radius: 50%;
    background: linear-gradient(180deg, #1a9cff 0%, #0066ff 100%);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    position: absolute;
    top: -24px;
    border: 3.5px solid #ffffff;
    box-shadow: 0 4px 10px rgba(0, 102, 255, 0.35);
  }
}
.custom-grid-icon {
  display: grid;
  grid-template-columns: repeat(2, 11px);
  grid-template-rows: repeat(2, 11px);
  gap: 3px;
  align-items: center;
  justify-content: center;
}

.custom-grid-icon .sq {
  width: 11px;
  height: 11px;
  border-radius: 3px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.custom-grid-icon .sq-white {
  background-color: #ffffff;
}

.custom-grid-icon .sq-blue {
  background-color: #8bb8ff;
}

.custom-grid-icon .sq-plus {
  color: #ffffff;
  font-size: 16px;
  font-weight: 900;
  line-height: 1;
}
/* ================= MODAL ĐĂNG KÝ & ĐĂNG NHẬP ================= */
.auth-modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  z-index: 3000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 15px;
}

.auth-modal.show {
  display: flex;
}

.auth-box {
  background: #ffffff;
  border-radius: 18px;
  overflow: hidden;
  width: 100%;
  box-shadow: 0 12px 35px rgba(0, 0, 0, 0.25);
  max-height: 94vh;
  overflow-y: auto;
  animation: modalFadeIn 0.2s ease;
}

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

/* Kích thước khung Đăng ký trên PC */
.register-box {
  max-width: 780px;
}

/* Khung Đăng nhập trên cả PC và Mobile đều mang giao diện giống Điện thoại */
.login-box {
  max-width: 440px;
}

.auth-header {
  background: linear-gradient(180deg, #0088ff 0%, #005ce6 100%);
  height: 68px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.auth-logo {
  height: 38px;
  object-fit: contain;
}

.auth-close-pc {
  position: absolute;
  right: 20px;
  background: transparent;
  border: none;
  color: #ff4d4f;
  font-size: 26px;
  cursor: pointer;
}

.auth-back-mb {
  display: none;
  position: absolute;
  left: 16px;
  background: transparent;
  border: none;
  color: #ffffff;
  font-size: 22px;
  cursor: pointer;
}

.auth-form {
  padding: 28px 36px 32px;
}

/* Lưới 2 cột cho form Đăng ký trên PC */
.reg-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 18px 24px;
}

.form-field {
  margin-bottom: 16px;
}

.reg-grid .form-field {
  margin-bottom: 0;
}

.reg-grid .form-field.full-col {
  grid-column: span 2;
}

.form-field label {
  display: block;
  color: #1677ff;
  font-weight: 700;
  font-size: 14.5px;
  margin-bottom: 8px;
}

.field-wrap {
  position: relative;
  display: flex;
  align-items: center;
  border: 1px solid #d9d9d9;
  border-radius: 6px;
  height: 46px;
  padding: 0 14px;
  background: #fff;
  transition: border-color 0.2s;
}

.field-wrap:focus-within {
  border-color: #1677ff;
}

.field-wrap.pill-wrap {
  border-radius: 25px;
}

.field-wrap input {
  width: 100%;
  border: none;
  outline: none;
  font-size: 13.5px;
  color: #333;
  background: transparent;
}

.field-wrap input::placeholder {
  color: #a6adb4;
}

.toggle-pass {
  color: #1677ff;
  cursor: pointer;
  font-size: 16px;
  margin-left: 8px;
}

.phone-wrap {
  gap: 8px;
}

.vn-prefix {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: #1677ff;
  font-size: 13.5px;
  font-weight: 600;
  white-space: nowrap;
  padding-right: 8px;
  border-right: 1px solid #e5e7eb;
}

.vn-flag {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #da251d;
  color: #ffff00;
  font-size: 11px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* Điều khoản */
.terms-check {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin: 22px 0 12px;
  font-size: 13.5px;
  color: #333;
  cursor: pointer;
}

.terms-check input {
  display: none;
}

.check-circle {
  width: 19px;
  height: 19px;
  border-radius: 50%;
  border: 1.5px solid #1677ff;
  color: transparent;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
}

.terms-check input:checked + .check-circle {
  color: #1677ff;
}

.terms-check a {
  color: #1677ff;
}

/* Báo lỗi */
.form-error {
  color: #ff4d4f;
  font-size: 13px;
  font-weight: 600;
  text-align: center;
  min-height: 18px;
  margin: 6px 0;
}

/* Cụm nút Đăng ký */
.reg-actions {
  display: flex;
  justify-content: center;
  gap: 20px;
  margin-top: 12px;
}

.btn-submit-main,
.btn-switch-outline {
  width: 155px;
  height: 44px;
  border-radius: 22px;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
}

.btn-submit-main {
  background: linear-gradient(180deg, #1a8cff 0%, #0066ff 100%);
  color: #fff;
  border: none;
}

.btn-switch-outline {
  background: #fff;
  color: #1677ff;
  border: 1px solid #1677ff;
}

/* Các thành phần riêng của Form Đăng nhập */
.security-notice {
  text-align: center;
  color: #1668dc;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.45;
  margin: 14px 0 8px;
}

.btn-login-pill {
  width: 100%;
  height: 48px;
  border-radius: 24px;
  background: linear-gradient(180deg, #1a8cff 0%, #0066ff 100%);
  color: #fff;
  font-size: 16px;
  font-weight: 700;
  border: none;
  cursor: pointer;
  margin-top: 4px;
}

.no-account-line {
  text-align: center;
  font-size: 13.5px;
  margin: 14px 0 18px;
  color: #333;
}

.no-account-line a {
  color: #000;
  font-weight: 800;
}

.app-download-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #fff;
  border-radius: 14px;
  padding: 12px 22px;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
  margin-bottom: 18px;
}

.app-side {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  font-weight: 700;
  color: #333;
}

.android-ic {
  font-size: 36px;
  color: #a4c639;
}

.apple-ic {
  font-size: 36px;
  color: #000000;
}

.app-center-txt {
  text-align: center;
}

.app-center-txt strong {
  display: block;
  color: #e68a00;
  font-size: 16px;
  line-height: 1.2;
}

.app-center-txt small {
  color: #d48806;
  font-size: 11px;
  font-weight: 600;
}

.recover-row {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}

.btn-recover-blue,
.btn-recover-outline {
  height: 46px;
  border-radius: 23px;
  font-size: 11px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  text-decoration: underline;
  line-height: 1.3;
}

.btn-recover-blue {
  background: linear-gradient(180deg, #1a8cff 0%, #0066ff 100%);
  color: #fff;
}

.btn-recover-outline {
  background: #fff;
  color: #1554ad;
  border: 1px solid #1554ad;
}

/* Responsive Form trên Điện thoại: Mở full màn hình y hệt ảnh mẫu */
@media (max-width: 768px) {
  .auth-modal {
    padding: 0;
  }

  .auth-box,
  .register-box,
  .login-box {
    max-width: 100%;
    height: 100vh;
    max-height: 100vh;
    border-radius: 0;
  }

  .auth-close-pc {
    display: none;
  }

  .auth-back-mb {
    display: block;
  }

  .auth-form {
    padding: 20px 16px 40px;
  }

  .reg-grid {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .reg-grid .form-field.full-col {
    grid-column: span 1;
  }
}