/* Room-scoped match chat. The drawer lives outside #app so gameplay renders do not reset it. */
.match-menu{gap:4px}
.topbar .match-chat-trigger{
  position:relative;
  width:40px;
  height:38px;
  display:grid;
  place-items:center;
  flex:0 0 auto;
  padding:0!important;
  border-color:#ffffff2d;
  background:#ffffff0a;
  color:#f5ead4;
}
.topbar .match-chat-trigger:hover,
.topbar .match-chat-trigger[aria-expanded="true"]{
  background:#ffffff18;
  border-color:#d8b75e66;
}
.match-chat-trigger svg{width:19px;height:19px;fill:currentColor}
.mobile-header-chat{display:none}
.match-chat-unread{
  position:absolute;
  top:-5px;
  right:-5px;
  min-width:18px;
  height:18px;
  display:grid;
  place-items:center;
  padding:0 4px;
  border:2px solid #09251a;
  border-radius:999px;
  background:#d8b75e;
  color:#12251c;
  font-size:9px;
  font-weight:1000;
  line-height:1;
}
.match-chat-unread[hidden]{display:none!important}
.match-chat-menu-item{display:flex!important;align-items:center;justify-content:space-between;gap:12px}
.match-chat-menu-count{
  min-width:20px;
  height:20px;
  display:grid;
  place-items:center;
  padding:0 5px;
  border-radius:999px;
  background:#d8b75e;
  color:#13271e;
  font-size:9px;
  font-weight:1000;
}
.match-chat-menu-count[hidden]{display:none!important}
.match-chat-mobile-unread{
  position:absolute;
  top:-4px;
  right:-4px;
  min-width:18px;
  height:18px;
  display:grid;
  place-items:center;
  padding:0 4px;
  border:2px solid #09251a;
  border-radius:999px;
  background:#d8b75e;
  color:#13271e;
  font-size:9px;
  font-weight:1000;
  line-height:1;
}
.match-chat-mobile-unread[hidden]{display:none!important}
.match-chat-backdrop{
  position:fixed;
  inset:0;
  z-index:360;
  display:flex;
  align-items:flex-start;
  justify-content:flex-end;
  padding:calc(var(--brasta-site-nav-base,58px) + var(--brasta-topbar-base,64px) + env(safe-area-inset-top) + 8px) 12px 12px;
  background:rgba(2,12,8,.18);
  backdrop-filter:none;
}
.match-chat-backdrop[hidden]{display:none!important}
.match-chat-drawer{
  position:relative;
  width:min(370px,calc(100vw - 24px));
  height:min(620px,calc(100dvh - var(--brasta-site-nav-base,58px) - var(--brasta-topbar-base,64px) - env(safe-area-inset-top) - 20px));
  min-height:360px;
  display:grid;
  grid-template-rows:auto minmax(0,1fr) auto auto auto;
  overflow:hidden;
  border:1px solid rgba(216,183,94,.32);
  border-radius:20px;
  background:
    radial-gradient(circle at 100% 0,rgba(216,183,94,.1),transparent 34%),
    linear-gradient(165deg,#0d3325 0%,#071f17 68%,#081912 100%);
  color:#f7f1e3;
  box-shadow:0 28px 80px rgba(0,0,0,.66),inset 0 1px 0 rgba(255,255,255,.06);
}
.match-chat-header{
  display:grid;
  grid-template-columns:auto minmax(0,1fr) auto;
  align-items:center;
  gap:10px;
  padding:14px;
  border-bottom:1px solid rgba(255,255,255,.1);
  background:rgba(255,255,255,.025);
}
.match-chat-mark{
  width:38px;
  height:38px;
  display:grid;
  place-items:center;
  border:1px solid rgba(216,183,94,.45);
  border-radius:12px;
  background:#153d2d;
  color:#d8b75e;
  font-family:var(--font-brasta-display),serif;
  font-size:20px;
  font-weight:900;
}
.match-chat-eyebrow{
  color:#d8b75e;
  font-size:8px;
  font-weight:900;
  letter-spacing:.16em;
}
.match-chat-header h2{margin:1px 0 0;font-size:18px;line-height:1.1}
.match-chat-header p{margin:3px 0 0;color:#94a99e;font-size:10px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.match-chat-close{
  width:34px;
  height:34px;
  display:grid;
  place-items:center;
  padding:0!important;
  border:1px solid rgba(255,255,255,.12)!important;
  border-radius:10px!important;
  background:rgba(255,255,255,.04)!important;
  color:#d9e3dd!important;
  font-size:23px!important;
  line-height:1!important;
  box-shadow:none!important;
}
.match-chat-close:hover{background:rgba(255,255,255,.1)!important}
.match-chat-messages{
  min-height:0;
  overflow-y:auto;
  overscroll-behavior:contain;
  display:flex;
  flex-direction:column;
  gap:9px;
  padding:12px;
  scrollbar-color:#476f5b transparent;
  scrollbar-width:thin;
}
.match-chat-empty{
  min-height:100%;
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:center;
  gap:5px;
  color:#8ea399;
  text-align:center;
}
.match-chat-empty>span{color:#d8b75e;font-size:26px}
.match-chat-empty>b{color:#d6e0db;font-size:13px}
.match-chat-empty>small{font-size:10px}
.match-chat-message{
  width:min(92%,330px);
  align-self:flex-start;
  padding:9px 10px 10px;
  border:1px solid rgba(255,255,255,.1);
  border-left:3px solid #64b6e8;
  border-radius:6px 14px 14px 14px;
  background:rgba(255,255,255,.055);
  box-shadow:0 7px 18px rgba(0,0,0,.18);
}
.match-chat-message.team-B{border-left-color:#f07878}
.match-chat-message.own{
  align-self:flex-end;
  border-right:3px solid #d8b75e;
  border-left:1px solid rgba(216,183,94,.2);
  border-radius:14px 6px 14px 14px;
  background:rgba(216,183,94,.11);
}
.match-chat-message-head{display:grid;grid-template-columns:28px minmax(0,1fr) auto;align-items:center;gap:7px;min-width:0}
.match-chat-avatar{
  width:28px;
  height:28px;
  display:grid;
  place-items:center;
  overflow:hidden;
  border:1px solid rgba(255,255,255,.2);
  border-radius:50%;
  background:#173e2e;
  color:#f0d477;
  font-size:10px;
  font-weight:950;
  line-height:1;
}
.match-chat-avatar img{width:100%;height:100%;display:block;object-fit:cover}
.match-chat-message-meta{display:flex;align-items:center;gap:6px;min-width:0}
.match-chat-message-meta b{max-width:105px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;color:#eef4f0;font-size:10px}
.match-chat-seat{color:#87a296;font-size:8px;font-weight:800;text-transform:uppercase}
.match-chat-message-meta time{margin-left:auto;color:#70877c;font-size:8px;white-space:nowrap}
.match-chat-safety-button{
  position:relative;
  z-index:2;
  width:36px;
  min-width:36px;
  height:36px;
  display:grid;
  place-items:center;
  margin:-5px -5px -5px 0;
  padding:0!important;
  border:0!important;
  border-radius:10px!important;
  background:transparent!important;
  color:#80988d!important;
  box-shadow:none!important;
  cursor:pointer;
  touch-action:manipulation;
  -webkit-tap-highlight-color:transparent;
}
.match-chat-safety-button svg{width:19px;height:19px;display:block;fill:currentColor;pointer-events:none}
.match-chat-safety-button:hover,.match-chat-safety-button:focus-visible{background:rgba(255,255,255,.08)!important;color:#f2dd9d!important}
.match-chat-safety-button:focus-visible{outline:2px solid #d8b75e;outline-offset:1px}
.match-chat-safety-button:active{background:rgba(255,255,255,.12)!important;transform:scale(.96)}
.match-chat-message p{margin:6px 0 0 35px;color:#f7f3e9;font-size:13px;line-height:1.35;overflow-wrap:anywhere}
.match-chat-status{
  min-height:0;
  padding:0 13px;
  color:#94cda8;
  font-size:9px;
  text-align:center;
}
.match-chat-status:not(:empty){padding-top:6px}
.match-chat-status.error{color:#ffaaa3}
.match-chat-readonly{
  margin:10px 12px 12px;
  padding:10px;
  border:1px solid rgba(216,183,94,.18);
  border-radius:11px;
  background:rgba(216,183,94,.06);
  color:#b8c9c0;
  font-size:10px;
  line-height:1.35;
  text-align:center;
}
.match-chat-readonly:not([hidden]){display:flex;align-items:center;justify-content:center;gap:8px}
.match-chat-readonly button{
  flex:0 0 auto;
  min-height:30px;
  padding:6px 10px!important;
  border:1px solid #d8b75e66!important;
  border-radius:8px!important;
  background:#d8b75e!important;
  color:#12251c!important;
  font-size:9px!important;
  font-weight:950!important;
  box-shadow:none!important;
}
.match-chat-readonly[hidden]{display:none!important}
.match-chat-consent{
  margin:8px 12px 12px;
  padding:12px;
  border:1px solid rgba(216,183,94,.28);
  border-radius:13px;
  background:linear-gradient(145deg,rgba(216,183,94,.11),rgba(255,255,255,.035));
  color:#c7d4ce;
  font-size:10px;
  line-height:1.4;
}
.match-chat-consent[hidden]{display:none!important}
.match-chat-consent>b{display:block;color:#fff2c7;font-size:12px}
.match-chat-consent p{margin:4px 0}
.match-chat-consent>a{color:#f0d477;text-underline-offset:2px}
.match-chat-consent label{display:flex;align-items:flex-start;gap:7px;margin:9px 0;color:#e5eee9}
.match-chat-consent input{width:15px;height:15px;flex:0 0 auto;margin:0;accent-color:#d8b75e}
.match-chat-consent button{
  width:100%;
  min-height:36px;
  padding:8px 10px!important;
  border:1px solid #d8b75e!important;
  border-radius:9px!important;
  background:#d8b75e!important;
  color:#13271e!important;
  font-size:10px!important;
  font-weight:950!important;
  box-shadow:none!important;
}
.match-chat-consent button:disabled{opacity:.45}
.match-chat-form{
  display:grid;
  grid-template-columns:minmax(0,1fr) auto;
  gap:8px;
  padding:11px 12px calc(11px + env(safe-area-inset-bottom));
  border-top:1px solid rgba(255,255,255,.1);
  background:rgba(2,16,11,.58);
}
.match-chat-form[hidden]{display:none!important}
.match-chat-form input{
  width:100%;
  min-width:0;
  height:42px;
  padding:0 12px;
  border:1px solid rgba(255,255,255,.14);
  border-radius:12px;
  outline:none;
  background:rgba(255,255,255,.06);
  color:#fff;
  font-size:16px;
}
.match-chat-form input::placeholder{color:#779084}
.match-chat-form input:focus{border-color:rgba(216,183,94,.65);box-shadow:0 0 0 3px rgba(216,183,94,.1)}
.match-chat-form button{
  min-width:66px;
  height:42px;
  padding:0 13px!important;
  border:1px solid #d8b75e!important;
  border-radius:12px!important;
  background:#d8b75e!important;
  color:#13271e!important;
  font-size:11px!important;
  font-weight:900!important;
  box-shadow:none!important;
}
.match-chat-form button:disabled,.match-chat-form input:disabled{opacity:.48}
.match-chat-safety-sheet{
  position:absolute;
  z-index:4;
  inset:67px 0 0;
  overflow-y:auto;
  padding:16px;
  background:linear-gradient(165deg,rgba(8,38,27,.985),rgba(3,18,13,.995));
  color:#edf4f0;
}
.match-chat-safety-sheet[hidden]{display:none!important}
.match-chat-safety-sheet>header{display:flex;align-items:center;justify-content:space-between;gap:12px;padding-bottom:13px;border-bottom:1px solid #ffffff18}
.match-chat-safety-sheet>header>div{display:flex;flex-direction:column;gap:3px;min-width:0}
.match-chat-safety-sheet>header span{color:#d8b75e;font-size:8px;font-weight:950;letter-spacing:.16em}
.match-chat-safety-sheet>header b{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:15px}
.match-chat-safety-sheet>header button{
  width:32px;
  height:32px;
  display:grid;
  place-items:center;
  padding:0!important;
  border:1px solid #ffffff20!important;
  border-radius:9px!important;
  background:#ffffff09!important;
  color:#fff!important;
  font-size:20px!important;
  box-shadow:none!important;
}
.match-chat-safety-sheet form{display:flex;flex-direction:column;gap:11px;padding:15px 0}
.match-chat-safety-sheet label{color:#aebfb7;font-size:9px;font-weight:850}
.match-chat-safety-sheet label small{color:#71897d;font-weight:600}
.match-chat-safety-sheet select,.match-chat-safety-sheet textarea{
  display:block;
  width:100%;
  margin-top:5px;
  padding:10px;
  border:1px solid #ffffff20;
  border-radius:9px;
  outline:none;
  background:#020e0a;
  color:#fff;
  font:inherit;
  font-size:12px;
}
.match-chat-safety-sheet textarea{min-height:88px;resize:vertical}
.match-chat-safety-sheet select:focus,.match-chat-safety-sheet textarea:focus{border-color:#d8b75e88;box-shadow:0 0 0 3px #d8b75e12}
.match-chat-safety-sheet form>button,.match-chat-block-panel>button{
  min-height:39px;
  padding:9px 12px!important;
  border:1px solid #d8b75e!important;
  border-radius:9px!important;
  background:#d8b75e!important;
  color:#13271e!important;
  font-size:10px!important;
  font-weight:950!important;
  box-shadow:none!important;
}
.match-chat-block-panel{display:flex;flex-direction:column;gap:7px;padding-top:15px;border-top:1px solid #ffffff18}
.match-chat-block-panel>button{border-color:#b95c62!important;background:#59232a!important;color:#fff!important}
.match-chat-block-panel small{color:#859a90;font-size:9px;line-height:1.4}
.match-chat-block-panel button:disabled{opacity:.5}
.match-chat-sr-only{
  position:absolute!important;
  width:1px!important;
  height:1px!important;
  padding:0!important;
  margin:-1px!important;
  overflow:hidden!important;
  clip:rect(0,0,0,0)!important;
  white-space:nowrap!important;
  border:0!important;
}
body.brasta-chat-open{overflow:hidden!important}

@media(max-width:800px){
  .topbar .match-chat-trigger{width:36px;height:34px}
  .match-chat-trigger svg{width:18px;height:18px}
  .match-chat-backdrop{align-items:flex-end;padding:0;background:rgba(2,12,8,.58);backdrop-filter:blur(2px)}
  .match-chat-drawer{
    width:100%;
    height:min(72dvh,640px);
    min-height:360px;
    max-height:calc(100dvh - 44px);
    border-right:0;
    border-bottom:0;
    border-left:0;
    border-radius:22px 22px 0 0;
    animation:match-chat-rise .18s ease-out;
  }
  .match-chat-header{padding:12px 14px}
  .match-chat-message{width:min(90%,330px)}
  .match-chat-safety-button{width:42px;min-width:42px;height:42px;margin:-8px -7px -8px 0}
}
@media(max-width:700px){
  body.brasta-mobile-merged-header .mobile-header-chat{
    position:fixed;
    z-index:1255;
    top:6px;
    right:max(51px,calc(env(safe-area-inset-right) + 51px));
    width:38px;
    height:38px;
    display:grid;
    place-items:center;
    padding:0!important;
    border:1px solid rgba(255,255,255,.18);
    border-radius:11px;
    background:rgba(255,255,255,.045);
    color:#f5f1e2;
    font:inherit;
    cursor:pointer;
  }
  body.brasta-mobile-merged-header .mobile-header-chat:hover,
  body.brasta-mobile-merged-header .mobile-header-chat[aria-expanded="true"]{
    background:rgba(255,255,255,.11);
    border-color:rgba(216,183,94,.42);
  }
  body.brasta-mobile-merged-header .mobile-header-chat svg{width:19px;height:19px;fill:currentColor}
  body.brasta-mobile-merged-header .topbar .match-chat-trigger{
    position:absolute!important;
    width:1px!important;
    height:1px!important;
    opacity:0!important;
    pointer-events:none!important;
  }
}
@media(max-width:430px){
  .match-menu{gap:3px}
  .topbar .match-chat-trigger{width:34px;height:34px}
  .match-chat-unread{top:-4px;right:-4px}
  .match-chat-drawer{height:min(74dvh,620px)}
}
@keyframes match-chat-rise{from{transform:translateY(18px);opacity:.75}to{transform:translateY(0);opacity:1}}
@media(prefers-reduced-motion:reduce){.match-chat-drawer{animation:none}}
