/* Rutube Smart TV: левая колонка, hero-карусель, горизонтальный ряд превью */
:root {
  --rt-bg: #000000;
  --rt-sidebar: #0a0a0a;
  --rt-border: #2a2a2a;
  --rt-text: #ffffff;
  --rt-text-dim: #c4c4c4;
  --rt-text-muted: #8e8e8e;
  --rt-accent: #ff5a00;
  --rt-focus-white: rgba(255, 255, 255, 0.95);
  --rt-badge-dark: rgba(30, 30, 30, 0.88);
  --rt-radius-lg: 18px;
  --rt-radius-xl: 22px;
  --rt-sidebar-w: 88px;
  --safe-top: max(12px, env(safe-area-inset-top, 0px));
  --safe-bottom: max(20px, env(safe-area-inset-bottom, 0px));
  --safe-x: max(28px, env(safe-area-inset-right, 0px));
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  font-family: "Segoe UI", Roboto, system-ui, -apple-system, sans-serif;
  background: var(--rt-bg);
  color: var(--rt-text);
  overflow-x: hidden;
}

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

/* ——— Shell: сайдбар + контент ——— */
.rt-shell {
  display: flex;
  min-height: 100vh;
  min-height: 100dvh;
}

.rt-sidebar {
  position: relative;
  width: var(--rt-sidebar-w);
  flex-shrink: 0;
  background: var(--rt-sidebar);
  border-right: 1px solid var(--rt-border);
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: calc(12px + var(--safe-top)) 0 var(--safe-bottom);
  gap: 12px;
  z-index: 120;
}

.rt-side-logo {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  margin-bottom: 8px;
  border-radius: 12px;
  outline: none;
}

.rt-side-logo:focus-visible {
  box-shadow: 0 0 0 3px var(--rt-focus-white);
}

.rt-side-logo img {
  display: block;
}

.rt-side-nav {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  flex: 1;
}

.rt-side-btn {
  width: 56px;
  height: 56px;
  border: none;
  border-radius: 14px;
  background: transparent;
  color: var(--rt-text);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  outline: none;
  transition: background 0.15s ease;
}

.rt-side-btn:hover {
  background: rgba(255, 255, 255, 0.06);
}

.rt-side-btn.is-active {
  background: rgba(255, 255, 255, 0.18);
}

.rt-side-btn:focus-visible {
  box-shadow: 0 0 0 3px var(--rt-focus-white);
}

.rt-ico {
  width: 28px;
  height: 28px;
  display: block;
}

.rt-side-admin {
  margin-top: auto;
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  color: var(--rt-text-muted);
  border-radius: 12px;
  outline: none;
}

.rt-side-admin:focus-visible {
  box-shadow: 0 0 0 3px var(--rt-focus-white);
}

/* ——— Основная область ——— */
.rt-content {
  flex: 1;
  min-width: 0;
  padding: var(--safe-top) var(--safe-x) var(--safe-bottom) 8px;
  display: flex;
  flex-direction: column;
}

/* Поиск + экранная клавиатура (оверлей снизу, как YouTube / Rutube TV) */
.rt-search-wide {
  display: flex;
  gap: 12px;
  max-width: 100%;
}

.rt-search-wide input {
  flex: 1;
  min-height: 56px;
  padding: 0 20px;
  border-radius: 12px;
  border: 1px solid var(--rt-border);
  background: #141414;
  color: var(--rt-text);
  font-size: 1.15rem;
  outline: none;
  caret-color: var(--rt-accent);
}

.rt-search-wide input:focus {
  border-color: #666;
  box-shadow: 0 0 0 3px rgba(255, 90, 0, 0.35);
}

.rt-search-go {
  min-height: 56px;
  padding: 0 22px;
  border-radius: 12px;
  border: none;
  background: var(--rt-accent);
  color: #0a0a0a;
  font-weight: 700;
  cursor: pointer;
}

.rt-search-go:focus-visible {
  box-shadow: 0 0 0 3px var(--rt-focus-white);
}

.tv-search-overlay {
  position: fixed;
  inset: 0;
  left: var(--rt-sidebar-w);
  z-index: 160;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  background: rgba(0, 0, 0, 0.55);
  padding: 0;
}

