.cc-player {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #0a0e1a;
  color: #fff;
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
  overflow: hidden;
  border-radius: 8px;
}

.cc-player video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  background: #000;
  object-fit: contain;
}

.cc-player__status {
  position: absolute;
  top: 12px;
  left: 12px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 5px 11px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  background: rgba(0, 0, 0, 0.55);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 999px;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 1;
  transition: opacity 0.2s ease;
}

.cc-player__status[data-state="live"] {
  color: #10b981;
  border-color: rgba(16, 185, 129, 0.45);
}

.cc-player__status[data-state="loop"] {
  color: rgba(255, 255, 255, 0.75);
}

/* Live stays pinned (viewers should always know it's a live stream). The idle "On now" / loading
   badges auto-hide with the control bar — revealed only while the player is "active". */
.cc-player__status[data-state="loop"],
.cc-player__status[data-state="loading"] {
  opacity: 0;
}

.cc-player--active .cc-player__status[data-state="loop"],
.cc-player--active .cc-player__status[data-state="loading"] {
  opacity: 1;
}

.cc-player__status .cc-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
}

.cc-player__status[data-state="live"] .cc-dot {
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.3);
  animation: cc-pulse 1.6s ease-in-out infinite;
}

@keyframes cc-pulse {
  50% { box-shadow: 0 0 0 7px rgba(16, 185, 129, 0); }
}

.cc-player__overlay {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  background: rgba(10, 14, 26, 0.65);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 2;
  font-size: 14px;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.25s ease;
}

.cc-player__overlay.is-visible {
  opacity: 1;
}

.cc-player__overlay-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  color: rgba(255, 255, 255, 0.85);
}

.cc-player__spinner {
  width: 32px;
  height: 32px;
  border: 2px solid rgba(255, 255, 255, 0.18);
  border-top-color: rgba(255, 255, 255, 0.85);
  border-radius: 50%;
  animation: cc-spin 0.8s linear infinite;
}

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

/* ---- control bar (mute/volume, PIP, fullscreen) ---- */
.cc-player__controls {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 22px 12px 10px;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.65), rgba(0, 0, 0, 0));
  z-index: 3;
  opacity: 0;
  transform: translateY(6px);
  transition: opacity 0.2s ease, transform 0.2s ease;
  pointer-events: none;
}

/* Auto-hide: the bar is revealed only while the player is "active" (recent pointer/keyboard
   activity, hover on the bar, focus within, or paused — all driven from player.js). */
.cc-player--active .cc-player__controls {
  opacity: 1;
  transform: none;
  pointer-events: auto;
}

/* Hide the cursor along with the controls during playback for a clean full-bleed picture. */
.cc-player:not(.cc-player--active) {
  cursor: none;
}

.cc-ctrl {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  padding: 0;
  border: none;
  background: transparent;
  color: #fff;
  cursor: pointer;
  border-radius: 6px;
  opacity: 0.9;
  transition: opacity 0.15s ease, background 0.15s ease;
}

.cc-ctrl:hover {
  opacity: 1;
  background: rgba(255, 255, 255, 0.14);
}

.cc-ctrl:focus-visible {
  outline: 2px solid rgba(255, 255, 255, 0.7);
  outline-offset: 1px;
}

.cc-ctrl svg {
  display: block;
}

.cc-ctrl__spacer {
  flex: 1;
}

.cc-ctrl__vol {
  width: 82px;
  height: 4px;
  cursor: pointer;
  accent-color: #fff;
}

/* ---- lower-third / overlay text ---- */
.cc-logobug {
  position: absolute;
  z-index: 2;
  height: auto;
  max-width: 40%;
  pointer-events: none;
  -webkit-user-select: none;
  user-select: none;
  filter: drop-shadow(0 1px 4px rgba(0, 0, 0, 0.45));
}

.cc-lowerthird {
  position: absolute;
  max-width: 62%;
  padding: 10px 16px;
  z-index: 2;
  pointer-events: none;
  color: #fff;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.85), 0 0 2px rgba(0, 0, 0, 0.6);
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}

.cc-lowerthird.is-visible {
  opacity: 1;
  transform: none;
}

.cc-lowerthird__title {
  font-size: clamp(1.05rem, 3.4vw, 1.6rem);
  font-weight: 700;
  line-height: 1.15;
}

.cc-lowerthird__subtitle {
  font-size: clamp(0.85rem, 2.4vw, 1.1rem);
  font-weight: 600;
  opacity: 0.92;
  margin-top: 2px;
}

.cc-lowerthird__desc {
  font-size: clamp(0.75rem, 2vw, 0.95rem);
  opacity: 0.85;
  margin-top: 5px;
  line-height: 1.35;
  white-space: pre-line; /* preserve line breaks entered in the description textarea */
}

.cc-lowerthird[data-align="bottom-left"]  { left: 22px; bottom: 66px; text-align: left; }
.cc-lowerthird[data-align="bottom-right"] { right: 22px; bottom: 66px; text-align: right; }
.cc-lowerthird[data-align="top-left"]     { left: 22px; top: 20px; text-align: left; }
.cc-lowerthird[data-align="top-right"]    { right: 22px; top: 20px; text-align: right; }
.cc-lowerthird[data-align="center"] {
  left: 50%; top: 50%; transform: translate(-50%, -50%) translateY(8px);
  text-align: center; max-width: 82%;
}
.cc-lowerthird[data-align="center"].is-visible { transform: translate(-50%, -50%); }
