:root {
    --bg: #0c0d0f;
    --surface: #111217;
    --surface-2: #171922;
    --border: orangered;
    --text: #F3F4F6;
    --muted: #B7BBC7;
    --accent: orangered;
    --accent-ink: #14120A;
    --radius: 5px;
    --shadow: 0 10px 30px rgba(0, 0, 0, .45);
}

#themes * {
    box-sizing: border-box;
}

#themes {
    color: var(--text);
}

.themes {
    max-width: 1200px;
    margin: 2rem auto;
    background: rgba(0, 0, 0, .6);
    backdrop-filter: blur(3px);
    border: 1px solid var(--border);
    border-radius: calc(var(--radius));
    box-shadow: var(--shadow);
    padding: 20px 16px 24px;
}

.themes__header {
    text-align: center;
    margin-bottom: .5rem;
}

.themes__title {
    margin: 0;
    font-size: clamp(26px, 2.6vw, 36px);
    font-weight: 800;
    letter-spacing: .2px;
    line-height: 1.15;
}

.themes__title::after {
    content: "";
    display: block;
    width: 88px;
    height: 3px;
    margin: .7rem auto 0;
    background: linear-gradient(90deg, transparent, var(--accent), transparent);
    border-radius: 99px;
}

.themes__subtitle {
    margin-top: .4rem;
    color: var(--muted);
    font-size: .98rem;
}

.themes__filters {
    display: flex;
    flex-wrap: wrap;
    gap: .5rem;
    justify-content: center;
    margin: .5rem 0 0;
}

.filter__btn {
    display: inline-block;
    padding: .5rem .8rem;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    background: var(--surface-2);
    color: var(--text);
    text-decoration: none;
    font-weight: 700;
    transition: transform .15s ease, background .2s ease, border-color .2s ease, color .2s ease;
}

.filter__btn:hover {
    transform: translateY(-1px);
    background: #1f2230;
    border-color: #313548;
}

.filter__btn.is-active {
    background: linear-gradient(180deg, var(--accent), color-mix(in srgb, var(--accent) 70%, #7f5a00));
    color: var(--accent-ink);
    border-color: color-mix(in srgb, var(--accent) 55%, #6a4d00);
}

.themes__grid {
    --gap: 18px;
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: var(--gap);
    padding: 16px 6px 2px;
}

@media (max-width:1200px) {
    .themes__grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width:900px) {
    .themes__grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width:600px) {
    .themes__grid {
        grid-template-columns: 1fr;
    }
}

.card {
    display: flex;
    flex-direction: column;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: transform .18s ease, box-shadow .2s ease, border-color .2s ease;
}

.card:hover {
    transform: translateY(-2px);
    box-shadow: 0 14px 36px rgba(0, 0, 0, .5);
    border-color: #2f3342;
}

.card__media {
    position: relative;
    background: #0a0b0e;
    aspect-ratio: 3 / 5;
    overflow: hidden;
}

.card__media img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: center;
    background-color: #0a0b0e;
    display: block;
}


.card:hover .card__media img {
    transform: scale(1.035);
}

.card__body {
    padding: 12px 12px 14px;
    display: flex;
    flex-direction: column;
    gap: .2rem;
}

.card__title {
    margin: 0;
    font-size: 1.02rem;
    line-height: 1.2;
    font-weight: 750;
    letter-spacing: .2px;
}

.card__meta {
    margin: 0;
    color: var(--muted);
    font-size: .94rem;
}

.pager__buttons {
    display: flex;
    justify-content: center;
    gap: .5rem;
    padding: .5rem 0 0;
    margin-top: .25rem;
}

.pager__btn {
    display: inline-block;
    min-width: 44px;
    padding: .52rem .8rem;
    border-radius: 999px;
    background: var(--surface-2);
    border: 1px solid var(--border);
    color: var(--text);
    text-decoration: none;
    font-weight: 700;
    transition: transform .15s ease, background .2s ease, border-color .2s ease;
}

.pager__btn:hover {
    transform: translateY(-1px);
    background: #1f2230;
    border-color: #313548;
}

.pager__btn.is-active {
    background: linear-gradient(180deg, var(--accent), color-mix(in srgb, var(--accent) 70%, #7f5a00));
    color: var(--accent-ink);
    border-color: color-mix(in srgb, var(--accent) 55%, #6a4d00);
}

.empty {
    grid-column: 1/-1;
    text-align: center;
    padding: 28px 10px;
    color: var(--muted);
    border: 1px dashed #2c2f3d;
    border-radius: var(--radius);
}

.to-top {
    position: fixed;
    right: 18px;
    bottom: 18px;
    width: 44px;
    height: 44px;
    display: grid;
    place-items: center;
    border-radius: 999px;
    background: var(--surface-2);
    border: 1px solid var(--border);
    color: var(--text);
    font-size: 22px;
    line-height: 1;
    text-decoration: none;
    box-shadow: var(--shadow);
    opacity: .92;
    transition: transform .15s ease, background .2s ease, border-color .2s ease, opacity .2s ease;
}

.to-top:hover {
    transform: translateY(-2px);
    background: #202435;
    border-color: #353a4e;
    opacity: 1;
}

.pager__btn:focus,
.filter__btn:focus,
.to-top:focus {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

.lightbox {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    padding: 20px;
}

.lightbox[hidden] {
    display: none;
}

.lightbox__content {
    max-width: 95%;
    max-height: 90%;
    text-align: center;
}

.lightbox__content img {
    max-width: 100%;
    max-height: 80vh;
    object-fit: contain;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: #0a0b0e;
    box-shadow: var(--shadow);
}

.lightbox__title {
    margin-top: 12px;
    color: var(--text);
    font-size: 1.1rem;
    font-weight: 700;
}

.lightbox__close {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    border: 1px solid var(--border);
    background: var(--surface-2);
    color: var(--text);
    font-size: 26px;
    font-weight: 700;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow);
    transition: transform .15s ease, background .2s ease, border-color .2s ease;
}

.lightbox__close:hover {
    transform: translateY(-2px);
    background: #202435;
    border-color: #353a4e;
}