:root {
    --bg: #0f1117;
    --panel: #171b24;
    --panel-2: #1d2330;
    --border: #2b3344;
    --text: #edf2ff;
    --muted: #a7b1c6;
    --accent: #7cc4ff;
    --accent-2: #89f0c7;
    --shadow: 0 10px 30px rgba(0, 0, 0, .28);
    --radius: 18px;
    --gap: 20px;
    --card-w: 300px;
    --btn: #243149;
    --btn-hover: #2d3d5c;
}

* {
    box-sizing: border-box
}

html,
body {
    margin: 0;
    padding: 0
}

body {
    font-family: Arial, Helvetica, sans-serif;
    background: radial-gradient(circle at top right, rgba(124, 196, 255, .08), transparent 32%), radial-gradient(circle at bottom left, rgba(137, 240, 199, .07), transparent 30%), var(--bg);
    color: var(--text);
    line-height: 1.45;
}

a {
    color: inherit;
    text-decoration: none
}

.page {
    max-width: 1400px;
    margin: 0 auto;
    padding: 28px 20px 40px;
}

.hero {
    margin-bottom: 24px;
    padding: 22px 24px;
    border: 1px solid var(--border);
    background: linear-gradient(180deg, rgba(255, 255, 255, .03), rgba(255, 255, 255, .01));
    border-radius: 22px;
    box-shadow: var(--shadow);
}

    .hero h1 {
        margin: 0 0 8px;
        font-size: clamp(28px, 4vw, 40px);
        line-height: 1.1;
    }

    .hero p {
        margin: 0;
        color: var(--muted);
        max-width: 900px;
        font-size: 15px;
    }

.topbar {
    display: flex;
    gap: 14px;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    margin: 18px 0 0;
}

.search-wrap {
    flex: 1 1 320px;
    position: relative;
}

.search {
    width: 100%;
    height: 46px;
    padding: 0 14px;
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: 12px;
    color: var(--text);
    outline: none;
    font-size: 14px;
}

    .search:focus {
        border-color: var(--accent);
        box-shadow: 0 0 0 3px rgba(124, 196, 255, .12);
    }

.summary {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    color: var(--muted);
    font-size: 14px;
}

.layout {
    display: grid;
    grid-template-columns: 260px 1fr;
    gap: var(--gap);
    align-items: start;
}

.filters {
    position: sticky;
    top: 65px;
    border: 1px solid var(--border);
    background: rgb(59 64 93);
    backdrop-filter: blur(8px);
    border-radius: 20px;
    padding: 18px;
    box-shadow: var(--shadow);
    max-height: calc(100vh - 32px);
    overflow-y: auto;
    scrollbar-gutter: stable;
    scrollbar-color: #3b405d #252840; /* thumb color, track color */
    scrollbar-width: thin; /* optional: thin, auto, none */
}

    .filters h2 {
        margin: 0 0 14px;
        font-size: 18px;
    }

.filter-group + .filter-group {
    margin-top: 18px;
    padding-top: 18px;
    border-top: 1px solid rgba(255, 255, 255, .06);
}

.filter-title {
    display: block;
    margin-bottom: 10px;
    color: #d8e2f9;
    font-size: 13px;
    letter-spacing: .08em;
    text-transform: uppercase;
}

.filter-list {
    display: grid;
    gap: 8px;
}

.filter-chip {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 11px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--panel);
    cursor: pointer;
    user-select: none;
    transition: .18s ease;
    font-size: 14px;
    color: #dfe8fb;
    margin: 0;
}

    .filter-chip:has(input[type="checkbox"]:checked) {
        background: #fff;
        color: #000;
    }

    .filter-chip:hover {
        border-color: #41506b;
        background: #1b2230;
    }

    .filter-chip input {
        margin: 0;
        accent-color: var(--accent);
        width: 16px;
        height: 16px;
        flex: 0 0 auto;
    }


/*
.filter-chip {
    justify-content: space-between;
    position: relative;
}

    .filter-chip > span:first-child {
        display: flex;
        align-items: center;
        gap: 10px;
    }

.info-tip {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    border: 1px solid var(--border);
    color: var(--muted);
    font-size: 12px;
    font-weight: bold;
    cursor: help;
    flex: 0 0 auto;
}

.tooltip {
    display: none;
    position: absolute;
    left: 0;
    bottom: calc(100% + 8px);
    width: 260px;
    padding: 10px 12px;
    border-radius: 10px;
    background: #111827;
    border: 1px solid var(--border);
    color: var(--text);
    font-size: 13px;
    line-height: 1.4;
    box-shadow: var(--shadow);
    z-index: 20;
}

.info-tip:hover .tooltip,
.info-tip:focus .tooltip {
    display: block;
}
        */

.filter-actions {
    margin-top: 18px;
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.btn,
.ghost-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 42px;
    padding: 0 14px;
    border-radius: 12px;
    border: 1px solid var(--border);
    cursor: pointer;
    transition: .18s ease;
    font-weight: bold;
    font-size: 14px;
}

.btn {
    background: var(--btn);
    color: var(--text);
}

    .btn:hover {
        background: var(--btn-hover);
        transform: translateY(-1px);
    }

