/* =========================================================
   Poetici.com — Игры / список кроссвордов
   ========================================================= */

.games-page {
    min-height: 100vh;
    background: var(--bg);
    color: var(--text);
}

.games-hero {
    position: relative;
    min-height: 290px;
    overflow: hidden;
}

.games-hero-bg {
    position: absolute;
    inset: 0;
    background:
        linear-gradient(180deg, rgba(255,255,255,.06), rgba(245,246,252,.86) 88%, var(--bg) 100%),
        var(--page-bg-image) center / cover no-repeat;
}

[data-theme="dark"] .games-hero-bg {
    background:
        linear-gradient(180deg, rgba(15,17,24,.18), rgba(15,17,24,.90) 88%, var(--bg) 100%),
        var(--page-bg-image) center / cover no-repeat;
}

.games-hero-content {
    position: relative;
    z-index: 1;
    min-height: 290px;
    display: grid;
    place-items: center;
    align-content: center;
    text-align: center;
}

.games-hero-content h1 {
    margin: 0;
    font-family: var(--font-main);
    font-size: clamp(48px, 5.8vw, 74px);
    line-height: 1.04;
    letter-spacing: -.04em;
}

.games-hero-decor {
    width: 170px;
    height: 14px;
    margin: 10px auto;
    background: linear-gradient(90deg, transparent, rgba(160,117,76,.75), transparent);
}

.games-hero-content p {
    max-width: 680px;
    margin: 0;
    color: var(--text);
    font-size: 20px;
    font-weight: 800;
    line-height: 1.55;
}

.games-section {
    position: relative;
    z-index: 2;
    margin-top: -34px;
    padding-bottom: 44px;
}

.games-main-card {
    padding: 24px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-soft);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
}

.crosswords-filter-form {
    display: grid;
    grid-template-columns: minmax(230px, 1fr) 190px 220px auto auto;
    gap: 10px;
    align-items: end;
    margin: 0 0 18px;
    padding: 16px;
    background: var(--surface-muted);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
}

.crosswords-filter-form label {
    min-width: 0;
}

.crosswords-filter-form label > span {
    display: block;
    margin-bottom: 6px;
    color: var(--text-muted);
    font-size: 11px;
    font-weight: 900;
}

.crosswords-search {
    position: relative;
}

.crosswords-search > span {
    position: absolute;
    left: 12px;
    bottom: 11px;
    margin: 0 !important;
    color: var(--text-soft);
    font-size: 18px !important;
}

.crosswords-filter-form input,
.crosswords-filter-form select {
    width: 100%;
    height: 42px;
    box-sizing: border-box;
    padding: 0 12px;
    color: var(--text);
    background: var(--surface-solid);
    border: 1px solid var(--border);
    border-radius: 10px;
    font: inherit;
    font-size: 13px;
    font-weight: 800;
    outline: 0;
}

.crosswords-search input {
    padding-left: 38px;
}

.crosswords-filter-form input:focus,
.crosswords-filter-form select:focus {
    border-color: rgba(255,47,50,.42);
}

.crosswords-filter-form button {
    height: 42px;
    padding: 0 18px;
    color: #fff;
    background: var(--primary);
    border: 0;
    border-radius: 10px;
    font-weight: 900;
    cursor: pointer;
}

.crosswords-filter-reset {
    height: 42px;
    display: inline-flex;
    align-items: center;
    color: var(--text-muted);
    text-decoration: none;
    font-size: 13px;
    font-weight: 900;
}

.games-count-line {
    margin: 18px 0;
    color: var(--text-muted);
    font-size: 14px;
    font-weight: 800;
}

.games-count-line strong {
    color: var(--text);
}

.crosswords-list-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}

.crossword-list-card {
    display: grid;
    grid-template-columns: 82px minmax(0, 1fr);
    gap: 18px;
    min-width: 0;
    min-height: 230px;
    padding: 24px;
    background: var(--surface-solid);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-soft);
}

.crossword-list-card-icon {
    width: 70px;
    height: 70px;
    display: grid;
    place-items: center;
    color: #9c6a39;
    background: #faf6f0;
    border: 1px solid #eadcca;
    border-radius: 18px;
    font-size: 30px;
    font-weight: 900;
}

.crossword-list-card-content {
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.crossword-list-card-top {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 8px;
}

.crossword-list-category,
.crossword-list-difficulty {
    display: inline-flex;
    align-items: center;
    min-height: 26px;
    padding: 0 10px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 900;
}

.crossword-list-category {
    color: #8b5d31;
    background: #f6f0ea;
}

.crossword-list-difficulty {
    color: #8a6429;
    background: #fbf6e9;
    border: 1px solid #e8ddc5;
}

.crossword-list-card h2 {
    margin: 0 0 9px;
    font-size: 24px;
    line-height: 1.18;
}

.crossword-list-card h2 a {
    color: var(--text);
    text-decoration: none;
}

.crossword-list-card h2 a:hover {
    color: var(--primary);
}

.crossword-list-card-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 12px;
    color: var(--text-soft);
    font-size: 12px;
    font-weight: 800;
}

