.card-hero-about {
    position: relative;
}

.card-hero-about .card-img-rating {
    right: auto;
    left: -10px;
}

.card-greeting-box {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.card-section-label {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #a855f7;
    font-weight: 600;
}

.card-greeting-text {
    color: var(--text-main);
    font-size: 0.95rem;
    line-height: 1.6;
    display: flex;
    gap: 0.5rem;
    flex-direction: column;
}

.card-greeting-text em {
    color: var(--text-muted);
}

.card-actions-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    margin-top: 1.25rem;
}

.card-actions-bar .card-buttons {
    width: auto;
}

.btn-secondary {
    display: inline-block;
    background-color: #121214;
    color: #9ca3af;
    text-decoration: none;
    padding: 0.75rem 1.5rem;
    border-radius: 0.5rem;
    font-weight: 500;
    font-size: 0.9rem;
    border: 1px solid #202024;
    transition: color 0.2s, border-color 0.2s, background-color 0.2s;
    white-space: nowrap;
}

.btn-secondary:hover {
    color: #ffffff;
    background-color: #1a1a1e;
    border-color: #2e2e33;
}

.card-spoilers {
    margin-top: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.card-spoiler {
    background-color: #121214;
    border: 1px solid #202024;
    border-radius: 0.75rem;
    overflow: hidden;
    transition: border-color 0.2s;
}

.card-spoiler:hover,
.card-spoiler[open] {
    border-color: #2e2e33;
}

.card-spoiler-header {
    list-style: none;
    cursor: pointer;
    padding: 1rem 1.5rem;
    font-weight: 500;
    font-size: 0.95rem;
    color: #ffffff;
    display: flex;
    justify-content: space-between;
    align-items: center;
    user-select: none;
}

.card-spoiler-header::-webkit-details-marker {
    display: none;
}

.spoiler-icon {
    width: 8px;
    height: 8px;
    border-right: 2px solid #9ca3af;
    border-bottom: 2px solid #9ca3af;
    transform: rotate(45deg);
    transition: transform 0.2s ease, border-color 0.2s;
}

.card-spoiler[open] .spoiler-icon {
    transform: rotate(-135deg);
    border-color: #a855f7;
}

.card-spoiler-body {
    padding: 0 1.5rem 1.25rem;
    color: #9ca3af;
    font-size: 0.92rem;
    line-height: 1.6;
    border-top: 1px solid #1a1a1e;
    padding-top: 1rem;
    white-space: pre-line;
}

@media (max-width: 800px) {
    .card-actions-bar {
        flex-direction: column-reverse;
        align-items: stretch;
    }

    .card-actions-bar .card-buttons {
        width: 100%;
    }

    .btn-secondary {
        width: 100%;
        text-align: center;
    }

    .card-spoiler-header {
        padding: 0.9rem 1rem;
    }

    .card-spoiler-body {
        padding: 0.85rem 1rem 1rem;
        font-size: 0.88rem;
    }
}


.cards-section {
    margin: 1rem 0;
}

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

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

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

.card-item {
    display: flex;
    position: relative;
    flex-direction: row;
    align-items: stretch;
    gap: 0.875rem;
    padding: 0.75rem;
    background: var(--card-bg);
    border: 1px solid var(--glass-border);
    border-radius: 0.875rem;
    transition: var(--transition);
}

.card-item:hover {
    transform: translateY(-5px);
    border-color: var(--accent-color);
    box-shadow: 0 5px 15px rgba(187, 134, 252, 0.15);
}

.card-cover {
    flex-shrink: 0;
    width: 6.25rem;
    height: 6.25rem;
    border-radius: 0.625rem;
    overflow: hidden;
    background: #0d0e12;
}

.card-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center top;
}

.card-body {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-width: 0;
}

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    margin-bottom: 0.25rem;
}

