/* # web/css/style.css */

:root {
    --bg-color: #0f0f0f;
    --sec-bg: #1a1a1a;
    --text-color: #ffffff;
    --hint-color: #aaaaaa;
    --accent: #e50914;
    --kp-color: #ff6600;
    --imdb-color: #f5c518;
    --rezka-color: #1a8ae0;
    --live-color: #4cd137;
    --end-color: #ff4757;
    --input-bg: #2a2a2a;
    --gap-size: 18px;
}

body {
    background-color: var(--bg-color);
    color: var(--text-color);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    margin: 0; padding: 0;
    user-select: none; -webkit-tap-highlight-color: transparent;
    overflow-x: hidden;
}

/* СЛУЖЕБНЫЕ КЛАССЫ */
.hidden { display: none !important; }

/* HEADER */
.header {
    position: sticky;
    top: 0;
    z-index: 1000;
    background-color: rgba(15, 15, 15, 0.98);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    
    /* ВАЖНО: Убираем фиксированные высоты */
    height: auto;
    padding: 10px 15px; 
}

/* Создаем невидимый распорный элемент перед поиском */
.header::before {
    content: '';
    display: block;
    /* Если приложение развернуто, Telegram подставит сюда высоту статус-бара */
    height: env(safe-area-inset-top, 0px);
    /* Если env не работает, добавим минимальный запас для развернутого режима */
    min-height: 35px; 
    width: 100%;
}

/* Если приложение НЕ развернуто (маленькое окно), нам не нужен такой большой отступ */
@media screen and (max-height: 500px) {
    .header::before {
        min-height: 0;
        height: 0;
    }
}

.search-box { position: relative; margin-bottom: 12px; }
#search-input {
    width: 100%; background: var(--sec-bg); border: 1px solid rgba(255,255,255,0.1);
    border-radius: 12px; padding: 12px 40px 12px 15px; color: #fff;
    box-sizing: border-box; outline: none; font-size: 16px; 
}
#search-input:focus { border-color: var(--accent); }
#search-clear {
    position: absolute; right: 12px; top: 50%; transform: translateY(-50%);
    color: var(--hint-color); padding: 5px; display: none; cursor: pointer;
}

.filter-bar { 
    display: flex; 
    overflow-x: auto; 
    gap: 8px; 
    scrollbar-width: none; 
    padding-bottom: 4px; 
    align-items: center; 
}

.filter-bar::-webkit-scrollbar { 
    display: none; 
}

.filter-btn {
    white-space: nowrap; padding: 6px 14px; border-radius: 20px;
    background: var(--sec-bg); font-size: 12px; color: var(--hint-color);
    border: 1px solid rgba(255,255,255,0.05); transition: 0.2s; cursor: pointer;
}
.filter-btn.active { background: var(--text-color); color: var(--bg-color); font-weight: bold; }
.filter-btn.settings { background: #333; color: #fff; }

/* CATALOG */
.catalog-container { padding: 12px; }
.catalog-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }

.movie-card {
    background: var(--sec-bg); border-radius: 10px; overflow: hidden;
    display: flex; flex-direction: column; cursor: pointer;
    position: relative; border: 1px solid rgba(255, 255, 255, 0.03);
    transition: transform 0.1s ease;
}
.movie-card:active { transform: scale(0.97); }

