﻿/* ============================================================
   PLAYERS CHAT - TaiChi Co
============================================================ */
.chat-fab {
    position: fixed;
    left: 22px;
    bottom: 22px;
    z-index: 99999;
    width: 58px;
    height: 58px;
    border-radius: 50%;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #F5F7FA;
    font-size: 24px;
    background: linear-gradient(135deg, #F0C66A, #8A6420);
    box-shadow: 0 6px 24px rgba(217,164,65, .55);
    transition: transform .3s, box-shadow .3s, background .3s;
    animation: chatPulse 2.4s infinite;
}
.chat-fab:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 30px rgba(240,198,106, .75);
}
.chat-fab.chat-active {
    background: linear-gradient(135deg, #F06464, #F06464);
    animation: none;
}
.chat-fab-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    min-width: 20px;
    height: 20px;
    border-radius: 10px;
    background: #F06464;
    color: #F5F7FA;
    font-size: 11px;
    font-weight: bold;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 0 5px;
    box-shadow: 0 0 10px rgba(255, 92, 108, .8);
}
@keyframes chatPulse {
    0%   { box-shadow: 0 6px 24px rgba(217,164,65,.55), 0 0 0 0 rgba(240,198,106,.45); }
    70%  { box-shadow: 0 6px 24px rgba(217,164,65,.55), 0 0 0 16px rgba(240,198,106,0); }
    100% { box-shadow: 0 6px 24px rgba(217,164,65,.55), 0 0 0 0 rgba(240,198,106,0); }
}
.chat-panel {
    position: fixed;
    left: 22px;
    bottom: 92px;
    z-index: 99998;
    width: 350px;
    max-width: calc(100vw - 44px);
    height: 480px;
    max-height: calc(100vh - 130px);
    display: none;
    flex-direction: column;
    background: rgba(10, 42, 78, .98);
    border: 1px solid #D9A441;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0, 0, 0, .6), 0 0 40px rgba(217,164,65, .15);
    animation: chatIn .25s ease;
}
.chat-panel.chat-open {
    display: flex;
}
@keyframes chatIn {
    from { opacity: 0; transform: translateY(16px) scale(.96); }
    to   { opacity: 1; transform: none; }
}
.chat-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px;
    background: linear-gradient(135deg, #101725, #8A6420);
    border-bottom: 1px solid #D9A441;
}
.chat-header-left {
    display: flex;
    flex-direction: column;
    gap: 3px;
}
.chat-header-title {
    font-weight: 700;
    letter-spacing: 1.5px;
    color: #F5F7FA;
    font-size: 14px;
}
.chat-header-status {
    display: flex;
    align-items: center;
    gap: 6px;
    color: #A7B1C2;
    font-size: 10px;
    letter-spacing: 2px;
}
.chat-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #35C98A;
    box-shadow: 0 0 8px #35C98A;
    animation: chatBlink 1.2s infinite;
}
@keyframes chatBlink {
    50% { opacity: .35; }
}
.chat-close {
    background: none;
    border: none;
    color: #A7B1C2;
    font-size: 16px;
    cursor: pointer;
    padding: 6px;
    transition: color .2s;
}
.chat-close:hover {
    color: #F5F7FA;
}
.chat-login {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 30px;
    text-align: center;
    color: #A7B1C2;
    font-size: 14px;
    flex: 1;
}
.chat-login-icon {
    font-size: 36px;
    color: #F0C66A;
}
.chat-login-btn {
    background: linear-gradient(135deg, #D9A441, #8A6420);
    color: #F5F7FA;
    text-decoration: none;
    font-weight: 700;
    letter-spacing: 1px;
    padding: 10px 26px;
    border-radius: 8px;
    transition: box-shadow .3s, transform .3s;
}
.chat-login-btn:hover {
    box-shadow: 0 0 20px rgba(240,198,106, .6);
    transform: translateY(-2px);
    color: #F5F7FA;
}
.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 14px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.chat-messages::-webkit-scrollbar {
    width: 6px;
}
.chat-messages::-webkit-scrollbar-track {
    background: rgba(9, 13, 22, .6);
}
.chat-messages::-webkit-scrollbar-thumb {
    background: #D9A441;
    border-radius: 3px;
}
.chat-msg {
    display: flex;
    gap: 10px;
    animation: msgIn .2s ease;
}
@keyframes msgIn {
    from { opacity: 0; transform: translateY(6px); }
    to   { opacity: 1; transform: none; }
}
.chat-avatar {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    border: 2px solid #D9A441;
    object-fit: cover;
    background: #101725;
    flex-shrink: 0;
}
.chat-body {
    flex: 1;
    background: rgba(16,23,37, .55);
    border: 1px solid rgba(29, 77, 122, .7);
    border-radius: 10px;
    padding: 8px 12px 5px;
}
.chat-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 3px;
}
.chat-user {
    color: #F0C66A;
    font-weight: 700;
    font-size: 12px;
}
.chat-level {
    color: #35C98A;
    font-size: 10px;
    font-weight: 700;
    background: rgba(53, 201, 138, .12);
    padding: 1px 6px;
    border-radius: 8px;
}
.chat-text {
    color: #F5F7FA;
    font-size: 13px;
    line-height: 1.5;
    word-break: break-word;
}
.chat-time {
    color: #A7B1C2;
    font-size: 10px;
    text-align: right;
    margin-top: 4px;
}
.chat-input-area {
    display: flex;
    gap: 8px;
    padding: 12px;
    border-top: 1px solid #D9A441;
    background: #171D2A;
}
.chat-input {
    flex: 1;
    background: #090D16;
    border: 1px solid #D9A441;
    color: #F5F7FA;
    border-radius: 20px;
    padding: 10px 16px;
    font-size: 13px;
    outline: none;
    transition: border-color .3s, box-shadow .3s;
}
.chat-input::placeholder {
    color: #A7B1C2;
}
.chat-input:focus {
    border-color: #D9A441;
    box-shadow: 0 0 12px rgba(217,164,65, .25);
}
.chat-send {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: none;
    background: linear-gradient(135deg, #D9A441, #8A6420);
    color: #F5F7FA;
    font-size: 15px;
    cursor: pointer;
    transition: box-shadow .3s, transform .3s;
    flex-shrink: 0;
}
.chat-send:hover {
    box-shadow: 0 0 18px rgba(240,198,106, .6);
    transform: scale(1.08);
}
@media (max-width: 480px) {
    .chat-panel {
        left: 10px;
        right: 10px;
        bottom: 86px;
        width: auto;
        height: 70vh;
    }
    .chat-fab {
        left: 14px;
        bottom: 14px;
    }
}

/* ============================================================
   AVATAR PICKER
============================================================ */
.chat-face-toggle {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 1px solid #D9A441;
    background: #101725;
    color: #F0C66A;
    font-size: 16px;
    cursor: pointer;
    transition: box-shadow .3s, transform .3s;
    flex-shrink: 0;
}
.chat-face-toggle:hover {
    box-shadow: 0 0 14px rgba(217,164,65, .5);
}
.chat-face-toggle.chat-face-active {
    background: linear-gradient(135deg, #D9A441, #8A6420);
    color: #F5F7FA;
}
.chat-face-wrap {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 8px 8px;
    border-top: 1px solid rgba(217,164,65, .35);
    background: #171D2A;
}
.chat-face-grid {
    display: flex;
    flex-wrap: nowrap;
    flex: 1;
    gap: 6px;
    overflow-x: auto;
    overflow-y: hidden;
    max-width: 100%;
}
.chat-face-grid::-webkit-scrollbar {
    height: 6px;
}
.chat-face-grid::-webkit-scrollbar-track {
    background: rgba(9, 13, 22, .6);
}
.chat-face-grid::-webkit-scrollbar-thumb {
    background: #D9A441;
    border-radius: 3px;
}
.chat-face-nav {
    width: 26px;
    height: 44px;
    flex: 0 0 auto;
    border: 1px solid #D9A441;
    background: #101725;
    color: #F0C66A;
    font-size: 12px;
    cursor: pointer;
    border-radius: 6px;
    transition: background .2s, box-shadow .2s;
}
.chat-face-nav:hover {
    background: #1C2433;
    box-shadow: 0 0 10px rgba(217,164,65, .4);
}
.chat-face-opt {
    width: 38px;
    height: 38px;
    border-radius: 8px;
    border: 2px solid rgba(217,164,65, .35);
    cursor: pointer;
    object-fit: contain;
    background: #090D16;
    transition: transform .15s, border-color .2s, box-shadow .2s;
}
.chat-face-opt:hover {
    transform: scale(1.12);
    border-color: #F0C66A;
}
.chat-face-opt.selected {
    border-color: #35C98A;
    box-shadow: 0 0 10px rgba(53,201,138, .6);
}