:root {
    --bg-color: #111111;
    --card-bg: #1a1a1a;
    --header-bg: rgba(17, 17, 17, 0.95);
    --accent-orange: #ff6b00;
    --accent-blue: #0088ff; /* ពណ៌ខៀវដូចប៊ូតុងក្នុងរូប */
    --text-main: #ffffff;
    --text-muted: #b0b0b0;
    --font-tech: 'Orbitron', sans-serif;
    --font-body: 'Inter', sans-serif;
    --transition: all 0.3s ease;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    background-color: var(--bg-color);
    color: var(--text-main);
    font-family: var(--font-body);
    overflow-x: hidden;
    line-height: 1.6;
}

a { text-decoration: none; color: inherit; }
ul { list-style: none; }

::-webkit-scrollbar {
    width: 8px;
}
::-webkit-scrollbar-track {
    background: var(--bg-color);
}
::-webkit-scrollbar-thumb {
    background: #333;
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: var(--accent-orange);
}

/* --- Header --- */
header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 70px;
    background: var(--header-bg);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid #333;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
    z-index: 1000;
    box-shadow: 0 4px 20px rgba(0,0,0,0.5);
}

.logo {
    font-family: var(--font-tech);
    font-size: 1.5rem;
    font-weight: 900;
    color: var(--text-main);
    text-transform: uppercase;
    letter-spacing: 2px;
    display: flex;
    align-items: center;
    gap: 10px;
}

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

.search-container {
    flex: 1;
    max-width: 500px;
    margin: 0 20px;
    position: relative;
    display: none;
}

@media (min-width: 768px) {
    .search-container {
        display: block;
    }
}

.search-input {
    width: 100%;
    background: #2a2a2a;
    border: 1px solid #444;
    border-radius: 50px;
    padding: 10px 20px;
    padding-right: 40px;
    color: white;
    font-family: var(--font-body);
    outline: none;
    transition: var(--transition);
}

.search-input:focus {
    border-color: var(--accent-orange);
    box-shadow: 0 0 10px rgba(255, 107, 0, 0.3);
}

.search-icon {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
}

.nav-actions {
    display: flex;
    align-items: center;
    gap: 20px;
}

.hamburger {
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-main);
    transition: var(--transition);
}

.hamburger:hover {
    color: var(--accent-blue);
}

/* Mobile Menu */
.mobile-menu {
    position: fixed;
    top: 70px;
    left: 0;
    width: 100%;
    background: var(--card-bg);
    padding: 20px;
    transform: translateY(-150%);
    transition: transform 0.4s ease-in-out;
    z-index: 999;
    border-bottom: 1px solid var(--accent-orange);
    text-align: center;
}

.mobile-menu.active {
    transform: translateY(0);
}

.mobile-menu a {
    display: block;
    padding: 15px;
    font-size: 1.2rem;
    border-bottom: 1px solid #333;
    font-family: var(--font-tech);
}

.mobile-menu a:hover {
    color: var(--accent-orange);
    background: #222;
}

/* --- Hero Section (3D Covered Poster Slider ដូចក្នុងរូបភាព) --- */
.hero-carousel-container {
    position: relative;
    width: 100%;
    max-width: 1250px;
    margin: 90px auto 30px;
    padding: 0 10px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.carousel-track-wrapper {
    position: relative;
    width: 100%;
    height: 320px;
    display: flex;
    justify-content: center;
    align-items: center;
    perspective: 1000px;
}

.carousel-slide {
    position: absolute;
    width: 62%;
    height: 100%;
    border-radius: 12px;
    background-size: cover;
    background-position: center;
    transition: all 0.5s cubic-bezier(0.25, 0.8, 0.25, 1);
    opacity: 0;
    transform: scale(0.7) translateX(0);
    z-index: 1;
    box-shadow: 0 8px 25px rgba(0,0,0,0.6);
    pointer-events: none;
}

/* Slide នៅកណ្តាល (Active Slide) */
.carousel-slide.active {
    opacity: 1;
    transform: scale(1) translateX(0);
    z-index: 10;
    pointer-events: auto;
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.8);
}

/* Slide ខាងឆ្វេង (Previous) */
.carousel-slide.prev {
    opacity: 0.45;
    transform: scale(0.85) translateX(-45%);
    z-index: 5;
    filter: brightness(0.6);
}

/* Slide ខាងស្តាំ (Next) */
.carousel-slide.next {
    opacity: 0.45;
    transform: scale(0.85) translateX(45%);
    z-index: 5;
    filter: brightness(0.6);
}

/* ប៊ូតុងរំកិលរូបភាព (Arrow Buttons ដូចក្នុងរូប) */
.carousel-nav-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 42px;
    height: 42px;
    background: #1a8cff;
    color: #ffffff;
    border: 2px solid #ffffff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 25;
    box-shadow: 0 4px 12px rgba(0, 120, 255, 0.5);
    transition: transform 0.2s ease, background 0.2s ease;
}

