:root {
  --destaque: #C9A24B;
  --fundo: #0f0d0b;
  --cartao: #1a1714;
  --texto: #f4efe7;
  --suave: #b7ad9f;
  --linha: #2d2823;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--fundo); color: var(--texto);
  font: 16px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
[hidden] { display: none !important; }

.portao { min-height: 100svh; display: grid; place-items: center; padding: 24px; }
.cartao { width: 100%; max-width: 440px; background: var(--cartao); border: 1px solid var(--linha);
  border-radius: 18px; padding: 32px 28px; }
.selo { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; letter-spacing: .04em;
  text-transform: uppercase; color: var(--destaque); margin: 0 0 12px; font-weight: 600; }
.selo.vivo { color: #ff5a4f; }
.ponto { width: 8px; height: 8px; border-radius: 50%; background: var(--destaque); }
h1 { font-size: clamp(24px, 5vw, 32px); line-height: 1.15; margin: 0 0 12px; font-weight: 700; }
.promessa { color: var(--suave); margin: 0 0 24px; }
label { display: block; font-size: 14px; color: var(--suave); margin-bottom: 14px; }
input { display: block; width: 100%; margin-top: 6px; padding: 14px; border-radius: 10px;
  border: 1px solid var(--linha); background: var(--fundo); color: var(--texto); font: inherit; }
input:focus { outline: 2px solid var(--destaque); outline-offset: 1px; border-color: transparent; }
.faixa-teste { background: #7c3aed; color: #fff; text-align: center; font-size: 13px; padding: 6px 12px; }
.faixa-teste button { margin-left: 10px; border: 1px solid #fff8; background: transparent; color: #fff; border-radius: 6px; padding: 2px 8px; font: inherit; cursor: pointer; }
.replay video { pointer-events: auto; }
/* WhatsApp com seletor de país ao lado */
.tel { display: flex; gap: 8px; margin-top: 6px; }
.tel input { margin-top: 0; flex: 1; min-width: 0; }
.tel select { flex: 0 0 auto; width: 112px; padding: 0 8px; border-radius: 10px; font: inherit; font-size: 15px;
  background: var(--campo, #1b1b22); color: inherit; border: 1px solid var(--borda, #333); }
.tel select:focus { outline: 2px solid var(--destaque); outline-offset: 1px; border-color: transparent; }
.botao { display: block; width: 100%; padding: 16px; border: 0; border-radius: 12px; background: var(--destaque);
  color: #1a1409; font-family: inherit; font-size: 17px; font-weight: 700; line-height: 1.1; cursor: pointer;
  text-align: center; text-decoration: none; }
.botao:disabled { opacity: .6; cursor: default; }
.miudo { font-size: 12px; color: var(--suave); margin: 10px 0 0; }
.erro { color: #ff8a7a; min-height: 1.2em; font-size: 14px; margin: 0 0 10px; }

/* 10/10: a sala usa a largura da tela — vídeo grande à esquerda (~72%), chat à direita na altura do título + vídeo */
.sala { max-width: 1760px; margin: 0 auto; padding: 28px clamp(16px, 2.6vw, 48px) 32px; }
.grade { display: grid; grid-template-columns: minmax(0, 1fr) clamp(320px, 25vw, 480px); grid-template-rows: auto auto auto; column-gap: clamp(16px, 1.8vw, 32px); row-gap: 16px; align-items: start; }
.topo { grid-column: 1; grid-row: 1; }
.topo h1 { font-size: clamp(22px, 2.4vw, 42px); line-height: 1.12; margin: 0; letter-spacing: -.01em; }
.palco { grid-column: 1; grid-row: 2; min-width: 0; }
.bloco-oferta { grid-column: 1; grid-row: 3; }
.chat { grid-column: 2; grid-row: 1 / span 2; align-self: stretch; }
.tela { position: relative; aspect-ratio: 16 / 9; background: #000; border-radius: 14px; overflow: hidden; }
.tela:fullscreen { border-radius: 0; }
video { width: 100%; height: 100%; display: block; background: #000; }
.sobre { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center;
  justify-content: center; text-align: center; padding: 24px;
  background: radial-gradient(circle at 50% 40%, #2a221a, #0a0908); }
.contagem { font-size: clamp(40px, 9vw, 88px); font-weight: 700; font-variant-numeric: tabular-nums;
  margin: 4px 0; line-height: 1.1; }
.contagem.pequena { font-size: clamp(22px, 4vw, 34px); }
.rotulo { color: var(--suave); margin: 0; }
.som { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); padding: 14px 22px;
  border-radius: 999px; border: 0; background: rgba(0, 0, 0, .78); color: #fff; font: inherit;
  font-weight: 600; cursor: pointer; }
.controles { position: absolute; right: 12px; bottom: 12px; display: flex; gap: 8px; z-index: 4; }
.controles button { width: 42px; height: 42px; border-radius: 10px; border: 0; background: rgba(0, 0, 0, .62);
  color: #fff; cursor: pointer; display: grid; place-items: center; }
.controles button:hover, .controles button[aria-expanded="true"] { background: rgba(0, 0, 0, .82); }
.controles svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.controles svg .alto { fill: currentColor; }
/* volume (10/10): toque no ícone abre a régua para cima; arrastar sobe ou desce o som */
.volume { position: relative; }
.volume-pop { position: absolute; bottom: calc(100% + 8px); left: 50%; transform: translateX(-50%); width: 42px; height: 150px; padding: 14px 0;
  border-radius: 10px; background: rgba(0, 0, 0, .82); display: grid; place-items: center; }
.volume-pop input { writing-mode: vertical-lr; direction: rtl; width: 6px; height: 120px; margin: 0; padding: 0; border: 0; accent-color: var(--destaque); background: transparent; cursor: pointer; }
.nivel-0 .onda1, .nivel-0 .onda2, .nivel-1 .onda2 { display: none; }
.nivel-1 .corte, .nivel-2 .corte { display: none; }
.nivel-0 .corte { display: inline; }
/* selo "ao vivo" + quantos assistindo, no canto de cima do vídeo (10/10) */
.placa { position: absolute; left: 14px; top: 14px; z-index: 4; display: inline-flex; border-radius: 8px; overflow: hidden; font-weight: 700; font-size: clamp(13px, 1.1vw, 17px); box-shadow: 0 4px 14px rgba(0,0,0,.35); }
.selo-vivo { display: inline-flex; align-items: center; gap: 8px; background: #e01e1e; color: #fff; padding: 8px 14px; letter-spacing: .02em; }
.selo-vivo.replay { background: #3a3a3a; }
.pulso { width: 9px; height: 9px; border-radius: 50%; background: #fff; animation: pulso 1.6s ease-in-out infinite; }
.replay .pulso { animation: none; opacity: .7; }
@keyframes pulso { 50% { opacity: .35; } }
.placa .audiencia { display: inline-flex; align-items: center; gap: 8px; background: #fff; color: #111; padding: 8px 14px; margin: 0; opacity: 1; font-size: inherit; }
.placa .audiencia svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; }
.so-leitor { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
@media (prefers-reduced-motion: reduce) { .pulso { animation: none; } }
.oferta { margin-top: 14px; animation: surgir .5s ease-out; }
@keyframes surgir { from { transform: translateY(8px); opacity: 0; } to { transform: none; opacity: 1; } }

.chat { background: var(--cartao); border: 1px solid var(--linha); border-radius: 14px; padding: 12px;
  display: flex; flex-direction: column; min-height: 420px; contain: size; }   /* contain: o chat acompanha a altura do título + vídeo sem esticar com as mensagens */
/* abas Chat (todos) e Suporte (privado com a equipe) — 10/10 */
.abas { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; padding: 4px; border-radius: 10px; background: rgba(255,255,255,.06); }
.abas button { border: 0; border-radius: 8px; padding: 10px; font: inherit; font-weight: 600; color: var(--suave); background: transparent; cursor: pointer; position: relative; }
.abas button.ativa { background: var(--fundo); color: var(--texto); box-shadow: 0 1px 4px rgba(0,0,0,.3); }
.abas .novo { position: absolute; top: 8px; right: 12px; width: 8px; height: 8px; border-radius: 50%; background: var(--destaque); }
.aviso-suporte { align-self: center !important; max-width: none !important; font-size: 13px; color: var(--suave); background: transparent !important; }
.chat-fechado { text-align: center; color: var(--suave); margin: 4px 0 2px; padding: 12px; border-top: 1px solid var(--linha); }
.mensagens { list-style: none; margin: 10px 0; padding: 0 4px; flex: 1; min-height: 0; overflow-y: auto;
  display: flex; flex-direction: column; gap: 6px; }
.mensagens li { padding: 8px 12px; border-radius: 12px; max-width: 90%; }
.mensagens strong { display: block; font-size: 12px; color: var(--suave); font-weight: 600; }
.mensagens p { margin: 2px 0 0; overflow-wrap: anywhere; white-space: pre-wrap; }
.minha { align-self: flex-end; background: #2a241d; }
.equipe { align-self: flex-start; background: #2b2417; border: 1px solid #4a3c1f; }
#form-chat { display: flex; gap: 8px; }
#form-chat input { margin: 0; }
#form-chat .botao { width: auto; padding: 0 16px; font-size: 15px; }
#erro-chat { margin: 0 0 6px; }
#erro-chat:empty { display: none; }

@media (max-width: 900px) {
  .sala { padding: 0 0 16px; }
  .grade { grid-template-columns: 1fr; grid-template-rows: none; row-gap: 12px; }
  .topo, .palco, .bloco-oferta, .chat { grid-column: 1; grid-row: auto; }
  .topo { padding: 12px 14px 0; }
  .tela { border-radius: 0; }
  .bloco-oferta { margin: 0 14px; }
  .chat { margin: 0 14px; height: 420px; min-height: 0; }
  .placa { left: 10px; top: 10px; }
  .selo-vivo, .placa .audiencia { padding: 6px 10px; }
}

.logo { max-width: 100%; max-height: 120px; display: block; margin: 0 auto 14px; border-radius: 10px; }
.apresentador { display: flex; align-items: center; gap: 10px; color: var(--suave); margin: -12px 0 20px; font-size: 14px; }
.apresentador img { width: 36px; height: 36px; border-radius: 50%; object-fit: cover; }
.bloco-oferta { margin-top: 14px; background: var(--cartao); border: 1px solid var(--linha); border-radius: 14px; padding: 14px; animation: surgir .5s ease-out; }
.bloco-oferta img { width: 100%; border-radius: 10px; display: block; margin-bottom: 10px; }
.oferta-titulo { margin: 0 0 6px; font-weight: 700; font-size: 18px; }
.oferta-titulo:empty, .oferta-preco:empty { display: none; }
.oferta-preco { margin: 0 0 10px; display: flex; justify-content: space-between; align-items: baseline; }
.oferta-preco s { color: var(--suave); }
.oferta-preco b { font-size: 24px; }
.bloco-oferta .oferta { margin-top: 0; }
.oferta-timer { text-align: center; font-size: 30px; font-weight: 700; font-variant-numeric: tabular-nums; margin: 10px 0 0; }
.oferta-timer.urgente { color: #ff5a4f; }
.oferta-timer.rotulos small { display: block; font-size: 11px; color: var(--suave); letter-spacing: .1em; }

/* barra "% das vagas" (portão) */
.vagas { margin: 10px 0 14px; }
.vagas .barra { height: 10px; border-radius: 5px; background: rgba(255,255,255,.12); overflow: hidden; }
.vagas .barra i { display: block; height: 100%; width: 0; background: var(--destaque); border-radius: 5px; transition: width 1.2s ease; }
.vagas small { display: block; margin-top: 6px; font-weight: 600; }
/* audiência */
.audiencia b { font-variant-numeric: tabular-nums; }
/* avisos de compra */
.compras { position: fixed; left: 16px; bottom: 16px; z-index: 30; display: flex; flex-direction: column; gap: 8px; pointer-events: none; }
.compra { background: rgba(20,20,24,.95); color: #fff; border-left: 4px solid var(--destaque); border-radius: 10px; padding: 10px 14px; box-shadow: 0 8px 24px rgba(0,0,0,.4); font-size: 14px; animation: compra-entra .4s ease; max-width: 320px; }
.compra small { display: block; opacity: .7; font-size: 12px; }
@keyframes compra-entra { from { transform: translateY(12px); opacity: 0; } to { transform: none; opacity: 1; } }
/* chat: comentários de outras pessoas */
.mensagens li.outro { align-self: flex-start; background: rgba(255,255,255,.06); }
.mensagens li.outro strong { color: var(--destaque); }
/* sorteio */
.sorteio { position: absolute; inset: auto 12px 12px 12px; z-index: 5; background: rgba(0,0,0,.82); border: 2px solid var(--destaque); border-radius: 14px; padding: 14px 18px; text-align: center; animation: compra-entra .5s ease; }
.sorteio .ganhador { font-size: 26px; font-weight: 800; margin: 4px 0; }
.sorteio .premio { opacity: .85; margin: 0; }

/* YouTube (10/10): o player ocupa a tela como o <video>; ao vivo não recebe clique (ninguém pausa nem sai para o YouTube) */
#yt, .tela iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; pointer-events: none; }
.yt-controles .tela iframe { pointer-events: auto; }

/* Sala Teste em modo edição (13/10): barra de controles e lápis/× nos comentários programados */
.edicao { position: sticky; top: 0; z-index: 40; display: flex; flex-wrap: wrap; gap: 8px 14px; align-items: center; justify-content: center; background: #2a1650; color: #fff; padding: 8px 12px; font-size: 13px; border-bottom: 1px solid #7c3aed; }
.edicao .ed-grupo { display: inline-flex; gap: 6px; align-items: center; }
.edicao button, .edicao label, .edicao #ed-status { white-space: nowrap; }
.edicao button { border: 1px solid #ffffff40; background: transparent; color: #fff; border-radius: 6px; padding: 4px 9px; font: inherit; cursor: pointer; }
.edicao button:hover { background: #ffffff1a; }
.edicao button.ativo { background: #7c3aed; border-color: #7c3aed; }
.edicao button.primario { background: #7c3aed; border-color: #7c3aed; font-weight: 700; }
.edicao button:disabled { opacity: .45; cursor: default; }
.edicao input { background: #ffffff14; border: 1px solid #ffffff40; color: #fff; border-radius: 6px; padding: 4px 8px; font: inherit; }
.edicao #ed-tempo { font-variant-numeric: tabular-nums; min-width: 96px; }
.edicao .ed-aluna { display: inline-flex; gap: 5px; align-items: center; cursor: pointer; }
.edicao #ed-status { opacity: .85; }
.edicao #ed-status.alerta { color: #fde68a; opacity: 1; }
.mensagens li.programado { position: relative; }
.mensagens li .ed-acoes { display: inline-flex; gap: 2px; margin-left: 6px; vertical-align: middle; }
.mensagens li .ed-acoes button { border: 0; background: #ffffff14; color: var(--texto); border-radius: 5px; width: 22px; height: 22px; padding: 0; font-size: 12px; cursor: pointer; line-height: 22px; }
.mensagens li .ed-acoes button:hover { background: #7c3aed; color: #fff; }
.como-aluna .mensagens li .ed-acoes { display: none; }
.mensagens li.editando { background: #2a1650; border: 1px solid #7c3aed; display: flex; flex-direction: column; gap: 6px; align-self: stretch; }
.mensagens li.editando input, .mensagens li.editando textarea { background: #ffffff10; border: 1px solid #ffffff33; color: var(--texto); border-radius: 6px; padding: 6px 8px; font: inherit; font-size: 14px; }
.mensagens li.editando .ed-linha { display: flex; gap: 6px; }
.mensagens li.editando .ed-linha input:first-child { width: 72px; text-align: center; font-variant-numeric: tabular-nums; }
.mensagens li.editando .ed-linha input:last-child { flex: 1; min-width: 0; }
.mensagens li.editando .ed-botoes { display: flex; gap: 6px; justify-content: flex-end; }
.mensagens li.editando .ed-botoes button { border: 1px solid #ffffff40; background: transparent; color: var(--texto); border-radius: 6px; padding: 4px 10px; font: inherit; font-size: 13px; cursor: pointer; }
.mensagens li.editando .ed-botoes button.primario { background: #7c3aed; border-color: #7c3aed; color: #fff; font-weight: 700; }
.mensagens li.editando .erro { color: #fca5a5; font-size: 12px; margin: 0; }
