:root {
    --primary-color: #0f7ad4;
    --secondary-color: #ff6b6b;
    --background-color: #f0f2f5;
    --text-color: #333;
    --box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    margin: 0;
    padding: 0;
    background-color: var(--background-color);
    color: var(--text-color);
}

header, .description {
    background-color: #ffffff;
    padding: 1rem;
    box-shadow: var(--box-shadow);
}

header h1 {
    margin: 0;
    font-size: 1.8rem;
    color: var(--primary-color);
}

.description {
    margin-top: 1rem;
    text-align: center;
}

main {
    max-width: 1200px;
    margin: 2rem auto;
    padding: 0 1rem;
}

.game-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 1.5rem;
}

.game-card {
    background-color: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: flex;
    flex-direction: column;
    height: 350px; /* Chiều cao cố định cho mỗi card */
}

.game-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 6px 15px rgba(0,0,0,0.15);
}

.game-card img {
    width: 100%;
    height: 180px;
    object-fit: cover;
    object-position: center;
    flex-shrink: 0;
}

.game-info {
    padding: 1rem;
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden; /* Ngăn nội dung tràn ra */
}

.game-card h3 {
    margin: 0 0 0.5rem;
    font-size: 1.1rem;
    color: var(--text-color);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis; /* Hiển thị ... khi text quá dài */
}

.game-card p {
    margin: 0 0 1rem;
    font-size: 0.9rem;
    color: #666;
    display: -webkit-box;
    -webkit-line-clamp: 2; /* Giới hạn 2 dòng cho phần mô tả */
    -webkit-box-orient: vertical;
    overflow: hidden;
    flex: 1;
}

.play-button {
    display: block;
    background-color: var(--secondary-color);
    color: white;
    text-align: center;
    padding: 0.7rem;
    text-decoration: none;
    font-weight: bold;
    border-radius: 6px;
    transition: background-color 0.3s ease;
    margin-top: auto; /* Đẩy nút xuống cuối card */
}

.play-button:hover {
    background-color: #ff4757;
}

footer {
    background-color: #333;
    color: #fff;
    padding: 2rem 0;
    margin-top: 2rem;
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 1rem;
}

.footer-links a {
    color: #fff;
    text-decoration: none;
    margin-right: 1rem;
}

.footer-links a:hover {
    text-decoration: underline;
}

