:root {
    --bg: #0f1115;
    --panel: #151923;
    --card: #171b26;
    --muted: #96a0b5;
    --text: #e6e9f2;
    --accent: #7aa2ff;
    --chip: #222836;
    --chip-on: #2a3652;
    --border: #262c3b;
    --shadow: 0 8px 20px rgba(0, 0, 0, 0.35);
    --radius: 16px;
}

* {
    box-sizing: border-box;
}
html,
body {
    height: 100%;
}
body {
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Inter, Helvetica, Arial, sans-serif;
    background: radial-gradient(rgb(40 0 46), rgb(0 0 0));

    color: var(--text);
    background-position: center center;
    background-attachment: fixed;
    color: var(--text);
}

.wrap {
    max-width: 1500px;
    margin-inline: auto;
    padding: 24px 18px 64px;
}

header {
    display: flex;
    flex-wrap: wrap;
    gap: 16px 12px;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 18px;
}
.top-h1 {
    display: flex;
    align-items: center;
}
.top-h1 img {
    width: 40px;
    margin-right: 14px;
}
h1 {
    margin: 0;
    font-weight: 700;
    letter-spacing: 0.2px;
    font-size: clamp(18px, 2vw, 22px);
    color: #eef2ff;
}
.meta {
    color: var(--muted);
    font-size: 13px;
}

/* Filters bar */
.filters {
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 12px;
    box-shadow: var(--shadow);
    z-index: 5;
}
.filters-top {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
    margin-bottom: 10px;
}
.filters-top .label {
    font-size: 13px;
    color: var(--muted);
    margin-right: 4px;
}
.chips {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    max-height: none;
}
.chip {
    background: var(--chip);
    color: #cfd7ea;
    border: 1px solid var(--border);
    padding: 8px 12px;
    border-radius: 999px;
    font-size: 13px;
    line-height: 1;
    cursor: pointer;
    transition:
        transform 0.08s ease,
        background 0.2s ease,
        border-color 0.2s ease;
    user-select: none;
}
.chip:hover {
    transform: translateY(-1px);
}
.chip.active {
    background: var(--chip-on);
    border-color: #324161;
    color: #eaf0ff;
    box-shadow:
        0 0 0 1px #2c3b5a inset,
        0 6px 16px rgba(0, 0, 0, 0.25);
}
.actions {
    margin-left: auto;
    display: flex;
    gap: 8px;
    align-items: center;
}
.btn {
    background: transparent;
    color: var(--muted);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 8px 10px;
    font-size: 12px;
    cursor: pointer;
}
.btn:hover {
    border-color: #3a4460;
    color: #d7def1;
}

/* Grid of cards */
.grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
    gap: 14px;
    margin-top: 14px;
}
.card {
    position: relative;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: var(--shadow);
    height: 100%;
    transition:
        transform 0.12s ease,
        box-shadow 0.12s ease,
        border-color 0.2s ease;
}
.card:hover:not(.blur) {
    transform: translateY(-2px);
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.45);
    border-color: #2d3550;
}
.thumb {
    width: 100%;
    aspect-ratio: 16/9;
    background: #0b0f15;
    display: block;
    object-fit: cover;
    border-bottom: 1px solid var(--border);
}
.content {
    position: relative;
    padding: 12px 12px 14px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.title {
    margin: 0;
    font-size: 15px;
    font-weight: 600;
    color: #e9eeff;
}
.count {
    position: absolute;
    top: -28px;
    right: 12px;
    font-size: 12px;
    color: var(--muted);
}
.tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 4px;
}
.tag {
    font-size: 11px;
    color: #b7c3e1;
    background: #1b2232;
    border: 1px solid #28314a;
    border-radius: 999px;
    padding: 4px 8px;
}

.empty {
    text-align: center;
    color: var(--muted);
    padding: 28px 8px;
    border: 1px dashed #2a3246;
    border-radius: var(--radius);
    background: rgba(26, 30, 42, 0.35);
    margin-top: 12px;
}

/* Small helpers */
.results {
    font-size: 13px;
    color: var(--muted);
    padding-top: 10px;
}
a.card-link {
    text-decoration: none;
    color: inherit;
    height: 100%;
}

/* Кнопки-фильтры активные */
.btn.active {
    border-color: #3a4460;
    color: #eaf0ff;
    background: #1b2232;
}

/* Обёртка карточки + панель действий */
.card-w {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.card-w.blur {
    opacity: 0.5 !important;
}

.card-actions {
    display: flex;
    justify-content: flex-start;
    padding: 0 2px;
}
.ht {
    display: flex;
    align-items: flex-start;
}
.ht .title {
    min-height: 30px;
    flex: 1 1 100%;
    align-items: center;
    display: flex;
}
/* Икон-кнопки */
.icon-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: #1b2232;
    border: 1px solid #28314a;
    color: #cfe0ff;
    padding: 8px 10px;
    border-radius: 10px;
    font-size: 12px;
    cursor: pointer;
}
.like-btn {
    border-bottom-right-radius: 0;
    border-top-right-radius: 0;
    margin-right: -1px;
}
.star-btn {
    border-bottom-left-radius: 0;
    border-top-left-radius: 0;
}
.icon-btn:hover {
    border-color: #3a4460;
    color: #eaf0ff;
    z-index: 20;
}
.icon-btn .ic {
    display: inline-block;
    line-height: 1;
}
.icon-btn.on {
    background: #2a3652;
    border-color: #324161;
    color: #eaf0ff;
}

/* Уголок «избранное» 🧶 */
.corner-star {
    position: absolute;
    right: 8px;
    top: 8px;
    z-index: 2;
    font-size: 24px;
}
.corner-star:after {
    opacity: 0.8;
    z-index: -1;
    content: "";
    background: #9d40ff;
    width: 100px;
    height: 100px;
    display: block;
    position: absolute;
    rotate: 45deg;
    top: -60px;
    right: -60px;
}
