:root {
    --bg-dark: #0b0c15;
    --card-bg: #1e293b;
    --primary-color: #6366f1;
    --secondary-color: #a78bfa;
    --text-light: #f1f5f9;
    --text-muted: #94a3b8;
    --border-color: #334155;
    --slate-600: #475569;
    --slate-700: #334155;
    --slate-800: #1e293b;
    --yellow-400: #facc15;
    --green-400: #4ade80;
    --white: #ffffff;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: 'Inter', system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial;
    background-color: var(--bg-dark);
    color: var(--text-light);
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    /* padding: 16px; */
}


body,
html {
    overflow-x: hidden;
    max-width: 100%;
}

/* @media (min-width: 768px) {
    body {
        padding: 32px;
    }
} */

.main-wrapper {
    max-width: 1280px;
    margin: 0 auto;
    padding: 16px;
}

@media (min-width: 768px) {
    .main-wrapper {
        padding: 32px;
    }
}

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

.header-section>.header-title {
    font-size: 30px;
    font-weight: 900;
    letter-spacing: 0.5px;
    margin: 0;
    color: var(--white);
}

.grid-layout {
    display: grid;
    grid-template-columns: 1fr;
    gap: 32px;
}

@media (min-width: 1024px) {
    .grid-layout {
        grid-template-columns: 3fr 1fr;
    }
}

.left-section {
    display: flex;
    flex-direction: column;
    gap: 32px;
}

.right-section {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.media-viewer {
    position: relative;
    width: 100%;
    padding-top: 56.25%;
    border-radius: 12px;
    overflow: hidden;
    background-color: var(--card-bg);
}

.media-viewer>iframe,
.media-viewer>img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    border: 0;
}

.gallery-container {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    justify-content: flex-start;
    overflow-x: auto;
    padding-bottom: 8px;
}

.gallery-container>.thumbnail-item {
    cursor: pointer;
    transition: border-color 0.2s, opacity 0.2s, transform 0.12s;
    border: 3px solid transparent;
    opacity: 0.7;
    border-radius: 8px;
    flex: 0 0 auto;
    display: inline-block;
}

.thumbnail-item>img {
    display: block;
    width: 112px;
    height: 64px;
    object-fit: cover;
    border-radius: 6px;
}

@media (min-width: 768px) {
    .thumbnail-item>img {
        width: 160px;
        height: 96px;
    }
}

@media (max-width: 767px) {
    .gallery-container {
        overflow-x: hidden;
    }

    .thumbnail-item>img {
        width: 100%;
        height: auto;
    }

    .gallery-container>.thumbnail-item {
        width: calc((100% - 32px) / 3);
    }
}



.gallery-container>.thumbnail-item:hover {
    transform: translateY(-2px);
    opacity: 1;
}

.gallery-container>.thumbnail-item.active {
    border-color: var(--primary-color);
    opacity: 1;
}

.card {
    background-color: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 16px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.08);
}

.card>.tab-header {
    display: flex;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 16px;
}

.tab-header>.tab-button {
    background: transparent;
    border: none;
    padding: 12px 16px;
    cursor: pointer;
    color: var(--text-muted);
    font-size: 14px;
    transition: color 0.15s, border-bottom-color 0.15s;
    border-bottom: 3px solid transparent;
    margin: 0;
}

@media (min-width: 768px) {
    .tab-header>.tab-button {
        font-size: 16px;
        padding: 12px 12px;
    }
}

.tab-header>.tab-button:hover {
    color: var(--text-light);
}

.tab-header>.tab-button.active {
    color: var(--primary-color);
    font-weight: 600;
    border-bottom-color: var(--primary-color);
}

.card>#tabContent>.tab-content {
    display: none;
    gap: 24px;
    flex-direction: column;
}

.card>#tabContent>.tab-content.active {
    display: flex;
}

.tab-content>div>.section-title {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 12px;
}

.tab-content>div>.section-subtitle {
    font-size: 18px;
    font-weight: 700;
    margin-top: 16px;
    margin-bottom: 8px;
}

