/* ═══════════════════════════════════════════════════════════
   AURA CHESS — Community & Messaging System
   Public chat · Private messages · Friends · Notifications
   Uses the site design tokens from styles.css (:root vars).
   RTL-first (logical properties throughout).
   ═══════════════════════════════════════════════════════════ */

.community-wrap {
    max-width: 1200px;
    margin: 0 auto;
    padding: 96px 16px 24px;
    height: 100vh;
    display: flex;
    flex-direction: column;
    box-sizing: border-box;
}

.community-shell {
    flex: 1;
    min-height: 0;
    display: grid;
    grid-template-columns: 230px 1fr;
    gap: 16px;
}

/* ── Navigation rail ──
   Premium nav items (icon tile + label + active accent bar) with the status
   cluster (online strip + presence selector) anchored to the bottom. Full-height
   so the rail reads as a real navigation surface, not a floating button list. */
.community-tabs {
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid var(--glass-border, rgba(255, 255, 255, 0.08));
    border-radius: var(--radius-lg);
    padding: 14px 12px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    height: 100%;
    min-height: 0;
    box-sizing: border-box;
}

.community-tab {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 12px 8px 10px;
    border-radius: var(--radius-md);
    border: 1px solid transparent;
    background: transparent;
    color: var(--text-secondary);
    font-family: inherit;
    font-size: 0.94rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.18s ease;
    text-align: start;
    width: 100%;
    position: relative;
}

.community-tab i {
    width: 34px;
    height: 34px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.04);
    font-size: 0.95rem;
    flex-shrink: 0;
    transition: all 0.18s ease;
}

.community-tab:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.03);
}

.community-tab:hover i {
    background: rgba(255, 255, 255, 0.08);
}

.community-tab.active {
    color: var(--text-primary);
    background: var(--accent-transparent);
    border-color: rgba(0, 200, 255, 0.25);
}

.community-tab.active i {
    background: var(--accent-gradient);
    color: #001018;
}

/* inset active accent bar on the inline-start edge */
.community-tab.active::before {
    content: '';
    position: absolute;
    inset-inline-start: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 20px;
    border-radius: 0 3px 3px 0;
    background: var(--accent);
}

[dir="rtl"] .community-tab.active::before {
    border-radius: 3px 0 0 3px;
}

.tab-icon-wrap {
    position: relative;
    display: inline-flex;
}

.tab-badge {
    position: absolute;
    top: -6px;
    inset-inline-end: -8px;
    min-width: 16px;
    height: 16px;
    padding: 0 4px;
    border-radius: var(--radius-full);
    background: #ef4444;
    color: #fff;
    font-size: 0.65rem;
    font-weight: 800;
    display: none;
    align-items: center;
    justify-content: center;
    box-shadow: 0 0 0 2px #0f172a;
}

.tab-badge.show {
    display: inline-flex;
}

.community-online-chip {
    margin-top: auto;
    padding: 10px 14px;
    border-radius: var(--radius-md);
    background: rgba(34, 197, 94, 0.08);
    border: 1px solid rgba(34, 197, 94, 0.2);
    color: var(--success);
    font-size: 0.85rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 8px;
}

.community-online-chip .dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--success);
    box-shadow: 0 0 8px var(--success);
    animation: pulse-dot 2s infinite;
}

@keyframes pulse-dot {
    50% {
        opacity: 0.4;
    }
}

/* ── Main panel ── */
.community-panel {
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid var(--glass-border, rgba(255, 255, 255, 0.08));
    border-radius: var(--radius-lg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    display: flex;
    flex-direction: column;
    min-height: 0;
    overflow: hidden;
}

.community-view {
    display: none;
    flex: 1;
    min-height: 0;
    flex-direction: column;
}

.community-view.active {
    display: flex;
}

/* ══════════════ CHATWOOT-STYLE CONVERSATION WORKSPACE ══════════════
   Public chat and DMs both frame the thread with a conversation header, a card
   composer, and a right details pane — Chatwoot's composition, AuraChess colors. */

/* public chat becomes a row: thread column + details pane */
#view-chat.active {
    flex-direction: row;
}

.conv-main {
    flex: 1;
    min-width: 0;
    min-height: 0;
    display: flex;
    flex-direction: column;
    position: relative;
}

/* conversation header bar (public chat header + shared look with the DM head) */
.conv-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
    min-height: 62px;
}

.conv-avatar {
    width: 38px;
    height: 38px;
    border-radius: 12px;
    object-fit: cover;
    flex-shrink: 0;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
}

.conv-header-info {
    flex: 1;
    min-width: 0;
}

.conv-title {
    font-weight: 800;
    font-size: 0.98rem;
    color: var(--text-primary);
}

.conv-sub {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.76rem;
    color: var(--text-secondary);
    margin-top: 1px;
}

.conv-ping {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--success);
    box-shadow: 0 0 6px var(--success);
    flex-shrink: 0;
}

.conv-details-btn {
    flex-shrink: 0;
}

.conv-details-btn.active {
    color: var(--accent);
    background: var(--accent-transparent);
}

/* right details pane (shared by public chat + DMs) */
.conv-details {
    width: 288px;
    flex-shrink: 0;
    border-inline-start: 1px solid var(--border);
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    background: rgba(0, 0, 0, 0.12);
}

.conv-details.collapsed {
    display: none;
}

.conv-details-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 14px 16px;
    font-weight: 800;
    font-size: 0.9rem;
    color: var(--text-primary);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    background: var(--bg-surface);
    z-index: 2;
}

.detail-section {
    padding: 14px 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

.detail-label {
    font-size: 0.68rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    color: var(--text-secondary);
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.detail-label i {
    color: #fbbf24;
}

.detail-about {
    font-size: 0.82rem;
    line-height: 1.6;
    color: var(--text-secondary);
    margin: 0;
}

.detail-online-row {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.86rem;
    color: var(--text-primary);
}

.detail-online-row b {
    color: var(--success);
    font-variant-numeric: tabular-nums;
}

/* DM details peer block */
.detail-peer {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 4px;
    padding: 18px 16px;
}

.detail-peer .c-avatar.lg {
    width: 64px;
    height: 64px;
}

.detail-peer .presence-dot {
    width: 14px;
    height: 14px;
    border-width: 3px;
}

.dm-detail-name {
    font-weight: 800;
    font-size: 1rem;
    color: var(--text-primary);
    margin-top: 6px;
}

.dm-detail-status {
    font-size: 0.76rem;
    color: var(--text-secondary);
}

/* the relocated pinned bar reads as a plain card inside the details pane */
#chatPinnedSection .pinned-bar {
    margin: 0;
}

/* hide the pinned section entirely when nothing is pinned */
#chatPinnedSection:not(:has(.pinned-bar.show)) {
    display: none;
}

/* relocated DM search / pinned panels now read as pane sections, not overlays */
.conv-details .dm-search-panel,
.conv-details .dm-pinned-panel {
    background: transparent;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
    max-height: 320px;
}

.conv-details .dm-search-row {
    border-bottom: none;
    padding: 12px 16px 8px;
}

.conv-details .dm-pinned-head {
    padding: 12px 16px 8px;
    border-bottom: none;
}

/* ── Panel headers ── */
.panel-head {
    padding: 14px 18px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    flex-shrink: 0;
}

.panel-head h2 {
    font-size: 1.05rem;
    font-weight: 800;
    color: var(--text-primary);
    margin: 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.panel-head h2 i {
    color: var(--accent);
}

.panel-head .spacer {
    flex: 1;
}

/* ── Badges ── */
.u-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 1px 8px;
    border-radius: var(--radius-full);
    font-size: 0.66rem;
    font-weight: 800;
    letter-spacing: 0.3px;
    vertical-align: middle;
    line-height: 1.6;
}

.u-badge.founder {
    background: rgba(245, 158, 11, 0.15);
    color: #fbbf24;
    border: 1px solid rgba(245, 158, 11, 0.35);
}

.u-badge.admin {
    background: rgba(168, 85, 247, 0.15);
    color: #c084fc;
    border: 1px solid rgba(168, 85, 247, 0.35);
}

.u-badge.moderator {
    background: rgba(34, 197, 94, 0.15);
    color: #4ade80;
    border: 1px solid rgba(34, 197, 94, 0.35);
}

.u-badge.premium {
    background: rgba(0, 200, 255, 0.12);
    color: var(--accent);
    border: 1px solid rgba(0, 200, 255, 0.3);
}

.u-badge.champion {
    background: rgba(251, 191, 36, 0.12);
    color: #fde68a;
    border: 1px solid rgba(251, 191, 36, 0.3);
}

.u-badge.member {
    background: rgba(148, 163, 184, 0.1);
    color: #94a3b8;
    border: 1px solid rgba(148, 163, 184, 0.2);
}

