/* ==========================================
   КАТАЛОГ ФАНФИКОВ — стиль AnimeHub (v2)
   ========================================== */
/* ==========================================
   HERO-БАННЕР КАТАЛОГА ФАНФИКОВ
   Повторяет .mg-hero / .anime-hero: та же высота, тот же бесшовный
   переход в фон страницы (конечный цвет = body #0d0e12).
   ========================================== */
.ff-hero {
    position: relative;
    padding: 54px 40px 42px;
    height: 320px;
    display: flex;
    align-items: flex-end;
    justify-content: flex-start;
    background:
        linear-gradient(180deg, rgba(13, 14, 18, .10) 0%, rgba(13, 14, 18, .72) 62%, rgba(13, 14, 18, .96) 86%, #0d0e12 100%),
        url('/static/images/fanfic-hero.avif') center/cover no-repeat;
    overflow: hidden;
}

.ff-hero-inner {
    max-width: 1600px;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 18px;
    position: relative;
    text-align: left;
    margin-left: 60px;
}

.ff-hero-icon {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 77, 109, .14);
    border: 1px solid rgba(255, 77, 109, .5);
    color: #ff8fa3;
}

.ff-hero-icon svg {
    width: 18px;
    height: 18px;
}

.ff-hero-text h1 {
    margin: 0;
    font-size: 26px;
    font-weight: 800;
    color: #fff;
    line-height: 1.1;
}

.ff-hero-text p {
    margin: 4px 0 0;
    font-size: 13px;
    color: #b98a94;
}

@media (max-width: 900px) {
    .ff-hero {
        height: 240px;
        padding: 34px 20px 30px;
    }

    .ff-hero-inner {
        margin-left: 16px;
        gap: 12px;
    }

    .ff-hero-icon {
        width: 32px;
        height: 32px;
        border-radius: 8px;
    }

    .ff-hero-icon svg {
        width: 16px;
        height: 16px;
    }

    .ff-hero-text h1 {
        font-size: 20px;
    }

    .ff-hero-text p {
        font-size: 12px;
    }
}

@media (max-width: 768px) {
    .ff-hero {
        height: auto !important;
        min-height: 180px !important;
        padding: 20px 14px 18px !important;
    }

    .ff-hero-inner {
        margin-left: 0 !important;
        gap: 12px !important;
        width: 100% !important;
    }

    .ff-hero-icon {
        width: 32px !important;
        height: 32px !important;
        border-radius: 8px !important;
    }

    .ff-hero-icon svg {
        width: 16px !important;
        height: 16px !important;
    }

    .ff-hero-text h1 {
        font-size: 20px !important;
    }

    .ff-hero-text p {
        font-size: 12px !important;
        margin-top: 4px !important;
    }
}
.fanfics-page {
    padding: 26px 90px 80px;
    color: #fff;
    font-family: 'MyCustomFont';
}

/* === Верхняя панель === */
.fanfic-topbar-wrap {
    position: relative;
    z-index: 60;
}

.fanfic-topbar {
    display: flex;
    align-items: center;
    gap: 14px;
}

.fanfic-search-bar {
    flex: 1.6;
    min-width: 380px;
    display: flex;
    align-items: center;
    gap: 10px;
    background: #1d1e24;
    border: 1px solid #2c2e36;
    border-radius: 14px;
    padding: 0 18px;
    height: 50px;
    transition: border-color .25s ease, box-shadow .25s ease, background .25s ease;
}

.fanfic-search-bar:focus-within {
    border-color: rgba(255, 77, 109, .65);
    box-shadow: 0 0 0 4px rgba(255, 77, 109, .12);
    background: #20212a;
}

.fanfic-search-bar svg {
    width: 18px;
    height: 18px;
    color: #7a7d87;
    flex-shrink: 0;
    transition: color .25s;
}

.fanfic-search-bar:focus-within svg {
    color: #ff4d6d;
}

.fanfic-search-bar input {
    flex: 1;
    background: none;
    border: none;
    outline: none;
    color: #fff;
    height: 100%;
    padding: 0;
    font-size: 15px;
    font-family: 'MyCustomFont';
}

.fanfic-search-bar input::placeholder {
    color: #5d6068;
}

.search-clear {
    background: none;
    border: none;
    color: #7a7d87;
    cursor: pointer;
    font-size: 15px;
    padding: 4px 8px;
    transition: color .15s, transform .15s;
}

.search-clear:hover {
    color: #ff4d6d;
    transform: scale(1.15);
}

.fanfic-topbar-btns {
    display: flex;
    gap: 10px;
    flex-shrink: 0;
}

