/* the two tabs of the chat, the lobby button, and the screens without a chat */
#chat::before{display:none}
#chtabs{display:flex;gap:6px;padding-bottom:8px;margin-bottom:6px;border-bottom:1px solid #f0c35a33}
#chtabs button{flex:1;min-height:34px;padding:4px 8px;background:transparent;border:1px solid #f0c35a33;color:#d9c79a;box-shadow:none}
#chtabs button.on{border-color:var(--gold);color:var(--gold);background:#f0c35a1f}
#chtabs button:disabled{opacity:.45}
#chtabs [hidden],#gmsgs[hidden],#msgs[hidden],#chatfab[hidden],#chatfab b[hidden]{display:none!important}
#chtabs b,#chatfab b{display:inline-block;min-width:18px;margin-inline-start:6px;padding:0 5px;border-radius:9px;background:#d92f45;color:#fff;font-size:12px;line-height:18px}
#chtabs [data-chx]{display:none;flex:0 0 38px}
body.bubble #chtabs [data-chx],body.phone #chtabs [data-chx]{display:block}
#gmsgs{flex:1;min-height:0;overflow-y:auto;overflow-wrap:anywhere}
#gmsgs .gm{padding:2px 0}
#gmsgs .gm small{opacity:.55;font-size:11px}
#gmsgs .gm-mod,#gmsgs .gm-del{min-height:0;padding:0 7px;margin-inline-start:6px;background:transparent;border:0;box-shadow:none;color:#d9c79a;opacity:.7}
#gmsgs .gm-menu{display:flex;flex-wrap:wrap;gap:4px;padding:4px 0}
#gmsgs .gm-menu button{min-height:30px;padding:2px 8px;font-size:13px}
body:not(.phone).solo:not(.home-on) main{grid-template-columns:minmax(0,1076px);justify-content:center}
body.solo #mtop [data-mt=chat]{display:none!important}

/* the bubble, and the chat that grows out of it */
#chatfab{position:fixed;left:16px;bottom:16px;z-index:70;width:56px;height:56px;min-height:0;padding:0;border-radius:50%;display:grid;place-items:center;
  background:linear-gradient(#ffe38a,#d9a62e);border:2px solid #fff3b0;box-shadow:0 6px 20px #000a;transition:opacity .16s ease .1s,transform .2s ease .1s}
#chatfab b{position:absolute;top:-4px;right:-4px;margin:0}
body.bubble.chat-open #chatfab{opacity:0;transform:scale(.6);pointer-events:none;transition-delay:0s}
html body.bubble #chat{display:flex!important;position:fixed!important;left:16px;right:auto;bottom:16px;top:auto;width:320px;height:min(460px,calc(100dvh - 100px))!important;min-height:0!important;max-height:none!important;z-index:71;
  transform-origin:left bottom;transform:scale(var(--sx,.17),var(--sy,.12));border-radius:50%;opacity:0;visibility:hidden;pointer-events:none;box-shadow:0 12px 40px #000d;will-change:transform,opacity;
  transition:transform .3s cubic-bezier(.4,0,.2,1),border-radius .3s ease,opacity .18s ease .12s,visibility 0s linear .3s}
html body.bubble #chat>*{opacity:0;transition:opacity .1s ease}
html body.bubble.chat-open #chat{transform:none;border-radius:16px;opacity:1;visibility:visible;pointer-events:auto;
  transition:transform .34s cubic-bezier(.3,1.18,.4,1),border-radius .22s ease,opacity .08s ease,visibility 0s}
html body.bubble.chat-open #chat>*{opacity:1;transition:opacity .18s ease .14s}
/* phone: in the lobby above the bottom menu, over a game in the top bar, where it hides no button */
body.phone #chatfab{width:46px;height:46px;font-size:21px;left:8px;bottom:calc(var(--navh) + 10px)}
html body.phone.bubble #chat{left:8px;right:8px;width:auto;bottom:calc(var(--navh) + 10px);height:52dvh!important}
body.phone.ingame #chatfab{bottom:auto;left:60px;top:calc(env(safe-area-inset-top) + 7px);width:40px;height:40px;font-size:18px;box-shadow:0 2px 8px #0008}
html body.phone.bubble.ingame #chat{bottom:auto;left:60px;top:calc(env(safe-area-inset-top) + 7px);width:calc(100vw - 68px);transform-origin:left top}
/* a message at the bottom of a phone would cover the line the chat is written in */
body.phone.chat-open #toast{bottom:auto;top:calc(env(safe-area-inset-top) + 64px)}
body.adm-open #chatfab,body.adm-open.bubble #chat{display:none!important}
@media (prefers-reduced-motion:reduce){html body.bubble #chat,#chatfab{transition-duration:0s!important}}
