:root {
  --bg: #0f1117;
  --panel: #171a23;
  --panel-2: #1e2230;
  --text: #e6e8ee;
  --muted: #9aa0ae;
  --accent: #e11d48;
  --radius: 12px;
}

* {
  box-sizing: border-box;
}

/* Атрибут hidden должен работать даже для элементов с display: flex/grid */
[hidden] {
  display: none !important;
}

body {
  margin: 0;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  gap: 24px;
  padding: 16px 24px;
  background: rgba(15, 17, 23, 0.85);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid #222736;
}

.logo {
  margin: 0;
  font-size: 20px;
  white-space: nowrap;
}

.search {
  flex: 1;
  max-width: 480px;
  padding: 10px 14px;
  border-radius: 10px;
  border: 1px solid #2a3040;
  background: var(--panel);
  color: var(--text);
  outline: none;
}

.search:focus {
  border-color: var(--accent);
}

.lang-switch {
  display: flex;
  gap: 4px;
  background: var(--panel);
  border: 1px solid #2a3040;
  border-radius: 10px;
  padding: 4px;
}

.lang-btn {
  background: none;
  border: none;
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
  padding: 5px 12px;
  border-radius: 7px;
  cursor: pointer;
}

.lang-btn:hover {
  color: var(--text);
}

.lang-btn.active {
  background: var(--accent);
  color: #fff;
}

.filters {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.sections {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.section-btn {
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid #2a3040;
  background: var(--panel);
  color: var(--muted);
  font-size: 13px;
  cursor: pointer;
  white-space: nowrap;
}

.section-btn:hover {
  color: var(--text);
  border-color: var(--accent);
}

.section-btn.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.section-btn .count {
  opacity: 0.7;
  margin-left: 4px;
  font-size: 12px;
}

/* Категории с подборками (Фильмы/Сериалы): кнопка + hover-меню. */
.sec-menu {
  position: relative;
  display: inline-flex;
}

.section-btn.has-menu::after {
  content: ' ▾';
  opacity: 0.55;
  font-size: 11px;
}

.sec-drop {
  position: absolute;
  top: 100%;
  left: 0;
  min-width: 190px;
  background: var(--panel);
  border: 1px solid #2a3040;
  border-radius: 10px;
  padding: 6px;
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.4);
  display: none;
  z-index: 60;
}

/* Показываем при наведении на категорию (и по фокусу с клавиатуры).
   Меню — ребёнок кнопки, поэтому при переходе курсора вниз на пункты
   hover не теряется (без зазора между кнопкой и списком). */
.sec-menu:hover .sec-drop,
.sec-menu:focus-within .sec-drop {
  display: block;
}

.sec-drop ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.sec-drop li {
  margin: 0;
}

.sec-drop-item {
  display: block;
  width: 100%;
  text-align: left;
  padding: 8px 12px;
  border: 0;
  background: none;
  color: var(--muted);
  font-size: 13px;
  border-radius: 8px;
  cursor: pointer;
  white-space: nowrap;
}

.sec-drop-item:hover {
  background: #2a3040;
  color: var(--text);
}

.sec-drop-item.active {
  color: #fff;
  background: var(--accent);
}

.genre-select {
  padding: 8px 12px;
  border-radius: 10px;
  border: 1px solid #2a3040;
  background: var(--panel);
  color: var(--text);
  font-size: 13px;
  outline: none;
  cursor: pointer;
}

.genre-select:focus {
  border-color: var(--accent);
}

.filter-controls {
  display: flex;
  align-items: center;
  gap: 10px;
}

.released-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  border: 1px solid #2a3040;
  border-radius: 10px;
  background: var(--panel);
  color: var(--text);
  font-size: 13px;
  cursor: pointer;
  white-space: nowrap;
  user-select: none;
}

.released-toggle input {
  accent-color: var(--accent);
  cursor: pointer;
}

main {
  padding: 24px;
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 20px;
}

