/* Desktop visual override to match reference layout */

:root {
    --bg-page: #070707;
    --bg-panel: #0f0f0f;
    --bg-card: #0b0b0b;
    --red-1: #6f0c0c;
    --red-2: #8f1010;
    --red-3: #b61a1a;
    --orange-1: #de7b14;
    --orange-2: #9f4f09;
    --text-main: #f6f6f6;
    --text-muted: #9d9d9d;
    --line-soft: #1d1d1d;
}

body.amp-dark-mode {
    background: var(--bg-page);
    color: var(--text-main);
}

/* Keep desktop width similar to screenshot proportions */
.container {
    max-width: 1020px;
    margin: 0 auto;
}

/* Avoid noisy defaults from previous refactor */
.wrapper,
#slot_leaks,
.title,
.header {
    border-radius: 0;
}

/* Header strip */
.header {
    background: #120707;
    border-bottom: 1px solid #2f0f0f;
    padding: 6px 0;
}

#header-besar .title {
    margin: 0;
    padding: 0;
    background: transparent;
}

#header-besar .title .title-text {
    font-size: 11px;
    font-weight: 600;
    color: #ffffff;
    letter-spacing: 0.2px;
    margin-top: 8px;
}

#header-besar .title .row {
    margin: 0;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: flex-end;
}

#header-besar .col-5 {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    flex: 1 1 auto;
    max-width: none;
}

#header-besar .col-5 .title {
    width: 100%;
    min-height: 50px;
    display: flex;
    align-items: center;
    justify-content: flex-end;
}

#header-besar .header-date-row {
    width: fit-content !important;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    position: static;
    margin-left: auto;
    padding: 4px 10px;
    white-space: nowrap;
}

#header-besar .header-date-icon {
    width: 16px;
    height: 16px;
    display: block;
}

#header-besar .header-date-text {
    margin: 0;
    width: auto !important;
    float: none !important;
    font-size: 14px;
    font-weight: 700;
    line-height: 1.2;
}

#header-besar .header-date-row {
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.container-tmp {
    margin-top: 8px;
}

.slideshow-images-container {
    margin: 0 0 8px 0;
    border-radius: 0;
    border: 1px solid #111;
}

#running_text_header {
    background: linear-gradient(180deg, rgba(28, 18, 18, 0.98), rgba(18, 12, 12, 0.98));
    border: 1px solid rgba(255, 255, 255, 0.08);
    margin: 0 0 8px 0;
    padding: 6px 8px;
    border-radius: 14px;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04), 0 10px 24px rgba(0, 0, 0, 0.18);
}

#running_text_header .row {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    margin: 0;
}

#running_text_header .running-announcement-col {
    flex: 1 1 auto;
    min-width: 0;
}

#running_text_header .running-actions-col {
    flex: 0 0 auto;
    margin-left: auto;
}

#running_text_header .running-announcement-pill {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.03)) !important;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 14px;
    overflow: hidden;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

#running_text_header .running-announcement-icon-cell {
    width: 34px;
    padding: 0 0 0 10px;
    vertical-align: middle;
}

#running_text_header .running-announcement-icon {
    width: 17px;
    height: 17px;
    display: block;
}

#running_text_header .running-announcement-text-cell {
    padding: 0 12px 0 8px;
    vertical-align: middle;
}

#running_text_header .running-announcement-text {
    font-size: 12px !important;
    font-weight: 700;
    color: #fff7ea !important;
    margin: 0;
    line-height: 1.2;
    letter-spacing: 0.2px;
    text-transform: uppercase;
    white-space: nowrap;
}

#running_text_header .running-actions {
    width: auto !important;
    border-collapse: separate;
    border-spacing: 8px 0;
}

#running_text_header .running-actions-cell {
    padding: 0;
    vertical-align: middle;
}

#running_text_header .top-strip-cta-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 132px;
    height: 34px;
    margin: 0;
}

#running_text_header .top-strip-cta-icon {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: contain;
}

#running_text_header h1 {
    font-size: 11px !important;
}

