/* === TẬP TIN GIAO DIỆN CHUNG: css/style.css === */

/* --- Biến màu và font chữ toàn cục --- */
:root {
    --bg-color: #f0f9ff;
    --ground-color: #a7e0a7;
    --title-color: #ff6347;
    --primary-button-bg: #4CAF50;
    --secondary-button-bg: #2196F3;
    --shadow-color: rgba(0, 0, 0, 0.15);
    --header-bg: rgba(255, 255, 255, 0.8);
}

/* --- Định dạng cơ bản cho toàn trang --- */
body {
    font-family: 'Quicksand', sans-serif;
    background: linear-gradient(to bottom, var(--bg-color) 70%, var(--ground-color) 30%);
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
    padding-top: 80px; /* Khoảng trống cho menu cố định */
}

/* --- Menu điều hướng (Header) --- */
header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    background: var(--header-bg);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    box-shadow: 0 4px 6px var(--shadow-color);
    padding: 0.75rem 5%;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-family: 'Paytone One', sans-serif;
    font-size: 1.8rem;
    color: var(--title-color);
    text-decoration: none;
}

nav .nav-links {
    display: flex;
    align-items: center;
    gap: 1rem;
}

nav .nav-link {
    text-decoration: none;
    color: #333;
    font-weight: 700;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    transition: background-color 0.3s, color 0.3s;
}

nav .nav-link:hover {
    background-color: var(--secondary-button-bg);
    color: white;
}

.btn-login {
     background-color: var(--primary-button-bg);
     color: white !important;
}

.btn-login:hover {
    background-color: #45a049 !important;
}

/* --- Khu vực nội dung chính và chân trang --- */
main {
    padding: 2rem 1rem;
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    position: relative; /* Cần thiết cho các icon bay */
    z-index: 1;
}

footer {
    text-align: center;
    padding: 2rem 0 1rem 0;
    font-size: 0.8rem;
    color: rgba(0,0,0,0.5);
}

/* --- Định dạng chung cho các thẻ hiển thị (Game Card / Category Card) --- */
.game-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 2rem;
}

.game-card {
    background: #ffffff;
    border-radius: 1.5rem;
    border: 1px solid #e0e0e0;
    box-shadow: 0 10px 20px var(--shadow-color);
    text-align: center;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: flex;
    flex-direction: column;
    overflow: hidden; /* Chống tràn nội dung */
}

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

.game-thumbnail-wrapper {
    width: 100%;
    aspect-ratio: 16 / 10;
    background-color: #f0f0f0; /* Chuyển màu nền sang xám nhạt hơn */
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden; /* Đảm bảo ảnh không tràn ra ngoài */
}
/* === ĐÂY LÀ ĐOẠN MÃ ĐÃ ĐƯỢC SỬA === */
.game-thumbnail-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover; /* Giúp ảnh lấp đầy khung chứa mà không bị méo */
}

.game-card-content {
    padding: 1.5rem;
    background-color: #F1F8E9; /* Màu xanh lá cây nhạt cho thêm phần dễ thương */
    display: flex;
    flex-direction: column;
    flex-grow: 1; /* Giúp nội dung card luôn chiếm đầy đủ chiều cao */
    justify-content: space-between;
}

.game-title {
    font-family: 'Quicksand', sans-serif;
    font-weight: 700;
    font-size: 1.5rem;
    color: #333;
    margin-bottom: 0.5rem;
}

.game-description {
    font-size: 0.95rem;
    color: #666;
    margin-bottom: 1.5rem;
    flex-grow: 1;
}

.btn-play {
    font-family: 'Paytone One', sans-serif;
    background: var(--title-color);
    color: white;
    padding: 0.8rem 2rem;
    border-radius: 50px;
    text-decoration: none;
    display: inline-block;
    transition: background-color 0.3s, transform 0.2s;
}

.btn-play:hover {
    background-color: #e65a3f;
    transform: scale(1.05);
}


/* --- HIỆU ỨNG DỄ THƯƠNG: MÂY VÀ ICON BAY --- */
.cloud, .floating-item {
    position: absolute;
    z-index: -1;
    pointer-events: none; /* Đảm bảo không bấm vào được */
}

/* Đám mây */
.cloud {
    background: white;
    border-radius: 100px;
    filter: opacity(0.8);
}
.cloud:before, .cloud:after {
    content: '';
    position: absolute;
    background: white;
    width: 100px; height: 100px;
    border-radius: 50%;
    top: -50px; left: 10px;
}
.cloud:after {
    width: 120px; height: 120px;
    top: -55px; left: auto; right: 15px;
}
.c1 { transform: scale(0.6); top: 15%; left: 15%; animation: drift 25s linear infinite; }
.c2 { transform: scale(0.8); top: 20%; left: 70%; animation: drift 35s linear infinite; }
.c3 { transform: scale(0.5); top: 60%; left: 80%; animation: drift 30s linear infinite; }
.c4 { transform: scale(0.7); top: 70%; left: 5%; animation: drift 20s linear infinite; }

@keyframes drift {
    from { transform: translateX(-200px) scale(var(--scale)); }
    to { transform: translateX(calc(100vw + 200px)) scale(var(--scale)); }
}

/* Icon bay lơ lửng */
.floating-item {
    font-size: clamp(40px, 5vw, 50px);
    animation: float 6s ease-in-out infinite;
    text-shadow: 0 5px 15px rgba(0,0,0,0.1);
}
.item1 { top: 10%; left: 5%; animation-delay: -2s; animation-duration: 7s; }
.item2 { top: 30%; left: 90%; animation-delay: -5s; animation-duration: 6s; }
.item3 { top: 65%; left: 10%; animation-delay: 0s; animation-duration: 8s; }
.item4 { top: 85%; left: 85%; animation-delay: -8s; animation-duration: 5s; }

@keyframes float {
    0% { transform: translateY(0px) rotate(0deg); }
    50% { transform: translateY(-25px) rotate(15deg); }
    100% { transform: translateY(0px) rotate(0deg); }
}

/* --- Các tiêu đề trang --- */
.page-title, .section-title {
    font-family: 'Paytone One', sans-serif;
    color: #333;
    text-align: center;
    margin-bottom: 2rem;
}
.page-title { font-size: 3rem; text-shadow: 2px 2px 0px #fff; }
.section-title { font-size: 2.5rem; }
/* === BỔ SUNG: CSS CHO NÚT ĐIỀU KHIỂN NHẠC NỀN === */
.music-toggle-btn {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 1001;
    width: 50px;
    height: 50px;
    background-color: var(--title-color);
    color: white;
    border-radius: 50%;
    border: none;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: transform 0.2s ease-in-out, background-color 0.2s;
}

.music-toggle-btn:hover {
    transform: scale(1.1);
    background-color: #e65a3f;
}

.music-toggle-btn svg {
    width: 24px;
    height: 24px;
}