:root {
    --bg: #000000;
    --card-bg: rgba(255, 255, 255, 0.03);
    --text: #e0e0e0;
    --text-secondary: rgba(255, 255, 255, 0.5);
    --border: rgba(255, 255, 255, 0.08);
    --header-bg: rgba(0, 0, 0, 0.90);
}

.dark-theme {
    --bg: #1a1a2e;
    --card-bg: rgba(255, 255, 255, 0.05);
    --text: white;
    --text-secondary: rgba(255, 255, 255, 0.7);
    --border: rgba(255, 255, 255, 0.1);
    --header-bg: rgba(26, 26, 46, 0.90);
}

.light-theme {
    --bg: #f0f2f5;
    --card-bg: white;
    --text: #1a1a2e;
    --text-secondary: #666;
    --border: #e0e0e0;
    --header-bg: rgb(255, 255, 255, 0.90);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    display: flex; flex-direction: column; min-height: 100vh;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: var(--bg); color: var(--text);
    transition: background 0.3s, color 0.3s;
    position: relative; overflow-x: hidden;
}

main { flex: 1; }

body::after, body::before {
    content: ''; position: fixed; pointer-events: none; z-index: -1;
    opacity: 0.15; background-size: contain; background-repeat: no-repeat;
}
body::after { right: 0; bottom: 0; width: 550px; height: 1500px; background-image: url('img/pngwing.webp'); background-position: bottom right; }
body::before { left: 0; bottom: 0; transform: translateX(-120px); width: 750px; height: 800px; background-image: url('img/yuta.webp'); background-position: bottom left; }

/* ==================== HEADER ==================== */
header {
    background: var(--header-bg); padding: 0.7rem 1.5rem;
    position: sticky; top: 0; z-index: 100;
    box-shadow: 0 2px 20px rgba(0,0,0,0.2);
    backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
    transition: background 0.3s, box-shadow 0.3s, backdrop-filter 0.3s;
}

header.header-transparent {
    background: transparent; box-shadow: none;
    backdrop-filter: none; -webkit-backdrop-filter: none;
    position: absolute; width: 100%;
}
header.header-transparent h1 { color: white; text-shadow: 0 2px 10px rgba(0,0,0,0.5); }
header.header-transparent .search-box input {
    background: rgba(255,255,255,0.1); border: 1px solid rgba(255,255,255,0.2);
    color: white; backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
}
header.header-transparent .search-box input::placeholder { color: rgba(255,255,255,0.6); }
header.header-transparent .search-box button {
    background: rgba(255,255,255,0.1); border: 1px solid rgba(255,255,255,0.2);
    backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
}
header.header-transparent .search-box button img,
header.header-transparent .search-box button:hover img,
header.header-transparent .btn-filter img,
header.header-transparent .btn-filter:hover img { 
    filter: brightness(0) invert(1) !important; 
    opacity: 1;
}
header.header-transparent .header-actions button,
header.header-transparent .btn-random {
    color: white; background: rgba(255,255,255,0.1);
    border: 1px solid rgba(255,255,255,0.2);
    backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
}
header.header-transparent .btn-theme img { filter: brightness(0) invert(1); }
header.header-transparent .btn-menu svg { fill: white !important; }

.header-top { display: flex; align-items: center; gap: 0.8rem; position: relative; }
.header-center { display: flex; align-items: center; gap: 0.6rem; flex: 1; justify-content: center; max-width: 600px; margin: 0 auto; }
.header-actions { display: flex; gap: 6px; align-items: center; flex-shrink: 0; }

