/* In-game chat (public/chat.js) as a camera log: bottom-left above the weapon plate; phone -> top-left, clear of the
   sticks and the keyboard. Tokens: ui/theme.css. */
#chat{position:absolute;left:calc(16px + var(--safe-l,0px));bottom:calc(84px + var(--safe-b,0px));width:min(440px,44vw);display:flex;flex-direction:column;gap:6px;z-index:5;pointer-events:none;font:500 12px/1.4 var(--mono)}
#chat .chat-log{display:flex;flex-direction:column;gap:2px;align-items:flex-start}
#chat .ln{max-width:100%;background:rgba(7,5,11,.72);border-left:2px solid var(--line2);padding:3px 10px 3px 8px;color:var(--ink);overflow-wrap:anywhere;transition:opacity .8s ease}
#chat .ln.old{opacity:0}
#chat.open .ln,#chat.open .ln.old{opacity:1;transition:none}
.hints-low #chat:not(.open) .ln.bot:not(.mate){display:none}   /* «Подсказки: мало»: bot voices live in the open chat only */
#chat .ln time{color:var(--mute);font-size:10px;margin-right:8px;font-variant-numeric:tabular-nums}
#chat .ln .n{font-weight:700;text-transform:uppercase;letter-spacing:.06em}
#chat .ln .n::after{content:" ";white-space:pre}
#chat .ln .tag{margin-right:6px}
#chat .ln .x{color:var(--ink)}
#chat .ln .sys{color:var(--dim);font-style:italic}
#chat .ln.me{border-left-color:var(--cyan)}
#chat .ln.bot{border-left-color:var(--line)}
#chat .chat-in{display:none;align-items:center;gap:8px;pointer-events:auto;background:rgba(7,5,11,.86);border-bottom:2px solid var(--cyan);padding:0 10px 0 0}
#chat .chat-in::before{content:"";flex:none;width:8px;height:8px;margin-left:10px;border-radius:50%;background:var(--red);box-shadow:0 0 8px var(--red)}
#chat.open .chat-in{display:flex}
#chat .chat-in input{flex:1;min-width:0;font:500 14px var(--mono);color:#fff;background:transparent;border:0;outline:0;padding:10px 4px;-webkit-user-select:text;user-select:text}
#chat .chat-in input::placeholder{color:var(--mute)}
#chat .chat-k{color:var(--dim);font-size:10px;letter-spacing:.14em;text-transform:uppercase;white-space:nowrap}
#chatBtn{display:none}
#chat[hidden],#chatBtn[hidden]{display:none!important}
#chatBtn svg,#chatSet svg{width:14px;height:14px;stroke:currentColor;fill:none;stroke-width:1.8;stroke-linejoin:round}
#chatSet{display:flex;align-items:center;gap:6px}
/* phone (touch.js sets body.touchp): «чат» chip sits in .hud.tl under the stats; chat.js pins #chat just below it */
body.touchp #chatBtn{display:flex;align-items:center;gap:6px;margin-top:4px;min-height:36px;padding:0 10px}
body.hints-low.touchp #chatBtn .lbl{display:none}   /* «Подсказки: мало» on a phone: the icon says it */
body.touchp #chat{bottom:auto;top:calc(152px + var(--safe-t,0px));left:calc(12px + var(--safe-l,0px));width:min(360px,46vw);font-size:11px}
body.touchp #chat .chat-k{display:none}
body.touchp #chat .chat-in input{font-size:16px}   /* >= 16 px: iOS does not zoom into the field */
@media (max-height:430px){body.touchp #chat:not(.open) .ln:nth-last-child(n+4){display:none}}
body.pad .chat-k{display:none}
/* hotfix/phone-feed: over the game on a phone only the last 2 lines (the chip opens the whole log); landscape: under the
   top-left stack, clear of the centre */
body.touchp #chat:not(.open) .ln:nth-last-child(n+3){display:none}
@media (orientation:landscape){body.touchp #chat{top:calc(150px + var(--safe-t,0px));width:min(300px,23vw)}}
