.bruxao-yt-bg {
  position: fixed;
  inset: 0;
  z-index: -12;
  overflow: hidden;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.5s ease;
  contain: strict;
}

.bruxao-yt-bg.is-active {
  opacity: 1;
}

.bruxao-yt-bg__shade {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgb(9 9 11 / 0.9) 0%, rgb(9 9 11 / 0.82) 45%, rgb(9 9 11 / 0.92) 100%),
    rgb(9 9 11 / 0.55);
  z-index: 2;
}

.bruxao-yt-bg__frame {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 100vw;
  height: 56.25vw;
  min-height: 100vh;
  min-width: 177.78vh;
  transform: translate(-50%, -50%) scale(1.14);
  z-index: 1;
  opacity: 0;
  filter: saturate(0.7) contrast(1.05);
}

.bruxao-yt-bg__frame iframe {
  width: 100%;
  height: 100%;
  border: 0;
  pointer-events: none;
}

.bruxao-yt-unmute-hint {
  position: fixed;
  bottom: 1.25rem;
  right: 1.25rem;
  z-index: 35;
  display: none;
  pointer-events: auto;
  padding: 0.55rem 0.9rem;
  font-size: 0.75rem;
  font-weight: 600;
  border-radius: var(--radius, 0.6rem);
  border: 1px solid rgb(255 255 255 / 0.12);
  background: rgb(9 9 11 / 0.85);
  color: rgb(250 250 250);
  backdrop-filter: blur(8px);
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s;
}

.bruxao-yt-unmute-hint:hover {
  background: hsl(var(--primary) / 0.25);
  border-color: hsl(var(--primary) / 0.45);
}

.bruxao-yt-unmute-hint.is-visible {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

/* Painel YouTube (admin) */
.yt-studio-header {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
}

.yt-studio-header__icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 3rem;
  height: 3rem;
  border-radius: var(--radius);
  background: #ff0000;
  color: #ffffff;
  border: 1px solid rgb(255 255 255 / 0.15);
  box-shadow: 0 4px 14px rgb(255 0 0 / 0.28);
  flex-shrink: 0;
}

.yt-studio-header__icon .bruxao-yt-logo {
  display: block;
  width: 1.65rem;
  height: 1.65rem;
  max-width: 100%;
  max-height: 100%;
  color: #ffffff;
}

.bruxao-yt-logo {
  display: block;
  flex-shrink: 0;
  vertical-align: middle;
}

.yt-studio-grid {
  display: grid;
  gap: 1.25rem;
}

@media (min-width: 1024px) {
  .yt-studio-grid {
    grid-template-columns: 1fr 1fr;
    align-items: start;
  }
}

.yt-studio-card {
  border: 1px solid rgb(var(--border));
  border-radius: calc(var(--radius) + 2px);
  padding: 1.35rem 1.5rem;
  background: linear-gradient(
    165deg,
    rgb(var(--muted-solid) / 0.45) 0%,
    rgb(var(--background) / 0.35) 100%
  );
  box-shadow: 0 1px 0 rgb(255 255 255 / 0.04) inset;
}

.yt-studio-card__head {
  margin-bottom: 1.15rem;
}

.yt-studio-card__title {
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.yt-studio-card__desc {
  font-size: 0.8rem;
  color: rgb(var(--muted-foreground));
  margin-top: 0.35rem;
  line-height: 1.45;
}

.yt-studio-field {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.yt-studio-field label {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: rgb(var(--muted-foreground));
}

.yt-studio-input-wrap {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0 0.85rem;
  border-radius: var(--radius);
  border: 1px solid rgb(var(--border));
  background: rgb(var(--background));
  transition: border-color 0.2s, box-shadow 0.2s;
}

.yt-studio-input-wrap:focus-within {
  border-color: hsl(var(--primary) / 0.55);
  box-shadow: 0 0 0 3px hsl(var(--primary) / 0.12);
}

.yt-studio-input-wrap input {
  flex: 1;
  min-width: 0;
  padding: 0.7rem 0;
  font-size: 0.875rem;
  border: 0;
  background: transparent;
  color: rgb(var(--foreground));
  outline: none;
}

.yt-studio-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  margin-top: 1.15rem;
  align-items: center;
}

.yt-studio-status-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 1rem;
}

.yt-studio-status-row.hidden {
  display: none;
}

.yt-studio-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.3rem 0.65rem;
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-radius: 999px;
  border: 1px solid rgb(var(--border));
}

.yt-studio-pill.hidden {
  display: none;
}

.yt-studio-pill--live {
  background: rgb(34 197 94 / 0.12);
  border-color: rgb(34 197 94 / 0.35);
  color: #4ade80;
}

.yt-studio-pill--live::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #4ade80;
  animation: yt-studio-pulse 1.4s ease-in-out infinite;
}

@keyframes yt-studio-pulse {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.35;
  }
}

.yt-studio-pill--muted {
  background: rgb(255 255 255 / 0.05);
  color: rgb(var(--muted-foreground));
}

.yt-studio-pill--sound {
  background: hsl(var(--primary) / 0.15);
  border-color: hsl(var(--primary) / 0.35);
  color: hsl(var(--primary));
}

.yt-studio-status-msg {
  font-size: 0.78rem;
  color: rgb(var(--muted-foreground));
  margin-top: 0.65rem;
  line-height: 1.4;
}

.yt-studio-status-msg--ok {
  color: #86efac;
}

.yt-studio-status-msg--err {
  color: #fca5a5;
}

.yt-studio-card--preview.hidden {
  display: none;
}

.yt-studio-preview-frame {
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid rgb(var(--border));
  background: #000;
}

.yt-admin-preview {
  aspect-ratio: 16 / 9;
  width: 100%;
}

.yt-admin-preview iframe {
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
}

.yt-studio-preview-overlay {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(
    180deg,
    rgb(9 9 11 / 0.88) 0%,
    rgb(9 9 11 / 0.78) 50%,
    rgb(9 9 11 / 0.9) 100%
  );
  mix-blend-mode: normal;
}

.yt-studio-actions .btn-primary[disabled],
.yt-studio-actions .btn-secondary[disabled] {
  opacity: 0.55;
  cursor: not-allowed;
}

.yt-studio-stats {
  margin-top: 0.25rem;
}

.yt-studio-stats.hidden {
  display: none;
}

.yt-studio-stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.75rem;
}

@media (max-width: 520px) {
  .yt-studio-stats-grid {
    grid-template-columns: 1fr;
  }
}

.yt-studio-stat {
  padding: 1rem 0.85rem;
  border-radius: var(--radius);
  border: 1px solid rgb(var(--border));
  background: rgb(var(--background) / 0.45);
  text-align: center;
}

.yt-studio-stat--total {
  border-color: hsl(var(--primary) / 0.35);
  background: hsl(var(--primary) / 0.08);
}

.yt-studio-stat__value {
  display: block;
  font-size: 1.75rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
}

.yt-studio-stat--total .yt-studio-stat__value {
  color: hsl(var(--primary));
}

.yt-studio-stat__label {
  display: block;
  margin-top: 0.35rem;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: rgb(var(--muted-foreground));
}

.yt-studio-stats__title {
  margin-bottom: 1rem;
}

.yt-studio-stats-grid {
  margin-top: 0;
}