.header-content {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo-container {
    flex-shrink: 0;
}

.logo img {
    max-height: 50px;
    width: auto;
}

.main-nav ul {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
}

.main-nav li {
    margin-left: 20px;
}

.main-nav a {
    text-decoration: none;
    color: var(--text-color);
    font-weight: bold;
    transition: color 0.3s ease;
}

.main-nav a:hover {
    color: var(--primary-color);
}

@media (max-width: 768px) {
    .header-content {
        flex-direction: column;
    }
    
    .main-nav {
        margin-top: 1rem;
    }
    
    .main-nav ul {
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .main-nav li {
        margin: 5px 10px;
    }
}
:root {
    --primary-color: #4a90e2;
    --secondary-color: #f39c12;
    --background-color: #f4f4f4;
    --text-color: #333;
    --border-radius: 8px;
    --box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    margin: 0;
    padding: 0;
    background-color: var(--background-color);
    color: var(--text-color);
    line-height: 1.6;
}

header {
    background-color: #ffffff;
    padding: 1rem;
    box-shadow: var(--box-shadow);
    text-align: center;
}

header h1 {
    margin: 0;
    font-size: 1.8rem;
    color: var(--primary-color);
}

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

.content-wrapper {
    display: flex;
    gap: 30px;
}

.game-and-info {
    flex: 1;
}

.game-container {
    margin-bottom: 20px;
}

.game-wrapper {
    width: 100%;
    padding-bottom: 75%; /* 4:3 Aspect Ratio */
    position: relative;
}

.game-frame {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: #000;
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: var(--box-shadow);
}

.ad-container {
    background-color: #fff;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    display: flex;
    justify-content: center;
    align-items: center;
    font-weight: bold;
    color: #888;
    margin: 20px auto;
    overflow: hidden;
    max-width: 100%;
}

.ad-container[data-ad-slot="ad-slot-728x90"] {
    width: 728px;
    height: 90px;
}

.ad-container[data-ad-slot="ad-slot-970x250"] {
    width: 970px;
    height: 250px;
}

.ad-container[data-ad-slot="ad-slot-300x250"] {
    width: 300px;
    height: 250px;
}

@media (max-width: 768px) {
    .ad-container[data-ad-slot="ad-slot-728x90"],
    .ad-container[data-ad-slot="ad-slot-970x250"] {
        height: auto;
        aspect-ratio: 728 / 90;
    }
}

.game-info {
    background-color: white;
    padding: 10px;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
}

.game-info h2 {
    color: var(--primary-color);
    margin-top: 0;
}

.sidebar {
    width: 300px;
    flex-shrink: 0;
}

.other-games {
    background-color: white;
    padding: 20px;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
}

.other-games h3 {
    color: var(--secondary-color);
    margin-top: 0;
}

.other-games ul {
    list-style-type: none;
    padding: 0;
}

.other-games li {
    padding: 10px 0;
    border-bottom: 1px solid #eee;
    transition: all 0.3s ease;
}

.other-games li:last-child {
    border-bottom: none;
}

.other-games li:hover {
    padding-left: 5px;
    color: var(--primary-color);
}

@media (max-width: 1024px) {
    .content-wrapper {
        flex-direction: column;
    }
    .sidebar {
        width: 100%;
    }
}

/*logo*/
.logo {
    display: flex;
    align-items: center;
    text-decoration: none;
    color: #333;
    font-size: 24px;
    font-weight: bold;
}

.logo i {
    margin-right: 10px;
    color: #4a90e2;
    font-size: 28px;
}

.logo span {
    color: #333;
}

.logo:hover {
    opacity: 0.8;
}

.logo:hover i {
    transform: rotate(15deg);
    transition: transform 0.3s ease;
}
/* gamesinffo */
.game-info {
    padding: 20px;
}

.game-info h2 {
    color: #333;
    margin-bottom: 20px;
    font-size: 24px;
}

.game-description {
    margin-bottom: 25px;
    line-height: 1.6;
    color: #444;
}

.game-features {
    margin-bottom: 25px;
    background: #f5f5f5;
    padding: 15px 20px;
    border-radius: 8px;
}

.game-features p {
    margin-bottom: 10px;
    font-weight: bold;
}

.game-features ul {
    list-style-type: none;
    padding-left: 15px;
}

.game-features li {
    margin-bottom: 8px;
    position: relative;
    padding-left: 15px;
}

.game-features li:before {
    content: "•";
    color: #2196F3;
    position: absolute;
    left: 0;
}

.game-info h3 {
    color: #333;
    margin: 2px 0 2px;
    font-size: 20px;
}

.game-controls {
    background: #f5f5f5;
    padding: 15px;
    border-radius: 8px;
    margin-top: 10px;
}
.game-container {
    position: relative;
    margin-bottom: 20px;
}

.game-wrapper {
    width: 100%;
    padding-bottom: 75%; /* 4:3 Aspect Ratio */
    position: relative;
    background-color: #000;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.game-frame {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
}

.fullscreen-controls {
    margin-top: 10px;
    text-align: right;
}

.fullscreen-button {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background-color: #4a90e2;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-family: Arial, sans-serif;
    font-size: 14px;
    transition: all 0.3s ease;
}

.fullscreen-button:hover {
    background-color: #357abd;
    transform: translateY(-2px);
}

.fullscreen-button i {
    font-size: 16px;
}

/* Fullscreen styles */
.game-wrapper:-webkit-full-screen,
.game-wrapper:-moz-full-screen,
.game-wrapper:-ms-fullscreen,
.game-wrapper:fullscreen {
    padding-bottom: 0;
    width: 100vw !important;  /* Chiều rộng của viewport */
    height: 100vh !important; /* Chiều cao của viewport */
    display: flex;
    justify-content: center;
    align-items: center;
}

.game-wrapper:-webkit-full-screen .game-frame,
.game-wrapper:-moz-full-screen .game-frame,
.game-wrapper:-ms-fullscreen .game-frame,
.game-wrapper:fullscreen .game-frame {
    /* Sửa kích thước để giữ tỷ lệ và không bị overflow */
    position: absolute;
    width: auto !important;       /* Để tự động điều chỉnh theo tỷ lệ */
    height: 100vh !important;     /* Chiều cao tối đa */
    max-width: 100vw;            /* Không vượt quá chiều rộng màn hình */
    max-height: 100vh;           /* Không vượt quá chiều cao màn hình */
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%); /* Căn giữa chính xác */
    margin: 0;
}
@media (orientation: portrait) {
    .game-wrapper:fullscreen .game-frame {
        width: 100vw !important;  /* Ưu tiên chiều rộng khi màn hình dọc */
        height: auto !important;
    }
}

@media (orientation: landscape) {
    .game-wrapper:fullscreen .game-frame {
        width: 100% !important;   /* Ưu tiên chiều cao khi màn hình ngang */
        height: 100vh !important;
    }
}