/* VW_WATCH_TOGETHER_CHAT_REPLY_REACTIONS_V3_7 */
/* VW_WATCH_TOGETHER_CHAT_LONGPRESS_NO_SELECTION_V3_7R2 */

/* Long-press must coexist with normal vertical chat scrolling. */
#chatMessages .msg[data-message-id]{
  touch-action:pan-y;
  -webkit-user-select:none!important;
  user-select:none!important;
  -webkit-touch-callout:none!important;
}

/*
 * A rendered message is one chat object during long-press. Native Android
 * word-selection handles/callouts must never compete with Reply/Reaction.
 * This is deliberately scoped to messages only; #chatInput remains selectable.
 */
#chatMessages .msg[data-message-id] *,
#chatMessages .msg[data-message-id]::before,
#chatMessages .msg[data-message-id]::after{
  -webkit-user-select:none!important;
  user-select:none!important;
  -webkit-touch-callout:none!important;
}

/* Reply quote lives inside the SAME message bubble/div. */
#chatMessages .msg .chat-reply-quote{
  box-sizing:border-box;
  display:grid;
  grid-template-columns:3px minmax(0,1fr) auto;
  align-items:center;
  gap:7px;
  width:100%;
  min-width:0;
  margin:1px 0 7px;
  padding:6px 7px 6px 0;
  overflow:hidden;
  border:1px solid rgba(155,135,230,.12);
  border-radius:9px;
  background:rgba(118,91,205,.075);
}

#chatMessages .msg .chat-reply-quote-accent{
  align-self:stretch;
  width:3px;
  min-height:28px;
  border-radius:0 3px 3px 0;
  background:rgba(157,126,255,.82);
}

#chatMessages .msg .chat-reply-quote-copy{
  display:flex;
  flex-direction:column;
  justify-content:center;
  gap:2px;
  min-width:0;
}

#chatMessages .msg .chat-reply-quote-name{
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
  color:#c9bcff;
  font-size:9.5px;
  font-weight:850;
  line-height:1.15;
}

#chatMessages .msg .chat-reply-quote-excerpt{
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
  color:#a3adbb;
  font-size:10px;
  line-height:1.2;
}

#chatMessages .msg .chat-reply-quote-thumb{
  display:block;
  width:34px;
  height:34px;
  margin-right:0;
  border-radius:7px;
  object-fit:cover;
  background:#05070a;
}

#chatMessages .msg .chat-reply-quote-thumb[hidden]{
  display:none!important;
}

/* Reaction chips are compact and remain inside the message bubble. */
#chatMessages .msg .chat-reaction-row{
  display:flex;
  flex-wrap:wrap;
  align-items:center;
  gap:4px;
  width:100%;
  margin:6px 0 0;
  padding:0;
}

#chatMessages .msg .chat-reaction-chip{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:3px;
  min-width:30px;
  height:24px;
  margin:0;
  padding:0 7px;
  border:1px solid rgba(255,255,255,.08);
  border-radius:999px;
  background:rgba(255,255,255,.045);
  color:#cbd2dd;
  font:700 9px/1 system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;
  cursor:pointer;
  -webkit-tap-highlight-color:transparent;
}

#chatMessages .msg .chat-reaction-chip.is-own{
  border-color:rgba(142,111,255,.52);
  background:rgba(125,88,255,.16);
  color:#e5deff;
}

#chatMessages .msg .chat-reaction-chip-emoji{
  font-size:13px;
  line-height:1;
}

#chatMessages .msg .chat-reaction-chip-count{
  min-width:7px;
  text-align:center;
}

/* Long-press / right-click action popover. */
.chat-interaction-popover[hidden]{display:none!important}

.chat-interaction-popover{
  box-sizing:border-box;
  position:fixed;
  z-index:2147483600;
  display:flex;
  align-items:center;
  gap:4px;
  max-width:calc(100vw - 14px);
  min-height:42px;
  padding:4px;
  border:1px solid rgba(255,255,255,.09);
  border-radius:15px;
  background:rgba(11,15,22,.985);
  box-shadow:0 12px 34px rgba(0,0,0,.44);
  opacity:0;
  transform:translateY(3px) scale(.985);
  transition:opacity .1s ease,transform .1s ease;
  -webkit-tap-highlight-color:transparent;
}

.chat-interaction-popover.open{
  opacity:1;
  transform:translateY(0) scale(1);
}

.chat-interaction-emoji-list{
  display:flex;
  align-items:center;
  gap:1px;
}

.chat-interaction-emoji,
.chat-interaction-reply,
.chat-interaction-more,
.chat-interaction-more-back,
.chat-interaction-copy{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  height:34px;
  margin:0;
  border:0;
  border-radius:10px;
  background:transparent;
  color:#e9edf4;
  cursor:pointer;
  -webkit-tap-highlight-color:transparent;
}

