/* =========================================================
   LEXITOTO UI POLISH & MOBILE RESPONSIVE PATCH
   Aman ditambahkan di akhir <head>. Tidak mengubah logic PHP.
========================================================= */
:root{
    --lex-polish-red:var(--b4d-setting-color,#ff3939);
    --lex-polish-red-2:var(--b4d-setting-color-2,#b80000);
    --b4d-polish-bg:var(--b4d-setting-bg,#120202);
    --b4d-polish-line:rgba(255,57,57,.16);
    --b4d-polish-text:#ffeaea;
    --b4d-polish-muted:#d8b8b8;
}

html{
    -webkit-text-size-adjust:100%;
    text-size-adjust:100%;
}

body{
    overflow-x:hidden;
}

img, iframe, video, canvas, svg{
    max-width:100%;
}

button, a, input, select, textarea{
    -webkit-tap-highlight-color:transparent;
}

input, select, textarea, button{
    font:inherit;
}

input, select, textarea{
    color-scheme:dark;
}

.table-container,
.table-box,
.table-scroll,
.schema-table-wrap,
.all-table-wrap{
    -webkit-overflow-scrolling:touch;
}

.table-container::-webkit-scrollbar,
.table-box::-webkit-scrollbar,
.table-scroll::-webkit-scrollbar,
.schema-table-wrap::-webkit-scrollbar,
.all-table-wrap::-webkit-scrollbar{
    height:8px;
}

.table-container::-webkit-scrollbar-thumb,
.table-box::-webkit-scrollbar-thumb,
.table-scroll::-webkit-scrollbar-thumb,
.schema-table-wrap::-webkit-scrollbar-thumb,
.all-table-wrap::-webkit-scrollbar-thumb{
    background:rgba(255,57,57,.35);
    border-radius:999px;
}

.b4d-mobile-safe-card{
    overflow:hidden;
}

@media(max-width:768px){
    body{
        min-width:0 !important;
    }

    .container,
    .content,
    .pay-wrap,
    .schema-page,
    .b4d-artikel-box,
    .detail-page,
    .result-page,
    .jadwal-page,
    .leaderboard-page{
        width:100% !important;
        max-width:100% !important;
        padding-left:12px !important;
        padding-right:12px !important;
    }

    .grid,
    .stats-box,
    .summary-grid,
    .quick-grid,
    .b4d-card-grid,
    .pasaran-grid{
        grid-template-columns:1fr !important;
    }

    .filter,
    .filter-box form,
    .filter-bar,
    form .filter-row,
    .setting-grid,
    .form-grid{
        grid-template-columns:1fr !important;
        width:100% !important;
    }

    .filter input,
    .filter select,
    .filter button,
    .filter a,
    .filter-box input,
    .filter-box select,
    .filter-box button,
    .filter-box a,
    .btn,
    .nav-btn,
    .action-btn,
    .submit-btn,
    .join-btn,
    .close-btn{
        min-height:46px;
    }

    .row{
        gap:12px !important;
    }

    .card,
    .market-block,
    .section-card,
    .summary-card,
    .stat-card,
    .page-head,
    .filter-box,
    .table-box,
    .popup-box{
        border-radius:18px !important;
    }

    .bottom,
    .action-buttons,
    .mobile-actions,
    .schema-actions,
    .b4d-footer-links{
        display:grid !important;
        grid-template-columns:1fr !important;
        gap:10px !important;
    }

    .bottom .btn,
    .action-buttons .btn,
    .mobile-actions .btn,
    .schema-actions a,
    .b4d-footer-links a{
        width:100% !important;
        justify-content:center !important;
        text-align:center !important;
    }

    .popup{
        padding:12px !important;
    }

    .popup-box{
        width:min(100%,440px) !important;
        max-height:calc(100vh - 28px) !important;
        overflow:auto !important;
        padding:18px !important;
    }

    .angka-box{
        gap:10px !important;
        flex-wrap:wrap !important;
    }

    .angka-box span{
        width:clamp(62px,26vw,82px) !important;
        height:clamp(62px,26vw,82px) !important;
        font-size:clamp(23px,8vw,32px) !important;
    }

    table{
        white-space:nowrap;
    }

    th,td{
        padding:11px 10px !important;
        font-size:13px !important;
    }
}

@media(max-width:520px){
    .title h1,
    .dashboard-title h2,
    .page-head h2,
    .schema-hero h1,
    .b4d-artikel h2{
        font-size:24px !important;
        line-height:1.2 !important;
    }

    .title p,
    .section-head p,
    .page-head p,
    .popup-info{
        font-size:14px !important;
        line-height:1.55 !important;
    }

    .date,
    .hadiah,
    .result,
    .value,
    .active{
        word-break:break-word;
    }

    .row{
        flex-direction:column !important;
        align-items:stretch !important;
    }

    .row > div,
    .row > div[style*="text-align:right"]{
        text-align:left !important;
    }
}

/* Small brand text helper used by synced headers */
.b4d-logo-text{
    display:inline-flex;
    flex-direction:column;
    line-height:1.05;
    min-width:0;
}
.b4d-logo-text strong{
    font-size:1em;
    font-weight:950;
    white-space:nowrap;
    overflow:hidden;
    text-overflow:ellipsis;
}
.b4d-logo-text small{
    margin-top:3px;
    font-size:.68em;
    font-weight:800;
    opacity:.82;
    letter-spacing:.4px;
    white-space:nowrap;
    overflow:hidden;
    text-overflow:ellipsis;
}

@media(max-width:480px){
    .b4d-logo-text strong{font-size:.95em;}
    .b4d-logo-text small{font-size:.62em;}
}


/* =========================================================
   LEXITOTO LEADERBOARD / MARKET HEADING POLISH
========================================================= */
.market-heading{
    align-items:center !important;
}
.market-title,
.market-name-with-logo{
    display:flex;
    align-items:center;
    gap:12px;
    min-width:0;
}
.market-logo,
.market-title img,
.market-name-with-logo img{
    width:42px;
    height:42px;
    min-width:42px;
    border-radius:14px;
    object-fit:cover;
    background:#090101;
    border:1px solid rgba(255,57,57,.28);
    box-shadow:0 0 0 3px rgba(255,57,57,.10),0 0 18px rgba(255,57,57,.16);
}
.market-title h3,
.market-name-with-logo h3{
    margin:0 !important;
    line-height:1.15;
    white-space:normal;
}
.b4d-line-label,
.lex-line-label{
    display:inline-flex;
    align-items:center;
    justify-content:center;
    gap:6px;
    padding:6px 10px;
    border-radius:999px;
    font-size:12px;
    font-weight:950;
    color:#ffdede;
    background:rgba(255,57,57,.10);
    border:1px solid rgba(255,57,57,.22);
}

@media(max-width:768px){
    .topbar .logo,
    .brand,
    .brand-box,
    .logo{
        min-width:0;
    }
    .market-heading{
        justify-content:flex-start !important;
        gap:10px !important;
    }
    .market-heading > span,
    .market-heading .total-pill{
        width:100%;
    }
    .market-logo,
    .market-title img,
    .market-name-with-logo img{
        width:38px;
        height:38px;
        min-width:38px;
        border-radius:13px;
    }
}

@media(max-width:420px){
    .container,
    .content{
        padding-left:10px !important;
        padding-right:10px !important;
    }
    .filter input,
    .filter select,
    .filter button,
    .filter a{
        min-width:0 !important;
    }
}
