/* Chat de atendimento do jogador.
   Vive fora do bundle do SPA (igual ao bb-extras), então sobrevive a
   recompilação do jogo. Nada aqui vaza para dentro do jogo: tudo é
   prefixado .bbc- e o container é fixed com z-index próprio. */

.bbc-raiz { position: fixed; inset: auto 0 0 auto; z-index: 2147483000; font-family: Nunito, system-ui, sans-serif; }

/* --- botão redondo --- */
.bbc-bolha {
  position: fixed; right: 16px; bottom: 16px;
  width: 56px; height: 56px; border-radius: 50%; border: 0;
  display: grid; place-items: center; cursor: pointer;
  background: linear-gradient(160deg, #22C55E, #16A34A);
  box-shadow: 0 10px 26px rgba(0,0,0,.45), 0 0 0 4px rgba(34,197,94,.15);
  transition: transform .18s ease, box-shadow .18s ease;
}
.bbc-bolha:hover { transform: translateY(-2px) scale(1.04); }
.bbc-bolha:active { transform: scale(.96); }
.bbc-bolha svg { width: 26px; height: 26px; stroke: #fff; fill: none; stroke-width: 2; }
.bbc-bolha.bbc-pulsa::after {
  content: ''; position: absolute; inset: -6px; border-radius: 50%;
  border: 2px solid rgba(34,197,94,.55); animation: bbc-onda 1.9s ease-out infinite;
}
@keyframes bbc-onda { 0% { transform: scale(.85); opacity: .9 } 100% { transform: scale(1.35); opacity: 0 } }

.bbc-ponto {
  position: absolute; top: -2px; right: -2px; min-width: 20px; height: 20px; padding: 0 5px;
  border-radius: 10px; background: #EF4444; color: #fff; font-size: 12px; font-weight: 800;
  display: grid; place-items: center; border: 2px solid #0b0f14;
}

/* --- balãozinho que puxa conversa --- */
.bbc-convite {
  position: fixed; right: 84px; bottom: 22px; max-width: min(280px, calc(100vw - 110px));
  background: #fff; color: #111827; border-radius: 16px 16px 4px 16px;
  padding: 12px 34px 12px 14px; font-size: 14px; line-height: 1.4;
  box-shadow: 0 14px 34px rgba(0,0,0,.35);
  animation: bbc-entra .28s cubic-bezier(.2,.8,.2,1);
}
.bbc-convite b { display: block; font-size: 12px; color: #16A34A; margin-bottom: 2px; }
.bbc-convite-x {
  position: absolute; top: 6px; right: 6px; width: 22px; height: 22px; border: 0; border-radius: 50%;
  background: transparent; color: #9CA3AF; font-size: 17px; line-height: 1; cursor: pointer;
}
.bbc-convite-x:hover { background: #F3F4F6; color: #374151; }
@keyframes bbc-entra { from { opacity: 0; transform: translateY(8px) scale(.96) } to { opacity: 1; transform: none } }

/* --- janela --- */
.bbc-janela {
  position: fixed; right: 16px; bottom: 84px; width: min(370px, calc(100vw - 32px));
  height: min(540px, calc(100vh - 120px));
  display: flex; flex-direction: column; overflow: hidden;
  background: #0F1620; border: 1px solid rgba(255,255,255,.09); border-radius: 18px;
  box-shadow: 0 24px 60px rgba(0,0,0,.55);
  animation: bbc-entra .22s cubic-bezier(.2,.8,.2,1);
}
@media (max-width: 480px) {
  .bbc-janela { right: 8px; left: 8px; bottom: 78px; width: auto; height: min(70vh, 520px); }
  .bbc-convite { right: 78px; }
}

.bbc-topo { display: flex; align-items: center; gap: 10px; padding: 12px 14px; background: #131C28; border-bottom: 1px solid rgba(255,255,255,.07); }
.bbc-ava { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; font-weight: 800; color: #04120a; background: linear-gradient(160deg, #4ADE80, #16A34A); font-size: 15px; }
.bbc-nome { flex: 1; min-width: 0; }
.bbc-nome strong { display: block; color: #F3F4F6; font-size: 14.5px; font-weight: 800; }
.bbc-nome span { display: block; color: #4ADE80; font-size: 11.5px; font-weight: 600; }
.bbc-fechar { width: 30px; height: 30px; border: 0; border-radius: 8px; background: transparent; color: #9CA3AF; font-size: 20px; cursor: pointer; }
.bbc-fechar:hover { background: rgba(255,255,255,.07); color: #fff; }

.bbc-corpo { flex: 1; overflow-y: auto; padding: 14px; display: flex; flex-direction: column; gap: 8px; background: #0F1620; }
.bbc-msg { max-width: 82%; padding: 9px 12px; border-radius: 14px; font-size: 14px; line-height: 1.45; white-space: pre-wrap; word-break: break-word; }
.bbc-msg.bbc-deles { align-self: flex-start; background: #1E2937; color: #E5E7EB; border-bottom-left-radius: 4px; }
.bbc-msg.bbc-meu   { align-self: flex-end;   background: #16A34A; color: #fff;    border-bottom-right-radius: 4px; }
.bbc-hora { font-size: 10.5px; opacity: .55; margin-top: 3px; display: block; }
.bbc-digitando { align-self: flex-start; display: flex; gap: 4px; padding: 11px 14px; background: #1E2937; border-radius: 14px; border-bottom-left-radius: 4px; }
.bbc-digitando i { width: 6px; height: 6px; border-radius: 50%; background: #9CA3AF; animation: bbc-pula 1.2s infinite; }
.bbc-digitando i:nth-child(2) { animation-delay: .15s }
.bbc-digitando i:nth-child(3) { animation-delay: .3s }
@keyframes bbc-pula { 0%,60%,100% { transform: none; opacity: .45 } 30% { transform: translateY(-4px); opacity: 1 } }

.bbc-atalhos { display: flex; flex-wrap: wrap; gap: 6px; padding: 0 14px 10px; }
.bbc-atalhos button {
  border: 1px solid rgba(74,222,128,.3); background: rgba(34,197,94,.1); color: #86EFAC;
  border-radius: 999px; padding: 6px 11px; font-size: 12.5px; cursor: pointer; font-family: inherit;
}
.bbc-atalhos button:hover { background: rgba(34,197,94,.2); }

.bbc-pe { display: flex; gap: 8px; padding: 10px; border-top: 1px solid rgba(255,255,255,.07); background: #131C28; }
.bbc-pe textarea {
  flex: 1; resize: none; max-height: 96px; min-height: 40px; padding: 10px 12px; font-family: inherit; font-size: 14px;
  color: #E5E7EB; background: #0F1620; border: 1px solid rgba(255,255,255,.1); border-radius: 12px; outline: none;
}
.bbc-pe textarea:focus { border-color: rgba(74,222,128,.5); }
.bbc-enviar { width: 40px; height: 40px; align-self: flex-end; border: 0; border-radius: 12px; background: #16A34A; color: #fff; cursor: pointer; display: grid; place-items: center; }
.bbc-enviar:disabled { opacity: .4; cursor: default; }
.bbc-enviar svg { width: 18px; height: 18px; fill: currentColor; }
