/* static/css/main.css */

/* === 0. VARIABLES & UTILS === */
:root {
    --bg-body: #000000;
    --bg-glass: rgba(12, 12, 14, 0.85);
    --bg-glass-modal: rgba(12, 12, 14, 0.95);
    --accent: #F72D4B; /* Красный */
    --text-main: #FFFFFF;
    --text-muted: rgba(255, 255, 255, 0.6); /* 60% белый */
    --text-dim: rgba(255, 255, 255, 0.3);
    --border-light: rgba(255, 255, 255, 0.1);
    --avatar-heart-mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100'><path fill='black' d='M50 88L44 82C20 61 5 48 5 30C5 16 16 5 30 5C38 5 46 9 50 16C54 9 62 5 70 5C84 5 95 16 95 30C95 48 80 61 56 82Z'/></svg>");
    --avatar-squircle-mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100'><path fill='black' d='M50 2C35 2 24 2 15.5 6.5C10.2 9.2 6.2 13.2 3.5 18.5C-1 27 -1 38 -1 53C-1 68 0 79 4.5 87.5C7.2 92.8 11.2 96.8 16.5 99.5C25 104 36 104 51 104C66 104 77 103 85.5 98.5C90.8 95.8 94.8 91.8 97.5 86.5C102 78 102 67 102 52C102 37 101 26 96.5 17.5C93.8 12.2 89.8 8.2 84.5 5.5C76 1 65 2 50 2Z'/></svg>");

    --font-main: 'Inter', sans-serif;
    --font-logo: 'Montserrat', sans-serif;
}

/* ВАЖНО: Скрывает элементы до загрузки Alpine */
[x-cloak] { display: none !important; }

/* Общий класс для центрирования (DRY) */
.flex-center,
.logo-block, .avatar-block, .search-container-wrapper, .search-block-initial,
.gradient-style, .tab-item, .icon-btn, .acc-close-btn, .acc-card-cover-box {
    display: flex;
    align-items: center;
    justify-content: center;
}

/* === 1. GLOBAL & RESET === */
html {
    scroll-behavior: auto;
}

::-webkit-scrollbar {
    width: 0px !important;
    height: 1px !important;
}

body {
    background-color: var(--bg-body);
    margin: 0; padding: 0;
    font-family: var(--font-main);
    color: var(--text-main);
    min-height: 100vh;
    overflow-x: hidden;
}
body.modal-open { overflow: hidden; overscroll-behavior: none; }
body.standalone-mobile-surface-open { overflow: hidden; overscroll-behavior: none; }
body, body * {
    -webkit-user-select: none;
    user-select: none;
}
img {
    -webkit-user-drag: none;
    user-drag: none;
}
input,
textarea,
select,
[contenteditable="true"] {
    -webkit-user-select: text;
    user-select: text;
}
a { text-decoration: none; color: inherit; }
.content-no-pad {
    padding-top: 0 !important;
    width: calc(100% - 40px);
    margin: 0 20px;
    box-sizing: border-box;
}
.drag-scroll-active {
    user-select: none;
}
.hidden { display: none !important; }

/* === 2. HEADER LAYOUT === */
header {
    height: 73px; width: 100%;
    display: flex; justify-content: center;
    position: relative; z-index: 50;
    background: #000;
}

@media (min-width: 769px) {
    body {
        padding-top: 73px;
        box-sizing: border-box;
    }

    header {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        z-index: 120;
        background: rgba(0, 0, 0, 0.92);
        border-bottom: none;
        backdrop-filter: blur(22px) saturate(1.14);
        -webkit-backdrop-filter: blur(22px) saturate(1.14);
    }
}

.search-mobile-bottom-count-slot {
    display: none;
}

.header-grid {
    width: 1319px; max-width: 100%; height: 100%;
    display: grid;
    grid-template-columns: 200px 1fr 200px; /* 200px по краям */
    align-items: center;
    padding: 0; /* Убрали паддинг по твоему запросу */
    box-sizing: border-box;
}

.logo-block, .moments-block, .avatar-block { height: 100%; cursor: pointer; }
.moments-block { display: none; }
.mobile-library-block {
    display: none;
}
.search-container-wrapper { position: relative; z-index: 51; }

/* Elements */
.logo-text {
    font-family: var(--font-logo); font-weight: 900;
    font-size: 22px; color: #E01F3D; letter-spacing: 0.5px;
}
.mobile-header-icon-wrap,
.mobile-header-icon {
    display: none;
}
.user-avatar {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background-color: #333;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    flex-shrink: 0;
}

.avatar-frame-circle {
    border-radius: 50% !important;
    -webkit-mask-image: none;
    mask-image: none;
}

.avatar-frame-heart {
    border-radius: 0 !important;
    -webkit-mask-image: var(--avatar-heart-mask);
    mask-image: var(--avatar-heart-mask);
    -webkit-mask-repeat: no-repeat;
    mask-repeat: no-repeat;
    -webkit-mask-position: center;
    mask-position: center;
    -webkit-mask-size: 100% 100%;
    mask-size: 100% 100%;
}

