/* chat color variables (dark theme) — scoped to chat elements */
.modal_okno_chat,
.chat_open,
.chat_background,
.chat_menu_smile {
    --card-color: #15161e;
    --bg-color: #0c0d12;
    --span-color: #29a3ab;
    --news: rgba(0, 0, 0, 0.7);
    --default-text-color: #ffffff;
    --custom-text-color: #9aa0c2;
    --button-color: #0c0d12;
    --link-second-navbar-color: #ffffff;
}

.chat_open span {
    position: absolute;
    top: -10px;
    right: -10px;
    font-weight: 700;
    width: 25px;
    height: 25px;
    display: flex;
    border-radius: 50%;
    color: var(--span-color);
    border: solid 2px var(--span-color);
    font-size: 12px;
    background-color: var(--bg-color);
    justify-content: center;
    align-items: center;
}
.chat_peoples {
    display: flex;
    gap: 5px;
    height: 25px;
    flex-wrap: wrap;
    margin-bottom: 15px;
}
.chat_peoples .ava {
    cursor: pointer;
    width: 25px;
    height: 25px;
    border-radius: 6px;
    opacity: .6;
    transition: .5s;
    object-fit: cover;
}
.chat_peoples .ava:hover {
    opacity: 1;
}
.block-chat-back {
    background-color: var(--card-color);
    padding: 0px 15px 15px 15px;
    border-radius: 6px;
    height: max-content;
    position: relative;
}
.chat_footer_send {
    display: flex;
    background-color: var(--bg-color);
    padding: 10px;
    gap: 10px;
    border-radius: 6px;
    position: relative;
    align-items: center;
}
.chat_footer_send > form {
    width: 100%;
}
.chat_smile_btn {
    cursor: pointer;
    position: absolute;
    display: flex;
    right: 80px;
    height: 40px;
    transition: .5s;
    align-items: center;
    user-select: none;
}
.chat_smile_btn svg {
    fill: var(--custom-text-color);
    transition: .5s;
    width: 20px;
    height: 20px;
    user-select: none;
    z-index: 1;
}
.chat_smile_btn:hover svg {
    fill: var(--span-color);
}
.chat_menu_smile {
    opacity: 0;
    pointer-events: none;
    bottom: 0px;
    right: 10px;
    display: flex;
    position: absolute;
    width: 290px;
    flex-wrap: wrap;
    border-radius: 6px;
    padding: 10px;
    user-select: none;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.5);
    background-color: var(--card-color);
    transition: opacity 0.3s, bottom 0.3s;
}
.chat_menu_smile.active {
    opacity: 1;
    pointer-events: auto;
    bottom: 62px;
}
.chat_menu_smile .smiley_js {
    cursor: pointer;
    width: 30px;
    height: 30px;
    font-size: 20px;
    opacity: .5;
    transition: .5s;
    display: flex;
    justify-content: center;
    align-items: center;
}
.chat_menu_smile .smiley_js:hover {
    opacity: 1;
}
.block-chat-my {
    display: flex;
    gap: 15px;
    background-color: var(--card-color);
    margin-bottom: 30px;
    padding: 15px;
    border-radius: 6px;
    align-items: center;
    position: relative;
}
.block-chat-my h5 {
    display: grid;
    gap: 5px;
}
.block-chat-my .block-chat-ava-my {
    width: 40px;
    height: 40px;
    border-radius: 6px;
    opacity: .6;
    transition: .5s;
    object-fit: cover;
}
.block-chat-my .block-chat-ava-my:hover {
    opacity: 1;
}
.block-chat-my h5 div {
    font-size: 8px;
    color: var(--custom-text-color);
}
.onlines_mess div h4 {
    cursor: pointer;
    transition: .5s;
}
.onlines_mess div h4:hover {
    color: var(--span-color);
}
.block-chat-back > h2 {
    height: 60px;
    display: flex;
    justify-content: center;
    align-items: center;
}
#chat_main_content {
    display: flex;
    width: 100%;
    gap: 15px;
    padding: 60px 15px 15px 15px;
    margin: 15px 0px;
    height: 420px;
    overflow: auto;
    background-color: var(--bg-color);
    border-radius: 6px;
    flex-direction: column;
}
#chat_main_content::-webkit-scrollbar {
    height: 2px;
    width: 2px;
}
.chat_footer_send > button {
    cursor: pointer;
    height: 40px;
    border-radius: 6px;
    width: 40px;
    transition: .5s;
    background-color: var(--card-color);
    color: var(--default-text-color);
}
.chat_footer_send > button > svg {
    transition: .5s;
    fill: var(--default-text-color);
    width: 15px;
    height: 15px;
}
.chat_footer_send > button:hover {
    color: var(--bg-color);
    background-color: var(--span-color);
}
.chat_footer_send > button:hover svg {
    fill: var(--bg-color);
}
.chat_line {
    font-weight: 700;
    color: var(--custom-text-color);
    font-size: 10px;
    display: flex;
    margin: 10px 5px;
    justify-content: space-between;
    align-items: center;
}
#chat_send_message > textarea {
    outline: 0;
    resize: vertical;
    float: left;
    min-height: 40px;
    max-height: 100px;
    width: 100%;
    overflow-y: auto;
    overflow-x: hidden;
    border-radius: 6px;
    line-height: 1.5;
    padding: 9px 50px 9px 15px;
    word-wrap: break-word;
    -webkit-box-sizing: border-box;
    background-color: var(--card-color);
    box-sizing: border-box;
    border: 0;
    color: var(--link-second-navbar-color);
    overflow-wrap: break-word;
}
[contentEditable=true]:empty:not(:focus):before {
    content: attr(data-text);
    color: var(--custom-text-color);
}
div:empty:before {
    content: attr(data-text);
    color: var(--custom-text-color);
}
.chat_message {
    display: flex;
    justify-content: flex-start;
    background-color: var(--bg-color);
    border-radius: 6px;
}
.chat_message_my {
    display: flex;
    justify-content: flex-end;
    background-color: var(--bg-color);
    border-radius: 6px;
}
.chat_message .padding, .chat_message_my .padding {
    padding: 10px;
    background-color: var(--card-color);
    border-radius: 6px;
    position: relative;
}
.chat_message div > a >  img, .chat_message_my div > a > img {
    width: 25px;
    height: 25px;
    cursor: pointer;
    border-radius: 6px;
    opacity: .6;
    transition: .5s;
    object-fit: cover;
}
.chat_message div > a > img {
    float: left;
}
.chat_message_my div > a > img  {
    float: right;
}
.chat_message div > a > img:hover, .chat_message_my div > a > img:hover {
    opacity: 1;
}
.chat_message .chat_info, .chat_message_my .chat_info {
    display: flex;
    gap: 10px;
    justify-content: space-between;
    align-items: flex-end;
}
.chat_message .chat_info {
    margin-left: 35px;
}
.chat_message_my .chat_info {
    margin-right: 35px;
}
.chat_message div > .chat_message_content {
    padding: 5px 5px 10px 0px;
    margin-left: 35px;
    font-size: 13px;
    min-width: 200px;
    white-space: pre-line;
    overflow-wrap: anywhere;
    text-align: left;
    color: var(--custom-text-color);
}
.chat_message_my div > .chat_message_content {
    padding: 5px 0px 10px 5px;
    margin-right: 35px;
    font-size: 13px;
    min-width: 150px;
    white-space: pre-line;
    overflow-wrap: anywhere;
    text-align: right;
    color: var(--custom-text-color);
}
.chat_message a:hover, .chat_message_my a:hover {
    color: var(--span-color);
}
.chat_message .chat_message_date, .chat_message_my .chat_message_date {
    display: flex;
    gap: 10px;
    font-size: 8px;
    justify-content: flex-end;
}
.chat_role {
    font-size: 8px;
    background-color: var(--bg-color);
    border-radius: 4px;
    padding: 3px 10px;
}
.chat_nickname {
    cursor: pointer;
    font-weight: 700;
    font-size: 13px;
    color: var(--default-text-color);
    transition: .5s;
    white-space: nowrap;
}
.chat_nickname:hover {
    color: var(--span-color);
}
.chat_message_date > stats {
    opacity: .1;
}
.chat_message_date > .mention_chat {
    color: var(--span-color);
    cursor: pointer;
    transition: .5s;
}
.chat_message_date > .mention_chat:hover {
    color: green;
}
.chat_message_date > .del_chat {
    color: var(--span-color);
    cursor: pointer;
    transition: .5s;
}
.chat_message_date > .del_chat:hover {
    color: red;
}
#chat_profile {
    background-color: var(--bg-color);
    display: flex;
    padding: 10px;
    flex-direction: row;
    border-radius: 6px;
    position: relative;
}
#chat_profile > img {
    height: 30px;
    width: 30px;
    border-radius: 6px;
}
#chat_profile > .chat_profile_container {
    margin-left: 10px;
    overflow: hidden;
    text-overflow: ellipsis;
}
.chat_profile_close {
    position: absolute;
    right: 10px;
    cursor: pointer;
}
.chat_profile_container > h4 {
    margin: 0;
    white-space: nowrap;
    text-overflow: ellipsis;
    overflow: hidden;
}
.block-chat-my label {
    position: absolute;
    right: 0px;
    margin-right: 15px;
}
.chat_checkbox {
    clip: rect(0 0 0 0);
    clip-path: inset(50%);
    height: 1px;
    overflow: hidden;
    position: absolute;
    white-space: nowrap;
    width: 1px;
}
.chat_checkbox:disabled + .toggle-track {
    cursor: not-allowed;
    opacity: 0.7;
}
.toggle-track {
    background-color: var(--bg-color);
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    height: 20px;
    position: relative;
    width: 40px;
    align-items: center;
}
.toggle-indicator {
    color: var(--bg-color);
    background-color: var(--span-color);
    border-radius: 6px;
    display: flex;
    position: absolute;
    transition: 0.25s;
}
.checkMark {
    fill: var(--default-text-color);
    height: 20px;
    width: 20px;
    opacity: 0;
    transition: opacity 0.25s ease-in-out;
}
.chat_checkbox:checked + .toggle-track .toggle-indicator {
    color: var(--bg-color);
    background-color: var(--span-color);
    transform: translateX(20px);
}
.chat_checkbox:checked + .toggle-track .toggle-indicator .checkMark {
    opacity: 1;
    transition: opacity 0.25s ease-in-out;
}
label[for="chat_checkbox_call"] {
    display: flex;
    gap: 15px;
    font-size: 10px;
    font-weight: 700;
    white-space: nowrap;
    align-items: center;
}
.margin-30-online {
    margin-left: 5px;
    margin-top: 30px;
    margin-bottom: 30px;
}
.wbold {
    display: flex;
    background-color: var(--bg-color);
    height: 40px;
    border-radius: 6px;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    transition: .5s;
}
.wbold:hover {
    color: var(--bg-color);
    background-color: var(--span-color);
}
@media (min-width: 1075px) {
    .position-block-sticky {
        height: fit-content;
        position: sticky;
        top: 75px;
    }
}
.role-chat-my {
    position: absolute;
    font-size: 8px;
    right: 5px;
    bottom: -15px;
}
.modal_okno_chat {
    position: fixed;
    transform: translate(100%, -50%);
    z-index: 9999;
    padding: 0px 15px;
    transition: .5s;
    right: 0;
    top: 50%;
    max-height: 100%;
    width: 100%;
    max-width: 500px;
}
.modal_okno_chat.show {
    transform: translate(0%, -50%);
    transition: .5s;
}
.chat_background.show {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 9999;
    background-color: var(--news);
    backdrop-filter: blur(5px);
    opacity: 1;
}
.chat_background {
    transition: .5s all;
    opacity: 0;
    position: fixed;
}
.block-chat-info {
    display: flex;
    height: 60px;
    gap: 15px;
    z-index: 1;
    padding: 15px;
    border-radius: 6px;
    margin-right: 15px;
    font-size: 10px;
    border: solid 2px var(--span-color);
    background-color: var(--bg-color);
    position: absolute;
    justify-content: center;
    align-items: center;
}
.block-chat-info > a {
    color: var(--span-color);
}
.block-chat-info > svg {
    width: 40px;
    height: 40px;
    fill: var(--span-color);
}
.block-chat-online {
    display: flex;
    padding: 0px 5px;
    justify-content: space-between;
    align-items: center;
}
.margin-bottom-15px {
    margin-bottom: 15px;
}
.chat_open {
    background-color: var(--span-color);
    color: var(--bg-color);
    outline: none;
    cursor: pointer;
    position: fixed;
    width: 50px;
    height: 50px;
    box-sizing: border-box;
    top: 50%;
    transform: translateY(-50%);
    right: 15px;
    z-index: 1000;
    font-size: 20px;
    border-radius: 6px;
}
.chat_open svg {
    fill: var(--button-color);
    width: 20px;
    height: 20px;
}
.reload-mess {
    display: flex;
    height: 100%;
    color: green;
    align-items: center;
    justify-content: center; 
}
.chat_no_msg {
    display: flex;
    height: 100%;
    color: red;
    align-items: center;
    justify-content: center;
}
.chat_message_content emoji {
    font-size: 15px;
}