.topbar-btn {
    display: flex;
    align-items: center;
    gap: 9px;
    background: #1d1e24;
    border: 1px solid #2c2e36;
    color: #c9ccd4;
    height: 52px;
    padding: 0 20px;
    border-radius: 14px;
    cursor: pointer;
    font-family: 'MyCustomFont';
    font-size: 14px;
    font-weight: 600;
    transition: all .25s ease;
}

.topbar-btn:hover {
    border-color: #3a3d46;
    color: #fff;
    transform: translateY(-1px);
}

.topbar-btn.active {
    background: rgba(255, 77, 109, .10);
    border-color: rgba(255, 77, 109, .7);
    color: #fff;
    box-shadow: 0 0 0 3px rgba(255, 77, 109, .12), 0 8px 24px rgba(255, 77, 109, .15);
}

.topbar-btn svg {
    width: 16px;
    height: 16px;
}

.topbar-btn .chevron {
    transition: transform .3s ease;
}

.topbar-btn.active .chevron {
    transform: rotate(180deg);
}

.filter-count {
    background: linear-gradient(135deg, #ff4d6d, #d63a6a);
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    min-width: 20px;
    height: 20px;
    padding: 0 6px;
    border-radius: 10px;
    display: none;
    align-items: center;
    justify-content: center;
    animation: ffPop .3s cubic-bezier(.34, 1.56, .64, 1);
}

@keyframes ffPop {
    from {
        transform: scale(.4);
    }

    to {
        transform: scale(1);
    }
}

.topbar-btn:focus-visible,
.fp-apply:focus-visible,
.page-btn:focus-visible,
.sort-btn:focus-visible {
    outline: 2px solid #ff4d6d;
    outline-offset: 2px;
}

/* === Меню сортировки === */
.sort-menu {
    position: absolute;
    top: calc(100% + 12px);
    right: 0;
    z-index: 110;
    width: 260px;
    background: rgba(26, 27, 32, .97);
    border: 1px solid #2c2e36;
    border-radius: 16px;
    padding: 16px;
    box-shadow: 0 24px 60px rgba(0, 0, 0, .55);
    backdrop-filter: blur(10px);
    display: none;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: none;
    transition: none;
}

.sort-menu.open {
    display: block;
    opacity: 1;
    transform: none;
    visibility: visible;
    pointer-events: auto;
}

.sm-title {
    font-size: 11px;
    letter-spacing: .8px;
    text-transform: uppercase;
    color: #7a7d87;
    margin-bottom: 10px;
}

.sm-options {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.sort-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    background: transparent;
    border: 1px solid transparent;
    color: #c9ccd4;
    padding: 10px 12px;
    border-radius: 10px;
    cursor: pointer;
    font-family: 'MyCustomFont';
    font-size: 14px;
    text-align: left;
    transition: all .2s ease;
}

.sort-btn:hover {
    background: #262831;
    color: #fff;
}

.sort-btn.active {
    background: rgba(255, 77, 109, .12);
    border-color: rgba(255, 77, 109, .45);
    color: #fff;
}

.sort-btn svg {
    width: 15px;
    height: 15px;
    color: #ff4d6d;
    flex-shrink: 0;
}

.sm-dir {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid #2c2e36;
}

.sm-dir-label {
    display: block;
    font-size: 12px;
    color: #7a7d87;
    margin-bottom: 8px;
}

.sm-seg {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4px;
    background: #1d1e24;
    border: 1px solid #2c2e36;
    border-radius: 10px;
    padding: 4px;
}

.sm-seg button {
    background: transparent;
    border: none;
    color: #9aa0ab;
    padding: 8px 10px;
    border-radius: 8px;
    cursor: pointer;
    font-family: 'MyCustomFont';
    font-size: 12.5px;
    transition: all .2s ease;
}

.sm-seg button:hover {
    color: #fff;
}

.sm-seg button.active {
    background: linear-gradient(135deg, #ff4d6d, #d63a6a);
    color: #fff;
    box-shadow: 0 4px 12px rgba(255, 77, 109, .35);
}

/* === Панель фильтров === */
.filters-panel-wrap {
    position: absolute;
    top: calc(100% + 12px);
    left: 0;
    right: 0;
    z-index: 100;
    display: none;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: none;
    transition: none;
}

.filters-panel-wrap.open {
    display: block;
    opacity: 1;
    transform: none;
    visibility: visible;
    pointer-events: auto;
}

.filters-panel {
    background: rgba(24, 25, 30, .97);
    border: 1px solid #2c2e36;
    border-radius: 20px;
    padding: 20px;
    box-shadow: 0 30px 80px rgba(0, 0, 0, .6);
    backdrop-filter: blur(12px);
    max-height: 74vh;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: #32353f transparent;
    -webkit-overflow-scrolling: touch;
}

.filters-panel::-webkit-scrollbar {
    width: 6px;
}

.filters-panel::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.02);
    border-radius: 4px;
}