.avatar-frame-squircle {
    border-radius: 36% !important;
    -webkit-mask-image: var(--avatar-squircle-mask);
    mask-image: var(--avatar-squircle-mask);
    -webkit-mask-repeat: no-repeat;
    mask-repeat: no-repeat;
    -webkit-mask-position: center;
    mask-position: center;
    -webkit-mask-size: 100% 100%;
    mask-size: 100% 100%;
}

.avatar-frame-heart .user-avatar-media,
.avatar-frame-heart .user-avatar-fallback,
.avatar-frame-heart .panel-avatar,
.avatar-frame-heart .panel-avatar-fallback,
.avatar-frame-heart .settings-avatar-frame-thumb-media,
.avatar-frame-heart .settings-avatar-frame-thumb-fallback,
.avatar-frame-heart .comment-avatar,
.avatar-frame-heart .user-avatar-small,
.avatar-frame-heart .friend-avatar,
.avatar-frame-heart .moment-comment-avatar,
.avatar-frame-heart .search-all-cover,
.avatar-frame-heart img,
.avatar-frame-squircle .user-avatar-media,
.avatar-frame-squircle .user-avatar-fallback,
.avatar-frame-squircle .panel-avatar,
.avatar-frame-squircle .panel-avatar-fallback,
.avatar-frame-squircle .settings-avatar-frame-thumb-media,
.avatar-frame-squircle .settings-avatar-frame-thumb-fallback,
.avatar-frame-squircle .comment-avatar,
.avatar-frame-squircle .user-avatar-small,
.avatar-frame-squircle .friend-avatar,
.avatar-frame-squircle .moment-comment-avatar,
.avatar-frame-squircle .search-all-cover,
.avatar-frame-squircle img {
    border-radius: 0 !important;
}

.user-avatar-media,
.user-avatar-fallback {
    width: 100%;
    height: 100%;
    border-radius: 50%;
}

.user-avatar-media {
    object-fit: cover;
    display: block;
}

.user-avatar-fallback {
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    color: #fff;
}

.avatar-block,
.panel-avatar-wrapper {
    position: relative;
}

.user-online-indicator {
    position: absolute;
    right: 0;
    bottom: -2px;
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: #31d158;
    border: 1px solid rgba(12, 12, 14, 0.95);
    box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.24);
    pointer-events: none;
}

