/* =================================================================== */
/* GAYA BARU: TEMA "LIGHT & CLEAN" (VERSI LENGKAP + PERBAIKAN MENU MOBILE) */
/* =================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Nunito+Sans:wght@400;600;700;800&display=swap');

/* =================================
   1. GLOBAL & ROOT VARIABLES
   ================================= */

:root {
    --primary-color: #6a5acd; /* Ungu Modern (SlateBlue) */
    --secondary-color: #2c3e50; /* Abu-abu Gelap (Asphalt) */
    --light-bg: #f4f7f9; /* Abu-abu Sangat Terang */
    --card-bg: #ffffff; /* Putih Bersih */
    --text-primary: #2c3e50; /* Teks Utama (Sama dengan secondary) */
    --text-secondary: #7f8c9a; /* Abu-abu Netral */
    --border-color: #dfe4ea; /* Abu-abu Cerah untuk Border */
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Nunito Sans', sans-serif;
    background-color: var(--light-bg);
    color: var(--text-primary);
    margin: 0;
    padding: 0;
    text-align: center;
    overflow-x: hidden;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

section {
    padding: 80px 0;
    background-color: transparent;
}

a {
    color: var(--primary-color);
    text-decoration: none;
    transition: color 0.3s ease;
}

a:hover {
    color: var(--secondary-color);
    text-decoration: none;
}


/* =================================
   2. TYPOGRAPHY
   ================================= */

h1 {
    font-size: clamp(2.2rem, 6vw, 3.5rem);
    font-weight: 800;
    margin: 20px 0 15px 0;
    color: var(--secondary-color);
}

h2 {
    font-size: clamp(1.8rem, 5vw, 2.8rem);
    margin-bottom: 50px;
    font-weight: 700;
}

p {
    line-height: 1.8;
    color: var(--text-secondary);
    max-width: 700px;
    margin-left: auto;
    margin-right: auto;
    font-size: 1.1rem;
}

/* ====================================================== */
/* 2. HEADER & NAVIGASI (TERMASUK PERBAIKAN MOBILE) */
/* ====================================================== */
header {
    padding: 15px 0;
    background-color: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(10px);
    position: sticky;
    top: 0;
    z-index: 1000;
    border-bottom: 1px solid var(--border-color);
}
.nav-container { display: flex; justify-content: space-between; align-items: center; }
.nav-logo a { font-size: 1.5rem; font-weight: 800; text-transform: uppercase; letter-spacing: 1px; color: var(--text-primary); text-decoration: none; }

/* Menu Desktop */
.nav-menu { display: none; }
@media (min-width: 992px) { .nav-menu { display: flex; } }
.nav-menu a { color: var(--text-primary); margin-left: 25px; font-weight: 700; transition: color 0.3s ease; }
.nav-menu a:hover { color: var(--primary-color); }

/* --- [START] BAGIAN MENU MOBILE YANG DIPERBAIKI --- */
/* TAMBAHKAN KODE BARU INI */
.hamburger-menu {
    display: flex; /* Menggunakan flexbox untuk menengahkan ikon */
    align-items: center;
    justify-content: center;
    width: 44px;  /* Memberi lebar yang pas */
    height: 44px; /* Memberi tinggi yang pas */
    background-color: rgba(106, 90, 205, 0.1); /* Latar belakang ungu transparan */
    border-radius: 12px; /* Sudut yang lebih tumpul dan modern */
    cursor: pointer;
    z-index: 1001;
    transition: background-color 0.3s ease, transform 0.3s ease;
}

.hamburger-menu:hover {
    background-color: rgba(106, 90, 205, 0.2); /* Latar belakang sedikit lebih gelap saat disentuh */
    transform: scale(1.05); /* Sedikit membesar saat disentuh */
}

.hamburger-menu i {
    font-size: 1.6rem; /* Sedikit menyesuaikan ukuran ikon */
    color: var(--primary-color); /* Warna ikon tetap ungu solid */
}
}
@media (min-width: 992px) { 
    .hamburger-menu { display: none; } 
}
.hamburger-menu i { 
    font-size: 1.8rem; 
    color: var(--text-primary); 
}

