/*!
 * 5Play Child (APKFlash) — perbaikan CSS frontend.
 *
 * Dimuat SETELAH style.min.css tema induk, sehingga override bekerja
 * lewat urutan cascade normal tanpa !important berlebihan.
 */

/* =========================================================================
   1. RICH BACKGROUND (panel Single -> Rich-Style Background)
   -------------------------------------------------------------------------
   Bug tema induk: .appview-bg .cover berukuran 1200x1200 tapi TIDAK ADA
   aturan untuk <img> di dalamnya. <i class="cover"> juga masih inline.
   Akibatnya gambar 300x300 nyangkut di pojok kiri-atas dan tertutup
   radial-gradient opaque -> terlihat seperti background kosong.
   ========================================================================= */
.appview-bg .cover {
    display: block;
}

.appview-bg .cover img {
    display: block;
    width: 100%;
    height: 100%;
    max-width: none;
    object-fit: cover;
    object-position: center center;
    border-radius: 50%;
}

/* Turunkan sedikit opasitas gradient tengah supaya warna ikon benar-benar
   terlihat, tanpa mengganggu keterbacaan teks di atasnya. */
.appview-bg .cover::after {
    background-image: radial-gradient(closest-side,
            hsla(var(--c-body-tone), .35) 30%,
            hsla(var(--c-body-tone), 1) 100%);
}

/* =========================================================================
   2. SCREENSHOTS
   -------------------------------------------------------------------------
   Class .portrait sekarang benar-benar ditambahkan oleh template override
   (lihat components/single/single-screenshots.php). Aturan 9/16 milik tema
   induk akhirnya terpakai. Di sini hanya penyempurnaan kecil.
   ========================================================================= */

/* Latar placeholder sebelum gambar termuat -> mengurangi flash putih. */
.screenshots .glist a {
    background-color: hsla(var(--c-text), .08);
}

/* object-position top lebih aman untuk screenshot game landscape:
   bagian atas (HUD/judul) lebih informatif daripada bagian bawah. */
.screenshots:not(.portrait) .glist a img {
    object-position: center top;
}

/* Kursor zoom supaya jelas gambar bisa diklik. */
.screenshots .glist a {
    cursor: zoom-in;
}

/* =========================================================================
   3. LIGHTBOX (pengganti Fancybox, ±4 KB)
   ========================================================================= */
html.apkf-lb-open {
    overflow: hidden;
    /* Cegah layout shift karena scrollbar hilang di desktop. */
    scrollbar-gutter: stable;
}

.apkf-lb {
    position: fixed;
    inset: 0;
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    /* dvh: aman terhadap address bar browser mobile. */
    height: 100dvh;
    padding: env(safe-area-inset-top, 0px) 0 env(safe-area-inset-bottom, 0px);
}

.apkf-lb[hidden] {
    display: none;
}

.apkf-lb__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(8, 10, 14, .94);
    -webkit-backdrop-filter: blur(2px);
    backdrop-filter: blur(2px);
}

.apkf-lb__stage {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    margin: 0;
    /* Padding dikecilkan supaya gambar benar-benar memenuhi layar. */
    padding: 8px;
    overflow: auto;
    -webkit-overflow-scrolling: touch;
}

.apkf-lb__img {
    display: block;
    /* Batas atas diperketat lagi oleh JS ke naturalWidth/naturalHeight,
       sehingga gambar TIDAK PERNAH di-upscale -> tidak pecah. */
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
    border-radius: 6px;
    cursor: zoom-in;
    opacity: 1;
    transition: opacity .15s linear;
}

.apkf-lb.is-loading .apkf-lb__img {
    opacity: 0;
}

/* Mode zoom 1:1 (klik gambar) — untuk membaca teks kecil di screenshot. */
.apkf-lb.is-zoomed .apkf-lb__stage {
    align-items: flex-start;
    justify-content: flex-start;
}

.apkf-lb.is-zoomed .apkf-lb__img {
    max-width: none;
    max-height: none;
    cursor: zoom-out;
}

.apkf-lb__btn {
    position: absolute;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, .12);
    color: #fff;
    font-size: 26px;
    line-height: 1;
    cursor: pointer;
    transition: background .15s linear;
}

.apkf-lb__btn:hover,
.apkf-lb__btn:focus-visible {
    background: rgba(255, 255, 255, .26);
    outline: 2px solid rgba(255, 255, 255, .5);
    outline-offset: 2px;
}

.apkf-lb__close {
    top: calc(12px + env(safe-area-inset-top, 0px));
    right: 12px;
    font-size: 30px;
}

.apkf-lb__prev {
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
}

.apkf-lb__next {
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
}

.apkf-lb.is-single .apkf-lb__prev,
.apkf-lb.is-single .apkf-lb__next,
.apkf-lb.is-single .apkf-lb__counter {
    display: none;
}

.apkf-lb__counter {
    position: absolute;
    z-index: 2;
    bottom: calc(14px + env(safe-area-inset-bottom, 0px));
    left: 50%;
    transform: translateX(-50%);
    padding: 5px 12px;
    border-radius: 999px;
    background: rgba(255, 255, 255, .12);
    color: #fff;
    font-size: 13px;
    font-variant-numeric: tabular-nums;
}

/* Layar sempit: tombol navigasi turun ke bawah agar tidak menutupi gambar. */
@media (max-width: 575px) {

    .apkf-lb__prev,
    .apkf-lb__next {
        top: auto;
        bottom: calc(10px + env(safe-area-inset-bottom, 0px));
        transform: none;
    }

    .apkf-lb__counter {
        bottom: calc(22px + env(safe-area-inset-bottom, 0px));
    }
}

@media (prefers-reduced-motion: reduce) {
    .apkf-lb__img {
        transition: none;
    }
}

/* =========================================================================
   4. HALAMAN DOWNLOAD — label penyedia file
   ========================================================================= */
.cdn-meta-item.apkf-provider {
    font-weight: 600;
}

.apkf-modinfo {
    margin-top: 14px;
    font-size: .9em;
    opacity: .8;
}

/* Gambar sumber beresolusi rendah: haluskan sedikit saat diperbesar. */
.apkf-lb.is-lowres .apkf-lb__img {
    image-rendering: auto;
}
