/* =====================================================================
   Chat ao vivo (js/chat.js): janela flutuante que não bloqueia o jogo
   ===================================================================== */
.chat-btn { position: relative; }
.chat-btn .chat-badge { position: absolute; top: -6px; right: -6px; }
.chat-win {
  position: fixed; right: 16px; bottom: 16px; z-index: 55;
  width: min(440px, calc(100vw - 32px)); height: min(440px, calc(100vh - 120px));
  display: flex; flex-direction: column;
  background: var(--bg-1); border: 1px solid var(--line-2); border-radius: var(--radius); box-shadow: var(--shadow);
}
.chat-win.hidden { display: none; }
.chat-head { display: flex; align-items: center; gap: 6px; padding: 6px 6px 0; border-bottom: 1px solid var(--line); min-width: 0; }
.chat-tabs { display: flex; gap: 2px; flex: 1; min-width: 0; overflow-x: auto; scrollbar-width: thin; }
.chat-tab {
  flex: none; display: inline-flex; align-items: center; gap: 6px; padding: 7px 10px; font: 600 13px/1 var(--font);
  color: var(--text-2); background: none; border: 0; border-bottom: 2px solid transparent; cursor: pointer; white-space: nowrap;
}
.chat-tab:hover { color: var(--text); }
.chat-tab.active { color: var(--orange-2); border-bottom-color: var(--orange); }
.chat-tab-x { padding: 0 2px; color: var(--muted); font-size: 15px; }
.chat-tab-x:hover { color: var(--red); }
.chat-badge { min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--orange); color: #1a0d00; font: 800 11px/18px var(--font); text-align: center; }
.chat-close { flex: none; margin-bottom: 4px; }
.chat-tools { display: flex; justify-content: flex-end; gap: 12px; padding: 3px 10px; border-bottom: 1px solid var(--line); }
.chat-tool { background: none; border: 0; padding: 2px 0; color: var(--muted); font: 600 11px var(--font); cursor: pointer; text-transform: uppercase; letter-spacing: .04em; }
.chat-tool:hover { color: var(--text); }
.chat-logs { flex: 1; min-height: 0; position: relative; }
.chat-log { position: absolute; inset: 0; overflow-y: auto; overflow-x: hidden; padding: 8px 10px; font-size: 13px; line-height: 1.45; }
.chat-line { overflow-wrap: anywhere; margin-bottom: 2px; }
.chat-time { color: var(--muted); font: 500 11px var(--mono); margin-right: 6px; }
.chat-name { font: 700 13px var(--font); color: var(--orange-2); background: none; border: 0; padding: 0; cursor: pointer; }
.chat-name:hover { text-decoration: underline; }
.chat-name.me { color: var(--chakra); cursor: default; }
.chat-line.whisper .chat-text { color: #f0c6ff; }
.chat-line.sys { font-size: 12px; font-style: italic; }
.chat-line.sys.err { color: #ff8a9a; }
.chat-line.sys.info { color: var(--text-2); }
.chat-form { display: flex; gap: 6px; padding: 8px; border-top: 1px solid var(--line); }
.chat-input { flex: 1; min-width: 0; }
.chat-menu { position: absolute; z-index: 2; min-width: 170px; padding: 4px; background: var(--bg-2); border: 1px solid var(--line-2); border-radius: 8px; box-shadow: var(--shadow); }
.chat-menu.hidden { display: none; }
.chat-menu-item { display: block; width: 100%; text-align: left; padding: 8px 10px; background: none; border: 0; border-radius: 6px; color: var(--text); font: 500 13px var(--font); cursor: pointer; }
.chat-menu-item:hover, .chat-menu-item:focus-visible { background: var(--bg-3); outline: none; }
.chat-menu-empty { padding: 8px 10px; color: var(--muted); font-size: 12px; }
.chat-win :focus-visible { outline: 2px solid var(--orange-2); outline-offset: 1px; }

/* celular: acima do menu de baixo, margem de 16px, sem rolagem horizontal */
@media (max-width: 760px) {
  .chat-win { left: 16px; right: 16px; width: auto; bottom: calc(76px + env(safe-area-inset-bottom)); height: min(60vh, calc(100vh - 170px)); }
}