.slot {
    gap: 8px;
    align-items: flex-start;
}

/* Sidebar look */
.slot-sidebar {
    flex: 0 0 190px;
    display: block;
}

.slot-sidebar-nav {
    background: linear-gradient(180deg, var(--red-2), var(--red-1));
    border: 1px solid #5d0b0b;
}

.slot-sidebar-nav > div {
    padding: 4px;
    background: #111;
    border-bottom: 1px solid #2d2d2d;
}

.input-search {
    background: #0f0f0f;
    color: #ddd;
    border: 1px solid #3a3a3a;
    height: 24px;
}

.input-search::placeholder {
    color: #7f7f7f;
}

.search-button {
    background: #8f1010;
    border: 1px solid #b31b1b;
    color: #fff;
    width: 32px;
    min-width: 32px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.search-icon-modern {
    width: 14px;
    height: 14px;
    display: block;
}

.mobile-header-actions {
    display: none;
}

.slot-sidebar .input-group {
    display: flex;
    flex-wrap: nowrap;
    align-items: stretch;
    width: 100%;
}

.slot-sidebar .input-group-append {
    display: flex;
    flex: 0 0 32px;
    min-width: 32px;
}

.slot-sidebar .input-search {
    flex: 1 1 auto;
    min-width: 0;
    height: 32px;
    margin-right: 0 !important;
}

.slot-sidebar .search-button {
    width: 32px;
    min-width: 32px;
    height: 32px;
}

.slot-sidebar-nav li {
    margin: 0;
    border-bottom: 1px solid #b61a1a;
}

.slot-sidebar-nav li:last-child {
    border-bottom: 0;
}

.slot-sidebar-nav .btn-provider {
    display: flex;
    align-items: center;
    gap: 8px;
    min-height: 30px;
    padding: 6px 8px;
    background: linear-gradient(180deg, var(--red-2), var(--red-1));
    color: #fff;
    border-radius: 0;
    font-size: 11px;
    line-height: 1.1;
}

.slot-sidebar-nav .btn-provider:hover,
.slot-sidebar-nav .active .btn-provider {
    background: linear-gradient(180deg, #b31b1b, #7e0f0f);
    color: #fff;
}

.slot-sidebar-nav .pragma-logo {
    width: 13px;
    height: 13px;
    flex: 0 0 13px;
    background-size: contain;
    background-position: center;
    background-repeat: no-repeat;
}

.slot-sidebar-nav .enter {
    display: none;
}

/* Game content panel */
.content {
    flex: 1;
    min-width: 0;
}

.content .wrapper:first-child {
    padding: 0;
    margin-bottom: 8px;
    background: transparent;
}

.search-kecil {
    display: none;
}

#slot_leaks {
    background: transparent;
    border: 0;
    padding: 0 !important;
    margin: 0 !important;
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 8px;
}

#slot_leaks .card {
    background: var(--bg-card);
    border: 1px solid var(--line-soft);
    border-radius: 0;
    overflow: hidden;
}

#slot_leaks .card-content {
    padding: 0;
    background: #0a0a0a;
}

#slot_leaks .img-100.cs-height {
    width: 100%;
    height: 112px;
    object-fit: cover;
    display: block;
    border-bottom: 1px solid #1f1f1f;
    background: #0f0f0f;
}

/* Hide obvious broken placeholders */
#slot_leaks img[src="#"] {
    opacity: 0;
}

#slot_leaks .mt-1 {
    margin-top: 0 !important;
    padding: 5px 6px 6px;
}

#slot_leaks .left.text-muted,
#slot_leaks .text-muted {
    color: var(--text-muted) !important;
    font-size: 9px;
}

#slot_leaks .text-wrap.left,
#slot_leaks .text-wrap.left b {
    color: #fff;
    font-size: 12px;
    font-weight: 700;
    line-height: 1.15;
    min-height: 28px;
    display: block;
}

#slot_leaks .d-flex.justify-content-between {
    margin: 2px 0 4px !important;
}