.tab-content>div>.description-text {
    color: var(--text-muted);
    line-height: 1.6;
}

.tab-content>div>.feature-list {
    list-style: disc;
    list-style-position: inside;
    gap: 4px;
    margin-left: 16px;
    color: var(--text-muted);
}

.feature-list>li {
    margin-bottom: 4px;
}

.tab-content>div>.config-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 24px;
}

@media (min-width: 768px) {
    .tab-content>div>.config-grid {
        grid-template-columns: 1fr 1fr;
    }
}

.config-grid>.config-box {
    padding: 16px;
    background-color: #334155;
    border-radius: 8px;
}

.config-box>.config-title {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 8px;
}

.config-box>.config-item {
    font-size: 14px;
    margin-bottom: 4px;
    color: var(--text-muted);
}

.config-item>.config-label {
    font-weight: 600;
}

.tab-content>div>.rating-container {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 24px;
}

.rating-container>.rating-number {
    font-size: 48px;
    font-weight: 900;
    color: var(--primary-color);
}

.rating-container>div>.rating-stars {
    display: flex;
    gap: 4px;
    color: var(--yellow-400);
    font-size: 24px;
    margin-bottom: 4px;
}

.rating-container>div>.rating-text {
    font-size: 14px;
    color: var(--text-muted);
}

.tab-content>.review-section {
    margin-top: 32px;
    padding-top: 16px;
    border-top: 1px solid var(--border-color);
}

.review-section>.section-subtitle {
    font-size: 18px;
    font-weight: 700;
    margin-top: 16px;
    margin-bottom: 8px;
}

.review-section>textarea {
    width: 100%;
    background-color: #0f172a;
    border: 1px solid var(--border-color);
    padding: 12px;
    border-radius: 8px;
    color: var(--text-light);
    resize: vertical;
    font-family: 'Inter', sans-serif;
    margin-bottom: 8px;
}

.review-section>.btn-primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: none;
    color: white;
    padding: 12px 16px;
    border-radius: 10px;
    font-weight: 700;
    background-image: linear-gradient(90deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    transition: transform 0.18s, opacity 0.12s;
}

.btn-primary:hover {
    transform: translateY(-1px);
    opacity: 0.95;
}

/* Thay thế các button lồng nhau trong review-section bằng selector cụ thể nếu có, 
    nhưng trong mã HTML gốc không có button nào khác ngoài .btn-primary trong .review-section */

.tab-content>div>.discussion-box {
    margin-top: 16px;
    padding: 16px;
    background-color: var(--slate-800);
    border-radius: 8px;
}

.discussion-box>.discussion-title {
    font-weight: 600;
    margin-bottom: 8px;
}

.discussion-box>.discussion-list {
    list-style: disc;
    list-style-position: inside;
    margin-left: 16px;
    color: var(--primary-color);
}

.discussion-list>li {
    margin-bottom: 4px;
}

.discussion-list>li>a {
    color: var(--primary-color);
    text-decoration: none;
}

.discussion-list>li>a:hover {
    text-decoration: underline;
}