.poster-box { position: relative; width: 100%; aspect-ratio: 2/3; background: #222; }
.poster-box img { width: 100%; height: 100%; object-fit: cover; }

.ratings-container { position: absolute; top: 6px; left: 6px; display: flex; flex-direction: column; gap: 3px; z-index: 2; }
.rt-item { font-size: 8px; font-weight: 900; padding: 1px 4px; border-radius: 3px; color: #000; width: fit-content; }
.rt-imdb { background: var(--imdb-color); }
.rt-kp { background: var(--kp-color); }

.category-badge { 
    position: absolute; top: 6px; right: 6px; 
    background: rgba(0, 0, 0, 0.5); color: #fff; 
    padding: 2px 5px; border-radius: 4px; 
    font-size: 7px; text-transform: uppercase; font-weight: bold; z-index: 2; 
}

.series-status { 
    position: absolute; bottom: 0; left: 0; right: 0; 
    background: rgba(0, 0, 0, 0.7); backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px);
    color: #fff; font-size: 8px; padding: 5px 2px; 
    display: flex; align-items: center; justify-content: center; text-align: center;
    z-index: 3;
}
.status-dot { display: inline-block; width: 6px; height: 6px; border-radius: 50%; margin-right: 4px; flex-shrink: 0; }
.dot-live { background-color: var(--live-color); box-shadow: 0 0 5px var(--live-color); }
.dot-end { background-color: var(--end-color); }

.movie-info { padding: 8px 6px; }
.movie-title { 
    font-size: 10px; font-weight: 500; height: 2.6em; overflow: hidden; 
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
    line-clamp: 2; line-height: 1.3; color: #efefef;
}
.movie-meta { 
    font-size: 9px; 
    color: var(--hint-color); 
    margin-top: 4px; 
    display: flex; 
    justify-content: space-between; 
    align-items: center; 
}

.card-inline-badges { display: flex; gap: 4px; align-items: center; }
.mini-badge { font-size: 11px; line-height: 1; }
/* 💔 дизлайк в каталоге */
.mini-badge-dislike {
    filter: hue-rotate(210deg) saturate(1.6) brightness(1.1);
    text-shadow: 0 0 6px rgba(123, 97, 255, 0.7);
}

/* MODAL */
.modal {
    position: fixed; inset: 0; background: rgba(0,0,0,0.95);
    z-index: 1000; display: none; flex-direction: column; justify-content: flex-end;
}
.modal.active { display: flex; }
.modal-content {
    background: var(--sec-bg); border-radius: 20px 20px 0 0;
    padding: 20px; max-height: 90vh; overflow-y: auto;
    position: relative;
}

.close-modal {
    position: absolute; top: 15px; right: 15px;
    width: 32px; height: 32px; background: rgba(255,255,255,0.1);
    border-radius: 50%; display: flex; align-items: center; justify-content: center;
    color: #fff; font-size: 18px; cursor: pointer; z-index: 1001;
    border: 1px solid rgba(255,255,255,0.1);
}

/* FIX: крестик закрытия модалки должен быть всегда кликабелен */
.close-modal {
    z-index: 99999 !important;
    pointer-events: auto !important;
}

/* FIX: контент модалки не должен перекрывать крестик */
.modal-content {
    position: relative;
    z-index: 1;
}

/* ЗАГОЛОВКИ СВЕРХУ */
.header-titles-top { 
    margin-bottom: 16px; 
    padding-right: 50px; 
}

.modal-title { 
    margin: 0 !important; 
    font-size: 20px; 
    font-weight: 800;
    line-height: 1.2;
    color: #fff;
}

.modal-orig-title { 
    margin: 2px 0 0 0 !important; 
    font-size: 14px; 
    font-style: italic;
    color: var(--hint-color);
    line-height: 1.2;
}

/* ОСНОВНАЯ ИНФО С ПОСТЕРОМ */
.header-main-info { 
    display: flex; 
    gap: 16px; 
    margin-bottom: 20px; 
    align-items: stretch;
}

.modal-poster-wrapper { 
    flex-shrink: 0; 
    width: 160px; 
    position: relative; 
    perspective: 1000px; 
}

.modal-poster-img {
    width: 100%; border-radius: 8px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.5), 0 0 0 1px rgba(255,255,255,0.08); 
    cursor: zoom-in; transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: block; position: relative; z-index: 2;
}

/* ПРАВАЯ КОЛОНКА */
.header-right-info { 
    flex-grow: 1; 
    display: flex; 
    flex-direction: column; 
    gap: 6px; 
    justify-content: flex-start;
}

/* ID ТОЛЬКО ДЛЯ АДМИНА */
.admin-only-id {
    font-family: monospace;
    font-size: 11px;
    color: var(--accent);
    background: rgba(229, 9, 20, 0.1);
    padding: 1px 4px;
    border-radius: 4px;
    width: fit-content;
    margin-top: 2px;
}

