.sc-home-games {
    --cm-bg-page: #101114;
    --cm-bg-section: #1c1e22;
    --cm-bg-frame: #25272d;
    --cm-bg-frame2: #3c4049;
    --cm-border: #30343b;
    --cm-text-primary: #ffffff;
    --cm-text-secondary: #8f96a3;
    --cm-text-muted: #c4c8cf;
    --cm-primary: #1081df;
    --cm-yellow: #9b7f0e;
    --cm-radius-card: 8px;
    --cm-radius-badge: 4px;
    --cm-radius-btn: 8px;
    --cm-gap-grid: 24px;
    --cm-gap-section: 64px;
    --cm-transition: 0.22s cubic-bezier(0.4, 0, 0.2, 1);
    --cm-font: 'Vazir', 'Vazir', 'Tahoma', sans-serif;

    width: min(1640px, calc(100% - 32px));
    margin: 64px auto 0;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 40px;
    direction: rtl;
    font-family: var(--cm-font);
}

.sc-home-games__header {
    display: grid;
    grid-template-columns: minmax(160px, 1fr) auto minmax(160px, 1fr);
    align-items: center;
    gap: 24px;
    width: 100%;
    direction: ltr;
}

.sc-home-games__all-link,
.sc-home-games__more {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 40px;
    padding: 8px 12px;
    border: 0;
    border-radius: var(--cm-radius-badge);
    background-color: var(--cm-bg-frame);
    color: var(--cm-text-primary);
    font-family: var(--cm-font);
    font-size: 16px;
    font-weight: 400;
    line-height: 1.5;
    text-decoration: none;
    white-space: nowrap;
    cursor: pointer;
    transition: background-color 0.22s ease, transform 0.22s ease, opacity 0.22s ease;
}

.sc-home-games__all-link {
    justify-self: start;
}

.sc-home-games__all-link:hover,
.sc-home-games__more:hover:not(:disabled) {
    background-color: var(--cm-bg-frame2);
    color: #ffffff;
    transform: translateY(-1px);
}

.sc-home-games__tabs.cat-game-tabs {
    justify-self: center;
}

.sc-home-games .cat-game-tab {
    color: var(--cm-text-secondary);
    font-family: var(--cm-font);
    transition: color var(--cm-transition), border-color var(--cm-transition);
}

.sc-home-games .cat-game-tab:hover {
    color: var(--cm-text-primary);
}

.sc-home-games .cat-game-tab--active {
    color: var(--cm-text-primary);
    border-bottom-color: var(--cm-primary);
}

.sc-home-games__title-wrap {
    justify-self: end;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.sc-home-games__title {
    margin: 0;
    color: var(--cm-text-primary);
    font-family: var(--cm-font);
    font-size: 20px;
    font-weight: 500;
    line-height: 1.5;
    white-space: nowrap;
}

.sc-home-games__title-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    flex: 0 0 24px;
}

.sc-home-games__title-icon img {
    display: block;
    width: 24px;
    height: 24px;
}

.sc-home-games__grid.cat-game-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    justify-content: center;
    align-items: start;
    column-gap: 24px;
    row-gap: 32px;
    width: 100%;
}

.sc-home-games .cat-game-card {
    width: 100%;
    max-width: none;
    min-width: 0;
}

.sc-home-games .cat-game-card__image-wrap {
    height: 184px;
}

.sc-home-games .cat-game-card__body {
    min-height: 115px;
    padding: 16px;
    gap: 16px;
    background-color: var(--cm-bg-section);
}

.sc-home-games .cat-game-card__badge {
    background-color: var(--cm-primary) !important;
    border-radius: var(--cm-radius-badge);
}

.sc-home-games .cat-game-card__title {
    display: block;
    min-height: 27px;
    height: auto;
    overflow: visible;
    visibility: visible;
    opacity: 1;
}

.sc-home-games .cat-game-card__title-link {
    display: block;
    font-size: 18px;
    font-weight: 400;
    color: #ffffff !important;
    visibility: visible;
    opacity: 1;
}

.sc-home-games .cat-game-card__meta-value {
    color: var(--cm-text-secondary);
}

.sc-home-games__footer {
    display: flex;
    justify-content: center;
    width: 100%;
}

.sc-home-games__more {
    min-width: 112px;
}

.sc-home-games__more:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

.sc-home-games__more[hidden] {
    display: none;
}

.sc-home-games--loading .sc-home-games__grid {
    pointer-events: none;
}

.sc-home-games__card--new {
    animation: sc-home-games-card-in 0.35s cubic-bezier(0.4, 0, 0.2, 1) both;
}

@keyframes sc-home-games-card-in {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@media (max-width: 1656px) {
    .sc-home-games__grid.cat-game-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 991px) {
    .sc-home-games__header {
        grid-template-columns: 1fr;
        justify-items: center;
    }

    .sc-home-games__all-link,
    .sc-home-games__title-wrap {
        justify-self: center;
    }

    .sc-home-games__title-wrap {
        order: -1;
    }

    .sc-home-games__grid.cat-game-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 640px) {
    .sc-home-games {
        width: min(100% - 24px, 392px);
        margin-top: 48px;
        gap: 28px;
    }

    .sc-home-games__tabs.cat-game-tabs {
        width: 100%;
        overflow-x: auto;
        justify-content: center;
        scrollbar-width: none;
    }

    .sc-home-games__tabs.cat-game-tabs::-webkit-scrollbar {
        display: none;
    }

    .sc-home-games__grid.cat-game-grid {
        grid-template-columns: 1fr;
        row-gap: 24px;
    }

    .sc-home-games .cat-game-card {
        max-width: none;
    }
}

@media (prefers-reduced-motion: reduce) {
    .sc-home-games *,
    .sc-home-games__card--new {
        animation: none !important;
        transition: none !important;
    }
}
