:root {
    /* ธีมสี Subnautica (พื้นหลังน้ำเงินเข้มๆ ทะเลลึก) */
    --bg-dark: #050d14;
    --bg-card: #0b1823;
    --text-main: #e0e6ed;
    --text-muted: #839ab0;
    
    /* สีหลัก ส้ม และ ฟ้าไซไฟ */
    --primary-orange: #f28500;
    --primary-cyan: #00d2ff;
    
    --orange-gradient: linear-gradient(90deg, #ff9d00, #f28500); 
    --cyan-gradient: linear-gradient(90deg, #00d2ff, #00a8ff); 
    
    /* ตั้งค่าให้ตัวแปรสีหลักเรียกใช้สีฟ้า */
    --primary-color: var(--primary-cyan);
}

/* =========================================
   Age Rating Box (กล่องแสดงเรตติ้งอายุ)
========================================= */
.age-rating {
    display: flex;
    align-items: center;
    gap: 20px;
    background: rgba(11, 24, 35, 0.8);
    padding: 20px;
    border-radius: 10px;
    margin-top: 25px;
    border-left: 5px solid #f39c12; /* สีเหลืองส้มสำหรับ PEGI 12 */
    box-shadow: 0 4px 15px rgba(0,0,0,0.4);
}

.age-rating img {
    width: 60px;
    height: auto;
    border-radius: 4px;
}

.age-desc h4 { 
    color: #ffffff; 
    margin-bottom: 5px; 
    font-size: 1.2rem;
}

.age-desc p { 
    font-size: 0.95rem; 
    color: var(--text-muted); 
    white-space: pre-line;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
    font-family: 'Prompt', sans-serif;
    background-color: var(--bg-dark);
    color: var(--text-main);
    line-height: 1.6;
}

h1, h2, h3, .logo { font-family: 'Orbitron', sans-serif; }

/* 1. Navbar */
.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 5%;
    background: rgba(15, 17, 21, 0.95);
    backdrop-filter: blur(10px);
    position: fixed;
    width: 100%;
    top: 0;
    z-index: 1000;
    border-bottom: 1px solid rgba(255,255,255,0.05);
}
.logo, .main-title { 
    font-weight: 900;
    color: #ffffff; /* สีเริ่มต้นเผื่อไว้ */
}
/* =========================================
   โลโก้ และ ชื่อเกม (ระบบแยกสีแบบอิสระ)
========================================= */
.text-orange {
    background: var(--orange-gradient) !important;
    -webkit-background-clip: text !important;
    -webkit-text-fill-color: transparent !important;
    display: inline-block;
}

.text-cyan {
    background: var(--cyan-gradient) !important;
    -webkit-background-clip: text !important;
    -webkit-text-fill-color: transparent !important;
    display: inline-block;
}

.nav-right {
    display: flex;
    align-items: center;
    gap: 30px;
}
.nav-links {
    list-style: none;
    display: flex;
    gap: 20px;
}
.nav-links a {
    color: var(--text-main);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s;
}
.nav-links a:hover { color: var(--primary-color); }

.btn-play {
    background: var(--orange-gradient);
    color: white;
    padding: 10px 25px;
    border-radius: 30px;
    text-decoration: none;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 4px 15px rgba(242, 133, 0, 0.4);
    transition: transform 0.2s;
}
.btn-play:hover { transform: scale(1.05); }

.mobile-menu-btn { display: none; background: none; border: none; color: white; font-size: 1.5rem; }

/* 2. VDO Hero */
.hero-vdo {
    position: relative;
    width: 100%;
    height: 70vh;
    margin-top: 70px;
    background: #000;
    overflow: hidden;
}
.vdo-container iframe {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 100vw;
    height: 56.25vw; /* 16:9 Aspect Ratio */
    min-height: 100vh;
    min-width: 177.77vh; /* 16:9 Aspect Ratio */
    transform: translate(-50%, -50%);
    pointer-events: none;
}
.vdo-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to bottom, rgba(15,17,21,0.2) 0%, var(--bg-dark) 100%);
}

