/* =========================================================
   custom.css  - perbaikan menu + responsive (dimuat setelah css5)
   ========================================================= */

/* ---------- MENU UTAMA ---------- */
.top-menu > li { position: static; }
.top-menu > li > a {
  display: flex; align-items: center; justify-content: center; gap: 6px;
}
.top-menu > li > a > img {
  width: 30px; height: 30px; flex: 0 0 30px; object-fit: contain;
}
/* ikon berganti ke versi "active" saat hover (URL ada di --image-src) */
.top-menu > li:hover > a > img { content: var(--image-src); }

/* dropdown daftar game: tersembunyi, tampil saat hover.
   position:fixed supaya tidak terpotong overflow:hidden pada .top-menu / .menu-slide */
.top-menu > li > ul.game-list {
  display: none;
  position: fixed; left: 0; right: 0; top: 143px; z-index: 1000;
  margin: 0; border: 0; border-radius: 0;
  border-bottom: 10px solid var(--top-menu-game-list-cntr-border);
  background: var(--top-menu-game-list-cntr-bg);
  padding: 16px max(15px, calc((100vw - 940px) / 2));
  max-height: calc(100vh - 160px); overflow-y: auto;
}
.top-menu > li:hover > ul.game-list {
  display: grid; gap: 14px;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
}
.top-menu > li > ul.game-list > li { margin: 0; padding: 0; list-style: none; }
.top-menu > li > ul.game-list > li > a {
  display: block; position: relative; width: 100%; aspect-ratio: 130 / 50;
  border-radius: 12px; overflow: hidden;
}
.top-menu > li > ul.game-list > li > a > .background,
.top-menu > li > ul.game-list > li > a > .foreground {
  position: absolute; inset: 0; border-radius: inherit;
}
.top-menu > li > ul.game-list > li > a > .background {
  background: var(--top-menu-games-cntr-li-bg);
}
.top-menu > li > ul.game-list > li > a > .foreground {
  background-repeat: no-repeat; background-position: center; background-size: cover;
  transition: transform .2s;
}
.top-menu > li > ul.game-list > li > a:hover > .foreground { transform: scale(1.06); }
/* teks pemeliharaan (jika ada) */
.top-menu > li > ul.game-list > li > a[data-maintenance-status="true"] > .foreground { filter: grayscale(1) brightness(.5); }
.top-menu > li > ul.game-list > li > a[data-maintenance-status="true"]::after {
  content: var(--maintenance-text, ''); position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
  font-size: 12px; color: #fff; background: #808080; border-radius: 5px; padding: 2px 8px; white-space: nowrap;
}

/* ---------- ANIMASI MASUK (JS pemicu tidak ada) ---------- */
.download-apk > div { opacity: 1 !important; transform: none !important; }

/* =========================================================
   RESPONSIVE (mobile & tablet kecil)
   ========================================================= */
img, video, canvas, svg { max-width: 100%; }
img { height: auto; }
table { max-width: 100%; }

@media (max-width: 991px) {
  html, body { max-width: 100%; overflow-x: hidden; }
  .container { width: 100% !important; max-width: 100%; padding-left: 15px; padding-right: 15px; }
}

