/* Clip Player. Цвета и скругление настраиваются переменными:
   --clip-player-accent, --clip-player-radius, --clip-player-text, --clip-player-muted */

.clip-player {
  --cp-accent: var(--clip-player-accent, #493dbd);
  --cp-radius: var(--clip-player-radius, 12px);
  --cp-text: var(--clip-player-text, #13152d);
  --cp-muted: var(--clip-player-muted, #9d9d9d);
  width: 100%;
}

.clip-player__screen {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #000;
  border-radius: var(--cp-radius);
  overflow: hidden;
}

.clip-player__video,
.clip-player__frame {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
  background: #000;
  object-fit: contain;
}

/* Заставка с кнопкой воспроизведения */
.clip-player__facade {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  padding: 0;
  border: 0;
  cursor: pointer;
  background: #000 center / cover no-repeat;
  display: flex;
  align-items: center;
  justify-content: center;
}

.clip-player__play {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: var(--cp-accent);
  box-shadow: 0 4px 18px rgba(0, 0, 0, .35);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform .15s ease;
}

.clip-player__facade:hover .clip-player__play,
.clip-player__facade:focus-visible .clip-player__play {
  transform: scale(1.08);
}

.clip-player__play svg {
  width: 30px;
  height: 30px;
  margin-left: 4px;
  fill: #fff;
}

.clip-player__spinner {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 40px;
  height: 40px;
  margin: -20px 0 0 -20px;
  border: 3px solid rgba(255, 255, 255, .25);
  border-top-color: #fff;
  border-radius: 50%;
  animation: clip-player-spin .8s linear infinite;
}

@keyframes clip-player-spin {
  to { transform: rotate(360deg); }
}

/* Сообщение об ошибке */
.clip-player__msg {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding: 16px;
  text-align: center;
  color: #fff;
  font-size: 14px;
}

.clip-player__link {
  text-decoration: none;
}

.clip-player__link--default {
  padding: 6px 12px;
  border-radius: 16px;
  font-size: 13px;
  font-weight: 500;
  color: #fff;
  background: var(--cp-accent);
}

/* Выбор качества под плеером */
.clip-player__bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 5px;
  padding-top: 10px;
}

.clip-player__bar[hidden] {
  display: none;
}

.clip-player__bar-label {
  color: var(--cp-muted);
  font-size: 13px;
  margin-right: 4px;
}

/* Сброс стилей кнопки с нулевой специфичностью — классы сайта всегда сильнее */
:where(.clip-player__q) {
  border: 0;
  margin: 0;
  font: inherit;
  background: transparent;
  cursor: pointer;
}

.clip-player__q--default {
  padding: 6px 10px;
  border-radius: 16px;
  font-size: 13px;
  font-weight: 500;
  color: var(--cp-text);
}

.clip-player__q--default:hover {
  background: rgba(35, 28, 153, .08);
}

.clip-player__q--default.is-active {
  background: var(--cp-accent);
  color: #fff;
}