.tv-search-overlay[hidden] {
  display: none !important;
}

.tv-search-overlay-panel {
  background: linear-gradient(180deg, #1a1a1a 0%, #0d0d0d 100%);
  border-top: 1px solid var(--rt-border);
  border-radius: 16px 16px 0 0;
  padding: 16px 20px calc(20px + env(safe-area-inset-bottom, 0px));
  max-height: min(72vh, 520px);
  overflow-y: auto;
  box-shadow: 0 -12px 40px rgba(0, 0, 0, 0.65);
}

.tv-search-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.tv-search-title {
  font-size: 1.2rem;
  font-weight: 700;
}

.tv-search-close {
  width: 48px;
  height: 48px;
  border: none;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.08);
  color: var(--rt-text);
  font-size: 1.75rem;
  line-height: 1;
  cursor: pointer;
}

.tv-search-close:focus-visible {
  box-shadow: 0 0 0 3px var(--rt-focus-white);
}

.tv-kb {
  margin-top: 16px;
  user-select: none;
}

.tv-kb-row {
  display: flex;
  gap: 6px;
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: 8px;
}

.tv-kb-key {
  min-width: 40px;
  min-height: 48px;
  padding: 0 8px;
  border-radius: 10px;
  border: 1px solid #3a3a3a;
  background: linear-gradient(180deg, #3a3a3a 0%, #2a2a2a 100%);
  color: var(--rt-text);
  font-size: 1rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  flex: 0 0 auto;
}

.tv-kb-key:active {
  transform: scale(0.97);
}

.tv-kb-key:focus-visible {
  box-shadow: 0 0 0 3px var(--rt-focus-white);
  outline: none;
}

.tv-kb-key--wide {
  flex: 1 1 120px;
  min-width: 100px;
  max-width: 100%;
}

.tv-kb-key--space {
  flex: 3 1 200px;
  min-width: 160px;
}

.tv-kb-key--accent {
  background: linear-gradient(180deg, #ff6a1a 0%, var(--rt-accent) 100%);
  border-color: #cc4a00;
  color: #0a0a0a;
  font-weight: 800;
}

.tv-kb-key--muted {
  background: #222;
  font-size: 0.88rem;
}

/* Горизонтальный скролл: стрелки в боковых колонках сетки — не перекрывают превью */
.rt-scroll-shell {
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr) 52px;
  align-items: center;
  gap: 0 4px;
  min-width: 0;
}

.rt-scroll-fab {
  position: static;
  z-index: 1;
  width: 44px;
  height: 44px;
  justify-self: center;
  align-self: center;
  flex-shrink: 0;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(0, 0, 0, 0.55);
  color: #fff;
  font-size: 26px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  backdrop-filter: blur(6px);
}

.rt-scroll-fab:hover {
  background: rgba(40, 40, 40, 0.85);
}

.rt-scroll-fab:focus-visible {
  box-shadow: 0 0 0 3px var(--rt-focus-white);
  outline: none;
}

.rt-scroll-shell .rt-hero-track,
.rt-scroll-shell .rt-row-track {
  grid-column: 2;
  min-width: 0;
}

/* В ряду превью у карточки есть ещё текст снизу — стрелка должна стоять напротив самого превью (16:9),
   а не по центру всей карточки вместе с подписью. */
.rt-scroll-shell--row .rt-scroll-fab {
  align-self: start;
  /* padding-top у .rt-row-track (8px) + половина высоты превью (ширина карточки 280px × 9/16 / 2 = 78.75px)
     − половина высоты самой кнопки (44/2 = 22px) */
  margin-top: calc(8px + (280px * 9 / 16) / 2 - 22px);
}

/* ——— Hero-карусель (крупные баннеры) ——— */
.rt-hero-wrap {
  margin-bottom: 8px;
}

.rt-hero-wrap.is-hidden {
  display: none;
}

.rt-hero-track {
  display: flex;
  align-items: flex-start;
  gap: 20px;
  overflow-x: auto;
  overflow-y: hidden;
  /* симметричные отступы + скрытый scrollbar — чтобы боковые стрелки попадали ровно в центр превью */
  padding: 12px 4px;
  margin-bottom: 0;
  scroll-snap-type: x mandatory;
  scroll-padding-inline: 24px;
  scroll-behavior: smooth;
  overscroll-behavior-x: contain;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.rt-hero-track::-webkit-scrollbar {
  display: none;
  width: 0;
  height: 0;
}

.rt-hero-slide {
  flex: 0 0 min(78vw, 920px);
  max-width: 920px;
  scroll-snap-align: center;
  border: none;
  padding: 0;
  margin: 0;
  background: transparent;
  cursor: pointer;
  border-radius: var(--rt-radius-xl);
  overflow: hidden;
  position: relative;
  outline: none;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.55);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.rt-hero-slide:focus-visible,
.rt-hero-slide:hover {
  transform: scale(1.01);
  box-shadow: 0 0 0 4px var(--rt-focus-white), 0 12px 40px rgba(0, 0, 0, 0.6);
}

.rt-hero-slide-inner {
  position: relative;
  aspect-ratio: 16 / 9;
  background: #111;
}

.rt-hero-slide-inner img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.rt-hero-gradient {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 55%;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.92), transparent);
  pointer-events: none;
}

