#sc-overlay {
  --sc-bg-opacity: 0.78;
  --sc-font-size: 18px;
  --sc-font-color: #ffffff;
  --sc-font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  display: none;
  position: fixed;
  bottom: 60px;
  left: 50%;
  transform: translateX(-50%);
  max-width: 62vw;
  min-width: 240px;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  z-index: 2147483647;
  pointer-events: auto;
  cursor: grab;
}

#sc-overlay.sc-dragging {
  cursor: grabbing;
}

/* Caption band: a fixed-height viewport (up to ~3 lines) that clips overflow.
   The inner .sc-roll is anchored to the bottom so the newest text is always
   visible and older lines scroll up and off the top. */
.sc-line {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  overflow: hidden;
  max-height: calc(var(--sc-font-size) * 1.35 * 2 + 16px);
  background: rgba(0, 0, 0, var(--sc-bg-opacity));
  color: var(--sc-font-color);
  font-family: var(--sc-font-family);
  font-size: var(--sc-font-size);
  line-height: 1.35;
  padding: 8px 14px;
  border-radius: 7px;
  text-align: center;
  max-width: 100%;
  word-break: break-word;
}

.sc-roll {
  width: 100%;
  will-change: transform;
}

.sc-translation {
  font-size: calc(var(--sc-font-size) * 0.86);
  max-height: calc(var(--sc-font-size) * 0.86 * 1.35 * 2 + 16px);
}

.sc-dots {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 1.35em;
}

.sc-dots span {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--sc-font-color);
  opacity: 0.35;
  animation: sc-dot-pulse 1.2s infinite ease-in-out;
}

.sc-dots span:nth-child(2) { animation-delay: 0.2s; }
.sc-dots span:nth-child(3) { animation-delay: 0.4s; }

@keyframes sc-dot-pulse {
  0%, 80%, 100% { opacity: 0.3; transform: scale(0.8); }
  40% { opacity: 1; transform: scale(1); }
}

.sc-paused {
  background: rgba(239, 68, 68, 0.92);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1px;
  padding: 3px 10px;
  border-radius: 4px;
  margin-bottom: 2px;
  pointer-events: none;
}
