﻿/* ============================================================
   PLAYERS CHAT - Mazreta 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: #fff;
    font-size: 24px;
    background: linear-gradient(135deg, #ffd966, #c85a18);
    box-shadow: 0 6px 24px rgba(245,182,46, .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(255,217,102, .75);
}
.chat-fab.chat-active {
    background: linear-gradient(135deg, #b82020, #c93a4b);
    animation: none;
}
.chat-fab-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    min-width: 20px;
    height: 20px;
    border-radius: 10px;
    background: #b82020;
    color: #fff;
    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(245,182,46,.55), 0 0 0 0 rgba(255,217,102,.45); }
    70%  { box-shadow: 0 6px 24px rgba(245,182,46,.55), 0 0 0 16px rgba(255,217,102,0); }
    100% { box-shadow: 0 6px 24px rgba(245,182,46,.55), 0 0 0 0 rgba(255,217,102,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 #f5b82e;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0, 0, 0, .6), 0 0 40px rgba(245,182,46, .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, #1d2e20, #c85a18);
    border-bottom: 1px solid #f5b82e;
}
.chat-header-left {
    display: flex;
    flex-direction: column;
    gap: 3px;
}
.chat-header-title {
    font-weight: 700;
    letter-spacing: 1.5px;
    color: #fff4d6;
    font-size: 14px;
}
.chat-header-status {
    display: flex;
    align-items: center;
    gap: 6px;
    color: #d8c79b;
    font-size: 10px;
    letter-spacing: 2px;
}
.chat-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #48e59a;
    box-shadow: 0 0 8px #48e59a;
    animation: chatBlink 1.2s infinite;
}
@keyframes chatBlink {
    50% { opacity: .35; }
}
.chat-close {
    background: none;
    border: none;
    color: #d8c79b;
    font-size: 16px;
    cursor: pointer;
    padding: 6px;
    transition: color .2s;
}
.chat-close:hover {
    color: #fff;
}
.chat-login {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 30px;
    text-align: center;
    color: #d8c79b;
    font-size: 14px;
    flex: 1;
}
.chat-login-icon {
    font-size: 36px;
    color: #ffd966;
}
.chat-login-btn {
    background: linear-gradient(135deg, #f5b82e, #c85a18);
    color: #fff;
    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(255,217,102, .6);
    transform: translateY(-2px);
    color: #fff;
}
.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(4, 24, 48, .6);
}
.chat-messages::-webkit-scrollbar-thumb {
    background: #f5b82e;
    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 #f5b82e;
    object-fit: cover;
    background: #1d2e20;
    flex-shrink: 0;
}
.chat-body {
    flex: 1;
    background: rgba(29,46,32, .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: #ffd966;
    font-weight: 700;
    font-size: 12px;
}
.chat-level {
    color: #48e59a;
    font-size: 10px;
    font-weight: 700;
    background: rgba(72, 229, 154, .12);
    padding: 1px 6px;
    border-radius: 8px;
}
.chat-text {
    color: #fff4d6;
    font-size: 13px;
    line-height: 1.5;
    word-break: break-word;
}
.chat-time {
    color: #d8c79b;
    font-size: 10px;
    text-align: right;
    margin-top: 4px;
}
.chat-input-area {
    display: flex;
    gap: 8px;
    padding: 12px;
    border-top: 1px solid #f5b82e;
    background: #17281a;
}
.chat-input {
    flex: 1;
    background: #101a12;
    border: 1px solid #f5b82e;
    color: #fff4d6;
    border-radius: 20px;
    padding: 10px 16px;
    font-size: 13px;
    outline: none;
    transition: border-color .3s, box-shadow .3s;
}
.chat-input::placeholder {
    color: #d8c79b;
}
.chat-input:focus {
    border-color: #f5b82e;
    box-shadow: 0 0 12px rgba(245,182,46, .25);
}
.chat-send {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: none;
    background: linear-gradient(135deg, #f5b82e, #c85a18);
    color: #fff;
    font-size: 15px;
    cursor: pointer;
    transition: box-shadow .3s, transform .3s;
    flex-shrink: 0;
}
.chat-send:hover {
    box-shadow: 0 0 18px rgba(255,217,102, .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 #f5b82e;
    background: #1d2e20;
    color: #ffd966;
    font-size: 16px;
    cursor: pointer;
    transition: box-shadow .3s, transform .3s;
    flex-shrink: 0;
}
.chat-face-toggle:hover {
    box-shadow: 0 0 14px rgba(245,182,46, .5);
}
.chat-face-toggle.chat-face-active {
    background: linear-gradient(135deg, #f5b82e, #c85a18);
    color: #fff;
}
.chat-face-wrap {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 8px 8px;
    border-top: 1px solid rgba(245,182,46, .35);
    background: #17281a;
}
.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(4, 24, 48, .6);
}
.chat-face-grid::-webkit-scrollbar-thumb {
    background: #f5b82e;
    border-radius: 3px;
}
.chat-face-nav {
    width: 26px;
    height: 44px;
    flex: 0 0 auto;
    border: 1px solid #f5b82e;
    background: #1d2e20;
    color: #ffd966;
    font-size: 12px;
    cursor: pointer;
    border-radius: 6px;
    transition: background .2s, box-shadow .2s;
}
.chat-face-nav:hover {
    background: #2a4530;
    box-shadow: 0 0 10px rgba(245,182,46, .4);
}
.chat-face-opt {
    width: 38px;
    height: 38px;
    border-radius: 8px;
    border: 2px solid rgba(245,182,46, .35);
    cursor: pointer;
    object-fit: contain;
    background: #101a12;
    transition: transform .15s, border-color .2s, box-shadow .2s;
}
.chat-face-opt:hover {
    transform: scale(1.12);
    border-color: #ffd966;
}
.chat-face-opt.selected {
    border-color: #48e59a;
    box-shadow: 0 0 10px rgba(72,229,154, .6);
}