/* =========================================
   1. VARIABLES & RESET (ค่าสีและการตั้งค่าพื้นฐาน)
   ========================================= */
:root {
    --bg-body: #050505;
    --bg-card: #121212;
    --bg-card-hover: #1a1a1a;
    --gold-primary: #d4af37;
    --gold-gradient: linear-gradient(135deg, #d4af37 0%, #f9d96e 50%, #b8860b 100%);
    --text-main: #ffffff;
    --text-muted: #b0b0b0;
    --shadow-gold: 0 4px 15px rgba(212, 175, 55, 0.3);
    --border-color: #333;
}

* { box-sizing: border-box; margin: 0; padding: 0; outline: none; }

body {
    background-color: var(--bg-body);
    color: var(--text-main);
    font-family: 'Kanit', sans-serif;
    line-height: 1.6;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    overflow-x: hidden;
}

a { text-decoration: none; color: inherit; transition: all 0.3s ease; }
ul { list-style: none; }
img { max-width: 100%; display: block; }

.container { max-width: 1200px; margin: 0 auto; padding: 0 20px; }

/* =========================================
   2. HEADER & NAVIGATION (เมนูบาร์)
   ========================================= */
header {
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(10px);
    padding: 15px 0;
    position: sticky;
    top: 0;
    z-index: 1000;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.nav-flex { display: flex; justify-content: space-between; align-items: center; }

.logo a {
    font-size: 26px;
    font-weight: 800;
    background: var(--gold-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    text-transform: uppercase;
    letter-spacing: 1px;
}

nav { display: flex; align-items: center; gap: 20px; }

.nav-link { color: var(--text-main); font-weight: 500; font-size: 16px; position: relative; }
.nav-link:hover { color: var(--gold-primary); }
.nav-link::after {
    content: ''; position: absolute; width: 0; height: 2px;
    bottom: -5px; left: 0; background: var(--gold-primary); transition: width 0.3s;
}
.nav-link:hover::after { width: 100%; }

/* =========================================
   3. BUTTONS
   ========================================= */
.btn-login, .btn-regis, .cta-button {
    border-radius: 50px; font-weight: 600; cursor: pointer; text-align: center; white-space: nowrap;
}
.btn-login { border: 1px solid var(--gold-primary); color: var(--gold-primary); padding: 6px 20px; }
.btn-login:hover { background: var(--gold-primary); color: #000; }
.btn-regis {
    background: var(--gold-gradient); color: #000; padding: 8px 25px;
    box-shadow: 0 0 10px rgba(212, 175, 55, 0.2);
}
.btn-regis:hover { transform: translateY(-2px); box-shadow: var(--shadow-gold); }

.cta-button {
    display: inline-block; padding: 15px 60px; font-size: 22px;
    background: var(--gold-gradient); color: #000; text-transform: uppercase;
    letter-spacing: 1px; margin-top: 30px; animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { box-shadow: 0 0 0 0 rgba(212, 175, 55, 0.7); }
    70% { box-shadow: 0 0 0 15px rgba(212, 175, 55, 0); }
    100% { box-shadow: 0 0 0 0 rgba(212, 175, 55, 0); }
}

/* =========================================
   4. HERO & SECTIONS
   ========================================= */
.hero {
    padding: 120px 20px; text-align: center;
    background: radial-gradient(circle at center, #222 0%, #050505 100%);
    border-bottom: 1px solid var(--border-color);
}
.hero h1 { font-size: 56px; line-height: 1.2; margin-bottom: 20px; color: #fff; }
.hero h1 span { background: var(--gold-gradient); -webkit-background-clip: text; -webkit-text-fill-color: transparent; }
.hero p { font-size: 18px; color: var(--text-muted); max-width: 700px; margin: 0 auto; }

.articles-sec, .features { padding: 80px 0; }
.sec-title { text-align: center; font-size: 36px; margin-bottom: 50px; color: var(--gold-primary); }

.grid-3, .article-grid {
    display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 30px;
}
.feature-card, .article-card {
    background: var(--bg-card); border: 1px solid var(--border-color);
    border-radius: 12px; overflow: hidden; transition: 0.4s;
}
.feature-card:hover, .article-card:hover {
    transform: translateY(-10px); border-color: var(--gold-primary); box-shadow: 0 10px 30px rgba(0,0,0,0.5);
}
.feature-card { padding: 40px 20px; text-align: center; }
.feature-icon { font-size: 48px; margin-bottom: 20px; }
.feature-card h3 { font-size: 22px; margin-bottom: 10px; color: #fff; }
.feature-card p { color: var(--text-muted); font-size: 15px; }

.article-thumb { width: 100%; height: 220px; object-fit: cover; }
.article-body { padding: 25px; }
.article-body h3 { 
    font-size: 20px; margin-bottom: 10px; color: #fff; line-height: 1.4; height: 56px; overflow: hidden;
}
.read-more { display: inline-block; margin-top: 15px; color: var(--gold-primary); font-weight: 600; }

/* =========================================
   5. INNER PAGES
   ========================================= */
.page-header {
    background: #0f0f0f; padding: 60px 0; text-align: center; border-bottom: 1px solid var(--border-color);
}
.page-header h1 { font-size: 40px; color: var(--gold-primary); }
.page-header p { color: var(--text-muted); margin-top: 10px; }

.single-article { padding: 60px 20px; max-width: 900px; margin: 0 auto; }
.main-image { width: 100%; border-radius: 15px; margin-bottom: 40px; box-shadow: 0 10px 40px rgba(0,0,0,0.5); border: 1px solid #333; }
.article-content { font-size: 18px; color: #e0e0e0; line-height: 1.8; }
.article-content h2 { 
    color: var(--gold-primary); font-size: 28px; margin: 40px 0 20px; 
    border-left: 4px solid var(--gold-primary); padding-left: 15px;
}
.article-content p { margin-bottom: 25px; }
.article-content ul, .article-content ol { margin-left: 30px; margin-bottom: 25px; color: var(--text-muted); }
.article-content li { margin-bottom: 10px; }
.article-content strong { color: #fff; }

/* =========================================
   6. FOOTER
   ========================================= */
footer {
    background: #000; border-top: 1px solid #222; padding: 30px 0;
    text-align: center; color: #666; font-size: 14px; margin-top: auto;
}

/* =========================================
   7. MOBILE BOTTOM NAV (แก้ไขใหม่ให้เท่ากันเป๊ะ)
   ========================================= */
.mobile-bottom-nav { display: none; }

@media (max-width: 768px) {
    .nav-flex { justify-content: center; }
    .desktop-menu { display: none; }
    
    .hero h1 { font-size: 36px; }
    .hero p { font-size: 16px; }
    .cta-button { width: 100%; padding: 15px; }
    .grid-3, .article-grid { grid-template-columns: 1fr; }

    body { padding-bottom: 80px; }

    .mobile-bottom-nav {
        display: flex; justify-content: space-around; align-items: center;
        position: fixed; bottom: 0; left: 0; width: 100%; height: 70px;
        background: #000; border-top: 2px solid var(--gold-primary);
        z-index: 9999; box-shadow: 0 -5px 20px rgba(0,0,0,0.8);
        padding-bottom: env(safe-area-inset-bottom);
    }

    /* ปุ่มเมนูทั่วไป */
    .nav-item {
        display: flex; flex-direction: column; align-items: center; justify-content: center;
        text-decoration: none; color: #888; font-size: 10px;
        width: 20%; height: 100%; transition: 0.3s;
    }
    
    /* ไอคอนปกติให้เป็นสีเทา */
    .nav-item .icon { 
        font-size: 20px; margin-bottom: 4px; 
        filter: grayscale(100%); /* ทำให้เป็นสีเทา */
        transition: 0.3s; 
    }
    
    /* เวลากดหรือเอาเมาส์ชี้ ให้เปลี่ยนเป็นสีทอง */
    .nav-item:active, .nav-item:hover { color: var(--gold-primary); }
    .nav-item:active .icon, .nav-item:hover .icon { 
        filter: grayscale(0%); /* คืนสีเดิม (ทอง) */
        transform: scale(1.2); 
    }

    /* ล้างค่าพิเศษของปุ่มสมัครสมาชิก ให้เหมือนเพื่อน 100% */
    .nav-item.highlight-gold {
        /* ไม่มีโค้ดพิเศษ */
    }
}

/* =========================================
   9. GAMES SECTION (ส่วนแนะนำเกม)
   ========================================= */

/* พื้นหลังส่วนเกม: ไล่เฉดดำเทา ให้ดูมีมิติ */
.games-sec {
    padding: 80px 0;
    background: radial-gradient(circle at center, #1a1a1a 0%, #000000 100%);
    border-top: 1px solid #222;
    border-bottom: 1px solid #222;
    position: relative;
    overflow: hidden;
}

/* เพิ่มแสงเงาด้านหลัง (Optional: ให้ดูพรีเมียม) */
.games-sec::before {
    content: '';
    position: absolute;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    width: 80%; height: 80%;
    background: radial-gradient(circle, rgba(212, 175, 55, 0.05) 0%, transparent 70%);
    z-index: 0;
    pointer-events: none;
}

/* ปรับ Grid ให้รองรับ 4 การ์ด (ในหน้าจอใหญ่) */
.games-sec .article-grid {
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    position: relative; z-index: 1;
}

/* ปรับแต่งการ์ดเกมเฉพาะในส่วนนี้ */
.games-sec .article-card {
    background: #0f0f0f;
    border: 1px solid #222;
    transition: all 0.3s ease;
}

/* เอฟเฟกต์ตอนเอาเมาส์ชี้การ์ดเกม */
.games-sec .article-card:hover {
    transform: translateY(-10px) scale(1.02);
    border-color: var(--gold-primary);
    box-shadow: 0 10px 30px rgba(212, 175, 55, 0.15); /* เงาสีทองจางๆ */
}

/* ปรับรูปภาพเกม */
.games-sec .article-thumb {
    height: 180px;
    object-fit: cover; /* ตัดรูปให้พอดีไม่เบี้ยว */
    border-bottom: 1px solid #222;
}

/* ปรับแต่งปุ่ม "เล่นทันที" ให้เป็นสีทองเด่นๆ */
.games-sec .btn-login {
    background: var(--gold-gradient);
    color: #000 !important; /* บังคับตัวหนังสือดำ */
    border: none;
    font-weight: 800;
    margin-top: 10px;
    padding: 10px 0;
    text-transform: uppercase;
    letter-spacing: 1px;
    transition: 0.3s;
    box-shadow: 0 4px 10px rgba(0,0,0,0.5);
}

.games-sec .btn-login:hover {
    background: #fff; /* ชี้แล้วเปลี่ยนเป็นขาว */
    box-shadow: 0 0 15px rgba(255, 255, 255, 0.5); /* เรืองแสง */
    transform: translateY(-2px);
}

/* ปรับ Text ในการ์ด */
.games-sec .article-body h3 {
    color: var(--gold-primary);
    font-size: 22px;
    font-weight: 700;
    margin-bottom: 5px;
}

.games-sec .article-body p {
    color: #888;
    font-size: 14px;
    height: 40px; /* ล็อกความสูงคำบรรยายให้เท่ากัน */
    overflow: hidden;
}

/* =========================================
   RESPONSIVE (มือถือ)
   ========================================= */
@media (max-width: 768px) {
    .games-sec { padding: 50px 0; }
    
    /* ในมือถือให้เรียง 2 แถว (2 คอลัมน์) จะสวยกว่าเรียงยาวลงมา */
    .games-sec .article-grid {
        grid-template-columns: repeat(2, 1fr); 
        gap: 15px;
    }
    
    .games-sec .article-thumb { height: 120px; }
    .games-sec .article-body { padding: 15px 10px; }
    .games-sec .article-body h3 { font-size: 16px; height: auto; }
    .games-sec .article-body p { display: none; } /* ซ่อนคำบรรยายในมือถือเพื่อให้ปุ่มกดง่ายขึ้น */
    .games-sec .btn-login { font-size: 12px; padding: 8px 0; }
}

/* จัดการ List ในบทความ SEO ให้สวยงาม */
.seo-box ul li {
    margin-bottom: 10px;
    color: #ccc;
}
.seo-box strong {
    color: #fff;
}
.seo-box em {
    color: var(--gold-primary);
    font-style: normal;
}