.sidebar-card {
    background-color: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.sidebar-card>div>.sidebar-title {
    font-size: 24px;
    font-weight: 700;
}

.sidebar-card>div>.sidebar-subtitle {
    font-size: 14px;
    color: var(--text-muted);
}

.sidebar-card>.sidebar-button {
    width: 100%;
    padding: 12px 16px;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.sidebar-card>.sidebar-button.primary {
    background-image: linear-gradient(90deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: white;
    font-size: 16px;
    padding: 16px;
}

.sidebar-card>.sidebar-button.primary:hover {
    opacity: 0.95;
    transform: translateY(-1px);
}

.sidebar-card>.sidebar-button.secondary {
    background-color: var(--slate-700);
    color: white;
}

.sidebar-card>.sidebar-button.secondary:hover {
    background-color: var(--slate-600);
}

.sidebar-card>.details-header {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border-color);
}

.sidebar-card>.detail-row {
    display: flex;
    justify-content: space-between;
    font-size: 14px;
    margin-bottom: 12px;
}

.detail-row>.detail-label {
    color: var(--text-muted);
}

.detail-row>.detail-value {
    font-weight: 700;
}

.detail-row>.detail-value.success {
    color: var(--green-400);
}

.hidden {
    display: none !important;
}

.yellow-text {
    color: var(--yellow-400);
}

.green-text {
    color: var(--green-400);
}

.small-text {
    font-size: 12px;
}

.download-btn {
    height: 45px;
    width: 100%;
    cursor: pointer;
    background: white;
    border: none;
    background: #8080ff;
    border-radius: 10px;
    overflow: hidden;
}

.button-content {
    transform: translateY(-45px);
    transition: all 250ms ease-in-out;
}

.svg-container,
.text-container {
    height: 45px;
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
}

.text-container .text {
    font-size: 13px;
    color: #fff;
    font-weight: 600;
    opacity: 1;
    transition: opacity ease-in-out 250ms;
}

.download-icon {
    height: 25px;
    width: 25px;
    fill: #fff;
    opacity: 0;
    transition: opacity ease-in-out 250ms;
}

.download-btn:hover .button-content {
    transform: translateY(0px);
}

.download-btn:hover .text {
    opacity: 0;
}

.download-btn:hover .download-icon {
    opacity: 1;
}

.download-btn:focus .download-icon {
    -webkit-animation: heartbeat 1.5s ease-in-out infinite both;
    animation: heartbeat 1.5s ease-in-out infinite both;
}

/* ======================================= */
/* Khắc phục lỗi bố cục cho Game Liên Quan */
/* ======================================= */
/* ======================================= */
/* Khắc phục lỗi bố cục cho Game Liên Quan */
/* ======================================= */
.related-games-section {
    margin-top: 40px;
    padding-top: 20px;
    border-top: 1px solid var(--border-color);
    /* Sử dụng biến thay vì hardcode */
}

.related-games-section .section-title {
    font-size: 1.5rem;
    /* Điều chỉnh kích thước */
    color: var(--text-light);
    margin-bottom: 20px;
    font-weight: 700;
}

/* 🎯 QUAN TRỌNG: Định nghĩa style cho game-card trong gameID.html */
/* Dựa trên style game-card từ game.css */
#related-games-list {
    display: grid;
    /* 2 cột trên màn hình lớn */
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
    width: 100%;
}

/* Kiểu dáng cơ bản của thẻ game */
#related-games-list .game-card {
    background-color: var(--slate-800);
    /* Dùng biến */
    border-radius: 0.75rem;
    overflow: hidden;
    border: 1px solid var(--border-color);
    /* Dùng biến */
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: column;
    height: 100%;
    transition: transform 0.3s, border-color 0.3s;
    cursor: pointer;
    text-decoration: none;
    /* Đảm bảo không có gạch chân nếu dùng thẻ <a> */
    color: var(--text-light);
}

#related-games-list .game-card:hover {
    border-color: var(--primary-color);
    transform: translateY(-2px);
}

/* Ảnh game */
#related-games-list .game-card .game-image {
    height: 8rem;
    /* Chiều cao ảnh thấp hơn */
    overflow: hidden;
}

#related-games-list .game-card .game-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: top;
    display: block;
}

/* Nội dung */
#related-games-list .game-card .game-content {
    padding: 0.8rem;
    /* Giảm padding */
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

#related-games-list .game-card .game-title {
    font-weight: 700;
    font-size: 1rem;
    /* Giảm kích thước chữ */
    margin-bottom: 0.25rem;
    /* Đảm bảo chữ không bị tràn */
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

#related-games-list .game-card .game-category {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
}

#related-games-list .game-card .game-rating {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--yellow-400);
    /* Màu vàng */
    display: flex;
    align-items: center;
    margin-bottom: 0.8rem;
}

#related-games-list .game-card .game-rating i {
    margin-right: 0.25rem;
}