.card {
  cursor: pointer;
  background: var(--panel);
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid #222736;
  transition: transform 0.15s ease, border-color 0.15s ease;
}

.card:hover {
  transform: translateY(-3px);
  border-color: var(--accent);
}

.thumb {
  position: relative;
  aspect-ratio: 16 / 9;
  /* До загрузки постера видна градиентная заглушка: чёрный прямоугольник выглядел
     так, будто карточка прогрузилась только наполовину. */
  background: linear-gradient(135deg, #1e2230, #171a23);
}

.thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* Постер проявляется по факту загрузки (класс .loaded ставит JS/страница каталога). */
.grid .thumb img,
.continue-list .thumb img {
  opacity: 0;
  transition: opacity 0.2s ease;
}

.grid .thumb img.loaded,
.continue-list .thumb img.loaded {
  opacity: 1;
}

.thumb .placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 42px;
  background: linear-gradient(135deg, #1e2230, #171a23);
}

.play {
  position: absolute;
  inset: 0;
  margin: auto;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: rgba(225, 29, 72, 0.9);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  opacity: 0;
  transition: opacity 0.15s ease;
}

.card:hover .play {
  opacity: 1;
}

.meta {
  padding: 12px 14px 14px;
}

.title {
  margin: 0 0 8px;
  font-size: 15px;
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
}

.card-head .title {
  margin: 0;
}

.card-rating {
  flex-shrink: 0;
  font-size: 12px;
  font-weight: 600;
  color: #f5c518;
  white-space: nowrap;
}

.card-line {
  margin-top: 5px;
  font-size: 12px;
  color: var(--muted);
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.meta .tags {
  margin-top: 10px;
}

.tags {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.badge {
  background: var(--panel-2);
  color: var(--muted);
  font-size: 12px;
  padding: 3px 8px;
  border-radius: 999px;
}

.badge.rating {
  background: #f5c518;
  color: #0f1117;
  font-weight: 600;
}

.badge.magnet {
  background: #1d4ed8;
  color: #fff;
}

.size {
  color: var(--muted);
  font-size: 12px;
}

.empty {
  text-align: center;
  color: var(--muted);
  padding: 48px 0;
}

/* Якорь бесконечной прокрутки: наблюдается IntersectionObserver'ом и
   догружает следующую страницу каталога при приближении к низу. */
.sentinel {
  height: 2px;
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.8);
  padding: 24px;
}

.modal-card {
  width: min(1100px, 100%);
  background: var(--panel);
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid #2a3040;
  max-height: 92vh;
  overflow-y: auto;
}

.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 16px;
  border-bottom: 1px solid #222736;
}

.modal-head h2 {
  margin: 0;
  font-size: 17px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.close {
  background: none;
  border: none;
  color: var(--text);
  font-size: 28px;
  line-height: 1;
  cursor: pointer;
  padding: 0 6px;
}

.close:hover {
  color: var(--accent);
}

#player {
  width: 100%;
  aspect-ratio: 16 / 9;
  display: block;
  background: #000;
}

.player-wrap {
  position: relative;
  background: #000;
}

.player-controls {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  background: var(--panel);
  border-top: 1px solid #222736;
}

/* --- Полноэкранный режим: всплывающая панель управления ---
   Видео занимает весь экран, панель плавает поверх него снизу и
   автоматически скрывается при бездействии мыши (класс controls-visible
   ставится из watch.js на mousemove). Тонкая полоса #ctrl-mini видна всегда. */
#player-wrap.fullscreen {
  width: 100vw;
  height: 100vh;
  max-width: none;
  background: #000;
}

#player-wrap.fullscreen #player {
  width: 100vw;
  height: 100vh;
  aspect-ratio: auto;
}

#player-wrap.fullscreen .ctrl-mini {
  display: block;
}

