:root {
  color-scheme: dark;
  --watch-bg: #050611;
  --watch-surface: #101126;
  --watch-text: #f1f3ff;
  --watch-muted: #c4b5fd;
  --watch-accent: #7067ff;
  --watch-button-text: #ffffff;
  --font-pixel: "Pixelify Sans", "Press Start 2P", -apple-system, monospace;
  --pixel-border: 2px solid #382e70;
  --pixel-shadow: 3px 3px 0px #000000;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  min-height: 100%;
  background: var(--watch-bg);
}

body {
  min-width: 320px;
  min-height: 100vh;
  min-height: 100svh;
  margin: 0;
  background:
    radial-gradient(circle at 85% 5%, color-mix(in srgb, var(--watch-accent) 18%, transparent), transparent 34rem),
    var(--watch-bg);
  color: var(--watch-text);
  -webkit-font-smoothing: antialiased;
}

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

[hidden] {
  display: none !important;
}

.watch-shell {
  width: min(920px, calc(100% - 28px));
  margin: 0 auto;
  padding: max(18px, env(safe-area-inset-top)) 0 max(24px, env(safe-area-inset-bottom));
}

.is-telegram-webapp .watch-shell {
  padding-top: max(68px, calc(var(--tg-content-safe-area-inset-top, 0px) + 22px), calc(var(--tg-safe-area-inset-top, 0px) + 22px), calc(env(safe-area-inset-top, 0px) + 22px));
}

.watch-header,
.watch-footer,
.watch-card__heading,
.ad-gate__footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.watch-header {
  min-height: 52px;
  transform: translateY(7px);
}

.watch-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-pixel);
  font-size: .92rem;
  font-weight: 700;
  letter-spacing: .12em;
}

.watch-brand__logo,
.watch-brand__mark {
  display: block;
  width: 36px;
  height: 36px;
  object-fit: contain;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
  flex-shrink: 0;
  border: none;
  box-shadow: none;
}

.watch-header__actions {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.watch-header__vip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 12px;
  background: rgba(255, 215, 0, 0.15);
  border: 1px solid rgba(255, 215, 0, 0.45);
  border-radius: 4px;
  color: #ffd700;
  font-family: var(--font-pixel);
  font-size: .75rem;
  font-weight: 700;
  letter-spacing: .04em;
  box-shadow: 2px 2px 0px #000000;
  animation: vipPulse 3s infinite ease-in-out;
}

.watch-header__vip-icon {
  font-size: .82rem;
}

.watch-card__vip-pill {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  margin-left: 6px;
  padding: 2px 7px;
  background: rgba(255, 215, 0, 0.16);
  border: 1px solid rgba(255, 215, 0, 0.38);
  border-radius: 4px;
  color: #ffd700;
  font-family: var(--font-pixel);
  font-size: .68rem;
  font-weight: 700;
  vertical-align: middle;
  text-transform: none;
  letter-spacing: normal;
}

@keyframes vipPulse {
  0%, 100% {
    box-shadow: 0 0 8px rgba(255, 215, 0, 0.2);
    border-color: rgba(255, 215, 0, 0.4);
  }
  50% {
    box-shadow: 0 0 16px rgba(255, 215, 0, 0.45);
    border-color: rgba(255, 215, 0, 0.7);
  }
}

.watch-header__label,
.watch-card__id {
  font-family: var(--font-pixel);
  color: var(--watch-muted);
  font-size: .74rem;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.watch-card {
  margin-top: clamp(24px, 7vw, 68px);
}

.watch-card__heading {
  align-items: flex-end;
  gap: 20px;
  margin-bottom: 18px;
}

.watch-card__kicker {
  margin: 0 0 6px;
  color: var(--watch-accent);
  font-family: var(--font-pixel);
  font-size: .74rem;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
}

.watch-card h1 {
  font-family: var(--font-pixel);
  margin: 0;
  font-size: clamp(2rem, 7vw, 3.8rem);
  letter-spacing: 0.02em;
  line-height: 1.05;
  text-shadow: 2px 2px 0px #000000;
}

.player-frame {
  position: relative;
  aspect-ratio: 16 / 9;
  min-height: 0;
  overflow: hidden;
  border: var(--pixel-border);
  border-radius: 6px;
  background: #070813;
  box-shadow: 4px 4px 0px #000000, 0 0 40px rgba(112, 103, 255, 0.25);
}

.ad-gate,
.player-placeholder,
.player {
  position: absolute;
  inset: 0;
  overflow: hidden;
  background: #03040c;
}




.player video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  transition: opacity .2s ease;
}

.player.is-loading:not(.is-ready) video {
  opacity: 0;
}

.player.is-ready.is-loading video {
  opacity: .85;
}

.player-loading {
  position: absolute;
  z-index: 6;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 8px;
  padding: 24px;
  background: #050506;
  color: var(--watch-muted);
  text-align: center;
}

.player.is-ready .player-loading {
  z-index: 4;
  inset: auto;
  top: 50%;
  left: 50%;
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr);
  width: min(260px, calc(100% - 24px));
  gap: 2px 9px;
  padding: 10px 12px;
  border: 1px solid rgba(255, 255, 255, .18);
  border-radius: 10px;
  background: rgba(5, 5, 6, .82);
  text-align: left;
  pointer-events: none;
  transform: translate(-50%, -50%);
}

.player.is-ready .player-loading__spinner {
  grid-row: span 2;
  width: 22px;
  height: 22px;
  margin: 0;
}

.player.is-ready .player-loading strong {
  font-size: .8rem;
}

.player.is-ready .player-loading [data-video-loading-message] {
  font-size: .68rem;
  line-height: 1.25;
}

.player-loading strong {
  color: var(--watch-text);
}

.player-loading__spinner {
  width: 38px;
  height: 38px;
  margin-bottom: 5px;
  border: 3px solid rgba(255, 255, 255, .15);
  border-top-color: var(--watch-accent);
  border-radius: 50%;
  animation: player-loading-spin .8s linear infinite;
}

.player-action-feedback,
.player-seek-feedback {
  position: absolute;
  z-index: 4;
  top: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  opacity: 0;
  background: rgba(8, 8, 10, .66);
  color: #fff;
  box-shadow: 0 12px 36px rgba(0, 0, 0, .28), inset 0 0 0 1px rgba(255, 255, 255, .12);
  backdrop-filter: blur(12px);
  transform: translateY(-50%) scale(.72);
}

.player-action-feedback {
  left: 50%;
  width: clamp(68px, 12vw, 88px);
  aspect-ratio: 1;
  border-radius: 50%;
  transform: translate(-50%, -50%) scale(.72);
}

.player-action-feedback svg {
  display: none;
  width: 52%;
  height: 52%;
  fill: currentColor;
  filter: drop-shadow(0 2px 8px rgba(0, 0, 0, .25));
}

