/* Global Styles / Style chung */
body {
    background-color: #121212; /* Dark background / Nền tối */
    color: #e0e0e0; /* Light text / Chữ sáng */
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    margin: 0;
    padding: 0;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Footer: align content to same container width as page */
/* --- SEO FOOTER STYLE --- */
.site-footer {
    background-color: #111; /* Nền rất tối */
    color: #bbb; /* Chữ màu xám sáng */
    padding: 60px 0 20px;
    margin-top: 50px;
    border-top: 3px solid #333;
    font-size: 14px;
}

.footer-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr; /* Cột đầu tiên rộng gấp đôi */
    gap: 40px;
    margin-bottom: 40px;
}

.footer-col h3 {
    color: #fff;
    font-size: 16px;
    text-transform: uppercase;
    margin-bottom: 20px;
    border-bottom: 2px solid var(--accent); /* Gạch chân màu xanh/đỏ */
    display: inline-block;
    padding-bottom: 5px;
}

/* Style cho cột Giới thiệu */
.footer-logo {
    font-size: 24px;
    font-weight: 900;
    color: #fff;
    margin-bottom: 15px;
    display: block;
}
.footer-logo span { color: var(--accent); }
.footer-logo-img { height: 56px; width: auto; display: block; margin-bottom: 12px; }
.footer-desc {
    line-height: 1.6;
    margin-bottom: 20px;
    color: #999;
}
.footer-desc strong { color: #ddd; } /* Nhấn mạnh từ khóa SEO */

/* Social Icons */
.social-links { display: flex; gap: 15px; }
.social-links a {
    width: 35px; height: 35px;
    background: #333; color: #fff;
    display: flex; align-items: center; justify-content: center;
    border-radius: 50%;
    transition: 0.3s;
}
.social-links a:hover { background: var(--accent); transform: translateY(-3px); }

/* Footer Links List */
.footer-links li { margin-bottom: 10px; }
.footer-links a {
    color: #bbb;
    transition: 0.2s;
    display: block;
}
.footer-links a:hover {
    color: var(--accent);
    padding-left: 5px; /* Hiệu ứng đẩy nhẹ sang phải */
}

/* Footer Bottom */
.footer-bottom {
    border-top: 1px solid #222;
    padding-top: 20px;
    text-align: center;
    font-size: 13px;
    color: #666;
}

/* RESPONSIVE (Mobile) */
@media (max-width: 900px) {
    .footer-grid {
        grid-template-columns: 1fr 1fr; /* 2 cột trên Tablet */
    }
}
@media (max-width: 600px) {
    .footer-grid {
        grid-template-columns: 1fr; /* 1 cột trên Mobile */
        text-align: center;
    }
    .footer-col h3 { display: inline-block; }
    .social-links { justify-content: center; }
}

/* Header */
.site-header {
    background-color: #1e1e1e;
    padding: 15px 0;
    box-shadow: 0 2px 5px rgba(0,0,0,0.5);
    margin-bottom: 30px;
}
.site-header .container { 
    display: flex; 
    justify-content: space-between; 
    align-items: center;
}

/* Logo */
.logo-link {
    display: inline-flex;
    align-items: center;
    text-decoration: none;
    transition: transform 0.3s ease;
}
.logo-link:hover {
    transform: scale(1.05);
}
.logo-img {
    height: 60px;
    width: auto;
}

.logo {
    color: #00e676; /* Green accent / Màu xanh điểm nhấn */
    font-size: 28px;
    font-weight: 900;
    text-decoration: none;
    text-transform: uppercase;
    display: inline-block;
}

/* Header Navigation */
.header-nav {
    display: flex;
    gap: 20px;
    align-items: center;
}
.nav-link {
    color: #e0e0e0;
    text-decoration: none;
    font-weight: 500;
    padding: 8px 12px;
    border-radius: 4px;
    transition: background-color 0.3s;
}
.nav-link:hover {
    background-color: #333;
    color: #00e676;
}

/* Catalogs Dropdown */
.nav-catalogs {
    position: relative;
}
.catalogs-btn {
    background: none;
    border: none;
    color: #e0e0e0;
    font-size: 14px;
    font-weight: 500;
    padding: 8px 12px;
    cursor: pointer;
    border-radius: 4px;
    transition: background-color 0.3s;
}
.catalogs-btn:hover {
    background-color: #333;
    color: #00e676;
}
.catalogs-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    background: #252525;
    border: 1px solid #333;
    border-radius: 4px;
    min-width: 150px;
    display: none;
    flex-direction: column;
    box-shadow: 0 4px 6px rgba(0,0,0,0.3);
    z-index: 1000;
}
.nav-catalogs:hover .catalogs-dropdown {
    display: flex;
}
.catalog-link {
    padding: 10px 15px;
    color: #e0e0e0;
    text-decoration: none;
    border-bottom: 1px solid #333;
    transition: background-color 0.2s;
}
.catalog-link:last-child {
    border-bottom: none;
}
.catalog-link:hover {
    background-color: #333;
    color: #00e676;
}

