/* ---------------------------------------------
   FLOATING CHAT BUTTON (always visible)
---------------------------------------------- */
#chatLauncher {
    position: fixed;
    bottom: 20px;
    right: 20px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    z-index: 999999;
    box-shadow: 0 0 12px rgba(0,0,0,0.4);
    transition: transform .2s, opacity .2s;
}

#chatLauncher img {
    width: 50px;
    height: 50px;
}

/* Hover effect */
#chatLauncher:hover {
    transform: scale(1.1);
}

/* ---------------------------------------------
   POPUP CHAT WINDOW
---------------------------------------------- */
#gameChatPopup {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 320px;
    height: 420px;
    background: #0a0a0af8;
    border-radius: 12px;
    border: 1px solid #333;
    box-shadow: 0 0 18px rgba(0,0,0,0.5);
    display: none;
    flex-direction: column;
    overflow: hidden;
    z-index: 1000000;
    opacity: 0;
    transform: scale(0.9);
    transition: opacity .25s, transform .25s;
}

#gameChatPopup.active {
    display: flex;
    opacity: 1;
    transform: scale(1);
}

/* Header */
#popupHeader {
    background: linear-gradient(135deg, #1a1a2e, #0f0f17);
    padding: 12px;
    font-weight:700;
    color:white;
    display:flex;
    justify-content:space-between;
    align-items:center;
}

#closePopup {
    cursor:pointer;
    font-size: 1.2em;
    color:#999;
}
#closePopup:hover { color:white; }

/* Chat body */
#messagesContainer {
    flex:1;
    overflow-y:auto;
    padding:10px;
    display:flex;
    flex-direction:column;
    gap:10px;
}

.msg {
    max-width:70%;
    padding:8px 12px;
    border-radius:10px;
}

.msg.me { background:#0078ff; align-self:flex-end; }
.msg.them { background:#2a2a2a; align-self:flex-start; }

.msg .author {
    font-size:0.7em;
    opacity:0.7;
    margin-bottom:2px;
}

/* Input */
#chatInput {
    display:flex;
    padding:8px;
    background: linear-gradient(135deg, #1a1a2e, #0f0f17);
}

#messageText {
    flex:1;
    padding:8px;
    background:#1b1b1b;
    border:none;
    border-radius:6px;
    color:white;
}

#sendBtn {
    margin-left:10px;
    background:#0078ff;
    border:none;
    padding:8px 12px;
    color:white;
    border-radius:6px;
    cursor:pointer;
}