.card-title {
    margin: 0;
    font-size: 0.98rem;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.card-title a {
    color: #f2f4f8;
    text-decoration: none;
}

.card-title a:hover {
    color: var(--accent-color, #a855f7);
}

.badge-tokens {
    flex-shrink: 0;
    padding: 0.125rem 0.4375rem;
    border-radius: 0.375rem;
    background: #1e2230;
    color: #8b95b0;
    font-size: 0.72rem;
    font-weight: 500;
}

.card-greeting {
    margin: 0 0 0.5rem;
    color: #8e95a5;
    font-size: 0.82rem;
    line-height: 1.38;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.card-greeting p,
.card-greeting div {
    display: inline;
    margin: 0;
}

.card-meta {
    margin-top: auto;
    align-items: end;
    align-content: end;
    text-align: end;
    font-size: 0.78rem;
    color: #6c7385;
}

.btn-dl {
    position: relative;
    z-index: 2;
    display: inline-block;
    padding: 0.5rem 1.5rem;
    border-radius: 0.4375rem;
    border: 1px solid #2e2e33;
    background-color: #18181b;
    color: #ffffff;
    text-decoration: none;
    font-weight: 500;
    transition: background 0.15s ease, border-color 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease;
}

.btn-dl:hover {
    background-color: #202024;
    border-color: #a855f7;
    transform: translateY(-1px);
    box-shadow: 0 2px 6px rgba(168, 85, 247, 0.2);
}

.card-link::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 1;
}

.load-more-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.625rem;
    width: 100%;
    max-width: 16.25rem;
    margin: 0 auto;
    padding: 0.75rem 1.5rem;
    background: #18181b;
    color: #e2e8f0;
    border: 1px solid #2e2e33;
    border-radius: 0.75rem;
    font-family: inherit;
    font-size: 0.92rem;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.18s ease, border-color 0.18s ease, transform 0.15s ease, box-shadow 0.18s ease;
}

.load-more-btn:hover:not(:disabled) {
    background: #202024;
    border-color: #a855f7;
    color: #ffffff;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(168, 85, 247, 0.2);
}

.load-more-btn:active:not(:disabled) {
    transform: translateY(0);
}

.load-more-btn:disabled {
    opacity: 0.7;
    cursor: wait;
    border-color: #252936;
}

.load-more-btn:disabled::before {
    content: "";
    width: 0.875rem;
    height: 0.875rem;
    border: 2px solid rgba(255, 255, 255, 0.25);
    border-top-color: #a855f7;
    border-radius: 50%;
    animation: btn-spin 0.7s linear infinite;
}

@keyframes btn-spin {
    to {
        transform: rotate(360deg);
    }
}

@media (max-width: 480px) {
    .card-item {
        gap: 0.625rem;
        padding: 0.625rem;
    }

    .card-cover {
        width: 5rem;
        height: 5rem;
    }
}

.filters-row {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.75rem;
    margin: 1rem 0 1.5rem;
}

.custom-select {
    position: relative;
}

.select-trigger {
    list-style: none;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.55rem 1.15rem;
    border-radius: 999px;
    border: 1px solid var(--glass-border);
    /* background: var(--card-bg); */
    color: #e5e7eb;
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    user-select: none;
    transition: var(--transition);
}

.select-trigger::-webkit-details-marker {
    display: none;
}

.select-trigger svg {
    color: #9ca3af;
    flex-shrink: 0;
    transition: transform 0.2s ease;
}

.custom-select[open] .select-trigger,
.select-trigger:hover {
    background: rgba(187, 134, 252, 0.05);
    border-color: var(--accent-color);
    color: var(--accent-color);
}

.custom-select[open] .select-trigger svg {
    transform: rotate(180deg);
    color: #a855f7;
}

.select-menu {
    position: absolute;
    top: calc(100% + 0.5rem);
    right: 0;
    z-index: 50;
    min-width: 13rem;
    max-height: 16rem;
    overflow-y: auto;
    padding: 0.4rem;
    background-color: var(--bg-color);
    border: 1px solid var(--glass-border);
    border-radius: 0.875rem;
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.6);
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

.select-option {
    display: block;
    padding: 0.55rem 0.85rem;
    border-radius: 0.55rem;
    color: #cbd5e1;
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 500;
    white-space: nowrap;
    transition: background-color 0.12s ease, color 0.12s ease;
}

.select-option:hover {
    background: var(--card-bg);
    color: #ffffff;
}

.select-option.active {
    background: var(--glass-border);
    color: #ffffff;
}

@media (max-width: 500px) {
    .filters-row {
        display: grid;
        grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
        gap: 0.5rem;
    }

    .custom-select {
        min-width: 0;
    }

    .select-trigger {
        width: 100%;
        box-sizing: border-box;
        padding: 0.5rem 0.75rem;
        gap: 0.35rem;
        font-size: 0.8rem;
    }

    .select-trigger span {
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .select-menu {
        min-width: 11rem;
        width: max-content;
        max-width: calc(100vw - 2rem);
    }

    .custom-select:first-child .select-menu {
        left: 0;
        right: auto;
    }

    .custom-select:last-child .select-menu {
        right: 0;
        left: auto;
    }
}

.card-item .card-img-rating {
    position: absolute;
    top: -5px;
    right: -5px;
    width: 30px;
}