/* Custom admin-assigned badges */
.u-badge.vip {
    background: linear-gradient(135deg, rgba(251, 191, 36, 0.2), rgba(245, 158, 11, 0.15));
    color: #fbbf24;
    border: 1px solid rgba(251, 191, 36, 0.35);
    font-weight: 700;
}

.u-badge.streamer {
    background: linear-gradient(135deg, rgba(244, 114, 182, 0.2), rgba(236, 72, 153, 0.15));
    color: #f472b6;
    border: 1px solid rgba(244, 114, 182, 0.35);
}

.u-badge.trusted {
    background: linear-gradient(135deg, rgba(52, 211, 153, 0.2), rgba(16, 185, 129, 0.15));
    color: #34d399;
    border: 1px solid rgba(52, 211, 153, 0.35);
}

.u-badge.tournament_champion {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.2), rgba(217, 119, 6, 0.15));
    color: #f59e0b;
    border: 1px solid rgba(245, 158, 11, 0.35);
    font-weight: 700;
}

/* Colored name glow animation */
.colored-name {
    font-weight: 700 !important;
    transition: text-shadow 0.3s ease;
}

.colored-name:hover {
    filter: brightness(1.2);
}

/* ── Avatars & presence ── */
.c-avatar {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    object-fit: cover;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    flex-shrink: 0;
}

.c-avatar.sm {
    width: 30px;
    height: 30px;
}

.c-avatar.lg {
    width: 46px;
    height: 46px;
}

.presence-wrap {
    position: relative;
    flex-shrink: 0;
}

.presence-dot {
    position: absolute;
    bottom: 0;
    inset-inline-end: 0;
    width: 11px;
    height: 11px;
    border-radius: 50%;
    background: #64748b;
    border: 2px solid #0f131a;
}

.presence-dot.online {
    background: var(--success);
    box-shadow: 0 0 6px rgba(34, 197, 94, 0.6);
}

/* ══════════════ PUBLIC CHAT ══════════════ */

.pinned-bar {
    display: none;
    margin: 6px 10px 0;
    padding: 6px 10px;
    border-radius: var(--radius-md);
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.1), rgba(0, 200, 255, 0.06));
    border: 1px solid rgba(245, 158, 11, 0.3);
    align-items: flex-start;
    gap: 8px;
    flex-shrink: 0;
    cursor: pointer;
    transition: background 0.2s;
}

.pinned-bar:hover {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.15), rgba(0, 200, 255, 0.1));
}

@keyframes highlight-flash {
    0% { background-color: rgba(245, 158, 11, 0.5); }
    100% { background-color: transparent; }
}
.highlight-msg {
    animation: highlight-flash 2s ease-out;
}

.pinned-bar.show {
    display: flex;
}

.pinned-bar .pin-ico {
    color: #fbbf24;
    font-size: 1rem;
    margin-top: 2px;
}

.pinned-bar .pin-title {
    font-weight: 800;
    color: #fde68a;
    font-size: 0.75rem;
    margin-bottom: 1px;
}

.pinned-bar .pin-body {
    color: var(--text-primary);
    font-size: 0.8rem;
    word-break: break-word;
    white-space: pre-wrap;
}

.pinned-bar .pin-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-top: 6px;
    padding: 5px 14px;
    border-radius: var(--radius-full);
    background: var(--accent-gradient);
    color: #001018;
    font-weight: 800;
    font-size: 0.8rem;
    text-decoration: none;
}

.pinned-bar .pin-nav {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1px;
    padding-inline-start: 12px;
    border-inline-start: 1px solid rgba(255, 255, 255, 0.1);
    margin-inline-start: 4px;
    align-self: stretch;
}

.pin-nav-btn {
    background: rgba(255, 255, 255, 0.05);
    border: none;
    color: var(--text-secondary);
    width: 26px;
    height: 26px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 0.8rem;
    transition: all 0.2s ease;
}

.pin-nav-btn:first-child {
    border-start-start-radius: 6px;
    border-end-start-radius: 6px;
}

.pin-nav-btn:last-child {
    border-start-end-radius: 6px;
    border-end-end-radius: 6px;
}

.pin-nav-btn:hover {
    background: rgba(255, 255, 255, 0.15);
    color: var(--text-primary);
}

.chat-scroll {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    padding: 14px 16px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    scroll-behavior: smooth;
}

.chat-load-older {
    align-self: center;
    margin-bottom: 8px;
    padding: 5px 16px;
    border-radius: var(--radius-full);
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border);
    color: var(--text-secondary);
    font-size: 0.78rem;
    font-family: inherit;
    cursor: pointer;
    display: none;
}

.chat-load-older.show {
    display: block;
}

.chat-load-older:hover {
    color: var(--text-primary);
    border-color: var(--border-hover);
}

.scroll-bottom-btn {
    position: absolute;
    bottom: 80px;
    inset-inline-end: 20px;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: var(--bg-surface-elevated, #1f2937);
    border: 1px solid var(--border);
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
    z-index: 10;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    opacity: 0;
    transform: translateY(10px) scale(0.9);
    pointer-events: none;
}

.scroll-bottom-btn.show {
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: auto;
}

.scroll-bottom-btn:hover {
    background: var(--accent);
    color: #000;
    border-color: var(--accent);
}

/* Date / unread dividers — pure client-side grouping, no new data */
.day-sep,
.unread-sep {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 10px 4px 6px;
    color: var(--text-secondary);
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.4px;
}

.day-sep::before,
.day-sep::after,
.unread-sep::before,
.unread-sep::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border);
}

.unread-sep {
    color: var(--accent);
}

.unread-sep::before,
.unread-sep::after {
    background: rgba(0, 200, 255, 0.25);
}

/* ── Grouped message timeline ──
   Fixed avatar gutter + content column. The first message of a turn (a run of
   consecutive messages from one author, see reconcileGrouping in community.js)
   shows the avatar + name header; continuation rows (.grouped) drop both and
   tuck tight under it, with the time revealed in the gutter on hover. This is
   the core structural change — the conversation reads as turns, not a flat list. */
.msg-row {
    display: grid;
    grid-template-columns: 42px 1fr;
    column-gap: 8px;
    padding: 1px 8px;
    border-radius: var(--radius-md);
    position: relative;
    transition: background 0.12s;
}

.msg-row>.presence-wrap {
    grid-column: 1;
    grid-row: 1;
    align-self: start;
    margin-top: 1px;
}

.msg-row>.msg-main {
    grid-column: 2;
    grid-row: 1;
    min-width: 0;
}

.msg-row>.msg-rail-time {
    grid-column: 1;
    grid-row: 1;
    align-self: start;
    text-align: center;
    font-size: 0.6rem;
    color: var(--text-muted);
    line-height: 1.9;
    opacity: 0;
    pointer-events: none;
    font-variant-numeric: tabular-nums;
}

/* a new turn breathes; continuation rows are tight */
.msg-row:not(.grouped) {
    margin-top: 12px;
}

#chatList>.msg-row:first-child {
    margin-top: 2px;
}

.msg-row.grouped {
    margin-top: 0;
}

.msg-row:hover {
    background: rgba(255, 255, 255, 0.03);
}

.msg-row.grouped>.presence-wrap {
    display: none;
}

.msg-row.grouped .msg-head {
    display: none;
}

.msg-row.grouped .msg-body {
    margin-top: 0;
}

.msg-row:not(.grouped)>.msg-rail-time {
    display: none;
}

.msg-row.grouped:hover>.msg-rail-time {
    opacity: 1;
}

.msg-row.highlight {
    animation: msg-flash 2s ease;
}

@keyframes msg-flash {

    0%,
    40% {
        background: rgba(0, 200, 255, 0.12);
    }
}

/* Restrained entrance transition for genuinely new messages only
   (initial history load is not animated — see js/community.js) */
.msg-row.enter,
.bubble-row.enter,
.msg-official.enter {
    animation: msg-enter 0.35s ease;
}