/* ===== improvements: scrollbar, animation, media, cooldown ===== */
#chat_main_content::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
#chat_main_content::-webkit-scrollbar-track {
    background: transparent;
}
#chat_main_content::-webkit-scrollbar-thumb {
    background: var(--span-color);
    border-radius: 6px;
}
#chat_main_content {
    scrollbar-width: thin;
    scrollbar-color: var(--span-color) transparent;
}

@keyframes chatMsgIn {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: none; }
}
.chat_message,
.chat_message_my {
    animation: chatMsgIn .25s ease;
}

.chat_msg_media {
    display: block;
    max-width: 220px;
    max-height: 160px;
    margin-top: 6px;
    border-radius: 6px;
    object-fit: cover;
    cursor: pointer;
}
.chat_msg_link {
    color: var(--span-color);
    text-decoration: underline;
    word-break: break-all;
}

.chat_footer_send > button.cooldown {
    opacity: .6;
    cursor: not-allowed;
}
.chat_footer_send > button .cd_sec {
    font-size: 14px;
    font-weight: 700;
    color: var(--default-text-color);
}

/* ════════════════ Spotlight chat restyle ════════════════ */
.block-chat-back{
  background: rgba(255,255,255,.035) !important;
  border: 1px solid rgba(255,255,255,.06) !important;
  border-radius: 20px !important;
  box-shadow: 0 24px 60px rgba(0,0,0,.35) !important;
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  padding: 6px 22px 22px !important;
}
/* заголовок «Игровой чат» */
.block-chat-back > h2{
  font-family: var(--font-family-1,"Unbounded"),sans-serif !important;
  font-weight: 800 !important; letter-spacing: -.01em;
  background: linear-gradient(120deg,#5fe3ff,#2b7fff);
  -webkit-background-clip: text; background-clip: text; color: transparent !important;
}
/* инфо-баннер */
.block-chat-info{
  background: rgba(41,163,171,.08) !important;
  border: 1px solid rgba(41,163,171,.35) !important;
  border-radius: 14px !important;
}
/* лента сообщений */
#chat_main_content{
  background: rgba(0,0,0,.18) !important;
  border: 1px solid rgba(255,255,255,.05) !important;
  border-radius: 16px !important;
}
/* пузыри сообщений — стекло */
.chat_message, .chat_message_my{ background: transparent !important; }
.chat_message .padding, .chat_message_my .padding{
  background: rgba(255,255,255,.04) !important;
  border: 1px solid rgba(255,255,255,.06) !important;
  border-radius: 16px !important;
  transition: border-color .2s, background .2s;
}
.chat_message .padding:hover, .chat_message_my .padding:hover{
  border-color: rgba(41,163,171,.4) !important;
}
.chat_nickname:hover, .chat_message a:hover, .chat_message_my a:hover{ color:#5fe3ff !important; }
/* аватары */
.block-chat-my .block-chat-ava-my,
.chat_message div > a > img, .chat_message_my div > a > img,
.chat_peoples .ava, #chat_profile > img{ border-radius: 11px !important; }
/* роль/тег */
.chat_role{ background: rgba(41,163,171,.14) !important; color:#9fd8de !important; border-radius:8px !important; }
/* поле ввода */
.chat_footer_send{
  background: rgba(255,255,255,.035) !important;
  border: 1px solid rgba(255,255,255,.06) !important;
  border-radius: 16px !important;
}
#chat_send_message > textarea{
  background: rgba(0,0,0,.2) !important;
  border: 1px solid rgba(255,255,255,.06) !important;
  border-radius: 12px !important;
  color: #e7edf2 !important;
}
/* кнопка отправки — gradient */
.chat_footer_send > button{
  background: linear-gradient(120deg,#29a3ab,#2b7fff) !important;
  border: none !important; border-radius: 12px !important;
  box-shadow: 0 6px 20px rgba(43,127,255,.28); transition: transform .2s, box-shadow .2s;
}
.chat_footer_send > button:hover{ transform: translateY(-2px); box-shadow: 0 10px 28px rgba(43,127,255,.45) !important; }
.chat_footer_send > button > svg{ fill:#fff !important; }
.chat_footer_send > button:hover svg{ fill:#fff !important; }
/* тоггл уведомлений */
.toggle-track{ border-radius: 999px !important; }
/* смайл-меню */
.chat_menu_smile{
  background: rgba(20,26,38,.92) !important;
  border: 1px solid rgba(255,255,255,.08) !important;
  border-radius: 16px !important;
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
}
/* плавающая кнопка открытия чата */
.chat_open{
  width: 52px !important; height: 52px !important;
  border-radius: 16px !important;
  background: linear-gradient(120deg,#29a3ab,#2b7fff) !important;
  border: 1px solid rgba(255,255,255,.12) !important;
  box-shadow: 0 10px 28px rgba(43,127,255,.35), inset 0 1px 0 rgba(255,255,255,.15) !important;
  display: flex !important; align-items: center !important; justify-content: center !important;
  transition: transform .2s, box-shadow .2s !important;
}
.chat_open:hover{ transform: translateY(-50%) scale(1.06) !important; box-shadow: 0 14px 36px rgba(43,127,255,.55) !important; }
.chat_open svg{ fill:#fff !important; }
.chat_open span{
  background: #0a0e16 !important;
  color: #5fe3ff !important;
  border-color: #5fe3ff !important;
}