/* Chat: the button (floating on the lobby, in the top bar during a run, on the match panel) and the panel. */
#talkBtn { position: fixed; right: max(14px, env(safe-area-inset-right)); bottom: max(14px, env(safe-area-inset-bottom)); z-index: 45; width: 52px; height: 52px; padding: 0; border-radius: 50%; border: 1px solid rgba(255, 255, 255, .16); background: var(--raise); color: var(--text); cursor: pointer; display: grid; place-items: center; box-shadow: 0 10px 30px -8px #000; }
#talkBtn svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.800; stroke-linejoin: round; }
#talkBtn:hover { border-color: var(--acid); color: var(--acid); }
#talkBtn em { position: absolute; top: -3px; right: -3px; min-width: 19px; height: 19px; padding: 0 5px; border-radius: 999px; background: var(--hot); color: #fff; font: 700 11px/19px var(--display); font-style: normal; text-align: center; }
#talkBtn em.dot { min-width: 11px; width: 11px; height: 11px; padding: 0; top: 1px; right: 1px; background: var(--acid); }
#talkBtn.in-hud { position: relative; right: auto; bottom: auto; z-index: auto; width: 34px; height: 34px; flex: none; box-shadow: none; background: transparent; }
#talkBtn.in-hud svg, #talkBtn.in-panel svg { width: 18px; height: 18px; }
#talkBtn.in-panel { position: absolute; right: 10px; top: 8px; bottom: auto; z-index: 4; width: 32px; height: 32px; box-shadow: none; background: transparent; }