/* === 3. SEARCH UI === */
.gradient-style {
    background:
        linear-gradient(#0C0C0E, #0C0C0E) padding-box,
        linear-gradient(to bottom, var(--border-light) 0%, rgba(255, 255, 255, 0) 100%) border-box;
    border: 1px solid transparent; color: white;
}

.search-input-style {
    width: 363px; height: 34px; outline: none;
    font-family: var(--font-main); font-weight: 700; font-size: 14px; text-align: center;
    border-radius: 999px; cursor: pointer; color: white;
}
.search-input-style.search-history-active {
    background:
        linear-gradient(#0C0C0E, #0C0C0E) padding-box,
        linear-gradient(to bottom, var(--border-light) 0%, rgba(255, 255, 255, 0) 100%) border-box;
    border: 1px solid transparent;
    cursor: text;
}
.search-input-style::placeholder { color: rgba(255, 255, 255, 0.6); letter-spacing: 0.05em; transition: opacity 0.3s ease; }
.search-input-style:focus::placeholder { opacity: 0; }
.side-btn { width: 32px; height: 32px; cursor: pointer; color: var(--accent); margin: 0 5px; border-radius: 50%; }
.side-btn.gradient-style { color: #F72D4B !important; }
.feature-disabled {
    opacity: 0.45;
    cursor: not-allowed !important;
}
.header-side-icon-mask {
    width: 16px;
    height: 16px;
    display: block;
    background-color: #F72D4B;
    -webkit-mask-image: var(--icon-url);
    mask-image: var(--icon-url);
    -webkit-mask-repeat: no-repeat;
    mask-repeat: no-repeat;
    -webkit-mask-position: center;
    mask-position: center;
    -webkit-mask-size: contain;
    mask-size: contain;
}

/* === 4. MODALS (Search & History) === */
.search-modal-container {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    z-index: 100;
    transition: top 0.3s cubic-bezier(0.25, 1, 0.5, 1);
}
.search-modal-container.mode-history { top: 74px; }
.search-modal-container.mode-results { top: 0px; }

.glass-window {
    background-color: var(--bg-body);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 18px; box-shadow: 0 30px 60px rgba(0,0,0,0.9);
    overflow: hidden; display: flex; flex-direction: column; align-items: center;
    opacity: 0; transform: translateY(-10px);
    transition: opacity 0.2s ease, transform 0.2s ease, background-color 0.8s ease 0.3s;
}
.glass-window.visible {
    opacity: 1; transform: translateY(0);
    background-color: var(--bg-glass); backdrop-filter: blur(20px);
}

/* --- TABS (Refactored) --- */
.window-history { width: 363px; min-height: 447px; padding: 7px; box-sizing: border-box; }

.tabs-container {
    width: 347px; height: 33px;
    background: transparent;
    display: flex; justify-content: space-between;
    margin-bottom: 20px;
}

.tab-item {
    flex: 1;
    font-size: 12px; font-weight: 700;
    cursor: pointer;
    color: var(--text-muted); /* 60% opacity */
    transition: color 0.2s ease;
}

.tab-item.active {
    background: transparent; /* Убрали фон */
    color: var(--text-main); /* 100% white */
    text-shadow: 0 0 10px rgba(255,255,255,0.3); /* Легкое свечение */
}

/* History Rows */
.history-row {
    width: 347px; height: 37px; display: flex; align-items: center;
    margin-bottom: 0; cursor: pointer; border-radius: 8px;
    transition: background 0.2s; padding: 0 5px; box-sizing: border-box;
}
.history-row:hover { background: rgba(255,255,255,0.05); }
.hist-mini-cover { width: 32px; height: 32px; border-radius: 6px; object-fit: cover; margin-right: 12px; }
.hist-text-block { flex: 1; display: flex; flex-direction: column; justify-content: center; }
.hist-title { font-size: 13px; font-weight: 700; color: white; line-height: 1.1; }
.hist-sub { font-size: 10px; font-weight: 700; color: rgba(255,255,255,0.4); }
.hist-lightning {
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.hist-lightning img {
    width: 14px;
    height: 14px;
    display: block;
    opacity: 0.6;
}

/* Results */
.window-results { width: 760px; padding-bottom: 0; position: relative; margin-top: 9px; }
.search-duplicate-container { width: 100%; height: 52px; display: flex; justify-content: center; align-items: center; margin-bottom: 0; padding-top: 0; }
.search-input-internal {
    width: 363px; height: 34px; outline: none;
    font-family: var(--font-main); font-weight: 700; font-size: 14px; text-align: center;
    border-radius: 999px; cursor: pointer;
    background: var(--border-light); border: 1px solid var(--border-light); color: var(--text-muted);
}
.btn-internal {
    width: 32px; height: 32px; border-radius: 50%; margin: 0 6px;
    color: var(--accent); cursor: pointer; background: var(--border-light);
}

.universe-header { width: 100%; height: 75px; display: none; align-items: center; justify-content: center; font-family: var(--font-main); font-weight: 800; font-size: 16px; color: white; text-transform: uppercase; letter-spacing: 0.5px; }
.universe-header.active { display: flex; }

.results-grid { display: grid; grid-template-columns: repeat(3, 227px); gap: 0px; justify-content: center; padding-bottom: 20px; }
.anime-card-res {
    width: 227px;
    min-height: 430px;
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 20px;
    position: relative;
    z-index: 0;
    transition: transform 1s ease;
    --meta-highlight-top: 278px;
}
.res-cover { width: 187px; height: 266px; border-radius: 12px; object-fit: cover; transition: transform 0.2s; cursor: pointer; }
.res-cover:hover { transform: scale(1.03); }
.anime-card-notification-btn {
    position: absolute;
    top: 10px;
    left: 50%;
    transform: translateX(-50%);
    width: 34px;
    height: 34px;
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 999px;
    background: rgba(12, 12, 16, 0.56);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 4;
    transition: background 0.16s ease, transform 0.16s ease, border-color 0.16s ease, opacity 0.16s ease;
}
.anime-card-notification-btn:hover {
    background: rgba(247, 45, 75, 0.24);
    border-color: rgba(247, 45, 75, 0.5);
    transform: translateX(-50%) translateY(-1px);
}

.anime-card-notification-btn.is-active {
    background: rgba(247, 45, 75, 0.22);
    border-color: rgba(247, 45, 75, 0.56);
}

.anime-card-notification-btn.is-active .anime-card-notification-icon {
    opacity: 1;
}
.anime-card-notification-icon {
    width: 13px;
    height: 13px;
    display: block;
    opacity: 0.92;
}
@media (hover: hover) and (pointer: fine) {
    .anime-card-notification-btn {
        opacity: 0;
        pointer-events: none;
        transform: translateX(-50%) translateY(-6px);
    }

    .library-anime-card:has(.res-cover:hover) .anime-card-notification-btn,
    .library-anime-card:has(.res-cover:focus-visible) .anime-card-notification-btn,
    .library-anime-card:has(.anime-card-notification-btn:hover) .anime-card-notification-btn,
    .library-anime-card:has(.anime-card-notification-btn:focus-visible) .anime-card-notification-btn {
        opacity: 1;
        pointer-events: auto;
        transform: translateX(-50%) translateY(0);
    }
}

@supports not selector(.library-anime-card:has(.res-cover:hover)) {
    @media (hover: hover) and (pointer: fine) {
        .library-anime-card:hover .anime-card-notification-btn,
        .library-anime-card:focus-within .anime-card-notification-btn {
            opacity: 1;
            pointer-events: auto;
            transform: translateX(-50%) translateY(0);
        }
    }
}
.res-title {
    width: min(205px, 100%);
    padding: 0 2px;
    box-sizing: border-box;
    font-weight: 900;
    font-size: 15px;
    color: white;
    margin-top: 18px;
    line-height: 1.25;
    text-align: center;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    white-space: normal;
    overflow-wrap: anywhere;
    word-break: break-word;
    min-height: 2.5em;
}
.res-info { width: 187px; font-size: 13px; font-weight: 700; color: rgba(255, 255, 255, 0.6); margin-top: 6px; text-align: center; line-height: 1.2; }
.res-buttons-block { height: 62px; width: 187px; display: flex; align-items: center; justify-content: center; gap: 15px; }
.card-library-label { font-size: 14px; font-weight: 700; color: rgba(255,255,255,1); margin-top: 0; margin-bottom: 20px; text-align: center; width: 100%; }
.icon-btn { color: rgba(255,255,255,0.6); cursor: pointer; transition: 0.2s; width: 24px; height: 24px; display:flex; align-items:center; justify-content:center; }
.icon-btn:hover { color: #fff; }
.icon-btn-img { width: 16px; height: 16px; opacity: 0.6; display:block; transition: opacity 0.15s ease, filter 0.15s ease; }
.icon-btn:hover .icon-btn-img { opacity: 1; }
.icon-btn-link.copied .icon-btn-img { opacity: 1; filter: brightness(0) saturate(100%) invert(91%) sepia(38%) saturate(4271%) hue-rotate(47deg) brightness(107%) contrast(109%); }

.anime-card-res.in-library::before {
    content: '';
    position: absolute;
    top: calc(var(--meta-highlight-top) + 7px);
    right: -3px;
    bottom: -3px;
    left: -3px;
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid transparent;
    border-radius: 20px;
    background-clip: padding-box;
    z-index: -1;
    pointer-events: none;
}

/* home page additions */
.home-section { margin: 40px 20px; width: calc(100% - 40px); max-width: none; padding: 10px; box-sizing: border-box; }
.home-section-load-sentinel { width: 100%; height: 1px; }
.home-moments-load-sentinel { width: 100%; height: 1px; }
.home-section .list-content-grid[data-home-needs-initial="1"] {
    min-height: 320px;
}
.home-mobile-brand,
.home-mobile-tabs {
    display: none;
}
.home-title { font-size: 28px; font-weight: 700; margin-bottom: 18px; text-align: left; margin-left: 14px; font-family: 'Inter', sans-serif; }
.home-title-link {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: inherit;
    text-decoration: none;
}
.home-title-link:visited {
    color: inherit;
}
.home-title-link:hover {
    color: inherit;
    opacity: 0.92;
}
body.client-verify-active {
    overflow: hidden;
    touch-action: none;
}
.home-title[data-home-section-title="retro"],
.home-title[data-home-section-title="movies"],
.home-title[data-home-section-title="top100"] {
    color: #FF3D51;
}
.home-section-open-card {
    width: 187px;
    min-width: 187px;
    min-height: 266px;
    border-radius: 22px;
    border: 1px solid rgba(255, 255, 255, 0.14);
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.04));
    color: #fff;
    text-decoration: none;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    box-sizing: border-box;
    transition: transform 0.18s ease, border-color 0.18s ease, background 0.18s ease;
}
.home-section-open-card:hover {
    transform: translateY(-2px);
    border-color: rgba(255, 255, 255, 0.28);
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.12), rgba(255, 255, 255, 0.06));
}
.home-section-open-card-moment {
    width: 253px;
    min-width: 253px;
    min-height: 151px;
}
.home-section-open-card-universe {
    min-height: 51px;
}
.home-section-open-copy {
    font-size: 13px;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.72);
}
.home-section-open-icon {
    width: 28px;
    height: 28px;
    object-fit: contain;
}
.home-section-open-card-universe .home-section-open-icon {
    width: 22px;
    height: 22px;
}
.home-collection-page {
    max-width: 1360px;
    margin: 30px auto 60px;
}
.home-collection-header-shell {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 18px;
}
.home-collection-layout {
    display: grid;
    grid-template-columns: minmax(0, 908px) minmax(280px, 304px);
    gap: 28px;
    align-items: start;
    max-width: 1240px;
    margin: 0 auto;
    justify-content: center;
}
.home-collection-layout.is-single-column {
    grid-template-columns: minmax(0, 1fr);
}
.home-collection-main {
    min-width: 0;
    max-width: 100%;
}
.collection-page-filter-toggle {
    display: none;
    flex-shrink: 0;
}
.home-collection-header {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 22px;
}
.home-collection-back-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    width: fit-content;
    color: rgba(255, 255, 255, 0.72);
    text-decoration: none;
    font-size: 14px;
    font-weight: 700;
}
.home-collection-back-icon {
    width: 18px;
    height: 18px;
    transform: rotate(180deg);
}
.home-collection-title {
    margin-bottom: 0;
}
.home-collection-meta {
    margin-left: 14px;
    color: rgba(255, 255, 255, 0.52);
    font-size: 13px;
    font-weight: 700;
}
.home-collection-results {
    grid-template-columns: repeat(auto-fit, minmax(227px, 227px));
    gap: 0;
    justify-content: center;
    justify-items: center;
    width: min(100%, 908px);
    margin: 0 auto;
}
.home-collection-moments-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(253px, 253px));
    gap: 14px;
    justify-content: center;
    padding-bottom: 20px;
}
.home-collection-universes-grid {
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}
.home-collection-filters {
    position: sticky;
    top: 96px;
    width: 304px;
    max-width: 100%;
    justify-self: end;
}
.home-collection-filter-box {
    width: 100%;
    padding: 20px 18px;
    border-radius: 28px;
    box-sizing: border-box;
}
.home-collection-filters .home-collection-filter-box {
    opacity: 1;
    transform: none;
}
.home-collection-filter-box-modal {
    width: min(340px, calc(100vw - 24px));
    max-height: calc(100vh - 28px);
    overflow-y: auto;
}
.home-collection-filter-title {
    font-size: 14px;
    font-weight: 900;
    color: #fff;
    margin-bottom: 12px;
}
.home-collection-filter-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 18px;
}
.home-collection-filter-chip {
    min-height: 34px;
    padding: 0 14px;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(255, 255, 255, 0.04);
    color: rgba(255, 255, 255, 0.74);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 800;
    transition: background 0.16s ease, border-color 0.16s ease, color 0.16s ease;
}
.home-collection-filter-chip.is-active,
.home-collection-filter-chip:hover {
    background: rgba(247, 45, 75, 0.18);
    border-color: rgba(247, 45, 75, 0.42);
    color: #fff;
}
.home-collection-filter-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
}
.home-collection-filter-field {
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.home-collection-filter-field > span {
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.02em;
    color: rgba(255, 255, 255, 0.72);
    text-transform: uppercase;
}
.home-collection-filter-select {
    width: 100%;
    min-height: 42px;
    border-radius: 14px;
    border: 1px solid rgba(255, 255, 255, 0.14);
    background: rgba(255, 255, 255, 0.05);
    color: #fff;
    font-size: 14px;
    font-weight: 700;
    padding: 0 12px;
    box-sizing: border-box;
}
.home-collection-filter-select:focus {
    outline: none;
    border-color: rgba(247, 45, 75, 0.42);
}
.home-collection-filter-inline {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}
.home-collection-filter-radio,
.home-collection-filter-checkbox {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: rgba(255, 255, 255, 0.84);
    font-size: 13px;
    font-weight: 700;
}
.home-collection-filter-radio input,
.home-collection-filter-checkbox input {
    accent-color: #f72d4b;
}
.home-collection-genre-open-btn {
    width: 100%;
    min-height: 42px;
    padding: 0 14px;
    border-radius: 14px;
    border: 1px solid rgba(255, 255, 255, 0.14);
    background: rgba(255, 255, 255, 0.06);
    color: #fff;
    font-size: 13px;
    font-weight: 800;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    cursor: pointer;
    transition: background 0.16s ease, border-color 0.16s ease;
}
.home-collection-genre-open-btn:hover {
    background: rgba(255, 255, 255, 0.09);
    border-color: rgba(247, 45, 75, 0.42);
}
.home-collection-genre-open-btn img {
    width: 16px;
    height: 16px;
    opacity: 0.88;
}
.home-collection-genre-summary {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}
.home-collection-genre-chip {
    display: inline-flex;
    align-items: center;
    min-height: 28px;
    padding: 0 11px;
    border-radius: 999px;
    background: rgba(247, 45, 75, 0.14);
    border: 1px solid rgba(247, 45, 75, 0.22);
    color: #fff;
    font-size: 12px;
    font-weight: 800;
}
.home-collection-genre-hidden-inputs {
    display: none;
}
.home-collection-filter-empty {
    color: rgba(255, 255, 255, 0.52);
    font-size: 13px;
    font-weight: 700;
}
.home-collection-filter-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 4px;
}
.home-collection-filter-submit,
.home-collection-filter-reset {
    min-height: 40px;
    padding: 0 16px;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.14);
    background: rgba(255, 255, 255, 0.06);
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    font-size: 13px;
    font-weight: 800;
    cursor: pointer;
}
.home-collection-filter-submit {
    background: rgba(247, 45, 75, 0.92);
    border-color: rgba(247, 45, 75, 0.92);
}
.home-collection-pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 14px;
    margin-top: 20px;
}
.home-collection-page-btn {
    min-width: 112px;
    padding: 10px 16px;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.16);
    background: rgba(255, 255, 255, 0.05);
    color: #fff;
    text-align: center;
    text-decoration: none;
    font-weight: 700;
}
.home-collection-page-btn.is-disabled {
    opacity: 0.38;
    pointer-events: none;
}
.home-collection-page-label {
    color: rgba(255, 255, 255, 0.58);
    font-size: 13px;
    font-weight: 700;
}
@media (max-width: 1220px) {
    .home-collection-header-shell {
        flex-direction: column;
        align-items: stretch;
    }

    .collection-page-filter-toggle {
        display: inline-flex;
        width: fit-content;
        align-self: flex-start;
    }

    .home-collection-layout {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .home-collection-filters {
        display: none;
    }
}
.home-header-cards-section {
    margin-top: 18px;
}
.home-header-cards {
    display: grid;
    grid-template-columns: repeat(9, 120px);
    grid-auto-rows: 162px;
    gap: 23px;
    justify-content: center;
    overflow-x: auto;
    overflow-y: hidden;
    padding: 4px 4px 10px;
}
.home-header-card {
    --home-header-gradient: linear-gradient(145deg, rgba(56, 126, 255, 0.7), rgba(104, 230, 220, 0.62));
    width: 120px;
    height: 162px;
    border-radius: 20px;
    overflow: hidden;
    position: relative;
    background: var(--home-header-gradient);
    border: 1px solid rgba(255, 255, 255, 0.15);
    cursor: pointer;
    transition: transform 0.2s ease, border-color 0.2s ease, filter 0.2s ease;
}
.home-header-card:hover {
    transform: translateY(-2px);
    border-color: rgba(255, 255, 255, 0.15);
    filter: brightness(1.04);
}
.home-header-card-label {
    position: absolute;
    left: 10px;
    right: 10px;
    bottom: 10px;
    font-size: 12px;
    font-weight: 800;
    line-height: 1.25;
    color: #fff;
    text-shadow: 0 1px 6px rgba(0, 0, 0, 0.38);
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    word-break: break-word;
}
.home-header-card:nth-child(8n + 1) { --home-header-gradient: linear-gradient(145deg, rgba(66, 149, 255, 0.72), rgba(119, 255, 219, 0.64)); }
.home-header-card:nth-child(8n + 2) { --home-header-gradient: linear-gradient(145deg, rgba(57, 97, 238, 0.72), rgba(81, 191, 255, 0.64)); }
.home-header-card:nth-child(8n + 3) { --home-header-gradient: linear-gradient(145deg, rgba(72, 189, 143, 0.7), rgba(111, 244, 197, 0.6)); }
.home-header-card:nth-child(8n + 4) { --home-header-gradient: linear-gradient(145deg, rgba(255, 176, 79, 0.72), rgba(255, 217, 117, 0.62)); }
.home-header-card:nth-child(8n + 5) { --home-header-gradient: linear-gradient(145deg, rgba(106, 127, 255, 0.72), rgba(138, 221, 255, 0.62)); }
.home-header-card:nth-child(8n + 6) { --home-header-gradient: linear-gradient(145deg, rgba(61, 188, 216, 0.72), rgba(101, 232, 197, 0.62)); }
.home-header-card:nth-child(8n + 7) { --home-header-gradient: linear-gradient(145deg, rgba(231, 167, 77, 0.72), rgba(255, 223, 137, 0.64)); }
.home-header-card:nth-child(8n + 8) { --home-header-gradient: linear-gradient(145deg, rgba(70, 118, 246, 0.72), rgba(118, 198, 255, 0.64)); }

.popular-universes-grid {
    width: 100%;
    max-width: 1320px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 10px;
}

.profile-universe-progress-card {
    min-height: 51px;
    max-width: 100%;
    border-radius: 25px;
    border: 1px solid rgba(255, 255, 255, 0.18);
    background: rgba(255, 255, 255, 0.04);
    box-sizing: border-box;
    padding: 6px;
    display: flex;
    align-items: center;
    gap: 9px;
    color: inherit;
    text-decoration: none;
    cursor: pointer;
    overflow: hidden;
}

.profile-universe-progress-avatar {
    width: 37px;
    height: 37px;
    border-radius: 50%;
    object-fit: cover;
    display: block;
    background: rgba(255, 255, 255, 0.08);
    flex-shrink: 0;
}

.profile-universe-progress-main {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
    overflow: hidden;
}

.profile-universe-progress-name {
    font-family: 'Inter', sans-serif;
    font-size: 13px;
    font-weight: 900;
    color: #fff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.profile-universe-block-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 10px;
}

.profile-universe-block-meta {
    font-size: 12px;
    font-weight: 800;
    color: rgba(255, 255, 255, 0.58);
    white-space: nowrap;
}

.compact-universe-group {
    padding: 16px 14px 14px;
    border-radius: 26px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(255, 255, 255, 0.04);
    box-sizing: border-box;
}

.compact-universe-group .profile-universe-block-head {
    justify-content: center;
    flex-direction: column;
    gap: 4px;
    margin-bottom: 12px;
}

.compact-universe-group .universe-name,
.compact-universe-group .profile-universe-block-meta {
    text-align: center;
}

.profile-universe-compact-list {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
    width: min(100%, 320px);
    margin: 0 auto;
}

.profile-universe-compact-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    overflow: hidden;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-sizing: border-box;
    transition: transform 0.16s ease, opacity 0.16s ease, filter 0.16s ease, border-color 0.16s ease;
}