.header-right-info .info-row { display: flex; align-items: flex-start; gap: 8px; font-size: 13px; }
.header-right-info b { color: #fff; white-space: nowrap; }

/* ACTION ICONS */
.header-actions-row { 
    display: flex; 
    gap: 22px; 
    margin-top: auto; 
    padding-top: 10px; 
    /* Позволяет иконкам не прижиматься друг к другу на узких экранах */
    align-items: center; 
}

.action-icon {
    font-size: 22px; 
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    filter: grayscale(1) brightness(0.7);
    opacity: 0.4;
    position: relative;

    /* --- МОБИЛЬНЫЕ ФИКСЫ (Добавь это) --- */
    padding: 10px;               /* Увеличиваем площадь для попадания пальцем */
    margin: -10px;                /* Компенсируем отступ, чтобы gap: 22px сохранился визуально */
    user-select: none;            /* Запрещаем выделение текста */
    -webkit-user-select: none;
    -webkit-touch-callout: none;  /* Отключаем контекстное меню Android (важно для лонг-пресса!) */
    -webkit-tap-highlight-color: transparent; /* Убираем синюю вспышку при тапе */
    touch-action: manipulation;   /* Убирает задержку 300мс перед кликом */
    display: inline-flex;
    align-items: center;
    justify-content: center;
    z-index: 5;
}

.action-icon:active {
    transform: scale(1.2);
}

/* АКТИВНЫЕ СОСТОЯНИЯ — снимаем серость */
.action-icon.active,
.action-icon.dislike {
    filter: none !important;
    opacity: 1 !important;
    transform: scale(1.1);
}

/* ❤️ лайк */
.action-icon.active[data-type="like"] {
    color: #ff4757;
    text-shadow: 0 0 15px rgba(255, 71, 87, 0.6);
}

/* 💔 дизлайк — фиолетовый */
.action-icon.dislike[data-type="like"] {
    /* Твой фильтр для изменения цвета на фиолетовый */
    filter: hue-rotate(210deg) saturate(1.6) brightness(1.1) !important;
    text-shadow: 0 0 12px rgba(123, 97, 255, 0.7);
}

/* 💔 дизлайки — фиолетовый */
.filter-btn.my-dislikes {
    filter: hue-rotate(210deg) saturate(1.6) brightness(1.1);
    text-shadow: 0 0 12px rgba(123, 97, 255, 0.7);
}

.filter-btn#f-my {
    transition: filter 0.25s ease, text-shadow 0.25s ease;
}

/* ⭐ избранное */
.action-icon.active[data-type="fav"] {
    color: #f5c518;
    text-shadow: 0 0 15px rgba(245, 197, 24, 0.6);
}

/* 👁️ просмотрено */
.action-icon.active[data-type="watched"] {
    color: #4cd137;
    text-shadow: 0 0 15px rgba(76, 209, 55, 0.6);
}

/* ПОЛНОЭКРАННЫЙ ПОСТЕР */
.full-poster-overlay {
    position: fixed; inset: 0; background: rgba(0, 0, 0, 0.95);
    display: flex; align-items: center; justify-content: center;
    z-index: 9999; opacity: 0; transition: opacity 0.3s ease; cursor: zoom-out;
}
.full-poster-overlay.active { opacity: 1; }
.full-poster-img {
    max-width: 90%; max-height: 85%; border-radius: 12px; transform: scale(0.9);
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    box-shadow: 0 30px 60px rgba(0,0,0,0.8); border: 1px solid rgba(255, 255, 255, 0.15);
}