@keyframes msg-enter {
    from {
        opacity: 0;
        transform: translateY(6px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@media (prefers-reduced-motion: reduce) {

    .msg-row.enter,
    .bubble-row.enter,
    .msg-official.enter {
        animation: none;
    }
}

.msg-main {
    flex: 1;
    min-width: 0;
}

.msg-head {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.msg-user {
    font-weight: 800;
    font-size: 0.9rem;
    color: var(--text-primary);
    cursor: pointer;
}

.msg-user:hover {
    color: var(--accent);
}

.msg-time {
    color: #64748b;
    font-size: 0.7rem;
}

.msg-edited {
    color: #64748b;
    font-size: 0.68rem;
    font-style: italic;
}

.msg-body {
    color: #e2e8f0;
    font-size: 0.93rem;
    line-height: 1.55;
    word-break: break-word;
    white-space: pre-wrap;
    margin-top: 1px;
}

.msg-body .mention {
    color: var(--accent);
    background: var(--accent-transparent);
    border-radius: 4px;
    padding: 0 3px;
    font-weight: 700;
}

.msg-reply-ref {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.75rem;
    color: var(--text-secondary);
    background: rgba(255, 255, 255, 0.04);
    border-inline-start: 2px solid var(--accent);
    border-radius: 6px;
    padding: 3px 8px;
    margin-bottom: 3px;
    max-width: 480px;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
    cursor: pointer;
}

.msg-reply-ref .r-user {
    color: var(--accent);
    font-weight: 700;
}

/* Hover actions */
.msg-actions {
    position: absolute;
    top: -12px;
    inset-inline-end: 10px;
    display: none;
    gap: 2px;
    background: #131a24;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 3px;
    z-index: 5;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
}

.msg-row:hover .msg-actions {
    display: flex;
}

.msg-act {
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    border-radius: 8px;
    color: var(--text-secondary);
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.15s;
}

.msg-act:hover {
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-primary);
}

.msg-act.danger:hover {
    background: rgba(239, 68, 68, 0.15);
    color: #f87171;
}

/* The add-reaction trigger is grouped into .msg-actions (see community.js) so
   it shows/hides with the rest of the hover toolbar instead of floating on
   its own under the message. Match the other icons' size exactly. */
.msg-actions .reaction-add-btn {
    width: 28px;
    height: 28px;
    border-radius: 8px;
}

/* .msg-actions floats near the row's inline-end edge (see .msg-actions
   above), so the default `inset-inline-start: 0` on .reaction-picker — which
   anchors it to expand toward inline-end — pushes the 9-emoji grid straight
   off the edge of the panel. Anchor from the opposite side instead, so it
   opens back into the message content where there's room. */
.msg-actions .reaction-picker {
    inset-inline-start: auto;
    inset-inline-end: 0;
}

/* ══════════════ CHESS SHARING (FEN / PGN inline preview) ══════════════ */

.chess-share-card {
    margin-top: 6px;
    max-width: 240px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 10px;
}

.chess-share-card:focus-visible {
    outline: 2px solid rgba(0, 200, 255, 0.5);
    outline-offset: 2px;
}

.chess-share-board {
    width: 100%;
    aspect-ratio: 1;
    border-radius: var(--radius-md);
    overflow: hidden;
}

.chess-share-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-top: 8px;
    font-size: 0.78rem;
}

.chess-share-title {
    color: var(--text-primary);
    font-weight: 600;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.chess-share-result {
    color: var(--text-secondary);
    font-variant-numeric: tabular-nums;
    flex-shrink: 0;
}

.chess-share-nav {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-top: 6px;
}

.chess-share-nav .composer-btn {
    width: 26px;
    height: 26px;
    font-size: 0.7rem;
}

.chess-share-step {
    font-size: 0.72rem;
    color: var(--text-secondary);
    font-variant-numeric: tabular-nums;
    min-width: 48px;
    text-align: center;
}

.chess-share-actions {
    display: flex;
    gap: 6px;
    margin-top: 8px;
}

.chess-share-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    flex: 1;
    min-width: 0;
    padding: 6px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    font-size: 0.76rem;
    cursor: pointer;
    font-family: inherit;
    transition: all 0.15s;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.chess-share-btn:hover {
    background: rgba(0, 200, 255, 0.08);
    border-color: rgba(0, 200, 255, 0.3);
    color: var(--accent);
}

/* Official announcement card */
.msg-official {
    margin: 8px 4px;
    border-radius: var(--radius-lg);
    border: 1px solid rgba(0, 200, 255, 0.2);
    background: rgba(0, 160, 255, 0.05);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
    padding: 16px;
    position: relative;
    overflow: hidden;
}

.msg-official::after {
    content: '\f0a1'; /* fa-bullhorn */
    font-family: 'Font Awesome 6 Pro', 'Font Awesome 6 Free';
    font-weight: 900;
    position: absolute;
    inset-inline-end: -10px;
    bottom: -15px;
    font-size: 80px;
    color: rgba(0, 200, 255, 0.04);
    pointer-events: none;
    transform: rotate(-15deg);
}

.official-head {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
}

.official-head img {
    width: 30px;
    height: 30px;
    border-radius: 50%;
}

.official-name {
    font-weight: 900;
    font-size: 0.85rem;
    color: var(--accent);
    letter-spacing: 0.5px;
}

.official-chip {
    font-size: 0.62rem;
    font-weight: 800;
    padding: 1px 8px;
    border-radius: var(--radius-full);
    background: var(--accent-transparent);
    border: 1px solid rgba(0, 200, 255, 0.3);
    color: var(--accent);
}

.official-title {
    font-weight: 800;
    color: #fff;
    font-size: 0.9rem;
    margin-bottom: 4px;
}

.official-body {
    color: #dbe6f0;
    font-size: 0.85rem;
    line-height: 1.6;
    white-space: pre-wrap;
    word-break: break-word;
}

.official-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-top: 12px;
    padding: 10px 24px;
    border-radius: var(--radius-md);
    background: #00c8ff;
    color: #001018;
    font-weight: 800;
    font-size: 0.78rem;
    text-decoration: none;
    transition: transform 0.15s, box-shadow 0.15s;
}

.official-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px var(--accent-glow);
}

/* Composer — single elevated input surface */
.chat-composer {
    padding: 12px 16px 16px;
    border-top: 1px solid var(--border);
    flex-shrink: 0;
    position: relative;
}

.composer-reply {
    display: none;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    margin-bottom: 8px;
    background: rgba(0, 200, 255, 0.06);
    border: 1px solid rgba(0, 200, 255, 0.2);
    border-radius: var(--radius-md);
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.composer-reply.show {
    display: flex;
}

.composer-reply .r-user {
    color: var(--accent);
    font-weight: 700;
}

.composer-reply .r-text {
    flex: 1;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.composer-reply button {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 0.9rem;
}

/* Attached FEN/PGN chip — caption text stays independent in the textarea below */
.composer-attach {
    display: none;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    margin-bottom: 8px;
    background: rgba(0, 200, 255, 0.06);
    border: 1px solid rgba(0, 200, 255, 0.2);
    border-radius: var(--radius-md);
    font-size: 0.8rem;
    color: var(--accent);
}

.composer-attach.show {
    display: flex;
}

.composer-attach span {
    flex: 1;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.composer-attach button {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 0.9rem;
}

/* Chatwoot-style reply card: textarea fills the top row, a thin toolbar
   (emoji at the start, send pushed to the end) sits below inside the same box. */
.composer-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    background: rgba(2, 8, 16, 0.6);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 10px 12px;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.composer-row:focus-within {
    border-color: rgba(0, 200, 255, 0.45);
    box-shadow: 0 0 0 3px rgba(0, 200, 255, 0.1);
}

.composer-input {
    flex: 1 1 100%;
    background: transparent;
    border: none;
    outline: none;
    resize: none;
    color: var(--text-primary);
    font-family: inherit;
    font-size: 0.95rem;
    line-height: 1.5;
    max-height: 140px;
    min-height: 24px;
    padding: 2px 4px 6px;
}

.composer-row .composer-btn.send {
    margin-inline-start: auto;
}

.composer-input::placeholder {
    color: #5b6b7f;
}

.composer-btn {
    width: 38px;
    height: 38px;
    border-radius: var(--radius-md);
    border: none;
    background: transparent;
    color: var(--text-secondary);
    font-size: 1.05rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s;
    flex-shrink: 0;
}

.composer-btn:hover {
    background: rgba(255, 255, 255, 0.06);
    color: var(--text-primary);
}

.composer-btn.send {
    background: var(--accent-gradient);
    color: #001018;
}

.composer-btn.send:disabled {
    opacity: 0.35;
    cursor: not-allowed;
}

.composer-btn.send:not(:disabled):hover {
    box-shadow: 0 4px 14px var(--accent-glow);
}

.composer-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 5px;
    font-size: 0.7rem;
    color: #5b6b7f;
    min-height: 16px;
}

.composer-error {
    color: #f87171;
    font-weight: 600;
    display: none;
}

.composer-error.show {
    display: block;
}

.composer-disabled-note {
    display: none;
    padding: 12px;
    text-align: center;
    color: #f87171;
    background: rgba(239, 68, 68, 0.08);
    border: 1px solid rgba(239, 68, 68, 0.25);
    border-radius: var(--radius-md);
    font-size: 0.88rem;
    font-weight: 600;
}

.composer-disabled-note.show {
    display: block;
}

/* Emoji picker — inset-inline-start is set by JS (positionPopover), to hug
   whichever button actually opened it rather than a guessed fixed offset. */
.emoji-pop {
    display: none;
    position: absolute;
    bottom: calc(100% + 6px);
    background: #10161f;
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 10px;
    grid-template-columns: repeat(8, 34px);
    gap: 2px;
    z-index: 30;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.55);
}

.emoji-pop.show {
    display: grid;
}

.emoji-pop button {
    width: 34px;
    height: 34px;
    background: none;
    border: none;
    font-size: 1.25rem;
    cursor: pointer;
    border-radius: 8px;
    line-height: 1;
}

.emoji-pop button:hover {
    background: rgba(255, 255, 255, 0.08);
}

.emoji-logo-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    border-bottom: 1px solid var(--border) !important;
    border-radius: 8px 8px 0 0 !important;
    grid-column: 1 / -1;
    width: 100% !important;
    height: 38px !important;
    margin-bottom: 3px;
}

/* Chess-share composer popover (paste FEN/PGN, preview, insert) —
   inset-inline-start is set by JS (positionPopover), see .emoji-pop above. */
.chess-share-pop {
    display: none;
    position: absolute;
    bottom: calc(100% + 6px);
    width: 280px;
    background: #10161f;
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 10px;
    z-index: 30;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.55);
}