.ghost-btn {
    background: transparent;
    color: var(--muted);
    width: 100%;
}

    .ghost-btn:hover {
        color: var(--text);
        border-color: #41506b;
        background: rgba(255, 255, 255, .03);
    }

.cards-area {
    min-width: 0;
}

.cards {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: var(--gap);
}

.card {
    display: flex;
    flex-direction: column;
    min-height: 100%;
    background: linear-gradient(180deg, rgba(255, 255, 255, .025), rgba(255, 255, 255, .015));
    border: 1px solid var(--border);
    border-radius: 20px;
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease;
}

    .card:hover {
        transform: translateY(-3px);
        border-color: #3d4f6d;
        box-shadow: 0 18px 40px rgba(0, 0, 0, .33);
    }

.card-inner {
    display: flex;
    flex-direction: column;
    height: 100%;
    padding: 16px;
}

.card h3 {
    margin: 0 0 12px;
    font-size: 20px;
    line-height: 1.2;
    min-height: 48px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.card-image {
    width: 100%;
    aspect-ratio: 3 / 2;
    border-radius: 14px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, .06);
    background: #10151f;
    margin-bottom: 12px;
    flex: 0 0 auto;
}

    .card-image img {
        width: 100%;
        height: 100%;
        display: block;
        object-fit: cover;
    }

.meta {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 12px;
    min-height: 32px;
    align-items: flex-start;
}

.pill {
    display: inline-flex;
    align-items: center;
    padding: 6px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: bold;
    border: 1px solid rgba(255, 255, 255, .08);
    color: #eef5ff;
    background: #202838;
    white-space: nowrap;
}

    .pill.tool {
        background: rgba(124, 196, 255, .3);
        color: #cfe8ff;
    }

    .pill.withquill {
        background: rgba(124, 196, 255, .3);
        color: #cfe8ff;
    }

    .pill.game {
        background: rgba(191, 146, 255, .2);
        color: #ecd9ff;
    }

    .pill.fun {
        background: rgba(255, 192, 105, .3);
        color: #ffe5b5;
    }

    .pill.experiment {
        background: rgba(137, 240, 199, .2);
        color: #d7fff0;
    }

    .pill.health {
        background: rgba(228, 49, 53, .6);
        color: #d7fff0;
    }

    .pill.desktop {
        background: rgba(168, 80, 16, .5);
        color: #d7fff0;
    }

    .pill.dev {
        background: rgba(228, 227, 54, .6);
        color: #d7fff0;
    }

    .pill.new {
        background: rgba(91, 153, 255, .38);
        color: #fff;
    }

    .pill.popular {
        background: rgba(255, 127, 168, .5);
        color: #ffd9e7;
    }

    .pill.updated {
        background: rgba(138, 255, 176, .3);
        color: #dfffe8;
    }

    .pill.indev {
        background: rgba(184, 66, 228, .5);
        color: #d7fff0;
    }

    .pill.free {
        background: rgba(255, 255, 255, .28);
        color: #f3f6fd;
    }

.desc {
    color: var(--muted);
    font-size: 14px;
    margin: 0 0 16px;
    display: -webkit-box;
    -webkit-line-clamp: 4;
    -webkit-box-orient: vertical;
    overflow: hidden;
    min-height: 81px;
}

.card-footer {
    margin-top: auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.card-link {
    width: 100%;
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 14px;
    border-radius: 12px;
    background: var(--btn);
    border: 1px solid var(--border);
    font-weight: bold;
    transition: .18s ease;
}

    .card-link:hover {
        background: var(--btn-hover);
    }

.empty {
    display: none;
    padding: 34px 24px;
    border: 1px dashed #40506c;
    border-radius: 18px;
    text-align: center;
    color: var(--muted);
    background: rgba(255, 255, 255, .02);
}

.mobile-filter-toggle {
    display: none;
    width: 100%;
    margin-bottom: 14px;
}

@media (max-width: 1150px) {
    .cards {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

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

    .filters {
        position: static;
        display: none;
        max-height: none;
        overflow-y: visible;
    }

        .filters.open {
            display: block;
        }

    .mobile-filter-toggle {
        display: inline-flex;
    }

    .cards {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 620px) {
    .page {
        padding: 16px 14px 30px;
    }

    .hero {
        padding: 18px;
        border-radius: 18px;
    }

    .cards {
        grid-template-columns: 1fr;
    }

    .card h3 {
        min-height: auto;
    }

    .desc {
        min-height: auto;
    }
}

@media (max-height: 1040px) {
    .filters {
        padding: 12px;
    }

        .filters h2 {
            margin-bottom: 10px;
            font-size: 16px;
        }

    .filter-group + .filter-group {
        margin-top: 12px;
        padding-top: 12px;
    }

    .filter-title {
        margin-bottom: 7px;
        font-size: 11px;
    }

    .filter-list {
        gap: 6px;
    }

    .filter-chip {
        padding: 6px 9px;
        border-radius: 10px;
        font-size: 13px;
    }

        .filter-chip input {
            width: 14px;
            height: 14px;
        }
}

@media (max-height: 845px) {
    .filter-chip {
        padding: 4px 8px;
        min-height: 30px;
    }

    .filter-group + .filter-group {
        margin-top: 8px;
        padding-top: 8px;
    }
}
