/* ================= BIẾN MÀU & RESET ================= */
:root {
  --bg-darkest: #060f24;
  --bg-header: #08132b;
  --bg-body: #112247;
  --bg-sidebar: #0d1a38;
  --bg-card: #162a57;
  --border-color: rgba(255, 255, 255, 0.08);
  --primary-blue: #1e88ff;
  --primary-cyan: #00d2ff;
  --text-white: #ffffff;
  --text-muted: #9eb3d6;
  --badge-hot: #ef233c;
  --badge-new: #10b981;
  --gold: #f5b726;
}

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

body {
  font-family: 'Be Vietnam Pro', sans-serif;
  background-color: var(--bg-body);
  color: var(--text-white);
  overflow-x: hidden;
  min-height: 100vh;
}

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

/* ================= HEADER ================= */
.header {
  position: sticky;
  top: 0;
  z-index: 1000;
  background-color: var(--bg-header);
  border-bottom: 1px solid var(--border-color);
  height: 64px;
}

.header-container {
  max-width: 1280px;
  height: 100%;
  margin: 0 auto;
  padding: 0 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.logo img {
  height: 36px;
  width: auto;
  display: block;
  object-fit: contain;
}

.logo-fallback {
  display: none;
  font-size: 26px;
  font-weight: 800;
  font-style: italic;
  letter-spacing: 1px;
  background: linear-gradient(90deg, #00d2ff, #ffffff);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.search-box {
  flex: 1;
  max-width: 360px;
  position: relative;
}

.search-box input {
  width: 100%;
  height: 38px;
  background: #142449;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  padding: 0 40px 0 14px;
  color: #fff;
  font-size: 13px;
  outline: none;
}

.search-box input::placeholder {
  color: var(--text-muted);
}

.search-box button {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: var(--primary-cyan);
  cursor: pointer;
}

.quick-links {
  display: flex;
  gap: 10px;
}

.quick-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border-radius: 8px;
  background: #14264e;
  border: 1px solid rgba(255, 255, 255, 0.08);
  font-size: 13px;
  font-weight: 600;
  transition: 0.2s;
}

.quick-btn i {
  color: var(--primary-cyan);
}

.quick-btn:hover {
  background: #1c356c;
}

.auth-buttons {
  display: flex;
  align-items: center;
  gap: 10px;
}

.btn {
  padding: 9px 18px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
  transition: 0.2s;
}

.btn-login {
  background: #0d1d42;
  border: 1px solid #2c5cc5;
  color: #fff;
}

.btn-login:hover {
  background: #17316b;
}

.btn-register {
  background: linear-gradient(180deg, #32a8ff 0%, #0d6efd 100%);
  color: #fff;
  box-shadow: 0 4px 12px rgba(13, 110, 253, 0.35);
}

.btn-register:hover {
  filter: brightness(1.1);
}

/* ================= THANH DỰ ĐOÁN MÙA GIẢI ================= */
.promo-strip {
  background: radial-gradient(circle at top, #172440 0%, #070d1c 100%);
  border-bottom: 1px solid var(--border-color);
  padding: 10px 0;
}

.promo-strip-container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.promo-title {
  font-size: 16px;
  font-weight: 800;
  letter-spacing: 0.5px;
}

.btn-predict {
  padding: 8px 18px;
  border-radius: 999px;
  background: linear-gradient(180deg, #1b74e4 0%, #0d47a1 100%);
  border: 1px solid #4da6ff;
  font-size: 13px;
  font-weight: 700;
  box-shadow: 0 0 12px rgba(27, 116, 228, 0.5);
  white-space: nowrap;
}

/* ================= BỐ CỤC CHÍNH (DESKTOP) ================= */
.main-wrapper {
  max-width: 1280px;
  margin: 16px auto 40px;
  padding: 0 16px;
  display: flex;
  align-items: flex-start;
  gap: 18px;
}

/* SIDEBAR */
.sidebar {
  width: 195px;
  flex-shrink: 0;
  background: var(--bg-sidebar);
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--border-color);
}

.sidebar-menu {
  list-style: none;
}

.menu-item a {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 13px 14px;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text-muted);
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  transition: 0.2s;
}

.menu-item a i {
  width: 18px;
  text-align: center;
  font-size: 15px;
}

.menu-item:hover a {
  color: #fff;
  background: rgba(255, 255, 255, 0.05);
}

.menu-item.active a {
  color: #fff;
  background: linear-gradient(90deg, #00c6ff 0%, #0072ff 100%);
}

.badge {
  margin-left: auto;
  font-size: 9px;
  font-weight: 800;
  padding: 2px 6px;
  border-radius: 4px;
  color: #fff;
}

.badge-hot { background: var(--badge-hot); }
.badge-new { background: var(--badge-new); }

/* MAIN CONTENT GRID (DESKTOP) */
.main-content {
  flex: 1;
  min-width: 0;
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 16px;
  grid-template-areas:
    "slider jackpot"
    "sports sports"
    "casino casino";
}

.hero-slider-box { grid-area: slider; min-width: 0; }
.jackpot-box     { grid-area: jackpot; min-width: 0; }
.sports-section  { grid-area: sports; min-width: 0; }
.casino-section  { grid-area: casino; min-width: 0; }

/* ================= BANNER SLIDER 6 HÌNH ================= */
.slider-viewport {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 7.5;
  border-radius: 12px;
  overflow: hidden;
  background: #091530;
  border: 1px solid var(--border-color);
}

.slider-track {
  display: flex;
  width: 100%;
  height: 100%;
  will-change: transform;
}

.slide {
  flex: 0 0 100%;
  width: 100%;
  max-width: 100%;
  height: 100%;
  overflow: hidden;
}

.slide img {
  width: 100%;
  height: 100%;
  object-fit: cover; /* Nếu muốn hiện trọn vẹn ảnh không bị cắt viền, đổi thành: fill */
  display: block;
}

.slider-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: none;
  background: rgba(6, 15, 36, 0.6);
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 5;
  transition: 0.2s;
}

.slider-nav:hover { background: rgba(0, 114, 255, 0.85); }
.slider-nav.prev { left: 10px; }
.slider-nav.next { right: 10px; }

.slider-dots {
  position: absolute;
  bottom: 10px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 6px;
  z-index: 5;
}

.dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.45);
  cursor: pointer;
  transition: 0.25s;
}