/* Nút Tải */
#related-games-list .game-card .btn-download {
    width: 100%;
    padding: 0.5rem;
    border-radius: 0.5rem;
    background: linear-gradient(90deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: var(--white);
    border: none;
    font-size: 0.75rem;
    /* Giảm kích thước chữ */
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

#related-games-list .game-card .btn-download:hover {
    opacity: 0.9;
    transform: translateY(-1px);
}

/* Media query cho mobile */
@media (max-width: 768px) {
    #related-games-list {
        grid-template-columns: 1fr;
        /* 1 cột trên mobile */
    }

    #related-games-list .game-card .game-image {
        height: 10rem;
    }
}


/* ======================================= */
/* Khắc phục lỗi bố cục cho Game Liên Quan */
/* ======================================= */
.related-games-section {
    margin-top: 40px;
    padding-top: 20px;
    border-top: 1px solid var(--border-color);
    /* Dùng biến CSS */
}

.related-games-section .section-title {
    font-size: 1.8em;
    color: var(--text-light);
    /* Dùng biến CSS */
    margin-bottom: 20px;
    font-weight: bold;
}

/* 🎯 QUAN TRỌNG: GHI ĐÈ BỐ CỤC LƯỚI CHO GAME LIÊN QUAN TRONG gameID */
/* Mục tiêu là game-grid trong left-section phải là 2 cột */
.left-section>.related-games-section>.game-grid {
    display: grid;
    /* Định nghĩa 2 cột cho game liên quan trong cột trái (left-section) */
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
    width: 100%;
    /* Đảm bảo game-card kế thừa style chung nhưng được định vị lại */
}

/* Ghi đè kích thước ảnh cho Game Card liên quan để phù hợp 2 cột */
.left-section>.related-games-section .game-card .game-image {
    height: 8rem;
    /* Giảm chiều cao ảnh cho các card nhỏ hơn */
}

/* Các tùy chỉnh font/padding nhỏ hơn nếu cần (dùng class từ game.css) */
.left-section>.related-games-section .game-card .game-title {
    font-size: 1rem;
}

.left-section>.related-games-section .game-card .game-category {
    margin-bottom: 0.5rem;
}

.left-section>.related-games-section .game-card .btn-download {
    padding: 0.4rem;
    font-size: 0.8rem;
}


/* Media query cho màn hình nhỏ (như điện thoại) */
@media (max-width: 768px) {

    /* Trở về 1 cột trên mobile */
    .left-section>.related-games-section>.game-grid {
        grid-template-columns: 1fr;
    }
}

.star-rating {
    display: inline-block;
    direction: rtl;
    /* Đảo ngược thứ tự để 5 sao ở bên trái */
}

.star-rating input[type="radio"] {
    display: none;
}

.star-rating label {
    font-size: 25px;
    /* Kích thước sao */
    color: #ddd;
    /* Màu mặc định */
    cursor: pointer;
    padding: 0 2px;
    transition: color 0.2s;
}

.star-rating input[type="radio"]:checked~label,
.star-rating label:hover,
.star-rating label:hover~label {
    color: gold;
    /* Màu khi được chọn/hover */
}

.review-section textarea {
    width: 100%;
    padding: 10px;
    margin-bottom: 10px;
    border: 1px solid #ccc;
    border-radius: 4px;
    box-sizing: border-box;
    resize: vertical;
}

.star-rating {
    display: inline-block;
    direction: rtl;
}

.star-rating input[type="radio"] {
    display: none;
}

.star Groupe-rating label {
    font-size: 25px;
    color: #ddd;
    cursor: pointer;
    padding: 0 2px;
    transition: color 0.2s;
}

.star-rating input[type="radio"]:checked~label,
.star-rating label:hover,
.star-rating label:hover~label {
    color: gold;
}

.review-section textarea {
    width: 100%;
    padding: 10px;
    margin-bottom: 10px;
    border: 1px solid #ccc;
    border-radius: 4px;
    box-sizing: border-box;
    resize: vertical;
}