.carousel-nav-btn:hover {
    background: #0066cc;
    transform: translateY(-50%) scale(1.1);
}

/* ទីតាំងប៊ូតុងឆ្វេង និងស្តាំ */
.carousel-nav-btn.prev-btn { left: 16%; }
.carousel-nav-btn.next-btn { right: 16%; }

/* Responsive សម្រាប់ទូរស័ព្ទដៃ (Mobile Phone) */
@media (max-width: 768px) {
    .hero-carousel-container {
        margin-top: 80px;
    }
    .carousel-track-wrapper {
        height: 180px;
    }
    .carousel-slide {
        width: 82%;
    }
    .carousel-slide.prev {
        transform: scale(0.88) translateX(-20%);
        opacity: 0.3;
    }
    .carousel-slide.next {
        transform: scale(0.88) translateX(20%);
        opacity: 0.3;
    }
    .carousel-nav-btn {
        width: 32px;
        height: 32px;
        font-size: 0.75rem;
    }
    .carousel-nav-btn.prev-btn { left: 2%; }
    .carousel-nav-btn.next-btn { right: 2%; }
}

/* --- Game Grid Section --- */
.games-section {
    padding: 30px 20px 60px;
    max-width: 1400px;
    margin: 0 auto;
}

.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 30px;
    position: relative;
}

.section-title {
    font-family: var(--font-tech);
    font-size: 1.8rem;
    text-transform: uppercase;
    border-left: 5px solid var(--accent-orange);
    padding-left: 15px;
}

.games-grid {
    display: grid;
    gap: 20px;
    grid-template-columns: repeat(2, 1fr); 
}

@media (min-width: 600px) {
    .games-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (min-width: 900px) {
    .games-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

@media (min-width: 1200px) {
    .games-grid {
        grid-template-columns: repeat(5, 1fr);
    }
}

@media (min-width: 1400px) {
    .games-grid {
        grid-template-columns: repeat(6, 1fr);
    }
}

.game-card {
    background: var(--card-bg);
    border-radius: 12px;
    overflow: hidden;
    position: relative;
    cursor: pointer;
    transition: var(--transition);
    border: 1px solid #333;
    display: flex;
    flex-direction: column;
    aspect-ratio: 1 / 1.2;
}

.game-card:hover {
    transform: translateY(-8px);
    border-color: var(--accent-blue);
    box-shadow: 0 10px 30px rgba(0, 136, 255, 0.2);
}

.card-img-wrapper {
    width: 100%;
    height: 75%;
    position: relative;
    overflow: hidden;
}

.card-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.game-card:hover .card-img {
    transform: scale(1.1);
}

.discount-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    background: var(--accent-orange);
    color: white;
    font-family: var(--font-tech);
    font-size: 0.8rem;
    font-weight: bold;
    padding: 4px 8px;
    border-radius: 4px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.5);
}

.card-info {
    padding: 12px;
    text-align: center;
    flex-grow: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #222;
}

.game-title {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-main);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    width: 100%;
}

/* --- Footer --- */
footer {
    background: #0a0a0a;
    border-top: 1px solid #333;
    padding: 60px 20px 20px;
    margin-top: 40px;
}

.footer-content {
    max-width: 1400px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 40px;
    margin-bottom: 40px;
}

.footer-col h3 {
    font-family: var(--font-tech);
    color: var(--accent-blue);
    margin-bottom: 20px;
    font-size: 1.2rem;
}

.footer-links li {
    margin-bottom: 10px;
}

.footer-links a {
    color: var(--text-muted);
    transition: var(--transition);
}

.footer-links a:hover {
    color: var(--accent-orange);
    padding-left: 5px;
}

.social-icons {
    display: flex;
    gap: 15px;
}

.social-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #222;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    transition: var(--transition);
}

.social-btn:hover {
    background: var(--accent-blue);
    color: #000;
}

.payment-methods {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}

.payment-icon {
    background: white;
    color: #333;
    padding: 8px 12px;
    border-radius: 4px;
    font-weight: bold;
    font-size: 0.8rem;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 60px;
}

.pay-aba { color: #0055a5; }
.pay-wing { color: #ed1c24; }
.pay-acleda { color: #005eb8; }

.footer-bottom {
    text-align: center;
    border-top: 1px solid #222;
    padding-top: 20px;
    color: #666;
    font-size: 0.85rem;
}

/* Toast Notification */
.toast {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: #222;
    color: white;
    padding: 12px 25px;
    border-radius: 50px;
    border: 1px solid var(--accent-orange);
    box-shadow: 0 5px 20px rgba(0,0,0,0.5);
    z-index: 2000;
    opacity: 0;
    transition: all 0.4s ease;
    display: flex;
    align-items: center;
    gap: 10px;
    font-family: var(--font-tech);
    font-size: 0.9rem;
}

.toast.show {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}

@media (max-width: 768px) {
    .section-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    .mobile-search-trigger {
        display: block;
        color: white;
        font-size: 1.2rem;
    }
}