#slot_leaks .ratings i {
    color: #f6c74c;
    font-size: 9px;
}

#slot_leaks .ml-1,
#slot_leaks .text-muted.ml-1 {
    color: #e8e8e8 !important;
    font-size: 10px;
    margin-left: 4px;
}

#slot_leaks .colors span {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #19c85f;
}

#slot_leaks .btn-pola-main-custom,
#slot_leaks .btn.btn-danger.btn-pola-main-custom {
    width: 100%;
    margin: 0;
    border: 0;
    border-radius: 0;
    padding: 5px 8px;
    font-size: 11px;
    font-weight: 700;
    color: #fff;
    background: linear-gradient(180deg, var(--orange-1), var(--orange-2));
}

#slot_leaks .btn-pola-main-custom:hover {
    filter: brightness(1.08);
}

/* Keep desktop clean like reference */
.menu-bottom,
#header-kecil,
.wabutton,
.wabutton2,
.wabutton3,
.fbbutton {
    display: none !important;
}

/* Desktop-specific tuning */
@media (max-width: 1199px) {
    .container {
        max-width: 980px;
    }

    #slot_leaks {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 1023px) {
    /* Let existing mobile style take over */
    .slot-sidebar {
        display: none;
    }

    #slot_leaks {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

/* Mobile layout refinement to match reference screenshot */
@media (max-width: 767px) {
    body.amp-dark-mode {
        background: #070707;
        padding-bottom: 76px;
    }

    .container,
    .container.container-tmp {
        width: 100%;
        max-width: 100%;
        padding-left: 0;
        padding-right: 0;
        margin: 0;
    }

    .header {
        padding: 2px 0 8px;
        background: linear-gradient(180deg, #430404, #5f0909);
        border-bottom: 1px solid #7d1515;
    }

    #header-besar {
        display: none !important;
    }

    #header-kecil {
        display: block !important;
        padding: 0 6px;
        overflow: hidden;
    }

    #header-kecil .row {
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 4px;
        flex-wrap: wrap !important;
        margin-left: 0;
        margin-right: 0;
    }

    #header-kecil .col-5 {
        flex: 0 0 100%;
        max-width: 100%;
        padding-left: 0;
        padding-right: 0;
        display: flex;
        justify-content: center;
    }

    #header-kecil .col-5 a {
        display: block;
        width: 100%;
        text-align: center;
        overflow: hidden;
    }

    #header-kecil .col-3 {
        flex: 0 0 calc(50% - 3px);
        max-width: calc(50% - 3px);
        padding-left: 0;
        padding-right: 0;
        display: flex;
        align-items: center;
    }

    #header-kecil .images-logo {
        max-width: min(144px, 62vw);
        width: min(144px, 62vw) !important;
        height: auto;
        display: block;
        margin: 0 auto;
        transform: translateX(-6px);
    }

    #header-kecil .images-logo img {
        max-width: min(144px, 62vw) !important;
        width: 100% !important;
        height: auto !important;
        display: block;
        margin: 0 auto;
    }

    #header-kecil .btn.btn-primary {
        margin: 0 !important;
        width: 100% !important;
        min-width: 0 !important;
        height: 28px;
        min-height: 28px;
        display: flex;
        align-items: center;
        justify-content: center;
        box-sizing: border-box;
        padding: 0 4px;
        font-size: 9px;
        line-height: 1;
        border-radius: 5px;
        background: #be130d;
        border: 1px solid #c8452f;
        color: #fff;
    }

    #header-kecil .col-3 {
        display: none !important;
    }

    .mobile-header-actions {
        display: block;
        padding: 4px 0 6px;
        box-sizing: border-box;
    }

    .mobile-header-actions-row {
        display: grid;
        grid-template-columns: 1fr 1fr;
        align-items: center;
        gap: 8px;
        margin: 0;
        width: 100%;
    }

    .mobile-header-action-col {
        width: 100%;
        max-width: 100%;
        padding: 0;
        display: flex;
    }

    .mobile-header-action-btn {
        width: 100% !important;
        min-width: 0 !important;
        height: 30px;
        min-height: 30px;
        margin: 0 !important;
        display: flex;
        align-items: center;
        justify-content: center;
        box-sizing: border-box;
        border-radius: 6px;
        padding: 0 6px;
        font-size: 10px;
        font-weight: 700;
        line-height: 1;
        background: #be130d;
        border: 1px solid #c8452f;
        color: #fff;
    }

    .slideshow-images-container {
        margin: 0;
        border: 0;
    }

    .slideshow-images img {
        min-height: 95px !important;
        max-height: 98px;
        object-fit: cover;
        border-radius: 0 !important;
    }

    #running_text_header {
        margin: 8px 8px 6px;
        border: 1px solid rgba(255, 255, 255, 0.08);
        background: linear-gradient(180deg, rgba(25, 18, 18, 0.98), rgba(17, 12, 12, 0.98));
        padding: 5px 6px;
        border-radius: 14px;
        box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04), 0 8px 18px rgba(0, 0, 0, 0.16);
    }

    #running_text_header .col:last-child {
        display: none;
    }

    #running_text_header .row {
        gap: 0;
    }

    #running_text_header .running-announcement-pill {
        border-radius: 12px;
        background: linear-gradient(180deg, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0.025)) !important;
    }

    #running_text_header .running-announcement-icon-cell {
        width: 30px;
        padding: 0 0 0 8px;
    }

    #running_text_header .running-announcement-text-cell {
        padding: 0 10px 0 6px;
    }

    #running_text_header .running-announcement-text {
        font-size: 10px !important;
    }

    #running_text_header .top-strip-cta-link {
        width: 116px;
        height: 30px;
    }

    #running_text_header table {
        background: transparent !important;
    }

    #running_text_header h1 {
        font-size: 11px !important;
        margin-top: 7px !important;
        white-space: nowrap;
    }

    .slot {
        display: block;
        margin: 0;
        gap: 0;
    }

    /* Hide desktop sidebar and show mobile horizontal provider bar */
    .slot > .slot-sidebar.res-bar {
        display: none !important;
    }

    .search-kecil {
        display: block;
        margin: 0 8px;
        background: #111;
    }

    .search-kecil > .row:first-of-type {
        display: none !important;
    }

    .search-kecil .col-12[style*="background"] {
        display: none;
    }

    .search-kecil .slot-sidebar.mySlides {
        display: block !important;
        margin-bottom: 4px;
        overflow-x: auto !important;
        overflow-y: hidden !important;
        -webkit-overflow-scrolling: touch;
        touch-action: pan-x;
        scrollbar-width: thin;
    }

    .search-kecil .slot-sidebar-nav.kecil-bar {
        display: flex;
        flex-wrap: nowrap;
        gap: 0;
        overflow-x: visible !important;
        width: max-content;
        min-width: 100%;
        padding: 0;
        margin: 0;
        border: 1px solid #7f1010;
        background: #3f0505;
        scroll-snap-type: x proximity;
    }

    .search-kecil .slot-sidebar-nav.kecil-bar li {
        list-style: none;
        flex: 0 0 auto;
        min-width: 64px;
        border-right: 1px solid #9d1a1a;
        margin: 0;
        scroll-snap-align: start;
    }

    .search-kecil .slot-sidebar-nav.kecil-bar li:last-child {
        border-right: 0;
    }

    .search-kecil .slot-sidebar-nav.kecil-bar .btn-provider {
        height: 58px;
        padding: 5px 3px;
        border-radius: 0;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 2px;
        font-size: 10px;
        color: #fff;
        background: linear-gradient(180deg, #990f0f, #6d0b0b);
    }

    .search-kecil .logo-filter-kecil {
        width: 16px;
        height: 16px;
        background-position: center;
        background-repeat: no-repeat;
        background-size: contain;
        display: block;
    }

    .search-mobile-row {
        display: flex !important;
        flex-direction: row !important;
        flex-wrap: nowrap !important;
        align-items: center;
        position: relative;
        left: 50%;
        transform: translateX(-50%);
        width: min(420px, calc(100vw - 24px));
        margin: 0;
        white-space: nowrap;
        box-sizing: border-box;
    }

    .search-kecil .row {
        display: block !important;
        width: 100% !important;
        margin-left: 0 !important;
        margin-right: 0 !important;
    }

    .search-kecil .row > .col-12 {
        display: block !important;
        flex: 0 0 100% !important;
        max-width: 100% !important;
        width: 100% !important;
        padding-left: 0 !important;
        padding-right: 0 !important;
    }

    .search-mobile-row .input-search {
        flex: 1 1 auto !important;
        min-width: 0 !important;
    }

    .search-mobile-row .input-group-append {
        display: block !important;
        flex: 0 0 40px !important;
        min-width: 40px !important;
    }

    .search-mobile-row .search-button {
        width: 40px !important;
        min-width: 40px !important;
        height: 34px !important;
    }

    .search-kecil .input-group {
        display: grid;
        grid-template-columns: minmax(0, 1fr) 40px;
        align-items: center;
        background: #202020;
        border: 1px solid #2f2f2f;
        border-radius: 0;
        overflow: hidden;
        gap: 0;
    }

    .search-kecil .input-group-append {
        display: block;
    }

    .search-kecil .col-12 > div {
        padding: 7px 8px !important;
    }

    .search-kecil .search-button {
        border: 0;
        width: 40px;
        min-width: 40px;
        height: 34px;
        display: flex;
        justify-content: center;
        align-items: center;
        background: linear-gradient(180deg, #a67a00, #8a6400);
        color: #fff;
    }

    .search-kecil .input-search {
        border: 0;
        width: 100%;
        min-width: 0;
        height: 34px;
        margin-right: 0 !important;
        padding: 0 10px;
        background: #2a2a2a;
        color: #d9d9d9;
        font-size: 12px !important;
    }

    .search-kecil .input-search::placeholder {
        color: #8f8f8f;
    }

    .search-kecil .search-icon-modern {
        width: 15px;
        height: 15px;
        display: block;
    }

    #slot_leaks {
        display: grid;
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 8px;
        padding: 0 8px !important;
        margin-top: 8px !important;
    }

    #slot_leaks .card {
        border: 1px solid #1f1f1f;
        border-radius: 0;
    }

    #slot_leaks .img-100.cs-height {
        height: 80px;
        min-height: 80px;
        max-height: 80px;
        border-bottom: 1px solid #252525;
    }

    #slot_leaks .mt-1 {
        padding: 4px 4px 0;
    }

    #slot_leaks .left.text-muted,
    #slot_leaks .text-muted {
        font-size: 10px;
        line-height: 1.15;
    }

    #slot_leaks .text-wrap.left,
    #slot_leaks .text-wrap.left b {
        font-size: 13px;
        min-height: 31px;
    }

    #slot_leaks .ml-1,
    #slot_leaks .text-muted.ml-1 {
        font-size: 10px;
    }

    #slot_leaks .btn-pola-main-custom,
    #slot_leaks .btn.btn-danger.btn-pola-main-custom {
        margin-top: 2px;
        padding: 6px 4px;
        font-size: 12px;
    }

    .menu-bottom {
        display: flex !important;
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        z-index: 150;
        background: linear-gradient(180deg, #6f0a0a, #4a0505);
        border-top: 1px solid #9f2828;
        padding: 6px 0 8px;
    }

    .menu-bottom .sub-menu-bottom {
        color: #fff;
        font-size: 10px;
        padding: 0;
    }

    .menu-bottom .icon-menu {
        width: 18px;
        height: 18px;
        margin-bottom: 2px;
    }

    .menu-bottom .text-menu,
    .menu-bottom h4 {
        margin: 0;
        font-size: 11px;
        font-weight: 600;
    }
}

@media (max-width: 420px) {
    #slot_leaks {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}