.rt-hero-caption {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 20px 24px 22px;
  text-align: left;
  z-index: 2;
}

.rt-hero-title {
  margin: 0;
  font-size: clamp(1rem, 2.2vw, 1.35rem);
  font-weight: 700;
  line-height: 1.3;
  color: #fff;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.rt-hero-meta {
  margin-top: 8px;
  font-size: 0.88rem;
  color: var(--rt-text-dim);
}

/* Возраст на баннере — справа снизу (как у Rutube) */
.age-badge--hero {
  position: absolute;
  bottom: 16px;
  right: 20px;
  z-index: 4;
  top: auto;
  left: auto;
  padding: 6px 12px;
  border-radius: 8px;
  font-size: 0.85rem;
  font-weight: 700;
  color: #fff;
  background: rgba(20, 20, 20, 0.88);
}

/* ——— Полоска категорий ——— */
.rt-cat-strip-wrap {
  margin-bottom: 16px;
}

.rt-cat-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 8px;
}

.cat-chip {
  min-height: 40px;
  padding: 0 18px;
  border-radius: 999px;
  border: 1px solid var(--rt-border);
  background: #101010;
  color: var(--rt-text-dim);
  font-size: 0.92rem;
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
  outline: none;
}

.cat-chip[aria-selected="true"] {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.35);
  color: var(--rt-text);
}

.cat-chip:focus-visible {
  box-shadow: 0 0 0 3px var(--rt-focus-white);
}