/* Overlay yang menutupi layar */
.mobile-nav-overlay { 
    height: 100%; 
    width: 0; /* Awalnya 0, diubah oleh JS menjadi 100% */
    position: fixed; 
    z-index: 1002; 
    top: 0; 
    left: 0; 
    background-color: rgba(244, 247, 249, 0.98); 
    overflow-x: hidden; 
    transition: 0.3s ease-in-out; 
    backdrop-filter: blur(5px);
}

/* Konten di dalam overlay */
.mobile-nav-content { 
    position: relative; 
    top: 20%; 
    width: 100%; 
    text-align: center; 
    margin-top: 30px; 
}
.mobile-nav-content a { 
    padding: 15px; 
    text-decoration: none; 
    font-size: 2rem; 
    font-weight: 700;
    color: var(--text-secondary); 
    display: block; 
    transition: 0.3s; 
}
.mobile-nav-content a:hover, .mobile-nav-content a:focus { 
    color: var(--primary-color); 
}

/* Tombol Close */
.mobile-nav-overlay .close-btn { 
    position: absolute; 
    top: 20px; 
    right: 45px; 
    font-size: 3rem; 
    color: var(--secondary-color); 
    text-decoration: none !important; 
}
/* --- [END] BAGIAN MENU MOBILE YANG DIPERBAIKI --- */


/* =================================
   4. HERO SECTION & ANIMATION
   ================================= */

#hero {
    padding: 40px 20px 80px 20px;
}

.animated-hero-svg {
    width: 180px;
    height: auto;
    margin-bottom: -20px;
    animation: floatAnimation 4s ease-in-out infinite;
}

@keyframes floatAnimation {
    0% { transform: translateY(0px); }
    50% { transform: translateY(-20px); }
    100% { transform: translateY(0px); }
}

.text-logo {
    font-size: clamp(1.5rem, 4vw, 2rem);
    font-weight: 800;
    margin-bottom: 25px;
    text-transform: uppercase;
    letter-spacing: 2px;
    background: linear-gradient(90deg, var(--primary-color) 0%, #a29bfe 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}


/* =================================
   5. BUTTONS & FORMS
   ================================= */

#search-container {
    margin-top: 40px;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

#search-input {
    width: 100%;
    box-sizing: border-box;
    padding: 18px 25px;
    font-size: 1.1rem;
    border: 2px solid var(--border-color);
    border-radius: 12px;
    background-color: var(--card-bg);
    color: var(--text-primary);
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}
#search-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 4px rgba(106, 90, 205, 0.2);
}

.cta-button {
    display: inline-block;
    background: var(--primary-color);
    color: white;
    padding: 18px 40px;
    text-decoration: none;
    font-size: 1.25rem;
    font-weight: 700;
    border-radius: 12px;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    cursor: pointer;
    border: none;
}

.cta-button:hover,
.cta-button:focus {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(106, 90, 205, 0.3);
    text-decoration: none;
    color: white;
}

.cta-button-secondary {
    display: inline-block;
    background: transparent;
    border: 2px solid var(--primary-color);
    color: var(--primary-color);
    padding: 16px 35px;
    text-decoration: none;
    font-size: 1.1rem;
    font-weight: 600;
    border-radius: 12px;
    transition: all 0.3s ease;
    margin-top: 25px;
}

.cta-button-secondary:hover {
    background-color: var(--primary-color);
    color: white;
    text-decoration: none;
}


/* =================================
   6. CATEGORY GRID (Disatukan dengan card-grid)
   ================================= */

#game-showcase {
    padding-bottom: 40px;
}

/* ====================================================== */
/* 3. GRID & KARTU KONSISTEN (UNTUK SEMUA HALAMAN) */
/* ====================================================== */
.category-grid, .card-grid, .related-grid {
    display: grid;
    gap: 25px;
    margin-top: 40px;
    grid-template-columns: repeat(2, 1fr);
}
@media (min-width: 768px) { .category-grid, .card-grid, .related-grid { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 1200px) { .category-grid, .card-grid, .related-grid { grid-template-columns: repeat(4, 1fr); } }

.game-card, .category-card, .related-card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    text-decoration: none;
    color: var(--text-primary);
    position: relative;
    display: flex;
    flex-direction: column;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}
