* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html,
body {
    background: linear-gradient(to bottom, #141e30 0%, #243b55 50%, #2c3e50 100%);

    color: #fff;
    height: 100%;
    font-family: Arial, sans-serif;

}

li {
    list-style: none;
}

a {
    text-decoration: none;
    color: inherit;
    background-color: transparent;
    outline: none;
    cursor: pointer;
}

.lazy-img {
    width: 100%;
    height: 300px;
    /* background-color: #f0f0f0; */
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    color: #999;
}


.header-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 10px;
    justify-content: center;
}

.h_logo img {
    width: 40px;
    height: 40px;
}

.h_search {
    display: flex;
    width: 100%;
    max-width: 400px;
    margin: 10px auto 0;
}

.h_search_input {
    flex: 1;
    padding: 12px;
    border: none;
    border-radius: 4px 0 0 4px;
    color: #fff;
}

.h_search_btn {
    padding: 12px 15px;
    background-color: #ff6b00;
    color: white;
    border: none;
    border-radius: 0 4px 4px 0;
    cursor: pointer;
}

.h_btn_list {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    list-style: none;
    margin: 0 auto;
    padding: 10px;

}

.h_btn_list li {
    padding: 8px 12px;
    margin: 5px;
    background-color: linear-gradient(135deg, #0f0c29 0%, #302b63 50%, #24243e 100%);
    border-radius: 20px;
    cursor: pointer;
    font-size: 28px;
}

main {
    display: flex;
    flex-direction: column;
    padding: 10px;
    align-items: center;
    min-height: calc(100vh - 160px);
    width: 100%;
    /* max-width: 1200px; */
    margin: 0 auto;
}

.m_popular_games,
.m_new_games {
    width: 100%;
    /* margin-bottom: 30px; */
}

.m_popular_games_title,
.m_new_games h2 {
    text-align: left;
    width: 100%;
    padding-top: 5px;
    font-size: 24px;
    font-weight: bold;
    color: #fff;
}

.m_popular_games_content,
.m_new_games_content {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    width: 100%;
    /* gap: 20px; */
}

.m_popular_games_item,
.m_new_games_item {
    flex: 1 1 200px;
    min-width: 200px;
    max-width: 250px;
    margin: 10px;
    text-align: center;
    background-color: #fff;
    border-radius: 8px;
    overflow: hidden;
    transition: transform 0.3s ease;
}

.m_popular_games_item:hover,
.m_new_games_item:hover {
    transform: translateY(-5px);
}

.m_popular_games_item img,
.m_new_games_item img {
    width: 100%;
    height: auto;
    display: block;
}

.m_popular_games_item p,
.m_new_games_item p {
    /* padding: 20px; */
    font-size: 16px;
    color: #fff;
    color: #5f6368;
    font: 500 1.125rem / normal "Poppins", sans-serif;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

footer {
    /* max-width: 1200px; */
    width: 100%;
    margin: 0 auto;
    text-align: center;
    padding: 20px 10px;
    margin-top: auto;
    background-color: #1a1a1a;
}



.m_popular_games_content,
.m_new_games+.m_popular_games_content {
    display: flex;
    margin: 0 -5px;
    padding: 5px;
    box-sizing: border-box;
}

.m_popular_games_item {
    padding: 5px;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    justify-content: center;
    /* min-height: 220px; */
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
    border-radius: 8px;
    overflow: hidden;
}

.m_popular_games_item a {
    display: flex;
    flex-direction: column;
    height: 100%;
    width: 100%;
    justify-content: center;
    text-align: center;
    padding: 10px;
    text-decoration: none;
}

.m_popular_games_item img {
    max-height: 120px;
    object-fit: contain;
    margin: 0 auto 10px;
}

.m_popular_games_item p {
    margin: 0;
    color: white;
    font-size: 14px;
    line-height: 1.3;
    word-break: break-word;
}

@media screen and (min-width: 768px) {
    .header-content {
        flex-direction: row;
        justify-content: space-between;
        padding: 10px 20px;
        flex-wrap: nowrap;
    }

    .h_logo {
        margin-bottom: 0;
    }

    .h_search {
        width: auto;
        max-width: 400px;
        margin: 0 20px;
    }

    main {
        margin: 0 auto;
        flex-wrap: wrap;
        justify-content: space-between;
        padding: 20px;
    }

    .m_popular_games {
        flex: 2;
        min-width: 300px;
        margin-right: 20px;
    }

    .m_new_games {
        flex: 1;
        min-width: 250px;
    }



}

@media screen and (min-width: 1024px) {
    .header-content {
        padding: 10px 50px;
    }

    .h_btn_list {
        justify-content: center;
        padding: 10px 50px;
    }

    main {
        padding: 20px 50px;
    }

    .m_popular_games_content,
    .m_new_games_content {
        justify-content: flex-start;
    }
}

@media (min-width: 380px) and (max-width: 560px) {

    .m_popular_games_content,
    .m_new_games+.m_popular_games_content {
        flex-wrap: wrap !important;
        overflow-x: hidden !important;
        scroll-behavior: auto !important;
    }

    .m_popular_games_item,
    .m_new_games+.m_popular_games_content .m_popular_games_item {
        flex: 0 0 calc(50% - 10px) !important;
        max-width: calc(50% - 10px) !important;
        min-width: calc(50% - 10px) !important;
        margin: 5px !important;
    }

    .ad-container {
        flex: 0 0 100% !important;
        margin: 15px 0 !important;
    }

    .m_new_games+.m_popular_games_content::after {
        display: none !important;
    }
}