/* Layout หลัก */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 40px 20px;
}
.section-block { margin-bottom: 60px; }
.section-block h2 {
    font-size: 2rem;
    margin-bottom: 25px;
    border-left: 5px solid var(--primary-color);
    padding-left: 15px;
}

/* 3. Details */
.main-title { 
    font-size: 3.5rem; 
    margin-bottom: 15px; 
    color: #ffffff; /* ให้คำแรก (FORZA) เป็นสีขาว */
    font-weight: 900;
    text-transform: uppercase;
}

/* ให้คำที่เหลือ (HORIZON 6) เป็นสีไล่ระดับเหมือนโลโก้ */
.main-title span {
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}
.game-desc-text { 
    font-size: 1.1rem; 
    color: var(--text-muted); 
    margin-bottom: 20px; 
    white-space: pre-line; /* เพิ่มบรรทัดนี้เพื่อให้ HTML อ่านค่าเว้นบรรทัด (\n) จาก JSON ได้ */
}
/* =========================================
   Game Meta (ผู้พัฒนา, ผู้จัดจำหน่าย, ภาษา)
========================================= */
.game-meta {
    background: var(--bg-card); /* สร้างกรอบพื้นหลังให้แยกจากเนื้อหาเกมชัดเจน */
    padding: 25px;
    border-radius: 10px;
    border-left: 5px solid var(--primary-color); /* เพิ่มแถบสีเน้นด้านซ้าย */
    margin-top: 30px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

.game-meta p {
    margin-bottom: 15px;
    font-size: 1.1rem;
    display: flex;
    align-items: flex-start;
}

.game-meta p strong {
    color: #ffffff;
    min-width: 140px; /* ล็อกความกว้างหัวข้อให้ตรงกันเป็นระเบียบ */
    flex-shrink: 0;
}

/* เน้นชื่อผู้พัฒนาและผู้จัดจำหน่ายให้ใหญ่และเป็นสีฟ้า/สีหลัก */
#game-dev, #game-pub {
    color: var(--primary-color);
    font-weight: 700;
    font-size: 1.15rem;
    letter-spacing: 0.5px;
}

/* ปรับส่วนของภาษาที่ยาวๆ ให้ดูกลืนเป็นรายละเอียดรอง */
#game-lang {
    color: var(--text-muted);
    font-size: 0.95rem;
    line-height: 1.6;
}

/* จัดระยะห่างของแท็กให้อยู่ด้านล่างสุดของกรอบ */
.hashtags { 
    display: flex; 
    gap: 10px; 
    margin-top: 25px; 
    flex-wrap: wrap; 
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    padding-top: 15px;
}
.hashtags { display: flex; gap: 10px; margin-top: 15px; flex-wrap: wrap; }
/* แท็ก (Hashtags) พื้นหลังเขียวอ่อน */
.tag { 
    background: rgba(0, 210, 255, 0.1); 
    color: var(--primary-cyan); 
    padding: 5px 12px; 
    border-radius: 20px; 
    font-size: 0.9rem; 
    border: 1px solid rgba(0, 210, 255, 0.3);
    transition: all 0.3s ease;
}

.tag:hover {
    background: rgba(242, 133, 0, 0.2); /* เมื่อชี้เปลี่ยนเป็นสีส้ม */
    color: #ffb347;
    border-color: rgba(242, 133, 0, 0.5);
    box-shadow: 0 0 10px rgba(242, 133, 0, 0.3);
}