#player-wrap.fullscreen .player-controls {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 2;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.82), rgba(0, 0, 0, 0));
  border-top: none;
  padding: 28px 14px 10px;
  opacity: 0;
  transform: translateY(6px);
  pointer-events: none;
  transition: opacity 0.25s ease, transform 0.25s ease;
}

#player-wrap.fullscreen.controls-visible .player-controls {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

#player-wrap.fullscreen.controls-hidden {
  cursor: none;
}

.ctrl-btn {
  background: none;
  border: none;
  color: var(--text);
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
  padding: 2px 4px;
  flex-shrink: 0;
}

.ctrl-btn:hover {
  color: var(--accent);
}

.ctrl-btn:disabled {
  opacity: 0.35;
  cursor: default;
  color: var(--text);
}

/* Кнопки переключения серий в плеере (prev/next). */
.ctrl-ep {
  font-size: 14px;
  padding: 2px 2px;
}

/* Кнопки перемотки на 5 секунд (−5/+5) рядом с полосой прогресса. */
.ctrl-seek {
  font-size: 12px;
  font-weight: 600;
  padding: 2px 3px;
  border-radius: 4px;
  border: 1px solid transparent;
  color: var(--muted);
}

.ctrl-seek:hover {
  color: var(--accent);
  border-color: rgba(0, 199, 255, 0.4);
}

/* Тонкая полоса прогресса поверх видео в полноэкранном режиме: видна,
   даже когда панель управления скрыта. */
.ctrl-mini {
  display: none;
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 3px;
  background: rgba(255, 255, 255, 0.18);
  z-index: 3;
  pointer-events: none;
}

.ctrl-mini-fill {
  height: 100%;
  width: 0%;
  background: var(--accent);
}

.ctrl-bar {
  position: relative;
  flex: 1;
  height: 18px;
  cursor: pointer;
  display: flex;
  align-items: center;
}

.ctrl-bar::before {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  height: 4px;
  border-radius: 2px;
  background: #2a3040;
}

.ctrl-buffered {
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  height: 4px;
  border-radius: 2px;
  background: rgba(0, 199, 255, 0.35);
  width: 0%;
  pointer-events: none;
}

.ctrl-position {
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  height: 4px;
  border-radius: 2px;
  background: var(--accent);
  width: 0%;
  pointer-events: none;
}

.ctrl-thumb {
  position: absolute;
  top: 50%;
  left: 0%;
  transform: translate(-50%, -50%);
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--accent);
  pointer-events: none;
}

