/* Force promotion popup images to show the full uploaded 16:9 artwork on mobile. */
.promo-modal .promo-swipe-wrap {
  width: 100% !important;
  aspect-ratio: 16 / 9 !important;
  height: auto !important;
  max-height: none !important;
  overflow: hidden !important;
}

.promo-modal .promo-swipe-track,
.promo-modal .promo-swipe-slide,
.promo-modal .promo-swipe-slide picture {
  height: 100% !important;
  max-height: none !important;
  min-height: 0 !important;
}

.promo-modal .promo-swipe-track {
  display: flex !important;
  width: 100% !important;
}

.promo-modal .promo-swipe-slide {
  flex: 0 0 100% !important;
  width: 100% !important;
  min-width: 100% !important;
  max-width: 100% !important;
}

.promo-modal .promo-swipe-slide picture {
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  width: 100% !important;
}

.promo-modal .promo-swipe-slide picture img {
  display: block !important;
  width: 100% !important;
  max-width: 100% !important;
  height: 100% !important;
  max-height: none !important;
  object-fit: contain !important;
}

@media (max-width: 767px) {
  .promo-modal .promo-swipe-wrap {
    aspect-ratio: 16 / 9 !important;
  }
}

/* mobile-topbar-logo */
/* โลโก้บนแถบบน (มือถือ): แสดงข้างปุ่มแฮมเบอร์เกอร์ + ขนาดใหญ่ อ่านง่าย
   ต้องใช้ selector เจาะจง (element + 5 class) เพราะกฎเดิมใน main.css /
   casino-blue-v21.css กินความกว้างไว้ที่ ~172px และ overflow:hidden */
@media (max-width: 767px) {
  header.topbar .topbar-inner {
    grid-template-columns: 44px minmax(0, 1fr) auto !important;
    gap: 0 !important;
  }
  header.topbar .topbar-inner .logo {
    display: flex !important;
    align-items: center !important;
    justify-content: flex-start !important;
    justify-self: start !important;
    width: auto !important;
    max-width: none !important;
    min-width: 0 !important;
    margin: 0 !important;
    overflow: visible !important;
  }
  header.topbar .topbar-inner .logo > a {
    display: flex !important;
    align-items: center !important;
    max-width: none !important;
    min-width: 0 !important;
  }
  header.topbar .topbar-inner .logo a span.brand-logo.brand-logo-image {
    display: flex !important;
    align-items: center !important;
    justify-content: flex-start !important;
    height: auto !important;
    width: auto !important;
    max-width: none !important;
    min-width: 0 !important;
    padding: 0 !important;
    overflow: visible !important;
    background: none !important;
    border: 0 !important;
    box-shadow: none !important;
    clip-path: none !important;
  }
  header.topbar .topbar-inner .logo a span.brand-logo.brand-logo-image img {
    display: block !important;
    height: auto !important;
    width: auto !important;
    max-height: 46px !important;
    max-width: calc(100vw - 72px) !important;   /* กันล้นจอแคบ เช่น 320px */
    object-fit: contain !important;
  }

  /* กรณีเว็บยังไม่ได้ตั้งโลโก้เป็นรูป (แสดงเป็นข้อความ) */
  header.topbar .topbar-inner .logo a span.brand-logo:not(.brand-logo-image) {
    height: 40px !important;
    min-width: 0 !important;
    max-width: 62vw !important;
    padding: 0 12px !important;
    font-size: 18px !important;
  }
}

/* mobile-topbar-logo-t2 */
/* Template 2: template2.css ซ่อน .t2-logo ที่จอ <640px - เปิดกลับมาข้างปุ่มเมนู
   หัวเว็บ T2 บนมือถือแคบมาก (rail ซ้าย ~80px เหลือพื้นที่ ~263px)
   จึงล็อกปุ่ม login/register ไม่ให้ถูกบีบ แล้วให้โลโก้ใช้พื้นที่ที่เหลือ */
@media (max-width: 639px) {
  .t2-headbar .t2-logo {
    display: block !important;
    height: 26px !important;
    width: auto !important;
    max-width: 70px !important;
    min-width: 0 !important;
    flex: 0 1 auto !important;
    object-fit: contain !important;
    margin-right: 4px !important;
  }
  .t2-headbar .t2-head-spacer { display: none !important }
  .t2-headbar .t2-head-actions {
    flex: 0 0 auto !important;
    margin-left: auto !important;
    gap: 6px !important;
  }
  .t2-headbar .t2-head-actions .t2-btn {
    padding-left: 9px !important;
    padding-right: 9px !important;
    font-size: 11.5px !important;
    white-space: nowrap !important;
  }
}

/* hero-arrows-hidden */
/* สไลด์แบนเนอร์เลื่อนอัตโนมัติอยู่แล้ว (slider.js ตั้ง 5.5 วิ) จึงซ่อนลูกศรทุกขนาดจอ
   ทั้งมือถือและคอม ยังเหลือจุดไข่ปลาไว้กดเลือกสไลด์เองได้ */
.hero-slider .hero-arrow { display: none !important }

/* game-card-hide-provider */
/* การ์ดเกม: ซ่อนชื่อค่ายใต้ชื่อเกม (เช่น "Askmeslot") เหลือแค่ชื่อเกม
   ต้องเจาะจงกว่า game-cards-t1.css ที่ตั้ง display:block !important ไว้ */