/* РЕЙТИНГИ */
.rating-section { background: rgba(255, 255, 255, 0.05); padding: 12px; border-radius: 12px; margin-bottom: 15px; }
.rating-label { font-weight: 700; font-size: 14px; color: #fff; margin-bottom: 8px; display: flex; align-items: center; gap: 8px; }
.rating-list { display: flex; flex-direction: column; gap: 6px; }
.rating-item { font-size: 13px; font-weight: 500; display: flex; align-items: center; gap: 6px; }
.rt-kp-text { color: var(--kp-color); }
.rt-imdb-text { color: var(--imdb-color); }
.rt-rezka-text { color: var(--rezka-color); }

.info-row { font-size: 13px; color: #efefef; display: flex; align-items: flex-start; gap: 8px; }
.main-meta, .content-section { display: flex; flex-direction: column; gap: 16px; margin: 15px 0; }
.content-section { padding-top: 15px; border-top: 1px solid rgba(255, 255, 255, 0.1); }

.meta-label { font-weight: 700; font-size: 14px; color: #fff; display: flex; align-items: center; gap: 8px; }
.meta-value { padding-left: 28px; font-size: 14px; line-height: 1.5; color: var(--hint-color); }

/* ОПИСАНИЕ */
.description-wrap { position: relative; cursor: pointer; }
.description-text {
    color: #ddd; white-space: pre-line; font-size: 14px; line-height: 1.5; 
    max-height: 100px; overflow: hidden; transition: max-height 0.4s ease;
}
.description-text.collapsed::after {
    content: ""; position: absolute; bottom: 0; left: 0; width: 100%; height: 40px;
    background: linear-gradient(transparent, var(--sec-bg)); pointer-events: none;
}
.description-text.expanded { max-height: 2000px; }
.read-more-btn { font-size: 12px; color: var(--accent); font-weight: bold; margin-top: 4px; padding-left: 28px; }

.separator { border: 0; border-top: 1px solid rgba(255,255,255,0.1); margin: 15px 0; }

/* ПЛЕЕР */
.selector-box { 
    background: rgba(255,255,255,0.05); 
    padding: 15px; 
    border-radius: 15px; 
    margin: 15px 0; 
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.selector-label { 
    display: block; 
    font-size: 11px; 
    color: var(--accent); 
    font-weight: bold; 
    margin-bottom: 8px; 
    text-transform: uppercase; 
    letter-spacing: 0.04em;
}

.selector-box select {
    width: 100%; background: var(--input-bg); color: #fff !important; border: 1px solid #444;
    padding: 12px; border-radius: 10px; outline: none; font-size: 15px; appearance: none;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' 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 10px center; background-size: 20px;
    margin-bottom: 4px;
}

/* БЛОКИ СЕРИЙ И КАЧЕСТВА */
#box-episodes {
    margin-top: 4px;
}

.episodes-grid { 
    display: grid; 
    grid-template-columns: repeat(5, 1fr); 
    gap: 10px; 
    margin-top: 8px; 
}

.ep-btn { 
    background: #2a2a2a; padding: 10px 0; text-align: center; border-radius: 8px; 
    font-size: 13px; border: 1px solid #444; color: #fff; transition: 0.1s;
}
.ep-btn.active { background: var(--accent); border-color: var(--accent); font-weight: bold; }

#box-quality {
    margin-top: 6px;
}

/* КНОПКА СМОТРЕТЬ */
.play-btn { 
    width: 100%; 
    background-color: var(--accent) !important; 
    color: #fff; 
    border: none; 
    padding: 16px; 
    border-radius: 12px; 
    font-weight: bold; 
    font-size: 16px; 
    margin-top: 14px; 
    cursor: pointer; 
    transition: all 0.3s ease;
    display: block; /* чтобы кнопки были друг под другом */
}

/* КНОПКА "СМОТРЕТЬ СНАЧАЛА" (ВТОРИЧНАЯ) */
/* Мы делаем её визуально "слабее", чем основную "Продолжить" */
#btn-watch {
    background-color: #2a2a2a !important; 
    color: #bbbbbb;
    font-size: 14px;
    padding: 12px;
    margin-top: 8px; /* Небольшой отступ от кнопки продолжения */
    border: 1px solid #333;
}

/* КНОПКА "ПРОДОЛЖИТЬ" (ГЛАВНАЯ) */
/* Она по умолчанию будет использовать стиль .play-btn (твой акцентный цвет) */
#btn-resume {
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

/* ТВОИ ПРАВИЛА ДЛЯ DISABLED (Без изменений) */
.play-btn:disabled, 
#btn-watch:disabled,
#btn-resume:disabled {
    background-color: #333333 !important; 
    color: #777777 !important;
    filter: grayscale(1) !important;
    cursor: not-allowed !important;
    box-shadow: none !important;
    opacity: 1 !important;
}

/* Переопределение disabled для регион-блока */
/* Даже в disabled остаётся предупреждающей */
.play-btn.btn-region-block:disabled,
#btn-watch.btn-region-block:disabled {
    background: linear-gradient(135deg, #ff7a18, #ff4d4d) !important;
    color: #fff !important;
    box-shadow: 0 0 10px rgba(255, 122, 24, 0.35) !important;
    filter: none !important;
    opacity: 1 !important;
    cursor: not-allowed !important;
}