.chess-share-pop.show {
    display: block;
}

.csp-textarea {
    width: 100%;
    min-height: 64px;
    resize: vertical;
    background: rgba(2, 8, 16, 0.5);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    padding: 8px 10px;
    font-family: inherit;
    font-size: 0.82rem;
    outline: none;
    direction: ltr;
    text-align: start;
}

.csp-textarea:focus {
    border-color: rgba(0, 200, 255, 0.4);
}

.csp-status {
    margin-top: 6px;
    font-size: 0.74rem;
    color: var(--text-secondary);
    min-height: 16px;
}

.csp-status.ok {
    color: #4ade80;
}

.csp-status.err {
    color: #f87171;
}

.csp-preview {
    display: none;
    width: 100%;
    aspect-ratio: 1;
    max-width: 180px;
    margin: 8px auto 0;
    border-radius: var(--radius-md);
    overflow: hidden;
}

.csp-preview.show {
    display: block;
}

.csp-actions {
    display: flex;
    gap: 8px;
    margin-top: 8px;
}

.csp-actions button {
    flex: 1;
    padding: 7px;
    border-radius: var(--radius-md);
    font-family: inherit;
    font-size: 0.8rem;
    cursor: pointer;
    border: 1px solid var(--border);
    background: rgba(255, 255, 255, 0.04);
    color: var(--text-secondary);
}

.csp-actions .csp-insert {
    background: rgba(0, 200, 255, 0.14);
    border-color: rgba(0, 200, 255, 0.4);
    color: var(--accent);
}

.csp-actions .csp-insert:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.csp-actions button:not(:disabled):hover {
    filter: brightness(1.15);
}

.emoji-logo-btn img {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    display: block;
}

/* Inline AuraChess logo icon rendered from the :aura: shortcode in message bodies */
.inline-emoji-logo {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    vertical-align: -4px;
    margin: 0 1px;
}

/* Mention autocomplete */
.mention-pop {
    display: none;
    position: absolute;
    bottom: calc(100% + 6px);
    inset-inline-start: 14px;
    min-width: 220px;
    background: #10161f;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 5px;
    z-index: 30;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.55);
    max-height: 220px;
    overflow-y: auto;
}

.mention-pop.show {
    display: block;
}

.mention-item {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    padding: 7px 10px;
    background: none;
    border: none;
    border-radius: 8px;
    color: var(--text-primary);
    font-family: inherit;
    font-size: 0.88rem;
    font-weight: 600;
    cursor: pointer;
    text-align: start;
}

.mention-item:hover,
.mention-item.sel {
    background: var(--accent-transparent);
    color: var(--accent);
}

/* ══════════════ PRIVATE MESSAGES ══════════════ */

.dm-layout {
    flex: 1;
    min-height: 0;
    display: flex;
}

.dm-list {
    width: 300px;
    border-inline-end: 1px solid var(--border);
    overflow-y: auto;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    gap: 3px;
    padding: 8px;
}

/* conversation rows read as a channel list — discrete rounded rows, not a
   full-bleed table; the active thread is a filled accent pill */
.dm-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 10px;
    cursor: pointer;
    border: 1px solid transparent;
    border-radius: var(--radius-md);
    transition: background 0.15s, border-color 0.15s;
    background: none;
    width: 100%;
    font-family: inherit;
    text-align: start;
}

.dm-item:hover {
    background: rgba(255, 255, 255, 0.04);
}

.dm-item.active {
    background: var(--accent-transparent);
    border-color: rgba(0, 200, 255, 0.25);
}

.dm-item-main {
    flex: 1;
    min-width: 0;
}

.dm-item-top {
    display: flex;
    align-items: center;
    gap: 6px;
}

.dm-item-name {
    font-weight: 700;
    font-size: 0.9rem;
    color: var(--text-primary);
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.dm-item-time {
    margin-inline-start: auto;
    font-size: 0.68rem;
    color: #5b6b7f;
    flex-shrink: 0;
}

.dm-item-excerpt {
    font-size: 0.78rem;
    color: var(--text-secondary);
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
    margin-top: 2px;
}

.dm-unread {
    min-width: 19px;
    height: 19px;
    padding: 0 5px;
    border-radius: var(--radius-full);
    background: var(--accent);
    color: #001018;
    font-size: 0.7rem;
    font-weight: 800;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.dm-thread {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.dm-thread-head {
    padding: 10px 16px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
    min-height: 58px;
}

.dm-peer-name {
    font-weight: 800;
    font-size: 0.95rem;
    color: var(--text-primary);
}

.dm-peer-status {
    font-size: 0.72rem;
    color: var(--text-secondary);
}

.dm-peer-status.online {
    color: var(--success);
}

.dm-peer-status.typing {
    color: var(--accent);
    font-weight: 700;
}

.dm-head-actions {
    margin-inline-start: auto;
    display: flex;
    gap: 4px;
}

.dm-scroll {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    padding: 14px 16px;
    display: flex;
    flex-direction: column;
    /* spacing is driven by .bubble-row margins so grouped turns can tighten */
}

.bubble-row {
    display: flex;
    margin-top: 10px;
}

.bubble-row.mine {
    justify-content: flex-end;
}

/* consecutive bubbles from the same side read as one turn: just a tighter gap.
   Corners stay uniform so the thread never shows mismatched square edges. */
.bubble-row.grouped {
    margin-top: 2px;
}

.bubble {
    max-width: 72%;
    padding: 9px 14px;
    border-radius: 18px;
    font-size: 0.92rem;
    line-height: 1.5;
    word-break: break-word;
    white-space: pre-wrap;
    position: relative;
}

.bubble-row:not(.mine) .bubble {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border);
    color: #e2e8f0;
}

.bubble-row.mine .bubble {
    background: linear-gradient(135deg, rgba(0, 200, 255, 0.14), rgba(0, 140, 255, 0.1));
    border: 1px solid rgba(0, 200, 255, 0.22);
    color: #eaf6ff;
}

.bubble-meta {
    display: flex;
    align-items: center;
    gap: 4px;
    justify-content: flex-end;
    margin-top: 3px;
    font-size: 0.64rem;
    color: rgba(255, 255, 255, 0.45);
}

.ticks {
    letter-spacing: -2px;
    font-size: 0.78rem;
}

.ticks.seen {
    color: var(--accent);
}

/* Broadcast bubble (official) */
.bubble.official-bubble {
    max-width: 88%;
    background: radial-gradient(at 0% 0%, rgba(0, 200, 255, 0.1), transparent 60%), rgba(10, 16, 26, 0.9);
    border: 1px solid rgba(0, 200, 255, 0.35);
    border-radius: var(--radius-lg);
}

.typing-bubble {
    display: none;
    padding: 0 16px 6px;
}

.typing-bubble.show {
    display: block;
}

.typing-dots {
    display: inline-flex;
    gap: 4px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid var(--border);
    padding: 10px 14px;
    border-radius: 16px;
}

.typing-dots span {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--text-secondary);
    animation: typing-b 1.2s infinite;
}

.typing-dots span:nth-child(2) {
    animation-delay: 0.15s;
}

.typing-dots span:nth-child(3) {
    animation-delay: 0.3s;
}

@keyframes typing-b {
    30% {
        transform: translateY(-4px);
        opacity: 1;
    }

    60% {
        transform: none;
        opacity: 0.5;
    }
}

/* ══════════════ FRIENDS ══════════════ */

.friends-scroll {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    padding: 16px;
}

.friend-search-row {
    display: flex;
    gap: 8px;
    background: rgba(2, 8, 16, 0.6);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 8px 12px;
    align-items: center;
    margin-bottom: 14px;
    transition: border-color 0.2s;
}

.friend-search-row:focus-within {
    border-color: rgba(0, 200, 255, 0.4);
}

.friend-search-row i {
    color: var(--text-secondary);
}

.friend-search-row input {
    flex: 1;
    background: transparent;
    border: none;
    outline: none;
    color: var(--text-primary);
    font-family: inherit;
    font-size: 0.93rem;
}

.f-section-title {
    font-size: 0.72rem;
    font-weight: 800;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.8px;
    margin: 20px 2px 10px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.f-section-title .cnt {
    color: var(--accent);
    background: var(--accent-transparent);
    border-radius: var(--radius-full);
    padding: 1px 8px;
    font-size: 0.7rem;
}

.friend-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 11px 13px;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    background: rgba(255, 255, 255, 0.02);
    margin-bottom: 8px;
    transition: border-color 0.15s, transform 0.15s, box-shadow 0.15s, background 0.15s;
}

.friend-card:hover {
    border-color: var(--border-hover);
    background: rgba(255, 255, 255, 0.035);
    transform: translateY(-1px);
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.25);
}

