/* --- VARIABLES & THEME CONFIGURATION --- */
:root {
    --primary-black: #1a1a1a;
    --soft-gray: #f5f7f9;
    --green: #00c853;
    --yellow: #ffab00;
    --red: #d50000;
    
    /* Indicator Background Colors */
    --bg-green: #e8f5e9;
    --border-green: #c8e6c9;
    --bg-yellow: #fff8e1;
    --border-yellow: #ffe082;
    --bg-red: #ffebee;
    --border-red: #ffcdd2;
}

/* --- GLOBAL SETTINGS --- */
body {
    margin: 0;
    background-color: #f0f2f5;
    font-family: 'Saira', sans-serif; 
    color: #333;
    line-height: 1.4;
    -webkit-tap-highlight-color: transparent;
}

/* --- MAIN WRAPPER --- */
.rtp-wrapper {
    width: 100%;
    max-width: 480px;
    margin: 0 auto;
    background-color: #ffffff;
    min-height: 100vh;
    position: relative;
    box-shadow: 0 0 20px rgba(0,0,0,0.05);
    /* Padding bawah untuk marquee */
    padding-bottom: 60px; 
}

/* --- HEADER AREA --- */
.content-area {
    padding: 20px 0 10px 0;
    text-align: center;
    background: #fff;
    position: sticky;
    top: 0;
    z-index: 50; 
    border-bottom: 1px solid var(--soft-gray);
}

.header-top {
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    margin-bottom: 10px;
}

.header-controls {
    position: absolute;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
}

.icon-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    
    /* Style Light Mode (Tombol Putih, Icon Gelap) */
    background: #ffffff;
    color: #4a4a4a;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.icon-btn:hover {
    transform: scale(1.1) rotate(15deg);
    box-shadow: 0 6px 16px rgba(0,0,0,0.15);
}

.icon-btn svg {
    width: 20px;
    height: 20px;
    stroke-width: 2;
    stroke: currentColor;
    fill: none;
    stroke-linecap: round;
    stroke-linejoin: round;
}

/* Style saat Dark Mode Aktif (Tombol Gelap, Icon Kuning) */
body.dark-mode .icon-btn {
    background: #333333;
    color: #ffab00; /* Warna Matahari */
    box-shadow: 0 4px 12px rgba(0,0,0,0.4);
}