/* Блок "Контент заблокирован" */
.blocked-notice {
    background: rgba(229, 9, 20, 0.12);
    border: 1px solid rgba(229, 9, 20, 0.8);
    border-radius: 12px;
    padding: 16px;
    color: #ffb3b3;
    font-size: 13px;
    text-align: center;
    width: 100%;
    box-sizing: border-box;
    box-shadow: 0 0 20px rgba(229, 9, 20, 0.25);
    animation: blockedPulse 2.5s ease-in-out infinite;
}

.blocked-notice h3 {
    margin: 6px 0 6px;
    color: #ff4757;
    font-size: 16px;
}

.blocked-notice p {
    margin: 0;
    color: #ffb3b3;
    line-height: 1.4;
}

.blocked-icon {
    font-size: 26px;
    display: block;
    margin-bottom: 6px;
    text-shadow: 0 0 12px rgba(229, 9, 20, 0.8);
}

@keyframes blockedPulse {
    0%, 100% { box-shadow: 0 0 16px rgba(229, 9, 20, 0.25); }
    50% { box-shadow: 0 0 28px rgba(229, 9, 20, 0.45); }
}

/* Кнопка регион-блока — спокойный предупреждающий стиль */
.play-btn.btn-region-block {
    background: #b94a2c !important;
    color: #fff !important;
    box-shadow: 0 0 6px rgba(185, 74, 44, 0.35);
    cursor: default !important;
}

/* Мобильный Telegram WebView fallback */
@media (max-width: 768px) {
    .blocked-notice {
        background: #2a0000 !important;
        border: 1px solid #ff3b3b !important;
        box-shadow: none !important;
        animation: none !important;
    }
}

/* Иконка перед текстом */
.play-btn.btn-region-block::before {
    content: "🛡️ ";
}

/* Блок "Технические работы" */
.tech-works-notice {
    background: rgba(255, 165, 0, 0.12);
    border: 1px solid rgba(255, 170, 0, 0.9);
    border-radius: 12px;
    padding: 16px;
    color: #ffd38a;
    font-size: 13px;
    text-align: center;
    width: 100%;
    box-sizing: border-box;
    box-shadow: 0 0 20px rgba(255, 165, 0, 0.35);
    animation: techPulse 2.5s ease-in-out infinite;
}

.tech-works-notice strong {
    color: #ffb703;
    font-size: 15px;
}

.tech-works-notice .tech-icon {
    font-size: 26px;
    display: block;
    margin-bottom: 6px;
    text-shadow: 0 0 12px rgba(255, 165, 0, 0.8);
}

@keyframes techPulse {
    0%, 100% { box-shadow: 0 0 14px rgba(255, 165, 0, 0.3); }
    50% { box-shadow: 0 0 26px rgba(255, 165, 0, 0.55); }
}

/* Мобильный Telegram WebView fallback */
@media (max-width: 768px) {
    .tech-works-notice {
        background: #2a1a00 !important;
        border: 1px solid #ffb703 !important;
        box-shadow: none !important;
        animation: none !important;
    }
}

/* ПАГИНАЦИЯ */
.pagination { display: flex; justify-content: space-between; align-items: center; padding: 20px 0; }
.page-btn { padding: 10px 20px; background: var(--sec-bg); border-radius: 10px; color: #fff; border: 1px solid #333; font-size: 14px; }

#page-input {
    display: inline-block; min-width: 30px; padding: 2px 6px; background: rgba(255, 255, 255, 0.05);
    border-radius: 6px; border: 1px dashed rgba(255, 255, 255, 0.2); color: var(--accent-color, #1a73e8);
}

/* --- СТИЛИ КОНСТРУКТОРА ПОИСКА (ADVANCED FILTERS) --- */

/* Telegram Desktop WebView: форс тёмную схему для select */
#filterModal select {
    color-scheme: dark !important;
    -webkit-appearance: none !important;
    appearance: none !important;
    background-color: #2a2a2a !important;
    color: #fff !important;
    border: 1px solid #444 !important;
}

/* иногда помогает задать фон через background */
#filterModal select {
    background-image: linear-gradient(#2a2a2a, #2a2a2a) !important;
}

/* Плейсхолдер-опция "Любой год" */
#filterModal select option[value=""] {
    color: #bbb !important;
}

.genre-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
    max-height: 40vh;
    overflow-y: auto;
    margin: 15px 0;
    padding-right: 5px;
}

.genre-item {
    background: #2a2a2a;
    border: 1px solid #444;
    border-radius: 8px;
    padding: 10px;
    text-align: center;
    font-size: 13px;
    color: #fff;
    cursor: pointer;
    transition: all 0.2s ease;
}