body:not(.tpl2-active) .game-card .game-info span,
body.tpl2-active .game-card .game-info span,
.game-card .game-info span { display: none !important }

/* hero-slider-autofit */
/* เดิม casino-blue-v21.css ล็อก .hero-slider ไว้ที่ aspect-ratio 5/1 ตายตัว
   ทำให้อัปรูปสูงกว่านั้นก็ไม่ช่วย (โดนย่อลงมาให้พอดีกรอบ 5:1)
   เปลี่ยนเป็นให้กล่องสูงตามสัดส่วนรูปจริง -> อัปรูป 1600x640 สไลด์จะสูงขึ้นเท่าตัวเอง */
.hero-slider {
  aspect-ratio: auto !important;
  height: auto !important;
  min-height: 0 !important;
  max-height: none !important;
}
.hero-track { height: auto !important; align-items: stretch !important }
.hero-slide { height: auto !important }
.hero-slide picture { height: auto !important }
.hero-slide picture img,
.hero-slide > img {
  width: 100% !important;
  height: auto !important;
  max-height: 60vh !important;    /* กันรูปสัดส่วนสูงผิดปกติกินทั้งจอ */
  object-fit: contain !important;
}
/* สไลด์ fallback (ยังไม่ได้ตั้งรูป) ไม่มี img จึงต้องกันไม่ให้ยุบ */
.hero-slide .hero-fallback { min-height: 150px }

/* t2-banner-fit */
/* เดิม Template 2 ล็อกกรอบ 3:1 แล้วใช้ object-fit:fill = "ยืดรูปให้เต็มกรอบ"
   รูป 5:1 จึงถูกบีบแนวนอนราว 40%
   แก้เป็น: คงกรอบ 3:1 ไว้ (ความสูงกำลังดี ไม่เตี้ย) แต่ใช้ contain กับตัวรูป
   -> รูปไม่ถูกตัด ไม่ถูกยืด ส่วนที่เหลือเติมด้วยรูปเดิมที่เบลอ จะได้ไม่เป็นแถบดำว่าง ๆ */
.t2-banner-img-wrap{
  aspect-ratio: 3 / 1 !important;
  height: auto !important;
  position: relative !important;
  overflow: hidden !important;
  background: #0b1020 !important;
}
.t2-banner-img-wrap::before{
  content: "";
  position: absolute;
  inset: -8%;                      /* เผื่อขอบ กันรอยเบลอที่มุม */
  background-image: var(--t2-bnr);
  background-size: cover;
  background-position: center;
  filter: blur(16px) saturate(1.15) brightness(.72);
  transform: scale(1.06);
  z-index: 0;
  pointer-events: none;
}
.t2-banner-img-wrap img{
  position: relative !important;
  z-index: 1 !important;
  width: 100% !important;
  height: 100% !important;
  object-fit: contain !important;  /* ไม่ตัด ไม่ยืด */
}

/* ── แถบแบ่งหน้ารายการเกม ────────────────────────────────────────────────
   เพิ่มพร้อมกับการแบ่งหน้าใน games.js (drawGameList)
   เดิมวาดการ์ดทุกใบพร้อมกัน หมวดสล็อต 3,510 เกม มือถือค้าง
   ------------------------------------------------------------------- */
.games-pager{
  display:flex; align-items:center; gap:10px; flex-wrap:wrap;
  padding:9px 12px; margin:0 0 12px;
  background:rgba(255,255,255,.045);
  border:1px solid rgba(255,255,255,.09);
  border-radius:10px;
  font-size:12.5px; color:#9ebce5;
}
.games-pager.is-bottom{ margin:14px 0 4px; justify-content:center; }
.games-per{ display:inline-flex; align-items:center; gap:6px; white-space:nowrap; }
.games-per select{
  background:#0d1b33; color:#e2e8f0;
  border:1px solid rgba(255,255,255,.16); border-radius:7px;
  padding:4px 7px; font-size:12.5px; font-family:inherit; cursor:pointer;
}
.games-count{ white-space:nowrap; }
.games-page-nums{ display:inline-flex; align-items:center; gap:4px; margin-left:auto; flex-wrap:wrap; }
.games-pager.is-bottom .games-page-nums{ margin-left:0; }
.games-page-btn{
  min-width:30px; height:30px; padding:0 8px;
  background:rgba(255,255,255,.06); color:#cfe1ff;
  border:1px solid rgba(255,255,255,.12); border-radius:7px;
  font-size:12.5px; font-family:inherit; cursor:pointer; line-height:1;
  transition:background .15s, border-color .15s;
}
.games-page-btn:hover:not(:disabled){ background:rgba(255,255,255,.13); }
.games-page-btn.active{
  background:linear-gradient(135deg,#1e3a8a,#0e7490);
  border-color:rgba(0,231,255,.45); color:#fff; font-weight:700;
}
.games-page-btn:disabled{ opacity:.32; cursor:default; }
.games-page-dots{ color:rgba(255,255,255,.35); padding:0 2px; }

@media (max-width:640px){
  .games-pager{ gap:7px; padding:8px 9px; font-size:11.5px; }
  .games-page-nums{ margin-left:0; width:100%; justify-content:center; }
  .games-page-btn{ min-width:28px; height:28px; padding:0 6px; font-size:11.5px; }
}