.game-card:hover, .category-card:hover, .related-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}
.game-card a, .category-card a { text-decoration: none; color: var(--text-primary); display: flex; flex-direction: column; height: 100%; }
.thumbnail-container { width: 100%; padding-top: 75%; position: relative; background-color: #eee; }
.thumbnail-container img { position: absolute; top: 0; left: 0; width: 100%; height: 100%; object-fit: cover; transition: transform 0.3s ease; }
.game-card:hover img, .category-card:hover img, .related-card:hover img { transform: scale(1.05); }
.thumbnail-overlay { display: none; /* Overlay tidak terlalu efektif di tema terang */ }

.category-card h3, .related-card h3 {
    font-size: 1.2rem;
    padding: 15px;
    margin: 0;
    text-align: center;
    background-color: var(--card-bg);
}

.game-card .details {
    padding: 15px;
    text-align: left;
}
.game-card h3 {
    margin: 0 0 5px 0;
    font-size: 1.1rem;
    font-weight: 700;
}
.game-card .category {
    font-size: 0.85rem;
    color: var(--text-secondary);
    font-weight: 600;
}
.game-card .play-icon {
    position: absolute;
    top: 37.5%; /* Pusat dari thumbnail (75% / 2) */
    left: 50%;
    transform: translate(-50%, -50%) scale(0.8);
    width: 60px;
    height: 60px;
    background-color: rgba(106, 90, 205, 0.9);
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    transition: all 0.3s ease;
}
.game-card:hover .play-icon { transform: translate(-50%, -50%) scale(1); opacity: 1; }
.game-card .play-icon svg { width: 30px; height: 30px; fill: #fff; margin-left: 5px; }


/* =================================
   8. GAME PLAY PAGE
   ================================= */

.play-container {
    width: 100%;
    padding-top: 56.25%; /* 16:9 Aspect Ratio */
    position: relative;
    background-color: #000;
    border-radius: 16px;
    overflow: hidden;
    border: 1px solid var(--border-color);
}

.play-container iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
}

.share-container {
    margin: 30px auto;
    text-align: center;
}

.share-button {
    display: inline-block;
    margin: 5px;
    padding: 10px 20px;
    border-radius: 8px;
    color: #fff;
    text-decoration: none;
    font-weight: 600;
    transition: transform 0.2s ease, opacity 0.2s ease;
}

.share-button:hover {
    transform: scale(1.05);
    opacity: 0.9;
    color: #fff;
    text-decoration: none;
}

.share-facebook { background-color: #1877F2; }
.share-twitter { background-color: #1DA1F2; }
.share-whatsapp { background-color: #25D366; }
.share-telegram { background-color: #0088cc; }

.game-details-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 40px;
    text-align: left;
    margin-top: 40px;
}

.detail-box {
    background-color: var(--card-bg);
    padding: 30px;
    border-radius: 16px;
    border: 1px solid var(--border-color);
}
.detail-box h3 {
    font-size: 1.5rem;
    color: var(--primary-color);
    margin-top: 0;
    border-bottom: 2px solid var(--border-color);
    padding-bottom: 10px;
}

.detail-box p {
    max-width: 100%;
    margin-left: 0;
    font-size: 1rem;
}

@media (min-width: 768px) {
    .game-details-grid {
        grid-template-columns: 2fr 1fr;
    }
}


/* =================================
   9. RELATED GAMES GRID (Sudah digabung di atas)
   ================================= */
   
/* Tidak perlu rule tambahan karena .related-grid dan .related-card sudah diatur */
/* dalam section .card-grid di atas untuk konsistensi. */


/* =================================
   10. STATIC PAGE & FOOTER
   ================================= */

.static-page {
    text-align: left;
    background-color: var(--card-bg);
    border-radius: 16px;
    padding: 40px;
    border: 1px solid var(--border-color);
}

.static-page h1 {
    margin-top: 0;
    border-bottom: 2px solid var(--border-color);
    padding-bottom: 15px;
    margin-bottom: 25px;
}

.footer {
    padding: 60px 20px 40px 20px;
    background-color: var(--secondary-color);
    color: var(--light-bg);
}

.footer-nav {
    margin-bottom: 20px;
}

.footer-nav a {
    margin: 0 15px;
    color: var(--border-color);
    transition: color 0.3s ease;
}
.footer-nav a:hover {
    color: var(--card-bg);
}

.footer p {
    color: var(--border-color);
    font-size: 0.9rem;
}