/* Floating game HUD; transparent overlay space remains clickable. */
.match-chat{
 --chat-accent:#36a6f3;--chat-glow:#138cf22e;
 position:fixed;right:max(12px,env(safe-area-inset-right,0px));bottom:max(12px,env(safe-area-inset-bottom,0px));
 width:min(380px,calc(100vw - 24px));z-index:14;display:flex;flex-direction:column;align-items:flex-end;gap:10px;
 font-family:"Segoe UI",Arial,sans-serif;color:#eaf3fa;pointer-events:none
}
.match-chat[data-faction=REBEL]{--chat-accent:#ed424c;--chat-glow:#d21d302e}
.match-chat[hidden],.match-chat [hidden]{display:none!important}
.match-chat button{
 margin:0;padding:10px 13px;border:1px solid var(--chat-accent);border-radius:5px;
 background:linear-gradient(135deg,#142032ed,#050b15f2);color:#edf5fc;
 box-shadow:inset 0 1px #d5e6f01c,inset 0 0 12px var(--chat-glow),0 4px 12px #0007;
 font:inherit;font-size:11px;font-weight:700;letter-spacing:.05em;cursor:pointer;pointer-events:auto;
 transition:background .15s ease,border-color .15s ease,box-shadow .15s ease
}
.match-chat button:hover:enabled{border-color:color-mix(in srgb,var(--chat-accent),white 28%);background:linear-gradient(135deg,#203246f2,#0a1726f5);box-shadow:inset 0 0 15px var(--chat-glow),0 0 12px var(--chat-glow),0 6px 18px #0008}
.match-chat button:active:enabled{background:#08121ef2;box-shadow:inset 0 2px 7px #0009}
.match-chat button:disabled{opacity:.45;cursor:not-allowed;box-shadow:none}
.match-chat button:focus-visible,.match-chat textarea:focus-visible{outline:2px solid var(--chat-accent);outline-offset:3px}
.match-chat svg{display:block;fill:none;stroke:currentColor;stroke-width:1.7;stroke-linecap:round;stroke-linejoin:round}
.match-chat .match-chat-toggle{
 --toggle-accent:var(--chat-accent);
 display:flex;align-items:center;justify-content:flex-start;gap:11px;width:min(228px,100%);min-height:58px;padding:11px 15px;
 border-color:var(--toggle-accent);border-radius:3px 10px 3px 10px;background:linear-gradient(125deg,#1d3044f5,#07121ef5 72%);
 box-shadow:inset 0 1px #dfedff26,inset 3px 0 var(--toggle-accent),inset 0 0 18px var(--chat-glow),0 7px 24px #0009
}
.match-chat-toggle svg{width:27px;height:27px;flex:none;color:var(--toggle-accent);filter:drop-shadow(0 0 4px var(--chat-glow))}
.match-chat-toggle-copy{display:flex;flex-direction:column;gap:5px;min-width:0;text-align:left}
.match-chat-toggle-label{color:#f5faff;font-size:12px;line-height:1.2;letter-spacing:.07em;white-space:nowrap}
.match-chat-toggle-copy small{color:#a7bfd0;font-size:8px;line-height:1.35;letter-spacing:.04em}
.match-chat-unread{display:grid;place-items:center;flex:none;min-width:23px;min-height:23px;margin-left:auto;padding:3px 6px;border:1px solid #e9bd60;border-radius:5px;background:#ebc16c;color:#1b2027;font-size:11px;font-weight:800;line-height:1}
.match-chat .match-chat-toggle[data-unread=true]{--toggle-accent:#efc56f;border-color:#efc56f;box-shadow:inset 3px 0 #efc56f,inset 0 0 19px #d6a74720,0 0 15px #e5b65d22,0 7px 24px #0009}
.match-chat[data-open=true] .match-chat-toggle{background:linear-gradient(125deg,#14273bf2,#07111df5)}
.match-chat-panel{
 align-self:stretch;position:relative;box-sizing:border-box;display:flex;flex-direction:column;gap:12px;
 height:min(470px,calc(100dvh - 100px));max-height:calc(100dvh - 100px);min-height:0;padding:16px;
 border:1px solid var(--chat-accent);border-radius:0;overflow:hidden;
 clip-path:polygon(0 14px,14px 0,calc(100% - 14px) 0,100% 14px,100% calc(100% - 14px),calc(100% - 14px) 100%,14px 100%,0 calc(100% - 14px));
 background:linear-gradient(120deg,#142032f5,#060c16f0 55%,#050810f0);
 box-shadow:inset 0 0 22px var(--chat-glow),0 0 14px var(--chat-glow),0 12px 30px #000b;
 backdrop-filter:blur(8px);-webkit-backdrop-filter:blur(8px);pointer-events:auto
}
.match-chat-panel::before{content:'';position:absolute;left:14px;right:14px;top:0;height:1px;background:linear-gradient(90deg,transparent,var(--chat-accent),transparent);pointer-events:none}
.match-chat-heading{display:flex;align-items:center;justify-content:space-between;gap:12px;flex:none;padding-bottom:12px;border-bottom:1px solid #d5e5f02a}
.match-chat-heading h2{margin:0;color:#f5faff;font-size:15px;font-weight:700;line-height:1.25;letter-spacing:.05em}
.match-chat-heading p{margin:5px 0 0;color:#9cb7cc;font-size:9px;letter-spacing:.09em;line-height:1.3}
.match-chat .match-chat-close{display:grid;place-items:center;flex:none;width:32px;height:32px;padding:0;border-color:#6c879b66;background:#0a1926a6;box-shadow:none}
.match-chat-close svg{width:18px;height:18px}
.match-chat-list{flex:1 1 auto;min-height:0;overflow-y:auto;overscroll-behavior:contain;padding:1px 4px 1px 0;scrollbar-width:thin;scrollbar-color:#537b95 #091521;scrollbar-gutter:stable}
.match-chat-list:empty{display:none}
.match-chat-empty{display:grid;align-content:center;gap:9px;flex:1 1 auto;min-height:0;margin:0;padding:16px;color:#9fb8cb;font-size:13px;line-height:1.6;text-align:center}
.match-chat-empty strong{color:#dbe9f4;font-weight:600}
.match-chat-list:not(:empty)+.match-chat-empty{display:none}
.match-chat-message{margin:0 20px 12px 0;padding:10px 11px;border:1px solid #7fabc11a;border-left:2px solid #698fa9;border-radius:2px 7px 7px 7px;background:#233b4b55;overflow-wrap:anywhere}
.match-chat-message.is-own{margin-right:0;margin-left:20px;border-left-color:var(--chat-accent);border-radius:7px 2px 7px 7px;background:linear-gradient(115deg,var(--chat-glow),#142b3b66)}
.match-chat-message header{display:flex;align-items:baseline;justify-content:space-between;gap:10px;font-size:11px;line-height:1.4;color:#bfdaeb}
.match-chat-message header strong{min-width:0;overflow-wrap:anywhere}
.match-chat-message time{flex:none;color:#87a4b9;font-size:10px;font-variant-numeric:tabular-nums}
.match-chat-message p{white-space:pre-wrap;margin:7px 0 0;color:#edf4f9;font-size:13px;line-height:1.55}
.match-chat form{display:grid;gap:9px;flex:none;padding-top:11px;border-top:1px solid #d5e5f026}
.match-chat textarea{display:block;resize:vertical;width:100%;min-height:66px;max-height:130px;box-sizing:border-box;padding:10px 11px;margin:0;border:1px solid #53758e99;border-radius:4px;background:#050f1bd9;color:#f0f7fc;font:13px "Segoe UI",Arial,sans-serif;line-height:1.5;box-shadow:inset 0 2px 8px #0004;pointer-events:auto}
.match-chat textarea::placeholder{color:#86a0b5}
.match-chat textarea:disabled{opacity:.65}
.match-chat-compose-actions{display:flex;align-items:center;justify-content:space-between;gap:12px}
.match-chat-compose-actions small{color:#829eb3;font-size:9px;line-height:1.5}
.match-chat-compose-actions button{flex:none;min-height:38px}
.match-chat-status{margin:0;color:#d4bf99;font-size:11px;line-height:1.5;overflow-wrap:anywhere}
.match-chat-status:empty{display:none}
@media(max-width:480px){
 .match-chat{right:max(8px,env(safe-area-inset-right,0px));bottom:max(8px,env(safe-area-inset-bottom,0px));width:min(360px,calc(100vw - 16px));gap:8px}
 .match-chat-panel{padding:14px}
 .match-chat .match-chat-toggle{min-height:54px;width:min(218px,100%)}
}
@media(max-height:600px){
 .match-chat{gap:8px}
 .match-chat-panel{height:min(330px,calc(100dvh - 92px));max-height:calc(100dvh - 92px);padding:12px;gap:8px}
 .match-chat-heading{padding-bottom:8px}.match-chat-heading h2{font-size:13px}.match-chat-heading p{display:none}
 .match-chat form{padding-top:8px;gap:7px}.match-chat textarea{height:46px;min-height:46px;max-height:80px;resize:none;padding:7px 9px}
 .match-chat-compose-actions button{min-height:32px;padding:7px 10px}.match-chat-message{padding:8px}
 .match-chat .match-chat-toggle{min-height:50px;padding:9px 13px}.match-chat-toggle-copy small{display:none}
}
@media(prefers-reduced-motion:reduce){.match-chat button{transition:none}}