/* 💬 /lobby — shared game lobby (public/lobby.js) · uses portal.css tokens */
.lby-page{padding:calc(var(--hdr) + 28px) 0 56px}
.lby-head{margin-bottom:18px}
.lby-head h1{font-size:clamp(28px,4vw,40px)}
.lby-grid{display:grid;grid-template-columns:minmax(260px,1fr) minmax(0,1.6fr) minmax(200px,.8fr);gap:16px;align-items:start}
.lby-col{display:flex;flex-direction:column;gap:16px;min-width:0}
.lby-box{border-radius:var(--r2);background:var(--panel);border:1px solid var(--line);backdrop-filter:blur(14px);-webkit-backdrop-filter:blur(14px);padding:14px;min-width:0}
.lby-bh{display:flex;align-items:center;justify-content:space-between;gap:10px;margin-bottom:10px;font-family:var(--f-disp)}
.lby-box .btn.sm,.lby-dlg .btn.sm{--h:32px;padding:0 12px;font-size:13px}
.lby-empty{font-size:14px;margin:6px 0}
.lby-gi{flex:none;width:36px;height:36px;display:grid;place-items:center;border-radius:10px;background:rgba(255,255,255,.05);border:1px solid var(--line);font-size:19px}
.lby-game,.lby-room,.lby-user{display:flex;gap:10px;align-items:flex-start;padding:9px 0;border-top:1px solid var(--line)}
.lby-game:first-child,.lby-room:first-child,.lby-user:first-child{border-top:0}
.lby-game>div,.lby-room>div,.lby-user>div{flex:1;min-width:0}
.lby-game b,.lby-room b,.lby-user b{font-family:var(--f-disp);font-size:14px}
.lby-game small,.lby-room small,.lby-user small{display:block;color:var(--text3);font-size:12px;line-height:1.5}
.lby-game p{margin:2px 0 6px;font-size:13px;line-height:1.5;color:var(--text2)}
.lby-gf{display:flex;flex-wrap:wrap;gap:6px;align-items:center;font-size:12px}
.lby-gf .chip{height:22px;font-size:11px}
.lby-room.me{background:color-mix(in srgb,var(--accent) 8%,transparent);border-radius:12px;padding:9px 8px}
.lby-room em{color:var(--ok);font-style:normal}
.lby-user{align-items:center}
.lby-user .dot{flex:none;width:8px;height:8px;border-radius:50%;background:var(--ok);box-shadow:0 0 8px var(--ok)}
.lby-chatbox{display:flex;flex-direction:column;height:min(72vh,720px);padding:0;overflow:hidden}
.lby-tabs{display:flex;border-bottom:1px solid var(--line)}
.lby-tabs button{flex:1;height:44px;border:0;background:none;color:var(--text3);font:600 14px var(--f-disp);cursor:pointer;border-bottom:2px solid transparent}
.lby-tabs button.on{color:var(--text);border-bottom-color:var(--accent)}
.lby-tabs i{display:inline-block;min-width:18px;height:18px;padding:0 5px;border-radius:9px;background:var(--accent2);color:#fff;font:700 11px/18px var(--f-body);font-style:normal}
.lby-rp{display:flex;flex-wrap:wrap;gap:10px;justify-content:space-between;padding:12px 14px;border-bottom:1px solid var(--line);background:rgba(255,255,255,.02)}
.lby-rp small{display:block;color:var(--text3);font-size:12px}
.lby-mem{display:flex;flex-wrap:wrap;gap:6px;margin-top:6px}
.lby-mem .chip{height:24px;font-size:12px}
.lby-x{border:0;background:none;color:var(--bad);cursor:pointer;font-size:15px;padding:0 0 0 2px;line-height:1}
.lby-ra{display:flex;flex-wrap:wrap;gap:6px;align-items:center}
.lby-msgs{flex:1;overflow-y:auto;padding:12px 14px;display:flex;flex-direction:column;gap:6px}
.lby-msg{display:flex;gap:8px;align-items:baseline;font-size:14px;line-height:1.55;word-break:break-word}
.lby-msg b{flex:none;font-family:var(--f-disp);color:var(--accent);font-size:13px}
.lby-msg.me b{color:var(--info)}
.lby-msg span{flex:1;min-width:0;color:var(--text)}
.lby-msg time{flex:none;color:var(--text3);font-size:11px}
.lby-motd{padding:8px 10px;border-radius:10px;background:rgba(251,191,36,.08);border:1px solid rgba(251,191,36,.25);font-size:13px}
.lby-say{display:flex;gap:8px;padding:10px;border-top:1px solid var(--line)}
.lby-say input,.lby-dlg input,.lby-dlg select{flex:1;min-width:0;height:40px;padding:0 12px;border-radius:10px;border:1px solid var(--line2);background:rgba(0,0,0,.35);color:var(--text);font:400 15px var(--f-body)}
.lby-guest{padding:12px 14px;border-top:1px solid var(--line);font-size:14px;color:var(--text2)}
.lby-status{margin-top:10px;font-size:13px;color:var(--warn)}
.lby-status[hidden]{display:none}
.lby-legal{margin-top:18px;font-size:12px}
.lby-ov{position:fixed;inset:0;z-index:300;display:flex;align-items:center;justify-content:center;padding:16px;background:rgba(0,0,0,.62)}
.lby-dlg{width:100%;max-width:440px;max-height:90vh;overflow-x:hidden;overflow-y:auto;border-radius:var(--r2);background:#140e0b;border:1px solid var(--line2);padding:20px;box-shadow:0 30px 80px -20px #000}
.lby-dlg h3{font-size:19px}
.lby-dlg label{display:flex;flex-direction:column;gap:4px;margin-bottom:12px;font-size:13px;color:var(--text2)}
.lby-dlg ol{padding-left:20px;font-size:14px}
.lby-2{display:grid;grid-template-columns:1fr 1fr;gap:10px}
.lby-da{display:flex;flex-wrap:wrap;gap:8px;justify-content:flex-end;margin-top:12px}
.lby-addr{display:flex;gap:8px;align-items:center}
.lby-addr code{padding:6px 10px;border-radius:8px;background:rgba(0,0,0,.4);border:1px solid var(--line2);font-size:15px}
@media (max-width:1020px){.lby-grid{grid-template-columns:1fr 1fr}.lby-mid{grid-column:1/-1;order:-1}}
@media (max-width:640px){.lby-page .wrap{padding:0 16px}.lby-grid{grid-template-columns:1fr}.lby-chatbox{height:70vh}.lby-2{grid-template-columns:1fr}}
.lby-dl{margin:10px 0 0;font-size:13px}

/* 🎖 avatars (public/lobby-av.js) · frame colour = tier by play hours · 🏅 badges = achievements */
.lby-av{flex:none;display:inline-block;width:45px;height:36px;border-radius:6px;border:2px solid #6d7a5a;background:#111;overflow:hidden}
.lby-av img{display:block;width:100%;height:100%;object-fit:cover}
.lby-av.t2{border-color:#c98a45}
.lby-av.t3{border-color:#3fb1b0}
.lby-av.t4{border-color:#9a6bff;box-shadow:0 0 10px -2px #9a6bff}
.lby-av.t5{border-color:#ffc940;box-shadow:0 0 14px -2px #ffc940}
.lby-av.sm{width:25px;height:20px;border-width:1.5px;border-radius:4px}
.lby-av.lg{width:90px;height:72px;border-width:3px;border-radius:10px}
.lby-msg{align-items:flex-start}
.lby-msg .lby-av,.lby-msg .lby-bd{flex:none}
.lby-me .lby-av.lg{width:75px;height:60px}
.lby-mb .btn{max-width:100%}
.lby-mem .chip{gap:5px;padding-left:3px}
.lby-bd{display:inline-grid;place-items:center;width:18px;height:18px;margin-left:3px;border-radius:5px;background:rgba(255,215,94,.12);border:1px solid rgba(255,215,94,.35);font-size:11px;line-height:1;vertical-align:1px}
.lby-bd.lg{width:40px;height:40px;margin:0;border-radius:10px;font-size:22px}
.lby-bds{display:inline-flex;margin-left:4px}
.lby-me{display:flex;gap:12px;align-items:center}
.lby-me>div{flex:1;min-width:0}.lby-me b{font-family:var(--f-disp);font-size:15px}
.lby-me small{display:block;color:var(--text3);font-size:12px;line-height:1.5}
.lby-mb{display:flex;flex-wrap:wrap;gap:6px;margin-top:6px}
.lby-tier{display:block;font-size:12px;font-weight:700;letter-spacing:.02em}
.lby-tier.t1{color:#9fb36a}.lby-tier.t2{color:#ff9a3c}.lby-tier.t3{color:#59e0d8}.lby-tier.t4{color:#c79bff}.lby-tier.t5{color:#ffd75e}
.lby-avt .lby-tier{display:inline}
.lby-bar{height:6px;border-radius:99px;background:rgba(255,255,255,.08);overflow:hidden;margin:6px 0 2px}
.lby-bar i{display:block;height:100%;border-radius:99px;background:linear-gradient(90deg,var(--accent),#ffd75e)}
.lby-dlg.lby-wide{max-width:640px}
.lby-avt{margin:14px 0 6px;font-size:13px}
.lby-avg{display:grid;grid-template-columns:repeat(auto-fill,minmax(112px,1fr));gap:8px}
.lby-avg button{display:flex;flex-direction:column;align-items:center;gap:6px;padding:10px 4px;border-radius:12px;border:1px solid var(--line2);background:rgba(255,255,255,.03);color:var(--text);font:600 12px var(--f-body);cursor:pointer}
.lby-avg button.on{border-color:var(--accent);background:rgba(255,122,26,.12)}
.lby-avg button:disabled{cursor:default;opacity:.45}
.lby-avg button:disabled .lby-av{filter:grayscale(1)}
.lby-avg small{color:var(--text3);font-weight:400}
.lby-achs{display:flex;flex-direction:column;gap:8px;margin-top:10px}
.lby-ach{display:flex;gap:10px;align-items:center;padding:8px 10px;border-radius:12px;border:1px solid var(--line);background:rgba(255,255,255,.02)}
.lby-ach>div{flex:1;min-width:0}.lby-ach b{font-size:14px}.lby-ach small{display:block;color:var(--text3);font-size:12px}
.lby-ach:not(.ok) .lby-bd{filter:grayscale(1);opacity:.5}
.lby-ach.ok{border-color:rgba(255,215,94,.35)}
.lby-ach .btn.on{border-color:var(--accent);color:var(--accent)}

/* 🧹 compact layout (2026-10-27): one-line head, columns share one height and scroll inside, one-line rows */
.lby-page{padding:16px 0 20px;--lh:clamp(440px,calc(100vh - 230px),660px)}
.lby-head{display:flex;align-items:baseline;gap:12px;margin-bottom:12px}
.lby-head .kicker{margin:0}
.lby-head h1{font-size:22px;margin:0}
.lby-grid{grid-template-columns:240px minmax(0,1fr) 230px;gap:12px;align-items:stretch;height:var(--lh)}
.lby-col{gap:12px;min-height:0}
.lby-box{padding:12px}
.lby-bh{margin-bottom:6px;font-size:14px}
.lby-fill{flex:1;min-height:0;display:flex;flex-direction:column}
.lby-scroll{flex:1;min-height:0;overflow-y:auto;margin:0 -4px;padding:0 4px;scrollbar-width:thin}
.lby-n{font-size:12px;color:var(--text3)}
.lby-empty{font-size:13px;margin:2px 0}
.lby-game,.lby-room,.lby-user{gap:8px;padding:7px 0;align-items:center}
.lby-game b,.lby-room b,.lby-user b{font-size:13px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;display:block}
.lby-game small,.lby-room small,.lby-user small{font-size:11px;line-height:1.4;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.lby-gi{width:28px;height:28px;border-radius:8px;font-size:15px;overflow:hidden;padding:1px}
.lby-gi-img{width:100%;height:100%;object-fit:contain;border-radius:6px;display:block}
.lby-gi-inline{display:inline-flex;vertical-align:middle;width:18px;height:18px;margin-right:4px;border-radius:4px;overflow:hidden}
.lby-gi-inline.sm{width:14px;height:14px;margin-right:2px}
.lby-gi-inline img{width:100%;height:100%;object-fit:contain;display:block}
.lby-get{flex:none;width:26px;height:26px;display:grid;place-items:center;border-radius:8px;border:1px solid var(--line2);color:var(--text2);text-decoration:none;font-size:13px}
.lby-get:hover{color:var(--accent);border-color:var(--accent)}
.lby-chatbox{height:100%}
.lby-tabs button{height:40px;font-size:13px}
.lby-msgs{padding:10px 12px;gap:4px}
.lby-msg{font-size:13px}
.lby-msgs>.lby-empty{margin:auto;text-align:center}
.lby-say{padding:8px}
.lby-say input{height:36px;font-size:14px}
.lby-guest{padding:10px 12px;font-size:13px}
.lby-legal{margin-top:10px;font-size:11px;opacity:.7}
.lby-av.md{width:50px;height:40px;border-width:2px;border-radius:7px}
.lby-me{gap:10px}
.lby-me b{font-size:14px;display:block;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.lby-me .lby-tier{font-size:11px}
.lby-me small{font-size:11px}
.lby-bds{margin:2px 0 0}
.lby-me .lby-bds .lby-bd:first-child{margin-left:0}
.lby-bar{height:4px;margin:10px 0 6px}
.lby-mf{display:flex;align-items:center;justify-content:space-between;gap:6px}
.lby-mf small{color:var(--text3);font-size:11px}
.lby-mf span{display:flex;gap:4px}
.lby-ib{height:26px;padding:0 8px;border-radius:8px;border:1px solid var(--line2);background:rgba(255,255,255,.03);color:var(--text);font:600 12px var(--f-body);cursor:pointer}
.lby-ib:hover{border-color:var(--accent)}
.lby-mb{margin-top:10px}
.lby-user .lby-av{width:35px;height:28px}
@media (max-width:1020px){.lby-grid{grid-template-columns:1fr 1fr;height:auto}.lby-mid{grid-column:1/-1;order:-1}.lby-chatbox{height:62vh}.lby-scroll{max-height:320px}}
@media (max-width:640px){.lby-grid{grid-template-columns:1fr}.lby-chatbox{height:52vh}}

/* 🟠 TS+FS match setup in the room panel */
.lby-ts{padding:8px 12px 10px;border-bottom:1px solid var(--line);display:flex;flex-direction:column;gap:7px;font-size:12px}
.lby-tsr{display:flex;flex-wrap:wrap;gap:6px 10px;align-items:center}
.lby-op{display:inline-flex;align-items:center;gap:5px;color:var(--text3)}
.lby-op select{height:26px;padding:0 6px;border-radius:7px;border:1px solid var(--line2);background:rgba(0,0,0,.35);color:var(--text);font:500 12px var(--f-body)}
.lby-map{flex:1;min-width:0}.lby-map select{flex:1;min-width:0;max-width:100%}
.lby-tg{display:inline-flex;align-items:center;gap:4px;color:var(--text2);cursor:pointer}
.lby-tg input{accent-color:var(--accent);margin:0}
.lby-cols{display:inline-flex;gap:4px;align-items:center}
.lby-sw{width:20px;height:20px;border-radius:6px;border:2px solid transparent;cursor:pointer;padding:0;color:var(--text2);font:700 11px var(--f-body);background:rgba(255,255,255,.06)}
.lby-sw.on{border-color:#fff;box-shadow:0 0 0 1px #000}
.lby-sw:disabled{opacity:.25;cursor:default}
.lby-whos{display:flex;flex-wrap:wrap;gap:4px 12px;color:var(--text3)}
.lby-who i{display:inline-block;width:8px;height:8px;border-radius:2px;margin-right:4px;border:1px solid var(--line2)}

/* ⬇ launcher setup button in the page head */
.lby-setup{margin-left:auto;align-self:center;display:inline-flex;align-items:center;height:30px;padding:0 12px;border-radius:8px;border:1px solid var(--accent);color:var(--accent);font:600 13px var(--f-body);text-decoration:none;white-space:nowrap}
.lby-setup:hover{background:var(--accent);color:#000}
@media (max-width:640px){.lby-head{flex-wrap:wrap}.lby-setup{margin-left:0}}
.lby-tsn{margin:0;color:var(--text2);font-size:12px;line-height:1.5}
.lby-bot{display:inline-flex;align-items:center;gap:3px;padding:2px 4px 2px 6px;border-radius:7px;border:1px solid var(--line2);color:var(--text2)}
.lby-bot select{height:22px;padding:0 3px;border-radius:5px;border:1px solid var(--line2);background:rgba(0,0,0,.35);color:var(--text);font:500 11px var(--f-body)}
.lby-setup.ok{border-color:#3fbf6a;color:#7be09a}
.lby-ln{margin:0 0 10px;padding:6px 10px;border-radius:8px;border:1px solid var(--line2);color:var(--text2);font-size:13px}
.lby-ln.ok{border-color:#3fbf6a;color:#7be09a}.lby-ln.warn{border-color:var(--accent);color:var(--accent)}
.lby-lnq{margin:10px 0;padding:10px 12px;border-radius:10px;background:rgba(255,255,255,.04);border:1px solid var(--line2)}
.lby-lnq p,.lby-lnq ol{margin:6px 0 0;font-size:13px}.lby-lnq ol{padding-left:18px}
.lby-lnb{justify-content:flex-start;flex-wrap:wrap}
.lby-lk{background:none;border:0;padding:0;color:var(--accent);text-decoration:underline;cursor:pointer;font:inherit}

/* 🕹️ Doom Arcade in Lobby */
.lby-arcade-window { position: fixed; bottom: 20px; right: 20px; width: 660px; max-width: calc(100vw - 32px); height: 500px; max-height: calc(100vh - 80px); background: #10121a; border: 1px solid #ff4d00; border-radius: 12px; box-shadow: 0 12px 50px rgba(0,0,0,0.85), 0 0 25px rgba(255,77,0,0.3); display: flex; flex-direction: column; z-index: 500; overflow: hidden; }
.lby-arcade-window[hidden] { display: none !important; }
.lby-arcade-window.minimized { width: 300px; height: 46px; cursor: pointer; border-color: #3b4252; box-shadow: 0 4px 20px rgba(0,0,0,0.6); }
.lby-arcade-window.minimized .lby-arcade-body { display: none; }
.lby-arcade-head { display: flex; align-items: center; justify-content: space-between; padding: 8px 12px; background: #181b26; border-bottom: 1px solid #282d3b; font-size: 13px; font-weight: 700; color: #fff; }
.lby-arcade-ctrls { display: flex; align-items: center; gap: 6px; }
.lby-arcade-ctrls button, .lby-arcade-ctrls a { border-radius: 6px; padding: 2px 8px; font-size: 11px; cursor: pointer; text-decoration: none; color: #ccc; background: #232733; border: 1px solid #3b4252; }
.lby-arcade-ctrls button:hover, .lby-arcade-ctrls a:hover { color: #fff; background: #2f3545; }
.lby-arcade-body { flex: 1; position: relative; background: #000; }
.lby-arcade-body iframe { width: 100%; height: 100%; border: none; display: block; }

/* 🎮 Play Button in Game List */
.lby-play-btn { flex: none; height: 26px; padding: 0 10px; border-radius: 6px; font-size: 12px; font-weight: 700; background: linear-gradient(135deg, #ff4d00, #d83a00); color: #fff; border: none; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; box-shadow: 0 2px 8px rgba(255, 77, 0, .35); transition: all .15s ease; }
.lby-play-btn:hover { background: linear-gradient(135deg, #ff621e, #e04509); transform: translateY(-1px); box-shadow: 0 4px 12px rgba(255, 77, 0, .5); }
.lby-game.lby-game-playable { background: rgba(255, 77, 0, .04); border-radius: 8px; padding: 7px 8px; margin: 2px 0; border: 1px solid rgba(255, 77, 0, .15); }

/* 🏠 Wide Modal & Game Preview in Create Room */
.lby-dlg.lby-dlg-wide { max-width: 520px; }
.lby-game-preview-card { display: flex; gap: 14px; align-items: center; background: rgba(255, 255, 255, .03); border: 1px solid var(--line2); border-radius: 12px; padding: 12px; margin-bottom: 14px; }
.lby-game-preview-logo { flex: none; width: 54px; height: 54px; border-radius: 10px; overflow: hidden; background: #000; border: 1px solid var(--line2); display: grid; place-items: center; }
.lby-game-preview-img { width: 100%; height: 100%; object-fit: contain; }
.lby-game-preview-info { flex: 1; min-width: 0; }
.lby-game-preview-info b { font-size: 15px; font-family: var(--f-disp); color: #fff; display: block; }
.lby-game-preview-sub { display: block; color: var(--accent); font-size: 12px; font-weight: 600; margin-top: 2px; }
.lby-game-preview-desc { margin: 4px 0 0; font-size: 11px; color: var(--text3); line-height: 1.4; }

/* ⚔ Mode Picker in Create Room */
.lby-mode-picker { margin-bottom: 14px; }
.lby-mode-title { font-size: 12px; color: var(--text2); margin-bottom: 8px; font-weight: 600; }
.lby-mode-options { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.lby-mode-opt { background: rgba(255, 255, 255, .03); border: 1px solid var(--line2); border-radius: 10px; padding: 10px 6px; display: flex; flex-direction: column; align-items: center; text-align: center; gap: 4px; cursor: pointer; color: var(--text); transition: all .15s ease; }
.lby-mode-opt:hover { border-color: rgba(255, 255, 255, .3); background: rgba(255, 255, 255, .06); }
.lby-mode-opt.on { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 15%, transparent); box-shadow: 0 0 14px color-mix(in srgb, var(--accent) 25%, transparent); }
.lby-mode-icon { font-size: 20px; line-height: 1; }
.lby-mode-name { font-size: 12px; font-weight: 700; color: #fff; }
.lby-mode-sub { font-size: 10px; color: var(--text3); line-height: 1.2; }
.lby-mode-opt.on .lby-mode-name { color: var(--accent); }

/* 🚀 Distinct Cockpit Panel ("ห้องของฉัน") */
.lby-room-cockpit { background: linear-gradient(180deg, rgba(255, 77, 0, .09) 0%, rgba(18, 20, 29, .75) 100%); border-bottom: 1px solid color-mix(in srgb, var(--accent) 30%, var(--line)); padding: 14px 16px; display: flex; flex-direction: column; gap: 12px; }
.lby-cockpit-header { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; flex-wrap: wrap; }
.lby-cockpit-game { display: flex; gap: 12px; align-items: center; flex: 1; min-width: 0; }
.lby-cockpit-logo { width: 44px; height: 44px; border-radius: 10px; overflow: hidden; border: 1px solid var(--line2); background: #000; display: grid; place-items: center; flex: none; }
.lby-cockpit-img { width: 100%; height: 100%; object-fit: contain; }
.lby-cockpit-title-row { display: flex; align-items: center; gap: 8px; }
.lby-cockpit-title-row h3 { margin: 0; font-size: 16px; color: #fff; font-family: var(--f-disp); }
.lby-cockpit-meta { font-size: 12px; color: var(--text3); margin-top: 3px; }
.lby-cockpit-gname { color: var(--text); font-weight: 600; }
.lby-cockpit-code { cursor: pointer; color: var(--accent); font-weight: 600; padding: 1px 4px; border-radius: 4px; background: rgba(255, 77, 0, .08); }
.lby-cockpit-code:hover { background: rgba(255, 77, 0, .18); text-decoration: underline; }
.lby-room-mode-chip { font-size: 11px; font-weight: 700; padding: 3px 9px; border-radius: 6px; }
.lby-room-mode-chip.solo { background: rgba(59, 130, 246, .18); color: #60a5fa; border: 1px solid rgba(59, 130, 246, .35); }
.lby-room-mode-chip.coop { background: rgba(34, 197, 94, .18); color: #4ade80; border: 1px solid rgba(34, 197, 94, .35); }
.lby-room-mode-chip.dm { background: rgba(239, 68, 68, .18); color: #f87171; border: 1px solid rgba(239, 68, 68, .35); }

.lby-cockpit-roster { display: flex; flex-direction: column; gap: 8px; margin: 4px 0 8px 0; }
.lby-cockpit-roster-title { font-size: 11px; text-transform: uppercase; letter-spacing: .05em; color: var(--text3); font-weight: 700; display: flex; align-items: center; justify-content: space-between; }
.lby-cockpit-members { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 10px; }

.lby-room-member-card {
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(15, 18, 25, .7);
  border: 1px solid rgba(255, 255, 255, .08);
  border-radius: 10px;
  padding: 8px 12px;
  font-size: 12px;
  position: relative;
  min-height: 58px;
  box-sizing: border-box;
  transition: all .2s ease;
}

.lby-room-member-card.is-host {
  border-color: rgba(255, 77, 0, .45);
  background: linear-gradient(135deg, rgba(255, 77, 0, .14), rgba(15, 18, 25, .85));
  box-shadow: 0 2px 10px rgba(255, 77, 0, .12);
}

.lby-room-member-card.lby-slot-bot {
  border-color: rgba(59, 130, 246, .35);
  background: linear-gradient(135deg, rgba(59, 130, 246, .1), rgba(15, 18, 25, .85));
  box-shadow: 0 2px 10px rgba(59, 130, 246, .1);
}

.lby-room-member-card.lby-slot-empty {
  border: 1px dashed rgba(255, 255, 255, .14);
  background: rgba(0, 0, 0, .22);
}

.lby-room-member-card.lby-slot-empty:hover {
  border-color: rgba(255, 77, 0, .35);
  background: rgba(255, 77, 0, .03);
}

.lby-slot-badge {
  font-size: 9px;
  font-weight: 800;
  color: var(--text3);
  background: rgba(255, 255, 255, .05);
  border: 1px solid rgba(255, 255, 255, .08);
  padding: 2px 5px;
  border-radius: 4px;
  flex-shrink: 0;
}

.lby-slot-human .lby-slot-badge { color: #f97316; border-color: rgba(249, 115, 22, .3); }
.lby-slot-bot .lby-slot-badge { color: #60a5fa; border-color: rgba(96, 165, 250, .3); }

.lby-bot-cam {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  background: rgba(59, 130, 246, .15);
  border: 1px solid rgba(59, 130, 246, .35);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
  box-shadow: 0 0 8px rgba(59, 130, 246, .2);
}

.lby-empty-cam {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  background: rgba(255, 255, 255, .03);
  border: 1px dashed rgba(255, 255, 255, .15);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  color: rgba(255, 255, 255, .25);
  flex-shrink: 0;
}

.lby-rmc-info { flex: 1; min-width: 0; }
.lby-rmc-info b { color: #fff; display: block; line-height: 1.2; font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lby-rmc-info small { color: var(--text3); font-size: 10px; display: block; margin-top: 2px; }

.lby-empty-title { color: var(--text3) !important; font-weight: 500 !important; font-size: 11px !important; }

.lby-slot-add-box { display: flex; align-items: center; gap: 4px; margin-top: 4px; flex-wrap: wrap; }
.lby-btn-addbot {
  background: rgba(255, 77, 0, .14) !important;
  color: #ff8533 !important;
  border: 1px solid rgba(255, 77, 0, .38) !important;
  padding: 2px 7px !important;
  font-size: 10.5px !important;
  border-radius: 5px !important;
  cursor: pointer;
  line-height: 1.4 !important;
  font-weight: 600 !important;
  transition: all .15s ease;
}
.lby-btn-addbot:hover {
  background: rgba(255, 77, 0, .28) !important;
  color: #fff !important;
  border-color: rgba(255, 77, 0, .6) !important;
}

.lby-bot-quick-pick { display: inline-flex; gap: 2px; }
.lby-btn-lv {
  font-size: 9px;
  padding: 2px 4px;
  background: rgba(255, 255, 255, .06);
  border: 1px solid rgba(255, 255, 255, .1);
  border-radius: 3px;
  cursor: pointer;
  color: var(--text3);
  transition: all .15s ease;
}
.lby-btn-lv.green:hover { background: rgba(34, 197, 94, .25); color: #4ade80; border-color: rgba(34, 197, 94, .5); }
.lby-btn-lv.yellow:hover { background: rgba(234, 179, 8, .25); color: #facc15; border-color: rgba(234, 179, 8, .5); }
.lby-btn-lv.red:hover { background: rgba(239, 68, 68, .25); color: #f87171; border-color: rgba(239, 68, 68, .5); }

.lby-bot-sel-row { margin-top: 3px; }
.lby-bot-lv {
  background: rgba(0, 0, 0, .55);
  border: 1px solid rgba(59, 130, 246, .4);
  color: #93c5fd;
  border-radius: 4px;
  font-size: 10.5px;
  padding: 2px 4px;
  cursor: pointer;
  outline: none;
}
.lby-bot-lv:focus { border-color: #60a5fa; }

.lby-bot-x { color: rgba(255, 255, 255, .4) !important; font-size: 15px; margin-left: 4px; flex-shrink: 0; }
.lby-bot-x:hover { color: #f87171 !important; }

.lby-cockpit-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding-top: 4px; }
.lby-btn-launch { background: linear-gradient(135deg, #ff4d00, #d83a00) !important; color: #fff !important; border: none !important; box-shadow: 0 2px 10px rgba(255, 77, 0, .45) !important; font-weight: 700 !important; }
.lby-cockpit-wait { font-size: 12px; color: #94a3b8; padding: 4px 10px; background: rgba(255, 255, 255, .05); border-radius: 6px; border: 1px solid var(--line); }
.lby-btn-leave { color: #f87171 !important; background: rgba(239, 68, 68, .12) !important; border: 1px solid rgba(239, 68, 68, .3) !important; border-radius: 6px !important; }
.lby-btn-leave:hover { background: rgba(239, 68, 68, .28) !important; color: #fff !important; }

/* 💬 Room Chat Distinct Tint & Banner */
.in-room-tab .lby-say { background: rgba(255, 77, 0, .04); border-top: 1px solid color-mix(in srgb, var(--accent) 30%, var(--line)); }
.in-room-tab .lby-say input { border-color: color-mix(in srgb, var(--accent) 40%, var(--line2)); background: rgba(20, 10, 5, .6); }
.lby-room-chat-banner { background: linear-gradient(90deg, rgba(255, 77, 0, .18), rgba(255, 77, 0, .03)); border-bottom: 1px solid color-mix(in srgb, var(--accent) 35%, transparent); padding: 7px 14px; font-size: 12px; color: var(--accent); display: flex; align-items: center; justify-content: space-between; margin: -10px -12px 6px -12px; position: sticky; top: -10px; z-index: 2; }
.lby-room-banner-sub { font-size: 11px; color: var(--text3); font-weight: normal; }
.lby-tab-code { font-size: 10px; background: var(--accent); color: #000; padding: 1px 5px; border-radius: 4px; font-weight: 800; margin-left: 4px; }

/* 📨 Invite Dialog */
.lby-inv-dlg { max-width: 420px; background: #161922; border: 1px solid #3b4252; border-radius: 16px; box-shadow: 0 20px 60px rgba(0, 0, 0, .85), 0 0 35px rgba(255, 77, 0, .25); padding: 20px; }
.lby-inv-header h3 { margin: 0; font-size: 18px; color: #fff; }
.lby-inv-card { display: flex; gap: 14px; background: rgba(0, 0, 0, .45); border: 1px solid var(--line2); border-radius: 12px; padding: 14px; margin: 14px 0; align-items: center; }
.lby-inv-logo { width: 54px; height: 54px; border-radius: 10px; overflow: hidden; background: #000; border: 1px solid var(--line2); display: grid; place-items: center; flex: none; }
.lby-inv-img { width: 100%; height: 100%; object-fit: contain; }
.lby-inv-info { flex: 1; min-width: 0; }
.lby-inv-info h4 { margin: 0; font-size: 16px; color: #fff; font-family: var(--f-disp); }
.lby-inv-sender { margin: 4px 0 2px; font-size: 13px; color: var(--text); }
.lby-inv-roomtitle { font-size: 12px; color: var(--text3); margin-bottom: 6px; }
.lby-inv-badges { display: flex; flex-wrap: wrap; gap: 6px; }

/* 🎮 In-Game Tab Viewport & Pinned Chat Controls */
.lby-gamepanel { display: flex; flex-direction: column; background: #000; height: 440px; min-height: 360px; flex: none; }
.lby-grid.is-game-view { height: auto; min-height: var(--lh); }
.lby-chatbox.is-game-view { height: auto; min-height: var(--lh); overflow: visible !important; display: flex; flex-direction: column; }
.lby-chatbox.is-game-view .lby-gamepanel { height: 440px; min-height: 360px; flex: none; }
.lby-chatbox.is-game-view .lby-msgs { min-height: 110px; max-height: 160px; flex: none; overflow-y: auto; }
.lby-chatbox.is-game-view .lby-say {
  position: sticky;
  bottom: 0;
  background: #141722;
  border-top: 2px solid var(--accent);
  z-index: 30;
  box-shadow: 0 -6px 20px rgba(0, 0, 0, 0.85);
  flex-shrink: 0;
  padding: 10px 12px;
  display: flex !important;
}
.lby-chatbox.is-game-view .lby-say input {
  background: rgba(0, 0, 0, 0.75);
  border: 1px solid var(--accent);
  color: #fff;
  height: 38px;
  padding: 0 12px;
  font-size: 14px;
}
.lby-chatbox.is-game-view .lby-say button {
  height: 38px;
  padding: 0 18px;
  background: linear-gradient(135deg, #ff4d00, #d83a00);
  color: #fff;
  border: none;
  border-radius: 8px;
  font-weight: 700;
  font-size: 13px;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(255, 77, 0, 0.4);
}
.lby-chatbox.is-game-view .lby-say button:hover {
  background: linear-gradient(135deg, #ff621e, #ea4206);
}



/* 🖥 bigger game view (2026-10-27): game spans the rooms/games column, height follows the window */
.lby-grid.is-game-view { grid-template-columns: minmax(0, 1fr) 230px; }
.lby-grid.is-game-view > .lby-left { display: none; }
.lby-chatbox.is-game-view .lby-gamepanel { height: clamp(480px, calc(100vh - 260px), 860px); min-height: 0; }
@media (max-width: 1020px) { .lby-grid.is-game-view { grid-template-columns: 1fr; } .lby-chatbox.is-game-view .lby-gamepanel { height: min(78vh, calc(100vw * 0.85)); } }
