  /* ─── PERSONAGEM JOÃO (surge no canto inferior direito) ─── */
  #joao-wrap {
    position: fixed;
    bottom: 0; right: 0;
    z-index: 999;
    display: flex;
    align-items: flex-end;
    opacity: 1;
    pointer-events: none;
    /* começa escondido embaixo */
    transform: translateY(115%);
    transition: transform 0.7s cubic-bezier(0.34, 1.56, 0.64, 1);
  }
  #joao-wrap.visible {
    transform: translateY(0);
  }

  #joao-img {
    width: 200px;
    display: block;
    filter: drop-shadow(0 8px 32px rgba(132,90,223,0.45));
    flex-shrink: 0;
    animation: joaoFloat 4.4s ease-in-out infinite;
  }
  @keyframes joaoFloat {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-8px); }
  }

  #joao-bubble {
    position: absolute;
    bottom: 195px; right: 95px;
    background: rgba(18,14,40,0.96);
    border: 1px solid rgba(132,90,223,0.5);
    border-radius: 18px 18px 4px 18px;
    padding: 16px 20px;
    width: max-content;
    max-width: min(230px, calc(100vw - 220px));
    box-shadow: 0 8px 40px rgba(0,0,0,0.5), 0 0 0 1px rgba(132,90,223,0.15);
    pointer-events: auto;
    opacity: 0;
    transform: scale(0.85) translateY(8px);
    transform-origin: bottom right;
    transition: opacity 0.4s ease 0.45s, transform 0.4s ease 0.45s;
  }
  #joao-wrap.visible #joao-bubble {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
  /* quando o João sai de cena, o balão some junto (vence o opacity inline do joaoSay) */
  #joao-wrap:not(.visible) #joao-bubble {
    opacity: 0 !important;
    transition: opacity 0.3s ease;
  }

  /* Triângulo do balão (aponta para baixo-direita, na direção do João) */
  #joao-bubble::before {
    content: '';
    position: absolute;
    bottom: -8px; right: 20px;
    width: 16px; height: 8px;
    background: rgba(18,14,40,0.96);
    clip-path: polygon(0 0, 100% 0, 50% 100%);
    border-left: 1px solid rgba(132,90,223,0.5);
    border-right: 1px solid rgba(132,90,223,0.5);
  }

  #joao-text {
    font-family: 'Inter', sans-serif;
    font-size: 0.85rem;
    line-height: 1.6;
    color: rgba(240,240,248,0.9);
    text-align: right;
  }
  #joao-text strong { color: var(--purple-light); font-weight: 600; }

  /* Glow roxo nos pés */
  #joao-glow {
    position: absolute;
    bottom: 0; right: -20px;
    width: 220px; height: 60px;
    background: radial-gradient(ellipse at center bottom, rgba(132,90,223,0.35) 0%, transparent 70%);
    pointer-events: none;
  }

  @media (max-width: 480px) {
    #joao-img { width: 150px; }
    #joao-bubble { bottom: 165px; right: 70px; max-width: min(200px, calc(100vw - 150px)); }
    #joao-glow { width: 180px; }
  }
