﻿/* ── Game Lobby Chat ── */

.game-chat {
    display: flex;
    flex-direction: column;
    border-radius: 0.75rem;
    overflow: hidden;
    background: var(--neuro-bg-elevated, #1a1a2e);
    border: 1px solid rgba(255, 255, 255, 0.06);
    max-height: 100%;
    height: 100%;
}

body[data-theme="neuro"] .game-chat {
    background: var(--neuro-bg-elevated);
}
body[data-theme="evil"] .game-chat {
    background: var(--evil-bg-elevated);
}
body[data-theme="twins"] .game-chat {
    background: var(--twins-bg-elevated);
}

.game-chat-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 14px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    cursor: pointer;
    user-select: none;
    flex-shrink: 0;
}

.game-chat-header-left {
    display: flex;
    align-items: center;
    gap: 8px;
}

.game-chat-title {
    font-size: 0.875rem;
    font-weight: 700;
}

.game-chat-user-count {
    display: flex;
    align-items: center;
    gap: 3px;
    font-size: 0.75rem;
}

.game-chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 8px 10px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-height: 0;
}

.game-chat-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    flex: 1;
    padding: 2rem 1rem;
    opacity: 0.7;
}

.game-chat-message {
    padding: 3px 6px;
    border-radius: 6px;
    animation: gameChatFadeIn 0.2s ease;
}

@keyframes gameChatFadeIn {
    from { opacity: 0; transform: translateY(4px); }
    to { opacity: 1; transform: translateY(0); }
}

.game-chat-bot-msg-neuro {
    background: rgba(0, 200, 255, 0.04);
    border-left: 2px solid rgba(0, 200, 255, 0.3);
}

.game-chat-bot-msg-evil {
    background: rgba(255, 50, 100, 0.04);
    border-left: 2px solid rgba(255, 50, 100, 0.3);
}

.game-chat-system-msg {
    background: rgba(255, 255, 255, 0.02);
}

.game-chat-system {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.75rem;
    font-style: italic;
}

.game-chat-deleted {
    font-size: 0.75rem;
}

.game-chat-msg-row {
    display: flex;
    align-items: flex-start;
    gap: 8px;
}

.game-chat-bot-avatar {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    flex-shrink: 0;
    margin-top: 2px;
}

.game-chat-msg-body {
    flex: 1;
    min-width: 0;
    font-size: 0.8125rem;
    line-height: 1.4;
    display: inline;
}

.game-chat-author {
    font-weight: 700;
    font-size: 0.8125rem;
    margin-right: 4px;
}

.game-chat-bot-badge {
    display: inline-flex;
    align-items: center;
    padding: 0 4px;
    border-radius: 3px;
    font-size: 0.5625rem;
    font-weight: 700;
    letter-spacing: 0.5px;
    margin-right: 4px;
    vertical-align: middle;
    line-height: 1.4;
}

.bot-badge-neuro {
    background: rgba(0, 200, 255, 0.2);
    color: #00c8ff;
}

.bot-badge-evil {
    background: rgba(255, 50, 100, 0.2);
    color: #ff3264;
}

.bot-name-neuro {
    color: #00c8ff !important;
}

.bot-name-evil {
    color: #ff3264 !important;
}

.admin-name {
    color: var(--neuro-primary, #00c8ff) !important;
}

.game-chat-msg-text {
    font-size: 0.8125rem;
    word-break: break-word;
}

.game-chat-input-area {
    padding: 8px 10px;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    flex-shrink: 0;
}

.game-chat-notice {
    display: flex;
    align-items: center;
    gap: 6px;
    justify-content: center;
    padding: 6px;
    font-size: 0.75rem;
}

.game-chat-input-wrapper {
    display: flex;
    align-items: center;
    gap: 6px;
    background: rgba(255, 255, 255, 0.04);
    border-radius: 8px;
    padding: 4px 4px 4px 10px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    transition: border-color 0.2s;
}

.game-chat-input-wrapper:focus-within {
    border-color: rgba(255, 255, 255, 0.15);
}

.game-chat-input {
    flex: 1;
    background: transparent;
    border: none;
    outline: none;
    color: inherit;
    font-size: 0.8125rem;
    font-family: inherit;
    min-width: 0;
}

.game-chat-input::placeholder {
    opacity: 0.4;
}

.game-chat-send-btn {
    flex-shrink: 0;
}

/* Bot mention badges in rendered content */
.bot-mention {
    display: inline;
    padding: 1px 4px;
    border-radius: 3px;
    font-weight: 600;
    font-size: 0.8125rem;
}

.bot-mention-neuro {
    background: rgba(0, 200, 255, 0.15);
    color: #00c8ff;
}

.bot-mention-evil {
    background: rgba(255, 50, 100, 0.15);
    color: #ff3264;
}

/* Inline emoji in chat messages */
.game-chat .chat-emoji-inline {
    display: inline-block;
    width: 1.25em;
    height: 1.25em;
    vertical-align: middle;
    margin: 0 1px;
}

/* Reply button visibility on hover */
.game-chat-message:hover .game-chat-reply-btn {
    opacity: 0.6 !important;
}

.game-chat-reply-btn:hover {
    opacity: 1 !important;
}

/* Reply preview in game chat */
.game-chat .reply-preview {
    font-size: 0.625rem;
    padding: 1px 4px;
    margin-bottom: 1px;
}

/* Reply indicator in game chat */
.game-chat .reply-indicator {
    font-size: 0.75rem;
    padding: 4px 8px;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.04);
}

/* Message highlight in game chat */
.game-chat .chat-message-highlight {
    animation: messageHighlight 1.5s ease;
}

@keyframes messageHighlight {
    0%, 20% {
        background: rgba(255, 255, 255, 0.1);
    }
    100% {
        background: transparent;
    }
}

/* ── Game with Chat Sidebar Layout ── */

.game-with-chat-layout {
    display: flex;
    gap: 0;
    height: calc(100vh - var(--global-player-height, 0px));
    overflow: hidden;
}

.game-main-content {
    flex: 1;
    min-width: 0;
    overflow-y: auto;
}

.game-chat-sidebar {
    width: 340px;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    border-left: 1px solid rgba(255, 255, 255, 0.06);
    background: var(--neuro-bg-elevated, #1a1a2e);
    overflow: hidden;
}

body[data-theme="neuro"] .game-chat-sidebar {
    background: var(--neuro-bg-elevated);
}

body[data-theme="evil"] .game-chat-sidebar {
    background: var(--evil-bg-elevated);
}

body[data-theme="twins"] .game-chat-sidebar {
    background: var(--twins-bg-elevated);
}

.game-chat-sidebar .chat-container {
    height: 100%;
    border-radius: 0;
}

@media (max-width: 1024px) {
    .game-chat-sidebar {
        width: 300px;
    }
}

@media (max-width: 768px) {
    .game-with-chat-layout {
        flex-direction: column;
        height: auto;
    }

    .game-main-content {
        overflow-y: visible;
    }

    .game-chat-sidebar {
        width: 100%;
        height: 400px;
        border-left: none;
        border-top: 1px solid rgba(255, 255, 255, 0.06);
    }
}