.dot.active {
  width: 22px;
  background: var(--primary-cyan);
}

/* ================= JACKPOT NỔ HŨ ================= */
.jackpot-card {
  position: relative;
  display: block;
  width: 100%;
  height: 100%;
  min-height: 185px;
  border-radius: 12px;
  background: url('images/slot-pc.png') center / 100% 100% no-repeat;
  border: 1px solid #ffd56b;
  overflow: hidden;
  transition: transform 0.2s;
}

.jackpot-card:hover {
  transform: scale(1.01);
}

.jackpot-amount {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 23%; /* Căn chuẩn vào dải tối ngang trên ảnh */
  text-align: center;
  color: #ffe891;
  font-size: 21px;
  font-weight: 800;
  letter-spacing: 1px;
  text-shadow: 0 2px 6px rgba(0, 0, 0, 0.85);
}
/* ================= TIÊU ĐỀ SECTION ================= */
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.section-header h2 {
  font-size: 15px;
  font-weight: 800;
  display: flex;
  align-items: center;
  gap: 8px;
}

.section-header h2 i {
  color: var(--primary-cyan);
}

.view-more {
  font-size: 13px;
  color: #4da6ff;
  font-weight: 600;
}

/* ================= THỂ THAO SÔI ĐỘNG (DESKTOP) ================= */
.sports-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 12px;
}

/* 2 ô đầu (K+SPORTS, BTI) mỗi ô chiếm 3 cột -> 2 ô 1 hàng */
.sports-grid .sport-card:nth-child(1),
.sports-grid .sport-card:nth-child(2) {
  grid-column: span 3;
}

/* 3 ô sau (TSPORTS, IM, ESPORTS) mỗi ô chiếm 2 cột -> 3 ô 1 hàng */
.sports-grid .sport-card:nth-child(n+3) {
  grid-column: span 2;
}

.sport-card {
  position: relative;
  display: block;
  height: 125px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  overflow: hidden;
  background: #0d1d42;
  transition: transform 0.2s;
}

.sport-card:hover {
  transform: translateY(-3px);
}

/* Ảnh phủ kín khung cho cả Thể Thao & Casino */
.card-img {
  width: 100%;
  height: 100%;
  object-fit: cover; /* Nếu ảnh bị cắt chữ ở mép, đổi thành: object-fit: fill; */
  display: block;
}

