/* แนะนำ: ถ้าโหลดฟอนต์ใน CSS ให้ใส่แบบนี้ไว้บนสุดเสมอ */
/* ถ้าใช้ Google Font Link ใน HTML ต้องมี &display=swap ต่อท้าย URL */
@font-face {
    font-family: 'Kanit';
    font-style: normal;
    font-weight: 400;
    font-display: swap; /* สำคัญมาก! ช่วยแก้ LCP */
    /* src: url(...) ใส่ path ฟอนต์ของคุณตรงนี้ */
}

: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; }

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%; }

.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); }
}

.hero {
    padding: 120px 20px; text-align: center;
    background: radial-gradient(circle at center, #222 0%, #050505 100%);
    border-bottom: 1px solid var(--border-color);
    /* LCP Optimization: ถ้า Hero มีรูป Background ให้ใช้ preload ใน HTML แทน */
    content-visibility: auto; /* ช่วยเรื่อง render performance */
}
.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; content-visibility: auto; }
.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;
    contain: content; /* บอก Browser ว่า content ข้างในไม่กระทบข้างนอก ช่วย render เร็วขึ้น */
}
.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; }

.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; }

footer {
    background: #000; border-top: 1px solid #222; padding: 30px 0;
    text-align: center; color: #666; font-size: 14px; margin-top: auto;
}

.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); }
}

.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; content-visibility: auto;
}
.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;
}
.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); }
.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; }

@media (max-width: 768px) {
    .games-sec { padding: 50px 0; }
    .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; }
}

.seo-box ul li { margin-bottom: 10px; color: #ccc; }
.seo-box strong { color: #fff; }
.seo-box em { color: var(--gold-primary); font-style: normal; }