/* ============================================================
   WHISTAO - Chat & Spectator Styles
   ============================================================ */

/* ─── Chat Panel ─────────────────────────────────────────── */

.chat-panel {
    position: absolute;
    right: 0;
    top: 44px;
    bottom: 0;
    width: 280px;
    z-index: 30;
    display: flex;
    flex-direction: column;
    transition: transform 0.3s ease;
}

.chat-panel.collapsed {
    transform: translateX(280px);
}

/* ─── Chat bar button (in top info bar) ───────────────────── */

.chat-bar-btn {
    background: none;
    border: 1px solid rgba(212,168,71,0.4);
    font-size: 18px;
    cursor: pointer;
    padding: 3px 8px;
    border-radius: 6px;
    transition: all 0.2s;
    line-height: 1;
    flex-shrink: 0;
    color: var(--cream);
    position: relative;
}

.chat-bar-btn:hover {
    background: rgba(212,168,71,0.2);
    border-color: var(--gold);
}

.chat-bar-badge {
    position: absolute;
    top: -6px;
    right: -6px;
    background: #e74c3c;
    color: white;
    border-radius: 50%;
    width: 16px;
    height: 16px;
    font-size: 10px;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

/* ─── Chat Header ─────────────────────────────────────────── */

.chat-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 12px;
    background: rgba(0, 0, 0, 0.5);
    border-bottom: 1px solid rgba(212, 168, 71, 0.3);
    font-size: 14px;
    font-weight: bold;
    color: var(--gold);
}

.chat-close-btn {
    background: none;
    border: none;
    color: var(--cream-dark);
    font-size: 16px;
    cursor: pointer;
    padding: 2px 6px;
    border-radius: 4px;
    transition: all 0.2s;
    line-height: 1;
}

.chat-close-btn:hover {
    color: var(--cream);
    background: rgba(255, 255, 255, 0.1);
}

/* ─── Chat Content ────────────────────────────────────────── */

.chat-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: rgba(0, 0, 0, 0.85);
    border-left: 1px solid var(--gold-dark);
    min-height: 0;
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 8px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-height: 0;
}

.chat-msg {
    font-size: 13px;
    color: var(--cream);
    padding: 4px 8px;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.05);
    word-wrap: break-word;
}

.chat-msg-quick {
    background: rgba(212, 168, 71, 0.15);
    border: 1px solid rgba(212, 168, 71, 0.3);
    font-style: italic;
}

.chat-msg-author {
    font-weight: bold;
    color: var(--gold);
    margin-right: 4px;
}

/* ─── Quick Messages ─────────────────────────────────────── */

.chat-quick-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    padding: 6px 8px;
    border-top: 1px solid rgba(212, 168, 71, 0.2);
    max-height: 64px;
    overflow-y: auto;
}

.chat-quick-btn {
    padding: 2px 8px;
    border-radius: 12px;
    border: 1px solid rgba(212, 168, 71, 0.3);
    background: rgba(0, 0, 0, 0.4);
    color: var(--cream-dark);
    font-size: 11px;
    cursor: pointer;
    white-space: nowrap;
    font-family: inherit;
    transition: all 0.2s;
}

.chat-quick-btn:hover {
    background: rgba(212, 168, 71, 0.2);
    border-color: var(--gold);
    color: var(--gold);
}

/* ─── Chat Input ─────────────────────────────────────────── */

.chat-input-row {
    display: flex;
    gap: 4px;
    padding: 6px 8px;
    border-top: 1px solid rgba(212, 168, 71, 0.2);
}

.chat-input {
    flex: 1;
    padding: 6px 10px;
    border: 1px solid rgba(212, 168, 71, 0.3);
    border-radius: 6px;
    background: rgba(0, 0, 0, 0.4);
    color: var(--cream);
    font-size: 13px;
    font-family: inherit;
    outline: none;
    min-width: 0;
}

.chat-input:focus {
    border-color: var(--gold);
}

.chat-send-btn {
    padding: 6px 12px;
    border-radius: 6px;
    border: 1px solid var(--gold-dark);
    background: rgba(212, 168, 71, 0.2);
    color: var(--gold);
    font-size: 12px;
    font-weight: bold;
    cursor: pointer;
    font-family: inherit;
    transition: all 0.2s;
    white-space: nowrap;
}

.chat-send-btn:hover {
    background: rgba(212, 168, 71, 0.4);
}

/* ─── Spectator Banner ───────────────────────────────────── */

.spectator-banner {
    position: absolute;
    top: 44px;
    left: 50%;
    transform: translateX(-50%);
    padding: 4px 20px;
    background: rgba(0, 0, 0, 0.7);
    border: 1px solid var(--gold-dark);
    border-top: none;
    border-radius: 0 0 8px 8px;
    color: var(--gold);
    font-size: 13px;
    font-weight: bold;
    z-index: 5;
    pointer-events: none;
}

/* ─── Spectator Count ────────────────────────────────────── */

.spectator-count {
    font-size: 13px;
    color: var(--cream-dark);
    padding: 2px 8px;
    white-space: nowrap;
}

/* ─── Responsive ─────────────────────────────────────────── */

@media (max-width: 600px) {
    .chat-panel {
        width: 220px;
    }

    .chat-panel.collapsed {
        transform: translateX(220px);
    }
}

/* Landscape compact */
@media (max-height: 500px) and (orientation: landscape) {
    .chat-bar-btn {
        font-size: 14px;
        padding: 2px 6px;
    }
}