.crossword-list-card p {
    margin: 0 0 16px;
    color: var(--text-muted);
    font-size: 14px;
    font-weight: 700;
    line-height: 1.55;
}

.crossword-list-card-bottom {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    margin-top: auto;
}

.game-type-card-link {
    flex-shrink: 0;
    color: var(--primary);
    text-decoration: none;
    font-size: 13px;
    font-weight: 900;
}

/* Действия: избранное / лайк / просмотры / поделиться */
.crossword-actions {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.crossword-actions .crossword-action-btn {
    -webkit-appearance: none;
    appearance: none;
    width: auto;
    min-width: 48px;
    height: 48px;
    min-height: 48px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    box-sizing: border-box;
    margin: 0;
    padding: 0 13px;
    color: #4c526b;
    background: var(--surface-solid);
    border: 1px solid var(--border);
    border-radius: 999px;
    box-shadow: 0 7px 20px rgba(40,31,25,.07);
    font: inherit;
    font-size: 13px;
    font-weight: 800;
    line-height: 1;
    text-decoration: none;
    cursor: pointer;
}

.crossword-actions .js-crossword-favorite {
    width: 48px;
    padding: 0;
}

.crossword-actions .crossword-heart-icon {
    color: var(--primary);
    font-family: Arial, Helvetica, sans-serif;
    font-size: 21px;
    line-height: 1;
}

.crossword-actions .js-crossword-favorite.is-active {
    color: #fff;
    background: var(--primary);
    border-color: var(--primary);
}

.crossword-actions .js-crossword-favorite.is-active .crossword-heart-icon {
    color: #fff;
}

.crossword-actions .js-crossword-like {
    min-width: 58px;
}

.crossword-actions .crossword-like-icon {
    font-family: "Segoe UI Emoji", "Apple Color Emoji", sans-serif;
    font-size: 19px;
    filter: grayscale(1);
    opacity: .72;
}

.crossword-actions .js-crossword-like.is-active {
    color: #fff;
    background: var(--primary);
    border-color: var(--primary);
}

.crossword-actions .js-crossword-like.is-active .crossword-like-icon {
    filter: none;
    opacity: 1;
}

.crossword-actions .crossword-action-count {
    font-size: 12px;
    font-weight: 900;
}

.crossword-actions .crossword-action-static {
    min-width: 68px;
    cursor: default;
}

.crossword-actions .crossword-eye-icon {
    font-family: "Segoe UI Emoji", "Apple Color Emoji", sans-serif;
    font-size: 15px;
}

.crossword-actions .crossword-share-btn {
    width: 48px;
    min-width: 48px;
    padding: 0;
}

.crossword-actions .crossword-share-icon {
    width: 20px;
    height: 20px;
    display: inline-flex;
}

.crossword-actions .crossword-share-icon svg {
    width: 20px;
    height: 20px;
    display: block;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.7;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.games-pagination {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 7px;
    margin-top: 24px;
}

.games-pagination a {
    min-width: 38px;
    height: 38px;
    display: grid;
    place-items: center;
    padding: 0 8px;
    color: var(--text);
    background: var(--surface-solid);
    border: 1px solid var(--border);
    border-radius: 10px;
    text-decoration: none;
    font-size: 13px;
    font-weight: 900;
}

.games-pagination a:hover,
.games-pagination a.is-active {
    color: #fff;
    background: var(--primary);
    border-color: var(--primary);
}

.games-empty {
    grid-column: 1 / -1;
    padding: 36px 20px;
    color: var(--text-muted);
    background: var(--surface-muted);
    border: 1px dashed var(--border);
    border-radius: var(--radius-md);
    text-align: center;
    font-weight: 800;
}

[data-theme="dark"] .crossword-list-card-icon {
    background: var(--surface-muted);
    border-color: var(--border);
}

[data-theme="dark"] .crossword-actions .crossword-action-btn {
    color: var(--text-muted);
    background: var(--surface-solid);
}

[data-theme="dark"] .crossword-actions .js-crossword-favorite.is-active,
[data-theme="dark"] .crossword-actions .js-crossword-like.is-active {
    color: #fff;
    background: var(--primary);
    border-color: var(--primary);
}

@media (max-width: 1100px) {
    .crosswords-filter-form {
        grid-template-columns: 1fr 1fr;
    }

    .crosswords-search {
        grid-column: 1 / -1;
    }
}

@media (max-width: 860px) {
    .crosswords-list-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 680px) {
    .games-section {
        margin-top: -24px;
    }

    .games-main-card {
        padding: 18px 14px;
    }

    .games-hero,
    .games-hero-content {
        min-height: 250px;
    }

    .games-hero-content h1 {
        font-size: clamp(40px, 11vw, 54px);
    }

    .games-hero-content p {
        font-size: 17px;
    }

    .crosswords-filter-form {
        grid-template-columns: 1fr;
        padding: 13px;
    }

    .crosswords-search {
        grid-column: auto;
    }

    .crossword-list-card {
        grid-template-columns: 58px minmax(0, 1fr);
        gap: 14px;
        padding: 17px 15px;
    }

    .crossword-list-card-icon {
        width: 54px;
        height: 54px;
        border-radius: 15px;
        font-size: 25px;
    }

    .crossword-list-card-bottom {
        align-items: flex-start;
        flex-direction: column;
    }

    .crossword-actions {
        gap: 6px;
    }

    .crossword-actions .crossword-action-btn {
        min-width: 44px;
        height: 44px;
        min-height: 44px;
        padding: 0 10px;
    }

    .crossword-actions .js-crossword-favorite,
    .crossword-actions .crossword-share-btn {
        width: 44px;
        min-width: 44px;
    }
}

/* =========================================================
   Главная страница "Игры" — восстановленные стили
   ========================================================= */

.games-section-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    margin: 4px 0 18px;
}

.games-section-head > div {
    min-width: 0;
}

.games-section-head span {
    display: inline-block;
    color: var(--primary);
    font-size: 11px;
    font-weight: 900;
    line-height: 1.2;
    text-transform: uppercase;
    letter-spacing: .08em;
}

.games-section-head h2 {
    margin: 4px 0 0;
    color: var(--text);
    font-size: 28px;
    line-height: 1.2;
}

.games-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}