#talk { position: fixed; right: max(14px, env(safe-area-inset-right)); bottom: max(76px, calc(env(safe-area-inset-bottom) + 76px)); z-index: 50; width: min(370px, calc(100vw - 28px)); height: min(540px, calc(100dvh - 100px)); display: flex; flex-direction: column; border-radius: 18px; border: 1px solid rgba(255, 255, 255, .14); background: var(--surface); box-shadow: 0 24px 70px -10px #000; overflow: hidden; }
#talk[hidden] { display: none; }
#talk header { display: flex; align-items: center; gap: 8px; padding: 8px 8px 8px 10px; border-bottom: 1px solid var(--line); }
.tk-tabs { flex: 1; min-width: 0; display: flex; align-items: center; gap: 4px; }
.tk-tabs button[data-k="tab"] { padding: 7px 12px; border: 0; border-radius: 999px; background: transparent; color: var(--muted); font: 700 12px var(--display); letter-spacing: .08em; text-transform: uppercase; cursor: pointer; }
.tk-tabs button.on { background: var(--raise); color: var(--text); }
.tk-tabs em { margin-left: 6px; padding: 1px 6px; border-radius: 999px; background: var(--hot); color: #fff; font: 700 10px var(--display); font-style: normal; }
.tk-back, .tk-x { width: 32px; height: 32px; flex: none; border: 0; border-radius: 50%; background: transparent; color: var(--muted); font-size: 22px; line-height: 1; cursor: pointer; }
.tk-back:hover, .tk-x:hover { background: var(--raise); color: var(--text); }
.tk-name { display: flex; align-items: center; gap: 8px; min-width: 0; font: 700 15px var(--display); cursor: pointer; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

#talk .av { flex: none; width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; background: hsl(var(--h) 55% 32%); color: #fff; font: 700 13px var(--display); font-style: normal; position: relative; }
#talk .av.on::after { content: ""; position: absolute; right: -1px; bottom: -1px; width: 9px; height: 9px; border-radius: 50%; background: var(--acid); border: 2px solid var(--surface); }

.tk-body { flex: 1; min-height: 0; overflow-y: auto; padding: 10px; overscroll-behavior: contain; }
.tk-empty { margin: 40px 18px; text-align: center; color: var(--muted); font-size: 14px; line-height: 1.45; }
.tk-empty b { display: block; margin-bottom: 6px; color: var(--text); font: 700 16px var(--display); }
.tk-empty .btn { margin-top: 14px; }
.tk-rule { margin: 0 0 10px; text-align: center; color: var(--muted); font-size: 11px; }

.tk-m { display: flex; gap: 8px; margin-bottom: 8px; align-items: flex-end; }
.tk-m.me { justify-content: flex-end; }
.tk-b { max-width: 80%; padding: 7px 10px; border-radius: 14px 14px 14px 4px; background: var(--raise); font-size: 14px; line-height: 1.35; overflow-wrap: anywhere; cursor: pointer; }
.tk-m.me .tk-b { border-radius: 14px 14px 4px 14px; background: rgba(200, 255, 46, .14); cursor: default; }
.tk-b > b { display: block; margin-bottom: 1px; color: hsl(var(--h) 70% 70%); font: 700 12px var(--display); }
.tk-b small { margin-left: 8px; color: var(--muted); font-size: 10px; white-space: nowrap; }
.tk-menu { display: flex; gap: 6px; margin-top: 7px; padding-top: 7px; border-top: 1px solid var(--line); }
.tk-menu button { padding: 4px 9px; border-radius: 999px; border: 1px solid var(--line); background: transparent; color: var(--text); font-size: 12px; cursor: pointer; }
.tk-menu button:hover { border-color: var(--hot); color: var(--hot); }
.tk-menu button:first-child:hover { border-color: var(--acid); color: var(--acid); }

.tk-list { list-style: none; margin: 0; padding: 0; }
.tk-list li { display: flex; align-items: center; gap: 10px; padding: 9px 8px; border-radius: 12px; cursor: pointer; }
.tk-list li:hover { background: var(--raise); }
.tk-list li > div { flex: 1; min-width: 0; }
.tk-list b { display: block; font: 700 14px var(--display); }
.tk-list small { display: block; color: var(--muted); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tk-list em { padding: 1px 7px; border-radius: 999px; background: var(--hot); color: #fff; font: 700 11px var(--display); font-style: normal; }
.tk-list span { color: var(--muted); font-size: 11px; }

.tk-form { display: flex; gap: 8px; padding: 8px; border-top: 1px solid var(--line); }
.tk-form[hidden] { display: none; }
.tk-form input { flex: 1; min-width: 0; padding: 10px 12px; border-radius: 999px; border: 1px solid var(--line); background: var(--bg); color: var(--text); font: inherit; font-size: 16px; }
.tk-form input:focus { outline: none; border-color: var(--acid); }
.tk-form input:disabled { opacity: .6; }

@media (max-width: 600px) {
  #talk { left: 0; right: 0; bottom: 0; width: auto; height: min(70dvh, 560px); border-radius: 18px 18px 0 0; border-bottom: 0; padding-bottom: env(safe-area-inset-bottom); }
  #talk.in-game { height: min(44dvh, 380px); }
  #talkBtn:not(.in-hud):not(.in-panel) { width: 48px; height: 48px; }
}

/* Reactions, group chats and the friend picker */
.tk-res { display: flex; gap: 4px; margin-top: 5px; }
.tk-re { display: inline-flex; align-items: center; gap: 4px; padding: 2px 7px; border-radius: 999px; border: 1px solid var(--line); background: var(--bg); color: var(--text); font-size: 13px; line-height: 1.3; cursor: pointer; }
.tk-re i { font: 700 11px var(--display); font-style: normal; color: var(--muted); }
.tk-re.on { border-color: var(--acid); background: rgba(200, 255, 46, .12); }
.tk-re.on i { color: var(--acid); }
.tk-m.me .tk-b { cursor: pointer; }
.tk-menu { flex-wrap: wrap; }
.tk-menu .tk-pickre { font-size: 17px; padding: 2px 9px; }
.tk-menu .tk-pickre:hover { border-color: var(--acid); }
.tk-new { display: block; width: 100%; margin: 0 0 8px; }
#talk .av.grp { background: rgba(200, 255, 46, .14); color: var(--acid); }
.tk-name .tk-n { margin-left: 6px; padding: 1px 7px; border-radius: 999px; background: var(--raise); color: var(--muted); font: 700 11px var(--display); font-style: normal; }
.tk-newbox { display: grid; gap: 10px; padding: 4px; }
.tk-newbox label { display: grid; gap: 6px; color: var(--muted); font: 700 11px var(--display); letter-spacing: .1em; text-transform: uppercase; }
.tk-newbox input { padding: 10px 12px; border-radius: 12px; border: 1px solid var(--line); background: var(--bg); color: var(--text); font: 600 16px Inter, system-ui, sans-serif; text-transform: none; letter-spacing: 0; }
.tk-newbox input:focus { outline: none; border-color: var(--acid); }
.tk-pick { display: flex; flex-wrap: wrap; gap: 6px; }
.tk-pick button { padding: 7px 12px; border-radius: 999px; border: 1px solid var(--line); background: var(--bg); color: var(--muted); font: 600 13px Inter, system-ui, sans-serif; cursor: pointer; }
.tk-pick button.on { border-color: var(--acid); background: rgba(200, 255, 46, .12); color: var(--acid); }
.tk-newbox .btn[disabled] { opacity: .5; }
.tk-leave { color: var(--hot); }
