/* ===== Realtime / live lobby UI ===== */
.net-status{
  font-size:12px; font-weight:700; padding:6px 10px; border-radius:10px;
  margin:6px 0 2px; display:inline-block; letter-spacing:.2px;
}
.net-status.online{ background:rgba(61,220,132,.16); color:#3ddc84; }
.net-status.connecting{ background:rgba(255,194,75,.16); color:#ffc24b; }
.net-status.demo{ background:rgba(255,255,255,.07); color:#9aa3b8; }

.friend .you-badge,
.friend .host-badge{
  font-size:10px; font-weight:800; padding:2px 6px; border-radius:6px;
  margin-left:6px; vertical-align:middle;
}
.friend .you-badge{ background:rgba(124,92,255,.22); color:#b9a6ff; }
.friend .host-badge{ background:rgba(255,194,75,.2); color:#ffc24b; }

.join-divider{
  display:flex; align-items:center; gap:10px; margin:18px 0 12px;
  color:#7c869c; font-size:12px; font-weight:600;
}
.join-divider::before, .join-divider::after{
  content:""; flex:1; height:1px; background:rgba(255,255,255,.12);
}
.join-row{ display:flex; gap:8px; }
.join-row input{
  flex:1; padding:11px 13px; border-radius:11px; color:#fff; font:inherit;
  border:1px solid rgba(255,255,255,.16); background:rgba(255,255,255,.05);
}
.join-row input:focus{ outline:none; border-color:#7c5cff; }
.spectating-note{
  margin-top:8px; font-size:12px; color:#ffc24b; font-weight:600;
}

/* ===== Typing indicator ===== */
.typing-row{
  height:0; overflow:hidden; opacity:0; font-size:12px; color:#9aa3b8;
  font-style:italic; padding:0 4px; transition:opacity .15s ease;
}
.typing-row.show{ height:auto; padding:2px 4px 4px; opacity:1; }

/* ===== Unread badge ===== */
.unread{
  display:none; min-width:16px; height:16px; line-height:16px; padding:0 4px;
  border-radius:9px; background:#ff4d8d; color:#fff; font-size:10px;
  font-weight:800; margin-left:4px; vertical-align:middle; text-align:center;
}
.unread.show{ display:inline-block; }
.icon-btn{ min-width:34px; }

/* ===== History messages ===== */
.msg.history{ opacity:.6; }

/* ===== Profile editor ===== */
.profile-name{
  width:100%; padding:11px 13px; border-radius:11px; color:#fff; font:inherit;
  border:1px solid rgba(255,255,255,.16); background:rgba(255,255,255,.05);
  margin-bottom:4px; box-sizing:border-box;
}
.profile-name:focus{ outline:none; border-color:#7c5cff; }
.picker-label{ font-size:12px; font-weight:700; color:#7c869c; margin:12px 0 6px; }
.av-grid{ display:grid; grid-template-columns:repeat(10,1fr); gap:6px; }
.av-opt{
  font-size:18px; padding:6px 0; border-radius:9px; cursor:pointer;
  border:1px solid rgba(255,255,255,.1); background:rgba(255,255,255,.04); color:#fff;
}
.av-opt:hover{ background:rgba(255,255,255,.09); }
.av-opt.on{ border-color:#7c5cff; background:rgba(124,92,255,.22); }
.col-grid{ display:flex; gap:8px; flex-wrap:wrap; }
.col-opt{ width:30px; height:30px; border-radius:50%; border:2px solid transparent; cursor:pointer; }
.col-opt.on{ border-color:#fff; box-shadow:0 0 0 2px rgba(255,255,255,.25); }

/* ===== Message actions / reactions / replies ===== */
.msg{ position:relative; }
.msg-actions{
  position:absolute; top:-10px; right:6px; display:none; gap:2px;
  background:rgba(20,22,38,.96); border:1px solid rgba(255,255,255,.12);
  border-radius:9px; padding:2px; box-shadow:0 4px 14px rgba(0,0,0,.4); z-index:4;
}
.msg:hover .msg-actions{ display:flex; }
.msg-actions button{
  background:none; border:none; cursor:pointer; font-size:13px; padding:3px 5px;
  border-radius:6px; color:#cdd3e3; line-height:1;
}
.msg-actions button:hover{ background:rgba(255,255,255,.12); }
.msg.deleted{ opacity:.5; font-size:12px; font-style:italic; }
.msg .edited{ font-size:10px; color:#7c869c; }
.msg.mention-me{
  background:rgba(124,92,255,.14); border-left:3px solid #7c5cff;
  padding-left:7px; border-radius:8px;
}
.reply-quote{
  border-left:3px solid rgba(255,255,255,.25); padding:2px 8px; margin:2px 0 4px;
  font-size:11px; color:#9aa3b8; background:rgba(255,255,255,.04); border-radius:6px;
}
.reply-quote b{ color:#b9a6ff; }
.reacts{ display:flex; gap:4px; flex-wrap:wrap; margin-top:4px; }
.rc{
  font-size:11px; padding:1px 7px; border-radius:11px; cursor:pointer;
  border:1px solid rgba(255,255,255,.14); background:rgba(255,255,255,.05); color:#cdd3e3;
}
.rc.on{ border-color:#7c5cff; background:rgba(124,92,255,.22); color:#fff; }
.msg a{ color:#7cc4ff; text-decoration:underline; word-break:break-all; }
.mention{ color:#b9a6ff; font-weight:700; }
.media{ margin-top:5px; }
.media img, .media iframe{ max-width:100%; max-height:200px; border-radius:9px; display:block; border:0; }

/* ===== Reaction popover ===== */
.react-pop{
  position:absolute; display:none; gap:2px; z-index:90;
  background:rgba(20,22,38,.97); border:1px solid rgba(255,255,255,.14);
  border-radius:12px; padding:4px; box-shadow:0 8px 22px rgba(0,0,0,.5);
}
.react-pop.show{ display:flex; }
.react-pop button{ background:none; border:none; font-size:17px; cursor:pointer; padding:3px 5px; border-radius:7px; }
.react-pop button:hover{ background:rgba(255,255,255,.12); }

/* ===== Composer hint (reply / edit) ===== */
.composer-hint{
  display:none; align-items:center; gap:8px; font-size:12px; color:#9aa3b8;
  padding:6px 9px; margin:0 0 6px; border-radius:9px;
  background:rgba(124,92,255,.12); border:1px solid rgba(124,92,255,.25);
}
.composer-hint.show{ display:flex; }
.composer-hint b{ color:#cdd3e3; }
.composer-hint button{ margin-left:auto; background:none; border:none; color:#9aa3b8; cursor:pointer; font-size:13px; }
.gif-btn{ font-weight:800; letter-spacing:.5px; }

/* ===== Friend host controls ===== */
.friend{ position:relative; }
.f-main{ flex:1; min-width:0; }
.host-ctrl{ display:flex; gap:2px; margin-left:auto; }
.host-ctrl button{
  background:rgba(255,255,255,.06); border:1px solid rgba(255,255,255,.12);
  border-radius:7px; cursor:pointer; font-size:12px; padding:3px 5px;
}
.host-ctrl button:hover{ background:rgba(255,255,255,.14); }

/* ===== GIF picker ===== */
.gif-results{
  display:grid; grid-template-columns:repeat(3,1fr); gap:6px;
  max-height:300px; overflow-y:auto; margin:12px 0;
}
.gif-pick{ width:100%; height:90px; object-fit:cover; border-radius:9px; cursor:pointer; border:2px solid transparent; }
.gif-pick:hover{ border-color:#7c5cff; }
.gif-hint{ grid-column:1/-1; color:#9aa3b8; font-size:13px; text-align:center; padding:18px 0; }

/* ===== Mobile slide-over drawer ===== */
.drawer-close{
  display:none; position:absolute; top:10px; right:10px; z-index:5;
  background:rgba(255,255,255,.08); border:1px solid rgba(255,255,255,.14);
  color:#fff; border-radius:8px; cursor:pointer; font-size:14px; padding:4px 9px;
}
@media (max-width:760px){
  .friends{
    position:fixed; top:0; right:0; height:100%; width:88%; max-width:360px;
    z-index:80; transition:transform .25s ease; box-shadow:-12px 0 40px rgba(0,0,0,.5);
  }
  .friends.collapsed{ transform:translateX(105%); }
  .friends:not(.collapsed){ transform:translateX(0); }
  .drawer-close{ display:block; }
}