.friend-card .c-avatar {
    width: 44px;
    height: 44px;
}

.friend-card .f-main {
    flex: 1;
    min-width: 0;
}

.friend-card .f-name {
    font-weight: 800;
    font-size: 0.94rem;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.friend-card .f-sub {
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin-top: 2px;
}

.friend-card .f-actions {
    display: flex;
    gap: 6px;
    flex-shrink: 0;
}

.f-btn {
    padding: 6px 13px;
    border-radius: var(--radius-full);
    border: 1px solid var(--border);
    background: rgba(255, 255, 255, 0.04);
    color: var(--text-primary);
    font-family: inherit;
    font-size: 0.78rem;
    font-weight: 700;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: all 0.15s;
    white-space: nowrap;
}

.f-btn:hover {
    border-color: var(--border-hover);
    background: rgba(255, 255, 255, 0.07);
    transform: translateY(-1px);
}

.f-btn:active {
    transform: translateY(0);
}

.f-btn.primary {
    background: var(--accent-gradient);
    color: #001018;
    border: none;
}

.f-btn.primary:hover {
    box-shadow: 0 4px 14px var(--accent-glow);
}

.f-btn.success {
    background: rgba(34, 197, 94, 0.15);
    color: #4ade80;
    border-color: rgba(34, 197, 94, 0.3);
}

.f-btn.danger {
    background: rgba(239, 68, 68, 0.1);
    color: #f87171;
    border-color: rgba(239, 68, 68, 0.25);
}

.f-btn:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

.f-btn.icon-only {
    padding: 6px 9px;
}

/* ══════════════ NOTIFICATIONS ══════════════ */

.notif-scroll {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    padding: 10px 12px;
    display: flex;
    flex-direction: column;
    gap: 3px;
}

/* discrete rounded rows; unread carries a tint + inline-start accent bar
   (a stronger, calmer signal than the old dot) */
.notif-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    width: 100%;
    padding: 11px 12px;
    border-radius: var(--radius-md);
    background: none;
    border: 1px solid transparent;
    cursor: pointer;
    font-family: inherit;
    text-align: start;
    transition: background 0.15s, border-color 0.15s;
    position: relative;
    overflow: hidden;
}

.notif-item:hover {
    background: rgba(255, 255, 255, 0.045);
}

.notif-item.unread {
    background: rgba(0, 200, 255, 0.05);
}

.notif-item.unread::before {
    content: '';
    position: absolute;
    inset-inline-start: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    background: var(--accent);
}

.notif-ico {
    width: 40px;
    height: 40px;
    border-radius: 11px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.95rem;
    flex-shrink: 0;
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-secondary);
    border: 1px solid var(--border);
}

.notif-ico.friend {
    color: #4ade80;
    border-color: rgba(34, 197, 94, 0.3);
    background: rgba(34, 197, 94, 0.08);
}

.notif-ico.dm {
    color: var(--accent);
    border-color: rgba(0, 200, 255, 0.3);
    background: rgba(0, 200, 255, 0.08);
}

.notif-ico.mention {
    color: #c084fc;
    border-color: rgba(168, 85, 247, 0.3);
    background: rgba(168, 85, 247, 0.08);
}

.notif-ico.sys {
    color: #fbbf24;
    border-color: rgba(245, 158, 11, 0.3);
    background: rgba(245, 158, 11, 0.08);
}

.notif-main {
    flex: 1;
    min-width: 0;
}

.notif-text {
    font-size: 0.88rem;
    color: var(--text-primary);
    line-height: 1.45;
}

.notif-text b {
    color: var(--accent);
}

.notif-preview {
    font-size: 0.78rem;
    color: var(--text-secondary);
    margin-top: 2px;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
    max-width: 460px;
}

.notif-time {
    font-size: 0.68rem;
    color: #5b6b7f;
    margin-top: 3px;
}

/* ══════════════ SHARED: empty states / skeletons / toast ══════════════ */

.c-empty {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    color: var(--text-secondary);
    padding: 40px 20px;
    text-align: center;
}

.c-empty i {
    font-size: 1.7rem;
    color: var(--accent);
    width: 68px;
    height: 68px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 20px;
    background: var(--accent-transparent);
    border: 1px solid rgba(0, 200, 255, 0.2);
    margin-bottom: 4px;
}

.c-empty .t {
    font-weight: 800;
    font-size: 1.05rem;
    color: var(--text-primary);
}

.c-empty .s {
    font-size: 0.85rem;
    max-width: 340px;
    line-height: 1.55;
}

.skel {
    border-radius: var(--radius-md);
    background: linear-gradient(90deg, rgba(255, 255, 255, 0.04) 25%, rgba(255, 255, 255, 0.09) 50%, rgba(255, 255, 255, 0.04) 75%);
    background-size: 200% 100%;
    animation: skel-move 1.4s infinite;
}

@keyframes skel-move {
    to {
        background-position: -200% 0;
    }
}

.skel-msg {
    height: 52px;
    margin: 6px 8px;
}

/* Shape-matched loading skeleton — mirrors a real grouped chat row
   (avatar gutter + stacked text lines) so the load-in doesn't visibly jump. */
.skel-row {
    display: grid;
    grid-template-columns: 42px 1fr;
    column-gap: 8px;
    padding: 4px 8px;
    margin-top: 12px;
    align-items: start;
}

.skel-avatar {
    width: 38px;
    height: 38px;
    border-radius: 50%;
}

.skel-lines {
    display: flex;
    flex-direction: column;
    gap: 7px;
    padding-top: 4px;
}

.skel-line {
    height: 10px;
    border-radius: 5px;
}

.skel-line.name {
    width: 32%;
    height: 11px;
}

.skel-line.med {
    width: 68%;
}

.skel-line.long {
    width: 84%;
}

.c-toast {
    position: fixed;
    bottom: 26px;
    inset-inline-start: 50%;
    transform: translateX(-50%) translateY(20px);
    background: #131a24;
    border: 1px solid var(--border);
    color: var(--text-primary);
    border-radius: var(--radius-md);
    padding: 11px 20px;
    font-size: 0.88rem;
    font-weight: 600;
    z-index: 3000;
    opacity: 0;
    pointer-events: none;
    transition: all 0.25s ease;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.5);
    max-width: min(480px, 90vw);
    text-align: center;
}

[dir="rtl"] .c-toast {
    transform: translateX(50%) translateY(20px);
}

.c-toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

[dir="rtl"] .c-toast.show {
    transform: translateX(50%) translateY(0);
}

.c-toast.error {
    border-color: rgba(239, 68, 68, 0.4);
    color: #fca5a5;
}

/* Report modal */
.c-modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(2, 6, 12, 0.7);
    backdrop-filter: blur(4px);
    z-index: 2500;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.c-modal-overlay.show {
    display: flex;
}

.c-modal {
    width: 100%;
    max-width: 430px;
    background: #0f151d;
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6);
}

.c-modal h3 {
    margin: 0 0 14px;
    font-size: 1.05rem;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 8px;
}

.c-modal h3 i {
    color: #f87171;
}

.report-reason {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    margin-bottom: 8px;
    cursor: pointer;
    color: var(--text-primary);
    font-size: 0.9rem;
    transition: all 0.15s;
}

.report-reason:hover {
    border-color: var(--border-hover);
}

.report-reason input {
    accent-color: var(--accent);
}

.c-modal textarea {
    width: 100%;
    background: rgba(2, 8, 16, 0.6);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-family: inherit;
    font-size: 0.88rem;
    padding: 10px;
    resize: vertical;
    min-height: 70px;
    box-sizing: border-box;
    margin-top: 4px;
}

.c-modal-actions {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
    margin-top: 14px;
}

/* Confirm modal (delete / remove friend / block user) */
.confirm-modal {
    max-width: 380px;
    text-align: center;
}