/* 4. System Requirements */
.sysreq-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
}
.req-card {
    background: var(--bg-card);
    padding: 30px;
    border-radius: 8px;
    border-top: 3px solid #3c4452;
}
.req-card h3 { margin-bottom: 15px; color: #fff; }
.req-card ul { list-style: none; }
.req-card ul li {
    margin-bottom: 10px;
    font-size: 0.95rem;
    color: var(--text-muted);
}
.req-card ul li strong { color: var(--text-main); }

/* =========================================
   5. Controllers (คอนโทรลเลอร์ที่รองรับ)
========================================= */
.controller-list {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
}
.controller-item {
    background: linear-gradient(145deg, #181c23, #222731);
    padding: 15px 25px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    gap: 12px;
    font-weight: 500;
    border: 1px solid rgba(231, 0, 100, 0.15); /* ขอบเรืองแสงสีชมพูอ่อน */
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease;
}
.controller-item i {
    color: var(--primary-color);
    font-size: 1.3rem;
    filter: drop-shadow(0 0 5px rgba(231, 0, 100, 0.5)); /* ไอคอนเรืองแสงสีชมพู */
}
.controller-item:hover {
    transform: translateY(-5px);
    border-color: var(--primary-color);
    background: linear-gradient(145deg, #1c212a, #262c38);
    box-shadow: 0 8px 20px rgba(231, 0, 100, 0.2);
}

/* =========================================
   6. Download (ช่องทางการดาวน์โหลด)
========================================= */
.download-buttons {
    display: flex;
    flex-direction: row; /* เรียงแนวนอนบน PC */
    flex-wrap: wrap; /* ถ้าหน้าจอแคบจะปัดตกบรรทัดใหม่ให้อัตโนมัติ */
    gap: 20px;
    width: 100%;
}

.btn-dl {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 18px 30px;
    border-radius: 10px;
    text-decoration: none;
    font-weight: 700;
    font-size: 1.1rem;
    transition: all 0.3s ease;
    flex: 1; /* บังคับให้ปุ่มขยายขนาดเท่าๆ กัน */
    min-width: 260px; /* ขนาดขั้นต่ำของปุ่ม ไม่ให้บีบจนเกินไป */
}

/* ปุ่ม Steam (สีฟ้า) */
.btn-steam { 
    background: linear-gradient(135deg, #1b2838, #2a475e); 
    color: white; 
    border: 1px solid #66c0f4; 
    box-shadow: 0 4px 15px rgba(102, 192, 244, 0.15);
}
.btn-steam:hover { 
    background: linear-gradient(135deg, #2a475e, #66c0f4); 
    color: #fff;
    transform: translateY(-4px);
    box-shadow: 0 8px 25px rgba(102, 192, 244, 0.3);
}

/* ปุ่ม Xbox Store (สีเขียว) */
.btn-xbox { 
    background: linear-gradient(135deg, #0e5c0e, #107c10); 
    color: white; 
    border: 1px solid #1f9f1f; 
    box-shadow: 0 4px 15px rgba(16, 124, 16, 0.15);
}
.btn-xbox:hover { 
    background: linear-gradient(135deg, #107c10, #23b323); 
    color: white;
    transform: translateY(-4px);
    box-shadow: 0 8px 25px rgba(16, 124, 16, 0.3);
}

/* ปุ่ม Epic Games (สีเทา-ดำ) */
.btn-epic { 
    background: linear-gradient(135deg, #2a2e38, #3f4555); 
    color: white; 
    border: 1px solid #717c96; 
    box-shadow: 0 4px 15px rgba(255, 255, 255, 0.05);
}
.btn-epic:hover { 
    background: linear-gradient(135deg, #3f4555, #5a6378); 
    color: white;
    transform: translateY(-4px);
    box-shadow: 0 8px 25px rgba(255, 255, 255, 0.15);
}

/* 7. Gallery (16:9, 3 Columns x 2 Rows) */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
}
.gallery-grid img {
    width: 100%;
    aspect-ratio: 16 / 9; /* บังคับสัดส่วน 16:9 ทุกภาพ */
    object-fit: cover;
    border-radius: 8px;
    transition: transform 0.3s;
    cursor: pointer;
}
.gallery-grid img:hover { transform: scale(1.02); }

footer { text-align: center; padding: 30px; color: var(--text-muted); border-top: 1px solid #2a2e38; }

/* =========================================
   Lightbox (แสดงภาพใหญ่)
========================================= */
.lightbox {
    display: none; /* ซ่อนไว้เป็นค่าเริ่มต้น */
    position: fixed;
    z-index: 2000; /* ให้อยู่บนสุดทับ Navbar */
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(10, 10, 12, 0.95); /* พื้นหลังดำโปร่งแสง */
    justify-content: center;
    align-items: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.lightbox.active {
    display: flex;
    opacity: 1;
}

.lightbox img {
    max-width: 90%;
    max-height: 85vh;
    border-radius: 10px;
    box-shadow: 0 0 30px rgba(231, 0, 100, 0.3); /* เงาสีชมพู Forza */
    object-fit: contain;
    animation: zoomIn 0.3s ease; /* เอฟเฟกต์เด้งตอนเปิด */
}

@keyframes zoomIn {
    from { transform: scale(0.9); }
    to { transform: scale(1); }
}

/* ปุ่มกากบาทปิด */
.close-lightbox {
    position: absolute;
    top: 30px;
    right: 40px;
    color: #fff;
    font-size: 40px;
    font-weight: bold;
    cursor: pointer;
    transition: color 0.3s;
    z-index: 2001;
}

.close-lightbox:hover { color: var(--primary-color); }

/* ปุ่มเลื่อน ซ้าย-ขวา */
.prev-lightbox, .next-lightbox {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(24, 28, 35, 0.6);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.2);
    width: 55px;
    height: 55px;
    border-radius: 50%;
    font-size: 1.5rem;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: all 0.3s ease;
    z-index: 2001;
}

.prev-lightbox:hover, .next-lightbox:hover {
    background: var(--primary-gradient); /* เปลี่ยนสีเมื่อชี้ */
    border-color: transparent;
    box-shadow: 0 0 15px rgba(231, 0, 100, 0.5);
    transform: translateY(-50%) scale(1.1);
}

.prev-lightbox { left: 40px; }
.next-lightbox { right: 40px; }

/* ปรับขนาดบนมือถือ */
@media (max-width: 768px) {
    .prev-lightbox { left: 10px; width: 40px; height: 40px; font-size: 1.2rem; }
    .next-lightbox { right: 10px; width: 40px; height: 40px; font-size: 1.2rem; }
    .close-lightbox { top: 15px; right: 20px; font-size: 30px; }
    .lightbox img { max-width: 95%; max-height: 70vh; }
}

/* Responsive */
@media (max-width: 900px) {
    .sysreq-grid { grid-template-columns: 1fr; }
    .gallery-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
    /* ซ่อนเมนูไว้ก่อน และจัดเลย์เอาต์ให้เป็นแบบกางลงมา (Dropdown) */
    .nav-right {
        display: none; 
        flex-direction: column;
        position: absolute;
        top: 100%; 
        left: 0;
        width: 100%;
        background: rgba(15, 17, 21, 0.98); 
        padding: 20px 0 30px 0;
        /* เปลี่ยนขอบเส้นด้านบนเป็นสีชมพู */
        border-top: 1px solid rgba(231, 0, 100, 0.4); 
        box-shadow: 0 10px 20px rgba(0, 0, 0, 0.5);
    }

    /* คลาสนี้จะถูกเรียกใช้ตอนกดปุ่มเมนู เพื่อให้เมนูแสดงขึ้นมา */
    .nav-right.active {
        display: flex;
    }

    .nav-links {
        flex-direction: column;
        align-items: center; /* จัดให้อยู่กึ่งกลาง */
        width: 100%;
        gap: 20px;
    }

    .btn-play {
        margin: 20px auto 0 auto; /* จัดปุ่มเข้าเล่นเกมให้อยู่กึ่งกลาง */
        justify-content: center;
        width: 80%;
    }

    .mobile-menu-btn { 
        display: block; 
        cursor: pointer;
    }

    .gallery-grid { grid-template-columns: 1fr; }
    .hero-vdo { height: 50vh; }
    .download-buttons { flex-direction: column; }
}