/* Search in All Games */
.all-search { margin: 10px 0 20px; text-align: right; }
.all-search input[type="search"] {
    padding: 8px 12px;
    border-radius: 6px;
    border: 1px solid #333;
    background: #121212;
    color: #e0e0e0;
    width: 240px;
}

/* Catalog list (small cards) */
.catalog-section { margin-bottom: 36px; }
.catalog-box {
    background: #1e1e1e;
    border: 1px solid #333;
    border-radius: 8px;
    padding: 15px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.3);
}
.catalog-header {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 12px;
}
.catalog-list { 
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 12px;
}
.game-card.small { 
    width: 100%;
}
.more-btn { 
    color: #00e676; 
    text-decoration: none; 
    font-weight: 600;
    font-size: 14px;
}
/* Game Grid / Lưới game */
.game-grid {
    display: grid;
    /* Responsive columns / Cột tự động co giãn */
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 25px;
}

/* Game Card / Thẻ game */
.game-card {
    background: #252525;
    border-radius: 10px;
    overflow: hidden;
    transition: transform 0.3s ease;
    box-shadow: 0 4px 6px rgba(0,0,0,0.3);
}
.game-card:hover {
    transform: translateY(-5px); /* Hover effect / Hiệu ứng nổi lên khi di chuột */
}
.game-card a { text-decoration: none; color: inherit; }

.thumbnail {
    position: relative;
    overflow: hidden;
    width: 100%;
    aspect-ratio: 16 / 9; /* keeps thumbnails proportional to their width */
    background: #000;
}
.thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover; /* preserves aspect ratio and crops instead of stretching */
    display: block;
}

/* Slightly different aspect for small catalog cards so layout looks balanced */
.catalog-list .thumbnail { aspect-ratio: 4 / 3; }
.play-btn {
    position: absolute;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0,0,0,0.7);
    color: #fff;
    padding: 10px 15px;
    border-radius: 50%;
    opacity: 0;
    transition: opacity 0.3s;
}
.game-card:hover .play-btn { opacity: 1; }

.info { padding: 15px; }
.info h3 { margin: 0; font-size: 16px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Single Game Page / Trang chơi game */
.back-link {
    color: #00e676;
    text-decoration: none;
    font-weight: bold;
    display: inline-block;
    margin-bottom: 15px;
}
.iframe-container {
    background: #000;
    border: 4px solid #333;
    border-radius: 8px;
    overflow: hidden;
}
.game-desc {
    margin-top: 20px;
    background: #1e1e1e;
    padding: 20px;
    border-radius: 8px;
}

/* Responsive layout improvements for header, nav, catalogs and game grid */
@media (max-width: 1000px) {
    .container { padding: 0 16px; }
    .logo { font-size: 24px; }
    .logo-img { height: 48px; }
    .site-header .container { flex-direction: column; align-items: center; gap: 10px; }
    .header-nav { flex-wrap: wrap; justify-content: center; gap: 10px; }
    .nav-link { padding: 6px 10px; }
    .catalog-list { grid-template-columns: repeat(4, 1fr); }
}

@media (max-width: 768px) {
    .logo { font-size: 22px; }
    .logo-img { height: 46px; }
    .header-nav { gap: 8px; }
    .catalog-list { grid-template-columns: repeat(3, 1fr); }
    .game-grid { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }
    .all-search { text-align: center; }
    .all-search input[type="search"] { width: 180px; }
}

@media (max-width: 600px) {
    .site-header { padding: 12px 0; }
    .logo { font-size: 20px; }
    .logo span { color: var(--accent); }
    .header-nav { width: 100%; justify-content: center; }
    .catalog-list { grid-template-columns: repeat(2, 1fr); gap: 10px; }
    .catalog-box { padding: 12px; }
    .game-grid { grid-template-columns: 1fr; gap: 18px; }
    .thumbnail { height: 180px; }
    .footer-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 400px) {
    .logo { font-size: 18px; }
    .catalog-list { grid-template-columns: 1fr; }
    .footer-grid { grid-template-columns: 1fr; text-align: center; }
    .nav-link { font-size: 14px; padding: 6px 8px; }
}

/* Adjust aspect ratios on smaller screens so thumbnails remain proportional and balanced */
@media (max-width: 600px) {
    .thumbnail { aspect-ratio: 4 / 3; }
    .catalog-list .thumbnail { aspect-ratio: 1 / 1; }
}
@media (max-width: 400px) {
    .thumbnail { aspect-ratio: 1 / 1; }
    .catalog-list .thumbnail { aspect-ratio: 1 / 1; }
}