.confirm-icon {
    width: 56px;
    height: 56px;
    margin: 0 auto 14px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    background: rgba(239, 68, 68, 0.12);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: #f87171;
}

.confirm-modal h3 {
    justify-content: center;
    margin-bottom: 8px;
}

.confirm-modal h3 i {
    display: none;
}

.confirm-modal p {
    color: var(--text-secondary);
    font-size: 0.9rem;
    line-height: 1.55;
    margin: 0;
}

.confirm-modal .c-modal-actions {
    justify-content: center;
}

.confirm-modal .f-btn {
    min-width: 110px;
    justify-content: center;
}

/* ══════════════ ADVANCED PRESENCE ══════════════ */

.presence-dot.away {
    background: #f59e0b;
    box-shadow: 0 0 6px rgba(245, 158, 11, 0.6);
}

.presence-dot.dnd {
    background: #ef4444;
    box-shadow: 0 0 6px rgba(239, 68, 68, 0.6);
}

.presence-dot.offline {
    background: #64748b;
    box-shadow: none;
}

.dm-peer-status.away {
    color: #f59e0b;
}

.dm-peer-status.dnd {
    color: #ef4444;
}

/* Status selector (online / dnd / invisible) — a grouped panel under the online
   strip. Vertical so the localized labels (e.g. "عدم الإزعاج") never cramp; the
   active state is a colored pill matching the chosen mode. */
.presence-switcher {
    margin-top: 8px;
    display: flex;
    flex-direction: column;
    gap: 3px;
    padding: 4px;
    background: rgba(0, 0, 0, 0.25);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
}

.ps-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    border-radius: var(--radius-sm);
    background: transparent;
    border: 1px solid transparent;
    color: var(--text-secondary);
    font-family: inherit;
    font-size: 0.8rem;
    font-weight: 700;
    cursor: pointer;
    text-align: start;
    transition: all 0.15s;
}

.ps-btn:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-primary);
}

.ps-btn[data-mode="online"].active {
    background: rgba(34, 197, 94, 0.15);
    color: var(--success);
    border-color: rgba(34, 197, 94, 0.35);
}

.ps-btn[data-mode="dnd"].active {
    background: rgba(239, 68, 68, 0.15);
    color: #f87171;
    border-color: rgba(239, 68, 68, 0.35);
}

.ps-btn[data-mode="invisible"].active {
    background: rgba(148, 163, 184, 0.15);
    color: #94a3b8;
    border-color: rgba(148, 163, 184, 0.35);
}

/* ══════════════ VERIFIED BADGE (independent overlay) ══════════════ */

.badge-wrap {
    display: inline-flex;
    align-items: center;
    gap: 3px;
}

.u-verified {
    display: inline-flex;
    color: var(--accent);
    font-size: 0.85rem;
    vertical-align: middle;
}

/* ══════════════ CLICKABLE USERNAMES → PROFILE CARD ══════════════ */

.clickable-name {
    cursor: pointer;
}

.clickable-name:hover {
    color: var(--accent);
}

.mention {
    cursor: pointer;
}

/* ══════════════ PUBLIC CHAT TYPING BAR ══════════════ */

.chat-typing-bar {
    max-height: 0;
    opacity: 0;
    overflow: hidden;
    padding: 0 16px;
    color: var(--accent);
    font-size: 0.78rem;
    font-weight: 700;
    transition: max-height 0.2s ease, opacity 0.2s ease, padding 0.2s ease;
}

.chat-typing-bar.show {
    max-height: 30px;
    opacity: 1;
    padding: 4px 16px;
}

/* ══════════════ PRIORITY-ACCENTED PINNED ANNOUNCEMENT ══════════════ */

.pinned-bar.prio-high {
    border-color: rgba(239, 68, 68, 0.4);
}

.pinned-bar.prio-high .pin-title {
    color: #fca5a5;
}

.pinned-bar.prio-critical {
    border-color: rgba(239, 68, 68, 0.6);
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.14), rgba(0, 200, 255, 0.06));
}

.pinned-bar.prio-critical .pin-title {
    color: #fca5a5;
}

/* ══════════════ DM PINNED MESSAGES ══════════════ */

.bubble-pin-btn {
    position: absolute;
    top: -8px;
    inset-inline-end: -8px;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: #0f151d;
    border: 1px solid var(--border);
    color: var(--text-secondary);
    font-size: 0.65rem;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    opacity: 0;
    transition: opacity 0.15s;
}

.bubble:hover .bubble-pin-btn {
    opacity: 1;
}

.bubble-pin-btn.pinned {
    opacity: 1;
    color: #fbbf24;
    border-color: rgba(251, 191, 36, 0.4);
}

/* reply hover button — sits beside the pin, same disc styling */
.bubble-reply-btn {
    position: absolute;
    top: -8px;
    inset-inline-end: 18px;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: #0f151d;
    border: 1px solid var(--border);
    color: var(--text-secondary);
    font-size: 0.65rem;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    opacity: 0;
    transition: opacity 0.15s, color 0.15s, border-color 0.15s;
}

.bubble:hover .bubble-reply-btn {
    opacity: 1;
}

.bubble-reply-btn:hover {
    color: var(--accent);
    border-color: rgba(0, 200, 255, 0.4);
}

/* ══════════════ EMOJI REACTIONS (shared: public chat + DMs) ══════════════ */

.msg-reactions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 4px;
    position: relative;
}

/* Only reserve the gap above the reaction row when there's actually
   something there — pills, or the add-trigger revealed on hover.
   Otherwise the bubble box would carry dead space below the timestamp
   at rest (the add-btn used to occupy its 24px box via opacity:0). */
.msg-reactions:has(.reaction-pill) {
    margin-top: 4px;
}

.msg-row:hover .msg-reactions,
.bubble:hover .msg-reactions,
.msg-official:hover .msg-reactions {
    margin-top: 4px;
}

.reaction-pill {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border);
    border-radius: 999px;
    padding: 2px 8px;
    font-size: 0.74rem;
    color: var(--text-secondary);
    cursor: pointer;
    line-height: 1.6;
    transition: all 0.15s;
    font-family: inherit;
    font-variant-numeric: tabular-nums;
}

.reaction-pill:hover {
    background: rgba(255, 255, 255, 0.09);
    border-color: rgba(0, 200, 255, 0.3);
}

.reaction-pill.mine {
    background: rgba(0, 200, 255, 0.14);
    border-color: rgba(0, 200, 255, 0.4);
    color: var(--accent);
}

.reaction-add-btn {
    width: 24px;
    height: 24px;
    display: none;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    border-radius: 999px;
    color: var(--text-secondary);
    font-size: 0.78rem;
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
}

.msg-row:hover .reaction-add-btn,
.bubble:hover .reaction-add-btn,
.msg-official:hover .reaction-add-btn,
.reaction-add-btn.show {
    display: flex;
}

.reaction-add-btn:hover {
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-primary);
}

.reaction-picker {
    display: none;
    position: absolute;
    bottom: calc(100% + 6px);
    inset-inline-start: 0;
    background: #10161f;
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 6px;
    grid-template-columns: repeat(9, 30px);
    gap: 2px;
    z-index: 30;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.55);
}

.reaction-picker.show {
    display: grid;
}

.reaction-picker button {
    width: 30px;
    height: 30px;
    background: none;
    border: none;
    font-size: 1.1rem;
    cursor: pointer;
    border-radius: 8px;
    line-height: 1;
}

.reaction-picker button:hover {
    background: rgba(255, 255, 255, 0.08);
}

.reaction-logo {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    object-fit: cover;
    vertical-align: middle;
}

.reaction-pill .reaction-logo {
    width: 13px;
    height: 13px;
}

.dm-pinned-panel {
    display: none;
    max-height: 220px;
    overflow-y: auto;
    border-bottom: 1px solid var(--border);
    background: rgba(0, 0, 0, 0.15);
    flex-shrink: 0;
}

.dm-pinned-panel.show {
    display: block;
}

.dm-pinned-head {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    font-size: 0.78rem;
    font-weight: 800;
    color: #fbbf24;
    border-bottom: 1px solid var(--border);
}

.dm-pinned-head span:not(.composer-btn) {
    flex: 1;
}

.dm-pinned-list {
    padding: 6px;
}

.dm-pinned-item {
    display: block;
    width: 100%;
    text-align: start;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 8px 10px;
    margin-bottom: 4px;
    color: var(--text-primary);
    font-family: inherit;
    cursor: pointer;
}

.dm-pinned-item:hover {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(251, 191, 36, 0.35);
}

.dpi-text {
    font-size: 0.82rem;
    word-break: break-word;
}

.dpi-time {
    font-size: 0.66rem;
    color: var(--text-secondary);
    margin-top: 2px;
}

.dm-pinned-empty {
    padding: 14px;
    text-align: center;
    color: var(--text-secondary);
    font-size: 0.82rem;
}