.seo-title {
    font-size: 1.6rem;
    font-weight: 800;
    color: var(--primary-black);
    margin: 0 0 10px 0;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.timer-badge {
    background: #e3f2fd;
    color: #1565c0;
    padding: 5px 12px;
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: 700;
    display: inline-block;
    margin-bottom: 15px;
    border: 1px solid #bbdefb;
    font-family: monospace;
}

/* --- FILTER CONTROLS (MINIMALIST) --- */
.filter-controls {
    display: flex;
    justify-content: center;
    gap: 25px; 
    margin-bottom: 15px;
    margin-top: 10px; 
}

.filter-btn {
    background: none; 
    border: none;     
    padding: 5px 0;   
    box-shadow: none; 
    font-family: 'Saira', sans-serif;
    font-size: 0.8rem;
    font-weight: 600;
    color: #999;      
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: all 0.3s ease;
    border-bottom: 2px solid transparent; 
}

.filter-btn:hover { color: var(--primary-black); }

.filter-btn.active {
    background: none;
    color: var(--primary-black);
    font-weight: 800;
    border-bottom: 2px solid var(--primary-black); 
    border-radius: 0;
}

/* --- NAVIGATION TABS --- */
.tabs-wrapper {
    position: relative;
    width: 100%;
    height: 50px;
    margin-bottom: 5px;
}

.tabs-wrapper::before {
    content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 40px;
    background: linear-gradient(to right, #ffffff 20%, transparent); z-index: 5; pointer-events: none;
}

.tabs-wrapper::after {
    content: ""; position: absolute; right: 0; top: 0; bottom: 0; width: 40px;
    background: linear-gradient(to left, #ffffff 20%, transparent); z-index: 5; pointer-events: none;
}

.provider-tabs-container {
    width: 100%; overflow-x: auto; white-space: nowrap; padding: 0 20px;
    box-sizing: border-box; scrollbar-width: none;
}
.provider-tabs-container::-webkit-scrollbar { display: none; }

.tab-btn {
    display: inline-block; background: transparent; border: 1px solid #e0e0e0;
    padding: 8px 18px; border-radius: 20px; font-family: 'Saira', sans-serif;
    font-size: 0.75rem; 
    font-weight: 700; color: #888; cursor: pointer;
    margin-right: 8px; transition: all 0.2s; text-transform: uppercase;
}

.tab-btn.active {
    background: var(--primary-black); color: #fff; border-color: var(--primary-black);
    box-shadow: 0 4px 10px rgba(0,0,0,0.2);
}

/* --- SEARCH BAR --- */
.search-container {
    position: relative;
    width: 90%;
    margin: 0 auto 15px auto; 
}

.search-container input {
    width: 100%;
    padding: 12px 45px 12px 20px;
    border-radius: 25px;
    border: 1px solid #e0e0e0;
    background: #f9f9f9;
    font-family: 'Saira', sans-serif;
    font-size: 0.9rem;
    font-weight: 600;
    color: #333;
    outline: none;
    box-sizing: border-box;
    transition: all 0.3s ease;
}

.search-container input:focus {
    background: #fff;
    border-color: var(--primary-black);
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
}

.search-icon {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    pointer-events: none; 
    display: flex;
    align-items: center;
}

/* --- GRID SYSTEM & GAME CARDS --- */
.rtp-grid {
    display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; padding: 10px 15px;
}

.game-card-link { text-decoration: none; color: inherit; display: block; }

.game-card {
    background: #fff; border-radius: 10px; padding: 6px; text-align: center;
    border: 1px solid var(--soft-gray); box-shadow: 0 2px 5px rgba(0,0,0,0.02);
    transition: transform 0.2s; position: relative;
}
.game-card:active { transform: scale(0.98); }

.game-img {
    width: 100%; aspect-ratio: 1/1; object-fit: cover; border-radius: 8px;
    display: block; margin-bottom: 6px;
}

.game-name {
    display: flex; align-items: center; justify-content: center;
    color: #444; font-size: 9px; font-weight: 700; height: 28px;
    line-height: 1.1; overflow: hidden; margin-bottom: 6px;
}

.progress-bar {
    background: #f0f0f0; height: 14px; border-radius: 4px; overflow: hidden;
    position: relative; margin-bottom: 4px;
}

.progress-fill {
    height: 100%;
    width: 0%;
    border-radius: 4px;
    transition: width 1s cubic-bezier(0.4, 0, 0.2, 1), background-color 1s ease;
}

.rtp-percent-text {
    font-size: 11px;
    font-weight: 800;
    display: block;
    transition: color 0.5s ease;
}

/* --- FAV ICON --- */
.fav-icon {
    position: absolute;
    top: 5px;
    right: 5px;
    font-size: 1.2rem;
    z-index: 10;
    cursor: pointer;
    filter: drop-shadow(0 2px 2px rgba(0,0,0,0.3));
    transition: transform 0.2s;
}
.fav-icon:hover { transform: scale(1.2); }
.fav-icon.is-active { color: red; }
.fav-icon.is-inactive { color: #fff; opacity: 0.7; }

/* --- PATTERN BADGE --- */
.gacor-badge {
    position: absolute;
    top: -7px;
    left: 50%;
    transform: translateX(-50%);
    background-color: var(--green);
    color: #ffffff;
    font-size: 9px; font-weight: 800;
    padding: 3px 10px; border-radius: 20px;
    z-index: 20; 
    box-shadow: 0 4px 8px rgba(0,0,0,0.3);
    text-transform: uppercase; letter-spacing: 0.5px;
    white-space: nowrap; pointer-events: auto; cursor: pointer;
    animation: pulse-gacor-center 1.5s infinite ease-in-out;
    transition: transform 0.2s;
}
.gacor-badge:hover { transform: translateX(-50%) scale(1.1); }

@keyframes pulse-gacor-center {
    0% { transform: translateX(-50%) scale(1); }
    50% { transform: translateX(-50%) scale(1.05); }
    100% { transform: translateX(-50%) scale(1); }
}

/* --- SEO CONTENT --- */
.seo-article-wrapper {
    background: #ffffff;
    margin: 15px; margin-bottom: 10px; padding: 15px; 
    border-radius: 12px; border: 1px solid var(--soft-gray);
}
.seo-heading {
    font-size: 16px; line-height: 1.3; font-weight: 800;
    color: var(--primary-black); margin-top: 0; margin-bottom: 10px;
    text-transform: uppercase; display: flex; align-items: center; gap: 8px;
}
.seo-heading::before {
    content: ""; display: block; width: 4px; height: 16px;
    background: var(--green); border-radius: 2px;
}
.seo-text {
    font-size: 12px; color: #555; margin-bottom: 12px;
    text-align: justify; line-height: 1.5;
}
.seo-list {
    font-size: 12px; color: #555; margin-bottom: 12px; padding-left: 20px;
}
.seo-list li { margin-bottom: 6px; }

/* --- FOOTER INFO AREA (Disclaimer & RG) --- */
.footer-info-area {
    padding: 0 15px 20px 15px;
}

.disclaimer-box {
    background-color: #fff8e1; border: 1px solid #ffe082;
    border-radius: 8px; padding: 12px; margin-top: 15px;
    display: flex; gap: 10px; align-items: flex-start;
}
.disclaimer-icon { font-size: 1.2rem; line-height: 1; }
.disclaimer-content h4 {
    margin: 0 0 4px 0; font-size: 11px; font-weight: 800;
    color: #f57f17; text-transform: uppercase;
}
.disclaimer-content p {
    margin: 0; font-size: 10px; color: #795548;
    line-height: 1.3; text-align: left;
}

/* --- RESPONSIBLE GAMBLING (18+) --- */
.responsible-gambling {
    margin-top: 15px;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px;
    border: 1px dashed #ccc;
    border-radius: 8px;
    background: #f9f9f9;
}
.rg-badge {
    background: var(--primary-black);
    color: #fff;
    font-size: 12px;
    font-weight: 800;
    width: 32px; height: 32px;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
}
.rg-text {
    font-size: 10px;
    color: #666;
    line-height: 1.3;
    text-align: left;
}

/* --- MARQUEE FOOTER (NEW) --- */
.marquee-footer {
    position: fixed;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    max-width: 480px;
    background: var(--primary-black);
    color: #fff;
    height: 45px;
    line-height: 45px;
    font-size: 13px;
    border-top: none;    
    overflow: hidden;
    white-space: nowrap;
    z-index: 100;
    font-weight: 600;
    letter-spacing: 0.5px;
    box-shadow: 0 -4px 10px rgba(0,0,0,0.1);
}

.marquee-track {
    display: inline-block;
    padding-left: 100%; 
    animation: marquee-scroll 25s linear infinite;
}

@keyframes marquee-scroll {
    0% { transform: translateX(0); }
    100% { transform: translateX(-100%); }
}

/* --- LIVE WINNER NOTIFICATION --- */
.live-winner-toast {
    position: fixed; bottom: 80px; left: 50%; transform: translateX(-50%);
    width: 90%; max-width: 400px; background: rgba(0, 0, 0, 0.85);
    color: #fff; padding: 10px 15px; border-radius: 8px;
    font-size: 0.8rem; display: flex; align-items: center; gap: 10px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.2); z-index: 90;
    opacity: 0; pointer-events: none; transition: opacity 0.5s ease;
}
.live-winner-toast.show { opacity: 1; animation: slideUpFade 0.5s ease-out; }

@keyframes slideUpFade {
    from { opacity: 0; transform: translate(-50%, 20px); }
    to { opacity: 1; transform: translate(-50%, 0); }
}

/* --- DARK MODE --- */
body.dark-mode { background-color: #121212; color: #e0e0e0; }
body.dark-mode .rtp-wrapper, 
body.dark-mode .content-area,
body.dark-mode .game-card,
body.dark-mode .seo-article-wrapper,
body.dark-mode .modal-content {
    background-color: #1e1e1e; border-color: #333; color: #e0e0e0;
}
body.dark-mode .filter-btn { color: #888; }
body.dark-mode .filter-btn:hover { color: #fff; }
body.dark-mode .filter-btn.active { color: #fff; border-bottom-color: #fff; background: none; }
body.dark-mode .seo-title, body.dark-mode .modal-title, body.dark-mode .seo-heading { color: #fff; }
body.dark-mode .search-container input { background-color: #2c2c2c; border-color: #444; color: #fff; }
body.dark-mode .game-name { color: #ccc; }
body.dark-mode .tabs-wrapper::before { background: linear-gradient(to right, #1e1e1e 20%, transparent); }
body.dark-mode .tabs-wrapper::after { background: linear-gradient(to left, #1e1e1e 20%, transparent); }
body.dark-mode .disclaimer-box { background-color: #2c2c00; border-color: #555500; }
body.dark-mode .disclaimer-content p, body.dark-mode .rg-text { color: #aaa; }
body.dark-mode .responsible-gambling { background: #2c2c2c; border-color: #444; }
body.dark-mode .rg-badge { background: #fff; color: #000; }

/* --- MODAL POPUP --- */
.modal-overlay {
    display: none; position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.7); z-index: 999;
    align-items: center; justify-content: center; backdrop-filter: blur(4px);
}
.modal-overlay.active { display: flex; }
.modal-content {
    background: #fff; width: 85%; max-width: 300px; padding: 25px 20px;
    border-radius: 16px; text-align: center; position: relative;
    box-shadow: 0 10px 25px rgba(0,0,0,0.2); animation: slideUp 0.3s ease-out;
}
@keyframes slideUp { from { transform: translateY(20px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
.modal-title { font-size: 1.1rem; font-weight: 800; color: var(--primary-black); margin-bottom: 5px; }
.modal-game-name { font-size: 0.8rem; color: #666; margin-bottom: 15px; font-weight: 600; }
.pattern-box {
    background: #f5f7f9; padding: 12px; border-radius: 10px;
    border: 1px dashed #ccc; margin-bottom: 15px; text-align: left;
}
body.dark-mode .pattern-box { background: #2c2c2c; border-color: #444; }
.pattern-item {
    font-size: 0.8rem; margin-bottom: 6px; display: flex;
    align-items: center; gap: 8px; line-height: 1.3;
}
.pattern-icon { color: var(--green); font-weight: bold; }
.modal-cta-btn {
    display: block; width: 100%; box-sizing: border-box; padding: 12px 0; margin-top: 10px;
    background: var(--primary-black); color: #fff; text-decoration: none; font-weight: 700;
    border-radius: 50px; font-size: 0.85rem; text-transform: uppercase; text-align: center;
    box-shadow: 0 4px 10px rgba(0,0,0,0.2); transition: transform 0.2s;
}
body.dark-mode .modal-cta-btn { background: #e0e0e0; color: #121212; }
.modal-cta-btn:active { transform: scale(0.98); }
.close-modal-btn {
    position: absolute; top: -15px; right: -10px; width: 32px; height: 32px;
    background-color: rgba(0, 0, 0, 0.6); border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    cursor: pointer; z-index: 10; box-shadow: 0 2px 8px rgba(0,0,0,0.2);
    transition: transform 0.2s;
}
.close-modal-btn:active { transform: scale(0.9); }
.close-modal-btn svg { display: block; }

/* --- RESPONSIVE BREAKPOINTS --- */
@media screen and (max-width: 380px) {
    /* Jika layar HP kecil (< 380px), ubah jadi 3 kolom */
    .rtp-grid {
        grid-template-columns: repeat(3, 1fr); 
    }
    
    /* Kecilkan sedikit font di filter agar muat */
    .filter-btn {
        font-size: 0.75rem; 
        gap: 4px;
    }
    
    /* Sesuaikan padding header */
    .filter-controls {
        gap: 15px;
    }
}