/* =========================================================
   Homepage
   ========================================================= */

.home-page {
    width: 100%;

    padding: 30px 20px 60px;
}


.home-content {
    width: 100%;
    max-width: 1400px;

    margin: 0 auto;
}


/* =========================================================
   Homepage sections
   ========================================================= */

.home-section {
    margin-bottom: 42px;
}


.home-section-title {
    margin: 0 0 16px;

    color: #ffffff;

    font-size: 1.6rem;
    font-weight: 700;
}


/* =========================================================
   Game grid
   ========================================================= */

.home-game-grid {
    display: grid;

    grid-template-columns:
        repeat(
            auto-fill,
            minmax(200px, 1fr)
        );

    gap: 18px;
}


/* =========================================================
   Game card
   ========================================================= */

.home-game-card {
    position: relative;

    display: block;

    aspect-ratio: 1 / 1;

    min-width: 0;

    overflow: hidden;

    border: 1px solid #333333;
    border-radius: 8px;

    color: #ffffff;
    background-color: #1a1a1a;

    text-decoration: none;

    transition:
        transform 0.15s ease,
        background-color 0.15s ease;
}


.home-game-card:hover {
    color: #ffffff;

    background-color: #222222;

    transform: translateY(-2px);
}


.home-game-card:focus-visible {
    outline: 2px solid #ffffff;
    outline-offset: 3px;
}


/* =========================================================
   Game image
   ========================================================= */

.home-game-image {
    display: block;

    width: 100%;
    height: 100%;

    object-fit: cover;

    background-color: #111111;
}

/* =========================================================
   Game information
   ========================================================= */

.home-game-info {
    padding: 12px;
}


.home-game-title {
    margin: 0;

    overflow: hidden;

    color: #ffffff;

    font-size: 1.05rem;
    font-weight: 600;

    white-space: nowrap;
    text-overflow: ellipsis;
}


.home-game-description {
    margin: 6px 0 0;

    display: -webkit-box;
    overflow: hidden;

    color: #999999;

    font-size: 0.85rem;
    line-height: 1.4;

    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
}

/* =========================================================
   Game description overlay
   ========================================================= */

.home-game-info {
    position: absolute;
    inset: auto 0 0 0;

    padding: 14px 12px;

    background: linear-gradient(
        transparent,
        rgba(0, 0, 0, 0.9)
    );

    transform: translateY(100%);

    transition: transform 0.2s ease;
}


.home-game-card:hover .home-game-info,
.home-game-card:focus-visible .home-game-info {
    transform: translateY(0);
}


.home-game-title {
    margin: 0 0 5px;

    color: #ffffff;

    font-size: 1.05rem;
    font-weight: 600;
}


.home-game-description {
    margin: 0;

    color: #dddddd;

    font-size: 0.85rem;
    line-height: 1.4;
}

/* =========================================================
   Mobile
   ========================================================= */

@media (max-width: 700px) {

    .home-page {
        padding: 24px 12px 50px;
    }


    .home-section {
        margin-bottom: 34px;
    }


    .home-section-title {
        font-size: 1.4rem;
    }


    .home-game-grid {
        grid-template-columns:
            repeat(
                auto-fill,
                minmax(150px, 1fr)
            );

        gap: 12px;
    }


    .home-game-info {
        padding: 10px;
    }


    .home-game-title {
        font-size: 0.95rem;
    }


    .home-game-description {
        font-size: 0.8rem;
    }

}


/* =========================================================
   Reduced motion
   ========================================================= */

@media (prefers-reduced-motion: reduce) {

    .home-game-card {
        transition: none;
    }

}