.flash-highlight {
    animation: flash-highlight-anim 1.4s ease;
}

@keyframes flash-highlight-anim {

    0%,
    100% {
        background: transparent;
    }

    20% {
        background: rgba(0, 200, 255, 0.18);
    }
}

/* ══════════════ DM SEARCH ══════════════ */

.dm-search-panel {
    display: none;
    max-height: 320px;
    overflow-y: auto;
    border-bottom: 1px solid var(--border);
    background: rgba(0, 0, 0, 0.15);
    flex-shrink: 0;
}

.dm-search-panel.show {
    display: block;
}

.dm-search-row {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    padding: 10px 14px;
    border-bottom: 1px solid var(--border);
}

.dm-search-row input[type="text"] {
    flex: 1;
    min-width: 140px;
    background: rgba(2, 8, 16, 0.5);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    padding: 7px 10px;
    font-family: inherit;
    font-size: 0.85rem;
    outline: none;
}

.dm-search-row select,
.dm-search-row input[type="date"] {
    background: rgba(2, 8, 16, 0.5);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    padding: 7px 8px;
    font-family: inherit;
    font-size: 0.78rem;
    outline: none;
}

.dm-search-results {
    padding: 6px;
}

.dm-search-item {
    display: block;
    width: 100%;
    text-align: start;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 8px 10px;
    margin-bottom: 4px;
    color: var(--text-primary);
    font-family: inherit;
    cursor: pointer;
}

.dm-search-item:hover {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(0, 200, 255, 0.35);
}

.dsi-text {
    font-size: 0.82rem;
    word-break: break-word;
}

.dsi-text mark {
    background: rgba(0, 200, 255, 0.35);
    color: inherit;
    border-radius: 3px;
}

.dsi-time {
    font-size: 0.66rem;
    color: var(--text-secondary);
    margin-top: 2px;
}

.dm-search-empty {
    padding: 14px;
    text-align: center;
    color: var(--text-secondary);
    font-size: 0.82rem;
}

/* ══════════════ USER PROFILE CARD MODAL ══════════════ */

.profile-card-modal {
    max-width: 300px;
    text-align: center;
    position: relative;
    overflow: hidden;
    padding: 0 16px 16px;
}

/* soft brand banner behind the avatar — the profile card's identity moment */
.profile-card-modal::before {
    content: '';
    position: absolute;
    top: 0;
    inset-inline: 0;
    height: 54px;
    background: var(--accent-gradient);
    opacity: 0.16;
    pointer-events: none;
}

.pc-close {
    position: absolute;
    top: 12px;
    inset-inline-end: 12px;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.35);
    border: 1px solid var(--border);
    color: var(--text-primary);
    cursor: pointer;
    z-index: 2;
    transition: background 0.15s;
}

.pc-close:hover {
    background: rgba(0, 0, 0, 0.55);
}

.pc-loading,
.pc-error {
    padding: 24px;
    text-align: center;
    color: var(--text-secondary);
}

.pc-head {
    position: relative;
    display: inline-block;
    margin: 24px auto 8px;
    z-index: 1;
}

.pc-avatar {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid var(--bg-surface);
    box-shadow: 0 0 0 1px var(--border), 0 6px 16px rgba(0, 0, 0, 0.45);
}

.pc-head .presence-dot {
    width: 13px;
    height: 13px;
    border-width: 2px;
}

.pc-name-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    flex-wrap: wrap;
}

.pc-username {
    font-size: 1.02rem;
    font-weight: 800;
    color: var(--text-primary);
}

.pc-country {
    font-size: 0.74rem;
    color: var(--text-secondary);
    margin-top: 2px;
}

/* compact player stats — 2×2 mini-tiles (rating / solved / success / streak) */
.pc-mini-stats {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 6px;
    margin: 14px 0;
    text-align: center;
}

.pc-mini {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    padding: 10px 6px;
    min-width: 0;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
}

.pc-mini i {
    font-size: 0.82rem;
    margin-bottom: 2px;
}

.pc-mini-value {
    font-size: 0.95rem;
    color: var(--text-primary);
    font-weight: 800;
    line-height: 1.1;
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
}

.pc-mini-label {
    font-size: 0.58rem;
    color: var(--text-secondary);
    font-weight: 700;
    white-space: nowrap;
}

.pc-actions {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.pc-actions .f-btn {
    width: 100%;
    justify-content: center;
}

/* Standalone user_profile.html page shell reuses the .pc-* identity block */
.profile-page-wrap {
    max-width: 640px;
    margin: 0 auto;
    padding: 100px 16px 40px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.profile-page-card,
.profile-activity-card {
    position: relative;
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid var(--glass-border, rgba(255, 255, 255, 0.08));
    border-radius: var(--radius-lg);
    padding: 24px;
    text-align: center;
}

.profile-activity-card {
    text-align: start;
}

.profile-activity-card h3 {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0 0 12px;
    font-size: 1rem;
    color: var(--text-primary);
}

.profile-activity-card h3 i {
    color: var(--accent);
}

.profile-activity-card .pc-stats {
    margin: 0;
}

/* ══════════════ RESPONSIVE ══════════════ */

@media (max-width: 900px) {
    .community-wrap {
        padding: 84px 8px 8px;
        height: 100dvh;
    }

    .community-shell {
        grid-template-columns: 1fr;
        grid-template-rows: auto 1fr;
        gap: 8px;
    }

    .community-tabs {
        flex-direction: row;
        align-items: center;
        padding: 4px;
        gap: 4px;
        overflow-x: auto;
        height: auto;
    }

    .community-tab {
        padding: 4px;
        font-size: 0.82rem;
        white-space: nowrap;
        width: auto;
        flex: 1;
        justify-content: center;
    }

    .community-tab span.tab-label {
        display: none;
    }

    .community-tab i {
        width: 30px;
        height: 30px;
        font-size: 0.95rem;
    }

    .community-tab.active::before {
        display: none;
    }

    .community-online-chip,
    .presence-switcher {
        display: none;
    }

    .dm-list {
        width: 100%;
        border-inline-end: none;
    }

    .dm-layout.thread-open .dm-list {
        display: none;
    }

    .dm-layout:not(.thread-open) .dm-thread {
        display: none;
    }

    /* details pane becomes a full-screen sheet on mobile, opened from the header */
    #view-chat.active {
        flex-direction: column;
    }

    .conv-details {
        position: fixed;
        inset: 0;
        z-index: 2400;
        width: auto;
        border-inline-start: none;
        background: var(--bg-primary);
        transform: translateX(0);
    }

    .conv-details:not(.open) {
        display: none;
    }

    .conv-header {
        min-height: 44px;
        padding: 6px 10px;
    }

    .conv-avatar {
        width: 30px;
        height: 30px;
        border-radius: 8px;
    }

    .bubble {
        max-width: 86%;
    }

    .emoji-pop {
        grid-template-columns: repeat(7, 34px);
    }

    .msg-actions {
        display: flex;
        opacity: 0;
        pointer-events: none;
    }

    .msg-row:hover .msg-actions,
    .msg-row.show-actions .msg-actions {
        opacity: 1;
        pointer-events: auto;
    }

    .dm-search-row {
        flex-direction: column;
    }

    .dm-pinned-panel,
    .dm-search-panel {
        max-height: 180px;
    }
}

/* Narrow phones: friend cards can't fit avatar + name + 3 action buttons on
   one row — drop the actions onto their own full-width row below the name so
   nothing overlaps or gets clipped. */
@media (max-width: 560px) {
    .friend-card {
        flex-wrap: wrap;
    }

    .friend-card .f-actions {
        flex-basis: 100%;
        flex-wrap: wrap;
        justify-content: flex-start;
        margin-top: 4px;
    }

    .friend-card .f-actions .f-btn {
        flex: 1 1 auto;
        justify-content: center;
    }
}/* ==========================================================================
   TIPS & DID YOU KNOW FEATURE
   ========================================================================== */
.daily-tip-banner {
    display: flex;
    align-items: center;
    background: rgba(245, 158, 11, 0.1);
    border: 1px solid rgba(245, 158, 11, 0.2);
    border-radius: var(--radius-md);
    padding: 12px 16px;
    margin-bottom: 20px;
    gap: 16px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}
.daily-tip-icon {
    font-size: 1.5rem;
    color: #f59e0b;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: rgba(245, 158, 11, 0.15);
    border-radius: 50%;
}
.daily-tip-content {
    flex: 1;
}
.daily-tip-label {
    margin: 0 0 4px 0;
    font-size: 0.85rem;
    color: #f59e0b;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
#dailyTipText {
    margin: 0;
    font-size: 0.95rem;
    color: var(--text-primary);
    line-height: 1.4;
}
.daily-tip-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}
.daily-tip-learn {
    background: rgba(245, 158, 11, 0.2);
    border: 1px solid rgba(245, 158, 11, 0.3);
    color: #f59e0b;
    padding: 6px 12px;
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}
.daily-tip-learn:hover {
    background: rgba(245, 158, 11, 0.3);
}
.daily-tip-close {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 1.1rem;
    padding: 4px;
    display: flex;
    transition: color 0.2s;
}
.daily-tip-close:hover {
    color: var(--text-primary);
}

