.rwtp {
  --rwtp-cor: #e11d2e;           /* cor da marca (o JS troca pela cor dominante da logo) */
  width: 100%;
  min-width: 0;
  max-width: 960px;
  margin: 0 auto 1.5em;
  background: #000;
  border-radius: 10px;
  overflow: hidden;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
.rwtp-tela {
  position: relative;
  aspect-ratio: 16 / 9;
  background: #05070b;
  overflow: hidden;
  container-type: inline-size;
}
.rwtp-tela > .rwtp-logo,
.rwtp-tela > .rwtp-video,
.rwtp-tela > .rwtp-yt,
.rwtp-tela > .rwtp-img,
.rwtp-tela > .rwtp-capa {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  visibility: hidden;
  transition: opacity .8s ease, visibility 0s linear .8s;
}
.rwtp-tela > .rwtp-ativo {
  opacity: 1;
  visibility: visible;
  transition: opacity .8s ease;
}
/* Saída agendada do clipe (troca na hora marcada pelo agente / fim da música na rádio):
   o clipe some em 1,5 s (o mesmo tempo do fade do som) e a tela da emissora aparece por baixo. */
.rwtp-saindo .rwtp-tela > .rwtp-logo { opacity: 1; visibility: visible; transition: opacity .4s ease; }
.rwtp-saindo .rwtp-tela > .rwtp-yt.rwtp-ativo,
.rwtp-saindo .rwtp-tela > .rwtp-video.rwtp-ativo { opacity: 0; transition: opacity 1.5s linear; }
.rwtp-video { object-fit: contain; background: #000; }

/* Comercial sem VT: logomarca do anunciante com zoom lento sobre fundo desfocado */
.rwtp-img { overflow: hidden; background: #000; }
.rwtp-img-fundo {
  position: absolute;
  inset: -10%;
  background: var(--rwtp-img) center / cover no-repeat;
  filter: blur(40px) brightness(.45) saturate(1.4);
}
.rwtp-img img {
  position: absolute;
  /* Logomarca do anunciante ocupando a tela inteira (sem cortar a logo) */
  inset: 3%;
  width: 94%;
  height: 94%;
  object-fit: contain;
  filter: drop-shadow(0 1cqw 2.5cqw rgba(0, 0, 0, .6));
}
.rwtp-img.rwtp-ativo img { animation: rwtp-kenburns 30s ease-out both; }
@keyframes rwtp-kenburns { from { transform: scale(.92); opacity: .0; } 8% { opacity: 1; } to { transform: scale(1.06); } }
@media (prefers-reduced-motion: reduce) { .rwtp-img.rwtp-ativo img { animation: none; } }

/* ---------------- Capa de divulgação da música (CLIPES = opção 3) ---------------- */
.rwtp-capa { overflow: hidden; background: #05070b; }
.rwtp-capa-fundo {
  position: absolute; inset: -20%;
  background: var(--rwtp-capa) center / cover no-repeat;
  filter: blur(4.5cqw) brightness(.5) saturate(1.6);
  animation: rwtp-capa-fundo 26s ease-in-out infinite alternate;
}
@keyframes rwtp-capa-fundo {
  from { transform: scale(1.05) rotate(0deg); }
  to   { transform: scale(1.3) rotate(8deg); }
}
.rwtp-capa-luz {
  position: absolute; inset: -30%;
  background: radial-gradient(closest-side, rgba(255, 255, 255, .16), transparent 70%) 0 0 / 60% 60% no-repeat;
  mix-blend-mode: screen;
  animation: rwtp-capa-luz 14s ease-in-out infinite alternate;
}
@keyframes rwtp-capa-luz {
  0%   { background-position: 10% 20%; }
  50%  { background-position: 80% 40%; }
  100% { background-position: 30% 90%; }
}
.rwtp-capa-palco {
  position: absolute; left: 7%; top: 50%;
  width: 34cqw; height: 34cqw; margin-top: -17cqw;
}
.rwtp-capa-disco {
  position: absolute; top: 4%; left: 30%; width: 92%; height: 92%;
  border-radius: 50%;
  background:
    radial-gradient(circle, #111 0 3%, transparent 3.5%),
    radial-gradient(circle, transparent 0 17%, rgba(0,0,0,.85) 17.5% 18.5%, transparent 19%),
    var(--rwtp-capa) center / 36% 36% no-repeat,
    repeating-radial-gradient(circle, #0c0c0e 0 .35cqw, #1b1b20 .4cqw .6cqw);
  box-shadow: 0 1.2cqw 3cqw rgba(0, 0, 0, .6), inset 0 0 0 .3cqw rgba(255, 255, 255, .05);
  animation: rwtp-capa-gira 4.5s linear infinite;
}
.rwtp-capa-disco::after {
  content: ""; position: absolute; inset: 0; border-radius: 50%;
  background: conic-gradient(from 30deg, transparent 0 20%, rgba(255,255,255,.13) 25%, transparent 30% 70%, rgba(255,255,255,.1) 75%, transparent 80%);
}
@keyframes rwtp-capa-gira { to { transform: rotate(360deg); } }
.rwtp-capa-arte {
  position: absolute; inset: 0; z-index: 1;
  border-radius: 1cqw; overflow: hidden;
  box-shadow: 0 2cqw 4.5cqw rgba(0, 0, 0, .65), 0 0 0 .15cqw rgba(255, 255, 255, .12);
  animation: rwtp-capa-flutua 7s ease-in-out infinite;
}
.rwtp-capa-arte img { display: block; width: 100%; height: 100%; object-fit: cover; }
@keyframes rwtp-capa-flutua {
  0%, 100% { transform: translateY(0) rotate(-1.2deg) scale(1); }
  50%      { transform: translateY(-2.5%) rotate(1.2deg) scale(1.02); }
}
.rwtp-capa-brilho {
  position: absolute; inset: 0;
  background: linear-gradient(115deg, transparent 35%, rgba(255, 255, 255, .35) 50%, transparent 65%) -150% 0 / 250% 100% no-repeat;
  animation: rwtp-capa-brilho 5.5s ease-in-out infinite;
}
@keyframes rwtp-capa-brilho { 0%, 55% { background-position: -150% 0; } 100% { background-position: 250% 0; } }
.rwtp-capa-txt {
  position: absolute; left: 62%; right: 5%; top: 50%; transform: translateY(-50%);
  display: flex; flex-direction: column; gap: .8cqw;
  color: #fff; font-family: system-ui, sans-serif; text-shadow: 0 .3cqw 1.2cqw rgba(0, 0, 0, .6);
}
.rwtp-capa-rot {
  align-self: flex-start; padding: .5cqw 1.3cqw; border-radius: 99px;
  background: rgba(255, 255, 255, .14); font-size: 1.6cqw; font-weight: 600; letter-spacing: .05em;
}
.rwtp-capa-titulo { font-size: 3.6cqw; line-height: 1.12; font-weight: 800; }
.rwtp-capa-artista { font-size: 2.4cqw; opacity: .9; }
.rwtp-capa-album { font-size: 1.6cqw; opacity: .65; }
.rwtp-capa-titulo, .rwtp-capa-artista, .rwtp-capa-album {
  overflow: hidden; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2;
}
.rwtp-capa-ondas {
  position: absolute; left: 62%; bottom: 13%;
  display: flex; align-items: flex-end; gap: .6cqw; height: 4cqw;
}
.rwtp-capa-ondas i {
  display: block; width: .8cqw; height: 100%; border-radius: .4cqw;
  background: rgba(255, 255, 255, .8); transform-origin: bottom;
  animation: rwtp-capa-onda 1.1s ease-in-out infinite;
}
.rwtp-capa-ondas i:nth-child(2) { animation-delay: -.3s; }
.rwtp-capa-ondas i:nth-child(3) { animation-delay: -.7s; }
.rwtp-capa-ondas i:nth-child(4) { animation-delay: -.15s; }
.rwtp-capa-ondas i:nth-child(5) { animation-delay: -.5s; }
.rwtp-capa-ondas i:nth-child(6) { animation-delay: -.9s; }
.rwtp-capa-ondas i:nth-child(7) { animation-delay: -.4s; }
@keyframes rwtp-capa-onda { 0%, 100% { transform: scaleY(.25); } 50% { transform: scaleY(1); } }
.rwtp-capa.rwtp-ativo .rwtp-capa-palco { animation: rwtp-capa-entra 1.1s cubic-bezier(.2, .8, .2, 1) both; }
@keyframes rwtp-capa-entra { from { opacity: 0; transform: translateX(-8%) scale(.9); } to { opacity: 1; transform: none; } }
/* Celular: textos maiores, sem o nome do álbum */
@container (max-width: 560px) {
  .rwtp-capa-palco { left: 5%; width: 40cqw; height: 40cqw; margin-top: -24cqw; }
  .rwtp-capa-txt { left: 58%; top: 42%; gap: 1.2cqw; }
  .rwtp-capa-rot { font-size: 2.6cqw; }
  .rwtp-capa-titulo { font-size: 5.2cqw; }
  .rwtp-capa-artista { font-size: 3.6cqw; }
  .rwtp-capa-album { display: none; }
  .rwtp-capa-ondas { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .rwtp-capa *, .rwtp-capa *::after { animation: none !important; }
}

/* Logo da emissora no canto, como nas TVs: só aparece sobre vídeos do YouTube */
.rwtp-marca-tv {
  position: absolute;
  top: 4.5%;
  left: 3%;
  z-index: 1;
  width: 11%;
  max-height: 16%;
  object-fit: contain;
  object-position: left top;
  opacity: 0;
  pointer-events: none;
  filter: drop-shadow(0 .15cqw .5cqw rgba(0, 0, 0, .7));
  transition: opacity .8s ease;
}
.rwtp-tela.rwtp-com-yt .rwtp-marca-tv { opacity: .85; }
.rwtp-yt iframe { width: 100%; height: 100%; border: 0; pointer-events: none; }

/* ---------------- Tela da emissora (sem vídeo) ---------------- */
.rwtp-logo { overflow: hidden; background: #05070b; }

/* Fundo: a própria logo, gigante e desfocada, girando devagar */
.rwtp-amb { position: absolute; inset: -25%; pointer-events: none; }
.rwtp-amb-logo {
  background: var(--rwtp-logo) center / 60% no-repeat;
  filter: blur(60px) saturate(1.6) brightness(.55);
  animation: rwtp-girar 60s linear infinite;
}
.rwtp-amb:not(.rwtp-amb-logo):not(.rwtp-amb-luz) {
  background:
    radial-gradient(circle at 30% 35%, color-mix(in srgb, var(--rwtp-cor) 55%, transparent), transparent 55%),
    radial-gradient(circle at 70% 70%, #1d3a8a, transparent 55%);
  filter: blur(40px);
  animation: rwtp-girar 40s linear infinite;
}
/* Luz que respira por cima + vinheta escura nas bordas */
.rwtp-amb-luz {
  inset: 0;
  background:
    radial-gradient(ellipse at 50% 42%, color-mix(in srgb, var(--rwtp-cor) 22%, transparent), transparent 60%),
    radial-gradient(ellipse at center, transparent 45%, rgba(0, 0, 0, .75) 100%);
  animation: rwtp-respirar 6s ease-in-out infinite;
}

/* Logo no centro */
.rwtp-marca {
  position: absolute;
  inset: 0 0 22% 0;
  display: flex;
  align-items: center;
  justify-content: center;
}
.rwtp-marca-img {
  position: relative;
  width: 32%;
  max-height: 58%;
  aspect-ratio: 1;
  animation: rwtp-flutuar 7s ease-in-out infinite;
}
.rwtp-marca-img img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 0 2.2cqw color-mix(in srgb, var(--rwtp-cor) 70%, transparent)) drop-shadow(0 1cqw 2cqw rgba(0, 0, 0, .6));
}
/* Reflexo de luz que passa só sobre o desenho da logo */
.rwtp-reflexo {
  position: absolute;
  inset: 0;
  background: linear-gradient(115deg, transparent 38%, rgba(255, 255, 255, .75) 50%, transparent 62%) no-repeat;
  background-size: 300% 100%;
  -webkit-mask: var(--rwtp-logo) center / contain no-repeat;
          mask: var(--rwtp-logo) center / contain no-repeat;
  mix-blend-mode: overlay;
  animation: rwtp-reflexo 7s ease-in-out infinite;
}
/* Sem logo cadastrada: nome da emissora estilizado */
.rwtp-nome {
  font-size: 8cqw;
  font-weight: 800;
  letter-spacing: -.02em;
  text-align: center;
  line-height: 1;
  padding: 0 6%;
  color: transparent;
  background: linear-gradient(115deg, #fff 35%, color-mix(in srgb, var(--rwtp-cor) 60%, #fff) 50%, #fff 65%) 0 0 / 300% 100%;
  -webkit-background-clip: text;
          background-clip: text;
  filter: drop-shadow(0 0 2cqw color-mix(in srgb, var(--rwtp-cor) 60%, transparent));
  animation: rwtp-reflexo 7s ease-in-out infinite, rwtp-flutuar 7s ease-in-out infinite;
}

/* Equalizador */
.rwtp-eq {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  width: 100%;
  height: 30%;
  opacity: .9;
  pointer-events: none;
}

/* Faixa "No ar" (estilo TV) */
.rwtp-info {
  position: absolute;
  left: 4%;
  bottom: 7%;
  max-width: 70%;
  display: flex;
  flex-direction: column;
  gap: .3cqw;
  padding: 1.1cqw 1.8cqw 1.2cqw;
  border-left: .5cqw solid var(--rwtp-cor);
  background: linear-gradient(90deg, rgba(0, 0, 0, .7), rgba(0, 0, 0, .25));
  backdrop-filter: blur(6px);
  border-radius: 0 .6cqw .6cqw 0;
  color: #fff;
}
.rwtp-info.rwtp-vazio { display: none; }
.rwtp-info-rotulo {
  font-size: 1.3cqw;
  font-weight: 700;
  letter-spacing: .15em;
  text-transform: uppercase;
  color: color-mix(in srgb, var(--rwtp-cor) 45%, #fff);
}
.rwtp-info-texto {
  font-size: 2.6cqw;
  font-weight: 700;
  line-height: 1.15;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.rwtp-info.rwtp-novo { animation: rwtp-entrar .7s cubic-bezier(.2, .8, .2, 1); }
.rwtp-info-sub {
  font-size: 1.55cqw;
  color: rgba(255, 255, 255, .78);
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.rwtp-info-sub:empty { display: none; }

.rwtp-relogio {
  position: absolute;
  top: 4%;
  right: 4%;
  padding: .5cqw 1.1cqw;
  border-radius: .5cqw;
  background: rgba(0, 0, 0, .45);
  color: #fff;
  font-size: 1.8cqw;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  letter-spacing: .04em;
}

@keyframes rwtp-girar { to { transform: rotate(360deg); } }
@keyframes rwtp-respirar { 50% { opacity: .55; } }
@keyframes rwtp-flutuar { 50% { transform: translateY(-1.2cqw) scale(1.025); } }
@keyframes rwtp-reflexo { 0%, 55% { background-position: 100% 0; } 85%, 100% { background-position: 0 0; } }
@keyframes rwtp-entrar { from { transform: translateX(-12%); opacity: 0; } }

@media (prefers-reduced-motion: reduce) {
  .rwtp-amb, .rwtp-marca-img, .rwtp-reflexo, .rwtp-nome, .rwtp-info.rwtp-novo { animation: none; }
}

/* ---------------- Controles ---------------- */
.rwtp-play {
  position: absolute;
  left: 50%;
  bottom: 12%;
  transform: translateX(-50%);
  z-index: 2;
  padding: .7em 1.6em;
  border: 0;
  border-radius: 999px;
  background: var(--rwtp-cor);
  color: #fff;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 4px 20px rgba(0, 0, 0, .5);
}
.rwtp-play:hover { filter: brightness(.9); }
/* Enquanto o botão está visível, a faixa "No ar" sobe para não ficar embaixo dele */
.rwtp:not(.rwtp-ouvindo) .rwtp-info { bottom: 24%; }

.rwtp-barra {
  display: flex;
  align-items: center;
  gap: .75em;
  padding: .6em .9em;
  background: #111;
  color: #eee;
  font-size: .95rem;
}
.rwtp-aovivo {
  flex: none;
  padding: .15em .5em;
  border-radius: 4px;
  background: var(--rwtp-cor);
  color: #fff;
  font-size: .75rem;
  font-weight: 700;
  letter-spacing: .05em;
}
/* flex-basis 0 + min-width 0: o nome longo da música é cortado com "…" e não alarga a página */
.rwtp-texto { flex: 1 1 0; min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.rwtp-btn {
  flex: none;
  min-width: 2.2em;
  height: 2em;
  padding: 0 .45em;
  border: 0;
  border-radius: 6px;
  background: none;
  color: inherit;
  font: inherit;
  font-size: 1.1rem;
  line-height: 1;
  cursor: pointer;
}
.rwtp-btn:hover, .rwtp-btn:focus-visible { background: rgba(255, 255, 255, .12); }
.rwtp-cc {
  font-size: .75rem;
  font-weight: 800;
  letter-spacing: .04em;
  border: 2px solid currentColor;
  height: 1.9em;
  opacity: .6;
}
.rwtp-cc[aria-pressed="true"] { opacity: 1; background: #fff; color: #111; }
/* iPhone: o som do vídeo precisa de um toque depois de voltar para a aba */
.rwtp-toque-som .rwtp-tela::after {
  content: "🔊 Toque para ouvir o som do vídeo";
  position: absolute; z-index: 4; left: 50%; top: 50%; transform: translate(-50%, -50%);
  padding: .6em 1.1em; border-radius: 999px; background: rgba(0, 0, 0, .72); color: #fff;
  font: 600 .9rem/1.2 system-ui, sans-serif; white-space: nowrap; pointer-events: none;
}
/* Live do estúdio: selo vermelho pulsando */
.rwtp-em-live .rwtp-aovivo { background: #e11d2e; animation: rwtp-pulso-live 1.6s ease-in-out infinite; }
@keyframes rwtp-pulso-live { 50% { box-shadow: 0 0 0 5px rgba(225, 29, 46, .25); } }

/* Celular: barra mais compacta para caber AO VIVO + música + 4 botões */
@media (max-width: 520px) {
  .rwtp-barra { gap: .35em; padding: .5em .55em; font-size: .85rem; }
  .rwtp-aovivo { font-size: .66rem; padding: .15em .4em; }
  .rwtp-btn { min-width: 1.9em; padding: 0 .3em; font-size: 1rem; }
  .rwtp-cc { font-size: .66rem; }
  .rwtp-sync { font-size: .78rem; }
  .rwtp-play { white-space: nowrap; font-size: .85rem; padding: .5em 1.2em; bottom: 8%; }
}

/* ---------------- Tela cheia ---------------- */
.rwtp:fullscreen, .rwtp.rwtp-cheio {
  max-width: none;
  width: 100vw;
  height: 100vh;
  margin: 0;
  border-radius: 0;
  display: flex;
  flex-direction: column;
}
.rwtp.rwtp-cheio { position: fixed; inset: 0; z-index: 999999; height: 100dvh; }
.rwtp:fullscreen .rwtp-tela, .rwtp.rwtp-cheio .rwtp-tela { flex: 1; aspect-ratio: auto; }
.rwtp:fullscreen .rwtp-sync, .rwtp.rwtp-cheio .rwtp-sync { display: none; }
.rwtp:fullscreen .rwtp-tela > .rwtp-video, .rwtp.rwtp-cheio .rwtp-tela > .rwtp-video { object-fit: contain; }

/* ---------------- Calibragem (só administradores) ---------------- */
.rwtp-sync {
  padding: .7em .9em .8em;
  background: #1b1f27;
  border-top: 1px solid #2c3340;
  color: #d7dbe2;
  font-size: .85rem;
  line-height: 1.5;
}
.rwtp-sync-topo { display: flex; align-items: baseline; gap: .5em; margin-bottom: .4em; }
.rwtp-sync-so { color: #8a93a3; }
.rwtp-sync-fonte { margin-left: auto; font-weight: 700; color: #fff; }
.rwtp-sync-linha { display: flex; flex-wrap: wrap; align-items: center; gap: .4em; margin: .3em 0; }
.rwtp-sync-linha label { display: inline-flex; align-items: center; gap: .25em; cursor: pointer; }
.rwtp-sync-dica { color: #8a93a3; font-size: .8rem; }
.rwtp-sync button {
  padding: .35em .75em;
  border: 1px solid #3a4352;
  border-radius: 6px;
  background: #262c37;
  color: #fff;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}
.rwtp-sync button:hover { background: var(--rwtp-cor); border-color: var(--rwtp-cor); }
.rwtp-sync-status { margin-top: .3em; color: #aeb6c4; font-variant-numeric: tabular-nums; }
