/* ===========================
   RESET & GLOBAL
=========================== */

*,
*::before,
*::after {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    padding: 0;
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
    /* tránh tràn ngang */
}

body {
    font-family: "Alumni+Sans", system-ui, sans-serif;
    background-color: #1a1a1a;
    color: #ffffff;
}

/* ===========================
   PAGE LAYOUT
=========================== */

.page {
    min-height: 100vh;
    background-color: #1a1a1a;
    display: flex;
    flex-direction: column;
}

.page-inner {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 20px 16px;
}

@media (min-width: 640px) {
    .page-inner {
        padding-inline: 40px;
    }
}

@media (min-width: 768px) {
    .page-inner {
        padding-inline: 80px;
    }
}

@media (min-width: 1024px) {
    .page-inner {
        padding-inline: 160px;
    }
}

/* ===========================
   MAIN
=========================== */

.main {
    margin-top: 20px;
    display: flex;
    flex-direction: column;
    gap: 40px;
}

/* ===========================
   HERO
=========================== */

.hero-section {
    width: 100%;
}

.hero {
    width: 100%;
}

/* Khung chứa ảnh */
.hero-image-wrapper {
    position: relative;
    width: 100%;
    max-height: 600px;
    overflow: hidden;
    border-radius: 12px;
}

/* Ảnh nền – hiển thị toàn bộ, hơi blur nhẹ */
.hero-image {
    width: 100%;
    height: auto;
    display: block;
    object-fit: contain;
    filter: blur(3px);
}

/* Lớp gradient phủ lên ảnh */
.hero-gradient {
    position: absolute;
    inset: 0;
    background: linear-gradient(rgba(16, 22, 34, 0.5),
            rgba(16, 22, 34, 0.9));
}

/* Text nằm trên ảnh */
.hero-text {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 24px 16px;
    gap: 16px;
}

.hero-title {
    font-size: 2rem;
    font-weight: 900;
    line-height: 1.2;
    letter-spacing: -0.033em;
    color: #ffffff;
}

.hero-subtitle {
    font-size: 0.875rem;
    font-weight: 400;
    color: rgba(255, 255, 255, 0.9);
    max-width: 640px;
}

/* Mobile cực nhỏ */
@media (max-width: 370px) {
    .hero-title {
        font-size: 1.5rem;
    }
}

/* >= 480px: text lớn hơn */
@media (min-width: 480px) {
    .hero-title {
        font-size: 2.4rem;
    }

    .hero-subtitle {
        font-size: 0.95rem;
    }
}

/* >= 768px: hero rộng, chữ to */
@media (min-width: 768px) {
    .hero-title {
        font-size: 3rem;
    }

    .hero-subtitle {
        font-size: 1rem;
    }
}

/* ===========================
   LIBRARY SECTION
=========================== */

.library-section {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.section-title {
    font-size: 1.5rem;
    font-weight: 700;
    padding: 20px 4px 12px;
    color: #fff;
}

/* ===========================
   CHIPS FILTER
=========================== */

.chips {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    padding: 0 4px 8px;
}

.chip {
    height: 32px;
    padding-inline: 16px;
    border-radius: 999px;
    font-size: 0.875rem;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background-color: #222f49;
    color: rgba(255, 255, 255, 0.8);
    border: none;
    cursor: pointer;
    transition: background-color 0.2s ease, color 0.2s ease;
}

.chip--active {
    background-color: #256af4;
    color: #ffffff;
}

.chip:not(.chip--active):hover {
    background-color: #314266;
}

/* ===========================
   GAME GRID
=========================== */

.game-grid {
    padding: 16px 4px 32px;
    display: grid;
    grid-template-columns: repeat(1, minmax(0, 1fr));
    gap: 24px;
}

@media (min-width: 640px) {
    .game-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (min-width: 768px) {
    .game-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (min-width: 1024px) {
    .game-grid {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
}

/* ===========================
   GAME CARD
=========================== */

.game-card {
    position: relative;
    overflow: hidden;
    border-radius: 12px;
}

/* Ảnh nền của card (dùng background-image inline) */
.card-image {
    position: relative;
    aspect-ratio: 3 / 4;
    background-size: cover;
    background-position: center;
    border-radius: 12px;
    padding: 16px;
    display: flex;
    align-items: flex-end;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.card-title-wrap {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.card-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: #fff;
}

.platforms {
    display: flex;
    align-items: center;
    gap: 8px;
    color: rgba(255, 255, 255, 0.7);
}

.platform-icon {
    font-size: 1rem;
}

/* Overlay trên card khi hover */
.card-overlay {
    position: absolute;
    inset: 0;
    padding: 16px;
    border-radius: 12px;
    background-color: rgba(0, 0, 0, 0.5);
    opacity: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    text-align: center;
    transition: opacity 0.3s ease;
}

.card-overlay a {
    text-decoration: none;
    color: #fff;
}

.card-desc {
    font-size: 0.875rem;
    color: rgba(255, 255, 255, 0.9);
}

/* Hover effect */
.game-card:hover .card-image {
    transform: scale(1.05);
    box-shadow:
        0 10px 15px -3px rgba(37, 106, 244, 0.2),
        0 4px 6px -2px rgba(37, 106, 244, 0.1);
}

.game-card:hover .card-overlay {
    opacity: 1;
}

/* ===========================
   BUTTONS
=========================== */

.btn {
    min-width: 84px;
    padding: 0 16px;
    height: 40px;
    border-radius: 8px;
    font-size: 0.875rem;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    white-space: nowrap;
    border: none;
    cursor: pointer;
}

.btn-primary {
    background-color: #256af4;
    color: #ffffff;
    transition: background-color 0.2s ease;
}

.btn-primary:hover {
    background-color: rgba(37, 106, 244, 0.9);
}

.btn-icon {
    height: 40px;
    padding-inline: 16px;
}

/* ===========================
   REVEAL ANIMATION
   (giống trang giới thiệu)
=========================== */

.reveal,
.reveal--zoom {
    opacity: 0;
    will-change: opacity, transform;
    transition:
        opacity 0.7s cubic-bezier(.15, .75, .35, 1),
        transform 0.7s cubic-bezier(.15, .75, .35, 1);
}

.reveal {
    transform: translateY(32px);
}

.reveal--zoom {
    transform: scale(0.94);
}

.reveal.is-visible,
.reveal--zoom.is-visible {
    opacity: 1;
    transform: none;
}