.rt-section-label {
  margin: 0 0 16px;
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

/* ——— Горизонтальный ряд превью (как внизу скрина Rutube) ——— */
.rt-row-wrap {
  flex: 1;
  min-height: 0;
  padding-bottom: 12px;
}

.rt-row-track {
  display: flex;
  flex-wrap: nowrap;
  align-items: flex-start;
  gap: 20px;
  overflow-x: auto;
  overflow-y: hidden;
  /* симметричные отступы + скрытый scrollbar — чтобы боковые стрелки были ровно по центру превью */
  padding: 8px 4px;
  margin-bottom: 0;
  scroll-snap-type: x proximity;
  scroll-padding-inline: 20px;
  scroll-behavior: smooth;
  overscroll-behavior-x: contain;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.rt-row-track::-webkit-scrollbar {
  display: none;
  width: 0;
  height: 0;
}

.video-card {
  flex: 0 0 280px;
  width: 280px;
  max-width: 85vw;
  scroll-snap-align: start;
  align-self: flex-start;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  border: none;
  border-radius: var(--rt-radius-lg);
  background: transparent;
  padding: 0;
  margin: 0;
  text-align: left;
  cursor: pointer;
  color: inherit;
  font: inherit;
  outline: none;
  appearance: none;
  -webkit-appearance: none;
  transition: transform 0.12s ease;
}

.video-card:focus-visible,
.video-card:hover {
  transform: translateY(-2px);
}

.video-card:focus-visible .thumb-wrap,
.video-card:hover .thumb-wrap {
  box-shadow: 0 0 0 3px var(--rt-focus-white);
}

.thumb-wrap {
  position: relative;
  border-radius: var(--rt-radius-lg);
  overflow: hidden;
  aspect-ratio: 16 / 9;
  background: #0a0a0a;
}

.thumb-wrap::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 40%;
  background: linear-gradient(transparent, rgba(0, 0, 0, 0.55));
  pointer-events: none;
  z-index: 1;
}

/* Ряд: возраст слева снизу, длительность справа снизу */
.age-badge--row {
  position: absolute;
  bottom: 10px;
  left: 10px;
  top: auto;
  z-index: 2;
  padding: 5px 9px;
  border-radius: 8px;
  font-size: 0.78rem;
  font-weight: 700;
  color: #fff;
  background: var(--rt-badge-dark);
}

.duration-badge {
  position: absolute;
  bottom: 10px;
  right: 10px;
  z-index: 2;
  padding: 5px 9px;
  border-radius: 8px;
  font-size: 0.8rem;
  font-weight: 600;
  color: #fff;
  background: var(--rt-badge-dark);
}

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

.thumb-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.5rem;
  color: #444;
  background: linear-gradient(160deg, #1a1a1a, #0d0d0d);
}

.card-title {
  margin: 12px 4px 6px;
  font-size: 0.95rem;
  font-weight: 600;
  line-height: 1.35;
  min-height: calc(1.35em * 2);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  color: var(--rt-text);
}

.card-channel {
  font-size: 0.84rem;
  color: var(--rt-text-dim);
  margin: 0 4px 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.card-stats {
  font-size: 0.78rem;
  color: var(--rt-text-muted);
  margin: 0 4px;
  line-height: 1.35;
}

.empty-state {
  padding: 40px 16px;
  color: var(--rt-text-muted);
  font-size: 1.05rem;
  max-width: 480px;
}

.rt-row-track > .empty-state {
  flex: 0 0 100%;
  width: 100%;
}

/* Плеер */
.is-hidden {
  display: none !important;
}

.player-overlay {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: #0a0a0a;
  display: none;
  flex-direction: column;
}

.player-overlay.is-open {
  display: flex;
}

/* Пока идёт преролл (Yandex Video Ads SDK) — не показываем свои кнопки/ползунок и заголовок ролика */
.player-overlay.stylelooks-ad-active {
  /* Слои рекламы на body часто 10³–10⁴; иначе fixed-оверлей SDK перекрывает весь плеер вместе с ✕ */
  z-index: 10000;
}

.player-overlay.stylelooks-ad-active .player-title,
.player-overlay.stylelooks-ad-active .player-desc {
  visibility: hidden !important;
  position: absolute !important;
  width: 0 !important;
  height: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
}

.player-overlay.stylelooks-ad-active .rt-player-chrome {
  display: none !important;
}

/* ——— Сцена плеера: видео на весь экран ——— */
.rt-pl-stage {
  position: absolute;
  inset: 0;
  isolation: isolate;
  background: #000;
  overflow: hidden;
}

.rt-pl-stage .player-video:not(.is-hidden),
.rt-pl-stage .player-frame:not(.is-hidden) {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: none;
  background: #000;
  display: block;
}

.rt-pl-stage .player-video:not(.is-hidden) {
  z-index: 1;
  object-fit: contain;
  pointer-events: none; /* клики ловит сцена, не сам тег video */
}

.player-overlay.stylelooks-ad-active .rt-pl-stage .player-video:not(.is-hidden) {
  z-index: 0; /* кадр рекламы не должен закрывать оверлеи SDK */
}

/* ——— Большая Play по центру ——— */
.rt-pl-bigplay {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  z-index: 30;
  width: 96px;
  height: 96px;
  padding: 0;
  border: none;
  background: transparent;
  cursor: pointer;
  color: #fff;
  transition: transform 0.15s ease, filter 0.15s ease;
  filter: drop-shadow(0 6px 24px rgba(0, 0, 0, 0.6));
}

.rt-pl-bigplay[hidden] { display: none; }
.rt-pl-bigplay svg { width: 100%; height: 100%; display: block; }
.rt-pl-bigplay:hover,
.rt-pl-bigplay:focus-visible {
  outline: none;
  transform: translate(-50%, -50%) scale(1.07);
}
.rt-pl-bigplay:focus-visible svg circle {
  stroke: var(--rt-accent);
  stroke-width: 4;
}

/* ——— Верхняя панель ——— */
.rt-pl-topbar {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 25;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: calc(20px + env(safe-area-inset-top, 0px)) 28px 60px;
  background: linear-gradient(to bottom, rgba(0, 0, 0, 0.78), rgba(0, 0, 0, 0));
  pointer-events: none;
  transition: opacity 0.25s ease, transform 0.25s ease;
}
.rt-pl-topbar > * { pointer-events: auto; }

.rt-pl-title {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.7);
}

/* ——— Нижняя панель контролов ——— */
.rt-pl-chrome {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 25;
  padding: 60px 28px calc(22px + env(safe-area-inset-bottom, 0px));
  background: linear-gradient(to top, rgba(0, 0, 0, 0.92), rgba(0, 0, 0, 0));
  display: flex;
  flex-direction: column;
  gap: 14px;
  transition: opacity 0.25s ease, transform 0.25s ease;
}
.rt-pl-chrome[hidden] { display: none; }

/* Авто-скрытие контролов при бездействии */
.player-overlay.is-idle .rt-pl-topbar,
.player-overlay.is-idle .rt-pl-chrome {
  opacity: 0;
  transform: translateY(0);
  pointer-events: none;
}
.player-overlay.is-idle .rt-pl-topbar { transform: translateY(-12px); }
.player-overlay.is-idle .rt-pl-chrome { transform: translateY(12px); }

/* ——— Полоса прогресса ——— */
.rt-pl-progress-row {
  display: flex;
  align-items: center;
  gap: 14px;
}

.rt-pl-time {
  font-size: 0.95rem;
  font-variant-numeric: tabular-nums;
  color: #fff;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.6);
  flex-shrink: 0;
  min-width: 4.5em;
  text-align: center;
}

.rt-pl-bar {
  position: relative;
  flex: 1;
  height: 28px; /* большая зона клика */
  display: flex;
  align-items: center;
  cursor: pointer;
}

.rt-pl-bar-bg,
.rt-pl-bar-buffered,
.rt-pl-bar-fill {
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  height: 6px;
  border-radius: 3px;
  pointer-events: none;
  transition: height 0.15s ease;
}
.rt-pl-bar-bg {
  width: 100%;
  background: rgba(255, 255, 255, 0.22);
}
.rt-pl-bar-buffered {
  width: 0%;
  background: rgba(255, 255, 255, 0.42);
}
.rt-pl-bar-fill {
  width: 0%;
  background: var(--rt-accent);
  box-shadow: 0 0 12px rgba(255, 90, 0, 0.45);
}

.rt-pl-bar-thumb {
  position: absolute;
  left: 0%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--rt-accent);
  box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.45);
  pointer-events: none;
  transition: transform 0.15s ease;
}