.filters-panel::-webkit-scrollbar-thumb {
    background: #32353f;
    border-radius: 4px;
    transition: background .2s ease;
}

.filters-panel::-webkit-scrollbar-thumb:hover {
    background: #ff4d6d;
}

.fp-columns {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(235px, 1fr));
    gap: 16px;
}

.fp-col {
    background: #1d1e24;
    border: 1px solid #2c2e36;
    border-radius: 16px;
    padding: 16px;
    transition: border-color .25s;
}

.fp-col:hover {
    border-color: #3a3d46;
}

.fp-col-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    width: 100%;
    background: none;
    border: none;
    color: #fff;
    cursor: pointer;
    font-family: 'MyCustomFont';
    padding: 0;
    margin: 0 0 12px;
    transition: margin .3s ease;
}

.fp-col.collapsed .fp-col-head {
    margin-bottom: 0;
}

.fp-col-title {
    display: flex;
    align-items: center;
    gap: 9px;
    font-size: 14.5px;
    font-weight: 700;
}

.fp-col-title svg {
    width: 16px;
    height: 16px;
    color: #ff4d6d;
    flex-shrink: 0;
}

.fp-col-head-right {
    display: flex;
    align-items: center;
    gap: 8px;
}

.fp-sel {
    font-size: 11.5px;
    color: #8b8e98;
}

.fp-sel b {
    color: #ff4d6d;
    font-weight: 700;
}

.fp-chev {
    width: 14px;
    height: 14px;
    color: #7a7d87;
    transform: rotate(180deg);
    transition: transform .3s ease;
}

.fp-col.collapsed .fp-chev {
    transform: rotate(0deg);
}

.fp-col-body {
    display: grid;
    grid-template-rows: 1fr;
    transition: grid-template-rows .35s ease;
}

.fp-col.collapsed .fp-col-body {
    grid-template-rows: 0fr;
}

.fp-col-inner {
    min-height: 0;
    overflow: hidden;
}