.genre-item.selected {
    background: var(--accent);
    border-color: var(--accent);
    box-shadow: 0 0 10px rgba(229, 9, 20, 0.3);
}

#filterModal .selector-label {
    margin-top: 10px;
}

/* --- FIX: Telegram WebView Android кликабельность жанров --- */
#filterModal .genre-item {
    pointer-events: auto !important;
    z-index: 5;
    position: relative;
    touch-action: manipulation;
}

#filterModal .genre-grid {
    position: relative;
    z-index: 4;
}

#filterModal select {
    width: 100%;
    background: var(--input-bg);
    color: #fff;
    border: 1px solid #444;
    padding: 12px;
    border-radius: 10px;
    outline: none;
    font-size: 15px;
}


/* --- СТИЛИ МОДАЛКИ КОНСТРУКТОРА ПОИСКА --- */

.filter-modal-header {
    border-bottom: 1px solid rgba(255,255,255,0.08);
    padding-bottom: 8px;
    margin-bottom: 16px;
}

.filter-modal-title {
    margin: 0;
    font-size: 20px;
    font-weight: 800;
    color: #fff;
    line-height: 1.2;
}

/* Секции внутри фильтров */
.filter-section {
    margin-bottom: 18px;
}

.filter-section-title {
    font-size: 12px;
    color: var(--accent);
    font-weight: bold;
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

#filterModal .modal-content {
    background: #1a1a1a;
    border: 1px solid rgba(255,255,255,0.1);
    position: relative;
    z-index: 3;
    padding-top: 20px;
}

#filterModal .play-btn {
    background: var(--accent);
    margin-top: 14px;
}


/* Fallback для Android WebView */
@media (max-width: 768px) {
    .genre-grid {
        display: flex !important;
        flex-wrap: wrap;
        gap: 8px;
    }

    .genre-item {
        flex: 1 1 48%;
        box-sizing: border-box;
    }
}

.genres-selected-info {
    margin-top: 6px;
    font-size: 12px;
    color: var(--hint-color);
    text-align: right;
}

.genre-item:active {
    transform: scale(0.97);
    opacity: 0.9;
}

.genre-item:hover {
    border-color: rgba(229, 9, 20, 0.6);
}

@keyframes fadeIn { from { opacity: 0; transform: translateY(-10px); } to { opacity: 1; transform: translateY(0); } }

.filter-btn.settings {
    position: relative;
    padding-right: 34px;   /* было 28px → даём место под кружок */
    user-select: none;
}

/* сам бейдж */
.filters-dot {
    position: absolute;
    top: 4px;            /* чуть выше */
    right: 3px;         /* выносим за пределы кнопки вправо */

    min-width: 18px;
    height: 18px;
    padding: 0 5px;

    background: #ff3b30;
    color: #fff;
    border-radius: 999px;

    font-size: 11px;
    line-height: 18px;
    font-weight: 700;
    text-align: center;

    display: none;
    box-shadow: 0 0 0 0 rgba(255, 59, 48, 0.6);
}

/* Пульсация — под новый размер */
.filters-dot.pulse {
    animation: pulseDot 0.5s ease-out;
}

@keyframes pulseDot {
    0%   { transform: scale(1);   box-shadow: 0 0 0 0 rgba(255, 59, 48, 0.7); }
    50%  { transform: scale(1.4); box-shadow: 0 0 0 8px rgba(255, 59, 48, 0); }
    100% { transform: scale(1);   box-shadow: 0 0 0 0 rgba(255, 59, 48, 0); }
}

.toast {
    position: fixed;
    left: 50%;
    bottom: 80px;
    transform: translateX(-50%) translateY(20px);
    background: rgba(30,30,30,0.95);
    color: #fff;
    padding: 10px 16px;
    border-radius: 12px;
    font-size: 13px;
    box-shadow: 0 6px 20px rgba(0,0,0,0.4);
    opacity: 0;
    transition: 0.25s ease;
    z-index: 9999;
    pointer-events: none;
}

.toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

.status-spacer {
    height: 6px;
    width: 100%;
}

