/* ==========================================================================
   freegame7 — games catalog page (/games)
   ========================================================================== */

.games-page {
    max-width: var(--container);
    margin: 0 auto;
    padding: var(--page-offset) var(--page-gutter) 50px;
    min-height: 100vh;
}

.games-nav {
    margin-bottom: 40px;
}

.games-nav__list {
    display: flex;
    align-items: center;
    gap: 40px;
    overflow-x: auto;
    -webkit-mask-image: linear-gradient(90deg, #000 90%, transparent);
    mask-image: linear-gradient(90deg, #000 90%, transparent);
    padding-bottom: 4px;
}

.games-nav__list::-webkit-scrollbar {
    display: none;
}

.games-nav__item {
    flex-shrink: 0;
    border: 1px solid rgba(0, 0, 0, 0.2);
    border-radius: 12px;
    background: transparent;
    color: #000;
    font-size: 18px;
    font-weight: 400;
    line-height: 40px;
    height: 40px;
    padding: 0 28px;
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.2s, border-color 0.2s, color 0.2s;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-family: inherit;
}

.games-nav__item.is-active {
    background: var(--color-primary);
    border-color: var(--color-primary);
    color: #fff;
}

.games-hero {
    display: flex;
    align-items: center;
    gap: 60px;
    padding: 30px;
    border-radius: 20px;
    background: #ff81c6;
}

.games-hero__search {
    width: 300px;
    flex-shrink: 0;
}

.games-hero__input-wrap {
    position: relative;
    display: flex;
    align-items: center;
    height: 46px;
    padding: 5px;
    border-radius: 46px;
    background: #fff;
}

.games-hero__input-wrap input {
    flex: 1;
    min-width: 0;
    height: 100%;
    border: none;
    outline: none;
    background: transparent;
    padding: 0 10px;
    font-size: 16px;
    color: #000;
}

.games-hero__input-wrap input::placeholder {
    color: rgba(0, 0, 0, 0.4);
}

.games-hero__search-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border: none;
    border-radius: 50%;
    background: var(--color-primary);
    color: #fff;
    cursor: pointer;
    flex-shrink: 0;
}

.games-hero__search-btn svg {
    width: 18px;
    height: 18px;
}

.games-hero__input-wrap .search-panel {
    top: calc(100% + 8px);
    left: 0;
    right: 0;
}

.games-hero__hot {
    display: flex;
    flex-wrap: wrap;
    gap: 10px 12px;
    margin-top: 15px;
    max-height: 70px;
    overflow: hidden;
}

.games-hero__hot-tag {
    padding: 0 20px;
    border-radius: 30px;
    background: rgba(255, 255, 255, 0.2);
    color: #fff;
    font-size: 16px;
    line-height: 30px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
    cursor: pointer;
    transition: opacity 0.2s;
}

.games-hero__hot-tag:hover {
    opacity: 0.85;
    color: #fff;
}

.games-hero__carousel {
    display: flex;
    align-items: center;
    flex: 1;
    min-width: 0;
    gap: 20px;
}

.games-hero__track-wrap {
    flex: 1;
    min-width: 0;
    overflow: hidden;
}

.games-hero__track {
    display: flex;
    gap: 24px;
    transition: transform 0.4s ease;
}

.games-hero__card {
    flex-shrink: 0;
    width: calc(12.5% - 21px);
    min-width: 72px;
    color: #fff;
    text-align: center;
}

.games-hero__card:hover {
    color: #fff;
}

.games-hero__card:hover .games-hero__card-img {
    transform: scale(1.12);
}

.games-hero__card-img {
    aspect-ratio: 1 / 1;
    width: 100%;
    border-radius: 16px;
    object-fit: cover;
    transition: transform 0.3s;
    background: rgba(255, 255, 255, 0.15);
}

.games-hero__card-name {
    margin-top: 10px;
    font-size: 14px;
    font-weight: 500;
    line-height: 20px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.games-hero__arrow {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    border: none;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.35);
    color: #fff;
    cursor: pointer;
    flex-shrink: 0;
    transform: translateY(-10px);
}

.games-hero__arrow:disabled {
    opacity: 0.35;
    cursor: not-allowed;
}

.games-hero__arrow svg {
    width: 18px;
    height: 18px;
}

.games-ad {
    margin-top: 40px;
}

.games-section {
    margin-top: 60px;
}

.games-section--panel .games-latest-list {
    background: #fff;
    border-radius: 20px;
    padding: 30px 34px;
}

.games-section__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--color-primary);
}

