/* ================================================================
   social-hub.css — Social Hub panel (FAB + DM + Friends/Requests)
   Requires pages to define (or let fallbacks apply):
     --accent  --surface  --surface2  --bg2  --border
     --text  --muted  --red  --green
   ================================================================ */

/* ── FAB ─────────────────────────────────────────────────────── */
.chat-fab {
    position: fixed;
    right: 16px;
    bottom: 16px;
    z-index: 1100;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    border: 1px solid var(--border, rgba(99,102,241,.2));
    background: linear-gradient(135deg, var(--accent, #6366f1) 0%, var(--cyan, #22d3ee) 100%);
    color: #fff;
    box-shadow: 0 14px 30px rgba(0,0,0,.24);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    overflow: visible;
}

.chat-fab-label {
    position: absolute;
    right: 68px;
    top: 50%;
    transform: translateY(-50%) translateX(6px);
    white-space: nowrap;
    padding: 8px 10px;
    border-radius: 10px;
    border: 1px solid var(--border, rgba(99,102,241,.2));
    background: var(--surface, #12122a);
    color: var(--text, #e2e8f0);
    font-family: 'IBM Plex Mono', monospace;
    font-size: 11px;
    letter-spacing: .04em;
    opacity: 0;
    pointer-events: none;
    transition: opacity .16s ease, transform .16s ease;
    box-shadow: 0 10px 22px rgba(0,0,0,.18);
}
.chat-fab:hover .chat-fab-label,
.chat-fab:focus-visible .chat-fab-label {
    opacity: 1;
    transform: translateY(-50%) translateX(0);
}
@media (max-width: 760px) { .chat-fab-label { display: none; } }

.chat-fab-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    background: var(--red, #f43f5e);
    color: #fff;
    border-radius: 999px;
    font-family: 'IBM Plex Mono', monospace;
    font-size: 9px;
    font-weight: 700;
    padding: 1px 5px;
    min-width: 16px;
    text-align: center;
    line-height: 14px;
    pointer-events: none;
    display: none;
}

/* ── Panel ───────────────────────────────────────────────────── */
.chat-panel {
    position: fixed;
    right: 16px;
    bottom: 84px;
    z-index: 1090;
    width: min(360px, calc(100vw - 24px));
    height: min(62vh, 520px);
    display: flex;
    flex-direction: column;
    background: var(--surface, #12122a);
    border: 1px solid var(--border, rgba(99,102,241,.2));
    border-radius: 16px;
    box-shadow: 0 18px 42px rgba(0,0,0,.22);
    overflow: hidden;
    opacity: 0;
    transform: translateY(12px) scale(.98);
    pointer-events: none;
    transition: opacity .18s ease, transform .18s ease;
    /* Reset page font so all children use panel fonts, not page body font */
    font-family: 'Be Vietnam Pro', 'DM Sans', sans-serif;
}
.chat-panel.show {
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: auto;
}
@media (max-width: 760px) {
    .chat-panel { right: 10px; left: 10px; width: auto; height: min(56vh, 460px); }
}

/* ── Panel Tabs ──────────────────────────────────────────────── */
.sh-panel-tabs {
    display: flex;
    padding: 0;
    border-bottom: 1px solid var(--border, rgba(99,102,241,.2));
    background: linear-gradient(135deg, rgba(99,102,241,.14), rgba(34,211,238,.08));
    flex-shrink: 0;
}
.sh-panel-tab-btn {
    flex: 1;
    padding: 8px 4px;
    border: none;
    border-bottom: 2px solid transparent;
    background: transparent;
    color: var(--muted, #64748b);
    font-family: 'IBM Plex Mono', monospace;
    font-size: 10.5px;
    font-weight: 600;
    letter-spacing: .02em;
    cursor: pointer;
    transition: color .14s, background .14s, border-color .14s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    margin-bottom: -1px;
    border-radius: 0;
    white-space: nowrap;
}
.sh-panel-tab-btn:hover { color: var(--text, #e2e8f0); background: rgba(99,102,241,.08); }
.sh-panel-tab-btn.active {
    background: rgba(99,102,241,.12);
    color: var(--text, #e2e8f0);
    border-bottom-color: var(--accent, #6366f1);
    font-weight: 700;
}
.sh-tab-badge {
    background: var(--red, #f43f5e);
    color: #fff;
    border-radius: 999px;
    font-size: 9px;
    font-weight: 700;
    padding: 1px 5px;
    min-width: 16px;
    text-align: center;
    line-height: 14px;
}

/* ── Chat Sub-tabs ───────────────────────────────────────────── */
.sh-subtabs {
    display: flex;
    padding: 0;
    border-bottom: 1px solid var(--border, rgba(99,102,241,.2));
    background: rgba(99,102,241,.04);
    flex-shrink: 0;
}
.sh-subtab-btn {
    flex: 1;
    padding: 6px 4px;
    border: none;
    border-bottom: 2px solid transparent;
    background: transparent;
    color: var(--muted, #64748b);
    font-family: 'IBM Plex Mono', monospace;
    font-size: 10px;
    font-weight: 600;
    cursor: pointer;
    transition: color .14s, background .14s, border-color .14s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    margin-bottom: -1px;
    border-radius: 0;
    white-space: nowrap;
}
.sh-subtab-btn:hover { color: var(--text, #e2e8f0); background: rgba(99,102,241,.06); }
.sh-subtab-btn.active {
    background: rgba(99,102,241,.1);
    color: var(--text, #e2e8f0);
    border-bottom-color: var(--cyan, #22d3ee);
    font-weight: 700;
}
.sh-dm-badge {
    background: var(--red, #f43f5e);
    color: #fff;
    border-radius: 999px;
    font-size: 9px;
    font-weight: 700;
    padding: 1px 4px;
    min-width: 14px;
    text-align: center;
    line-height: 13px;
}

/* ── Social List / Rows ──────────────────────────────────────── */
.sh-tab-content {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    padding: 8px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.sh-row {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    background: rgba(99,102,241,.06);
    border: 1px solid rgba(99,102,241,.14);
    border-left: 4px solid rgba(99,102,241,.32);
    border-radius: 10px;
}
.sh-row-info { flex: 1; min-width: 0; }
.sh-row-name {
    font-family: 'Be Vietnam Pro', 'DM Sans', sans-serif;
    font-size: 12px;
    font-weight: 700;
    color: var(--accent, #6366f1);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.sh-row-sub {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 10px;
    color: var(--muted, #64748b);
    margin-top: 2px;
}
.sh-row-actions { display: flex; gap: 4px; flex-shrink: 0; flex-wrap: wrap; justify-content: flex-end; }
.sh-section-label {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 10px;
    letter-spacing: .06em;
    color: var(--muted, #64748b);
    text-transform: uppercase;
    padding: 4px 4px 0;
}
.sh-empty {
    margin: auto 0;
    text-align: center;
    color: var(--muted, #64748b);
    font-family: 'IBM Plex Mono', monospace;
    font-size: 12px;
    padding: 24px 0;
}
.sh-group-label {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 10px;
    letter-spacing: .06em;
    color: var(--muted, #64748b);
    text-transform: uppercase;
    padding: 6px 4px 2px;
    display: flex;
    align-items: center;
    gap: 6px;
}
.sh-online-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #22c55e;
    flex-shrink: 0;
}
.sh-online-dot.offline { background: #64748b; }

.sh-list-meta {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 10px;
    color: var(--muted, #64748b);
    padding: 2px 4px 6px;
    text-align: right;
}
.sh-count-badge {
    display: inline-block;
    padding: 1px 6px;
    border-radius: 999px;
    background: var(--accent, #6366f1);
    color: #fff;
    font-family: 'IBM Plex Mono', monospace;
    font-size: 9px;
    font-weight: 700;
    margin-left: 4px;
    line-height: 14px;
    vertical-align: middle;
}
.sh-confirm-txt {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 10px;
    color: var(--text, #e2e8f0);
}
.sh-load-sentinel {
    height: 1px;
    flex-shrink: 0;
}
.sh-loading-row {
    text-align: center;
    padding: 10px 0 4px;
    font-family: 'IBM Plex Mono', monospace;
    font-size: 10px;
    color: var(--muted, #64748b);
    letter-spacing: .06em;
}

/* ── DM Inbox ────────────────────────────────────────────────── */
.sh-inbox-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 10px;
    background: rgba(99,102,241,.05);
    border: 1px solid rgba(99,102,241,.12);
    border-left: 4px solid rgba(99,102,241,.28);
    border-radius: 10px;
    cursor: pointer;
    transition: background .12s;
}
.sh-inbox-item:hover { background: rgba(99,102,241,.10); }
.sh-inbox-item.has-unread { border-left-color: var(--accent, #6366f1); }
.sh-avatar {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent, #6366f1), var(--cyan, #22d3ee));
    color: #fff;
    font-family: 'Bungee', cursive;
    font-size: 13px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.sh-inbox-meta { flex: 1; min-width: 0; }
.sh-inbox-name {
    font-family: 'Be Vietnam Pro', 'DM Sans', sans-serif;
    font-size: 12px;
    font-weight: 700;
    color: var(--accent, #6366f1);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.sh-inbox-preview {
    font-family: 'Be Vietnam Pro', 'DM Sans', sans-serif;
    font-size: 11px;
    color: var(--muted, #64748b);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-top: 1px;
}
.sh-inbox-right { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; flex-shrink: 0; }
.sh-inbox-time { font-family: 'IBM Plex Mono', monospace; font-size: 9px; color: var(--muted, #64748b); }
.sh-inbox-unread {
    background: var(--red, #f43f5e);
    color: #fff;
    border-radius: 999px;
    font-size: 9px;
    font-weight: 700;
    padding: 1px 6px;
    min-width: 18px;
    text-align: center;
    line-height: 15px;
}

/* ── DM Thread ───────────────────────────────────────────────── */
.sh-thread-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    border-bottom: 1px solid var(--border, rgba(99,102,241,.2));
    background: linear-gradient(135deg, rgba(99,102,241,.12), rgba(34,211,238,.07));
    flex-shrink: 0;
}
.sh-back-btn {
    background: none;
    border: 1px solid var(--border, rgba(99,102,241,.2));
    border-radius: 6px;
    color: var(--text, #e2e8f0);
    font-family: 'Be Vietnam Pro', 'DM Sans', sans-serif;
    font-size: 16px;
    width: 28px;
    height: 28px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.sh-back-btn:hover { background: rgba(99,102,241,.1); }
.sh-thread-name {
    font-family: 'Be Vietnam Pro', 'DM Sans', sans-serif;
    font-size: 13px;
    font-weight: 700;
    color: var(--accent, #6366f1);
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.sh-thread-status { font-family: 'IBM Plex Mono', monospace; font-size: 10px; color: var(--muted, #64748b); flex-shrink: 0; }
.sh-messages {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    padding: 10px;
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.sh-bubble-wrap { display: flex; flex-direction: column; gap: 1px; }
.sh-bubble-wrap.me { align-items: flex-end; }
.sh-bubble-wrap.them { align-items: flex-start; }
.sh-bubble {
    max-width: 82%;
    padding: 7px 11px;
    border-radius: 14px;
    font-family: 'Be Vietnam Pro', 'DM Sans', sans-serif;
    font-size: 12px;
    line-height: 1.4;
    word-break: break-word;
    overflow-wrap: anywhere;
    cursor: pointer;
    transition: filter .1s;
    position: relative;
}
.sh-bubble:hover { filter: brightness(1.1); }
/* -- Grouped border-radius for consecutive same-sender bubbles -- */
/* me: default all round */
.sh-bubble.me {
    background: linear-gradient(135deg, var(--accent, #6366f1), var(--cyan, #22d3ee));
    color: #fff;
    border-radius: 14px;
}
/* them: default all round */
.sh-bubble.them {
    background: rgba(99,102,241,.10);
    border: 1px solid rgba(99,102,241,.18);
    color: var(--text, #e2e8f0);
    border-radius: 14px;
}
/* Single message (no group) — tail on the side */
.sh-bubble.me.single           { border-bottom-right-radius: 4px; }
.sh-bubble.them.single         { border-bottom-left-radius: 4px; }
/* First in group */
.sh-bubble.me.group-first      { border-bottom-right-radius: 4px; }
.sh-bubble.them.group-first    { border-bottom-left-radius: 4px; }
/* Middle in group */
.sh-bubble.me.group-mid        { border-top-right-radius: 4px; border-bottom-right-radius: 4px; }
.sh-bubble.them.group-mid      { border-top-left-radius: 4px; border-bottom-left-radius: 4px; }
/* Last in group */
.sh-bubble.me.group-last       { border-top-right-radius: 4px; }
.sh-bubble.them.group-last     { border-top-left-radius: 4px; }

/* Group time separator */
.sh-group-time {
    text-align: center;
    font-family: 'IBM Plex Mono', monospace;
    font-size: 9px;
    color: var(--muted, #64748b);
    padding: 6px 0 2px;
}
.sh-bubble-time { font-family: 'IBM Plex Mono', monospace; font-size: 9px; color: var(--muted, #64748b); padding: 0 4px; display: none; }

/* -- Reply block inside DM bubbles -- */
.sh-bubble .chat-msg-reply {
    padding: 4px 8px;
    margin-bottom: 4px;
    border-radius: 6px;
    border-left: 2px solid;
    cursor: pointer;
    font-size: 11px;
}
.sh-bubble.me .chat-msg-reply {
    background: rgba(255,255,255,.18);
    border-left-color: rgba(255,255,255,.5);
}
.sh-bubble.me .chat-msg-reply-name {
    color: rgba(255,255,255,.85);
    font-weight: 700;
    font-size: 10px;
}
.sh-bubble.me .chat-msg-reply-text {
    color: rgba(255,255,255,.6);
    font-size: 11px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 180px;
}
.sh-bubble.them .chat-msg-reply {
    background: rgba(99,102,241,.12);
    border-left-color: var(--accent, #6366f1);
}
.sh-bubble.them .chat-msg-reply-name {
    color: var(--accent, #6366f1);
    font-weight: 700;
    font-size: 10px;
}
.sh-bubble.them .chat-msg-reply-text {
    color: var(--muted, #64748b);
    font-size: 11px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 180px;
}

/* -- DM Reply preview bar -- */
.sh-dm-reply-bar {
    display: none;
    align-items: center;
    gap: 6px;
    padding: 5px 10px;
    flex-shrink: 0;
    border-top: 1px solid var(--border, rgba(99,102,241,.2));
    background: rgba(99,102,241,.06);
}
.sh-dm-reply-bar.show { display: flex; }
.sh-dm-reply-bar-label {
    font-family: 'Be Vietnam Pro', 'DM Sans', sans-serif;
    font-weight: 700;
    font-size: 11px;
    color: var(--accent, #6366f1);
    white-space: nowrap;
}
.sh-dm-reply-bar-snippet {
    font-family: 'Be Vietnam Pro', 'DM Sans', sans-serif;
    font-size: 11px;
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: var(--muted, #64748b);
}
.sh-dm-reply-bar-close {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--muted, #64748b);
    font-family: 'Be Vietnam Pro', 'DM Sans', sans-serif;
    font-size: 15px;
    padding: 0 2px;
    line-height: 1;
    flex-shrink: 0;
}
.sh-dm-reply-bar-close:hover { color: var(--text, #e2e8f0); }

.sh-compose {
    display: flex;
    gap: 6px;
    padding: 8px 10px;
    border-top: 1px solid var(--border, rgba(99,102,241,.2));
    background: var(--surface, #12122a);
    flex-shrink: 0;
}
.sh-compose-input {
    flex: 1;
    min-height: 38px;
    padding: 9px 12px;
    border-radius: 10px;
    border: 1px solid var(--border, rgba(99,102,241,.2));
    background: var(--bg2, #0a0a1f);
    color: var(--text, #e2e8f0);
    font-family: 'Be Vietnam Pro', 'DM Sans', sans-serif;
    font-size: 13px;
    outline: none;
}
.sh-compose-input:focus {
    border-color: rgba(99,102,241,.5);
    box-shadow: 0 0 0 3px rgba(99,102,241,.10);
}
.sh-compose-send {
    min-width: 72px;
    border: none;
    border-radius: 10px;
    background: linear-gradient(135deg, var(--accent, #6366f1) 0%, var(--cyan, #22d3ee) 100%);
    color: #fff;
    font-family: 'Bungee', cursive;
    font-size: 12px;
    letter-spacing: .04em;
    cursor: pointer;
    padding: 0 12px;
}
.sh-compose-send:disabled { opacity: .45; cursor: not-allowed; }

/* ── Hub Search ──────────────────────────────────────────────── */
.sh-search-wrap {
    padding: 6px 8px;
    border-bottom: 1px solid var(--border, rgba(99,102,241,.2));
    flex-shrink: 0;
}
.sh-search {
    width: 100%;
    box-sizing: border-box;
    padding: 5px 10px;
    border: 1px solid var(--border, rgba(99,102,241,.2));
    border-radius: 8px;
    background: var(--surface2, var(--surface, #12122a));
    color: var(--text, #e2e8f0);
    font-family: 'IBM Plex Mono', monospace;
    font-size: 11px;
    outline: none;
}
.sh-search:focus { border-color: rgba(99,102,241,.4); }

/* ================================================================
   Global Lobby Chat — content injected into #shGlobalChatContainer
   ================================================================ */
.chat-list {
    flex: 1; overflow-y: auto; padding: 6px; min-height: 0;
    display: flex; flex-direction: column; gap: 6px;
}
.chat-empty {
    text-align: center; padding: 24px 0;
    color: var(--muted, #64748b);
    font-family: 'IBM Plex Mono', monospace;
    font-size: 12px;
}

/* ── Chat item (grouped by author) ── */
.chat-item {
    display: flex; flex-direction: row; align-items: flex-start;
    gap: 7px; padding: 5px 8px; border-radius: 8px;
    border-left: 3px solid rgba(99,102,241,.18);
}
.chat-item.me { border-left-color: var(--accent, #6366f1); background: rgba(99,102,241,.06); }
.chat-item.tier-bronze { border-left-color: rgba(180,83,9,.45); }
.chat-item.tier-silver { border-left-color: rgba(71,85,105,.45); }
.chat-item.tier-gold   { border-left-color: rgba(217,119,6,.55); }
.chat-item.tier-diamond{ border-left-color: rgba(14,165,233,.55); }
.chat-item.tier-legend { border-left-color: rgba(168,85,247,.65); }

.chat-item-avatar {
    width: 32px; height: 32px; flex-shrink: 0;
    border-radius: 8px; overflow: hidden;
    background: rgba(79,104,232,.08);
    border: 1px solid var(--border, rgba(99,102,241,.2));
    margin-top: 1px;
    cursor: pointer;
    transition: opacity .12s;
}
.chat-item-avatar:hover { opacity: .8; }
.chat-item-avatar.chat-item-avatar-letter {
    display: flex; align-items: center; justify-content: center;
    font-size: 13px; font-weight: 700;
    color: var(--accent, #6366f1);
}
.chat-item-avatar img {
    width: 100%; height: 100%; object-fit: contain; display: block;
}
.chat-item-avatar.char-rare {
    border: 2px solid #8b5cf6;
    box-shadow: 0 0 5px rgba(139, 92, 246, .3);
}
.chat-item-content {
    flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px;
}

.chat-item-author {
    display: flex; align-items: center;
    justify-content: space-between; gap: 6px;
}
.chat-item-author-main { display: flex; align-items: center; gap: 5px; min-width: 0; flex: 1; }
.chat-item-name {
    font-family: 'Be Vietnam Pro', 'DM Sans', sans-serif;
    font-size: 11.5px; font-weight: 700;
    color: var(--accent, #6366f1);
    max-width: 110px; white-space: nowrap;
    overflow: hidden; text-overflow: ellipsis;
    cursor: pointer;
}
.chat-item-name:hover { text-decoration: underline; }
.chat-item-name.verified-badge::after { content: ' ✓'; font-size: 9px; opacity: .85; }
.chat-item-elo {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 8.5px; font-weight: 700;
    padding: 1px 4px; border-radius: 4px;
    border: 1px solid var(--border, rgba(99,102,241,.2));
    background: var(--surface2, #111128);
    color: var(--muted, #64748b);
    white-space: nowrap; flex-shrink: 0;
}
.chat-item-elo.tier-bronze { color: #b45309; background: rgba(146,64,14,.1); border-color: rgba(146,64,14,.25); }
.chat-item-elo.tier-silver { color: #64748b; background: rgba(71,85,105,.1); border-color: rgba(71,85,105,.25); }
.chat-item-elo.tier-gold   { color: #b45309; background: rgba(217,119,6,.12); border-color: rgba(217,119,6,.3); }
.chat-item-elo.tier-diamond{ color: #0891b2; background: rgba(14,165,233,.1); border-color: rgba(14,165,233,.25); }
.chat-item-elo.tier-legend { color: #7c3aed; background: rgba(168,85,247,.1); border-color: rgba(168,85,247,.25); }
.chat-item-time {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 9px; color: var(--muted, #64748b);
    white-space: nowrap; flex-shrink: 0;
}

.chat-msg-lines { display: flex; flex-direction: column; gap: 2px; padding-left: 2px; }
.chat-msg-line { cursor: pointer; padding: 2px 4px; border-radius: 4px; transition: background .1s; }
.chat-msg-line:hover { background: rgba(99,102,241,.07); }
.chat-msg-line.self { cursor: default; }
.chat-msg-line.self:hover { background: transparent; }
.chat-item-msg {
    font-family: 'Be Vietnam Pro', 'DM Sans', sans-serif;
    font-size: 12.5px; line-height: 1.4;
    color: var(--text, #e2e8f0);
    overflow-wrap: anywhere; word-break: break-word;
}
.chat-item-msg a { color: var(--accent, #6366f1); text-decoration: underline; text-underline-offset: 2px; }

.chat-mention-tag {
    display: inline-flex; align-items: center;
    margin-right: 3px; padding: 0 5px;
    border-radius: 999px;
    background: rgba(99,102,241,.12);
    border: 1px solid rgba(99,102,241,.22);
    color: var(--accent, #6366f1);
    font-family: 'Be Vietnam Pro', 'DM Sans', sans-serif;
    font-size: 10.5px; font-weight: 700;
}
.chat-msg-reply {
    padding: 4px 8px; margin-bottom: 2px;
    border-left: 2px solid rgba(99,102,241,.45);
    border-radius: 4px; background: rgba(99,102,241,.07);
}
.chat-msg-reply-name {
    font-family: 'Be Vietnam Pro', 'DM Sans', sans-serif;
    font-size: 10px; font-weight: 700;
    color: var(--accent, #6366f1);
}
.chat-msg-reply-text {
    font-family: 'Be Vietnam Pro', 'DM Sans', sans-serif;
    font-size: 11px; color: var(--muted, #64748b); line-height: 1.3;
}

/* ── Reply preview bar ── */
.chat-reply-preview {
    display: none; align-items: center; gap: 6px;
    padding: 5px 10px; flex-shrink: 0;
    border-top: 1px solid var(--border, rgba(99,102,241,.2));
    background: rgba(99,102,241,.06);
}
.chat-reply-preview.show { display: flex; }
.chat-reply-label {
    font-family: 'Be Vietnam Pro', 'DM Sans', sans-serif;
    font-weight: 700; font-size: 11px;
    color: var(--accent, #6366f1); white-space: nowrap;
}
.chat-reply-snippet {
    font-family: 'Be Vietnam Pro', 'DM Sans', sans-serif;
    font-size: 11px; flex: 1;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
    color: var(--muted, #64748b);
}
.chat-reply-cancel {
    background: none; border: none; cursor: pointer;
    color: var(--muted, #64748b);
    font-family: 'Be Vietnam Pro', 'DM Sans', sans-serif;
    font-size: 15px; padding: 0 2px; line-height: 1; flex-shrink: 0;
}

/* ── Compose area ── */
.chat-compose {
    display: flex; gap: 6px; padding: 8px 10px; flex-shrink: 0;
    border-top: 1px solid var(--border, rgba(99,102,241,.2));
    background: var(--surface, #12122a);
}
.chat-input {
    flex: 1; padding: 8px 12px; border-radius: 10px; outline: none;
    border: 1px solid var(--border, rgba(99,102,241,.2));
    background: var(--bg2, #0a0a1f);
    color: var(--text, #e2e8f0);
    font-family: 'Be Vietnam Pro', 'DM Sans', sans-serif;
    font-size: 13px; min-height: 36px;
}
.chat-input:focus { border-color: rgba(99,102,241,.5); box-shadow: 0 0 0 3px rgba(99,102,241,.08); }
.chat-send {
    border: none; border-radius: 10px; cursor: pointer;
    background: linear-gradient(135deg, var(--accent, #6366f1) 0%, var(--cyan, #22d3ee) 100%);
    color: #fff; font-family: 'Bungee', cursive;
    font-size: 12px; letter-spacing: .04em;
    padding: 0 14px; min-width: 60px;
}
.chat-send:disabled { opacity: .45; cursor: not-allowed; }

/* ── Tiny button (shared: friends/requests rows + profile) ─── */
.tiny-btn {
    padding: 5px 10px;
    font-family: 'IBM Plex Mono', monospace;
    font-size: 11px;
    font-weight: 700;
    border: none;
    border-radius: 6px;
    background: var(--accent, #6366f1);
    color: #fff;
    cursor: pointer;
    transition: background .15s, transform .1s;
    white-space: nowrap;
    letter-spacing: .02em;
}
.tiny-btn:hover { background: #818cf8; transform: translateY(-1px); }
.tiny-btn:disabled { opacity: .5; cursor: not-allowed; transform: none; }
.tiny-btn.danger { background: var(--red, #e5304e); }
.tiny-btn.danger:hover { background: #f43f5e; }

/* ── Profile tooltip (fixed, appended to body) ───────────────── */
.sh-ptip {
    position: fixed;
    z-index: 9999;
    width: 230px;
    font-family: 'Be Vietnam Pro', 'DM Sans', sans-serif;
    filter: drop-shadow(0 8px 24px rgba(0,0,0,.28));
    animation: shPtipIn .12s ease;
}
@keyframes shPtipIn {
    from { opacity: 0; transform: translateY(4px) scale(.97); }
    to   { opacity: 1; transform: none; }
}
.sh-ptip-inner {
    background: var(--surface, #12122a);
    border: 1px solid var(--border, rgba(99,102,241,.22));
    border-radius: 14px;
    overflow: hidden;
}
/* Arrow */
.sh-ptip-arr {
    position: absolute;
    width: 12px; height: 12px;
    background: var(--surface, #12122a);
    border: 1px solid var(--border, rgba(99,102,241,.22));
    transform: rotate(45deg);
}
.sh-ptip-above .sh-ptip-arr {
    bottom: -7px;
    border-top: none; border-left: none;
}
.sh-ptip-below .sh-ptip-arr {
    top: -7px;
    border-bottom: none; border-right: none;
}
/* Loading */
.sh-ptip-loading {
    padding: 20px;
    text-align: center;
    font-family: 'IBM Plex Mono', monospace;
    font-size: 18px;
    color: var(--muted, #64748b);
    letter-spacing: .2em;
}
/* Body */
.sh-ptip-body { padding: 12px; }
.sh-ptip-top {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}
.sh-ptip-av {
    width: 52px; height: 60px;
    flex-shrink: 0;
    border-radius: 10px;
    overflow: hidden;
    background: rgba(79,104,232,.08);
    border: 1px solid var(--border, rgba(99,102,241,.2));
}
.sh-ptip-av.char-rare {
    border: 2px solid #8b5cf6;
    box-shadow: 0 0 6px rgba(139, 92, 246, .35);
}
.sh-ptip-av img {
    width: 100%; height: 100%; object-fit: contain; display: block;
}
.sh-ptip-meta { flex: 1; min-width: 0; }
.sh-ptip-name {
    font-family: 'Be Vietnam Pro', 'DM Sans', sans-serif;
    font-size: 14px; font-weight: 700;
    color: var(--text, #e2e8f0);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.sh-ptip-name.verified::after {
    content: ' ✓';
    font-size: 10px;
    color: var(--accent, #6366f1);
    opacity: .9;
}
.sh-ptip-pts {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 12px; font-weight: 700;
    color: var(--cyan, #22d3ee);
    margin-top: 2px;
}
.sh-ptip-loc {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 10px;
    color: var(--muted, #64748b);
    margin-top: 2px;
}
.sh-ptip-status {
    font-family: 'Be Vietnam Pro', 'DM Sans', sans-serif;
    font-size: 11px; font-weight: 700;
    color: #22c55e;
    margin-bottom: 8px;
    padding: 4px 8px;
    background: rgba(34,197,94,.1);
    border-radius: 6px;
    text-align: center;
}
.sh-ptip-acts {
    display: flex; gap: 6px;
    margin-top: 2px;
}
.sh-ptip-acts .tiny-btn {
    flex: 1; font-size: 11px; padding: 6px 8px; text-align: center;
}

/* ── Global Chat ──────────────────────────────────────────────── */
.sh-global-msg {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0 5px;
    padding: 5px 12px;
    font-size: 13px;
    line-height: 1.4;
    border-bottom: 1px solid var(--border, rgba(99,102,241,.08));
}
.sh-global-msg:last-child { border-bottom: none; }
.sh-global-msg > .chat-item-avatar {
    width: 22px; height: 22px; flex-shrink: 0;
    border-radius: 5px; overflow: hidden;
    background: rgba(79,104,232,.08);
}
.sh-global-msg > .chat-item-avatar img {
    width: 100%; height: 100%; object-fit: contain; display: block;
}
.sh-global-msg > .chat-item-avatar-letter {
    display: flex; align-items: center; justify-content: center;
    font-size: 11px; font-weight: 700;
    color: var(--accent, #6366f1);
}
.sh-global-msg .chat-item-name {
    font-weight: 700;
    color: var(--accent, #6366f1);
    cursor: pointer;
    white-space: nowrap;
}
.sh-global-msg .chat-item-name:hover { text-decoration: underline; }
.sh-global-colon { color: var(--muted, #64748b); }
.sh-global-text { color: var(--text, #e2e8f0); flex: 1; word-break: break-word; }
.sh-global-time {
    font-size: 10px;
    color: var(--muted, #64748b);
    margin-left: auto;
    white-space: nowrap;
}

/* ── Global Chat Reply Bar ────────────────────────────────────── */
.sh-gc-reply-bar {
    display: flex; align-items: center; gap: 6px;
    padding: 6px 12px;
    background: var(--surface2, #14142e);
    border-top: 1px solid var(--border, rgba(99,102,241,.15));
    font-size: 11px;
}
.sh-gc-reply-label { color: var(--accent, #6366f1); font-weight: 600; white-space: nowrap; }
.sh-gc-reply-snippet { color: var(--muted, #64748b); flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sh-gc-reply-close { background: none; border: none; color: var(--muted); cursor: pointer; font-size: 13px; padding: 0 4px; }
.sh-gc-reply-close:hover { color: var(--text); }

/* ── Chat Msg Reply Bubble ───────────────────────────────────── */
.chat-msg-reply {
    padding: 4px 8px; margin-bottom: 2px;
    border-left: 2px solid var(--accent, #6366f1);
    background: rgba(99,102,241,.06);
    border-radius: 4px; font-size: 11px;
}
.chat-msg-reply-name { color: var(--accent, #6366f1); font-weight: 600; }
.chat-msg-reply-text { color: var(--muted, #64748b); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 200px; }
.chat-mention-tag { color: var(--accent, #6366f1); font-weight: 600; margin-right: 3px; }
.chat-msg-line { cursor: pointer; padding: 1px 0; border-radius: 4px; }
.chat-msg-line:hover { background: rgba(99,102,241,.04); }
.chat-link { color: var(--cyan, #22d3ee); text-decoration: underline; }

/* ── Lock Banner ──────────────────────────────────────────────── */
.sh-locked-banner {
    padding: 20px 16px;
    text-align: center;
    color: var(--muted, #64748b);
    font-size: 13px;
    font-style: italic;
    line-height: 1.5;
}