.rt-pl-bar:hover .rt-pl-bar-bg,
.rt-pl-bar:hover .rt-pl-bar-buffered,
.rt-pl-bar:hover .rt-pl-bar-fill {
  height: 8px;
}
.rt-pl-bar:hover .rt-pl-bar-thumb {
  transform: translate(-50%, -50%) scale(1.18);
}

/* ——— Ряд кнопок ——— */
.rt-pl-buttons-row {
  display: flex;
  align-items: center;
  gap: 10px;
}
.rt-pl-spacer { flex: 1; }

.rt-pl-iconbtn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 52px;
  height: 52px;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  cursor: pointer;
  flex-shrink: 0;
  transition: background 0.12s ease, transform 0.12s ease, box-shadow 0.12s ease;
}
.rt-pl-iconbtn:hover { background: rgba(255, 255, 255, 0.16); }
.rt-pl-iconbtn:active { transform: scale(0.96); }
.rt-pl-iconbtn:focus-visible {
  outline: none;
  background: var(--rt-accent);
  border-color: var(--rt-accent);
  color: #0a0a0a;
  box-shadow: 0 0 0 4px rgba(255, 90, 0, 0.4);
}

.rt-pl-iconbtn svg {
  width: 26px;
  height: 26px;
  display: block;
}