.games-section__title {
    font-size: 30px;
    font-weight: 500;
    line-height: 36px;
    color: #000;
}

.games-section__more {
    color: rgba(0, 0, 0, 0.5);
    font-size: 20px;
    font-weight: 500;
    line-height: 36px;
    white-space: nowrap;
}

.games-section__more:hover {
    color: var(--color-primary);
}

.games-latest-list {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 20px 132px;
}

.games-latest-item {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
    color: #000;
    transition: transform 0.3s;
}

.games-latest-item__link {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
    min-width: 0;
    color: inherit;
    text-decoration: none;
}

.games-latest-item__link:hover {
    color: inherit;
}

.games-latest-item:hover {
    transform: translateY(-6px);
    color: #000;
}

.games-latest-item img {
    width: 90px;
    aspect-ratio: 1 / 1;
    border-radius: 10px;
    object-fit: cover;
    flex-shrink: 0;
    background: #eee;
}

.games-latest-item__info {
    flex: 1;
    min-width: 0;
}

.games-latest-item__name {
    font-size: 20px;
    font-weight: 500;
    line-height: 26px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.game-stars {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    margin-top: 6px;
}

.game-stars__icon {
    width: 14px;
    height: 14px;
    background-repeat: no-repeat;
    background-size: contain;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23d9d9d9'%3E%3Cpath d='M12 2l3.09 6.26L22 9.27l-5 4.87L18.18 22 12 18.27 5.82 22 7 14.14l-5-4.87 6.91-1.01L12 2z'/%3E%3C/svg%3E");
}

.game-stars__icon.is-filled {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23ffb400'%3E%3Cpath d='M12 2l3.09 6.26L22 9.27l-5 4.87L18.18 22 12 18.27 5.82 22 7 14.14l-5-4.87 6.91-1.01L12 2z'/%3E%3C/svg%3E");
}

.games-featured-item .game-stars {
    margin-top: 8px;
}

.games-latest-item__play {
    flex-shrink: 0;
    padding: 0 17px;
    border-radius: 30px;
    background: #f7f7f7;
    color: var(--color-primary);
    font-size: 16px;
    font-weight: 600;
    line-height: 30px;
}

.games-featured-grid {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 47px;
}

.games-featured-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    color: #000;
    transition: transform 0.3s;
}

.games-featured-item:hover {
    transform: translateY(-10px);
    color: var(--color-primary);
}

.games-featured-item img {
    width: 100%;
    aspect-ratio: 1 / 1;
    border-radius: 16px;
    object-fit: cover;
    background: #eee;
}

.games-featured-item__name {
    margin-top: 16px;
    font-size: 20px;
    font-weight: 500;
    line-height: 26px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    width: 100%;
}

.games-cat-section {
    margin-top: 60px;
    scroll-margin-top: calc(var(--page-offset) + 8px);
}

.games-cat-section.is-hidden {
    display: none;
}

.games-cat-section .game-row {
    margin-top: 0;
}

.games-cat-section .games-mobile-grid {
    display: none;
}

@media (max-width: 1334px) {
    .games-hero {
        gap: 28px;
        padding: 24px;
    }

    .games-hero__card {
        width: calc(16.66% - 20px);
    }

    .games-featured-grid {
        grid-template-columns: repeat(4, minmax(0, 1fr));
        gap: 24px;
    }
}

@media (max-width: 1024px) {
    .games-hero {
        flex-direction: column;
        align-items: stretch;
        gap: 24px;
    }

    .games-hero__search {
        width: 100%;
    }

    .games-hero__card {
        width: calc(20% - 20px);
    }

    .games-latest-list {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 20px 40px;
    }
}