.daily-tip-banner.did-you-know-theme {
    background: rgba(56, 189, 248, 0.1);
    border-color: rgba(56, 189, 248, 0.2);
}
.daily-tip-banner.did-you-know-theme .daily-tip-icon {
    background: rgba(56, 189, 248, 0.15);
    color: #38bdf8;
}
.daily-tip-banner.did-you-know-theme .daily-tip-label {
    color: #38bdf8;
}
.daily-tip-banner.did-you-know-theme .daily-tip-learn {
    background: rgba(56, 189, 248, 0.12);
    border-color: rgba(56, 189, 248, 0.3);
    color: #38bdf8;
}
.daily-tip-banner.did-you-know-theme .daily-tip-learn:hover {
    background: rgba(56, 189, 248, 0.2);
}

/* FEATURE MODAL */
.feature-modal {
    max-width: 460px;
    padding: 28px 24px 24px;
    animation: featureModalIn 0.3s cubic-bezier(0.22, 1, 0.36, 1);
}
@keyframes featureModalIn {
    from { opacity: 0; transform: scale(0.92) translateY(12px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}
.feature-modal-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    margin-bottom: 20px;
}
.feature-icon {
    font-size: 2.5rem;
    color: #f59e0b;
    margin-bottom: 12px;
    background: rgba(245, 158, 11, 0.15);
    width: 64px;
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}
.feature-icon.did-you-know {
    color: #38bdf8;
    background: rgba(56, 189, 248, 0.15);
}
#featureModalTitle {
    margin: 0;
    font-size: 1.15rem;
    font-weight: 800;
}
#featureModalTitle.did-you-know {
    color: #38bdf8;
}
.feature-main-text {
    font-size: 0.98rem;
    font-weight: 700;
    line-height: 1.8;
    text-align: center;
    padding: 0 4px;
    margin-bottom: 15px;
}
.feature-divider {
    height: 1px;
    background: rgba(255,255,255,0.1);
    margin: 15px 0;
}
.feature-desc-text {
    font-size: 0.9rem;
    color: var(--text-muted);
    line-height: 1.6;
    text-align: center;
}
#featureModalBtn {
    width: 100%;
    padding: 13px 20px;
    background: linear-gradient(135deg, #f59e0b, #d97706);
    border: none;
    border-radius: var(--radius-md);
    color: #1a1a2e;
    font-weight: 700;
    box-shadow: 0 4px 15px rgba(245, 158, 11, 0.25);
    cursor: pointer;
    transition: all 0.2s ease;
}
#featureModalBtn:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(245, 158, 11, 0.35);
}
.feature-modal.dyk-theme #featureModalBtn {
    background: linear-gradient(135deg, #38bdf8, #0ea5e9);
    box-shadow: 0 4px 15px rgba(56, 189, 248, 0.25);
}

/* ══════════════ BANNED STATE ══════════════ */
.c-banned-state {
    flex: 1;
    display: flex;
    flex-direction: row;
    align-items: stretch;
    justify-content: center;
    padding: 30px;
    background: radial-gradient(circle at center, rgba(30, 40, 55, 0.4) 0%, transparent 70%);
    grid-column: 1 / -1;
    overflow: hidden;
    gap: 30px;
    min-height: 0;
    height: 100%;
    box-sizing: border-box;
}

@media (max-width: 992px) {
    .c-banned-state {
        flex-direction: column;
        justify-content: flex-start;
        overflow-y: auto;
    }
}

.c-banned-card {
    background: rgba(15, 20, 28, 0.85);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 60, 60, 0.15);
    border-top: 1px solid rgba(255, 60, 60, 0.3);
    padding: 50px 40px;
    border-radius: 24px;
    text-align: center;
    max-width: 480px;
    width: 100%;
    height: fit-content;
    align-self: center;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.4), 0 0 0 1px rgba(255,255,255,0.02);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    animation: fadeUpIn 0.6s cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
}

.c-banned-card .icon-wrap {
    width: 72px;
    height: 72px;
    background: rgba(255, 60, 60, 0.1);
    border: 1px solid rgba(255, 60, 60, 0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 8px;
    box-shadow: 0 0 30px rgba(255, 60, 60, 0.15) inset;
}

.c-banned-card .icon-wrap i {
    font-size: 2rem;
    color: #ff4d4d;
    filter: drop-shadow(0 0 8px rgba(255, 77, 77, 0.4));
}

.c-banned-card .banned-title {
    font-size: 1.4rem;
    font-weight: 800;
    color: var(--text-primary);
    margin: 0;
    letter-spacing: -0.3px;
}

.c-banned-card .banned-desc {
    font-size: 0.95rem;
    color: var(--text-secondary);
    line-height: 1.7;
    margin: 0;
}

@keyframes fadeUpIn {
    from {
        opacity: 0;
        transform: translateY(20px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* ═══════════════ Appeal / Ticket Section ═══════════════ */

.banned-expires {
    font-size: 0.88rem;
    color: #fbbf24;
    background: rgba(251, 191, 36, 0.08);
    border: 1px solid rgba(251, 191, 36, 0.15);
    padding: 8px 18px;
    border-radius: 20px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.appeal-section {
    background: rgba(15, 20, 28, 0.85);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 20px;
    max-width: 600px;
    width: 100%;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    animation: fadeUpIn 0.6s 0.2s cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

.appeal-heading {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--text-primary);
    padding: 18px 24px;
    margin: 0;
    border-bottom: 1px solid rgba(255,255,255,0.06);
    display: flex;
    align-items: center;
    gap: 10px;
}
.appeal-heading i {
    color: var(--accent);
}

.appeal-messages {
    padding: 20px;
    flex: 1;
    min-height: 120px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

@media (max-width: 992px) {
    .appeal-messages {
        max-height: 400px;
    }
}

.appeal-empty {
    text-align: center;
    color: var(--text-tertiary);
    padding: 30px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}
.appeal-empty i {
    font-size: 2rem;
    opacity: 0.4;
}

.appeal-loading {
    text-align: center;
    color: var(--text-tertiary);
    padding: 30px;
}

.appeal-error {
    text-align: center;
    color: #f87171;
    padding: 20px;
}

/* Chat bubbles */
.appeal-bubble {
    max-width: 85%;
    padding: 12px 16px;
    border-radius: 16px;
    animation: fadeUpIn 0.3s ease both;
}
.appeal-bubble.user {
    align-self: flex-end;
    background: rgba(99, 102, 241, 0.15);
    border: 1px solid rgba(99, 102, 241, 0.2);
    border-bottom-left: 4px;
}
.appeal-bubble.admin {
    align-self: flex-start;
    background: rgba(52, 211, 153, 0.1);
    border: 1px solid rgba(52, 211, 153, 0.2);
    border-bottom-right: 4px;
}

.appeal-bubble-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 6px;
    gap: 12px;
}
.appeal-sender {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 5px;
}
.appeal-sender.is-admin {
    color: #34d399;
}
.appeal-time {
    font-size: 0.72rem;
    color: var(--text-tertiary);
}
.appeal-bubble-body {
    font-size: 0.92rem;
    color: var(--text-primary);
    line-height: 1.6;
    word-break: break-word;
    white-space: pre-wrap;
}

/* Input area */
.appeal-input-area {
    padding: 16px 20px;
    border-top: 1px solid rgba(255,255,255,0.06);
    display: flex;
    gap: 10px;
    align-items: flex-end;
}
.appeal-textarea {
    flex: 1;
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 12px;
    padding: 12px 14px;
    color: var(--text-primary);
    font-size: 0.9rem;
    resize: none;
    font-family: inherit;
    transition: border-color 0.2s;
    line-height: 1.5;
}
.appeal-textarea:focus {
    outline: none;
    border-color: var(--accent);
}
.appeal-textarea::placeholder {
    color: var(--text-tertiary);
}
.appeal-send-btn {
    background: var(--accent);
    color: #fff;
    border: none;
    border-radius: 12px;
    padding: 12px 20px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 7px;
    white-space: nowrap;
}
.appeal-send-btn:hover {
    filter: brightness(1.15);
    transform: translateY(-1px);
}
.appeal-send-btn:disabled {
    opacity: 0.5;
    pointer-events: none;
}

.appeal-closed-notice {
    font-size: 0.88rem;
    color: var(--text-tertiary);
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 0;
}
.appeal-closed-notice i {
    color: #9ca3af;
}