/* Главная кнопка Play/Pause крупнее */
.rt-pl-iconbtn--main {
  width: 64px;
  height: 64px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.92);
  color: #0a0a0a;
  border-color: transparent;
}
.rt-pl-iconbtn--main:hover { background: #fff; }
.rt-pl-iconbtn--main svg { width: 32px; height: 32px; }
.rt-pl-iconbtn--main:focus-visible {
  background: var(--rt-accent);
  color: #0a0a0a;
}

/* Переключение иконки play/pause через data-state */
.rt-pl-iconbtn .rt-pl-ico-pause,
.rt-pl-iconbtn .rt-pl-ico-vol-off { display: none; }
.rt-pl-iconbtn[data-state="playing"] .rt-pl-ico-play { display: none; }
.rt-pl-iconbtn[data-state="playing"] .rt-pl-ico-pause { display: block; }
.rt-pl-iconbtn[data-state="muted"] .rt-pl-ico-vol-on { display: none; }
.rt-pl-iconbtn[data-state="muted"] .rt-pl-ico-vol-off { display: block; }

/* Кнопка закрытия в нижнем ряду — акцент красным при фокусе */
.rt-pl-iconbtn--close:focus-visible {
  background: #c4302b;
  border-color: #c4302b;
  color: #fff;
  box-shadow: 0 0 0 4px rgba(196, 48, 43, 0.35);
}

/* Маленькая цифра «10» поверх стрелки на rew/fwd */
.rt-pl-iconbtn-num {
  position: absolute;
  bottom: 11px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 9px;
  font-weight: 800;
  font-family: inherit;
  color: currentColor;
  pointer-events: none;
  letter-spacing: -0.5px;
}

.rt-pl-back svg { transform: scaleX(1); }

/* ——— Тост (перемотка / громкость) ——— */
.rt-pl-toast {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  z-index: 28;
  min-width: 220px;
  padding: 18px 22px;
  border-radius: 16px;
  background: rgba(0, 0, 0, 0.78);
  color: #fff;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  pointer-events: none;
  backdrop-filter: blur(10px);
}
.rt-pl-toast[hidden] { display: none; }

.rt-pl-toast-big {
  font-size: 1.6rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}
.rt-pl-toast-sub {
  font-size: 0.95rem;
  color: rgba(255, 255, 255, 0.7);
  font-variant-numeric: tabular-nums;
}
.rt-pl-toast-bars {
  display: inline-flex;
  align-items: flex-end;
  gap: 3px;
  height: 28px;
}
.rt-pl-toast-bar {
  width: 8px;
  height: 8px;
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.22);
  align-self: flex-end;
}
.rt-pl-toast-bar.is-on {
  background: var(--rt-accent);
}
.rt-pl-toast-bars .rt-pl-toast-bar:nth-child(2)  { height: 11px; }
.rt-pl-toast-bars .rt-pl-toast-bar:nth-child(3)  { height: 13px; }
.rt-pl-toast-bars .rt-pl-toast-bar:nth-child(4)  { height: 15px; }
.rt-pl-toast-bars .rt-pl-toast-bar:nth-child(5)  { height: 17px; }
.rt-pl-toast-bars .rt-pl-toast-bar:nth-child(6)  { height: 19px; }
.rt-pl-toast-bars .rt-pl-toast-bar:nth-child(7)  { height: 21px; }
.rt-pl-toast-bars .rt-pl-toast-bar:nth-child(8)  { height: 23px; }
.rt-pl-toast-bars .rt-pl-toast-bar:nth-child(9)  { height: 25px; }
.rt-pl-toast-bars .rt-pl-toast-bar:nth-child(10) { height: 28px; }