.profile-universe-compact-avatar:hover {
    transform: translateY(-1px);
    border-color: rgba(255, 255, 255, 0.22);
}

.profile-universe-compact-avatar.is-missing {
    filter: grayscale(100%);
    opacity: 0.42;
}

.profile-universe-compact-avatar.is-missing:hover {
    opacity: 0.65;
}

.profile-universe-compact-avatar-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.profile-universe-anime-meta {
    font-size: 11px;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.58);
    line-height: 1.25;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.popular-universe-count {
    font-size: 11px;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.58);
}

.moment-grid {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 14px;
    padding-bottom: 10px;
    justify-content: stretch;
    align-items: start;
    margin: 0 auto;
    max-width: 1270px;
}
.moment-grid-wrap {
    position: relative;
    width: 100%;
    max-width: 1270px;
    margin: 0 auto;
}
.home-moments-panel .moment-grid-wrap {
    max-width: 1354px;
    padding: 0 42px;
    box-sizing: border-box;
}

@media (min-width: 769px) {
    .home-moments-panel .moment-grid-wrap {
        max-width: 1648px;
        padding: 0;
    }

    .home-moments-panel .moment-grid {
        grid-template-columns: repeat(6, 263px);
        max-width: 1648px;
        justify-content: center;
    }

    .home-moments-panel .moment-grid > *,
    .home-moments-panel .moment-grid .mv-moment-card-wrap {
        width: 263px;
        min-width: 263px;
    }

    .home-moments-panel .moment-grid .mv-moment-card,
    .home-moments-panel .moment-grid .mv-moment-thumb,
    .home-moments-panel .moment-grid .mv-moment-thumb-placeholder {
        width: 263px;
        height: 163px;
        aspect-ratio: auto;
    }
}