.game-type-card {
    display: grid;
    grid-template-columns: 72px minmax(0, 1fr);
    gap: 18px;
    min-width: 0;
    padding: 22px;
    background: var(--surface-solid);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-soft);
}

.game-type-card-icon {
    width: 64px;
    height: 64px;
    display: grid;
    place-items: center;
    color: #a0754c;
    background: rgba(160, 117, 76, .09);
    border: 1px solid rgba(160, 117, 76, .16);
    border-radius: 18px;
    font-size: 30px;
    font-weight: 900;
    line-height: 1;
}

.game-type-card-content {
    min-width: 0;
}

.game-type-card h2 {
    margin: 0 0 7px;
    color: var(--text);
    font-size: 23px;
    line-height: 1.2;
}

.game-type-card h2 a {
    color: var(--text);
    text-decoration: none;
}

.game-type-card h2 a:hover {
    color: var(--primary);
}

.game-type-card-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 10px;
    color: var(--text-soft);
    font-size: 12px;
    font-weight: 800;
}

.game-type-card p {
    margin: 0 0 14px;
    color: var(--text-muted);
    font-size: 14px;
    font-weight: 700;
    line-height: 1.55;
}

.game-type-card-link {
    display: inline-flex;
    align-items: center;
    color: var(--primary);
    text-decoration: none;
    font-size: 13px;
    font-weight: 900;
}

.game-type-card-link:hover {
    text-decoration: underline;
}

.game-type-card.is-coming {
    opacity: .72;
}

.game-type-card.is-coming .game-type-card-icon {
    color: var(--text-soft);
    background: var(--surface-muted);
    border-color: var(--border);
}

.game-coming-label {
    display: inline-flex;
    margin-bottom: 7px;
    color: var(--text-soft);
    font-size: 11px;
    font-weight: 900;
    line-height: 1.2;
    text-transform: uppercase;
    letter-spacing: .06em;
}

[data-theme="dark"] .game-type-card-icon {
    background: rgba(160, 117, 76, .12);
    border-color: rgba(214, 181, 135, .16);
}

[data-theme="dark"] .game-type-card.is-coming .game-type-card-icon {
    background: var(--surface-muted);
    border-color: var(--border);
}

@media (max-width: 860px) {
    .games-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 680px) {
    .games-section-head h2 {
        font-size: 24px;
    }

    .game-type-card {
        grid-template-columns: 58px minmax(0, 1fr);
        gap: 14px;
        padding: 17px 15px;
    }

    .game-type-card-icon {
        width: 54px;
        height: 54px;
        border-radius: 15px;
        font-size: 25px;
    }

    .game-type-card h2 {
        font-size: 21px;
    }
}

@media (max-width: 420px) {
    .game-type-card {
        grid-template-columns: 1fr;
    }
}