.fav-btn {
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 3;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: none;
  background: rgba(0, 0, 0, 0.45);
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.fav-btn.active {
  color: #ff4d6d;
}

/* ================= LIVE CASINO ĐỘT PHÁ ================= */
.casino-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

.casino-card {
  position: relative;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: #0d1d42;
}

.live-tag {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 3;
  background: rgba(239, 35, 60, 0.9);
  color: #fff;
  font-size: 10px;
  font-weight: 800;
  padding: 3px 8px;
  border-radius: 999px;
  display: flex;
  align-items: center;
  gap: 4px;
}

.live-tag i {
  font-size: 6px;
}

.casino-thumb {
  position: relative;
  height: 185px;
  width: 100%;
}

.casino-footer {
  position: absolute;
  left: 8px;
  right: 8px;
  bottom: 8px;
  z-index: 2;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 8px;
  background: rgba(6, 15, 36, 0.78);
  backdrop-filter: blur(4px);
  padding: 8px 10px;
  border-radius: 8px;
}

.casino-name {
  font-size: 14px;
  font-weight: 700;
}

.casino-pot {
  font-size: 11.5px;
  color: var(--gold);
  font-weight: 700;
  margin-top: 2px;
}

.btn-play-now {
  background: linear-gradient(180deg, #ff7b29 0%, #e8590c 100%);
  color: #fff;
  font-size: 11.5px;
  font-weight: 700;
  padding: 6px 12px;
  border-radius: 6px;
  white-space: nowrap;
}

/* ================= NÚT HỖ TRỢ NỔI (DESKTOP) ================= */
.floating-support {
  position: fixed;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  flex-direction: column;
  gap: 10px;
  z-index: 900;
}

.float-btn {
  width: 42px;
  height: 42px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  color: #fff;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.35);
}

.float-app  { background: #16a34a; }
.float-chat { background: #0ea5e9; }

/* ================= BOTTOM NAV (ẨN TRÊN DESKTOP) ================= */
.mobile-bottom-nav {
  display: none;
}

/* ========================================================
   GIAO DIỆN ĐIỆN THOẠI (MOBILE <= 768px)
   ======================================================== */
@media (max-width: 768px) {
  body {
    padding-bottom: 72px; /* Chừa chỗ cho thanh điều hướng dưới */
  }

  .desktop-only {
    display: none !important;
  }

  .header {
    height: 56px;
  }

  .logo img {
    height: 28px;
  }

  .btn {
    padding: 7px 12px;
    font-size: 12px;
  }

  .promo-title {
    font-size: 13px;
  }

  .btn-predict {
    padding: 6px 12px;
    font-size: 11.5px;
  }

  /* Bố cục Mobile: Giữ Sidebar dọc bên trái giống ảnh mẫu */
  .main-wrapper {
    margin: 0;
    padding: 0;
    gap: 0;
  }

  .sidebar {
    width: 74px;
    border-radius: 0;
    border: none;
    border-right: 1px solid var(--border-color);
  }

  .menu-item a {
    flex-direction: column;
    justify-content: center;
    text-align: center;
    gap: 5px;
    padding: 12px 4px;
    font-size: 10.5px;
  }

  .menu-item a i {
    font-size: 18px;
  }

  .badge {
    position: absolute;
    top: 4px;
    right: 4px;
    font-size: 8px;
    padding: 1px 4px;
  }

  /* Sắp xếp thứ tự nội dung Mobile giống ảnh mẫu:
     Banner -> Live Casino -> Nổ Hũ -> Thể Thao */
  .main-content {
    padding: 10px;
    gap: 14px;
    grid-template-columns: 1fr;
    grid-template-areas:
      "slider"
      "casino"
      "jackpot"
      "sports";
  }

  .slider-viewport {
    aspect-ratio: 16 / 8.5;
  }

  .slider-nav {
    width: 26px;
    height: 26px;
    font-size: 11px;
  }

  /* Live Casino trên Mobile: Trượt ngang hoặc hiện card lớn */
  .casino-grid {
    grid-template-columns: 1fr;
  }

  .casino-card:not(:first-child) {
    display: none; /* Hiện card nổi bật đầu tiên như ảnh mẫu, bấm "Xem thêm" để mở rộng */
  }

  /* Jackpot trên Mobile: Nằm ngang gọn đẹp */
  .jackpot-card {
    min-height: 105px;
    padding: 12px;
  }

  .jackpot-overlay {
    flex-direction: row-reverse;
    justify-content: space-between;
    text-align: left;
  }

  .jackpot-icon {
    font-size: 40px;
  }

  .jackpot-amount {
    font-size: 15px;
    padding: 6px 10px;
  }

  .btn-jackpot {
    font-size: 11px;
    padding: 7px 12px;
  }

  /* Thể thao trên Mobile: 1 ô đầu full ngang, 4 ô sau chia 2x2 */
  .sports-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
  }

  .sports-grid .sport-card:nth-child(1) {
    grid-column: span 2;
    height: 115px;
  }

  .sports-grid .sport-card:nth-child(n+2) {
    grid-column: span 1;
    height: 105px;
  }

  /* Giúp chữ trên 4 ô nhỏ không bị cắt mép phải */
  .sports-grid .card-img {
    object-fit: fill;
  }

  .sport-card {
    height: 100px;
    padding: 0;
  }

  .sport-logo {
    font-size: 16px;
  }

  /* Thanh điều hướng cố định phía dưới */
  .mobile-bottom-nav {
    display: flex;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 62px;
    background: var(--bg-darkest);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    z-index: 1000;
    align-items: center;
    justify-content: space-around;
  }

  .nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    font-size: 10.5px;
    color: var(--text-muted);
    flex: 1;
  }

  .nav-item i {
    font-size: 18px;
  }

  .nav-deposit {
    position: relative;
    top: -10px;
    color: var(--primary-cyan);
    font-weight: 700;
  }

  .deposit-circle {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: linear-gradient(180deg, #32d2ff 0%, #0066ff 100%);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 3px solid var(--bg-darkest);
    box-shadow: 0 0 14px rgba(0, 174, 255, 0.6);
  }
}
/* ================= MODAL ĐĂNG NHẬP / ĐĂNG KÝ ================= */
.auth-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(3, 8, 22, 0.78);
  backdrop-filter: blur(4px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 2000;
  padding: 16px;
}

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

.auth-modal-box {
  position: relative;
  width: 100%;
  max-width: 420px;
  border-radius: 14px;
  overflow: hidden;
  background: #102042;
  box-shadow: 0 18px 45px rgba(0, 0, 0, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.auth-close-btn {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 5;
  width: 32px;
  height: 32px;
  border: none;
  background: transparent;
  color: #fff;
  font-size: 24px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.auth-close-btn:hover {
  color: #32a8ff;
}

.auth-tabs {
  display: flex;
  background: #081533;
  padding-right: 48px;
}

.auth-tab {
  flex: 1;
  padding: 16px 10px;
  border: none;
  background: transparent;
  color: #b8c9e8;
  font-size: 14px;
  font-weight: 800;
  cursor: pointer;
  transition: 0.2s;
  border-radius: 12px 12px 0 0;
}

.auth-tab.active {
  background: #102042;
  color: #2196ff;
}

.auth-body {
  padding: 24px 20px 26px;
}

.auth-form {
  display: none;
  flex-direction: column;
  gap: 14px;
}

.auth-form.active {
  display: flex;
}

.input-group {
  position: relative;
  width: 100%;
}

.input-group input {
  width: 100%;
  height: 46px;
  background: #050a14;
  border: 1px solid rgba(255, 255, 255, 0.35);
  border-radius: 8px;
  padding: 0 14px;
  color: #fff;
  font-size: 14px;
  outline: none;
  transition: border-color 0.2s;
}

.input-group input:focus {
  border-color: #2196ff;
}

.input-group input::placeholder {
  color: #8a9bb8;
}

.password-group input {
  padding-right: 44px;
}

.toggle-password {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: #9eb3d6;
  font-size: 16px;
  cursor: pointer;
}

.auth-error {
  color: #ff5c77;
  font-size: 12.5px;
  font-weight: 600;
  min-height: 16px;
  display: none;
}

.auth-error.show {
  display: block;
}

.forgot-wrap {
  text-align: right;
  margin-top: -6px;
}

.forgot-link {
  color: #7ab8ff;
  font-size: 13px;
  font-weight: 600;
}

.auth-submit-btn {
  width: 100%;
  height: 46px;
  border: none;
  border-radius: 8px;
  background: linear-gradient(180deg, #1d74d8 0%, #1253a3 100%);
  color: #fff;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  margin-top: 4px;
  transition: filter 0.2s;
}

.auth-submit-btn:hover {
  filter: brightness(1.12);
}

.auth-switch {
  text-align: center;
  font-size: 13.5px;
  color: #c5d4ee;
  margin-top: 6px;
}

.auth-switch a {
  color: #1da1ff;
  font-weight: 800;
  margin-left: 4px;
}