@media (min-width: 769px) {
    .home-moments-panel .home-section-open-card-moment {
        display: none !important;
    }
}
.moment-grid-next-btn {
    position: absolute;
    right: 0;
    top: 52px;
    width: 34px;
    height: 34px;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.24);
    background: rgba(12, 12, 14, 0.62);
    color: #fff;
    font-size: 17px;
    font-weight: 900;
    cursor: pointer;
}
.moment-grid-page-hidden {
    display: none !important;
}
.moment-grid > * { min-width: 0; }
.moment-grid .mv-moment-card-wrap { width: 100%; min-width: 0; }
.moment-grid .mv-moment-card { width: 100%; height: auto; aspect-ratio: 263 / 163; border-radius: 13px; overflow: hidden; }
.mv-moment-thumb { width: 100%; height: 100%; object-fit: cover; border-radius: 13px; }
.moment-grid .mv-moment-anime {
    display: block;
    margin-top: 6px;
    font-weight: 700;
    font-size: 13px;
    color: rgba(255, 255, 255, 0.6);
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    text-decoration: none;
    transition: color 0.2s ease;
}

.moment-grid .mv-moment-anime:hover {
    color: rgba(255, 255, 255, 0.9);
}
.moment-grid .mv-moment-title {
    display: block;
    margin-top: 8px;
    font-weight: 800;
    font-size: 14px;
    color: #fff;
    line-height: 1.25;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.moment-grid .mv-moment-title-link {
    text-decoration: none;
    cursor: pointer;
}
.playlist-header-line { display:flex; align-items:center; gap:14px; flex-wrap:wrap; }
.playlist-header-cover { width:64px; height:64px; border-radius:12px; object-fit:cover; border:1px solid rgba(255,255,255,0.12); }
.playlist-header-titles { display:flex; flex-direction:column; gap:6px; }
.playlist-shared-actions { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.playlist-report-btn { width: 38px; min-width: 38px; padding: 0; border-radius: 10px; color: #E01F3D; font-weight: 900; font-size: 17px; }

/* горизонтальные подборки */
.content-no-pad .list-content-grid {
    padding: 14px;
    cursor: default;
}
.content-no-pad .library-anime-card {
    flex: 0 0 187px;
}

.home-section .list-content-grid {
    display: flex;
    overflow-x: auto;
    gap: 30px;
    padding-bottom: 10px;
    justify-content: flex-start;
    scrollbar-width: none;
}

.home-section .list-content-grid::-webkit-scrollbar {
    display: none;
}

.home-section .list-content-grid .library-anime-card {
    flex: 0 0 187px;
}

.moment-grid,
.combined-lists-container {
    cursor: default;
}

/* === 5. ACCOUNT & AUTH OVERLAYS === */
.account-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    z-index: 200;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}
.account-modal-overlay.open { opacity: 1; }
.account-glass-window {
    width: 900px; height: 600px;
    background: var(--bg-glass-modal); backdrop-filter: blur(25px);
    border: 1px solid var(--border-light); border-radius: 24px;
    box-shadow: 0 40px 80px rgba(0,0,0,0.9);
    display: flex; flex-direction: column; padding: 30px; box-sizing: border-box;
    transform: scale(0.95); transition: transform 0.10s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.account-modal-overlay.open .account-glass-window { transform: scale(1); }

/* Account content */
.acc-header { display: flex; align-items: center; margin-bottom: 30px; }
.acc-avatar-img { width: 64px; height: 64px; border-radius: 50%; object-fit: cover; background: #333; margin-right: 20px; }
.acc-username { font-family: var(--font-main); font-weight: 900; font-size: 24px; color: white; }
.acc-subtitle { font-family: var(--font-main); font-weight: 700; font-size: 14px; color: rgba(255,255,255,0.4); }
.acc-close-btn { margin-left: auto; width: 40px; height: 40px; border-radius: 50%; background: var(--border-light); color: white; cursor: pointer; font-weight: bold; }
.acc-close-btn:hover { background: var(--accent); }

.acc-scroll-area { flex: 1; overflow-y: auto; padding-right: 10px; }
.acc-scroll-area::-webkit-scrollbar { width: 6px; }
.acc-scroll-area::-webkit-scrollbar-track { background: rgba(255,255,255,0.02); }
.acc-scroll-area::-webkit-scrollbar-thumb { background: var(--border-light); border-radius: 10px; }
.acc-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 20px; }

.acc-card {
    background: rgba(255, 255, 255, 0.03); border-radius: 16px; padding: 10px;
    transition: transform 0.35s ease, filter 0.35s ease, background 0.2s; cursor: pointer; display: flex; flex-direction: column;
}
.acc-card:hover { transform: scale(1.03); animation: universeCardPulse 1s ease-in-out infinite; background: rgba(255, 255, 255, 0.08); }
.acc-card-cover-box { width: 100%; aspect-ratio: 1/1; border-radius: 12px; overflow: hidden; margin-bottom: 12px; background: #1a1a1a; position: relative; }
.acc-card-title { font-family: var(--font-main); font-weight: 800; font-size: 16px; color: white; margin-bottom: 4px; }
.acc-card-count { font-family: var(--font-main); font-weight: 700; font-size: 13px; color: rgba(255,255,255,0.5); }

.collage-grid { display: grid; grid-template-columns: 1fr 1fr; grid-template-rows: 1fr 1fr; width: 100%; height: 100%; gap: 2px; }
.collage-img, .playlist-cover-full { width: 100%; height: 100%; object-fit: cover; }

/* Auth */
.auth-tabs { display: flex; width: 100%; margin-bottom: 30px; border-bottom: 1px solid var(--border-light); }
.auth-tab { flex: 1; text-align: center; padding-bottom: 10px; cursor: pointer; font-weight: 700; color: rgba(255,255,255,0.4); transition: 0.2s; }
.auth-tab.active { color: var(--accent); border-bottom: 2px solid var(--accent); }
.auth-input {
    width: 100%; height: 50px; background: rgba(255,255,255,0.05);
    border: 1px solid var(--border-light); border-radius: 12px; margin-bottom: 15px;
    color: white; padding: 0 20px; box-sizing: border-box;
    font-family: var(--font-main); font-size: 14px; outline: none;
}
.auth-input:focus { border-color: var(--accent); }
.auth-btn {
    width: 100%; height: 50px; background: var(--accent); border: none;
    border-radius: 12px; color: white; font-weight: 900; font-size: 16px;
    cursor: pointer; transition: 0.2s; margin-top: 10px;
}
.auth-btn:hover { transform: scale(1.02); box-shadow: 0 10px 20px rgba(247, 45, 75, 0.3); }
.auth-error { color: var(--accent); margin-top: 15px; text-align: center; font-size: 13px; font-weight: bold; min-height: 20px;}

/* === NEW STYLES === */

/* 1. List Info 2 lines — see modals.css for .list-info */

/* 2. Rubber Combined Container */
.combined-lists-container {
    flex-grow: 1;
    display: flex;
    overflow-y: auto; /* Allow internal scroll if needed, or just expand */
    min-height: 0; /* Flexbox fix */
}
/* Ensure parent has height */
.lists-section {
    display: flex;
    flex-direction: column;
    padding: 15px 0 20px 0;
}

/* 3-4. Playlist image, lock, actions — see modals.css */

/* 5. Co-authors in Create Modal */
.create-playlist-window {
    /* Existing styles... */
    display: flex;
    flex-direction: column;
    gap: 0;
}
.friends-selector-container {
    margin-top: 0;
    border-top: none;
    padding-top: 0;
    max-height: 200px;
    overflow-y: auto;
}

/* 6. Editable Username */
.panel-handle[contenteditable="true"] {
    outline: none;
}
.panel-handle[contenteditable="true"]:focus {
    border-bottom: none;
}

/* === 7. FOOTER === */
.site-footer {
    width: 100%;
    border-top: none;
    background: #000;
    padding: 24px 20px 0;
    box-sizing: border-box;
    margin-top: 28px;
}

.site-footer-squares {
    margin: 0 auto;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 11px;
}

.site-footer-square {
    width: 40px;
    height: 40px;
    border-radius: 11px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.16);
}

.site-footer-square-tiktok {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: rgba(255, 255, 255, 0.9);
}

.site-footer-square-tiktok img {
    width: 20px;
    height: 20px;
    display: block;
}

.site-footer-legal {
    min-height: 130px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 26px;
}

.site-footer-legal-link {
    font-family: var(--font-main);
    font-weight: 700;
    font-size: 15px;
    color: rgba(255, 255, 255, 0.5);
    text-align: center;
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
    transition: color 0.15s ease;
}

.site-footer-legal-link:hover {
    color: rgba(255, 255, 255, 0.82);
}

@media (max-width: 768px) {
    .site-footer {
        padding: 18px 10px 0;
    }

    .site-footer-legal {
        flex-wrap: wrap;
        gap: 12px 18px;
    }
}