.ctrl-time {
  flex-shrink: 0;
  color: var(--muted);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.ctrl-volume {
  width: 80px;
  accent-color: var(--accent);
}

.ctrl-quality {
  display: flex;
  gap: 4px;
  flex-shrink: 0;
}

.q-btn {
  background: var(--panel-2);
  border: 1px solid #2a3040;
  border-radius: 6px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1;
  padding: 4px 6px;
  cursor: pointer;
}

.q-btn:hover {
  border-color: var(--accent);
  color: var(--text);
}

.q-btn.active {
  border-color: var(--accent);
  background: rgba(0, 199, 255, 0.12);
  color: var(--text);
}

.player-error {
  margin: 12px 20px;
  padding: 10px 12px;
  color: #ff6b6b;
  font-size: 13px;
  background: rgba(255, 107, 107, 0.08);
  border: 1px solid rgba(255, 107, 107, 0.3);
  border-radius: 8px;
}

.player-debug {
  margin: 0 20px 12px;
  padding: 10px 12px;
  font-size: 11px;
  line-height: 1.5;
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  color: #9fb0c3;
  background: #141824;
  border: 1px solid #2a3040;
  border-radius: 8px;
  white-space: pre-wrap;
  word-break: break-word;
  max-height: 200px;
  overflow-y: auto;
}

.details-body {
  display: flex;
  gap: 20px;
  padding: 20px;
}

.details-poster {
  width: 200px;
  flex-shrink: 0;
  border-radius: 8px;
  object-fit: cover;
  align-self: flex-start;
  background: var(--panel-2);
}

.details-info {
  flex: 1;
  min-width: 0;
}

.details-title {
  margin: 0 0 2px;
  font-size: 20px;
  line-height: 1.25;
}

.details-rating {
  color: var(--accent);
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 6px;
}

.details-subtitle {
  color: var(--text);
  font-size: 13px;
  opacity: 0.85;
  margin-bottom: 6px;
}

.details-meta {
  color: var(--muted);
  font-size: 14px;
  margin-bottom: 6px;
}

.details-line {
  color: var(--muted);
  font-size: 13px;
  margin-bottom: 4px;
}

.details-plot {
  line-height: 1.5;
  margin: 8px 0 16px;
}

.details-note {
  color: var(--muted);
  font-size: 13px;
  padding: 10px 12px;
  background: var(--panel-2);
  border-radius: 8px;
}

.sources {
  padding: 16px 20px;
  border-top: 1px solid #222736;
}

.sources-title {
  margin: 0 0 10px;
  font-size: 14px;
  color: var(--muted);
  font-weight: 600;
}

.src-group {
  margin-bottom: 12px;
}

.src-group-label {
  font-size: 12px;
  color: var(--muted);
  font-weight: 600;
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.src-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 10px;
}

.chip {
  background: var(--panel-2);
  border: 1px solid #2a3040;
  border-radius: 999px;
  color: var(--text);
  font-size: 12px;
  padding: 5px 12px;
  cursor: pointer;
}

.chip:hover {
  border-color: var(--accent);
}

.chip.active {
  border-color: var(--accent);
  background: rgba(0, 199, 255, 0.12);
}

.episodes {
  margin-top: 14px;
}

.episodes-title {
  margin: 0 0 10px;
  font-size: 14px;
  color: var(--muted);
  font-weight: 600;
}

.ep-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  max-height: 200px;
  overflow-y: auto;
}

.ep-btn {
  min-width: 56px;
  background: var(--panel-2);
  border: 1px solid #2a3040;
  border-radius: 8px;
  color: var(--text);
  font-size: 12px;
  padding: 6px 10px;
  cursor: pointer;
  white-space: nowrap;
}

.ep-btn:hover {
  border-color: var(--accent);
}

.ep-btn.active {
  border-color: var(--accent);
  background: rgba(0, 199, 255, 0.12);
}

/* Список раздач (торрентов) сезона сериала: по каждой видно озвучки
   (студии, без дублей), качество и сиды. Клик переключает просмотр. */
.release-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 240px;
  overflow-y: auto;
}

.release-btn {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  text-align: left;
  padding: 7px 12px;
  background: var(--panel-2);
  border: 1px solid #2a3040;
  border-radius: 8px;
  color: var(--text);
  cursor: pointer;
}

.release-btn:hover {
  border-color: var(--accent);
}

.release-btn.active {
  border-color: var(--accent);
  background: rgba(0, 199, 255, 0.12);
}

