.stm-protected-video {
  --stm-accent: #4255ff;
  --stm-accent-rgba: #4255ff;
  --stm-aspect: 16/9;
  --stm-watermark-opacity: .42;
  --stm-watermark-size: 14px;
  position: relative;
  max-width: 960px;
  margin: 28px 0;
  padding: 14px;
  border: 1px solid rgba(255, 255, 255, .08);
  border-radius: 14px;
  background: #050505;
  color: #fff;
  box-shadow: 0 16px 40px rgba(0, 0, 0, .18);
  overflow: hidden;
  font-family: system-ui, -apple-system, Segoe UI, sans-serif;
}

.stm-protected-video.stm-rounded,
.stm-protected-video.stm-rounded video,
.stm-protected-video.stm-rounded .stm-pv-stage {
  border-radius: 16px;
}

.stm-theme-light {
  border-color: #e5e7eb;
  background: #fff;
  color: #111;
}

.stm-pv-stage {
  position: relative;
  overflow: hidden;
  background: #000;
}

.stm-protected-video video {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: var(--stm-aspect);
  background: #000;
  outline: 1px solid color-mix(in srgb, var(--stm-accent) 42%, transparent);
}

.stm-pv-title-row {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  margin: 12px 0 10px;
}

.stm-pv-title-row img {
  width: 42px;
  height: 42px;
  border-radius: 999px;
  object-fit: cover;
}

.stm-pv-preview-title,
.stm-pv-preview-author {
  min-width: 0;
  overflow-wrap: anywhere;
}

.stm-pv-preview-title {
  font-weight: 800;
}

.stm-pv-preview-author {
  color: rgba(255, 255, 255, .72);
}

.stm-theme-light .stm-pv-preview-author {
  color: rgba(0, 0, 0, .62);
}

.stm-pv-center-play {
  position: absolute;
  left: 50%;
  top: 50%;
  z-index: 6;
  width: 76px;
  height: 76px;
  transform: translate(-50%, -50%);
  border: 0;
  border-radius: 50%;
  background: color-mix(in srgb, var(--stm-accent) 82%, #000);
  color: #fff;
  box-shadow: 0 16px 45px rgba(0, 0, 0, .35);
  cursor: pointer;
}

.stm-pv-controls {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px;
  border: 1px solid rgba(255, 255, 255, .08);
  border-radius: 0 0 12px 12px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, .08), rgba(255, 255, 255, .02)),
    #111;
  color: #fff;
  transition: opacity .16s ease, transform .16s ease;
}

.stm-pv-controls button,
.stm-pv-controls select {
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
  width: auto;
  min-width: 0;
  min-height: 34px;
  border: 1px solid rgba(255, 255, 255, .1);
  border-radius: 9px;
  background: rgba(255, 255, 255, .08);
  color: #fff;
  cursor: pointer;
}

.stm-pv-controls select {
  min-width: 68px;
  padding: 0 6px;
  font: 800 12px/1 system-ui, -apple-system, Segoe UI, sans-serif;
}

.stm-pv-controls select option {
  color: #111;
}

