/* =========================================================
   CHAT GLOBAL (bubble fixo no canto inferior direito)
   ========================================================= */
.gchat { --gc-bottom:22px; --gc-right:22px; position:fixed; right:var(--gc-right); bottom:calc(var(--gc-bottom) + env(safe-area-inset-bottom, 0px)); z-index:3950; }

.gchat-bubble { position:relative; width:58px; height:58px; display:flex; align-items:center; justify-content:center; border:0; border-radius:50%; background:linear-gradient(145deg, #2fe38a, #10a35c); color:#fff; font-size:23px; cursor:pointer; box-shadow:0 10px 26px rgba(16,163,92,.4), 0 2px 6px rgba(0,0,0,.35), inset 0 -3px 0 rgba(0,0,0,.15); transition:transform .18s ease, box-shadow .18s ease; -webkit-tap-highlight-color:transparent; }
.gchat-bubble:hover { transform:translateY(-2px) scale(1.04); box-shadow:0 14px 30px rgba(16,163,92,.5), 0 2px 6px rgba(0,0,0,.35), inset 0 -3px 0 rgba(0,0,0,.15); }
.gchat-bubble:active { transform:scale(.95); }
.gchat-bubble:focus-visible { outline:3px solid #fff; outline-offset:3px; }
.gchat.is-open .gchat-bubble { background:linear-gradient(145deg, #2a4656, #17303e); box-shadow:0 8px 20px rgba(0,0,0,.4); }
.gchat.is-open .gchat-bubble i::before { content:"\f00d"; }   /* vira um X */
.gchat-dot { position:absolute; top:2px; right:2px; width:16px; height:16px; border-radius:50%; background:#ff3b4f; border:3px solid #0b1d27; box-shadow:0 0 0 0 rgba(255,59,79,.6); animation:gcPulse 1.8s ease-out infinite; }
.gchat-dot[hidden] { display:none; }
@keyframes gcPulse { 0% { box-shadow:0 0 0 0 rgba(255,59,79,.55); } 100% { box-shadow:0 0 0 10px rgba(255,59,79,0); } }

/* "Online agora N" acima do bubble (some com o chat aberto) */
.gchat-online { position:absolute; right:0; bottom:calc(100% + 8px); display:inline-flex; align-items:center; gap:6px; padding:5px 11px; border-radius:999px; background:rgba(11,29,39,.92); border:1px solid rgba(47,227,138,.35); box-shadow:0 6px 16px rgba(0,0,0,.35); color:#d9f7e5; font-size:12px; font-weight:700; white-space:nowrap; pointer-events:none; }
.gchat-online[hidden], .gchat.is-open .gchat-online { display:none; }
.gchat-online i { width:8px; height:8px; border-radius:50%; background:#2fe38a; box-shadow:0 0 0 0 rgba(47,227,138,.6); animation:gcOnline 1.8s ease-out infinite; }
.gchat-online b { color:#fff; font-weight:900; font-variant-numeric:tabular-nums; }
@keyframes gcOnline { 0% { box-shadow:0 0 0 0 rgba(47,227,138,.55); } 100% { box-shadow:0 0 0 7px rgba(47,227,138,0); } }

.gchat-panel { position:absolute; right:0; bottom:72px; width:min(370px, calc(100vw - 32px)); height:min(540px, calc(100vh - 190px)); height:min(540px, calc(100dvh - 190px)); display:flex; flex-direction:column; overflow:hidden; border-radius:18px; background:#0f2330; border:1px solid rgba(255,255,255,.1); box-shadow:0 24px 60px rgba(0,0,0,.55); transform-origin:100% 100%; animation:gcIn .2s ease-out; }
.gchat-panel[hidden] { display:none; }
@keyframes gcIn { from { opacity:0; transform:translateY(10px) scale(.96); } to { opacity:1; transform:none; } }

.gchat-head { display:flex; align-items:center; gap:10px; padding:12px 12px 12px 16px; background:linear-gradient(180deg, #16323f, #11293a); border-bottom:1px solid rgba(255,255,255,.07); }
.gchat-title { flex:1; min-width:0; color:#fff; font-size:14.5px; font-weight:850; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.gchat-title i { color:#2fe38a; margin-right:4px; }
.gchat-live { display:inline-flex; align-items:center; gap:6px; color:#9fe8b6; font-size:11px; font-weight:800; text-transform:uppercase; letter-spacing:.4px; }
.gchat-live span { width:7px; height:7px; border-radius:50%; background:#26e35f; animation:gcLive 1.6s ease-out infinite; }
@keyframes gcLive { 0% { box-shadow:0 0 0 0 rgba(38,227,95,.6); } 100% { box-shadow:0 0 0 7px rgba(38,227,95,0); } }
.gchat-close { width:32px; height:32px; display:flex; align-items:center; justify-content:center; border:0; border-radius:10px; background:rgba(255,255,255,.06); color:#cfdbe3; cursor:pointer; }
.gchat-close:hover { background:rgba(255,255,255,.12); color:#fff; }

.gchat-list { flex:1; min-height:0; overflow-y:auto; overscroll-behavior:contain; padding:10px 12px 6px; scrollbar-width:thin; scrollbar-color:rgba(255,255,255,.15) transparent; }
.gchat-empty { padding:40px 14px; color:#8aa5b5; font-size:13px; text-align:center; }
.gchat-empty[hidden] { display:none; }

.gchat-msg { display:flex; gap:9px; margin-top:10px; }
.gchat-msg.is-grouped { margin-top:3px; }
.gchat-side { flex:0 0 32px; }
.gchat-avatar { width:32px !important; height:32px !important; font-size:12px !important; display:flex; }
.gchat-main { flex:1; min-width:0; }
.gchat-meta { display:flex; align-items:baseline; gap:8px; margin-bottom:2px; }
.gchat-user { color:inherit; text-decoration:none; }
.gchat-meta strong { color:#dfe9ef; font-size:12.5px; font-weight:800; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; max-width:200px; display:inline-block; vertical-align:bottom; }
.gchat-user:hover strong { color:#fff; text-decoration:underline; }
.gchat-msg.is-mine .gchat-meta strong { color:#6ee7a5; }
.gchat-body { display:inline-flex; align-items:flex-end; gap:8px; max-width:100%; padding:7px 10px; border-radius:4px 12px 12px 12px; background:rgba(255,255,255,.06); color:#eaf2f6; font-size:13.5px; line-height:1.4; }
.gchat-msg.is-grouped .gchat-body { border-radius:12px; }
.gchat-msg.is-mine .gchat-body { background:rgba(38,227,95,.13); }
.gchat-body span { min-width:0; overflow-wrap:anywhere; white-space:pre-wrap; }
.gchat-time { flex:0 0 auto; color:#7e98a7; font-size:10.5px; font-weight:600; white-space:nowrap; font-variant-numeric:tabular-nums; }

.gchat-new { position:absolute; left:50%; bottom:92px; transform:translateX(-50%); display:inline-flex; align-items:center; gap:6px; padding:6px 12px; border:0; border-radius:999px; background:#2fe38a; color:#06301b; font-size:12px; font-weight:850; cursor:pointer; box-shadow:0 6px 16px rgba(0,0,0,.35); }
.gchat-new[hidden] { display:none; }

/* mencoes (@usuario) */
.gchat-mention { color:#8cc8ff; font-weight:700; text-decoration:none; }
.gchat-mention:hover { text-decoration:underline; }
.gchat-mention.is-me { color:#ffd166; background:rgba(255,209,102,.14); border-radius:4px; padding:0 3px; }
.gchat-msg.is-mentioned .gchat-body { box-shadow:inset 3px 0 0 #ffd166; }
.gchat-suggest { position:relative; margin:0 12px; max-height:200px; overflow-y:auto; border:1px solid rgba(255,255,255,.1); border-radius:10px; background:#0f2433; }
.gchat-suggest-item { display:flex; align-items:center; gap:9px; width:100%; padding:7px 10px; border:0; background:none; color:#eaf2f6; text-align:left; cursor:pointer; font:inherit; }
.gchat-suggest-item + .gchat-suggest-item { border-top:1px solid rgba(255,255,255,.05); }
.gchat-suggest-item.is-active, .gchat-suggest-item:hover { background:rgba(22,136,248,.18); }
.gchat-suggest-item span { display:flex; flex-direction:column; min-width:0; line-height:1.25; }
.gchat-suggest-item strong { font-size:13px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.gchat-suggest-item small { color:#8fa9b8; font-size:11.5px; }
.gchat-form { display:flex; align-items:center; gap:8px; padding:10px 12px 4px; border-top:1px solid rgba(255,255,255,.07); }
.gchat-input { flex:1; min-width:0; height:42px; padding:0 14px; border-radius:12px; border:1px solid rgba(255,255,255,.12); background:#0a1a24; color:#fff; font:inherit; font-size:14px; outline:none; }
.gchat-input:focus { border-color:rgba(47,227,138,.6); box-shadow:0 0 0 3px rgba(47,227,138,.15); }
.gchat-send { flex:0 0 42px; height:42px; display:flex; align-items:center; justify-content:center; border:0; border-radius:12px; background:linear-gradient(145deg, #2fe38a, #10a35c); color:#fff; font-size:15px; cursor:pointer; }
.gchat-form.is-sending .gchat-send { opacity:.55; pointer-events:none; }
.gchat-hint { padding:3px 14px 10px; color:#6f8a99; font-size:11px; }
.gchat-hint.is-error { color:#ff9a9a; font-weight:700; }
.gchat-guest { display:flex; align-items:center; justify-content:space-between; gap:10px; padding:12px 14px; border-top:1px solid rgba(255,255,255,.07); color:#b9cbd6; font-size:13px; }

/* celular: acima da barra de navegacao de baixo; o chat aberto ocupa a largura toda */
@media (max-width:768px) {
    .gchat { --gc-bottom:calc(var(--mobile-bottom-height, 70px) + 14px); --gc-right:14px; }
    .gchat-bubble { width:54px; height:54px; font-size:21px; }
    .gchat-panel { position:fixed; left:10px; right:10px; width:auto; bottom:calc(var(--mobile-bottom-height, 70px) + 80px + env(safe-area-inset-bottom, 0px)); height:auto; top:calc(var(--promo-bar-height, 0px) + 74px); max-height:none; }
    .gchat-input { font-size:16px; }   /* evita o zoom automatico do iPhone */
}

@media (prefers-reduced-motion: reduce) {
    .gchat-dot, .gchat-live span, .gchat-panel, .gchat-online i { animation:none; }
}

/* cartao "procurando partida" (Jogar agora) */
.gchat-queue { margin-top:2px; padding:10px 11px; border-radius:4px 12px 12px 12px; background:linear-gradient(135deg, rgba(38,227,95,.16), rgba(22,136,248,.10)); border:1px solid rgba(38,227,95,.35); color:#eaf2f6; font-size:13px; line-height:1.4; }
.gchat-queue-info { display:flex; align-items:flex-start; gap:7px; }
.gchat-queue-info i { color:#26e35f; margin-top:2px; }
.gchat-queue-info span { flex:1; min-width:0; overflow-wrap:anywhere; font-weight:700; }
.gchat-queue-act { margin-top:8px; }
.gchat-queue-btn { display:inline-flex; align-items:center; gap:6px; min-height:34px; padding:0 14px; border-radius:9px; background:#26e35f; color:#062012; font-size:13px; font-weight:850; text-decoration:none; }
.gchat-queue-btn:hover { filter:brightness(1.08); }
.gchat-queue-state { color:#aef5c4; font-size:12px; font-weight:700; }
.gchat-queue-closed { display:none; color:#8aa5b5; font-size:12px; font-weight:700; }
.gchat-msg.is-queue.is-closed .gchat-queue { background:rgba(255,255,255,.04); border-color:rgba(255,255,255,.1); }
.gchat-msg.is-queue.is-closed .gchat-queue-info i { color:#8aa5b5; }
.gchat-msg.is-queue.is-closed .gchat-queue-btn,
.gchat-msg.is-queue.is-closed .gchat-queue-state { display:none; }
.gchat-msg.is-queue.is-closed .gchat-queue-closed { display:inline; }
.gchat-msg.is-queue.is-live .gchat-queue-closed { color:#ffc72c; }
.gchat-msg.is-queue.is-live .gchat-queue-closed::before { content:''; display:inline-block; width:7px; height:7px; margin-right:6px; border-radius:50%; background:#ffc72c; vertical-align:1px; animation:gchat-live 1.2s ease-in-out infinite; }
.gchat-msg.is-queue.is-done .gchat-queue-closed b { color:#e6f0f6; }
.gchat-msg.is-queue.is-done .gchat-queue-closed .gchat-queue-prize { color:#26e35f; }
@keyframes gchat-live { 50% { opacity:.35; } }
