/* ECNChat Theme U2G — Webchat Username and Topic Contrast Repair */

/* Public room sender names */
body.chatActive #chatMessages :is(
  .username,.userName,.user,.sender,.senderName,.messageUser,.messageUsername,
  .messageSender,.chatUser,.chatUsername,.nick,.nickname,
  [class*="username" i],[class*="sender" i],[class*="message-user" i]
) {
  color: #063f78 !important;
  -webkit-text-fill-color: #063f78 !important;
  opacity: 1 !important;
  text-shadow: none !important;
}

/* Common transcript rows */
body.chatActive #chatMessages :is(
  .message,.chatMessage,.messageRow,.chatLine,.line,
  [class*="message-row" i],[class*="chat-line" i]
) > :first-child:not(img):not(.roleIcon) {
  color: #063f78 !important;
  -webkit-text-fill-color: #063f78 !important;
  opacity: 1 !important;
  text-shadow: none !important;
}

/* PM / whisper sender names */
body.chatActive #chatMessages :is(
  .pm,.privateMessage,.whisper,.directMessage,
  [class*="private" i],[class*="whisper" i],[class*="direct-message" i]
) :is(.username,.userName,.sender,.senderName,.nick,.nickname,strong,b) {
  color: #6b228f !important;
  -webkit-text-fill-color: #6b228f !important;
  opacity: 1 !important;
  text-shadow: none !important;
}

/* Room topic text */
body.chatActive :is(
  #topic,#topicText,#roomTopic,#roomTopicText,#chatTopic,#chatTopicText,
  #topicHeader,#roomTopicHeader,#chatTopicHeader,
  .topic,.topicText,.roomTopic,.roomTopicText,.topicHeader,.roomTopicHeader,
  [class*="topic-text" i],[class*="topicText"],[class*="room-topic" i]
) {
  color: #123c64 !important;
  -webkit-text-fill-color: #123c64 !important;
  opacity: 1 !important;
  text-shadow: none !important;
}

/* Bottom status strip */
body.chatActive :is(
  #chatStatus,#statusBar,#connectionStatus,#chatConnectionStatus,
  #nickStatus,#roomStatus,#userCount,#chatSafetyStrip,
  .chatStatus,.statusBar,.connectionStatus,.roomStatus,
  [class*="status-bar" i],[class*="chat-status" i]
),
body.chatActive :is(
  #chatStatus,#statusBar,#connectionStatus,#chatConnectionStatus,
  #nickStatus,#roomStatus,#userCount,#chatSafetyStrip,
  .chatStatus,.statusBar,.connectionStatus,.roomStatus,
  [class*="status-bar" i],[class*="chat-status" i]
) * {
  color: #31597c !important;
  -webkit-text-fill-color: #31597c !important;
  opacity: 1 !important;
  text-shadow: none !important;
}

body.chatActive :is(
  #chatStatus,#statusBar,#connectionStatus,#chatConnectionStatus,
  .chatStatus,.statusBar,.connectionStatus
) :is(.connected,.online,.statusConnected) {
  color: #16863b !important;
  -webkit-text-fill-color: #16863b !important;
}

body.chatActive #chatSafetyStrip a,
body.chatActive #chatSafetyStrip button,
body.chatActive :is(#chatStatus,#statusBar) .reportAbuse {
  color: #c40000 !important;
  -webkit-text-fill-color: #c40000 !important;
}

/* Right nicklist */
body.chatActive :is(
  #userList,#users,#nickList,#roomUsers,
  .userList,.nickList,[class*="user-list" i],[class*="nick-list" i]
) :is(.username,.userName,.user,.nick,.nickname,span,a,button) {
  color: #063f78;
  -webkit-text-fill-color: #063f78;
  opacity: 1;
}

/* Preserve intentionally colored lines */
body.chatActive #chatMessages :is(
  .system,.systemMessage,.welcome,.welcomeMessage,.action,.join,.part,
  .notice,.error,[class*="system" i],[class*="welcome" i]
) {
  -webkit-text-fill-color: currentColor !important;
  opacity: 1 !important;
}