.player-action-feedback.is-play .player-action-feedback__play,
.player-action-feedback.is-pause .player-action-feedback__pause { display: block; }

.player-action-feedback.is-visible {
  animation: player-action-pop .62s cubic-bezier(.2, .75, .25, 1) both;
}

.player-seek-feedback {
  gap: 3px;
  min-width: 92px;
  padding: 13px 16px;
  border-radius: 999px;
  font-weight: 850;
}

.player-seek-feedback svg {
  width: 27px;
  height: 27px;
  margin-right: 1px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.player-seek-feedback span { font-size: 1rem; }
.player-seek-feedback small { align-self: flex-end; margin-bottom: 3px; font-size: .58rem; opacity: .72; }
.player-seek-feedback.is-forward { flex-direction: row-reverse; }
.player-seek-feedback.is-forward svg { transform: scaleX(-1); }

.player-seek-feedback.is-visible {
  animation: player-seek-pop .62s cubic-bezier(.2, .75, .25, 1) both;
}

.player-seek-feedback.is-back { left: 12%; }
.player-seek-feedback.is-forward { right: 12%; }

@keyframes player-action-pop {
  0% { opacity: 0; transform: translate(-50%, -50%) scale(.68); }
  28% { opacity: 1; transform: translate(-50%, -50%) scale(1.06); }
  48% { transform: translate(-50%, -50%) scale(1); }
  100% { opacity: 0; transform: translate(-50%, -56%) scale(.92); }
}

@keyframes player-seek-pop {
  0% { opacity: 0; transform: translateY(-50%) scale(.72); }
  28% { opacity: 1; transform: translateY(-50%) scale(1.05); }
  48% { transform: translateY(-50%) scale(1); }
  100% { opacity: 0; transform: translateY(-56%) scale(.94); }
}

@media (prefers-reduced-motion: reduce) {
  .player-action-feedback.is-visible,
  .player-seek-feedback.is-visible { animation-duration: .01ms; }
}

.player__error {
  position: absolute;
  z-index: 6;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  display: flex;
  flex-direction: column;
  width: min(380px, calc(100% - 32px));
  max-width: 100%;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin: 0;
  padding: 18px 22px;
  border: 1px solid rgba(120, 116, 255, 0.38);
  border-radius: 16px;
  background: rgba(7, 9, 27, 0.96);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  box-shadow: 0 14px 40px rgba(0, 0, 0, 0.55);
  color: #d9dcff;
  font-size: .84rem;
  line-height: 1.45;
  text-align: center;
}

.player__error[hidden],
.player__error-action[hidden] {
  display: none;
}

.player__error-text {
  min-width: 0;
  display: block;
}

.player__error-action {
  flex-shrink: 0;
  min-height: 36px;
  border: 1px solid rgba(164, 159, 255, 0.42);
  border-radius: 10px;
  padding: 0 20px;
  background: linear-gradient(145deg, #726cf0, #4659ca);
  color: #fff;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 5px 16px rgba(59, 63, 172, 0.32);
}

.player__error-action:active {
  transform: scale(0.97);
}

@media (max-width: 520px) {
  .player__error {
    width: calc(100% - 24px);
    padding: 16px 18px;
    gap: 10px;
    font-size: .82rem;
  }
}

.player-controls {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  pointer-events: none;
  z-index: 5;
  transition: opacity .25s cubic-bezier(0.4, 0, 0.2, 1), visibility .25s ease;
}

.player:not(.is-ready) .player-controls {
  visibility: hidden;
  opacity: 0;
}

.player.is-ready .player-controls {
  visibility: hidden;
  opacity: 0;
}

.player.is-ready.is-controls-visible .player-controls {
  visibility: visible;
  opacity: 1;
}

.player.is-ad-active .player-controls {
  display: none !important;
}

.player.is-loading .player-controls__play,
.player.is-loading .player-controls__slider-wrap,
.player.is-loading .player-controls__time {
  visibility: hidden !important;
  opacity: 0 !important;
  pointer-events: none !important;
  transition: opacity .15s ease, visibility .15s ease;
}

.player-controls__scrim {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to top,
    rgba(0, 0, 0, 0.94) 0%,
    rgba(0, 0, 0, 0.6) 30%,
    rgba(0, 0, 0, 0.18) 60%,
    transparent 100%
  );
  pointer-events: none;
}

.player-controls__top {
  position: absolute;
  top: 8px;
  left: 10px;
  right: 10px;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  pointer-events: none;
  transform: translateY(0);
  transition: transform .25s cubic-bezier(0.4, 0, 0.2, 1), opacity .25s ease;
}

.player-controls__top > * {
  pointer-events: auto;
}

.player.is-ready:not(.is-controls-visible) .player-controls__top {
  transform: translateY(-8px);
  opacity: 0;
  pointer-events: none;
}

.player-action-btn--download {
  margin-left: auto;
  flex-shrink: 0;
  white-space: nowrap;
}

.player-action-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 11px;
  background: rgba(14, 16, 24, 0.72);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 999px;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  color: #ffffff;
  font-size: 0.68rem;
  font-weight: 600;
  line-height: 1;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.4);
  transition: border-color 0.15s ease, background 0.15s ease, transform 0.1s ease;
}

.player-action-btn:hover {
  background: rgba(26, 28, 38, 0.9);
  border-color: rgba(255, 255, 255, 0.28);
}

.player-action-btn:active {
  transform: scale(0.95);
}