/* Чекбоксы */
.fp-checks {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.fp-scroll {
    max-height: 236px;
    overflow-y: auto;
    padding-right: 6px;
}

.fp-scroll::-webkit-scrollbar {
    width: 4px;
}

.fp-scroll::-webkit-scrollbar-track {
    background: transparent;
}

.fp-scroll::-webkit-scrollbar-thumb {
    background: #3a3d46;
    border-radius: 2px;
    transition: background .2s;
}

.fp-scroll::-webkit-scrollbar-thumb:hover {
    background: #ff4d6d;
}

.fp-check {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    border-radius: 10px;
    border: 1px solid transparent;
    cursor: pointer;
    color: #c9ccd4;
    font-size: 13.5px;
    transition: background .2s, border-color .2s, color .2s;
}

.fp-check:hover {
    background: #262831;
    color: #fff;
}

.fp-check:has(input:checked) {
    background: rgba(255, 77, 109, .10);
    border-color: rgba(255, 77, 109, .45);
    color: #fff;
}

.fp-check input {
    display: none;
}

.fp-box {
    width: 18px;
    height: 18px;
    border-radius: 6px;
    border: 1.5px solid #4a4d57;
    background: #20212a;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: all .2s ease;
}

.fp-check:hover .fp-box {
    border-color: #8b8e98;
}

.fp-check input:checked+.fp-box {
    background: linear-gradient(135deg, #ff4d6d, #d63a6a);
    border-color: transparent;
    box-shadow: 0 2px 10px rgba(255, 77, 109, .45);
}

.fp-check input:checked+.fp-box::after {
    content: '✓';
    color: #fff;
    font-size: 11px;
    line-height: 1;
    font-weight: 700;
    animation: ffPop .25s cubic-bezier(.34, 1.56, .64, 1);
}

.fp-name {
    flex: 1;
}

.fp-count {
    background: #262831;
    color: #8b8e98;
    font-size: 11px;
    font-weight: 600;
    padding: 3px 8px;
    border-radius: 8px;
    transition: all .2s;
}

.fp-check:has(input:checked) .fp-count {
    background: rgba(255, 77, 109, .18);
    color: #ff8fa3;
}

/* Колонка фэндома */
.fp-fandom-input {
    display: flex;
    align-items: center;
    gap: 8px;
    background: #20212a;
    border: 1px solid #2c2e36;
    border-radius: 10px;
    padding: 0 12px;
    transition: border-color .2s, box-shadow .2s;
}

.fp-fandom-input:focus-within {
    border-color: rgba(255, 77, 109, .6);
    box-shadow: 0 0 0 3px rgba(255, 77, 109, .12);
}

.fp-fandom-input svg {
    width: 14px;
    height: 14px;
    color: #7a7d87;
    flex-shrink: 0;
}

.fp-fandom-input input {
    flex: 1;
    background: none;
    border: none;
    outline: none;
    color: #fff;
    font-family: 'MyCustomFont';
    font-size: 13px;
    padding: 10px 0;
}

.fp-fandom-input input::placeholder {
    color: #5d6068;
}

.fp-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 10px;
}

.fp-pills:empty {
    margin-top: 0;
}

.fp-link {
    background: none;
    border: none;
    color: #8b8e98;
    font-size: 12px;
    cursor: pointer;
    font-family: 'MyCustomFont';
    margin-top: 10px;
    padding: 0;
    text-decoration: underline;
    text-underline-offset: 3px;
    transition: color .2s;
}

.fp-link:hover {
    color: #ff4d6d;
}

/* === Низ панели: активные фильтры + применить === */
.fp-bottom {
    display: flex;
    align-items: center;
    gap: 14px;
    flex-wrap: wrap;
    border-top: 1px solid #2c2e36;
    margin-top: 18px;
    padding-top: 16px;
}

.fp-active {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    flex: 1;
    min-width: 0;
}

.fp-active-label {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #8b8e98;
    font-size: 13px;
    flex-shrink: 0;
}

.fp-active-label svg {
    width: 15px;
    height: 15px;
}

.active-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.a-pill {
    display: flex;
    align-items: center;
    gap: 7px;
    background: #262831;
    border: 1px solid #3a3d46;
    color: #d5d8df;
    padding: 6px 12px;
    border-radius: 14px;
    font-size: 12.5px;
    font-family: 'MyCustomFont';
    animation: pillIn .25s ease;
}

@keyframes pillIn {
    from {
        opacity: 0;
        transform: scale(.85);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

.a-pill svg {
    width: 12px;
    height: 12px;
    color: #ff4d6d;
    flex-shrink: 0;
}

.a-pill button {
    background: none;
    border: none;
    color: #7a7d87;
    cursor: pointer;
    font-size: 12px;
    line-height: 1;
    padding: 0;
    transition: color .15s, transform .15s;
}

.a-pill button:hover {
    color: #ff4d6d;
    transform: scale(1.25);
}

.reset-all-btn {
    display: flex;
    align-items: center;
    gap: 7px;
    background: none;
    border: none;
    color: #8b8e98;
    font-family: 'MyCustomFont';
    font-size: 12.5px;
    cursor: pointer;
    padding: 6px 4px;
    text-decoration: underline;
    text-underline-offset: 3px;
    transition: color .2s;
}

.reset-all-btn:hover {
    color: #ff4d6d;
}

.reset-all-btn svg {
    width: 13px;
    height: 13px;
}

.fp-apply {
    display: flex;
    align-items: center;
    gap: 9px;
    margin-left: auto;
    background: linear-gradient(135deg, #ff4d6d, #d63a6a);
    border: none;
    color: #fff;
    font-family: 'MyCustomFont';
    font-size: 14px;
    font-weight: 700;
    padding: 12px 26px;
    border-radius: 12px;
    cursor: pointer;
    box-shadow: 0 8px 24px rgba(255, 77, 109, .35);
    transition: transform .2s ease, box-shadow .2s ease, filter .2s ease;
}

.fp-apply:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 30px rgba(255, 77, 109, .45);
    filter: brightness(1.05);
}

.fp-apply:active {
    transform: translateY(0) scale(.98);
}

.fp-apply svg {
    width: 15px;
    height: 15px;
}

/* === Заголовок и сетка === */
.fanfics-section-title {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 30px;
    font-weight: 800;
    margin: 36px 0 18px;
    color: #fff;
}

.fanfics-section-title svg {
    width: 26px;
    height: 26px;
    color: #ff4d6d;
    filter: drop-shadow(0 0 8px rgba(255, 77, 109, .5));
}

.fanfics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 22px;
}

.fanfics-loading,
.fanfics-empty {
    grid-column: 1 / -1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 14px;
    padding: 70px 20px;
    color: #7a7d87;
    font-size: 15px;
    text-align: center;
}

.ff-spinner {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    border: 3px solid #2c2e36;
    border-top-color: #ff4d6d;
    animation: spin .8s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.fanfics-empty-icon svg {
    width: 46px;
    height: 46px;
    color: #3a3d46;
    animation: floaty 2.6s ease-in-out infinite;
}

@keyframes floaty {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-8px);
    }
}

.fanfics-empty-title {
    font-size: 18px;
    color: #c9ccd4;
    font-weight: 700;
}

/* === Карточка === */
.ff-card {
    position: relative;
    display: flex;
    flex-direction: column;
    background: #1d1e24;
    border: 1px solid #2c2e36;
    border-radius: 16px;
    overflow: hidden;
    color: inherit;
    transition: transform .3s ease, box-shadow .3s ease, border-color .3s ease;
    animation: cardIn .45s ease backwards;
    animation-delay: var(--d, 0s);
}

@keyframes cardIn {
    from {
        opacity: 0;
        transform: translateY(18px) scale(.98);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.ff-card:hover {
    transform: translateY(-6px);
    border-color: rgba(255, 77, 109, .5);
    box-shadow: 0 16px 40px rgba(0, 0, 0, .5), 0 0 0 1px rgba(255, 77, 109, .25);
}

.ff-media {
    position: relative;
    height: 190px;
    overflow: hidden;
    background: #17181c;
}

.ff-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: brightness(.82) saturate(.95);
    transition: transform .45s ease, filter .45s ease;
}

.ff-card:hover .ff-img {
    transform: scale(1.06);
    filter: brightness(1) saturate(1);
}

.ff-media::after {
    content: '';
    position: absolute;
    inset: 0;
    pointer-events: none;
    background: linear-gradient(180deg, rgba(0, 0, 0, .25) 0%, transparent 30%, transparent 60%, rgba(13, 14, 17, .75) 100%);
}

.ff-rate {
    position: absolute;
    top: 10px;
    left: 10px;
    z-index: 2;
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 11px;
    font-weight: 700;
    padding: 4px 9px;
    border-radius: 8px;
    background: rgba(13, 14, 17, .72);
    backdrop-filter: blur(6px);
    border: 1px solid rgba(255, 255, 255, .08);
}

.ff-rate svg {
    width: 12px;
    height: 12px;
}

.rate-pg {
    color: #4ade80;
}

.rate-pg-13 {
    color: #60a5fa;
}

.rate-r {
    color: #fbbf24;
}

.rate-nc-17 {
    color: #f87171;
}

.ff-likes {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 2;
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 11.5px;
    font-weight: 700;
    color: #ffb3c0;
    padding: 4px 9px;
    border-radius: 8px;
    background: rgba(13, 14, 17, .72);
    backdrop-filter: blur(6px);
    border: 1px solid rgba(255, 255, 255, .08);
}

.ff-likes svg {
    width: 12px;
    height: 12px;
    color: #ff4d6d;
}

.ff-body {
    display: flex;
    flex-direction: column;
    flex: 1;
    padding: 14px 14px 12px;
    gap: 8px;
}

.ff-title {
    font-size: 15.5px;
    font-weight: 700;
    line-height: 1.35;
    color: #fff;
    margin: 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    transition: color .2s;
}

.ff-card:hover .ff-title {
    color: #ff8fa3;
}

.ff-sub {
    font-size: 12.5px;
    color: #8b8e98;
    margin-top: -4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ff-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.ff-tag {
    font-size: 10.5px;
    font-weight: 600;
    color: #aeb2bc;
    background: #262831;
    border: 1px solid #33363f;
    padding: 3px 9px;
    border-radius: 8px;
    transition: border-color .2s;
}

.ff-tag.more {
    color: #ff8fa3;
    background: rgba(255, 77, 109, .10);
    border-color: rgba(255, 77, 109, .35);
}

/* Подвал карточки: мета-строка + кнопка действия на отдельной строке */
.ff-list-foot {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: auto;
    padding-top: 10px;
    border-top: 1px solid #262831;
}

.ff-meta {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 11.5px;
    color: #8b8e98;
}

.ff-action-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    width: 100%;
    padding: 8px 14px;
    border-radius: 10px;
    background: rgba(255, 77, 109, .1);
    border: 1px solid rgba(255, 77, 109, .35);
    color: #ff8fa3;
    font-size: 12.5px;
    font-weight: 700;
    text-decoration: none;
    cursor: pointer;
    transition: background .2s, border-color .2s, color .2s, box-shadow .2s;
}

.ff-action-btn:hover,
.ff-card:hover .ff-action-btn {
    background: rgba(255, 77, 109, .22);
    border-color: rgba(255, 77, 109, .7);
    color: #fff;
    box-shadow: 0 0 14px rgba(255, 77, 109, .3);
}

.ff-m {
    display: flex;
    align-items: center;
    gap: 5px;
}

.ff-m svg {
    width: 13px;
    height: 13px;
    opacity: .8;
}

.ff-status {
    margin-left: auto;
    font-size: 10.5px;
    font-weight: 700;
    padding: 3px 10px;
    border-radius: 8px;
    border: 1px solid;
}

.st-ongoing {
    color: #ff7d95;
    border-color: rgba(255, 77, 109, .55);
    background: rgba(255, 77, 109, .08);
}

.st-completed {
    color: #9aa0ab;
    border-color: #3a3d46;
    background: #262831;
}

.st-frozen {
    color: #fbbf24;
    border-color: rgba(251, 191, 36, .45);
    background: rgba(251, 191, 36, .08);
}

/* === Пагинация === */
.fanfics-pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    margin-top: 44px;
    padding-bottom: 40px;
}

.page-btn {
    background: #1d1e24;
    border: 1px solid #2c2e36;
    color: #c9ccd4;
    min-width: 40px;
    height: 40px;
    padding: 0 12px;
    border-radius: 12px;
    cursor: pointer;
    font-family: 'MyCustomFont';
    font-size: 14px;
    transition: all .2s ease;
}

.page-btn:hover:not(:disabled):not(.active) {
    border-color: #3a3d46;
    color: #fff;
    transform: translateY(-2px);
}

.page-btn.active {
    background: linear-gradient(135deg, #ff4d6d, #d63a6a);
    border-color: transparent;
    color: #fff;
    box-shadow: 0 6px 18px rgba(255, 77, 109, .35);
}

.page-btn:disabled {
    opacity: .35;
    cursor: default;
}

.page-dots {
    color: #5d6068;
    padding: 0 4px;
}

/* === Блок создания === */
.fanfic-create-class {
    margin-top: 100px;
}

.fanfic-create-class {
    margin-top: 60px;
}

.fc-cta {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 300px;
    overflow: hidden;
    text-decoration: none;
    background-color: #17181c;
    border: 1px solid #2c2e36;
    border-radius: 20px;
    transition: border-color .3s ease, box-shadow .3s ease, transform .3s ease;
}

/* слой с картиной: лёгкий зум при наведении */
.fc-cta::before {
    content: '';
    position: absolute;
    inset: 0;
    z-index: 0;
    background: url('/static/images/banner_create.avif') center / cover no-repeat;
    transition: transform .6s ease;
}

.fc-cta:hover::before {
    transform: scale(1.03);
}

/* затемнение под текст, чтобы заголовок и кнопка читались */
.fc-cta::after {
    content: '';
    position: absolute;
    inset: 0;
    z-index: 1;
    background: radial-gradient(720px 280px at 50% 55%, rgba(13, 14, 17, .66), rgba(13, 14, 17, .30) 60%, transparent 82%);
}

/* SVG-декор теперь живёт внутри картины — прячем его слои */
.fc-papers,
.fc-pagoda,
.fc-moon {
    display: none;
}

.fc-cta:hover {
    border-color: rgba(255, 77, 109, .55);
    box-shadow: 0 18px 50px rgba(255, 77, 109, .15), 0 0 0 1px rgba(255, 77, 109, .25);
    transform: translateY(-3px);
}

.fc-content {
    position: relative;
    z-index: 3;
    text-align: center;
    padding: 44px 24px;
    max-width: 660px;
}

.fc-title {
    margin: 0 0 12px;
    font-size: 30px;
    font-weight: 800;
    color: #fff;
}

.fc-title b {
    color: #ff4d6d;
    text-shadow: 0 0 18px rgba(255, 77, 109, .55);
}

.fc-text {
    margin: 0 0 24px;
    color: #9a9ca1;
    font-size: 14px;
    line-height: 1.65;
}

.fc-btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    background: linear-gradient(135deg, #ff4d6d, #d63a6a);
    color: #fff;
    font-family: 'MyCustomFont';
    font-size: 14px;
    font-weight: 700;
    padding: 13px 28px;
    border-radius: 999px;
    box-shadow: 0 8px 26px rgba(255, 77, 109, .4);
    transition: transform .2s ease, box-shadow .2s ease, filter .2s ease;
}

.fc-cta:hover .fc-btn {
    transform: translateY(-2px);
    filter: brightness(1.07);
    box-shadow: 0 12px 32px rgba(255, 77, 109, .5);
}

.fc-btn svg {
    width: 15px;
    height: 15px;
}

.fc-arrow {
    transition: transform .2s ease;
}

.fc-cta:hover .fc-arrow {
    transform: translateX(4px);
}

/* --- декор: луна и пагода справа --- */
.fc-moon {
    position: absolute;
    right: 96px;
    top: 24px;
    width: 130px;
    height: 130px;
    border-radius: 50%;
    background: radial-gradient(circle at 35% 35%, rgba(255, 120, 150, .5), rgba(255, 77, 109, .18) 60%, transparent 75%);
    filter: blur(2px);
    z-index: 1;
}

.fc-pagoda {
    position: absolute;
    right: 42px;
    bottom: -8px;
    width: 200px;
    color: #3a1218;
    opacity: .9;
    z-index: 2;
}

.fc-pagoda svg {
    width: 100%;
    height: auto;
    display: block;
}

/* --- декор: стопка бумаг с тории слева --- */
.fc-papers {
    position: absolute;
    left: 48px;
    top: 50%;
    transform: translateY(-50%);
    width: 175px;
    z-index: 2;
    opacity: .95;
}

.fc-papers svg {
    width: 100%;
    height: auto;
    display: block;
    filter: drop-shadow(0 0 14px rgba(255, 77, 109, .35));
}

/* --- вертикальный иероглиф --- */
.fc-kanji {
    position: absolute;
    left: 26px;
    top: 18px;
    z-index: 2;
    writing-mode: vertical-rl;
    font-size: 34px;
    letter-spacing: 6px;
    color: rgba(255, 77, 109, .18);
    user-select: none;
}

/* --- лепестки сакуры --- */
.fc-petal {
    position: absolute;
    width: 12px;
    height: 12px;
    background: #ff8fa3;
    border-radius: 100% 0 100% 0;
    opacity: .5;
    z-index: 2;
    animation: fcFloat 6s ease-in-out infinite;
}

.fc-petal.p1 {
    left: 24%;
    top: 28%;
}

.fc-petal.p2 {
    left: 66%;
    top: 20%;
    width: 9px;
    height: 9px;
    animation-delay: 1.4s;
}

.fc-petal.p3 {
    left: 80%;
    top: 62%;
    width: 10px;
    height: 10px;
    animation-delay: 2.6s;
}

.fc-petal.p4 {
    left: 36%;
    top: 74%;
    width: 8px;
    height: 8px;
    animation-delay: 3.8s;
}

@keyframes fcFloat {

    0%,
    100% {
        transform: translate(0, 0) rotate(0deg);
    }

    50% {
        transform: translate(10px, 14px) rotate(40deg);
    }
}

/* --- мобильная версия --- */
@media (max-width: 800px) {

    .fc-papers,
    .fc-pagoda,
    .fc-moon,
    .fc-kanji {
        display: none;
    }

    .fc-title {
        font-size: 24px;
    }

    .fc-cta {
        min-height: 220px;
    }
}

/* === Адаптив === */
@media (max-width: 900px) {
    .fanfics-page {
        padding: 24px 20px 40px;
    }

    .fanfic-topbar {
        flex-wrap: wrap;
    }

    .fanfic-search-bar {
        flex-basis: 100%;
        order: 1;
    }

    .fanfic-topbar-btns {
        order: 2;
        margin-left: auto;
    }

    .fp-bottom {
        flex-direction: column;
        align-items: stretch;
    }

    .fp-apply {
        margin-left: 0;
        justify-content: center;
    }
}


/* ==========================================
   GLOBAL SKELETON SHIMMER LOADING
   ========================================== */
@keyframes ahShimmer {
    0% {
        background-position: -200% 0;
    }

    100% {
        background-position: 200% 0;
    }
}

.ff-media,
.mg-media,
.fanfic-card-cover,
.ad-sim-card,
.ad-cover-wrap,
.md-media,
.md-mini-media {
    background: linear-gradient(90deg, #17181c 0%, #252833 35%, #333747 50%, #252833 65%, #17181c 100%) !important;
    background-size: 250% 100% !important;
    animation: ahShimmer 2.2s infinite ease-in-out !important;
}

.ff-img,
.mg-media img,
.fanfic-card-cover img,
.ad-sim-card img,
.md-media img,
.md-mini-media img {
    transition: opacity 0.35s ease;
}

/* ==========================================
   МОБИЛЬНЫЙ АДАПТИВ КАТАЛОГА (ФАНФИКИ, АНИМЕ, МАНГА)
   ========================================== */
@media (max-width: 768px) {
    .fanfics-page {
        padding: 16px 14px 24px !important;
    }

    /* Верхняя панель поиска и кнопок */
    .fanfic-topbar {
        width: 100% !important;
        max-width: 100% !important;
        min-width: 0 !important;
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 10px !important;
    }

    .fanfic-search-bar {
        width: 100% !important;
        max-width: 100% !important;
        box-sizing: border-box !important;
        height: 44px !important;
        padding: 0 14px !important;
        border-radius: 12px !important;
    }

    .fanfic-topbar-btns {
        width: 100% !important;
        max-width: 100% !important;
        min-width: 0 !important;
        display: flex !important;
        flex-wrap: nowrap !important;
        overflow-x: auto !important;
        padding-bottom: 4px !important;
        margin: 0 !important;
        gap: 8px !important;
        scrollbar-width: none !important;
        -webkit-overflow-scrolling: touch !important;
    }

    .fanfic-topbar-btns::-webkit-scrollbar {
        display: none !important;
    }

    .topbar-btn {
        height: 40px !important;
        padding: 0 14px !important;
        font-size: 13px !important;
        border-radius: 10px !important;
        white-space: nowrap !important;
        flex-shrink: 0 !important;
    }

    /* Меню сортировки на мобильных устройствах — открывается вниз от верхней панели */
    .sort-menu {
        position: absolute !important;
        top: calc(100% + 8px) !important;
        bottom: auto !important;
        left: auto !important;
        right: 0 !important;
        width: 280px !important;
        max-width: calc(100vw - 28px) !important;
        margin: 0 !important;
        z-index: 99999 !important;
        border-radius: 16px !important;
        box-shadow: 0 20px 60px rgba(0, 0, 0, 0.95), 0 0 0 1px rgba(255, 255, 255, 0.12) !important;
        display: none !important;
        transform: none !important;
        transition: none !important;
    }

    .sort-menu.open {
        display: block !important;
        opacity: 1 !important;
        transform: none !important;
        visibility: visible !important;
        pointer-events: auto !important;
    }

    /* Панель фильтров на мобильных */
    .filters-panel {
        max-height: 80vh !important;
        overflow-y: auto !important;
        padding: 16px !important;
        border-radius: 16px !important;
    }

    .fp-columns {
        grid-template-columns: 1fr !important;
        gap: 16px !important;
    }

    .filters-actions {
        flex-direction: column !important;
        gap: 8px !important;
    }

    .filters-actions button {
        width: 100% !important;
        height: 42px !important;
    }

    /* Смарт-теги горизонтальный скролл без отступа по высоте со строкой фильтров.
       padding-left/right = 0 — ряд должен начинаться вровень с поиском
       и кнопками фильтров/сортировки (иначе «Топ сезона» и
       «Онгоинги недели» визуально съезжают вправо). */
    .catalog-smart-tags {
        overflow-x: auto !important;
        padding: 0 0 4px 0 !important;
        margin: 2px 0 8px 0 !important;
        flex-wrap: nowrap !important;
        gap: 8px !important;
        scrollbar-width: none !important;
        -webkit-overflow-scrolling: touch !important;
    }

    .catalog-smart-tags::-webkit-scrollbar {
        display: none !important;
    }

    .smart-tag {
        flex-shrink: 0 !important;
        font-size: 12.5px !important;
        padding: 7px 12px !important;
        border-radius: 10px !important;
    }

    /* Сетка карточек — 3 колонки в обычной сетке, 4 в компактной на мобильных */
    .fanfics-grid:not(.view-compact):not(.view-list),
    .fanfics-grid.view-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
        gap: 8px !important;
    }
    .fanfics-grid.view-compact {
        grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
        gap: 5px !important;
    }

    .ff-card {
        border-radius: 12px !important;
        width: 100% !important;
        min-width: 0 !important;
        box-sizing: border-box !important;
        content-visibility: auto !important;
        contain-intrinsic-size: auto 240px !important;
        overflow: hidden !important;
    }

    .ff-media {
        aspect-ratio: 2 / 2.85 !important;
        max-height: 200px !important;
        height: auto !important;
        width: 100% !important;
    }

    .ff-body {
        padding: 7px 9px 9px !important;
        gap: 3px !important;
    }

    .ff-title {
        font-size: 12px !important;
        line-height: 1.25 !important;
        -webkit-line-clamp: 2 !important;
    }

    .ff-sub {
        font-size: 10px !important;
    }

    .ff-desc-snippet,
    .ff-tags {
        display: none !important;
    }

    .ff-meta {
        font-size: 9.5px !important;
        gap: 6px !important;
        padding-top: 3px !important;
    }

    .ff-stats {
        gap: 8px !important;
        font-size: 11px !important;
    }

    .ff-stat {
        gap: 3px !important;
    }

    .ff-stat svg {
        width: 12px !important;
        height: 12px !important;
    }

    .fanfics-section-title {
        font-size: 18px !important;
        margin: 16px 0 12px !important;
    }

    .fanfics-pagination {
        gap: 6px !important;
        margin-top: 24px !important;
    }

    .fp-page {
        width: 36px !important;
        height: 36px !important;
        font-size: 13px !important;
    }
}