/* Custom Variables */
:root {
    --bg: #1a0b2e;
    --header: #12061f;
    --card: #2d1b4d;
    --accent: #ffcc00;
    --text: #ffffff;
    --transition: 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

/* Base Styles - Optimasi Firefox & Safari Mac */
html {
    height: 100%;
    overflow-y: scroll; /* Memaksa scrollbar tetap aktif */
    -webkit-text-size-adjust: 100%;
}

body {
    background-color: var(--bg);
    color: var(--text);
    font-family: 'Inter', 'Segoe UI', system-ui, -apple-system, sans-serif;
    margin: 0;
    padding: 0;
    min-height: 100%;
    display: flex;
    flex-direction: column;
    overflow-x: hidden; /* Mengganti clip agar kompatibel dengan versi lama */
    line-height: 1.5;
}

/* Header */
header {
    background: var(--header);
    padding: 15px 5%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 5px 20px rgba(0,0,0,0.6);
    width: 100%;
    box-sizing: border-box;
}

.logo { 
    font-size: 24px; 
    font-weight: 900; 
    color: white; 
    text-decoration: none; 
    letter-spacing: 1px;
}

.logo span { color: var(--accent); }

/* Navigation */
.filter-bar {
    display: flex;
    justify-content: center;
    gap: 12px;
    padding: 25px 5%;
    flex-wrap: wrap;
    background: linear-gradient(to bottom, var(--header), transparent);
}

.filter-btn {
    background: var(--card);
    color: white;
    text-decoration: none;
    padding: 10px 22px;
    border-radius: 30px;
    font-size: 13px;
    font-weight: bold;
    transition: var(--transition);
    border: 1px solid rgba(255,255,255,0.1);
}

.filter-btn.active, .filter-btn:hover {
    background: var(--accent);
    color: var(--header);
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(255, 204, 0, 0.3);
}

/* Main Container */
.main-container { 
    padding: 0 5% 80px;
    width: 100%;
    box-sizing: border-box;
    flex: 1; /* Penting agar kontainer mengisi ruang kosong */
}

.game-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 20px;
}

/* Game Card */
.game-card {
    text-decoration: none;
    color: white;
    outline: none;
}

.card-inner {
    background: var(--card);
    border-radius: 18px;
    overflow: hidden;
    position: relative;
    aspect-ratio: 1 / 1;
    box-shadow: 0 8px 20px rgba(0,0,0,0.4);
    transition: var(--transition);
}

.game-card:hover .card-inner { 
    transform: translateY(-8px);
    box-shadow: 0 12px 30px rgba(0,0,0,0.6);
}

.game-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block; /* Menghilangkan gap bawah gambar di Firefox */
}

.game-title {
    padding: 12px 8px;
    font-size: 12px;
    font-weight: bold;
    text-align: center;
    background: linear-gradient(transparent, rgba(0,0,0,0.9));
    position: absolute;
    bottom: 0; 
    width: 100%;
    box-sizing: border-box;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Loader */
#loader { 
    text-align: center; 
    padding: 50px 0; 
    color: var(--accent); 
    display: none; 
    font-weight: bold;
    width: 100%;
}

/* Mobile Adjustments */
@media (max-width: 768px) {
    .game-grid { grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 15px; }
}

@media (max-width: 480px) {
    .game-grid { grid-template-columns: repeat(auto-fill, minmax(100px, 1fr)); gap: 10px; }
    .filter-btn { padding: 8px 15px; font-size: 11px; }
}


/* ==========================================
   PREMIUM GAMING FOOTER
   ========================================== */
footer {
    background: linear-gradient(to bottom, transparent, var(--header));
    padding: 80px 5% 40px;
    margin-top: 100px;
    position: relative;
    width: 100%;
    box-sizing: border-box;
}

/* Garis aksen di atas footer */
footer::before {
    content: '';
    position: absolute;
    top: 0; left: 50%;
    transform: translateX(-50%);
    width: 80%;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--accent), transparent);
    opacity: 0.3;
}

.footer-main {
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 1.5fr 1fr 1fr 1.5fr;
    gap: 40px;
}

.footer-brand .f-logo {
    font-size: 28px;
    font-weight: 900;
    color: #fff;
    text-decoration: none;
    display: block;
    margin-bottom: 20px;
    letter-spacing: -1px;
}

.footer-brand .f-logo span {
    color: var(--accent);
    text-shadow: 0 0 15px rgba(255, 204, 0, 0.4);
}

.footer-brand p {
    color: #8b829d;
    font-size: 14px;
    line-height: 1.7;
    max-width: 280px;
}

.footer-box h4 {
    color: #fff;
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 25px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.footer-box ul {
    list-style: none;
    padding: 0; margin: 0;
}

.footer-box ul li {
    margin-bottom: 15px;
}

.footer-box ul li a {
    color: #8b829d;
    text-decoration: none;
    font-size: 14px;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
}

.footer-box ul li a:hover {
    color: var(--accent);
    transform: translateX(8px);
}

/* Newsletter / Stats Box */
.footer-newsletter {
    background: rgba(255, 255, 255, 0.03);
    padding: 25px;
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.footer-newsletter h4 { margin-bottom: 15px; }
.footer-newsletter p { font-size: 13px; color: #8b829d; margin-bottom: 20px; }

.f-stats {
    display: flex;
    gap: 15px;
}

.stat-item {
    background: var(--card);
    padding: 10px 15px;
    border-radius: 12px;
    text-align: center;
    flex: 1;
}

.stat-item span { display: block; font-size: 10px; color: #8b829d; text-transform: uppercase; }
.stat-item b { display: block; font-size: 14px; color: var(--accent); }

.footer-bottom {
    max-width: 1200px;
    margin: 60px auto 0;
    padding-top: 30px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: #5d546d;
    font-size: 13px;
}

/* Responsive */
@media (max-width: 1024px) {
    .footer-main { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 600px) {
    .footer-main { grid-template-columns: 1fr; text-align: center; }
    .footer-brand p { max-width: 100%; }
    .footer-box ul li a { justify-content: center; }
    .footer-bottom { flex-direction: column; gap: 20px; }
    .footer-newsletter { text-align: left; }
}

/* --- CSS KHUSUS IKLAN ARCADEFUN --- */

/* 1. Iklan Feed (Yang disisipkan di tengah grid) */
.ad-feed-row {
    /* KUNCI: Memaksa iklan memakan 1 baris penuh (7 kolom desktop / 3 kolom mobile) */
    grid-column: 1 / -1; 
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    margin: 15px 0;
    padding: 20px 0;
    background: rgba(255, 255, 255, 0.03); /* Background tipis agar estetik */
    border-radius: 18px; /* Menyesuaikan border-radius game-card kamu */
    min-height: 100px; /* Jaga layout agar tidak melompat saat iklan muncul */
}

/* 2. Pembungkus Iklan Header (Atas Filter) */
.ad-header-wrapper {
    width: 100%;
    display: flex;
    justify-content: center;
    padding: 10px 0 20px 0;
    min-height: 90px;
}

/* 3. Penyesuaian Frame Iklan agar tidak meluber */
#div-gpt-ad-gm-header, 
#div-gpt-ad-gm-feed {
    max-width: 100% !important;
    overflow: hidden;
}

/* 4. Responsive Mobile */
@media (max-width: 768px) {
    .ad-feed-row {
        margin: 10px 0;
        padding: 15px 0;
        border-radius: 12px;
    }
}