.player-action-btn svg {
  stroke: var(--watch-accent, #7067ff);
}

.player-controls__content {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 10px 12px 12px;
  pointer-events: none;
  transform: translateY(0);
  transition: transform .25s cubic-bezier(0.4, 0, 0.2, 1);
}

.player.is-ready:not(.is-controls-visible) .player-controls__content {
  transform: translateY(14px);
}

.player-controls__settings {
  display: flex;
  flex-wrap: nowrap;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-x;
  overscroll-behavior-x: contain;
  justify-content: safe center;
  align-items: center;
  gap: 6px;
  pointer-events: auto;
  padding: 2px 2px 4px 2px;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.player-controls__settings::-webkit-scrollbar {
  display: none !important;
  width: 0 !important;
  height: 0 !important;
}

.series-picker {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
  max-width: calc(100% - 85px);
  overflow-x: auto;
  scrollbar-width: none;
}

.series-picker::-webkit-scrollbar {
  display: none;
}

.series-picker[hidden] {
  display: none !important;
}

.control-chip {
  position: relative;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  max-width: 100%;
  overflow: hidden;
  background: rgba(22, 22, 28, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 999px;
  padding: 4px 25px 4px 10px;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  color: var(--watch-muted);
  font-size: 0.72rem;
  font-weight: 600;
  transition: border-color 0.15s ease, background 0.15s ease;
  cursor: pointer;
  touch-action: pan-x;
  user-select: none;
  -webkit-user-select: none;
}

.control-chip:focus-within,
.control-chip:hover {
  border-color: rgba(255, 255, 255, 0.28);
  background: rgba(32, 32, 40, 0.92);
}

.control-chip.is-switching {
  opacity: 0.85;
  border-color: #38bdf8 !important;
  animation: chip-switching-pulse 1.2s infinite ease-in-out;
}

@keyframes chip-switching-pulse {
  0%, 100% {
    border-color: rgba(56, 189, 248, 0.4);
  }
  50% {
    border-color: rgba(56, 189, 248, 1);
  }
}

.control-chip__title {
  display: inline-flex;
  flex-shrink: 0;
  align-items: center;
  gap: 3px;
  color: rgba(255, 255, 255, 0.45);
  font-size: 0.63rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  white-space: nowrap;
}

.control-chip__title svg {
  opacity: 0.7;
  flex-shrink: 0;
}

.control-chip__select-wrap {
  display: inline-flex;
  flex: 0 1 auto;
  min-width: 0;
  align-items: center;
}

.control-chip__value {
  display: block;
  min-width: 0;
  max-width: 200px;
  overflow: hidden;
  color: var(--watch-text);
  font-size: 0.75rem;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.control-chip select {
  position: absolute;
  z-index: 2;
  inset: 0;
  appearance: none;
  -webkit-appearance: none;
  width: 100%;
  height: 100%;
  min-width: 100%;
  max-width: none;
  margin: 0;
  padding: 0;
  background: transparent;
  border: 0;
  opacity: 0;
  cursor: pointer;
  outline: none;
  touch-action: pan-x;
}

.control-chip select option {
  background: #101126;
  color: #f1f3ff;
}

.control-chip__select-wrap::after {
  content: "";
  position: absolute;
  right: 11px;
  width: 5px;
  height: 5px;
  border-right: 1.5px solid rgba(255, 255, 255, 0.6);
  border-bottom: 1.5px solid rgba(255, 255, 255, 0.6);
  transform: rotate(45deg) translateY(-2px);
  pointer-events: none;
}

.control-chip--translation {
  max-width: 175px;
}

.control-chip--translation .control-chip__value {
  max-width: 110px;
}

.control-chip--source {
  max-width: 140px;
}

.control-chip--source .control-chip__value {
  max-width: 85px;
}

.control-chip--quality {
  max-width: 145px;
}

.control-chip--quality .control-chip__value {
  max-width: 85px;
}

.player-controls__timeline {
  display: flex;
  align-items: center;
  gap: 10px;
  pointer-events: auto;
  width: 100%;
}

.player-controls__play {
  flex-shrink: 0;
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 50%;
  background: linear-gradient(145deg, #8178ff, #5365e8);
  color: var(--watch-button-text);
  cursor: pointer;
  box-shadow: 0 7px 22px rgba(77, 81, 210, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.2);
  transition: transform 0.15s ease, filter 0.15s ease, box-shadow 0.15s ease;
}

.player-controls__play:hover {
  filter: brightness(1.1);
  box-shadow: 0 9px 26px rgba(77, 81, 210, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.24);
}

.player-controls__play:active {
  transform: scale(0.92);
}

.player-controls__play-icon {
  display: grid;
  width: 18px;
  height: 18px;
  place-items: center;
}

.player-controls__play-icon svg {
  grid-area: 1 / 1;
  width: 100%;
  height: 100%;
  fill: currentColor;
}

.player-controls__pause-symbol,
.player-controls__play.is-playing .player-controls__play-symbol {
  display: none;
}

.player-controls__play.is-playing .player-controls__pause-symbol {
  display: block;
}

.player-controls__time {
  flex-shrink: 0;
  min-width: 32px;
  color: rgba(255, 255, 255, 0.82);
  font-size: 0.72rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  text-align: center;
}

.player-controls__slider-wrap {
  flex: 1;
  display: flex;
  align-items: center;
  min-width: 60px;
  height: 24px;
}

.player-controls input[type='range'] {
  width: 100%;
  height: 4px;
  margin: 0;
  border-radius: 999px;
  appearance: none;
  -webkit-appearance: none;
  background: linear-gradient(
    to right,
    var(--watch-accent) 0 var(--seek-progress, 0%),
    rgba(255, 255, 255, 0.48) var(--seek-progress, 0%) var(--buffered-progress, 0%),
    rgba(255, 255, 255, 0.18) var(--buffered-progress, 0%) 100%
  );
  cursor: pointer;
  transition: height 0.15s ease;
}

.player-controls__slider-wrap:hover input[type='range'] {
  height: 6px;
}

.player-controls input[type='range']::-webkit-slider-thumb {
  width: 13px;
  height: 13px;
  border: 2px solid white;
  border-radius: 50%;
  appearance: none;
  -webkit-appearance: none;
  background: var(--watch-accent);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.45);
}

.player-controls__fullscreen {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 34px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 999px;
  padding: 0 10px;
  background: rgba(255, 255, 255, 0.08);
  color: var(--watch-text);
  font-size: 0.72rem;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  transition: background 0.15s ease, border-color 0.15s ease;
}

.player-controls__fullscreen:hover {
  background: rgba(255, 255, 255, 0.16);
  border-color: rgba(255, 255, 255, 0.3);
}

.player-controls__fullscreen svg {
  width: 15px;
  height: 15px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.fullscreen-icon--collapse { display: none; }
.player-frame.is-fullscreen .fullscreen-icon--expand { display: none; }
.player-frame.is-fullscreen .fullscreen-icon--collapse { display: block; }

/* Webmaster / Embed controls: Volume, Speed, Next Episode, PiP */
.player-controls__next-ep,
.player-controls__volume,
.player-controls__pip,
.player-controls__speed {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  color: var(--watch-text);
  font-size: 0.72rem;
  font-weight: 700;
  cursor: pointer;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  transition: all 0.15s ease;
  padding: 0;
}

.player-controls__next-ep:hover,
.player-controls__volume:hover,
.player-controls__pip:hover,
.player-controls__speed:hover {
  background: rgba(255, 255, 255, 0.18);
  border-color: rgba(255, 255, 255, 0.35);
  transform: translateY(-1px);
}

.player-volume-wrap {
  display: flex;
  align-items: center;
  position: relative;
}

.player-volume-slider-box {
  width: 0;
  opacity: 0;
  overflow: hidden;
  transition: width 0.2s ease, opacity 0.2s ease, margin 0.2s ease;
  margin-left: 0;
  display: flex;
  align-items: center;
}

.player-volume-wrap:hover .player-volume-slider-box,
.player-volume-wrap:focus-within .player-volume-slider-box {
  width: 60px;
  opacity: 1;
  margin-left: 6px;
}

.player-volume-slider-box input[type='range'] {
  width: 100%;
  height: 4px;
}

.player-next-overlay {
  position: absolute;
  bottom: 80px;
  right: 20px;
  z-index: 60;
  background: rgba(15, 23, 42, 0.9);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 12px;
  padding: 14px 18px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.6);
  animation: fadeInNext 0.3s ease;
}

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

.player-next-box strong {
  display: block;
  font-size: 0.9rem;
  color: #f1f5f9;
  margin-bottom: 10px;
}

.player-next-actions {
  display: flex;
  gap: 8px;
}

.player-next-btn {
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
  border: none;
  transition: all 0.15s ease;
}

.player-next-btn--play {
  background: #38bdf8;
  color: #000;
}
.player-next-btn--play:hover {
  background: #7dd3fc;
}

.player-next-btn--cancel {
  background: rgba(255, 255, 255, 0.1);
  color: #cbd5e1;
  border: 1px solid rgba(255, 255, 255, 0.15);
}
.player-next-btn--cancel:hover {
  background: rgba(255, 255, 255, 0.2);
}

.movie-hub {
  position: relative;
  margin: 12px 0 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  width: 100%;
  padding: 14px 16px;
  overflow: hidden;
  border: 1px solid rgba(117, 108, 255, 0.2);
  border-radius: 16px;
  background:
    radial-gradient(circle at 8% 0, rgba(83, 101, 232, 0.2), transparent 42%),
    linear-gradient(135deg, rgba(13, 15, 31, 0.96), rgba(7, 8, 17, 0.98));
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.28), 0 0 20px rgba(83, 101, 232, 0.08);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

.movie-hub__badges {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 7px;
}

.hub-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 0.72rem;
  font-weight: 600;
  padding: 6px 11px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.04);
  color: #c8cbff;
  border: 1px solid rgba(117, 108, 255, 0.18);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.18);
  transition: all 0.2s ease;
}

.hub-pill:hover {
  background: rgba(117, 108, 255, 0.12);
  border-color: rgba(129, 120, 255, 0.35);
  color: #ffffff;
}

.hub-pill--accent {
  background: rgba(91, 91, 221, 0.18);
  color: #ffffff;
  border-color: rgba(129, 120, 255, 0.4);
  font-weight: 700;
  box-shadow: 0 0 14px rgba(117, 108, 255, 0.25);
}

.hub-pill--voice {
  max-width: 180px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  background: rgba(117, 108, 255, 0.1);
  border-color: rgba(129, 120, 255, 0.25);
  color: #e4e2ff;
}

.movie-hub__status {
  position: relative;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.68rem;
  color: #67b7ff;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 6px 12px;
  border-radius: 10px;
  background: rgba(46, 125, 255, 0.1);
  border: 1px solid rgba(103, 183, 255, 0.25);
  box-shadow: 0 0 12px rgba(103, 183, 255, 0.15);
}

.pulse-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #67b7ff;
  box-shadow: 0 0 8px #67b7ff, 0 0 16px rgba(103, 183, 255, 0.7);
  animation: pulseDot 2s infinite ease-in-out;
}