@media (max-width: 767px) {
  /* header: sticky agar tinggi bebas menyesuaikan, tanpa padding-top tetap */
  body { padding-top: 0 !important; }
  .navbar-fixed-top, .navbar.navbar-fixed-top { position: sticky !important; top: 0; left: 0; right: 0; width: 100% !important; z-index: 1030; }

  /* bar atas */
  .topbar-container { height: auto !important; padding: 6px 0; }
  .topbar-container .container,
  .topbar-inner-container { width: 100% !important; }
  .topbar-inner-container { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px; }
  .topbar-left-section { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; }
  .topbar-left-section .topbar-item { margin: 0 !important; padding: 0 4px !important; }
  .login-panel { width: auto !important; margin-left: auto; display: flex; gap: 6px; }
  .login-panel .btn, .login-panel a, .login-panel button { padding: 5px 14px !important; font-size: 12px !important; }

  /* header utama */
  .site-header { height: auto !important; }
  .site-header-inner-container { width: 100% !important; display: flex; align-items: center; gap: 8px; padding: 6px 0; }
  .site-header-inner-container .logo { flex: 0 0 auto; }
  .site-header-inner-container .logo img { height: 34px !important; width: auto !important; }
  .menu-slide { flex: 1 1 auto; min-width: 0; width: auto !important; }
  .top-menu { overflow-x: auto !important; -webkit-overflow-scrolling: touch; scrollbar-width: none; }
  .top-menu::-webkit-scrollbar { display: none; }
  .top-menu > li { flex: 0 0 auto !important; flex-basis: auto !important; width: auto !important; }
  .top-menu > li > a { padding: 0 6px; font-size: 11px; }
  .top-menu > li > a > img { width: 22px; height: 22px; flex-basis: 22px; }
  /* dropdown hover tidak dipakai di layar sentuh */
  .top-menu > li > ul.game-list, .top-menu > li:hover > ul.game-list { display: none !important; }

  /* banner */
  .banner, .banner-carousel, .banner .slick-list, .banner .slick-slide { width: 100% !important; max-width: 100%; }
  .banner, .banner .slick-slide img, .banner-carousel>div:first-child img { aspect-ratio: auto !important; }
  .banner { overflow: visible; margin: 0; padding: 0; }
  .banner img { display: block; width: 100% !important; max-width: 100% !important; height: auto !important; object-fit: contain; }
  .banner .slick-track { width: 100% !important; transform: none !important; }

  /* kotak jackpot */
  .home-progressive-jackpot .outer-container,
  .home-progressive-jackpot .inner-container,
  .home-progressive-jackpot .border-container { width: 100% !important; max-width: 100%; min-width: 0; box-sizing: border-box; }
  .home-progressive-jackpot .border-container { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 10px !important; }
  .home-progressive-jackpot .jackpot-play-section img { max-width: 160px; height: auto; }
  .home-progressive-jackpot .jackpot-play-text { font-size: 22px !important; }
  .home-progressive-jackpot .jackpot-container { width: 100% !important; font-size: clamp(18px, 6vw, 26px) !important; }
  .home-progressive-jackpot .jackpot-container, .home-progressive-jackpot .jackpot-inner-container, .home-progressive-jackpot .jackpot-border-container { white-space: nowrap; max-width: 100%; box-sizing: border-box; }
  .home-progressive-jackpot .jackpot-border-container { display: flex; align-items: center; justify-content: center; gap: 6px; padding: 8px 10px !important; }
  .home-progressive-jackpot #progressive_jackpot { letter-spacing: 0 !important; }
  .home-progressive-jackpot .jackpot-currency { font-size: 16px !important; }

  /* judul + daftar game */
  .popular-game-title-container { flex-wrap: wrap; gap: 6px; }
  .game-list-container .game-list,
  .home-outer-container .game-list { display: grid !important; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; padding: 8px; }
  .game-list .games-group { display: contents !important; }
  .game-list .game-item { width: auto !important; max-width: 100%; margin: 0 !important; min-width: 0; flex: none !important; }
  .game-list .game-item .wrapper-container { width: 100%; aspect-ratio: 1 / 1; height: auto; overflow: hidden; border-radius: 18px; }
  .game-list .game-item .wrapper-container img { position: absolute; inset: 0; width: 100% !important; height: 100% !important; object-fit: cover; }
  /* tombol MAIN selalu tampil (tidak ada hover di layar sentuh) */
  .game-list .game-item .link-container { display: flex !important; position: absolute; top: auto !important; left: 0; right: 0; bottom: 0; height: auto !important; align-items: flex-end; justify-content: center; padding: 6px; background: linear-gradient(180deg, rgba(0,0,0,0), rgba(0,0,0,.65)); }
  .game-list .game-item .link-container a.play-now { width: auto !important; height: auto !important; padding: 3px 14px; font-size: 11px; }
  .game-list .game-item .game-name { width: 100% !important; height: auto !important; font-size: 12px; text-align: center; white-space: normal; padding: 4px 2px 2px; overflow: hidden; }
  .game-list .game-item .provider-name { text-align: center; font-size: 10px; }

  /* unduh APK */
  .download-apk { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 10px; }
  .download-apk > div { flex-basis: 100%; width: 100%; }
  .download-apk img.img-responsive { max-width: 70%; height: auto; }
  .download-apk .h2 { font-size: 26px; line-height: 1.2; margin-bottom: 8px; }
  .download-apk .h3 { font-size: 16px; line-height: 1.3; }
  .download-apk-info, .download-apk-section { flex-wrap: wrap; justify-content: center; }

  /* footer: kolom bootstrap ditumpuk */
  .site-footer [class*="col-"], .site-contacts [class*="col-"], .home-outer-container [class*="col-"] { width: 100% !important; float: none !important; }
  .site-footer .row { margin-left: 0; margin-right: 0; }
  .site-footer table { display: block; overflow-x: auto; }
  .site-footer img { max-width: 100%; }

  /* modal */
  .modal-dialog { width: auto !important; margin: 10px !important; max-width: calc(100vw - 20px); }
}