.chat-interaction-emoji{
  width:34px;
  min-width:34px;
  padding:0;
  font-size:19px;
  line-height:1;
}

.chat-interaction-emoji:active,
.chat-interaction-reply:active,
.chat-interaction-more:active,
.chat-interaction-more-back:active,
.chat-interaction-copy:active{
  background:rgba(255,255,255,.075);
}

.chat-interaction-reply{
  gap:4px;
  min-width:58px;
  padding:0 8px;
  border-left:1px solid rgba(255,255,255,.075);
  border-radius:0 10px 10px 0;
  color:#c8cff0;
  font-size:10px;
}

.chat-interaction-reply>span{
  font-size:16px;
  line-height:1;
}

.chat-interaction-reply>b{
  font:800 10px/1 system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;
}


.chat-interaction-more{
  width:32px;
  min-width:32px;
  padding:0;
  border-left:1px solid rgba(255,255,255,.075);
  border-radius:0 10px 10px 0;
  color:#bfc7d5;
  font-size:20px;
  font-weight:800;
  line-height:1;
}

.chat-interaction-more-panel[hidden]{display:none!important}

.chat-interaction-more-panel{
  display:flex;
  align-items:center;
  gap:3px;
  min-height:34px;
}

.chat-interaction-popover.more-open .chat-interaction-emoji-list,
.chat-interaction-popover.more-open .chat-interaction-reply,
.chat-interaction-popover.more-open .chat-interaction-more{
  display:none!important;
}

.chat-interaction-more-back{
  width:34px;
  min-width:34px;
  padding:0;
  color:#b9c2d0;
  font-size:17px;
}

.chat-interaction-copy{
  gap:5px;
  min-width:68px;
  padding:0 10px;
  color:#e1e6ed;
  font-size:10px;
}

.chat-interaction-copy>span{
  font-size:14px;
  line-height:1;
}

.chat-interaction-copy>b{
  font:800 10px/1 system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;
}

.chat-interaction-copy:disabled{
  opacity:.38;
  cursor:default;
}

/*
 * Reply composer preview is a BODY overlay, not a new row inside #chatForm.
 * R4 keyboard/player geometry therefore remains byte-for-byte untouched.
 */
.chat-pending-reply[hidden]{display:none!important}

.chat-pending-reply{
  box-sizing:border-box;
  position:fixed;
  z-index:2147482990;
  display:grid;
  grid-template-columns:3px minmax(0,1fr) auto 30px;
  align-items:center;
  gap:7px;
  min-height:48px;
  max-height:58px;
  padding:5px 5px 5px 0;
  overflow:hidden;
  border:1px solid rgba(143,113,255,.22);
  border-radius:11px;
  background:rgba(8,12,18,.985);
  box-shadow:0 -8px 24px rgba(0,0,0,.28);
}

.chat-pending-reply-accent{
  align-self:stretch;
  width:3px;
  border-radius:0 3px 3px 0;
  background:rgba(154,121,255,.9);
}

.chat-pending-reply-body{
  display:flex;
  flex-direction:column;
  justify-content:center;
  gap:3px;
  min-width:0;
}

.chat-pending-reply-name{
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
  color:#cbbdff;
  font-size:9.5px;
  font-weight:850;
  line-height:1.1;
}

.chat-pending-reply-text{
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
  color:#a7b0be;
  font-size:10px;
  line-height:1.2;
}

.chat-pending-reply-thumb{
  width:36px;
  height:36px;
  border-radius:7px;
  object-fit:cover;
  background:#05070a;
}

.chat-pending-reply-thumb[hidden]{display:none!important}

.chat-pending-reply-close{
  display:grid;
  place-items:center;
  width:28px;
  min-width:28px;
  height:28px;
  margin:0;
  padding:0;
  border:0;
  border-radius:50%;
  background:rgba(255,255,255,.055);
  color:#98a2b1;
  font-size:19px;
  line-height:1;
  cursor:pointer;
  -webkit-tap-highlight-color:transparent;
}

@media(max-width:380px){
  .chat-interaction-popover{
    gap:2px;
    padding:3px;
  }

  .chat-interaction-emoji{
    width:31px;
    min-width:31px;
    height:33px;
    font-size:18px;
  }

  .chat-interaction-reply{
    min-width:53px;
    padding:0 6px;
  }

  .chat-interaction-more{
    width:30px;
    min-width:30px;
  }

  .chat-pending-reply{
    grid-template-columns:3px minmax(0,1fr) auto 28px;
  }
}