@keyframes pulseDot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.4; transform: scale(0.8); }
}

.movie-summary__description {
  max-width: 72ch;
  margin: 0;
  color: var(--watch-muted);
  font-size: .85rem;
  line-height: 1.5;
}

.player-guide {
  position: relative;
  display: grid;
  grid-template-columns: minmax(180px, 0.8fr) minmax(0, 2.2fr);
  align-items: center;
  gap: 16px;
  width: 100%;
  margin-top: 12px;
  padding: 14px 16px;
  overflow: hidden;
  border: 1px solid rgba(117, 108, 255, 0.2);
  border-radius: 16px;
  background:
    radial-gradient(circle at 8% 0, rgba(83, 101, 232, 0.2), transparent 42%),
    linear-gradient(135deg, rgba(13, 15, 31, 0.96), rgba(7, 8, 17, 0.98));
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.28);
}

.player-guide__heading {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.player-guide__heading span {
  color: #777dff;
  font-size: 0.58rem;
  font-weight: 750;
  letter-spacing: 0.11em;
  text-transform: uppercase;
}

.player-guide__heading strong {
  max-width: 18ch;
  color: #f4f5ff;
  font-size: 0.9rem;
  line-height: 1.25;
}

.player-guide__items {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.player-guide__item {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 8px;
  padding: 8px 9px;
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 11px;
  background: rgba(255, 255, 255, 0.035);
}

.player-guide__icon {
  display: grid;
  width: 27px;
  height: 27px;
  flex: 0 0 27px;
  place-items: center;
  border: 1px solid rgba(129, 120, 255, 0.4);
  border-radius: 4px;
  background: rgba(91, 91, 221, 0.2);
  color: #c4b5fd;
  box-shadow: 1px 1px 0 #000;
}

.player-guide__icon svg {
  width: 15px;
  height: 15px;
  fill: currentColor;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
  shape-rendering: crispEdges;
  filter: drop-shadow(1px 1px 0px #000);
}

.player-guide__icon text {
  font-size: 6px;
  font-weight: 800;
  stroke: none;
  text-anchor: middle;
}

.player-guide__item > span:last-child {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 2px;
}

.player-guide__item strong {
  overflow: hidden;
  color: #ffffff;
  font-size: 0.66rem;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.player-guide__item small {
  overflow: hidden;
  color: #c4b5fd;
  font-size: 0.57rem;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

body.has-fullscreen-player {
  overflow: hidden;
}

.player-frame.is-fullscreen {
  position: fixed;
  z-index: 10000;
  inset: 0;
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  min-height: 0;
  border: 0;
  border-radius: 0;
  aspect-ratio: auto;
  background: #000;
}

.player-frame.is-fullscreen .player-controls__top,
.player-frame:fullscreen .player-controls__top,
.player-frame:-webkit-full-screen .player-controls__top {
  top: max(74px, calc(env(safe-area-inset-top, 0px) + 36px));
  left: max(clamp(28px, 5vw, 64px), calc(env(safe-area-inset-left, 0px) + 16px));
  right: max(clamp(28px, 5vw, 64px), calc(env(safe-area-inset-right, 0px) + 16px));
}


.player-frame:fullscreen,
.player-frame:-webkit-full-screen {
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  border: 0;
  border-radius: 0;
  background: #000;
}

.player-frame.is-fullscreen .player video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.player-frame.is-fullscreen .player-controls__content,
.player-frame:fullscreen .player-controls__content,
.player-frame:-webkit-full-screen .player-controls__content {
  padding: 16px max(24px, env(safe-area-inset-right)) max(20px, env(safe-area-inset-bottom)) max(24px, env(safe-area-inset-left));
  gap: 10px;
}

.player-frame.is-fullscreen .control-chip,
.player-frame:fullscreen .control-chip,
.player-frame:-webkit-full-screen .control-chip {
  min-height: 32px;
  max-width: none;
  padding: 4px 28px 4px 12px;
  gap: 6px;
  border-radius: 999px;
  background: rgba(18, 20, 32, 0.78);
  border: 1px solid rgba(255, 255, 255, 0.16);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.35);
  transition: background 0.15s ease, border-color 0.15s ease;
}

.player-frame.is-fullscreen .control-chip:hover,
.player-frame:fullscreen .control-chip:hover,
.player-frame:-webkit-full-screen .control-chip:hover,
.player-frame.is-fullscreen .control-chip:focus-within,
.player-frame:fullscreen .control-chip:focus-within,
.player-frame:-webkit-full-screen .control-chip:focus-within {
  background: rgba(30, 34, 52, 0.92);
  border-color: rgba(255, 255, 255, 0.32);
}

.player-frame.is-fullscreen .control-chip__value,
.player-frame:fullscreen .control-chip__value,
.player-frame:-webkit-full-screen .control-chip__value {
  font-size: 0.78rem;
  font-weight: 600;
  color: #f1f3ff;
}

.player-frame.is-fullscreen .control-chip__title,
.player-frame:fullscreen .control-chip__title,
.player-frame:-webkit-full-screen .control-chip__title {
  font-size: 0.65rem;
  letter-spacing: 0.04em;
  color: rgba(255, 255, 255, 0.55);
}

.player-frame.is-fullscreen .control-chip__select-wrap::after,
.player-frame:fullscreen .control-chip__select-wrap::after,
.player-frame:-webkit-full-screen .control-chip__select-wrap::after {
  right: 11px;
}

.player-frame.is-fullscreen .control-chip--source,
.player-frame:fullscreen .control-chip--source,
.player-frame:-webkit-full-screen .control-chip--source {
  max-width: 220px;
}

.player-frame.is-fullscreen .control-chip--source .control-chip__value,
.player-frame:fullscreen .control-chip--source .control-chip__value,
.player-frame:-webkit-full-screen .control-chip--source .control-chip__value {
  max-width: 150px;
}

.player-frame.is-fullscreen .control-chip--translation,
.player-frame:fullscreen .control-chip--translation,
.player-frame:-webkit-full-screen .control-chip--translation {
  max-width: 340px;
}

.player-frame.is-fullscreen .control-chip--translation .control-chip__value,
.player-frame:fullscreen .control-chip--translation .control-chip__value,
.player-frame:-webkit-full-screen .control-chip--translation .control-chip__value {
  max-width: 250px;
}

.player-frame.is-fullscreen .control-chip--quality,
.player-frame:fullscreen .control-chip--quality,
.player-frame:-webkit-full-screen .control-chip--quality {
  max-width: 180px;
}

.player-frame.is-fullscreen .control-chip--quality .control-chip__value,
.player-frame:fullscreen .control-chip--quality .control-chip__value,
.player-frame:-webkit-full-screen .control-chip--quality .control-chip__value {
  max-width: 110px;
}

.player-frame.is-fullscreen .player-action-btn,
.player-frame:fullscreen .player-action-btn,
.player-frame:-webkit-full-screen .player-action-btn {
  min-height: 32px;
  padding: 5px 14px;
  font-size: 0.74rem;
  border-radius: 999px;
}

.player-frame.is-fullscreen .player-controls__play,
.player-frame:fullscreen .player-controls__play,
.player-frame:-webkit-full-screen .player-controls__play {
  width: 36px;
  height: 36px;
  font-size: 0.85rem;
}

.player-frame.is-fullscreen .player-controls__fullscreen,
.player-frame:fullscreen .player-controls__fullscreen,
.player-frame:-webkit-full-screen .player-controls__fullscreen {
  height: 34px;
  padding: 0 14px;
  font-size: 0.76rem;
  border-radius: 999px;
}

.player-frame.is-fullscreen .player-controls__fullscreen svg,
.player-frame:fullscreen .player-controls__fullscreen svg,
.player-frame:-webkit-full-screen .player-controls__fullscreen svg {
  width: 16px;
  height: 16px;
}

@media (orientation: portrait) {
  .player-frame.is-fullscreen .player-controls__content,
  .player-frame:fullscreen .player-controls__content,
  .player-frame:-webkit-full-screen .player-controls__content {
    padding: 8px 12px max(24px, calc(50vh - 28.125vw + 10px));
    padding: 8px 12px max(24px, calc(50dvh - 28.125vw + 10px));
    gap: 6px;
  }

  .player-frame.is-fullscreen .player-controls__top,
  .player-frame:fullscreen .player-controls__top,
  .player-frame:-webkit-full-screen .player-controls__top {
    top: max(20px, calc(50vh - 28.125vw + 8px));
    top: max(20px, calc(50dvh - 28.125vw + 8px));
    left: 12px;
    right: 12px;
    gap: 6px;
  }

  .player-frame.is-fullscreen .control-chip,
  .player-frame:fullscreen .control-chip,
  .player-frame:-webkit-full-screen .control-chip {
    min-height: 28px;
    padding: 3px 20px 3px 8px;
    gap: 4px;
  }

  .player-frame.is-fullscreen .control-chip__value,
  .player-frame:fullscreen .control-chip__value,
  .player-frame:-webkit-full-screen .control-chip__value {
    font-size: 0.7rem;
  }

  .player-frame.is-fullscreen .control-chip__title,
  .player-frame:fullscreen .control-chip__title,
  .player-frame:-webkit-full-screen .control-chip__title {
    font-size: 0.58rem;
  }

  .player-frame.is-fullscreen .control-chip__select-wrap::after,
  .player-frame:fullscreen .control-chip__select-wrap::after,
  .player-frame:-webkit-full-screen .control-chip__select-wrap::after {
    right: 7px;
    font-size: 0.6rem;
  }

  .player-frame.is-fullscreen .player-action-btn,
  .player-frame:fullscreen .player-action-btn,
  .player-frame:-webkit-full-screen .player-action-btn {
    min-height: 28px;
    padding: 3px 10px;
    font-size: 0.7rem;
  }

  .player-frame.is-fullscreen .player-controls__play,
  .player-frame:fullscreen .player-controls__play,
  .player-frame:-webkit-full-screen .player-controls__play {
    width: 30px;
    height: 30px;
    font-size: 0.75rem;
  }

  .player-frame.is-fullscreen .player-controls__play-icon,
  .player-frame:fullscreen .player-controls__play-icon,
  .player-frame:-webkit-full-screen .player-controls__play-icon {
    width: 14px;
    height: 14px;
  }

  .player-frame.is-fullscreen .player-controls__fullscreen,
  .player-frame:fullscreen .player-controls__fullscreen,
  .player-frame:-webkit-full-screen .player-controls__fullscreen {
    height: 28px;
    padding: 0 8px;
    font-size: 0.7rem;
  }

  .player-frame.is-fullscreen .player-controls__fullscreen span[data-fullscreen-label],
  .player-frame:fullscreen .player-controls__fullscreen span[data-fullscreen-label],
  .player-frame:-webkit-full-screen .player-controls__fullscreen span[data-fullscreen-label] {
    display: none;
  }

  .player-frame.is-fullscreen .player-controls__time,
  .player-frame:fullscreen .player-controls__time,
  .player-frame:-webkit-full-screen .player-controls__time {
    font-size: 0.68rem;
    min-width: 26px;
  }
}

@media (orientation: landscape) and (min-width: 700px) {
  .player-frame.is-fullscreen .control-chip,
  .player-frame:fullscreen .control-chip,
  .player-frame:-webkit-full-screen .control-chip {
    min-height: 32px;
    padding: 4px 28px 4px 12px;
    gap: 7px;
  }

  .player-frame.is-fullscreen .control-chip--source,
  .player-frame:fullscreen .control-chip--source,
  .player-frame:-webkit-full-screen .control-chip--source {
    min-width: 130px;
    max-width: 240px;
  }
  .player-frame.is-fullscreen .control-chip--source .control-chip__value,
  .player-frame:fullscreen .control-chip--source .control-chip__value,
  .player-frame:-webkit-full-screen .control-chip--source .control-chip__value {
    max-width: 160px;
  }

  .player-frame.is-fullscreen .control-chip--translation,
  .player-frame:fullscreen .control-chip--translation,
  .player-frame:-webkit-full-screen .control-chip--translation {
    min-width: 180px;
    max-width: 380px;
  }
  .player-frame.is-fullscreen .control-chip--translation .control-chip__value,
  .player-frame:fullscreen .control-chip--translation .control-chip__value,
  .player-frame:-webkit-full-screen .control-chip--translation .control-chip__value {
    max-width: 290px;
  }

  .player-frame.is-fullscreen .control-chip--quality,
  .player-frame:fullscreen .control-chip--quality,
  .player-frame:-webkit-full-screen .control-chip--quality {
    min-width: 120px;
    max-width: 200px;
  }
  .player-frame.is-fullscreen .control-chip--quality .control-chip__value,
  .player-frame:fullscreen .control-chip--quality .control-chip__value,
  .player-frame:-webkit-full-screen .control-chip--quality .control-chip__value {
    max-width: 130px;
  }

  .player-frame.is-fullscreen .player-action-btn,
  .player-frame:fullscreen .player-action-btn,
  .player-frame:-webkit-full-screen .player-action-btn,
  .player-frame.is-fullscreen .player-controls__fullscreen,
  .player-frame:fullscreen .player-controls__fullscreen,
  .player-frame:-webkit-full-screen .player-controls__fullscreen {
    padding-right: 16px;
    padding-left: 16px;
    height: 32px;
  }
}

.ad-gate {
  z-index: 10;
  isolation: isolate;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: clamp(22px, 5vw, 42px);
  background: #03040c;
  transition: opacity .25s ease, visibility .25s ease;
}

.ad-gate.is-complete {
  visibility: hidden;
  opacity: 0;
}

.ad-gate__label {
  position: relative;
  z-index: 2;
  align-self: flex-start;
  padding: 6px 9px;
  border-radius: 6px;
  background: rgba(12, 14, 24, .78);
  color: rgba(255, 255, 255, .8);
  font-size: .63rem;
  font-weight: 600;
  letter-spacing: .06em;
  text-transform: uppercase;
}

.ad-gate__content strong {
  display: block;
  font-size: clamp(1.6rem, 5vw, 3.2rem);
  letter-spacing: -.04em;
}

.ad-gate__content,
.ad-gate__footer {
  position: relative;
  z-index: 2;
}

.ad-gate.is-video .ad-gate__content,
.ad-gate.is-banner .ad-gate__content {
  display: none;
}

.ad-gate__video,
.ad-gate__banner {
  position: absolute;
  z-index: 1;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  cursor: pointer;
}

.ad-gate__banner {
  width: min(300px, 75%);
  height: min(250px, 70%);
  inset: 50% auto auto 50%;
  transform: translate(-50%, -50%);
}

.ad-gate__footer,
.ad-gate__skip {
  position: absolute;
  z-index: 3;
  right: 12px;
  bottom: 16px;
  min-height: 34px;
  border: 1px solid rgba(255, 255, 255, .26);
  border-radius: 7px;
  background: rgba(10, 12, 20, .84);
  color: #fff;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.ad-gate__skip {
  padding: 0 12px;
  font: inherit;
  font-size: .75rem;
  font-weight: 600;
  cursor: pointer;
}

.ad-gate__skip:hover {
  background: rgba(31, 34, 52, .94);
}

.ad-gate.is-skippable .ad-gate__footer {
  display: none;
}

.ad-gate__content p,
.player-placeholder p,
.watch-card__notice {
  color: var(--watch-muted);
  line-height: 1.55;
}

.ad-gate__content p {
  margin: 8px 0 0;
}

.ad-gate__footer {
  justify-content: center;
  gap: 5px;
  padding: 0 11px;
  font-size: .75rem;
  white-space: nowrap;
}

.ad-gate__timer {
  color: #fff;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.ad-gate__timer::after {
  content: ' с';
}

.ad-gate__progress {
  position: absolute;
  z-index: 3;
  right: 12px;
  bottom: 8px;
  left: 12px;
  height: 3px;
  border-radius: 3px;
  overflow: hidden;
  background: color-mix(in srgb, var(--watch-text) 10%, transparent);
}

.ad-gate__progress i {
  display: block;
  width: 0;
  height: 100%;
  background: var(--watch-accent);
  transition: width 1s linear;
}

.ad-gate {
  cursor: pointer;
  user-select: none;
}

.player-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: clamp(10px, 3vw, 30px);
  text-align: center;
}

.download-popover {
  position: absolute;
  top: 38px;
  right: 10px;
  width: min(240px, calc(100% - 20px));
  background: rgba(14, 16, 24, 0.96);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 12px;
  padding: 8px 10px;
  box-shadow: 0 14px 32px rgba(0, 0, 0, 0.65);
  z-index: 60;
  pointer-events: auto;
  max-height: calc(100% - 46px);
  overflow-y: auto;
  overscroll-behavior: contain;
  animation: dlPopoverIn 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes dlPopoverIn {
  from {
    opacity: 0;
    transform: translateY(-8px) scale(0.96);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.download-popover[hidden] {
  display: none !important;
}

.player-frame.is-fullscreen .download-popover,
.player-frame:fullscreen .download-popover,
.player-frame:-webkit-full-screen .download-popover {
  top: calc(max(74px, calc(env(safe-area-inset-top, 0px) + 36px)) + 38px);
  right: max(16px, calc(env(safe-area-inset-right, 0px) + 16px));
  width: min(300px, calc(100% - 32px));
  padding: 12px 14px;
  border-radius: 14px;
  background: rgba(14, 16, 24, 0.98);
  box-shadow: 0 20px 48px rgba(0, 0, 0, 0.85);
  max-height: calc(100% - max(120px, calc(env(safe-area-inset-top, 0px) + 80px)));
}

.player-frame.is-fullscreen .download-popover__title,
.player-frame:fullscreen .download-popover__title,
.player-frame:-webkit-full-screen .download-popover__title {
  font-size: 0.88rem;
}

.player-frame.is-fullscreen .download-popover__row,
.player-frame:fullscreen .download-popover__row,
.player-frame:-webkit-full-screen .download-popover__row {
  font-size: 0.78rem;
  padding: 5px 0;
}

.player-frame.is-fullscreen .download-popover__action,
.player-frame:fullscreen .download-popover__action,
.player-frame:-webkit-full-screen .download-popover__action {
  padding: 8px 14px;
  font-size: 0.78rem;
  margin-top: 10px;
}

.download-popover__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  margin-bottom: 6px;
}

.download-popover__title {
  font-size: 0.8rem;
  font-weight: 700;
  color: #ffffff;
  margin: 0;
  line-height: 1.2;
}

.download-popover__close {
  background: rgba(255, 255, 255, 0.08);
  border: none;
  color: rgba(255, 255, 255, 0.7);
  border-radius: 50%;
  width: 18px;
  height: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 10px;
  line-height: 1;
  transition: background 0.15s, color 0.15s;
  flex-shrink: 0;
}

.download-popover__close:hover {
  background: rgba(255, 255, 255, 0.2);
  color: #ffffff;
}

.download-popover__meta {
  background: rgba(0, 0, 0, 0.45);
  border-radius: 7px;
  padding: 5px 8px;
  display: flex;
  flex-direction: column;
  gap: 3px;
  margin-bottom: 7px;
  border: 1px solid rgba(255, 255, 255, 0.07);
}

.download-popover__row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.65rem;
  line-height: 1.25;
}

.download-popover__row[hidden] {
  display: none !important;
}

.download-popover__label {
  color: rgba(255, 255, 255, 0.45);
}

.download-popover__value {
  color: rgba(255, 255, 255, 0.95);
  font-weight: 600;
  text-align: right;
  max-width: 135px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.download-popover__status {
  font-size: 0.68rem;
  color: #ef4444;
  background: rgba(239, 68, 68, 0.12);
  border: 1px solid rgba(239, 68, 68, 0.25);
  border-radius: 6px;
  padding: 4px 8px;
  margin-bottom: 6px;
  line-height: 1.25;
}

.download-popover__action {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 6px 10px;
  background: var(--watch-accent, #7067ff);
  color: var(--watch-button-text, #ffffff);
  border: none;
  border-radius: 7px;
  font-size: 0.72rem;
  font-weight: 700;
  cursor: pointer;
  transition: opacity 0.15s ease, transform 0.1s ease;
}

.download-popover__action:hover {
  opacity: 0.92;
}

.download-popover__action:active {
  transform: scale(0.98);
}

.download-popover__action:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.download-popover__action svg {
  stroke: currentColor;
}

.watch-toast {
  position: absolute;
  z-index: 61;
  top: 50%;
  left: 50%;
  width: fit-content;
  max-width: min(420px, calc(100% - 24px));
  padding: 13px 17px;
  border: 1px solid color-mix(in srgb, var(--watch-text) 14%, transparent);
  border-radius: 12px;
  background: color-mix(in srgb, var(--watch-surface) 94%, transparent);
  box-shadow: 0 16px 44px rgb(0 0 0 / 35%);
  font-size: .88rem;
  font-weight: 700;
  transform: translate(-50%, -50%);
}

.player-placeholder__loader {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2px;
  width: 36px;
  height: 36px;
  flex-shrink: 0;
  margin-bottom: 18px;
}

/* Canonical SpinKit Grid by Tobias Ahlin (MIT): https://github.com/tobiasahlin/SpinKit */
.player-placeholder__loader span {
  width: 100%;
  height: 100%;
  background: rgba(248, 250, 252, 0.85);
  border-radius: 2px;
  animation: player-cube-grid 1.3s infinite ease-in-out;
}

.player-placeholder__loader span:nth-child(1) { animation-delay: .2s; }
.player-placeholder__loader span:nth-child(2) { animation-delay: .3s; }
.player-placeholder__loader span:nth-child(3) { animation-delay: .4s; }
.player-placeholder__loader span:nth-child(4) { animation-delay: .1s; }
.player-placeholder__loader span:nth-child(5) { animation-delay: .2s; }
.player-placeholder__loader span:nth-child(6) { animation-delay: .3s; }
.player-placeholder__loader span:nth-child(7) { animation-delay: 0s; }
.player-placeholder__loader span:nth-child(8) { animation-delay: .1s; }
.player-placeholder__loader span:nth-child(9) { animation-delay: .2s; }

@keyframes player-cube-grid {
  0%, 70%, 100% {
    transform: scale3D(1, 1, 1);
  }
  35% {
    transform: scale3D(0, 0, 1);
  }
}

@keyframes player-loading-spin {
  to { transform: rotate(1turn); }
}

.player-placeholder strong {
  font-size: clamp(1.25rem, 4vw, 1.8rem);
}

.player-placeholder p {
  max-width: 440px;
  margin: 9px 0 0;
  font-size: .9rem;
}

.watch-card__notice {
  margin: 16px 2px 0;
  font-size: .82rem;
}

.watch-footer {
  gap: 16px;
  margin-top: 18px;
  color: var(--watch-muted);
  font-size: .65rem;
  letter-spacing: .06em;
  text-transform: uppercase;
}

@media (max-width: 600px) {
  .watch-shell {
    width: min(100% - 20px, 560px);
    padding-top: max(68px, calc(var(--tg-content-safe-area-inset-top, 0px) + 22px), calc(var(--tg-safe-area-inset-top, 0px) + 22px), calc(env(safe-area-inset-top, 0px) + 22px));
  }

  .watch-card {
    margin-top: 28px;
  }

  .watch-card__heading {
    align-items: flex-start;
    flex-direction: column;
    gap: 9px;
  }

  .player-frame {
    aspect-ratio: 16 / 9;
    min-height: 0;
    border-radius: 18px;
  }

  .ad-gate {
    padding: 24px 21px;
  }

  .watch-footer {
    align-items: flex-start;
    flex-direction: column;
    gap: 6px;
  }
}

@media (orientation: landscape) and (max-height: 600px) {
  .watch-shell {
    width: min(calc(100% - 32px), 1100px);
    padding: max(8px, env(safe-area-inset-top)) 0 max(20px, env(safe-area-inset-bottom));
  }

  .watch-header,
  .watch-footer {
    display: none;
  }

  .watch-card {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 0;
    padding: 0;
    border: 0;
    background: transparent;
    box-shadow: none;
  }

  .player-frame:not(.is-fullscreen) {
    width: min(100%, calc(min(82vh, 520px) * 16 / 9));
    width: min(100%, calc(min(82dvh, 520px) * 16 / 9));
    aspect-ratio: 16 / 9;
    margin: 0 auto;
    border-radius: 16px;
    min-height: 0;
  }

  .player-frame:not(.is-fullscreen) .player-controls__top {
    left: clamp(28px, 5vw, 64px);
    right: clamp(28px, 5vw, 64px);
  }

  .watch-card__heading {
    margin-bottom: 0;
    align-items: flex-start;
    flex-direction: column;
    gap: 4px;
  }

  .watch-card h1 {
    font-size: clamp(1.2rem, 3vw, 1.7rem);
    line-height: 1.15;
  }

  .movie-hub {
    margin-top: 12px;
    width: 100%;
    padding: 12px 14px;
    gap: 10px;
  }

}

@media (max-width: 580px) {
  .player-guide {
    grid-template-columns: 1fr;
  }
  .player-guide__heading strong {
    max-width: none;
  }
  .player-guide__items {
    grid-template-columns: 1fr;
  }
  .player-controls__content {
    gap: 7px;
    padding: 8px 10px 10px;
  }
  .player-controls__fullscreen span[data-fullscreen-label] {
    display: none;
  }
  .player-controls__fullscreen {
    padding: 0 8px;
    height: 32px;
  }
  .player-controls__play {
    width: 32px;
    height: 32px;
    font-size: 0.75rem;
  }
  .player-controls__settings {
    gap: 4px;
  }
  .control-chip {
    padding: 2px 22px 2px 7px;
    gap: 3px;
    font-size: 0.67rem;
  }
  .control-chip__value {
    font-size: 0.68rem;
  }
  .control-chip__select-wrap::after {
    right: 9px;
  }
  .control-chip--translation .control-chip__value {
    max-width: 95px;
  }
  .control-chip--source .control-chip__value {
    max-width: 75px;
  }
  .control-chip--quality .control-chip__value {
    max-width: 75px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .player-placeholder__loader span {
    animation: none;
  }

  *, *::before, *::after {
    scroll-behavior: auto !important;
    animation-duration: .01ms !important;
    transition-duration: .01ms !important;
  }
}
.watched-panel {
  margin: 8px 0;
  padding: 8px 14px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.03);
  color: #f8fafc;
  width: fit-content;
  max-width: 100%;
}
.watched-panel [hidden] { display: none !important; }
.watched-panel__heading { display: flex; align-items: center; justify-content: flex-start; gap: 12px; }
.watched-panel__hint { font-size: 12px; color: #94a3b8; font-weight: 500; }
.watched-panel strong, .watched-panel h3 { font-size: 13px; font-weight: 600; }
.watched-panel h3 { margin: 10px 0 4px; }
.watched-panel p { margin: 3px 0 0; font-size: 11px; color: #b8b5ce; }
.watched-panel button { cursor: pointer; font: inherit; color: inherit; transition: all .18s ease; }
.watched-panel button:focus-visible { outline: 2px solid rgba(255, 255, 255, 0.4); outline-offset: 3px; }
.watched-panel button:disabled { opacity: .6; cursor: wait; }
.watched-panel button.is-completed,
.watched-panel button.is-completed:disabled {
  opacity: 1;
  cursor: default;
  pointer-events: none;
  background: rgba(16, 185, 129, 0.12) !important;
  color: #34d399 !important;
  border: 1px solid rgba(16, 185, 129, 0.28) !important;
  box-shadow: inset 0 1px 0 rgba(16, 185, 129, 0.2) !important;
  font-weight: 600;
}
.watched-panel button:hover:not(:disabled):not(.is-completed) {
  transform: translateY(-1px);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.14) 0%, rgba(255, 255, 255, 0.05) 100%);
  border-color: rgba(255, 255, 255, 0.25);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2), 0 2px 6px rgba(0, 0, 0, 0.5);
}
.watched-panel button:active:not(:disabled):not(.is-completed) {
  transform: translateY(0);
  background: rgba(255, 255, 255, 0.04);
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.3);
}
.watched-panel__primary {
  flex-shrink: 0;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 8px;
  padding: 5px 12px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: -0.01em;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.08) 0%, rgba(255, 255, 255, 0.02) 100%);
  color: #f8fafc;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.15), 0 1px 3px rgba(0, 0, 0, 0.4);
  white-space: nowrap;
}
.watched-panel__scores { display: grid; grid-template-columns: repeat(10, 1fr); gap: 6px; margin-top: 10px; max-width: 480px; }
.watched-panel__scores button {
  min-height: 32px; border: 1px solid #ffffff16; border-radius: 8px; font-size: 12px; font-weight: 600;
  background: hsl(calc(260 + var(--score) * 2) 65% calc(20% + var(--score) * 2%));
}
.watched-panel__scores button:hover {
  border-color: rgba(255, 255, 255, 0.35);
  box-shadow: 0 2px 10px rgba(168, 85, 247, 0.3);
}
.watched-panel__badges { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; max-width: 480px; }
.watched-panel__badges button { padding: 6px 12px; border: 1px solid #ffffff20; border-radius: 8px; background: rgba(255, 255, 255, 0.06); font-size: 12px; font-weight: 500; }
.watched-panel__badges button:hover { background: rgba(255, 255, 255, 0.12); border-color: rgba(255, 255, 255, 0.35); }
.watched-panel__skip { margin-top: 8px; padding: 4px 0; border: 0; background: transparent; font-size: 11px; color: #c4b5fd !important; text-decoration: underline; text-underline-offset: 3px; }
.watched-panel .watched-panel__status { margin: 8px 0 0; font-size: 12px; color: #ddd6fe; }
@media (max-width: 600px) {
  .watched-panel { width: 100%; padding: 8px 12px; }
  .watched-panel__heading { align-items: center; flex-direction: row; justify-content: space-between; gap: 8px; }
  .watched-panel__scores { grid-template-columns: repeat(5, 1fr); max-width: 100%; }
  .watched-panel__primary { width: auto; font-size: 11px; padding: 5px 12px; }
  .watched-panel__badges button { flex: 1 1 40%; }
}

@media (orientation: landscape) and (max-height: 600px) {
  .watched-panel { margin-inline: auto; }
  .watched-panel__heading { flex-direction: column; justify-content: center; text-align: center; }
}
