/* Chat do jogo (ui/chat.js): canto de baixo à esquerda, no tema Bolsa (Grafite). Usa as variáveis --bag-* do theme-bolsa.css. */
.chat-dock { position: fixed; left: 12px; bottom: 12px; z-index: 45; font-size: 12px; color: var(--bag-ink, #eef1f4); pointer-events: none; }
.chat-dock[hidden] { display: none; }
.chat-dock > * { pointer-events: auto; }

.ct-toggle { position: relative; display: flex; align-items: center; gap: 6px; padding: 6px 12px 6px 9px; cursor: pointer;
  background: var(--bag-pink, #3c4149); color: var(--bag-ink, #eef1f4); border: 2px solid var(--bag-frame, #16181d); border-radius: var(--bag-r, 10px);
  box-shadow: inset 0 0 0 2px var(--bag-pink-d, #2a2e35), 0 3px 10px rgba(0,0,0,.45); font: inherit; font-family: var(--px, inherit); letter-spacing: .04em; }
.ct-toggle:hover { border-color: var(--bag-red, #e0262c); }
.ct-ico { font-size: 15px; line-height: 1; }
.ct-badge { position: absolute; right: -7px; top: -7px; min-width: 18px; height: 18px; padding: 0 4px; border-radius: 9px; background: var(--bag-red, #e0262c);
  color: #fff; font-size: 11px; line-height: 18px; text-align: center; border: 2px solid var(--bag-frame, #16181d); }
.ct-badge[hidden] { display: none; }

.ct-panel { width: min(400px, calc(100vw - 24px)); height: min(300px, 46vh); display: flex; flex-direction: column; gap: 5px; padding: 6px;
  background: color-mix(in srgb, var(--bag-pink, #3c4149) 94%, transparent); border: 2px solid var(--bag-frame, #16181d); border-radius: var(--bag-r, 10px);
  box-shadow: inset 0 0 0 2px var(--bag-pink-d, #2a2e35), 0 4px 16px rgba(0,0,0,.5); backdrop-filter: blur(3px); }
.ct-panel[hidden] { display: none; }
.ct-head { display: flex; gap: 4px; align-items: stretch; }
.ct-tabs { flex: 1; display: flex; padding: 2px; gap: 2px; }
.ct-tabs button { flex: 1; padding: 3px 2px; font-size: 10px; cursor: pointer; position: relative; white-space: nowrap; }
.ct-tabs button.off { opacity: .5; }
.ct-n { display: inline-block; margin-left: 3px; min-width: 14px; padding: 0 3px; border-radius: 7px; background: var(--bag-red, #e0262c); color: #fff; font-size: 9px; line-height: 14px; text-align: center; text-shadow: none; }
.ct-min { width: 26px; cursor: pointer; font: 700 16px/1 system-ui, sans-serif; color: var(--bag-ink, #eef1f4); background: var(--bag-off, #343940);
  border: 2px solid var(--bag-frame, #16181d); border-radius: 7px; }
.ct-min:hover { border-color: var(--bag-red, #e0262c); }

.ct-peers { display: flex; gap: 4px; flex-wrap: nowrap; overflow-x: auto; align-items: center; scrollbar-width: thin; }
.ct-peers[hidden] { display: none; }
.ct-peer { flex: none; padding: 2px 8px; font: inherit; font-size: 11px; cursor: pointer; color: var(--bag-ink, #eef1f4); background: var(--bag-card, #4a5059);
  border: 2px dotted var(--bag-dot, #a9b1bc); border-radius: 7px; }
.ct-peer.on { background: var(--bag-white, #6a7280); border: 2px solid var(--bag-red, #e0262c); }
.ct-to { flex: 1 0 120px; min-width: 110px; padding: 2px 6px; font-size: 11px; }

.ct-list { flex: 1; min-height: 0; overflow-y: auto; padding: 4px 6px; background: var(--bag-off, #343940); border-radius: 7px;
  border: 2px dotted color-mix(in srgb, var(--bag-dot, #a9b1bc) 55%, transparent); scrollbar-width: thin; line-height: 1.35; }
.ct-msg { padding: 1px 0; overflow-wrap: anywhere; }
.ct-time { color: var(--bag-ink2, #b9c2cc); font-size: 10px; opacity: .8; }
.ct-name { padding: 0; border: 0; background: none; font: inherit; font-weight: 700; color: #f2cb4f; cursor: pointer; }
.ct-name:hover { text-decoration: underline; }
.ct-name.me { color: #9cc4ff; cursor: default; text-decoration: none; }
.ct-to-l, .ct-sep { color: var(--bag-ink2, #b9c2cc); }
.ct-text { color: var(--bag-ink, #eef1f4); }
.chat-dock[data-tab="trade"] .ct-text { color: #ffe1a8; }
.chat-dock[data-tab="guild"] .ct-name:not(.me) { color: #7fe09a; }
.chat-dock[data-tab="group"] .ct-name:not(.me) { color: #6ec0f0; }
.chat-dock[data-tab="private"] .ct-name:not(.me) { color: #f08ab0; }
.ct-empty { margin: 6px 0; color: var(--bag-ink2, #b9c2cc); font-size: 11px; }

.ct-form { display: flex; gap: 4px; align-items: center; position: relative; }
.ct-input { flex: 1; min-width: 0; padding: 4px 8px; font-size: 12px; }
.ct-input:disabled { opacity: .6; }
.ct-count { position: absolute; right: 70px; font-size: 10px; color: #6a6f78; pointer-events: none; }
.ct-count.low { color: var(--bag-red, #e0262c); font-weight: 700; }

@media (max-width: 640px) {
  .chat-dock { left: 8px; bottom: 8px; }
  .ct-panel { height: min(260px, 42vh); }
}
.ct-toggle[hidden] { display: none; }
/* o botão do chat fica embaixo do registro da HUD (dicas e eventos da Hunt), sem cobrir */
body.has-chat .g-log { padding-bottom: 42px; }

/* balão de fala do chat em cima do treinador (ui/speech.js) */
.speech-bubble { position: absolute; left: 0; top: 0; pointer-events: none; z-index: 3;
  margin-top: -8px; max-width: 220px; width: max-content; padding: 5px 9px; border-radius: 10px;
  font-size: 12px; line-height: 1.25; color: #1d232b; text-align: center; white-space: normal; overflow-wrap: anywhere;
  background: #f7f8fa; border: 2px solid #3a4350; box-shadow: 0 2px 6px rgba(0,0,0,.35); transition: opacity .35s; }
.speech-bubble.tagged { margin-top: -28px; } /* acima do nome dos outros jogadores */
.speech-bubble::after { content: ''; position: absolute; left: 50%; bottom: -8px; transform: translateX(-50%);
  border: 6px solid transparent; border-top: 7px solid #3a4350; border-bottom: 0; }
.speech-bubble::before { content: ''; position: absolute; left: 50%; bottom: -4px; transform: translateX(-50%); z-index: 1;
  border: 4px solid transparent; border-top: 5px solid #f7f8fa; border-bottom: 0; }
.speech-bubble[data-ch="group"] { border-color: #2f6fae; }
.speech-bubble[data-ch="group"]::after { border-top-color: #2f6fae; }
.speech-bubble[data-ch="guild"] { border-color: #3f8a4f; }
.speech-bubble[data-ch="guild"]::after { border-top-color: #3f8a4f; }
.speech-bubble.pop .sb-text { display: inline-block; animation: sb-pop .18s ease-out; }
.speech-bubble.ending { opacity: 0; }
@keyframes sb-pop { from { transform: scale(.7); opacity: 0; } to { transform: scale(1); opacity: 1; } }
