/* Split the screen into independent lanes so the Online Players pane never
   forces Chat Meja below the fold. Keep Find Table in its existing footer. */
.ranked-full-room #ranked-search:has(.ranked-chat-layout){
 grid-template-rows:auto minmax(min-content,1fr) auto;
 gap:clamp(4px,calc(var(--os-h)*.016),10px);
}
.ranked-chat-left,.ranked-chat-right{
 display:flex;flex-direction:column;min-inline-size:0;min-block-size:0;gap:clamp(3px,calc(var(--os-h)*.012),8px);
}
.ranked-chat-left .ranked-room-seats{flex:0 0 auto}
.ranked-chat-right .ranked-match-panel{flex:1 1 auto}
.ranked-chat-right .ranked-live{flex:0 0 auto}
.ranked-full-room .ranked-chat-layout .ranked-seat-grid{flex:0 0 auto;grid-auto-rows:auto}
.ranked-full-room .ranked-chat-layout .ranked-seat-grid .idr-preview-seat{
 --seat-chat-band:20px;
 --ranked-portrait-row:clamp(27px,calc(var(--os-h)*.091),52px);
 grid-template-rows:var(--ranked-portrait-row) 1.14em 1.05em clamp(18px,calc(var(--os-h)*.052),26px);
 align-content:center;min-height:0;padding-block:var(--seat-chat-band) 4px;gap:2px;
}
.ranked-full-room .ranked-chat-layout .idr-preview-seat > :is(.idr-self-avatar,.idr-empty-icon,.idr-peer-avatar){
 --rank-seat-control:clamp(24px,calc(var(--os-h)*.083),47px);
 --mg-look-size:var(--rank-seat-control);
}
.rank-seat-chat-bubble{
 position:absolute;z-index:4;inset-block-start:2px;inset-inline-start:50%;transform:translateX(-50%);
 max-inline-size:calc(100% - 5px);box-sizing:border-box;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;
 padding:2px 5px;border:1px solid #e3b88a;border-radius:8px;background:#f4d5a3;color:#3a252c;
 font:750 clamp(.55rem,calc(var(--os-h)*.028),.74rem)/1.12 system-ui,sans-serif;
 box-shadow:0 1px 5px #17090ab3;pointer-events:none;
}
:dir(rtl) .rank-seat-chat-bubble{transform:translateX(50%)}
@media(prefers-reduced-motion:no-preference){.rank-seat-chat-bubble{animation:rank-chat-bubble-in .16s ease-out}}
@keyframes rank-chat-bubble-in{from{opacity:.15}to{opacity:1}}
.rank-lobby-chat{display:grid;min-width:0;gap:3px;padding:5px 7px;border:1px solid #bf8d66;border-radius:10px;background:linear-gradient(150deg,#4b3037,#261a29 82%);color:#fce8c7;font:600 .76rem/1.25 system-ui,sans-serif}
.rank-lobby-chat-top{display:flex;align-items:center;gap:4px;min-width:0}
.rank-lobby-chat h3{margin:0;color:#ffe0a2;font:800 .83rem/1.1 system-ui,sans-serif}
.rank-lobby-chat [data-chat-private]{margin-inline-start:auto;color:#dfc4b5;font-size:.63rem;text-align:end}
.rank-lobby-chat [data-chat-note]{margin:0;color:#dfc1ab;font-size:.64rem}
.rank-lobby-chat [data-chat-note]:empty,.rank-lobby-chat ol:empty{display:none}
.rank-lobby-chat ol{position:relative;list-style:none;margin:0;padding:0 2px;block-size:clamp(3.75em,calc(var(--os-h)*.19),7em);overflow-y:auto;overflow-x:hidden;overscroll-behavior:contain;scrollbar-width:thin}
.rank-lobby-chat ol:focus-visible{outline:1px solid #ffd996;outline-offset:1px}
.rank-lobby-chat li{min-height:1.25em;display:flex;align-items:baseline;gap:5px;overflow-wrap:anywhere}
.rank-lobby-chat li>bdi{color:#ffd996;font-weight:800;flex:0 0 auto;max-width:35%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.rank-lobby-chat li>span{white-space:pre-wrap;min-width:0}
.rank-lobby-chat .rank-chat-report{margin-inline-start:auto;white-space:nowrap;font-size:.58rem;padding:0 3px;opacity:.78}
.rank-quick-row,.rank-chat-editor{display:flex;align-items:center;gap:5px;min-width:0}
.rank-quick-row>small{color:#e9c38f;font-size:.63rem;white-space:nowrap}
.rank-quick-row>[data-chat-presets]{display:flex;gap:4px;overflow:auto;scrollbar-width:none;min-width:0;touch-action:pan-x}
.rank-lobby-chat button{min-height:19px;padding:2px 6px;border:1px solid #a67b62;border-radius:7px;background:#4c2c38;color:#ffe8c1;font:700 .65rem/1.15 system-ui,sans-serif;white-space:nowrap;cursor:pointer}
.rank-lobby-chat button[data-chat-send]{padding-inline:10px;background:#ecc28a;color:#322014;font-size:.73rem;min-height:30px}
.rank-lobby-chat button:disabled,.rank-lobby-chat input:disabled{opacity:.62;cursor:default}
.rank-lobby-chat input{width:100%;min-width:0;height:30px;border:1px solid #a17582;border-radius:6px;background:#1e1622;color:#fff1d9;padding:3px 6px;font:500 16px/1.1 system-ui,sans-serif}
.rank-lobby-chat input::placeholder{color:#d2bec3;opacity:1}
.rank-lobby-chat :is(button,input):focus-visible{outline:2px solid #ffdb98;outline-offset:1px}
.rank-chat-editor [data-chat-send]{flex:0 0 auto}
.rank-chat-fill-note{display:block;color:#d5bab2;font-size:.62rem;margin:0 2px}
html.mg-native-keyboard-open .rank-lobby-chat.mg-native-keyboard-panel{position:fixed;z-index:160;inset:auto;top:calc(var(--mg-keyboard-top) + 5px);left:50%;transform:translateX(-50%);width:min(640px,calc(100vw - 22px));box-shadow:0 5px 32px #110a14d9}
html.mg-native-keyboard-open .rank-lobby-chat.mg-native-keyboard-panel :is(.rank-quick-row,ol){display:none}
@media(max-height:450px),(orientation:portrait) and (any-pointer:coarse){.rank-lobby-chat{padding:4px 5px;gap:2px}.rank-chat-fill-note{display:none}}