.release-voices {
  font-size: 13px;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.release-meta {
  flex: none;
  font-size: 11px;
  color: var(--muted);
  white-space: nowrap;
}

.sources-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.source-btn {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  min-height: 46px;
  text-align: left;
  padding: 8px 12px;
  background: var(--panel-2);
  border: 1px solid #2a3040;
  border-radius: 8px;
  color: var(--text);
  cursor: pointer;
  font-size: 13px;
}

.source-btn:hover {
  border-color: var(--accent);
}

.source-btn.active {
  border-color: var(--accent);
  background: rgba(0, 199, 255, 0.08);
}

.source-title {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.source-meta {
  flex-shrink: 0;
  color: var(--muted);
  white-space: nowrap;
}

.sources-empty {
  color: var(--muted);
  font-size: 13px;
  margin: 0;
}

.tracks {
  padding: 0 20px 16px;
}

.tracks-title {
  margin: 0 0 8px;
  font-size: 13px;
  color: var(--muted);
  font-weight: 600;
}

.tracks-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.track-btn {
  padding: 6px 12px;
  background: var(--panel-2);
  border: 1px solid #2a3040;
  border-radius: 8px;
  color: var(--text);
  cursor: pointer;
  font-size: 13px;
}

.track-btn:hover {
  border-color: var(--accent);
}

.track-btn.active {
  border-color: var(--accent);
  background: rgba(0, 199, 255, 0.08);
}

/* Кнопки выбора субтитров — как .track-btn, но отдельный класс, чтобы
   переключение звуковой дорожки (querySelectorAll('.track-btn')) не
   сбрасывало активность субтитров. */
.sub-btn {
  padding: 6px 12px;
  background: var(--panel-2);
  border: 1px solid #2a3040;
  border-radius: 8px;
  color: var(--text);
  cursor: pointer;
  font-size: 13px;
}

.sub-btn:hover {
  border-color: var(--accent);
}

.sub-btn.active {
  border-color: var(--accent);
  background: rgba(0, 199, 255, 0.08);
}

.tracks-note {
  width: 100%;
  margin: 0;
  padding: 10px 12px;
  border: 1px solid rgba(248, 113, 113, 0.3);
  border-radius: 8px;
  background: rgba(248, 113, 113, 0.06);
  color: #f87171;
  font-size: 13px;
  line-height: 1.4;
}

/* Диалог «озвучка не сделана на все серии» (выбор доступной серии или
   закрытие просмотра). */
.tl-card {
  max-width: 560px;
}

.tl-body {
  padding: 16px 20px;
}

.tl-message {
  margin: 0 0 14px;
  color: var(--text);
  font-size: 14px;
  line-height: 1.5;
}

.tl-episodes {
  margin-bottom: 16px;
}

.tl-season {
  width: 100%;
  font-size: 12px;
  color: var(--muted);
  font-weight: 600;
  margin: 8px 0 4px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.tl-close-btn {
  width: 100%;
  margin-top: 4px;
}

@media (max-width: 640px) {
  .details-body {
    flex-direction: column;
  }
  .details-poster {
    width: 100%;
    max-width: 300px;
  }
}

/* ---- Авторизация (вход/регистрация) ---- */

.user-area {
  display: flex;
  align-items: center;
  gap: 10px;
}

.user-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  max-width: 180px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.auth-btn {
  padding: 8px 14px;
  border-radius: 10px;
  border: 1px solid #2a3040;
  background: var(--panel);
  color: var(--text);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
}

.auth-btn:hover {
  border-color: var(--accent);
}

.auth-btn-primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.auth-btn-primary:hover {
  filter: brightness(1.1);
}

/* Модалка входа/регистрации */
.auth-card {
  width: min(420px, 100%);
}

.auth-body {
  padding: 20px;
}

.auth-tabs {
  display: flex;
  gap: 6px;
  margin-bottom: 18px;
  background: var(--panel-2);
  border: 1px solid #2a3040;
  border-radius: 10px;
  padding: 4px;
}

.auth-tab {
  flex: 1;
  background: none;
  border: none;
  color: var(--muted);
  font-size: 14px;
  font-weight: 600;
  padding: 8px;
  border-radius: 8px;
  cursor: pointer;
}

.auth-tab:hover {
  color: var(--text);
}

.auth-tab.active {
  background: var(--accent);
  color: #fff;
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.auth-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 13px;
  color: var(--muted);
}

.auth-field input {
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid #2a3040;
  background: var(--panel-2);
  color: var(--text);
  font-size: 14px;
  outline: none;
}

.auth-field input:focus {
  border-color: var(--accent);
}

.auth-error {
  margin: 0;
  color: #f87171;
  font-size: 13px;
}

.auth-submit {
  padding: 11px;
  border-radius: 10px;
  border: none;
  background: var(--accent);
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}

.auth-submit:hover {
  filter: brightness(1.1);
}

.auth-submit:disabled {
  opacity: 0.6;
  cursor: default;
}

/* ---- «Продолжить просмотр» (история) ---- */

.continue {
  margin-bottom: 24px;
}

.continue-title {
  margin: 0 0 12px;
  font-size: 18px;
}

.continue-list {
  display: flex;
  gap: 14px;
  overflow-x: auto;
  padding-bottom: 8px;
}

.continue-card {
  position: relative;
  flex: 0 0 190px;
  width: 190px;
  background: var(--panel);
  border: 1px solid #222736;
  border-radius: var(--radius);
  overflow: hidden;
  cursor: pointer;
  transition: transform 0.15s ease, border-color 0.15s ease;
}

.continue-card:hover {
  transform: translateY(-3px);
  border-color: var(--accent);
}

.continue-card .thumb {
  aspect-ratio: 2 / 3;
}

.continue-meta {
  padding: 10px 12px;
}

.continue-name {
  font-size: 13px;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.continue-sub {
  font-size: 12px;
  color: var(--muted);
  margin-top: 2px;
}

.continue-progress {
  height: 4px;
  background: #2a3040;
  border-radius: 2px;
  margin-top: 8px;
  overflow: hidden;
}

.continue-bar {
  height: 100%;
  background: var(--accent);
}

.continue-time {
  font-size: 11px;
  color: var(--muted);
  margin-top: 4px;
}

.continue-remove {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: none;
  background: rgba(0, 0, 0, 0.6);
  color: #fff;
  font-size: 12px;
  cursor: pointer;
  line-height: 1;
}

.continue-remove:hover {
  background: var(--accent);
}

/* Кнопка «Продолжить» в шапке модалки фильма */
.modal-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.resume-btn {
  padding: 8px 14px;
  border-radius: 10px;
  border: 1px solid var(--accent);
  background: rgba(225, 29, 72, 0.15);
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
}

.resume-btn:hover {
  background: var(--accent);
}


/* Missing seasons and episodes remain visible. */
.chip:disabled, .ep-btn:disabled {
  color: #888;
  background: #292929;
  border-color: #444;
  opacity: .55;
  cursor: not-allowed;
  box-shadow: none;
}

/* ---- Отдельные страницы (каталог / фильм / просмотр / вход / IPTV) ----
   Карточка фильма и плеер жили в модалке внутри каталога — теперь это свои
   страницы, поэтому контейнер повторяет .modal-card, но без фиксированной
   высоты и затемнения фона. */

a.logo {
  text-decoration: none;
  color: inherit;
}

/* Карточка каталога — ссылка на страницу фильма: без синего цвета и подчёркивания
   (стили гиперссылки браузера здесь не нужны — карточка выглядит как плитка). */
a.card,
a.card:hover,
a.card:visited,
a.card:focus {
  color: inherit;
  text-decoration: none;
}

a.close {
  text-decoration: none;
}

.page {
  max-width: 1180px;
  margin: 0 auto;
  padding: 20px 24px 48px;
}

/* Страница просмотра — плеер шире прочих страниц. */
.page-wide {
  max-width: 1500px;
  padding-bottom: 32px;
}

.page-narrow {
  max-width: 460px;
}

.page-card {
  background: var(--panel);
  border: 1px solid #2a3040;
  border-radius: var(--radius);
  overflow: hidden;
}

.page > .player-wrap {
  border-radius: var(--radius);
  overflow: hidden;
}

/* Название фильма/серии в шапке страницы просмотра. */
.watch-title {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--muted);
  font-size: 14px;
}

/* Узкие экраны (телефон, окно браузера): в шапке много ссылок — название убираем,
   логотип разрешаем сжимать, иначе строка не помещается и уезжает за край. */
@media (max-width: 720px) {
  .topbar {
    gap: 12px;
    padding: 12px 14px;
  }

  .watch-title {
    display: none;
  }

  .logo {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
  }
}