.stm-protected-video:not(.stm-pv-is-paused) .stm-pv-center-play,
.stm-protected-video:not(.stm-pv-is-paused) .stm-pv-controls {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.stm-protected-video:not(.stm-pv-is-paused) .stm-pv-controls {
  transform: translateY(6px);
}

.stm-pv-icon {
  width: 18px;
  height: 18px;
  display: block;
  fill: currentColor;
  pointer-events: none;
}

.stm-pv-center-play .stm-pv-icon {
  width: 30px;
  height: 30px;
  margin: auto;
}

.stm-pv-icon-pause,
.stm-protected-video:not(.stm-pv-is-paused) .stm-pv-icon-play,
.stm-pv-is-muted .stm-pv-icon-volume {
  display: none;
}

.stm-pv-is-paused .stm-pv-icon-play,
.stm-protected-video:not(.stm-pv-is-paused) .stm-pv-icon-pause,
.stm-pv-is-muted .stm-pv-icon-muted {
  display: block;
}

.stm-pv-is-paused .stm-pv-icon-pause,
.stm-pv-icon-muted {
  display: none;
}

.stm-pv-timeline,
.stm-pv-volume {
  min-width: 0;
  width: auto;
  accent-color: var(--stm-accent);
}

.stm-pv-timeline {
  flex: 1 1 120px;
}

.stm-pv-volume {
  flex: 0 0 82px;
}

.stm-pv-time-current,
.stm-pv-time-duration {
  display: inline-flex;
  justify-content: center;
  min-width: 42px;
  color: rgba(255, 255, 255, .86);
  font: 800 12px/1 ui-monospace, SFMono-Regular, Menlo, monospace;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.stm-pv-no-controls .stm-pv-controls {
  display: none;
}

.stm-video-watermark {
  position: absolute;
  left: 7%;
  top: 10%;
  z-index: 5;
  max-width: 70%;
  padding: 4px 7px;
  border-radius: 999px;
  background: rgba(0, 0, 0, .14);
  color: rgba(255, 255, 255, var(--stm-watermark-opacity));
  font: 600 var(--stm-watermark-size)/1.3 system-ui, -apple-system, Segoe UI, sans-serif;
  text-shadow: 0 1px 2px #000;
  pointer-events: none;
  transition: all 1.2s ease;
  overflow-wrap: anywhere;
}

.stm-theme-light .stm-video-watermark {
  background: rgba(255, 255, 255, .35);
  color: rgba(0, 0, 0, var(--stm-watermark-opacity));
  text-shadow: 0 1px 2px #fff;
}

.stm-protected-video[data-show-watermark="0"] .stm-video-watermark {
  display: none;
}

.stm-pv-image-watermark {
  position: absolute;
  z-index: 7;
  display: block;
}

.stm-pv-image-watermark img {
  display: block;
  width: 120px;
  max-width: 22vw;
}

.stm-pv-image-watermark.is-small img {
  width: 72px;
}

.stm-pv-image-watermark.is-rounded img {
  border-radius: 12px;
}

.stm-pv-image-watermark.wm-tl {
  left: 14px;
  top: 14px;
}

.stm-pv-image-watermark.wm-tr {
  right: 14px;
  top: 14px;
}

.stm-pv-image-watermark.wm-bl {
  left: 14px;
  bottom: 14px;
}

.stm-pv-image-watermark.wm-br {
  right: 14px;
  bottom: 14px;
}

.stm-pv-preview-muted {
  position: absolute;
  right: 16px;
  bottom: 18px;
  z-index: 8;
  border: 0;
  border-radius: 999px;
  background: #111;
  color: #fff;
  padding: 9px 14px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, .3);
  cursor: pointer;
}

.stm-pv-buy {
  position: absolute;
  right: 18px;
  bottom: 18px;
  z-index: 9;
  min-width: 210px;
  padding: 14px;
  border-radius: 16px;
  background: #fff;
  color: #111;
  text-align: center;
  text-decoration: none;
  box-shadow: 0 18px 50px rgba(0, 0, 0, .4);
}

.stm-pv-buy strong,
.stm-pv-buy span,
.stm-pv-buy b,
.stm-pv-buy em {
  display: block;
}

.stm-pv-buy b {
  margin: 8px 0;
  padding: 9px 12px;
  border-radius: 999px;
  background: var(--stm-accent);
  color: #fff;
}

.stm-pv-buy img {
  max-width: 220px;
  display: block;
}

.stm-pv-splash {
  position: absolute;
  inset: 0;
  z-index: 8;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, .55);
}

.stm-pv-splash img {
  max-width: 85%;
  max-height: 85%;
  border-radius: 18px;
  box-shadow: 0 18px 60px rgba(0, 0, 0, .45);
}

.stm-protected-video-denied {
  padding: 14px;
  border: 1px solid #ffe69c;
  border-radius: 10px;
  background: #fff3cd;
  color: #664d03;
}

@media (max-width: 640px) {
  .lesson-panel .stm-protected-video {
    width: auto;
    max-width: none;
    margin-left: -8px;
    margin-right: -8px;
    padding: 8px;
    border-left: 0;
    border-right: 0;
    border-radius: 0;
  }

  .lesson-panel .stm-protected-video.stm-rounded,
  .lesson-panel .stm-protected-video.stm-rounded video,
  .lesson-panel .stm-protected-video.stm-rounded .stm-pv-stage {
    border-radius: 4px;
  }

  .stm-pv-center-play {
    width: 58px;
    height: 58px;
  }

  .stm-pv-center-play .stm-pv-icon {
    width: 24px;
    height: 24px;
  }

  .stm-pv-controls {
    flex-wrap: nowrap;
    gap: 4px;
    padding: 8px;
  }

  .stm-pv-controls .stm-pv-volume,
  .stm-pv-controls .stm-pv-rate,
  .stm-pv-controls .stm-pv-control-play,
  .stm-pv-controls .stm-pv-time-duration {
    display: none;
  }

  .stm-pv-time-current,
  .stm-pv-time-duration {
    min-width: 36px;
    font-size: 11px;
  }

  .stm-pv-controls button {
    flex: 0 0 32px;
    width: auto;
    padding: 4px 7px;
    min-height: 32px;
    border-radius: 8px;
  }

  .stm-pv-timeline {
    flex-basis: 58px;
  }

  .stm-pv-buy {
    left: 12px;
    right: 12px;
    bottom: 12px;
  }
}