/* ——— Fullscreen ——— */
.rt-pl-stage:fullscreen { background: #000; }
.rt-pl-stage:fullscreen .player-video { object-fit: contain; max-height: 100vh; }

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

/* Алиасы админки */
:root {
  --text: var(--rt-text);
  --text-muted: var(--rt-text-muted);
  --bg-card: #141414;
  --bg-panel: #0a0a0a;
  --accent: var(--rt-accent);
  --accent-2: #ff8c4d;
}

/* ——— Android TV / Smart TV режим ———
   На ТВ обычно есть overscan: пиксели по краям обрезаны 3–5%.
   Класс .tv ставится из tv-spatial.js по userAgent. Увеличиваем боковые поля,
   делаем фокус ярче и крупнее (видно с дивана, навигация D-pad'ом). */
body.tv {
  --safe-top: 48px;
  --safe-bottom: 48px;
  --safe-x: 64px;
  --rt-sidebar-w: 104px;
}

body.tv .tv-search-overlay {
  left: var(--rt-sidebar-w);
  right: var(--safe-x);
  padding-bottom: var(--safe-bottom);
}

/* На TV дефолтный focus-ring может не отображаться (нет :focus-visible после
   keyboard navigation в WebView Android), поэтому усиливаем :focus тоже. */
body.tv .video-card:focus .thumb-wrap,
body.tv .rt-hero-slide:focus,
body.tv .cat-chip:focus,
body.tv .rt-side-btn:focus,
body.tv .rt-side-logo:focus,
body.tv .rt-side-admin:focus,
body.tv .tv-kb-key:focus,
body.tv .tv-search-close:focus,
body.tv .rt-search-go:focus,
body.tv .rt-scroll-fab:focus,
body.tv .player-close:focus {
  outline: none;
  box-shadow: 0 0 0 4px var(--rt-accent), 0 0 0 7px rgba(255, 90, 0, 0.35);
}

body.tv .video-card:focus,
body.tv .rt-hero-slide:focus {
  transform: scale(1.04);
  z-index: 5;
  position: relative;
}

body.tv .cat-chip:focus {
  background: var(--rt-accent);
  color: #0a0a0a;
  border-color: var(--rt-accent);
}

/* На TV ховер не нужен (нет курсора) — выключаем дрожание элементов от :hover. */
body.tv .rt-side-btn:hover,
body.tv .rt-scroll-fab:hover,
body.tv .video-card:hover,
body.tv .rt-hero-slide:hover {
  background: transparent;
  transform: none;
  box-shadow: none;
}
body.tv .video-card:hover .thumb-wrap,
body.tv .rt-hero-slide:hover {
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.55);
}

/* ——— Плеер на ТВ ——— */
body.tv .player-overlay { background: #000; }
body.tv .rt-pl-title { font-size: 1.5rem; }
body.tv .rt-pl-time { font-size: 1.05rem; min-width: 5em; }

body.tv .rt-pl-iconbtn {
  width: 60px;
  height: 60px;
  border-radius: 16px;
}
body.tv .rt-pl-iconbtn svg { width: 30px; height: 30px; }
body.tv .rt-pl-iconbtn--main {
  width: 76px;
  height: 76px;
  border-radius: 20px;
}
body.tv .rt-pl-iconbtn--main svg { width: 38px; height: 38px; }
body.tv .rt-pl-iconbtn-num {
  font-size: 11px;
  bottom: 13px;
}

body.tv .rt-pl-bigplay { width: 128px; height: 128px; }

body.tv .rt-pl-topbar {
  padding: calc(36px + env(safe-area-inset-top, 0px)) 64px 80px;
}
body.tv .rt-pl-chrome {
  padding: 80px 64px calc(36px + env(safe-area-inset-bottom, 0px));
  gap: 18px;
}
body.tv .rt-pl-bar { height: 36px; }
body.tv .rt-pl-bar-bg,
body.tv .rt-pl-bar-buffered,
body.tv .rt-pl-bar-fill { height: 8px; border-radius: 4px; }
body.tv .rt-pl-bar-thumb { width: 22px; height: 22px; }

@media (max-width: 720px) {
  .rt-shell {
    flex-direction: column;
  }

  .rt-sidebar {
    width: 100%;
    flex-direction: row;
    justify-content: center;
    padding: 10px 12px;
    border-right: none;
    border-bottom: 1px solid var(--rt-border);
  }

  .rt-side-nav {
    flex-direction: row;
    flex: none;
  }

  .rt-side-admin {
    margin-top: 0;
    margin-left: auto;
  }

  .player-bar,
  .player-frame-wrap {
    padding-left: 16px;
  }

  .tv-search-overlay {
    left: 0;
  }
}