h1 { font-size: 1.5rem; color: gray; white-space: nowrap; cursor: pointer; transition: color 0.3s; flex-shrink: 0; }
h1:hover { color: #667eea; }

/* Выпадающее меню */
.nav-dropdown { position: relative; }
.btn-menu {
    width: 42px; height: 42px; border-radius: 50%;
    background: rgba(255,255,255,0.08); border: 1px solid var(--border);
    display: flex; align-items: center; justify-content: center;
    cursor: pointer; padding: 0; transition: all 0.3s;
}
.btn-menu svg { fill: white; }
.btn-menu:hover { background: rgba(102,126,234,0.3); border-color: #667eea; transform: scale(1.08); }

.nav-dropdown-content {
    display: none; position: absolute; top: 50px; left: 0;
    background: var(--header-bg); border: 1px solid var(--border);
    border-radius: 12px; min-width: 220px; padding: 8px; z-index: 101;
    backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
    box-shadow: 0 8px 30px rgba(0,0,0,0.4);
}
.nav-dropdown-content.show { display: block; }

.dropdown-item {
    display: flex; align-items: center; gap: 8px;
    width: 100%; padding: 10px 14px;
    background: transparent; border: none; border-radius: 8px;
    color: var(--text); font-size: 14px; cursor: pointer;
    transition: background 0.2s; font-weight: 500;
}
.dropdown-item:hover { background: rgba(102,126,234,0.2); }
.dropdown-item img { width: 16px; height: 16px; filter: brightness(0) invert(1); }

.dropdown-seasons { border-top: 1px solid var(--border); margin-top: 6px; padding-top: 6px; }
.dropdown-seasons .season-btn {
    display: block; width: 100%; padding: 8px 14px; margin: 2px 0;
    text-align: left; background: transparent; border: none; border-radius: 8px;
    color: var(--text); font-size: 13px; cursor: pointer;
}
.dropdown-seasons .season-btn:hover { background: rgba(102,126,234,0.2); }

.header-transparent .btn-menu { background: rgba(255,255,255,0.1); border: 1px solid rgba(255,255,255,0.2); backdrop-filter: blur(10px); }
.header-transparent .nav-dropdown-content { background: rgba(0,0,0,0.85); border: 1px solid rgba(255,255,255,0.15); }

/* Светлая тема — выпадающий список */
.light-theme .btn-menu { background: rgba(0,0,0,0.05); }
.light-theme .btn-menu svg { fill: #1a1a2e; }
.light-theme .btn-menu:hover { background: rgba(102,126,234,0.3) !important; border-color: #667eea !important; }
.light-theme .nav-dropdown-content { background: white; border: 1px solid #e0e0e0; box-shadow: 0 8px 30px rgba(0,0,0,0.15); }
.light-theme .nav-dropdown-content .dropdown-item { color: #1a1a2e; }
.light-theme .nav-dropdown-content .dropdown-item:hover { background: rgba(102,126,234,0.1); }
.light-theme .nav-dropdown-content .dropdown-item img { filter: none; }
.light-theme .nav-dropdown-content .season-btn { color: #1a1a2e; }
.light-theme .nav-dropdown-content .season-btn:hover { background: rgba(102,126,234,0.1); }
.light-theme .dropdown-seasons { border-top: 1px solid #e0e0e0; }

/* Тёмная тема — меню */
.dark-theme .btn-menu { background: rgba(255,255,255,0.05); }
.dark-theme .btn-menu svg { fill: white; }

/* Поиск */
.search-box { display: flex; gap: 8px; flex: 1; max-width: 400px; min-width: 200px; }
.search-box input { flex: 1; padding: 7px 14px; font-size: 13px; }
.search-box button {
    width: 42px; height: 42px; padding: 0; border-radius: 50%;
    background: rgba(255,255,255,0.08); border: 1px solid var(--border);
    display: flex; align-items: center; justify-content: center;
    transition: background 0.3s, border-color 0.3s; box-shadow: none;
}
.search-box button img { width: 20px; height: 20px; filter: brightness(0) invert(1); opacity: 0.7; transition: filter 0.3s, opacity 0.3s; }
.search-box button:hover { background: rgba(102,126,234,0.3); border-color: #667eea; transform: scale(1.08); }
.search-box button:hover img { opacity: 1; filter: brightness(1.3) invert(1); }

.light-theme .search-box button { background: rgba(0,0,0,0.05); }
.light-theme .search-box button img { filter: none; opacity: 0.9; }
.light-theme .search-box button:hover { background: rgba(102,126,234,0.3) !important; border-color: #667eea !important; }
.light-theme .search-box button:hover img { opacity: 1; filter: none; }

.dark-theme .search-box button { background: rgba(255,255,255,0.06); border: 1px solid rgba(255,255,255,0.12); }

input { padding: 10px 16px; border-radius: 25px; border: 2px solid #764ba2; background: var(--card-bg); color: var(--text); font-size: 14px; outline: none; transition: all 0.3s; }
input:focus { border-color: #667eea; box-shadow: 0 0 15px rgba(102,126,234,0.3); }

/* Кнопки */
.btn-filter {
    width: 42px; height: 42px; padding: 0; border-radius: 50%;
    background: rgba(255,255,255,0.08); border: 1px solid var(--border);
    display: flex; align-items: center; justify-content: center;
    cursor: pointer; transition: all 0.3s; flex-shrink: 0;
}
.btn-filter img { width: 16px; height: 16px; filter: brightness(0) invert(1); }
.btn-filter:hover { background: rgba(102,126,234,0.3); border-color: #667eea; transform: scale(1.08); }

.dark-theme .btn-filter { background: rgba(255,255,255,0.06); border: 1px solid rgba(255,255,255,0.12); }
.light-theme .btn-filter { background: rgba(0,0,0,0.05); border: 1px solid #e0e0e0; }
.light-theme .btn-filter img { filter: none; }
.light-theme .btn-filter:hover { background: rgba(102,126,234,0.3) !important; border-color: #667eea !important; }

.header-transparent .btn-filter { background: rgba(255,255,255,0.1); border: 1px solid rgba(255,255,255,0.2); backdrop-filter: blur(10px); }

button {
    padding: 8px 18px; border: none; border-radius: 25px;
    cursor: pointer; font-size: 14px; font-weight: 600;
    transition: all 0.3s; white-space: nowrap;
}
.btn-search { 
    background: transparent;
    color: var(--text);
    border: 1px solid var(--border);
    transition: all 0.3s ease;
 }

 .btn-search:hover {
    background: rgba(102, 126, 234, 0.15);
    border-color: #667eea;
    box-shadow: 0 0 20px rgba(102, 126, 234, 0.3);
    transform: scale(1.03);
}
.btn-random { background: transparent; color: var(--text); border: 1px solid var(--border); }
.btn-theme { background: transparent; color: var(--text); border: none; display: flex; align-items: center; justify-content: center; width: 40px; height: 40px; padding: 8px; }
.btn-theme:hover { transform: scale(1.1); background: transparent; }
button:hover { transform: scale(1.05); }
button:active { transform: scale(0.97); }

/* Обычная шапка — обводка и фон при наведении */
.btn-menu:hover,
.search-box button:hover,
.btn-filter:hover {
    background: rgba(102, 126, 234, 0.3) !important;
    border-color: #667eea !important;
    transform: scale(1.08);
}

/* Прозрачная шапка (главная) — только увеличение */
header.header-transparent .btn-menu:hover,
header.header-transparent .search-box button:hover,
header.header-transparent .btn-filter:hover {
    background: transparent !important;
    border-color: rgba(255, 255, 255, 0.2) !important;
    box-shadow: none !important;
    transform: scale(1.08);
}

.load-more-btn {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    padding: 12px 30px;
    border-radius: 25px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
}

/* Скелетон-карточка */
.skeleton-card {
    background: var(--card-bg);
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid var(--border);
}

.skeleton-img {
    width: 100%;
    aspect-ratio: 2/3;
    background: linear-gradient(90deg, 
        var(--card-bg) 25%, 
        rgba(255,255,255,0.05) 50%, 
        var(--card-bg) 75%
    );
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
}

.skeleton-info {
    padding: 10px;
}

.skeleton-title {
    height: 16px;
    border-radius: 4px;
    background: linear-gradient(90deg, 
        var(--card-bg) 25%, 
        rgba(255,255,255,0.05) 50%, 
        var(--card-bg) 75%
    );
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    margin-bottom: 8px;
    width: 80%;
}

.skeleton-genres {
    height: 12px;
    border-radius: 4px;
    background: linear-gradient(90deg, 
        var(--card-bg) 25%, 
        rgba(255,255,255,0.05) 50%, 
        var(--card-bg) 75%
    );
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    width: 60%;
}

.scroll-top-btn {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: var(--card-bg);
    border: 1px solid var(--border);
    color: var(--text);
    font-size: 24px;
    cursor: pointer;
    z-index: 999;
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.3s;
    pointer-events: none;
}
.scroll-top-btn.visible {
    opacity: 1;
    transform: translateY(0);
    pointer-events: all;
}

@keyframes shimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

/* Скелетоны для категорий на главной */
.skeleton-category {
    display: flex;
    gap: 12px;
    overflow: hidden;
    padding: 0 10px;
}

.skeleton-cat-card {
    flex-shrink: 0;
    width: 180px;
}

.skeleton-cat-img {
    width: 180px;
    height: 250px;
    border-radius: 10px;
    background: linear-gradient(90deg, 
        var(--card-bg) 25%, 
        rgba(255,255,255,0.05) 50%, 
        var(--card-bg) 75%
    );
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
}

/* ==================== СЕТКА КАРТОЧЕК ==================== */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 1.2rem; padding: 1.5rem; max-width: 1400px; margin: 0 auto; }
/* ===== Карточка-постер (каталог, категории, похожие, связанные) ===== */
.card { position: relative; aspect-ratio: 2 / 3; cursor: pointer; }
.card-poster { position: absolute; inset: 0; border-radius: 12px; overflow: hidden; background: rgba(0,0,0,0.35); border: 1px solid var(--border); transition: transform 0.28s ease, box-shadow 0.28s ease, border-color 0.28s ease; }
.card-poster > img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: transform 0.35s ease; }
.card-shade { position: absolute; inset: 0; background: linear-gradient(to top, rgba(0,0,0,0.92) 0%, rgba(0,0,0,0.2) 42%, rgba(0,0,0,0) 64%); transition: background 0.28s ease; pointer-events: none; }
.card-info { position: absolute; left: 0; right: 0; bottom: 0; padding: 0.55rem 0.7rem 0.65rem; color: #fff; }
.card-title { font-size: 0.86rem; font-weight: 600; line-height: 1.25; text-shadow: 0 1px 4px rgba(0,0,0,0.9); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.card-extra { max-height: 0; opacity: 0; overflow: hidden; transition: opacity 0.3s ease; }
.card-meta { font-size: 0.68rem; color: #c7d0ff; margin-top: 0.35rem; }
.card-desc { font-size: 0.7rem; line-height: 1.35; color: #e2e2e2; margin-top: 0.3rem; display: -webkit-box; -webkit-line-clamp: 5; -webkit-box-orient: vertical; overflow: hidden; }
.card-relation { position: absolute; top: 8px; left: 8px; background: rgba(102,126,234,0.88); color: #fff; padding: 2px 8px; border-radius: 6px; font-size: 10px; font-weight: 600; z-index: 4; max-width: calc(100% - 16px); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
@media (hover: hover) {
    .card:hover .card-poster { box-shadow: 0 10px 28px rgba(0,0,0,0.55); }
    .card:hover .card-poster > img { transform: scale(1.12); }
    .card:hover .card-shade { background: linear-gradient(to top, rgba(0,0,0,0.96) 0%, rgba(0,0,0,0.8) 45%, rgba(0,0,0,0.45) 100%); }
    .card:hover .card-extra { max-height: 260px; opacity: 1; }
}
.score { position: absolute; top: 8px; right: 8px; background: rgba(0,0,0,0.25); color: white; padding: 3px 8px; border-radius: 6px; font-weight: bold; font-size: 13px; backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); }
.fav-btn { position: absolute; top: 8px; left: 8px; background: rgba(0,0,0,0.6); border: none; width: 30px; height: 30px; border-radius: 50%; cursor: pointer; display: flex; align-items: center; justify-content: center; transition: all 0.3s; padding: 0; z-index: 5; }
.fav-btn:hover { transform: scale(1.1); }
.fav-btn.active { background: rgba(231,76,60,0.2); }
/* Карточки-постеры в горизонтальных лентах */
.category-scroll > .card { width: 165px; flex-shrink: 0; }
.tab-card { width: 150px; flex-shrink: 0; }
.anime-tab-list { padding-top: 20px !important; padding-bottom: 20px !important; }
@media (max-width: 768px) {
    .category-scroll > .card { width: 120px; }
    .tab-card { width: 115px; }
}
.info { padding: 0.8rem; }
.info h2 { font-size: 0.9rem; margin-bottom: 0.3rem; line-height: 1.3; color: var(--text); }
.genres { display: flex; flex-wrap: wrap; gap: 4px; margin: 0.4rem 0; }
.genre { background: rgba(102,126,234,0.3); padding: 2px 7px; border-radius: 10px; font-size: 0.65rem; color: var(--text-secondary); }
.meta { display: flex; justify-content: space-between; font-size: 0.75rem; color: var(--text-secondary); }

/* ==================== ПАГИНАЦИЯ ==================== */
.pagination { display: flex; justify-content: center; gap: 10px; padding: 1.5rem; align-items: center; flex-wrap: wrap; }
.pagination button { background: var(--card-bg); color: var(--text); border: 1px solid var(--border); }
.pagination button:disabled { opacity: 0.4; cursor: not-allowed; }
.pagination button:hover:not(:disabled) { background: #667eea; color: white; border-color: #667eea; }
.page-info { color: var(--text-secondary); font-size: 14px; }

/* ==================== МОДАЛЬНЫЕ ОКНА ==================== */
.modal { display: none; position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.92); z-index: 1000; overflow-y: auto; }
.modal-content { background: var(--bg); margin: 2% auto; padding: 2rem; border-radius: 15px; max-width: 750px; position: relative; border: 1px solid var(--border); }
.auth-modal { max-width: 400px; }
.auth-modal h2 { text-align: center; margin-bottom: 1.5rem; color: var(--text); }
.auth-modal form { display: flex; flex-direction: column; gap: 1rem; }
.auth-modal input { padding: 12px 16px; border-radius: 25px; }
.auth-modal button[type="submit"] { width: 100%; padding: 12px; margin-top: 0.5rem; }
.auth-link { text-align: center; margin-top: 1rem; color: var(--text-secondary); }
.auth-link a { color: #667eea; cursor: pointer; text-decoration: underline; }
.auth-or { display: none; align-items: center; gap: 12px; margin: 1.1rem 0 0.9rem; color: var(--text-secondary); font-size: 13px; }
.auth-or::before, .auth-or::after { content: ''; flex: 1; height: 1px; background: var(--border); }
.google-btn-wrap { display: none; justify-content: center; min-height: 40px; color-scheme: light; }
.close { position: absolute; right: 20px; top: 15px; font-size: 2rem; color: #764ba2; cursor: pointer; transition: color 0.3s; }
.close:hover { color: #f5576c; }

/* Модальное окно фильтра */
.filter-modal { max-width: 500px; }
.filter-modal h3 { margin-bottom: 1.5rem; color: var(--text); display: flex; align-items: center; justify-content: center; gap: 10px; font-size: 1.3rem; }
.filter-modal h3 img { width: 22px; height: 22px; filter: brightness(0) invert(1); }
.light-theme .filter-modal h3 img { filter: none; }
.filter-group { margin-bottom: 1.2rem; }
.filter-group label { display: block; margin-bottom: 0.4rem; color: var(--text-secondary); font-size: 0.85rem; }
.filter-group select, .filter-group input { width: 100%; padding: 10px 14px; border-radius: 10px; border: 1px solid var(--border); background: var(--card-bg); color: var(--text); font-size: 14px; outline: none; cursor: pointer; }
.filter-group select { appearance: none; -webkit-appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='white'%3E%3Cpath d='M7 10l5 5 5-5z'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; padding-right: 36px; }
.light-theme .filter-group select { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='%231a1a2e'%3E%3Cpath d='M7 10l5 5 5-5z'/%3E%3C/svg%3E"); }
.filter-group select:focus { border-color: #667eea; box-shadow: 0 0 10px rgba(102,126,234,0.2); }
.filter-group select option { background: var(--bg); color: var(--text); padding: 8px; }
.light-theme .filter-group select option { background: white; color: #1a1a2e; }
.filter-actions { display: flex; gap: 10px; margin-top: 1.5rem; }
.filter-actions button { flex: 1; }

.list-title { font-size: 1.6rem; font-weight: 700; color: var(--text); margin: 0.5rem 0 0.2rem; padding: 0 1.5rem; }
@media (max-width: 768px) { .list-title { font-size: 1.25rem; padding: 0 1rem; } }
.loading {
    grid-column: 1 / -1;
    display: flex;
    justify-content: center;
    align-items: center;
    text-align: center; 
    padding: 4rem; 
    min-height: 300px;
    width: 100%;
    color: var(--text-secondary); 
    font-size: 1.2rem; 
}
.spinner { display: inline-block; width: 40px; height: 40px; border: 4px solid rgba(102,126,234,0.3); border-top-color: #667eea; border-radius: 50%; animation: spin 0.8s linear infinite; margin-bottom: 1rem; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ==================== ИЗБРАННОЕ ==================== */
.favorites-overlay { display: none; position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.5); z-index: 199; }
.favorites-overlay.open { display: block; }
.favorites-panel { position: fixed; right: -350px; top: 0; height: 100%; width: 340px; background: var(--header-bg); z-index: 200; box-shadow: -5px 0 30px rgba(0,0,0,0.3); overflow-y: auto; padding: 1.5rem; transition: right 0.3s ease; }
.favorites-panel.open { right: 0; }
.favorites-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1.5rem; }
.favorites-header h3 { color: var(--text); font-size: 1.3rem; }
.btn-close-panel { background: transparent; border: 1px solid var(--border); color: var(--text); width: 35px; height: 35px; border-radius: 50%; cursor: pointer; display: flex; align-items: center; justify-content: center; transition: all 0.3s; padding: 0; }
.btn-close-panel:hover { background: #e74c3c; border-color: #e74c3c; color: white; }

/* ==================== ПРОФИЛЬ ==================== */
.profile-avatar-wrapper { position: relative; width: 100px; height: 100px; margin: 0 auto; }
.profile-avatar { width: 100px; height: 100px; border-radius: 50%; background: linear-gradient(135deg, #667eea, #f5576c); display: flex; align-items: center; justify-content: center; font-size: 2.5rem; color: white; overflow: hidden; }
.profile-avatar img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }
.avatar-remove-btn { position: absolute; top: -5px; right: -5px; width: 24px; height: 24px; border-radius: 50%; background: #e74c3c; color: white; border: 2px solid var(--bg); cursor: pointer; font-size: 12px; display: none; align-items: center; justify-content: center; padding: 0; transition: all 0.3s; z-index: 2; }
.profile-avatar-wrapper:hover .avatar-remove-btn { display: flex; }
.avatar-remove-btn:hover { transform: scale(1.2); background: #c0392b; }
.profile-nav-btn { width: 100%; padding: 12px; background: var(--card-bg); color: var(--text); border: 1px solid var(--border); border-radius: 10px; cursor: pointer; font-size: 14px; text-align: left; display: flex; align-items: center; gap: 10px; transition: all 0.3s; }
.profile-nav-btn:hover { background: rgba(102,126,234,0.2); border-color: #667eea; }
.user-avatar-btn { width: 38px; height: 38px; border-radius: 50%; background: rgba(102,126,234,0.2); border: 1px solid var(--border); color: var(--text); cursor: pointer; display: flex; align-items: center; justify-content: center; padding: 0; overflow: hidden; transition: all 0.3s; flex-shrink: 0; position: relative; }
.user-avatar-btn:hover { background: rgba(102,126,234,0.4); border-color: #667eea; transform: scale(1.1); }
.user-avatar-btn img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; display: block; position: absolute; top: 0; left: 0; }
header.header-transparent .user-avatar-btn { background: rgba(255,255,255,0.1); border: 1px solid rgba(255,255,255,0.2); color: white; backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); }
header.header-transparent .user-avatar-btn:hover { background: rgba(255,255,255,0.25); border-color: rgba(255,255,255,0.5); }
header.header-transparent .user-avatar-btn svg { filter: brightness(0) invert(1); }

/* ==================== СТРАНИЦА АНИМЕ ==================== */
.anime-page { background: var(--bg); border-radius: 15px; overflow: hidden; border: 1px solid var(--border); }
.anime-page-top { display: flex; gap: 1.5rem; padding: 1.5rem; flex-wrap: wrap; }
.anime-page-poster-block { display: flex; flex-direction: column; flex-shrink: 0; width: 250px; }
.anime-page-poster { width: 250px; height: 350px; object-fit: cover; border-radius: 10px; }
.anime-page-info { flex: 1; min-width: 280px; }
.anime-page-info h2 { font-size: 1.8rem; margin: 0; color: var(--text); }
.anime-page-title-en { color: var(--text-secondary); font-style: italic; margin-bottom: 1rem; }
.anime-page-meta { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 1rem; }
.anime-page-badge { background: rgba(102,126,234,0.2); color: #667eea; padding: 4px 10px; border-radius: 15px; font-size: .85rem; font-weight: 600; }
.anime-page-genres { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 1rem; }
.anime-page-genre { background: rgba(102,126,234,0.3); color: var(--text); padding: 4px 10px; border-radius: 12px; font-size: .8rem; }
.anime-page-synopsis { color: var(--text-secondary); line-height: 1.6; margin-top: 1rem; padding: 1rem; background: var(--card-bg); border-radius: 10px; font-size: .9rem; }
.anime-page-player { border-top: 1px solid var(--border); }
.fav-btn-page { background: rgba(0,0,0,0.5); border: 2px solid rgba(255,255,255,0.3); color: white; width: 44px; height: 44px; border-radius: 50%; cursor: pointer; display: flex; align-items: center; justify-content: center; transition: all 0.3s; padding: 0; flex-shrink: 0; }
.fav-btn-page:hover { transform: scale(1.1); border-color: #e74c3c; }
.fav-btn-page.active { background: rgba(231,76,60,0.2); border-color: #e74c3c; }
.rating-stars { display: flex; gap: 5px; margin: 0.5rem 0; }
.rating-stars span { cursor: pointer; font-size: 1.5rem; transition: transform 0.2s; }
.rating-stars span:hover { transform: scale(1.3); }

/* Комментарии */
.comments-section { padding: 1.5rem; border-top: 1px solid var(--border); }
.comments-section h3 { margin-bottom: 1rem; color: var(--text); }
.comment-form { display: flex; flex-direction: column; gap: 10px; margin-bottom: 1.5rem; }
.comment-form textarea { width: 100%; padding: 12px; border-radius: 10px; border: 1px solid var(--border); background: var(--card-bg); color: var(--text); font-size: 14px; resize: vertical; outline: none; }
.comment-form textarea:focus { border-color: #667eea; }
.comment-form button { align-self: flex-end; padding: 8px 20px; }
.comment-item { background: var(--card-bg); padding: 12px 16px; border-radius: 10px; margin-bottom: 10px; border: 1px solid var(--border); }
.comment-header { display: flex; justify-content: space-between; margin-bottom: 6px; font-size: .85rem; }
.comment-user { font-weight: 600; color: #667eea; }
.comment-date { color: var(--text-secondary); font-size: .8rem; }
.comment-text { color: var(--text); line-height: 1.5; font-size: .9rem; }

/* Вкладки */
.anime-tabs-section { background: var(--card-bg); border-radius: 10px; padding: 0.8rem 0; }
.anime-tabs-header { display: flex; flex-wrap: wrap; gap: 5px; padding: 0 0.5rem; }
.anime-tab-btn { padding: 8px 16px; border: none; border-radius: 20px; background: transparent; color: var(--text-secondary); cursor: pointer; font-size: 13px; font-weight: 600; transition: all 0.3s; }
.anime-tab-btn:hover { background: rgba(102,126,234,0.15); color: var(--text); }
.anime-tab-btn.active { background: rgba(102,126,234,0.2); color: #667eea; }
.anime-tab-list { display: flex; flex-wrap: nowrap; gap: 8px; overflow-x: auto; scroll-behavior: smooth; padding: 0.5rem 0; scrollbar-width: none; }
.anime-tab-list::-webkit-scrollbar { display: none; }
.anime-tab-list > * { flex-shrink: 0; }

/* Контейнер для кнопок */
.anime-photos-scroll {
    position: relative;
}

.anime-photo-left-btn, .anime-photo-right-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 5;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: rgba(0,0,0,0.75);
    min-width: 44px;
    min-height: 44px;
    flex-shrink: 0;
    border: none;
    cursor: pointer;
    display: flex;
    opacity: 0;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
    backdrop-filter: blur(5px);
}
.anime-photo-left-btn { left: 0; }
.anime-photo-right-btn { right: 0; }
.anime-photo-left-btn:hover, .anime-photo-right-btn:hover {
    background: rgba(102,126,234,0.5);
    transform: translateY(-50%) scale(1.1);
}
.anime-photo-left-btn svg,
.anime-photo-right-btn svg {
    fill: white !important;
    width: 28px;
    height: 28px;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.8));
    opacity: 1 !important;
}

/* Кнопка "Показать все" */
.category-show-all {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    padding: 0 8px;
}

.category-show-all-inner {
    padding: 10px 16px;
    border-radius: 25px;
    background: rgba(0, 0, 0, 0.30);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid var(--border);
    color: white;
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
    transition: all 0.3s;
}

.category-show-all-inner:hover {
    background: rgba(102, 126, 234, 0.3);
    border-color: #667eea;
    transform: scale(1.05);
}
/* ==================== HERO BANNER ==================== */
.hero-banner { position: relative; width: 100%; height: 600px; overflow: hidden; margin-bottom: 0; background: #000; border-radius: 0 0 20px 20px; }
.hero-slide { position: relative; width: 100%; height: 100%; }
.hero-video-container { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; border-radius: 0 0 20px 20px; overflow: hidden; z-index: 1; }
.hero-overlay { position: absolute; inset: 0; background: linear-gradient(to right, rgba(0,0,0,0.7) 0%, rgba(0,0,0,0.2) 50%, rgba(0,0,0,0.4) 100%); z-index: 2; }
.hero-content { position: absolute; bottom: 140px; left: 60px; z-index: 3; max-width: 500px; }
.hero-title { font-size: 2.5rem; font-weight: 700; color: white; text-shadow: 0 2px 20px rgba(0,0,0,0.8); margin-bottom: 0.5rem; }
.hero-info { color: rgba(255,255,255,0.9); font-size: 1rem; line-height: 1.5; }
.hero-watch-btn { position: absolute; bottom: 40px; right: 40px; z-index: 3; padding: 14px 32px; background: white; color: #1a1a2e; border: none; border-radius: 30px; font-size: 1rem; font-weight: 600; cursor: pointer; transition: transform 0.2s, box-shadow 0.2s; box-shadow: 0 4px 20px rgba(0,0,0,0.3); }
.hero-watch-btn:hover { transform: scale(1.05); box-shadow: 0 6px 25px rgba(0,0,0,0.5); }
.hero-video-container video { width: 100%; height: 100%; border: none; object-fit: cover; }
.hero-nav { position: absolute; bottom: 30px; left: 60px; z-index: 3; display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.hero-nav button, .hero-nav .season-btn { background: rgba(255,255,255,0.1); border: 1px solid rgba(255,255,255,0.3); color: white; backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); padding: 8px 16px; border-radius: 25px; font-size: 13px; cursor: pointer; transition: all 0.3s; font-weight: 600; white-space: nowrap; display: inline-flex; align-items: center; gap: 6px; }
.hero-nav button:hover, .hero-nav .season-btn:hover { background: rgba(255,255,255,0.25); border-color: rgba(255,255,255,0.5); transform: scale(1.05); }
.hero-nav button img { width: 16px; height: 16px; filter: brightness(0) invert(1); }

/* ==================== КАТЕГОРИИ ==================== */
.categories-section { padding: 1rem 0; }
.category-row { margin-bottom: 2rem; padding: 10px 1.5rem; max-width: 1400px; margin-left: auto; margin-right: auto; overflow: hidden; }
.category-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1rem; }
.category-title { font-size: 2rem; font-weight: 700; color: var(--text); }
.category-scroll { display: flex; gap: 1rem; overflow-x: auto; scroll-behavior: smooth; padding: 10px 5px 15px 5px; scrollbar-width: none; margin: -10px -5px -15px -5px; }
.category-scroll::-webkit-scrollbar { display: none; }
.scroll-btn { width: 40px; height: 40px; border-radius: 50%; background: var(--card-bg); border: 1px solid var(--border); color: var(--text); cursor: pointer; font-size: 1.2rem; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.scroll-btn:hover { background: rgba(102,126,234,0.2); }

/* ==================== ФУТЕР ==================== */
.site-footer { background: var(--header-bg); border-top: 1px solid var(--border); padding: 1rem 1.5rem; margin-top: 2rem; font-size: .9rem; color: var(--text-secondary); }
.footer-top { display: flex; align-items: flex-start; position: relative; padding: 0; }
.footer-left { width: 280px; flex-shrink: 0; }
.footer-logo { font-size: 1.2rem; font-weight: 700; margin: 0 0 .3rem; background: linear-gradient(135deg,#667eea,#c084fc); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; animation: logoGlow 2s ease-in-out infinite alternate; }
@keyframes logoGlow { from { text-shadow: 0 0 15px rgba(102,126,234,.4), 0 0 25px rgba(102,126,234,.2); } to { text-shadow: 0 0 20px rgba(192,132,252,.6), 0 0 35px rgba(192,132,252,.3); } }
.footer-copy { font-size: .8rem; color: var(--text-secondary); margin: 0; }
.footer-copy a { color: #667eea; text-decoration: none; }
.footer-center { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 0.6rem; position: absolute; left: 50%; transform: translateX(-50%); }
.footer-social { display: flex; gap: 10px; }
.footer-social a { color: var(--text-secondary); display: flex; align-items: center; justify-content: center; width: 36px; height: 36px; border-radius: 50%; background: var(--card-bg); border: 1px solid var(--border); transition: all .2s; }
.footer-social a:hover { color: #667eea; border-color: #667eea; box-shadow: 0 0 12px rgba(102,126,234,.3); }
.footer-links { display: flex; flex-wrap: wrap; gap: 0.3rem; justify-content: center; }
.footer-links a { color: var(--text-secondary); text-decoration: none; cursor: pointer; font-size: .85rem; padding: 4px 10px; transition: color .2s; }
.footer-links a:hover { color: #667eea; }

/* ==================== СТРАНИЦЫ (FAQ, PRIVACY, DMCA) ==================== */
.page-wrap { max-width: 700px; margin: 2rem auto; padding: 1.5rem; }
.page-wrap h2 { color: var(--text); margin-bottom: 1.5rem; font-size: 1.5rem; text-align: center; }
.page-wrap p { color: var(--text-secondary); line-height: 1.6; margin-bottom: 1rem; }
.page-wrap a { color: #667eea; text-decoration: none; }
.page-wrap strong { color: var(--text); }
.back-btn { display: inline-block; padding: 10px 20px; background: var(--card-bg); color: var(--text); border: 1px solid var(--border); border-radius: 25px; text-decoration: none; font-weight: 600; margin-bottom: 2rem; transition: all 0.2s; }
.back-btn:hover { background: rgba(102,126,234,0.2); border-color: #667eea; }
.faq-block { background: var(--card-bg); border: 1px solid var(--border); border-radius: 12px; overflow: hidden; }
.faq-item { border-bottom: 1px solid var(--border); }
.faq-item:last-child { border-bottom: none; }
.faq-question { width: 100%; padding: 16px 20px; background: none; border: none; color: var(--text); font-size: 1rem; font-weight: 600; text-align: left; cursor: pointer; display: flex; justify-content: space-between; align-items: center; transition: background 0.2s; }
.faq-question:hover { background: rgba(102,126,234,0.08); transform: none; }
.faq-arrow { font-size: 0.8rem; transition: transform 0.3s; color: var(--text-secondary); flex-shrink: 0; margin-left: 10px; }
.faq-item.open .faq-arrow { transform: rotate(180deg); }
.faq-answer { max-height: 0; overflow: hidden; transition: max-height 0.3s ease; }
.faq-item.open .faq-answer { max-height: 500px; }
.faq-answer p { padding: 0 20px 16px; color: var(--text-secondary); line-height: 1.6; font-size: 0.9rem; }
.info-block { background: var(--card-bg); border: 1px solid var(--border); border-radius: 12px; padding: 20px; }
.info-block p { color: var(--text-secondary); line-height: 1.6; font-size: 0.9rem; margin-bottom: 0.5rem; }
.info-block a { color: #667eea; text-decoration: none; }
.toast { position: fixed; bottom: 30px; left: 50%; transform: translateX(-50%); background: #e74c3c; color: white; padding: 12px 24px; border-radius: 25px; font-size: 14px; font-weight: 600; z-index: 9999; animation: toastIn 0.3s ease; box-shadow: 0 5px 20px rgba(0,0,0,0.3); }
@keyframes toastIn { from { opacity: 0; transform: translateX(-50%) translateY(20px); } to { opacity: 1; transform: translateX(-50%) translateY(0); } }

#dubbingHeader { cursor: default; }
#dubbingHeader span { display: none; }
#episodesScrollContainer::-webkit-scrollbar { display: none; }

/* ==================== АНИМАЦИИ КАРТОЧЕК ==================== */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px) scale(0.97);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* ==================== СЕТКА КАРТОЧЕК (#grid) ==================== */
#grid .card {
    opacity: 0;
    animation: fadeInUp 0.4s ease forwards;
}

#grid .card:nth-child(1)  { animation-delay: 0.00s; }
#grid .card:nth-child(2)  { animation-delay: 0.02s; }
#grid .card:nth-child(3)  { animation-delay: 0.04s; }
#grid .card:nth-child(4)  { animation-delay: 0.06s; }
#grid .card:nth-child(5)  { animation-delay: 0.08s; }
#grid .card:nth-child(6)  { animation-delay: 0.10s; }
#grid .card:nth-child(7)  { animation-delay: 0.12s; }
#grid .card:nth-child(8)  { animation-delay: 0.14s; }
#grid .card:nth-child(9)  { animation-delay: 0.16s; }
#grid .card:nth-child(10) { animation-delay: 0.18s; }
#grid .card:nth-child(11) { animation-delay: 0.20s; }
#grid .card:nth-child(12) { animation-delay: 0.22s; }
#grid .card:nth-child(13) { animation-delay: 0.24s; }
#grid .card:nth-child(14) { animation-delay: 0.26s; }
#grid .card:nth-child(15) { animation-delay: 0.28s; }
#grid .card:nth-child(16) { animation-delay: 0.30s; }
#grid .card:nth-child(17) { animation-delay: 0.32s; }
#grid .card:nth-child(18) { animation-delay: 0.34s; }
#grid .card:nth-child(19) { animation-delay: 0.36s; }
#grid .card:nth-child(20) { animation-delay: 0.38s; }
#grid .card:nth-child(21) { animation-delay: 0.40s; }
#grid .card:nth-child(22) { animation-delay: 0.42s; }
#grid .card:nth-child(23) { animation-delay: 0.44s; }
#grid .card:nth-child(24) { animation-delay: 0.46s; }

/* Подгруженные карточки (после 24-й) — без анимации */
#grid .card:nth-child(n+25) {
    opacity: 1 !important;
    animation: none !important;
}

/* ==================== КАТЕГОРИИ НА ГЛАВНОЙ ==================== */
.category-scroll .card {
    opacity: 0;
    animation: fadeInUp 0.4s ease forwards;
}

.category-scroll .card:nth-child(1)  { animation-delay: 0.00s; }
.category-scroll .card:nth-child(2)  { animation-delay: 0.05s; }
.category-scroll .card:nth-child(3)  { animation-delay: 0.10s; }
.category-scroll .card:nth-child(4)  { animation-delay: 0.15s; }
.category-scroll .card:nth-child(5)  { animation-delay: 0.20s; }
.category-scroll .card:nth-child(6)  { animation-delay: 0.25s; }

/* Остальные карточки в категориях — сразу видны */
.category-scroll .card:nth-child(n+7) {
    opacity: 1 !important;
    animation: none !important;
}

/* ==================== СКЕЛЕТОНЫ — БЕЗ АНИМАЦИИ ==================== */
.card[style*="pointer-events:none"] {
    opacity: 1 !important;
    animation: none !important;
}
/* Контейнер для правого верхнего угла */
.card-badges {
    position: absolute;
    top: 8px;
    right: 8px;
    display: flex;
    gap: 4px;
    z-index: 5;
}

/* Общие стили бейджей */
.badge-hot, .badge-new {
    padding: 4px 8px;
    border-radius: 5px;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.5px;
    white-space: nowrap;
    line-height: 1;
    display: flex;
    align-items: center;
    gap: 3px;
}

/* HOT — красный с огнём */
.badge-hot {
    background: #e74c3c;
    color: white;
    padding: 4px 8px 4px 6px;
    box-shadow: 0 2px 8px rgba(231,76,60,0.5);
}

.badge-hot svg {
    width: 11px;
    height: 11px;
    flex-shrink: 0;
}

/* NEW — фиолетовый */
.badge-new {
    background:#764ba2;
    color: white;
    box-shadow: 0 2px 8px rgba(102,126,234,0.4);
}

/* Score — в том же ряду */
.card-badges .score {
    position: static;
    background: rgba(0,0,0,0.55);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    color: white;
    padding: 4px 8px;
    border-radius: 5px;
    font-size: 11px;
    font-weight: 700;
    line-height: 1;
}


@keyframes badgePulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.06); }
}

.anime-page-player > div > div:last-child { display: flex; flex-direction: column; max-height: 100%; overflow: hidden; }
#dubbingList { flex: 1 1 0; overflow-y: auto; overflow-x: hidden; min-height: 0; scrollbar-width: thin; scrollbar-color: #667eea var(--card-bg); }
#dubbingList::-webkit-scrollbar { width: 5px; }
#dubbingList::-webkit-scrollbar-track { background: var(--card-bg); border-radius: 10px; }
#dubbingList::-webkit-scrollbar-thumb { background: #667eea; border-radius: 10px; }
.dubbing-btn { min-height: 36px; flex-shrink: 0; display: flex; align-items: center; }
/* ==================== АДАПТИВНОСТЬ ==================== */
/* ===== Блок выбора озвучек ===== */
.dubbing-sidebar { width: 210px; flex-shrink: 0; background: var(--card-bg); border-left: 1px solid var(--border); display: flex; flex-direction: column; max-height: 100%; }
#dubbingHeader { padding: 14px 12px; font-size: 15px; font-weight: 600; color: var(--text); border-bottom: 1px solid var(--border); display: flex; justify-content: space-between; align-items: center; user-select: none; }
.dubbing-arrow { font-size: 12px; }
#dubbingList { display: flex; flex-direction: column; flex: 1 1 0; min-height: 0; max-height: 520px; overflow-y: auto; overflow-x: hidden; scrollbar-width: thin; scrollbar-color: #764ba2 transparent; }
#dubbingList::-webkit-scrollbar { width: 8px; }
#dubbingList::-webkit-scrollbar-track { background: transparent; margin: 4px 0; }
#dubbingList::-webkit-scrollbar-thumb { background: linear-gradient(180deg, #667eea, #764ba2); border-radius: 8px; }
#dubbingList::-webkit-scrollbar-thumb:hover { background: #764ba2; }
.dubbing-btn { flex-shrink: 0; }
/* На ПК блок всегда открыт, заголовок не кликабелен, стрелка скрыта */
@media (min-width: 769px) {
    #dubbingHeader { cursor: default; }
    .dubbing-arrow { display: none; }
}

@media (max-width: 1100px) {
    body::after, body::before { display: none; }
    
    /* Серии */
    #episodesScrollContainer { width: 420px !important; }
    #episodeButtons button { padding: 8px 22px !important; min-width: 44px !important; font-size: 14px !important; }
    #prevSeriesBtn { left: 4px !important; padding: 8px 12px !important; font-size: 12px !important; }
    #nextSeriesBtn { right: 4px !important; padding: 8px 12px !important; font-size: 12px !important; }
    
    /* Hero — кнопка Смотреть не заходит под навигацию */
    .hero-nav { left: 40px; bottom: 20px; max-width: calc(100% - 200px); }
    .hero-watch-btn { bottom: 30px; right: 30px; }
    .hero-content { bottom: 130px; left: 40px; max-width: 400px; }
}

@media (max-width: 900px) {
    .footer-top { flex-direction: column; align-items: center; text-align: center; gap: 1rem; }
    .footer-left { width: auto; flex: none; }
    .footer-center { position: static; transform: none; }
    
    /* Hero */
    .hero-banner { height: 450px; }
    .hero-content { left: 20px; bottom: 130px; max-width: 350px; }
    .hero-title { font-size: 1.8rem; }
    .hero-watch-btn { bottom: 25px; right: 20px; padding: 10px 24px; font-size: 0.9rem; }
    .hero-nav { left: 20px; bottom: 15px; max-width: calc(100% - 180px); gap: 5px; }
    .hero-nav button, .hero-nav .season-btn { padding: 6px 12px; font-size: 12px; }
}

@media (max-width: 768px) {
    body::after, body::before { display: none; }
    /* Компактная шапка в один ряд: лого слева, поиск по центру, иконки справа */
    .header-top { flex-wrap: nowrap; gap: 6px; align-items: center; }
    h1 { font-size: 1.1rem; flex-shrink: 0; }
    .header-center { order: 0; flex: 1 1 auto; min-width: 0; display: flex; align-items: center; gap: 5px; max-width: none; }
    .search-box { flex: 1 1 auto; min-width: 0; max-width: none; }
    .search-box input { min-width: 0; }
    .header-actions { gap: 5px; flex-shrink: 0; }
    .btn-random, .btn-filter { display: none; } /* перенесены в бургер-меню */
    .btn-menu, .search-box button, .user-avatar-btn, .btn-theme { width: 36px; height: 36px; flex-shrink: 0; }
    .mobile-only { display: flex !important; }
    .grid { grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); padding: 1rem; gap: 0.7rem; }
    .card-img { height: 180px; }
    /* Карточки в домашних категориях (горизонтальный скролл) — компактнее */
    .category-scroll .card { width: 130px !important; }
    .category-scroll .card .card-img { height: 180px !important; }
    .modal-content { margin: 10% auto; padding: 1rem; max-width: 95vw; }
    .favorites-panel { width: 100%; right: -100%; }
    
    /* Страница аниме */
    .anime-page { overflow: hidden; }
    .anime-page-top { flex-direction: column; align-items: center; }
    .anime-page-poster-block { width: 180px; }
    .anime-page-poster { width: 180px; height: 250px; }
    .anime-page-info { min-width: auto; width: 100%; }
    .anime-page-info h2 { font-size: 1.3rem; text-align: center; word-break: break-word; }
    .anime-page-synopsis { font-size: 0.85rem; word-break: break-word; }
    .anime-page-meta { gap: 4px; }
    .anime-page-badge { font-size: 0.75rem; padding: 3px 8px; }
    .anime-page-player > div { flex-direction: column !important; }
    .anime-page-player > div > div:last-child { width: 100% !important; border-left: none !important; border-top: 1px solid var(--border); }
    .anime-page-player > div > div:first-child { width: 100% !important; }
    .dubbing-btn { width: 100% !important; margin: 2px 0 !important; white-space: normal !important; overflow: visible !important; text-overflow: clip !important; font-size: 12px !important; }
    
    /* Серии — компактно */
    #episodesScrollContainer { width: 100% !important; max-width: 100%; overflow-x: auto !important; -webkit-overflow-scrolling: touch; }
    #episodeButtons { 
        display: flex !important; 
        flex-wrap: wrap !important; 
        justify-content: center !important; 
        gap: 3px !important; 
        min-width: auto !important; 
        padding: 0 5px !important; 
    }
    #episodeButtons button { 
        padding: 5px 8px !important; 
        min-width: 34px !important; 
        font-size: 11px !important; 
        flex-shrink: 0; 
    }
    #epPrevBtn, #epNextBtn, .ep-divider { display: none !important; }
    #prevSeriesBtn, #nextSeriesBtn { 
        display: inline-flex !important;
        position: static !important; 
        margin: 2px 4px; 
        padding: 6px 10px !important; 
        font-size: 11px !important; 
    }
    
/* Озвучка */
#dubbingHeader { cursor: pointer !important; }
.dubbing-arrow { display: inline !important; } .dubbing-sidebar { max-height: none; }
#dubbingList { display: none !important; }
#dubbingList.open { display: flex !important; height: 220px; max-height: 220px; flex: none; }
    
    /* Вкладки — не выходят за границы */
    .anime-tabs-section { padding: 0.5rem 0; overflow: hidden; }
    .anime-tab-btn { padding: 5px 10px; font-size: 11px; white-space: nowrap; }
    .anime-tab-list { 
        gap: 6px; 
        padding: 0.5rem 35px; 
        -webkit-overflow-scrolling: touch;
    }
    .anime-tab-content { overflow: hidden; }
    .anime-photos-scroll { overflow: hidden; }
    .anime-photo-left-btn, .anime-photo-right-btn { 
        width: 30px; 
        height: 30px; 

    }
    .anime-photo-left-btn svg, .anime-photo-right-btn svg { width: 16px; height: 16px; }
    .anime-screenshot-item { width: 220px !important; height: 124px !important; }
    
    /* Похожие/связанные карточки */
    #similarList .anime-tab-list > div,
    #relatedList .anime-tab-list > div {
        width: 140px !important;
        height: 200px !important;
    }
    #similarList img,
    #relatedList img {
        width: 100% !important;
        height: 100% !important;
    }
    
    /* Комментарии */
    .comments-section { padding: 1rem; }
    .comment-item { padding: 8px 10px; }
    .comment-text { font-size: 0.85rem; word-break: break-word; }
    .comment-form textarea { font-size: 13px; }
    
    /* Футер */
    .footer-top { flex-direction: column; align-items: center; text-align: center; }
    .footer-left { flex: none; align-items: center; }
    
    /* Hero */
    .hero-banner { height: 380px; }
    .hero-content { left: 12px; bottom: 120px; max-width: 250px; }
    .hero-title { font-size: 1.3rem; }
    .hero-info { font-size: 0.75rem; }
    .hero-watch-btn { 
        bottom: 75px; 
        right: 12px; 
        padding: 8px 16px; 
        font-size: 0.8rem; 
        z-index: 4;
    }
    .hero-nav { 
        left: 12px; 
        bottom: 10px; 
        right: 12px; 
        max-width: none;
        gap: 4px; 
        justify-content: flex-start; 
        flex-wrap: wrap;
    }
    .hero-nav button, .hero-nav .season-btn { 
        padding: 5px 8px; 
        font-size: 10px; 
    }
    
    /* Категории */
    .category-row { padding: 5px 10px; margin-bottom: 1.5rem; }
    .category-title { font-size: 1rem; }
    .category-scroll { gap: 0.7rem; -webkit-overflow-scrolling: touch; }
    .scroll-btn { width: 32px; height: 32px; font-size: 0.9rem; }
    
    /* Выпадающее меню */
    .nav-dropdown-content { min-width: 180px; left: 0; right: auto; }
    
    /* Карточки — текст не вылезает */
    .info { padding: 0.6rem; }
    .info h2 { font-size: 0.8rem; word-break: break-word; }
    .genres { gap: 2px; }
    .genre { font-size: 0.6rem; padding: 1px 5px; }
    .meta { font-size: 0.7rem; flex-wrap: wrap; gap: 2px; }
    .card-badges { gap: 2px; }
    .badge-hot, .badge-new { font-size: 9px; padding: 2px 5px; }
    .badge-hot svg { width: 9px; height: 9px; }
    .score { font-size: 10px; padding: 2px 5px; }
    
    /* Скелетоны */
    .skeleton-card .card-img { height: 200px; }
}

/* Очень маленькие экраны (телефоны) */
@media (max-width: 480px) {
    .grid { grid-template-columns: repeat(auto-fill, minmax(100px, 1fr)); gap: 0.5rem; padding: 0.5rem; }
    .card-img { height: 150px; }
    .category-scroll .card { width: 110px !important; }
    .category-scroll .card .card-img { height: 150px !important; }
    .info h2 { font-size: 0.7rem; }
    .genre { font-size: 0.55rem; padding: 1px 4px; }
    .meta { font-size: 0.6rem; }
    
    .hero-banner { height: 280px; }
    .hero-content { left: 8px; bottom: 90px; max-width: 180px; }
    .hero-title { font-size: 1rem; }
    .hero-info { display: none; }
    .hero-watch-btn { bottom: 50px; right: 8px; padding: 6px 12px; font-size: 0.7rem; }
    .hero-nav { left: 8px; bottom: 5px; right: 8px; gap: 3px; }
    .hero-nav button, .hero-nav .season-btn { padding: 3px 6px; font-size: 8px; }
    
    .anime-page-poster-block { width: 130px; }
    .anime-page-poster { width: 130px; height: 180px; }
    .anime-page-info h2 { font-size: 1.1rem; }
    
    #episodeButtons button { padding: 3px 5px !important; min-width: 28px !important; font-size: 10px !important; }
    #prevSeriesBtn, #nextSeriesBtn { padding: 4px 6px !important; font-size: 10px !important; }
    
    .header-top { padding: 0.4rem; }
    h1 { font-size: 1rem; }
    .btn-menu, .search-box button, .btn-filter { width: 32px; height: 32px; }
    .search-box input { padding: 4px 8px; font-size: 11px; }
    
    .category-title { font-size: 0.9rem; }
    .scroll-btn { width: 28px; height: 28px; font-size: 0.8rem; }
    
    .anime-photo-left-btn, .anime-photo-right-btn { width: 26px; height: 26px; }
    .anime-photo-left-btn svg, .anime-photo-right-btn svg { width: 14px; height: 14px; }
    .anime-screenshot-item { width: 180px !important; height: 100px !important; }
}

/* ===== Тач-устройства: убрать «залипающий» hover после тапа ===== */
@media (hover: none) {
    button:hover,
    .card:hover,
    .btn-menu:hover, .search-box button:hover, .btn-filter:hover,
    .btn-theme:hover, .btn-search:hover, .scroll-btn:hover,
    .hero-nav button:hover, .hero-nav .season-btn:hover, .hero-watch-btn:hover,
    .fav-btn:hover, .fav-btn-page:hover, .user-avatar-btn:hover,
    .anime-tab-btn:hover, .rating-stars span:hover,
    .anime-photo-left-btn:hover, .anime-photo-right-btn:hover,
    .category-show-all-inner:hover, .dropdown-item:hover, .season-btn:hover {
        transform: none !important;
        box-shadow: none !important;
    }
    .card:hover { border-color: var(--border) !important; }
}

/* ===== Кнопки навигации/сезонов не сжимаются ===== */
.hero-nav button, .hero-nav .season-btn, .dropdown-seasons .season-btn {
    flex-shrink: 0;
    white-space: nowrap;
}

.mobile-only { display: none; }
.rating-clear { cursor: pointer; color: var(--text-secondary); font-size: 0.85rem; margin-left: 8px; opacity: 0.6; transition: color 0.2s, opacity 0.2s; }
.rating-clear:hover { color: #e74c3c; opacity: 1; }

/* ===== Попап подписки на Telegram ===== */
.tg-popup { position: fixed; right: 18px; bottom: 18px; z-index: 9998; width: 300px; max-width: calc(100vw - 24px); background: rgba(20,20,28,0.82); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); border: 1px solid var(--border); border-radius: 16px; padding: 16px 16px 14px; box-shadow: 0 14px 44px rgba(0,0,0,0.55); transform: translateY(170%); opacity: 0; transition: transform 0.45s cubic-bezier(.2,.8,.2,1), opacity 0.4s ease; }
.tg-popup.show { transform: translateY(0); opacity: 1; }
body.light-theme .tg-popup { background: rgba(250,250,253,0.85); border-color: rgba(0,0,0,0.12); box-shadow: 0 14px 44px rgba(0,0,0,0.2); }
.tg-popup-close { position: absolute; top: 6px; right: 10px; background: none; border: none; color: var(--text-secondary); font-size: 22px; cursor: pointer; line-height: 1; }
.tg-popup-row { display: flex; align-items: center; gap: 12px; padding-right: 14px; }
.tg-popup-icon { width: 44px; height: 44px; flex-shrink: 0; border-radius: 12px; background: rgba(255,255,255,0.9); display: flex; align-items: center; justify-content: center; font-size: 22px; }
.tg-popup-icon img { width: 32px; height: 32px; fill: #fff; }
.tg-popup-text { display: flex; flex-direction: column; min-width: 0; }
.tg-popup-text b { color: var(--text); font-size: 14px; }
.tg-popup-text span { color: var(--text-secondary); font-size: 12px; margin-top: 2px; }
.tg-popup-btn { display: block; text-align: center; margin-top: 12px; padding: 10px; border-radius: 10px; background: linear-gradient(135deg, #2aabee, #229ed9); color: #fff; font-weight: 600; font-size: 14px; text-decoration: none; cursor: pointer; }
@media (max-width: 480px) { .tg-popup { right: 10px; left: 10px; bottom: 10px; width: auto; } }

/* ===== Баннер на мобильных: затемнение снизу для читаемости текста ===== */
@media (max-width: 768px) {
    .hero-overlay { background: linear-gradient(to top, rgba(0,0,0,0.92) 0%, rgba(0,0,0,0.45) 40%, rgba(0,0,0,0.15) 100%) !important; }
}

/* ==================== ФИЛЬТР: ЧИПЫ (мультивыбор) ==================== */
.filter-count { color: #667eea; font-weight: 600; }
.filter-chips {
    display: flex; flex-wrap: wrap; gap: 8px; max-height: 200px; overflow-y: auto; padding: 2px 6px 2px 2px;
    scrollbar-width: thin; scrollbar-color: #667eea var(--card-bg);
}
.filter-chips::-webkit-scrollbar { width: 6px; }
.filter-chips::-webkit-scrollbar-track { background: var(--card-bg); border-radius: 10px; }
.filter-chips::-webkit-scrollbar-thumb { background: #667eea; border-radius: 10px; }
.filter-chips::-webkit-scrollbar-thumb:hover { background: #764ba2; }
.filter-chips-loading { color: var(--text-secondary); font-size: 13px; padding: 6px 0; }
.filter-chip {
    padding: 7px 14px; border-radius: 20px; border: 1px solid var(--border);
    background: transparent; color: var(--text); font-size: 13px; cursor: pointer;
    transition: all 0.2s; white-space: nowrap; user-select: none;
}
.filter-chip:hover { border-color: #667eea; background: rgba(102,126,234,0.08); }
.filter-chip.active { background: rgba(102,126,234,0.15); border-color: #667eea; color: #667eea; font-weight: 600; }

/* ==================== МЕНЮ ПРОФИЛЯ (выпадающее у иконки) ==================== */
.profile-dropdown { position: relative; }
.profile-menu {
    display: none; position: absolute; top: 48px; right: 0;
    background: var(--header-bg); border: 1px solid var(--border);
    border-radius: 14px; min-width: 240px; padding: 8px; z-index: 300;
    backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
    box-shadow: 0 12px 40px rgba(0,0,0,0.45);
}
.profile-menu.show { display: block; animation: pmFade 0.18s ease; }
@keyframes pmFade { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: translateY(0); } }
.profile-menu-divider { height: 1px; background: var(--border); margin: 6px 4px; }
.profile-menu-item {
    display: flex; align-items: center; gap: 10px; width: 100%; padding: 10px 12px;
    background: transparent; border: none; border-radius: 9px; color: var(--text);
    font-size: 14px; cursor: pointer; transition: background 0.2s; text-align: left;
}
.profile-menu-item svg { fill: var(--text-secondary); flex-shrink: 0; }
.profile-menu-item:hover { background: rgba(102,126,234,0.18); }
.profile-menu-item.premium { color: #f0a500; }
.profile-menu-item.premium svg { fill: #f0a500; }
.profile-menu-item.disabled { opacity: 0.55; }
.menu-soon-badge { margin-left: auto; font-size: 10px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.5px; color: var(--text-secondary); background: var(--card-bg); border: 1px solid var(--border); padding: 2px 7px; border-radius: 10px; }
.profile-menu-item.danger { color: #e74c3c; }
.profile-menu-item.danger svg { fill: #e74c3c; }
.profile-menu-item.danger:hover { background: rgba(231,76,60,0.15); }
.light-theme .profile-menu { background: #fff; border: 1px solid #e0e0e0; box-shadow: 0 12px 40px rgba(0,0,0,0.18); }

/* ==================== СТРАНИЦА НАСТРОЕК ==================== */
.settings-page { max-width: 680px; margin: 0 auto; }
.settings-title { color: var(--text); font-size: 1.6rem; margin: 0 0 1.2rem; }
.settings-card { background: var(--card-bg); border: 1px solid var(--border); border-radius: 16px; margin-bottom: 1.2rem; overflow: hidden; }
.settings-banner { position: relative; height: 250px; background-color: rgba(102,126,234,0.12); background-size: cover; background-position: center; display: flex; align-items: flex-end; }
.settings-banner.has-banner::after { content: ''; position: absolute; inset: 0; background: linear-gradient(to bottom, rgba(0,0,0,0.1), rgba(0,0,0,0.45)); }
.settings-banner-actions { position: absolute; top: 12px; right: 12px; display: flex; gap: 8px; z-index: 2; }
.settings-avatar-wrap { position: relative; margin: 0 0 -42px 22px; z-index: 2; }
.settings-avatar-wrap .profile-avatar { width: 92px; height: 92px; border: 4px solid var(--bg); font-size: 2.2rem; }
.settings-identity { padding: 52px 22px 20px; }
.settings-identity h3 { color: var(--text); font-size: 1.3rem; margin: 12px 0 2px; }
.settings-identity p { color: var(--text-secondary); font-size: 0.9rem; margin: 0; }
.settings-mini-btn { padding: 7px 14px; border-radius: 20px; border: 1px solid var(--border); background: var(--bg); color: var(--text); font-size: 12px; cursor: pointer; transition: all 0.2s; }
.settings-mini-btn:hover { border-color: #667eea; background: rgba(102,126,234,0.12); }
.settings-mini-btn.danger { color: #e74c3c; }
.settings-mini-btn.danger:hover { background: #e74c3c; color: #fff; border-color: #e74c3c; }
.settings-block { padding: 6px 18px; }
.settings-block-row { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 16px 0; flex-wrap: wrap; }
.settings-block-label { color: var(--text); font-size: 15px; }
.settings-theme-buttons { display: flex; gap: 8px; }
.settings-theme-btn { width: 42px; height: 42px; border-radius: 10px; border: 1px solid var(--border); background: var(--bg); cursor: pointer; transition: all 0.2s; display: flex; align-items: center; justify-content: center; padding: 0; }
.settings-theme-btn img { width: 22px; height: 22px; filter: brightness(0) invert(1); }
.light-theme .settings-theme-btn img { filter: brightness(0); }
.settings-theme-btn:hover { border-color: #667eea; }
.settings-theme-btn.active { border-color: #667eea; box-shadow: 0 0 0 2px rgba(102,126,234,0.3); background: rgba(102,126,234,0.12); }
.settings-logout-btn { width: 100%; padding: 13px; border-radius: 12px; border: 1px solid #e74c3c; background: transparent; color: #e74c3c; font-size: 14px; cursor: pointer; transition: all 0.2s; }
.settings-logout-btn:hover { background: #e74c3c; color: #fff; }

/* ==================== ПРЕМИУМ ==================== */
.premium-modal { border: 1px solid rgba(240,165,0,0.4); }
.premium-features { list-style: none; padding: 0; margin: 0 0 1.5rem; display: flex; flex-direction: column; gap: 10px; }
.premium-features li { color: var(--text); font-size: 14px; background: var(--card-bg); border: 1px solid var(--border); border-radius: 10px; padding: 10px 14px; }
.premium-plans { display: flex; gap: 12px; }
.premium-plan { position: relative; flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 16px 12px; border-radius: 14px; border: 1px solid var(--border); background: var(--card-bg); color: var(--text); cursor: pointer; transition: all 0.2s; }
.premium-plan:hover { border-color: #f0a500; transform: translateY(-2px); }
.premium-plan.featured { border-color: #f0a500; background: linear-gradient(135deg, rgba(245,175,25,0.12), rgba(241,39,17,0.12)); }
.premium-plan-name { font-size: 13px; color: var(--text-secondary); }
.premium-plan-price { font-size: 22px; font-weight: 700; }
.premium-badge { position: absolute; top: -10px; background: linear-gradient(135deg, #f5af19, #f12711); color: #fff; font-size: 11px; font-weight: 600; padding: 3px 10px; border-radius: 20px; }

/* ==================== СТРАНИЦА ПРОФИЛЯ ==================== */
.profile-page { max-width: 1000px; margin: 0 auto; }
.profile-page-header { position: relative; display: flex; align-items: center; gap: 1.2rem; padding: 1.2rem; background: var(--card-bg); border: 1px solid var(--border); border-radius: 16px; margin-bottom: 1.2rem; flex-wrap: wrap; overflow: hidden; }
.profile-page-cover { display: none; }
/* Когда есть шапка — раскладка колонкой: баннер сверху, а имя/почта на сплошном фоне (не сливаются) */
.profile-page-header.has-cover { display: block; padding: 0 0 1.2rem; align-items: initial; gap: 0; }
.profile-page-header.has-cover .profile-page-cover { display: block; position: relative; top: auto; left: auto; right: auto; height: 300px; background-size: cover; background-position: center; }
.profile-page-header.has-cover .profile-page-avatar { margin: -46px 0 0 1.2rem; border: 4px solid var(--bg); position: relative; z-index: 1; }
.profile-page-header.has-cover .profile-page-meta { padding: 0.7rem 1.2rem 0; }
.profile-page-header.has-cover .profile-edit-btn { margin: 0.9rem 1.2rem 0; }
.profile-page-avatar { width: 84px; height: 84px; border-radius: 50%; flex-shrink: 0; background: linear-gradient(135deg, #667eea, #f5576c); display: flex; align-items: center; justify-content: center; color: #fff; font-size: 2rem; font-weight: 600; overflow: hidden; border: 4px solid var(--bg); box-sizing: border-box; }
.profile-page-avatar img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }
.profile-page-meta { flex: 1; min-width: 200px; }
.profile-page-meta h2 { color: var(--text); font-size: 1.5rem; margin: 0 0 0.2rem; }
.profile-page-meta p { color: var(--text-secondary); font-size: 0.9rem; margin: 0 0 0.6rem; }
.profile-page-stats { display: flex; flex-wrap: wrap; gap: 14px; }
.profile-page-stats span { color: var(--text-secondary); font-size: 13px; }
.profile-page-stats b { color: #667eea; font-size: 15px; }
.profile-edit-btn { padding: 9px 16px; border-radius: 22px; border: 1px solid var(--border); background: var(--bg); color: var(--text); font-size: 13px; cursor: pointer; transition: all 0.2s; align-self: flex-start; }
.profile-edit-btn:hover { border-color: #667eea; background: rgba(102,126,234,0.12); }
.profile-tabs { display: flex; flex-wrap: nowrap; gap: 8px; margin-bottom: 1.2rem; overflow-x: auto; overflow-y: hidden; scrollbar-width: none; -ms-overflow-style: none; padding: 2px 2px 6px; -webkit-overflow-scrolling: touch; }
.profile-tabs::-webkit-scrollbar { display: none; }
.profile-tab { flex: 0 0 auto; white-space: nowrap; padding: 9px 16px; border-radius: 22px; border: 1px solid var(--border); background: transparent; color: var(--text-secondary); font-size: 14px; cursor: pointer; transition: background 0.2s, border-color 0.2s, color 0.2s; }
.profile-tab:hover { color: var(--text); border-color: #667eea; background: rgba(102,126,234,0.08); }
.profile-tab.active { background: rgba(102,126,234,0.15); border-color: #667eea; color: #667eea; font-weight: 600; }
.profile-tab-content { min-height: 200px; }
.profile-empty { text-align: center; color: var(--text-secondary); padding: 3rem 1rem; font-size: 1.05rem; }
.profile-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 12px; }
.profile-item { display: flex; align-items: center; gap: 12px; padding: 10px; background: var(--card-bg); border: 1px solid var(--border); border-radius: 14px; cursor: pointer; transition: all 0.2s; position: relative; }
.profile-item:hover { border-color: #667eea; transform: translateY(-2px); }
.profile-item-poster { width: 54px; height: 76px; object-fit: cover; border-radius: 8px; flex-shrink: 0; }
.profile-item-noposter { background: linear-gradient(135deg, #2a2a40, #3a3a55); }
.profile-item-body { min-width: 0; flex: 1; }
.profile-item-title { color: var(--text); font-size: 14px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.profile-item-sub { color: #8b95e6; font-size: 13px; margin-top: 5px; }
.profile-stars { color: #f5576c; letter-spacing: 1px; }
.profile-item-del { background: transparent; border: none; color: #e74c3c; cursor: pointer; font-size: 17px; padding: 4px 8px; flex-shrink: 0; border-radius: 8px; transition: background 0.2s; }
.profile-item-del:hover { background: rgba(231,76,60,0.15); }
.profile-comments { display: flex; flex-direction: column; gap: 12px; }
.profile-comment { background: var(--card-bg); border: 1px solid var(--border); border-radius: 14px; padding: 14px 16px; }
.profile-comment-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 8px; flex-wrap: wrap; }
.profile-comment-anime { color: #667eea; font-weight: 600; font-size: 14px; cursor: pointer; }
.profile-comment-anime:hover { text-decoration: underline; }
.profile-comment-date { color: var(--text-secondary); font-size: 12px; }
.profile-comment-text { color: var(--text); font-size: 14px; line-height: 1.5; white-space: pre-wrap; word-break: break-word; }
.profile-comment-foot { display: flex; align-items: center; justify-content: space-between; margin-top: 10px; }
.profile-comment-votes { color: var(--text-secondary); font-size: 13px; }
.profile-comment-del { background: transparent; border: 1px solid var(--border); color: #e74c3c; font-size: 12px; padding: 5px 12px; border-radius: 16px; cursor: pointer; transition: all 0.2s; }
.profile-comment-del:hover { background: #e74c3c; color: #fff; border-color: #e74c3c; }
@media (max-width: 600px) {
    .profile-list { grid-template-columns: 1fr; }
    .profile-page-header { gap: 1rem; }
    .profile-edit-btn { align-self: stretch; width: 100%; }
}

/* ==================== РЕКЛАМА ==================== */
.ad-slot { position: relative; margin: 10px 0; text-align: center; background: var(--card-bg); border: 1px solid var(--border); border-radius: 12px; padding: 10px; min-height: 40px; overflow: hidden; }
.ad-slot img { max-width: 100%; height: auto; border-radius: 8px; display: inline-block; vertical-align: middle; }
.ad-frame { display: block; margin: 0 auto; max-width: 100%; }
.ad-label { position: absolute; top: 6px; left: 8px; z-index: 2; font-size: 9px; text-transform: uppercase; letter-spacing: 0.5px; color: #fff; background: rgba(0,0,0,0.45); padding: 1px 6px; border-radius: 6px; pointer-events: none; }
.ad-preroll { position: relative; width: 100%; padding-top: 56.25%; background: #000; }
.ad-preroll-body { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; }
.ad-preroll-body img { max-width: 100%; max-height: 100%; object-fit: contain; }
.ad-preroll-skip { position: absolute; right: 14px; bottom: 14px; z-index: 3; padding: 9px 16px; border-radius: 8px; border: none; background: rgba(0,0,0,0.78); color: #fff; font-size: 14px; font-weight: 600; cursor: pointer; transition: background 0.2s; }
.ad-preroll-skip:not(:disabled):hover { background: #667eea; }
.ad-preroll-skip:disabled { opacity: 0.7; cursor: default; }
/* Видеореклама в правом нижнем углу на странице просмотра */
.corner-ad { position: fixed; right: 16px; bottom: 16px; width: 320px; height: 180px; z-index: 300; background: #000; border-radius: 10px; overflow: hidden; box-shadow: 0 8px 30px rgba(0,0,0,0.5); }
.corner-ad iframe { width: 100%; height: 100%; border: 0; display: block; }
.corner-ad-label { position: absolute; top: 4px; left: 6px; z-index: 2; font-size: 9px; text-transform: uppercase; letter-spacing: 0.5px; color: #fff; background: rgba(0,0,0,0.5); padding: 1px 6px; border-radius: 6px; pointer-events: none; }
.corner-ad-close { position: absolute; top: -9px; right: -9px; z-index: 3; width: 24px; height: 24px; border-radius: 50%; border: 2px solid var(--bg); background: rgba(0,0,0,0.9); color: #fff; font-size: 12px; line-height: 1; cursor: pointer; display: flex; align-items: center; justify-content: center; padding: 0; }
.corner-ad-close:hover { background: #e74c3c; }
@media (max-width: 600px) { .corner-ad { width: 180px; height: 101px; right: 8px; bottom: 8px; } }
/* Баннер-полоска поверх низа плеера */
.ad-overlay { position: absolute; left: 50%; bottom: 56px; transform: translateX(-50%); z-index: 6; max-width: 92%; background: rgba(0,0,0,0.6); border-radius: 8px; padding: 6px; line-height: 0; }
.ad-overlay-body img, .ad-overlay-body { max-width: 100%; }
.ad-overlay-body img { max-height: 90px; width: auto; border-radius: 4px; display: block; }
.ad-overlay-close { position: absolute; top: -10px; right: -10px; width: 22px; height: 22px; border-radius: 50%; border: none; background: rgba(0,0,0,0.85); color: #fff; font-size: 12px; line-height: 1; cursor: pointer; z-index: 7; }
.ad-overlay .ad-label { top: -8px; left: 6px; }
@media (max-width: 768px) { .ad-overlay { bottom: 48px; } .ad-overlay-body img { max-height: 60px; } }

/* ===== ТАЧ-УСТРОЙСТВА: убираем залипающий hover и серый тап-флэш ===== */
* { -webkit-tap-highlight-color: transparent; }
@media (hover: none) {
    .filter-chip:hover, .profile-tab:hover, .anime-tab-btn:hover, .dropdown-item:hover,
    .season-btn:hover, .profile-menu-item:hover, .settings-mini-btn:hover,
    .profile-edit-btn:hover, .profile-item:hover, .btn-search:hover, .btn-random:hover,
    .profile-nav-btn:hover, .category-show-all-inner:hover {
        background: transparent !important;
        border-color: var(--border) !important;
        box-shadow: none !important;
        transform: none !important;
    }
    .filter-chip.active:hover, .profile-tab.active:hover {
        background: rgba(102,126,234,0.15) !important; border-color: #667eea !important;
    }
    .user-avatar-btn:hover { background: rgba(102,126,234,0.2) !important; transform: none !important; }
    header.header-transparent .user-avatar-btn:hover { background: rgba(255,255,255,0.1) !important; transform: none !important; }
    .btn-menu:hover { background: rgba(255,255,255,0.08) !important; transform: none !important; }
    .scroll-btn:hover { background: var(--card-bg) !important; transform: none !important; box-shadow: none !important; }
}
/* Стрелки прокрутки карточек на главной — всегда квадратные, не сжимаются */
.scroll-btn { flex-shrink: 0; padding: 0; box-sizing: border-box; }
@media (max-width: 768px) { .scroll-btn { width: 32px !important; height: 32px !important; } }
@media (max-width: 480px) { .scroll-btn { width: 30px !important; height: 30px !important; } }
/* Чтобы кнопки в рядах не сжимались по ширине на телефоне */
.profile-tab, .filter-chip, .anime-tab-btn, .dubbing-btn,
.header-actions button, .footer-social a { flex-shrink: 0; }
/* Кнопка аватара: обёртка не должна сжиматься, кнопка держит квадрат */
.profile-dropdown { flex-shrink: 0; display: flex; align-items: center; }
.user-avatar-btn { flex-shrink: 0; aspect-ratio: 1 / 1; }
@media (max-width: 768px) {
    .profile-dropdown .user-avatar-btn { width: 36px; height: 36px; }
}