/* ==========================================================
   Responsive overrides – dimuat paling akhir setelah CSS tema.
   Desktop (>= 992px) tidak diubah.
   ========================================================== */

img,
picture img {
    max-width: 100%;
}

/* ---------- Tablet & mobile (<= 991px) ---------- */
@media (max-width: 991px) {
    html,
    body {
        overflow-x: hidden;
    }

    /* Topbar */
    .topbar-left-container,
    .topbar-right-container {
        width: auto;
        flex: 1 1 auto;
    }

    /* Header & menu: menu bisa di-scroll horizontal */
    .site-header .row {
        display: flex;
        flex-wrap: wrap;
        align-items: center;
    }

    .site-header .row > .col-sm-3 {
        width: 100%;
    }

    .site-header .row > .col-sm-9 {
        width: 100%;
    }

    .site-header .logo {
        max-width: 240px;
        margin: 0 auto;
    }

    .menu-slide > i.glyphicon {
        display: none;
    }

    .top-menu {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
    }

    .top-menu::-webkit-scrollbar {
        display: none;
    }

    .top-menu > li {
        flex: 0 0 80px;
        width: 80px;
    }

    .top-menu > li > a {
        padding: 10px 0;
        font-size: 11px;
    }

    /* Dropdown game menu (hover) tidak cocok untuk layar sentuh */
    .top-menu .game-list {
        display: none !important;
    }

    /* Pengumuman */
    .announcement-container {
        flex-wrap: wrap;
        gap: 8px;
        padding: 10px;
    }

    .announcement-container > [data-section="announcements"] {
        order: 3;
        width: 100%;
    }

    /* Jackpot & togel */
    .home-inner-container {
        flex-direction: column;
        align-items: stretch;
        margin-bottom: 25px;
    }

    .home-inner-container > [data-section] {
        width: 100%;
    }

    .home-progressive-jackpot .border-container {
        gap: 20px;
    }

    /* Game populer */
    .popular-game-title-container .container-content .game-list .games-group {
        width: calc((100% - 6px * 4) / 4.5);
    }

    /* Video slots populer & provider */
    .popular-games {
        flex-direction: column;
    }

    .popular-games [data-section="left"] {
        margin-right: 0;
    }

    .popular-games [data-section="right"] {
        width: 100%;
    }

    .popular-games .tab-content picture,
    .popular-games .tab-content img {
        display: block;
        max-width: 100%;
        height: auto;
    }

    /* Download APK */
    .download-apk {
        flex-direction: column;
        text-align: center;
        padding: 20px 0;
    }

    .download-apk > div {
        flex-basis: auto;
        width: 100%;
    }

    .download-apk picture img {
        max-width: 60%;
        height: auto;
    }

    .download-apk-info {
        justify-content: center;
    }

    .download-apk-info .download-apk-section {
        flex-basis: 100%;
        max-width: 360px;
    }

    /* Footer */
    .site-footer .footer-links {
        display: flex;
        flex-wrap: wrap;
        justify-content: center;
        padding-left: 0;
    }

    .site-footer .copyright {
        text-align: center;
    }

    .site-footer img {
        height: auto;
    }

    /* Modal */
    .modal-dialog {
        width: auto;
        max-width: 95%;
        margin: 15px auto;
    }
}

/* ---------- Mobile (<= 767px) ---------- */
@media (max-width: 767px) {
    /* Topbar */
    .topbar-left-section .topbar-item + .topbar-item {
        margin-left: 3px;
        padding-left: 3px;
    }

    .login-panel-item a {
        padding-left: 12px;
        padding-right: 12px;
    }

    .site-header .logo {
        max-width: 220px;
    }

    /* Pengumuman */
    .announcement-container {
        font-size: 12px;
    }

    .announcement-container > [data-section="date"] {
        font-size: 11px;
    }

    /* Jackpot */
    .home-progressive-jackpot {
        padding: 6px;
        border-radius: 20px;
    }

    .home-progressive-jackpot .outer-container,
    .home-progressive-jackpot .inner-container,
    .home-progressive-jackpot .border-container {
        padding: 5px;
    }

    .home-progressive-jackpot .border-container {
        gap: 8px;
    }

    .home-progressive-jackpot .jackpot-play-section {
        margin-left: 8px;
    }

    .home-progressive-jackpot .jackpot-play-section img {
        width: 50px;
    }

    .home-progressive-jackpot .jackpot-play-section .jackpot-play-text {
        font-size: 16px;
    }

    .home-progressive-jackpot .jackpot-container {
        font-size: 20px;
        letter-spacing: 2px;
        padding: 5px;
        min-width: 0;
    }

    .home-progressive-jackpot .jackpot-inner-container {
        padding: 5px;
        min-width: 0;
    }

    .home-progressive-jackpot .jackpot-border-container {
        line-height: 28px;
        padding-bottom: 4px;
        min-width: 0;
        overflow: hidden;
    }

    /* Togel */
    .lottery-result-container .lottery-result {
        flex-wrap: wrap;
        gap: 6px;
    }

    .lottery-result-container .lottery-numbers {
        margin-left: 0;
        flex-wrap: wrap;
        justify-content: center;
        max-width: 100%;
    }

    /* Game populer */
    .popular-game-title-container .container-title span {
        padding: 5px 30px;
    }

    .popular-game-title-container .container-content {
        padding: 6px;
    }

    .popular-game-title-container .container-content .game-list .games-group {
        width: calc((100% - 6px * 3) / 3.3);
    }

    /* Video slots populer */
    .popular-games [data-section="left"] .section-title {
        font-size: 16px;
        height: 45px;
    }

    .popular-games .nav-tabs {
        display: flex;
        flex-wrap: wrap;
        justify-content: center;
    }

    .popular-games .nav-tabs > li {
        float: none;
        width: calc(100% / 3);
    }

    .popular-games .nav-tabs > li > a {
        display: block;
        text-align: center;
    }

    .popular-games .nav-tabs > li img {
        max-width: 100%;
        height: auto;
    }

    /* Download APK */
    .download-apk .h2 {
        font-size: 22px;
    }

    .download-apk .h3,
    .download-apk h3 {
        font-size: 16px;
    }

    .download-apk-section {
        font-size: 13px;
    }

    /* Footer */
    .site-footer .footer-links li {
        margin-bottom: 5px;
    }

    .site-footer .row > [class*="col-"] {
        text-align: center;
    }

    .provider-section ul,
    .provider-section .row {
        display: flex;
        flex-wrap: wrap;
        justify-content: center;
    }

    /* Ikon melayang kiri bawah lebih kecil */
    body > div[style*="position:fixed"] {
        width: 45px !important;
        bottom: 15px !important;
        left: 5px !important;
    }

    body > div[style*="position:fixed"] a {
        width: 45px !important;
        height: auto !important;
    }

    body > div[style*="position:fixed"] img {
        width: 45px;
        height: auto;
    }
}