/* === Меню "Моё" === */
.my-menu {
    position: absolute;
    top: 100%;
    left: 12px;
    right: 12px;
    margin-top: 6px;
    background: #1a1a1a;
    border-radius: 12px;
    border: 1px solid rgba(255,255,255,0.1);
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
    z-index: 200;
    overflow: hidden;
}

.my-menu-item {
    padding: 12px 14px;
    font-size: 14px;
    border-bottom: 1px solid rgba(255,255,255,0.05);
    cursor: pointer;
}

.my-menu-item:last-child {
    border-bottom: none;
}

.my-menu-item:active {
    background: rgba(255,255,255,0.08);
}

/* Общий стиль иконок в меню "Моё" */
.menu-icon {
    display: inline-block;
    margin-right: 6px;
    font-size: 16px;
    line-height: 1;
    vertical-align: -2px;
}

/* ⭐ Избранное */
.menu-icon-fav {
    color: #f5c518;
    text-shadow: 0 0 8px rgba(245, 197, 24, 0.6);
}

/* ❤️ Понравилось */
.menu-icon-like {
    color: #ff4757;
    text-shadow: 0 0 10px rgba(255, 71, 87, 0.6);
}

/* 💔 Не понравилось (фиолетовый дизлайк) */
.menu-icon-dislike {
    filter: hue-rotate(210deg) saturate(1.6) brightness(1.1);
    text-shadow: 0 0 8px rgba(123, 97, 255, 0.7);
}

/* 👁️ Просмотрено */
.menu-icon-watched {
    color: #4cd137;
    text-shadow: 0 0 8px rgba(76, 209, 55, 0.6);
}

.my-menu-item.active {
    background: rgba(255,255,255,0.08);
}

.my-menu-item.active .menu-icon {
    transform: scale(1.1);
}

/* Пульсация кнопки "⭐ Моё" — красный акцент */
.filter-btn.my-active {
    animation: myPulseRed 1.4s ease-in-out infinite;
    box-shadow: 0 0 0 0 rgba(229, 9, 20, 0.6);
}

@keyframes myPulseRed {
    0% {
        box-shadow: 0 0 0 0 rgba(229, 9, 20, 0.7);
    }
    50% {
        box-shadow: 0 0 0 10px rgba(229, 9, 20, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(229, 9, 20, 0);
    }
}

.custom-select {
    position: relative;
}

.custom-select__value {
    background: var(--input-bg);
    color: #fff;
    padding: 12px;
    border-radius: 10px;
    border: 1px solid #444;
    cursor: pointer;
    font-size: 15px;
}

.custom-select__dropdown {
    position: absolute;
    top: 110%;
    left: 0;
    right: 0;
    max-height: 240px;
    overflow-y: auto;
    background: #1a1a1a;
    border-radius: 10px;
    border: 1px solid #444;
    z-index: 9999;
    display: none;
}

.custom-select__option {
    padding: 10px 12px;
    cursor: pointer;
}

.custom-select__option:hover {
    background: rgba(255,255,255,0.08);
}

/* ===== ПРОГРЕСС ПРОСМОТРА ===== */

.progress-wrap {
    margin-top: 6px;
    width: 100%;
}

.progress-bg {
    width: 100%;
    height: 4px;
    background: rgba(255,255,255,0.25);
    border-radius: 3px;
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    width: 0%;
    background: #e50914;
    border-radius: 3px;
    transition: width 0.25s ease;
}

.progress-percent {
    font-size: 10px;
    margin-top: 2px;
    color: var(--hint-color);
    text-align: right;
}

html[data-platform="telegram"] {
    font-size: 15px;
}


/* Telegram */
html[data-platform="telegram"] body {
    font-family: "Inter", sans-serif;
}

/* Browser */
html[data-platform="browser"] body {
    font-family: system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
}

html[data-platform="browser"] .catalog-container {
    max-width: 1700px;
    margin: 0 auto;
}

html[data-platform="browser"] .catalog-grid {
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
}

/* --- Browser typography fix --- */

html[data-platform="browser"] .movie-title {
    font-size: 14px;
}

html[data-platform="browser"] .movie-meta {
    font-size: 12px;
}

html[data-platform="browser"] .filter-btn {
    font-size: 14px;
    padding: 8px 16px;
}

html[data-platform="browser"] #search-input {
    font-size: 18px;
}

html[data-platform="browser"] .rt-item {
    font-size: 10px;
}

html[data-platform="browser"] .series-status {
    font-size: 11px;
}