@media (max-width: 768px) {
    .games-page {
        padding: calc(80px + env(safe-area-inset-top, 0px)) var(--page-gutter) 40px;
    }

    .games-nav {
        margin-bottom: 28px;
    }

    .games-nav__list {
        gap: 12px;
    }

    .games-nav__item {
        height: 36px;
        line-height: 36px;
        padding: 0 20px;
        font-size: 16px;
        border: none;
        border-radius: 36px;
        background: #fff;
        box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    }

    .games-nav__item.is-active {
        background: var(--color-primary);
        border: none;
        color: #fff;
    }

    .games-hero {
        padding: 20px 16px;
        border-radius: 16px;
    }

    .games-hero__carousel {
        gap: 8px;
    }

    .games-hero__track-wrap {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scroll-snap-type: x mandatory;
        scrollbar-width: none;
    }

    .games-hero__track-wrap::-webkit-scrollbar {
        display: none;
    }

    .games-hero__track {
        transform: none !important;
    }

    .games-hero__card {
        scroll-snap-align: start;
        width: calc(40% - 12px);
        min-width: 96px;
    }

    .games-hero__arrow {
        display: none;
    }

    .games-section {
        margin-top: 24px;
    }

    .games-section__head {
        margin-bottom: 17px;
        padding-bottom: 0;
        border-bottom: none;
    }

    .games-section__title {
        font-size: 20px;
        line-height: 26px;
    }

    .games-section__more {
        font-size: 16px;
        line-height: 26px;
        color: #000;
    }

    .games-section--panel .games-latest-list {
        padding: 0;
        background: transparent;
        border-radius: 0;
    }

    .games-latest-list {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .games-latest-item {
        padding-right: 10px;
        background: #fff;
        border-radius: 14px;
        transform: none;
    }

    .games-latest-item:hover {
        transform: none;
    }

    .games-latest-item img {
        width: 70px;
        border-radius: 14px 0 0 14px;
    }

    .games-latest-item__name {
        font-size: 16px;
        line-height: 22px;
    }

    .game-stars {
        margin-top: 4px;
    }

    .game-stars__icon {
        width: 12px;
        height: 12px;
    }

    .games-latest-item__play {
        font-size: 13px;
        line-height: 30px;
        padding: 0 14px;
        border: 1px solid var(--color-primary);
        background: transparent;
    }

    .games-featured-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 16px 15px;
    }

    .games-featured-item {
        background: #fff;
        border-radius: 14px;
        overflow: hidden;
        padding-bottom: 10px;
    }

    .games-featured-item:hover {
        transform: none;
    }

    .games-featured-item img {
        border-radius: 0;
        aspect-ratio: 16 / 9;
    }

    .games-featured-item__name {
        font-size: 16px;
        line-height: 22px;
        margin-top: 10px;
    }

    .games-cat-section .games-cat-preview {
        display: none;
    }

    .games-cat-section .games-mobile-grid {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 16px 15px;
    }

    .games-cat-section {
        margin-top: 24px;
        scroll-margin-top: calc(80px + env(safe-area-inset-top, 0px));
    }

    .games-mobile-card {
        overflow: hidden;
        border-radius: 14px;
        background: #fff;
        color: #000;
    }

    .games-mobile-card img {
        width: 100%;
        aspect-ratio: 16 / 9;
        object-fit: cover;
        background: #eee;
    }

    .games-mobile-card__body {
        padding: 0 14px 10px;
    }

    .games-mobile-card__name {
        padding: 0;
        font-size: 16px;
        line-height: 22px;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .games-mobile-card .game-stars {
        margin-top: 4px;
    }
}

@media (max-width: 480px) {
    .games-hero {
        padding: 16px 12px;
        border-radius: 12px;
    }

    .games-hero__hot {
        max-height: none;
        gap: 8px;
    }

    .games-hero__hot-tag {
        padding: 0 14px;
        font-size: 14px;
        line-height: 28px;
    }

    .games-hero__card {
        width: calc(46% - 8px);
        min-width: 84px;
    }

    .games-nav__item {
        padding: 0 16px;
        font-size: 14px;
    }

    .games-featured-item__name,
    .games-mobile-card__name {
        font-size: 14px;
        line-height: 20px;
    }
}
