:root {
    --bg-deep: #000000;
    --bg-panel: #0a0a0a;
    --bg-surface: #121212;
    --bg-surface-hover: #1a1a1a;
    
    --border-light: #222222;
    --border-focus: #444444;
    
    --text-main: #f5f5f5;
    --text-muted: #888888;
    
    --accent: #ffffff;
    --accent-glow: 0 0 20px rgba(255,255,255,0.15);
    
    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
    font-family: var(--font-sans);
    background: radial-gradient(circle at 50% 0%, #111111 0%, var(--bg-deep) 100%);
    color: var(--text-main);
    display: flex;
    height: 100vh;
    overflow: hidden;
    -webkit-font-smoothing: antialiased;
}

/* ================= PREMIUM NAVIGATION (LEFT BAR) ================= */
.server-sidebar {
    width: 80px;
    min-width: 80px;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(20px);
    border-right: 1px solid var(--border-light);
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 24px 0;
    gap: 16px;
    z-index: 30;
}

.server-icon-wrapper {
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    cursor: pointer;
}

.server-indicator {
    position: absolute;
    left: 0;
    width: 2px;
    height: 0;
    background-color: var(--accent);
    box-shadow: 0 0 8px var(--accent);
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    opacity: 0;
}

.server-icon-wrapper.active .server-indicator {
    height: 24px;
    opacity: 1;
}

.server-icon {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: var(--bg-surface);
    border: 1px solid var(--border-light);
    color: var(--text-main);
    display: flex;
    justify-content: center;
    align-items: center;
    font-weight: 600;
    font-size: 1.05rem;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.server-icon-wrapper:hover .server-icon {
    border-color: var(--border-focus);
    background: var(--bg-surface-hover);
    transform: translateY(-2px);
    box-shadow: 0 8px 16px rgba(0,0,0,0.4);
}

.server-icon-wrapper.active .server-icon {
    border-color: var(--accent);
    box-shadow: var(--accent-glow);
}

.home-icon { background: linear-gradient(135deg, #1a1a1a, #2a2a2a); }
.home-icon svg { width: 20px; height: 20px; stroke: var(--text-main); fill: none; stroke-width: 2; }

.sidebar-divider {
    width: 24px; height: 1px; background-color: var(--border-light); margin: 8px 0;
}

.icon-ai { background: linear-gradient(135deg, #111, #222); }
.icon-w3 { background: linear-gradient(135deg, #111, #222); }
.icon-ui { background: linear-gradient(135deg, #111, #222); }
.icon-gd { background: linear-gradient(135deg, #111, #222); }

.server-icon-add { color: var(--text-main); }
.server-icon-add svg { stroke: var(--text-muted); transition: stroke 0.3s; }
.server-icon-wrapper:hover .server-icon-add svg { stroke: var(--text-main); }

/* ================= MAIN CONTENT AREA ================= */
.main-wrapper {
    flex-grow: 1; position: relative;
}

#home-view, #chat-view {
    position: absolute; top: 0; left: 0; right: 0; bottom: 0; display: flex; overflow: hidden;
}
#chat-view { display: none; }

/* Elegant, subtle white ambient glow at the top of all views (Hub & Chat)! */
#chat-ambient-glow, #home-ambient-glow {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 220px;
    pointer-events: none;
    background: radial-gradient(circle at 50% 0%, rgba(255, 255, 255, 0.05) 0%, transparent 75%);
    filter: blur(70px);
    z-index: 1;
}

/* --- COMMUNITY HUB --- */
#home-view { flex-direction: column; }

.hub-header {
    height: 72px; min-height: 72px; display: flex; align-items: center; justify-content: space-between;
    padding: 0 48px; border-bottom: 1px solid var(--border-light);
    background: rgba(0,0,0,0.2); backdrop-filter: blur(10px); z-index: 100;
}
.hub-header-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    user-select: none;
    transition: opacity 0.2s, transform 0.2s;
}
.hub-header-brand:hover {
    opacity: 0.95;
    transform: translateY(-0.5px) scale(1.01);
}
.hub-header-brand:active {
    transform: translateY(0.5px) scale(0.99);
}

.hub-header-logo {
    height: 36px; /* Polished header logo height */
    width: auto;
    object-fit: contain;
    display: block;
    filter: drop-shadow(0 2px 10px rgba(255, 255, 255, 0.08));
    user-select: none;
}

.hub-header-title {
    font-family: 'Lobster Two', cursive;
    font-weight: 400;
    font-size: 1.85rem; /* Slightly smaller for a premium micro-sized logo aesthetic! */
    letter-spacing: 0.03em;
    text-transform: none;
    background: linear-gradient(180deg, #ffffff 35%, #cbd5e1 75%, #94a3b8 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    display: inline-block;
    filter: drop-shadow(0 2px 10px rgba(255, 255, 255, 0.12));
    line-height: 1.4;
    padding: 0 6px;
    margin-top: -2px; /* lowered slightly from -6px */
    margin-left: -6px; /* shifted slightly to the left */
}

/* Top Middle Hub Search Bar styling */
.hub-search-container {
    position: relative; display: flex; align-items: center; width: 420px;
    background: rgba(255, 255, 255, 0.03); border: 1px solid var(--border-light);
    border-radius: 8px; padding: 8px 16px; transition: border-color 0.2s, box-shadow 0.2s;
    z-index: 101; /* Must sit above the overlay! */
}
.hub-search-container:focus-within {
    border-color: var(--border-focus); box-shadow: var(--accent-glow);
}
.hub-search-icon {
    color: var(--text-muted); margin-right: 12px; flex-shrink: 0;
}
.hub-search-input {
    background: transparent; border: none; color: var(--text-main); font-size: 0.9rem;
    outline: none; width: 100%; font-family: inherit;
}
.hub-search-input::placeholder { color: var(--text-muted); }

/* Search Overlay & Dropdown */
.hub-search-overlay {
    position: fixed;
    top: 70px; /* Below header */
    left: 0;
    width: 100%;
    height: calc(100vh - 70px);
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 90;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}
.hub-search-overlay.active {
    opacity: 1;
    pointer-events: all;
}
.search-dropdown-container {
    position: absolute;
    top: 45px;
    left: 0;
    width: 100%;
    background: rgba(22, 22, 22, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--border-light);
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
    padding: 8px;
    z-index: 100;
    opacity: 0;
    transform: translateY(-10px);
    pointer-events: none;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    max-height: 400px;
    overflow-y: auto;
}
.search-dropdown-container.active {
    opacity: 1;
    transform: translateY(0);
    pointer-events: all;
}
.search-result-strip {
    display: flex;
    align-items: center;
    padding: 12px;
    border-radius: 8px;
    transition: background 0.2s;
    cursor: pointer;
    gap: 16px;
}
.search-result-strip:hover {
    background: rgba(255, 255, 255, 0.05);
}
.search-result-avatar {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    background: #111;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.9rem;
    border: 1px solid var(--border-light);
    flex-shrink: 0;
}
.search-result-info {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}
.search-result-name {
    font-size: 1rem;
    font-weight: 500;
    color: var(--text-main);
}
.search-result-meta {
    font-size: 0.8rem;
    color: var(--text-muted);
}
.search-result-join-btn {
    padding: 6px 16px;
    border-radius: 20px;
    background: var(--text-main);
    color: #000;
    font-weight: 600;
    font-size: 0.85rem;
    border: none;
    cursor: pointer;
    transition: transform 0.2s;
}
.search-result-join-btn:hover {
    transform: scale(1.05);
}
.content-scroll { flex-grow: 1; overflow-y: auto; padding: 48px; padding-bottom: 120px; }
.communities-section { margin-bottom: 72px; max-width: 1100px; margin-left: auto; margin-right: auto; }

.section-header-wrapper { display: flex; justify-content: space-between; align-items: center; margin-bottom: 24px; }
.section-header {
    font-size: 1.18rem; font-weight: 600; text-transform: uppercase;
    letter-spacing: 0.06em; margin-bottom: 24px;
    background: linear-gradient(180deg, #ffffff 40%, rgba(255, 255, 255, 0.45) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    display: inline-flex;
    align-items: center;
}

.scroll-arrows { display: flex; gap: 8px; }
.scroll-arrows button {
    background: var(--bg-surface); border: 1px solid var(--border-light); color: var(--text-main);
    width: 36px; height: 36px; border-radius: 8px; cursor: pointer; display: flex; justify-content: center; align-items: center; transition: all 0.2s;
}
.scroll-arrows button:hover { background: var(--bg-surface-hover); border-color: var(--border-focus); }

.horizontal-scroll {
    display: flex;
    gap: 24px;
    overflow-x: auto;
    padding-top: 12px; /* safety padding so floating cards do not clip */
    margin-top: -12px; /* offset margin to preserve exact layout rhythm */
    padding-bottom: 24px;
    scroll-behavior: smooth;
    scrollbar-width: none;
}
.horizontal-scroll::-webkit-scrollbar { display: none; }

.community-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 24px;
    padding-top: 12px; /* safety padding for hover translation */
    margin-top: -12px; /* offset margin */
}

/* Fixed Premium Community Cards with Banners */
.community-card {
    background: linear-gradient(145deg, #161616 0%, #080808 100%); border: 1px solid #1f1f1f; border-radius: 16px;
    cursor: pointer; transition: all 0.3s ease; position: relative; overflow: hidden;
    display: flex; flex-direction: column; min-width: 320px; max-width: 320px;
}
.community-card:hover { border-color: var(--border-focus); transform: translateY(-4px); box-shadow: 0 12px 32px rgba(0,0,0,0.5); }

.card-banner { height: 80px; position: relative; width: 100%; background-size: cover !important; background-position: center !important; background-repeat: no-repeat !important; }
.card-banner::after { content: ''; position: absolute; top:0; left:0; right:0; bottom:0; background: linear-gradient(180deg, transparent 0%, rgba(0,0,0,0.5) 100%); }
.banner-1 { background: url('thumb_ai.png') center/cover; }
.banner-2 { background: url('thumb_web3.png') center/cover; }
.banner-3 { background: url('thumb_ui.png') center/cover; }
.banner-4 { background: url('thumb_rust.png') center/cover; }

.card-body { padding: 0 20px 20px 20px; flex-grow: 1; display: flex; flex-direction: column; }

.card-avatar {
    width: 48px; height: 48px; border-radius: 12px; background: #161616; border: 3px solid #161616;
    display: flex; justify-content: center; align-items: center; font-weight: 600; font-size: 1rem;
    margin-top: -24px; margin-bottom: 12px; position: relative; z-index: 2;
}

.community-name {
    font-size: 1.15rem; font-weight: 500; margin-bottom: 4px; letter-spacing: -0.01em;
    display: flex; align-items: center;
}

/* Premium Official Checkmark with cyan/blue gradient fill */
.verify-badge {
    width: 16px; height: 16px; margin-left: 4px; display: inline-block; flex-shrink: 0;
}
.verify-badge path {
    fill: url(#verify-grad);
}
.chat-verify { width: 18px; height: 18px; margin-left: -2px; }

/* Premium Member & Online Metadata Row */
.community-meta {
    display: flex; align-items: center; font-size: 0.8rem; color: var(--text-muted); margin-bottom: 12px;
}
.online-indicator {
    width: 6px; height: 6px; background-color: #22c55e; border-radius: 50%; margin-right: 6px;
    box-shadow: 0 0 8px #22c55e; flex-shrink: 0;
}
.meta-separator { margin: 0 8px; color: #222; }

.community-desc { font-size: 0.9rem; color: var(--text-muted); line-height: 1.5; flex-grow: 1; }

.card-footer {
    padding: 16px 20px; border-top: 1px solid var(--border-light); background: rgba(0,0,0,0.2);
}

.join-btn {
    background: var(--text-main); color: var(--bg-deep); border: none; border-radius: 8px; padding: 10px 0;
    width: 100%; font-weight: 600; font-size: 0.9rem; cursor: pointer; transition: opacity 0.2s;
}
.join-btn:hover { opacity: 0.9; }
.btn-outline {
    background: transparent;
    color: var(--text-main);
    border: 1px solid var(--border-light);
    border-radius: 8px;
    padding: 10px 24px;
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s;
    font-family: inherit;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.btn-outline:hover {
    background: var(--bg-surface);
    border-color: var(--border-focus);
}

.empty-pinned-state {
    color: var(--text-muted);
    font-size: 0.85rem;
    font-style: italic;
    background: rgba(255, 255, 255, 0.015);
    border: 1px dashed rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    padding: 48px 16px;
    text-align: center;
    line-height: 1.5;
}
.empty-pinned-state.thin-state {
    padding: 32px 16px;
}

/* --- CHAT VIEW UI --- */
.chat-main { 
    flex-grow: 1; 
    display: flex; 
    flex-direction: column; 
    background: transparent; 
    min-width: 0; 
    position: relative;
}

/* ================= UNREAD TRACKER UI ================= */
.unread-messages-pill {
    position: absolute;
    bottom: 90px; /* Float above the input container */
    left: 50%;
    transform: translateX(-50%);
    background: rgba(17, 17, 17, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    padding: 8px 16px;
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    z-index: 50;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
    color: #fff;
    font-size: 0.85rem;
    font-weight: 600;
    font-family: 'Inter', sans-serif;
    transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}
.unread-messages-pill:hover {
    background: rgba(30, 30, 30, 0.9);
    border-color: rgba(255, 255, 255, 0.2);
    transform: translateX(-50%) translateY(-2px);
}
.unread-dot {
    width: 8px;
    height: 8px;
    background: #ef4444; /* Alert red */
    border-radius: 50%;
    box-shadow: 0 0 8px rgba(239, 68, 68, 0.6);
}
.unread-divider {
    display: flex;
    align-items: center;
    text-align: center;
    color: #ef4444;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin: 16px 0;
    width: 100%;
}
.unread-divider::before,
.unread-divider::after {
    content: '';
    flex: 1;
    border-bottom: 1px solid rgba(239, 68, 68, 0.3);
}
.unread-divider::before {
    margin-right: 12px;
}
.unread-divider::after {
    margin-left: 12px;
}

.chat-header {
    height: 72px; min-height: 72px; border-bottom: 1px solid var(--border-light);
    display: flex; align-items: center; justify-content: space-between; padding: 0 32px;
    background: rgba(0,0,0,0.2); backdrop-filter: blur(10px); z-index: 10;
}

.chat-header-left { display: flex; align-items: center; justify-content: flex-start; gap: 12px; }

.chat-header-center { display: flex; align-items: center; justify-content: center; gap: 12px; flex-grow: 1; }

.back-btn {
    background: transparent; border: none; color: var(--text-muted); cursor: pointer;
    display: flex; align-items: center; justify-content: center; transition: color 0.2s;
}
.back-btn:hover { color: var(--text-main); }

.chat-title {
    font-size: 1.1rem;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    background: linear-gradient(180deg, #ffffff 40%, rgba(255, 255, 255, 0.45) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.header-members-pill {
    display: flex; align-items: center; background: transparent; border: none; padding: 0; font-size: 0.8rem; color: var(--text-muted);
}

.chat-header-right { display: flex; align-items: center; justify-content: flex-end; gap: 20px; }

.header-icon {
    color: var(--text-muted); cursor: pointer; transition: color 0.25s, transform 0.2s; display: flex; align-items: center;
}
.header-icon:hover {
    color: var(--text-main); transform: scale(1.08);
}

.chat-messages { flex-grow: 1; padding: 32px; overflow-y: auto; display: flex; flex-direction: column; gap: 24px; }

/* Premium Slack/Discord-style Chat Messages (No Text Bubbles, Left Aligned) */
@keyframes messageFadeIn {
    from {
        opacity: 0;
        transform: translateY(12px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.message { 
    display: flex; 
    position: relative; /* Anchor for absolute avatar */
    max-width: 85%; 
    align-items: flex-start; 
    animation: messageFadeIn 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
    opacity: 0; /* Starts hidden until animation kicks in */
}

/* Pull grouped messages tightly together, overriding the 24px container gap */
.message.grouped-message {
    margin-top: -20px !important;
}

.message-avatar { 
    position: absolute; 
    left: 0; 
    top: 0; 
    width: 36px; 
    height: 36px; 
    border-radius: 50%; 
    background: #222; 
    flex-shrink: 0; 
    border: 1px solid #333; 
}
.message-avatar.user2 { background: linear-gradient(135deg, #f5af19, #f12711); }
.message-avatar.user-self { background: linear-gradient(135deg, #f5af19, #f12711); }

.message-bubble-wrapper {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    max-width: 100%;
    min-width: 0;
    margin-left: 48px; /* 36px avatar + 12px gap for all messages */
}

.message-content {
    position: relative;
    background: transparent;
    border: none;
    padding: 0;
    border-radius: 0;
    box-shadow: none;
    transition: none;
    max-width: 100%;
    min-width: 0;
}

.message-header { display: flex; align-items: baseline; gap: 8px; margin-bottom: 4px; }
.message-author { font-weight: 600; font-size: 0.9rem; color: var(--text-main); }
.message-header-time {
    font-size: 10px !important;
    font-weight: 400 !important;
    color: rgba(255, 255, 255, 0.35) !important;
    margin-left: 6px;
    font-family: 'Outfit', 'Inter', sans-serif;
    user-select: none;
}
.message-text {
    font-size: 0.95rem;
    line-height: 1.5rem; /* Explicitly locked line-height for perfect repeating background alignment */
    background: linear-gradient(180deg, #ffffff 35%, #d4d4d8 100%);
    background-size: 100% 1.5rem; /* Repeats the gradient precisely once per line of text! */
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    display: inline-block;
    max-width: 450px; /* Cozy, modern layout max-width for tight text wrapping */
    word-break: break-word;
    overflow-wrap: anywhere;
}
.message-text * {
    -webkit-text-fill-color: initial;
    background-clip: initial;
}

.message.self { align-self: flex-start; flex-direction: row; }
.message.self .message-bubble-wrapper { align-items: flex-start; }
.message.self .message-content { background: transparent; }


.chat-input-container { padding: 0 32px 32px 32px; perspective: 1000px; }
.chat-input-wrapper {
    background: rgba(15, 15, 18, 0.6);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-top: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 16px;
    display: flex; align-items: center; padding: 14px 20px; 
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: 0 12px 32px rgba(0,0,0,0.4), inset 0 1px 0 rgba(255,255,255,0.05);
    position: relative;
    transform-style: preserve-3d;
}

/* Premium bottom middle edge light */
.chat-input-wrapper::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 20%;
    right: 20%;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(16, 185, 129, 0), transparent);
    transition: all 0.5s ease;
    border-radius: 50%;
}

.chat-input-wrapper:focus-within, .chat-input-wrapper:has(.mic-recording), .chat-input-wrapper:has(#voice-preview-container[style*="display: flex"]) { 
    border-color: rgba(16, 185, 129, 0.4); 
    box-shadow: 0 16px 40px rgba(0,0,0,0.5), 0 12px 40px -10px rgba(16, 185, 129, 0.25); 
    transform: translateY(-2px);
}

.chat-input-wrapper:focus-within::after, .chat-input-wrapper:has(.mic-recording)::after, .chat-input-wrapper:has(#voice-preview-container[style*="display: flex"])::after {
    background: linear-gradient(90deg, transparent, rgba(16, 185, 129, 1), transparent);
    box-shadow: 0 0 20px 2px rgba(16, 185, 129, 0.6);
}

.chat-input {
    flex-grow: 1; background: transparent; border: none; color: var(--text-main); font-size: 0.95rem;
    outline: none; font-family: inherit; padding: 0 16px;
}
.chat-input::placeholder { color: rgba(255, 255, 255, 0.3); transition: color 0.3s; }
.chat-input:focus::placeholder { color: rgba(255, 255, 255, 0.5); }

.chat-input-actions { display: flex; gap: 16px; align-items: center; }

/* Premium icon styling with bottom gradient/shadow */
.chat-input-actions svg, .chat-input-wrapper > div > svg:not(#voice-preview-submit):not(#voice-preview-delete):not(#voice-preview-play-btn svg) { 
    cursor: pointer; 
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1) !important; 
    color: #ffffff !important;
    opacity: 0.5;
    filter: drop-shadow(0 2px 2px rgba(0,0,0,0.8));
}

.chat-input-actions svg:hover, .chat-input-wrapper > div > svg:not(#voice-preview-submit):not(#voice-preview-delete):not(#voice-preview-play-btn svg):hover { 
    color: #10b981 !important; 
    opacity: 1;
    transform: translateY(-2px) scale(1.05);
    filter: drop-shadow(0 4px 8px rgba(16, 185, 129, 0.6));
}

/* Ensure #input-action-trigger container doesn't clash */
#input-action-trigger { transition: all 0.3s ease !important; color: inherit !important; }

/* ================= PINNED INFO RIGHT SIDEBAR ================= */
.chat-right-panel {
    position: relative;
    width: 320px; min-width: 320px; background: rgba(0,0,0,0.15); border-left: 1px solid var(--border-light);
    display: flex; flex-direction: column; z-index: 10;
}

.resize-handle {
    position: absolute;
    top: 0;
    left: -4px;
    bottom: 0;
    width: 8px; /* Wider click area for accessibility */
    cursor: col-resize;
    z-index: 100;
}

.resize-handle::after {
    content: '';
    position: absolute;
    top: 0;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 2px; /* Razor thin visible line */
    background: transparent;
    transition: background 0.2s ease, box-shadow 0.2s ease;
}

.resize-handle:hover::after, .resize-handle:active::after {
    background: rgb(34, 197, 94); /* Neon green core */
    box-shadow: 0 0 8px rgb(34, 197, 94), 0 0 12px rgba(34, 197, 94, 0.6); /* Soft emerald glow */
}

.panel-header {
    height: 72px; min-height: 72px; border-bottom: 1px solid var(--border-light);
    display: flex; align-items: center; justify-content: space-between; padding: 0 24px; font-weight: 500; font-size: 1.05rem;
}

.panel-content {
    flex-grow: 1; overflow-y: auto; padding: 24px; display: flex; flex-direction: column; gap: 28px;
    transition: opacity 0.4s ease, max-height 0.4s ease, padding 0.4s ease;
    max-height: 1000px;
    opacity: 1;
}

.chat-right-panel.tv-focused-mode .panel-content {
    opacity: 0;
    max-height: 0px;
    padding-top: 0px;
    padding-bottom: 0px;
    overflow: hidden;
}

.panel-header-title-wrap {
    position: relative;
    display: flex;
    align-items: center;
    width: 140px;
    height: 24px;
}

.panel-title {
    position: absolute;
    left: 0;
    transition: opacity 0.4s ease, transform 0.4s ease;
    white-space: nowrap;
}

.panel-title-visible {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

.panel-title-hidden {
    opacity: 0;
    transform: translateY(5px);
    pointer-events: none;
}

.panel-icon-btn {
    background: none;
    border: none;
    padding: 6px;
    cursor: pointer;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    transition: color 0.2s, background 0.2s, transform 0.3s ease;
}
.panel-icon-btn:hover {
    color: var(--text-main);
    background: rgba(255, 255, 255, 0.05);
}
.panel-icon-btn.active {
    color: rgb(34, 197, 94);
    background: transparent;
    filter: drop-shadow(0 0 6px rgba(34, 197, 94, 0.6));
    transform: scale(1.1);
}

.chat-right-panel.sidebar-transitioning {
    transition: width 0.4s cubic-bezier(0.16, 1, 0.3, 1), min-width 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.panel-section { display: flex; flex-direction: column; gap: 12px; }

.panel-section-title {
    font-size: 0.75rem; text-transform: uppercase; font-weight: 600; color: var(--text-muted);
    letter-spacing: 0.05em;
}
.pinned-links-list { display: flex; flex-direction: column; gap: 8px; }
.pinned-link-item {
    text-decoration: none; color: var(--text-main); background: var(--bg-panel);
    border: 1px solid var(--border-light); border-radius: 8px; padding: 12px;
    display: flex; align-items: center; gap: 10px; font-size: 0.85rem; transition: all 0.2s;
}
.pinned-link-item svg { color: var(--text-muted); }
.pinned-link-item:hover { border-color: var(--border-focus); background: var(--bg-surface); }

.pinned-announcement-card {
    position: relative;
    background: var(--bg-panel); border: 1px solid var(--border-light); border-radius: 8px; padding: 14px;
}
.announcement-meta { font-size: 0.7rem; color: var(--text-muted); margin-bottom: 6px; }
.announcement-text { font-size: 0.85rem; line-height: 1.5; color: #d4d4d8; }

/* Pulsing red dot notification badge for unread pinned messages */
.pinned-announcement-badge {
    position: absolute;
    top: -6px;
    right: -6px;
    background: #ff4a4a;
    color: #fff;
    font-size: 9px;
    font-weight: 800;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 0 10px rgba(255, 74, 74, 0.6);
    border: 2px solid var(--bg-deep);
    z-index: 5;
    animation: badgePulse 2s infinite ease-in-out;
}

@keyframes badgePulse {
    0% { transform: scale(1); box-shadow: 0 0 0 0 rgba(255, 74, 74, 0.7); }
    70% { transform: scale(1.08); box-shadow: 0 0 0 6px rgba(255, 74, 74, 0); }
    100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(255, 74, 74, 0); }
}

/* ================= PREMIUM VIEW TRANSITION ANIMATIONS ================= */
@keyframes fadeInSlideUp {
    from {
        opacity: 0;
        transform: translateY(12px) scale(0.99);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}
@keyframes fadeOutSlideDown {
    from {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
    to {
        opacity: 0;
        transform: translateY(12px) scale(0.99);
    }
}

.fade-in-slide {
    animation: fadeInSlideUp 0.4s cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
}
.fade-out-slide {
    animation: fadeOutSlideDown 0.3s cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
}

/* ================= SLEEK CUSTOM SCROLLBARS ================= */
.content-scroll::-webkit-scrollbar,
.chat-messages::-webkit-scrollbar,
.panel-content::-webkit-scrollbar {
    width: 6px;
}
.content-scroll::-webkit-scrollbar-track,
.chat-messages::-webkit-scrollbar-track,
.panel-content::-webkit-scrollbar-track {
    background: transparent;
}
.content-scroll::-webkit-scrollbar-thumb,
.chat-messages::-webkit-scrollbar-thumb,
.panel-content::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.08);
    border-radius: 10px;
    transition: background 0.3s;
}
.content-scroll::-webkit-scrollbar-thumb:hover,
.chat-messages::-webkit-scrollbar-thumb:hover,
.panel-content::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.18);
}

/* Firefox compatibility */
.content-scroll,
.chat-messages,
.panel-content {
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.08) transparent;
}

/* Hide scrollbar in sidebar for maximum sleekness */
.server-sidebar {
    overflow-y: auto;
    scrollbar-width: none;
}
.server-sidebar::-webkit-scrollbar {
    display: none;
}

/* ================= PREMIUM MODAL & CREATE FLOW ================= */
.modal-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(12px);
    display: none; /* Controlled by JS */
    justify-content: center;
    align-items: center;
    z-index: 100;
    opacity: 0;
    transition: opacity 0.3s ease;
}
.modal-overlay.active {
    display: flex;
    opacity: 1;
}

.modal-card {
    background: linear-gradient(145deg, #121212 0%, #050505 100%);
    border: 1px solid #222;
    border-radius: 24px;
    width: 680px;
    max-width: 90%;
    padding: 40px;
    box-shadow: 0 24px 64px rgba(0,0,0,0.8), var(--accent-glow);
    position: relative;
    overflow: hidden;
    transform: scale(0.95) translateY(20px);
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}
.modal-overlay.active .modal-card {
    transform: scale(1) translateY(0);
}

.modal-step {
    display: none;
}
.modal-step.active {
    display: block;
    animation: fadeInSlideUp 0.4s cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
}

.modal-title {
    font-size: 1.75rem;
    font-weight: 600;
    margin-bottom: 8px;
    letter-spacing: -0.02em;
    background: linear-gradient(to right, #fff 0%, #888 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}
.modal-subtitle {
    font-size: 0.95rem;
    color: var(--text-muted);
    margin-bottom: 32px;
}

/* Step 1 Type Grid */
.community-type-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    margin-bottom: 32px;
}
.type-card {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid #1c1c1c;
    border-radius: 16px;
    padding: 24px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    position: relative;
    display: flex;
    flex-direction: column;
}
.type-card:hover {
    border-color: #333;
    background: rgba(255, 255, 255, 0.04);
    transform: translateY(-4px);
    box-shadow: 0 12px 24px rgba(0,0,0,0.4);
}
.type-card.premium:hover {
    border-color: #22c55e;
    box-shadow: 0 12px 24px rgba(34, 197, 94, 0.12);
}
.type-icon-wrapper {
    width: 56px;
    height: 56px;
    border-radius: 12px;
    background: #111;
    border: 1px solid #222;
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 20px;
    color: var(--text-main);
    transition: all 0.3s;
}
.type-card:hover .type-icon-wrapper {
    border-color: var(--border-focus);
    color: #fff;
    background: #161616;
}
.type-card.premium .type-icon-wrapper {
    background: linear-gradient(135deg, rgba(34, 197, 94, 0.1), rgba(0, 242, 254, 0.1));
    border-color: rgba(34, 197, 94, 0.2);
    color: #22c55e;
    filter: drop-shadow(0 0 6px rgba(34, 197, 94, 0.5));
}
.type-card.premium:hover .type-icon-wrapper {
    border-color: #22c55e;
    background: linear-gradient(135deg, rgba(34, 197, 94, 0.15), rgba(0, 242, 254, 0.15));
    filter: drop-shadow(0 0 10px rgba(34, 197, 94, 0.8));
}
.type-card h3 {
    font-size: 1.15rem;
    font-weight: 500;
    margin-bottom: 8px;
}
.type-card p {
    font-size: 0.85rem;
    color: var(--text-muted);
    line-height: 1.5;
    flex-grow: 1;
}
.type-badge {
    position: absolute;
    top: 16px; right: 16px;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 4px 8px;
    border-radius: 20px;
    background: rgba(255,255,255,0.05);
    color: var(--text-muted);
    border: 1px solid rgba(255,255,255,0.05);
}
.type-card.premium .type-badge {
    background: linear-gradient(135deg, #22c55e, #00f2fe);
    color: #052e16;
    border: none;
    font-weight: 700;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 16px;
    padding-top: 24px;
    border-top: 1px solid var(--border-light);
}

/* Step 2 Form Styling */
.form-group {
    margin-bottom: 24px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.form-group label {
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}
.form-group input[type="text"],
.form-group textarea,
.form-group input[type="number"] {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-light);
    border-radius: 8px;
    padding: 12px 16px;
    color: var(--text-main);
    font-size: 0.95rem;
    outline: none;
    font-family: inherit;
    transition: all 0.25s;
}
.form-group input[type="text"]:focus,
.form-group textarea:focus,
.form-group input[type="number"]:focus {
    border-color: var(--border-focus);
    box-shadow: var(--accent-glow);
    background: rgba(255, 255, 255, 0.05);
}

/* Pricing Input wrapper */
.price-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}
.currency-symbol {
    position: absolute;
    left: 16px;
    font-size: 1rem;
    color: var(--text-muted);
}
.price-input-wrapper input {
    width: 100%;
    padding-left: 32px !important;
    padding-right: 64px !important;
}
.price-period {
    position: absolute;
    right: 16px;
    font-size: 0.85rem;
    color: var(--text-muted);
}

/* Gradient Selector for branding */
.gradient-selector {
    display: flex;
    gap: 12px;
}
.grad-option {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    cursor: pointer;
    border: 2px solid transparent;
    transition: all 0.2s;
}
.grad-option:hover {
    transform: scale(1.1);
}
.grad-option.active {
    border-color: #fff;
    box-shadow: 0 0 10px rgba(255, 255, 255, 0.3);
    transform: scale(1.1);
}
.option-1 { background: linear-gradient(135deg, #00c6ff, #0072ff); }
.option-2 { background: linear-gradient(135deg, #8a2387, #e94057); }
.option-3 { background: linear-gradient(135deg, #f5af19, #f12711); }
.option-4 { background: linear-gradient(135deg, #11998e, #38ef7d); }
.option-5 { background: linear-gradient(135deg, #ff9966, #ff5e62); }

/* ================= LOADING SCREEN ANIMATIONS ================= */
.loading-logo {
    animation: pulseLogo 1.6s infinite ease-in-out;
}

@keyframes pulseLogo {
    0%, 100% {
        transform: scale(1);
        filter: drop-shadow(0 0 0px rgba(255,255,255,0));
    }
    50% {
        transform: scale(1.08);
        filter: drop-shadow(0 0 20px rgba(255, 255, 255, 0.15));
    }
}

.community-count-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-muted);
    -webkit-text-fill-color: var(--text-muted); /* Overrides text-gradient inheritance */
    font-size: 0.85rem;
    font-weight: 600;
    padding: 2px 10px;
    border-radius: 20px;
    margin-left: 12px;
    border: 1px solid rgba(255, 255, 255, 0.06);
    box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.02);
}

/* Logo Expand Fade Out animation at the end of creation (viewport scale) */
.expand-fade-out {
    will-change: transform, opacity;
    backface-visibility: hidden;
    transform: translate3d(0, 0, 0);
    animation: logoExpandFade 0.6s cubic-bezier(0.22, 1, 0.36, 1) forwards !important;
}

@keyframes logoExpandFade {
    0% {
        transform: scale(1) translate3d(0, 0, 0);
        opacity: 1;
    }
    100% {
        transform: scale(15) translate3d(0, 0, 0);
        opacity: 0;
    }
}

/* Modal Card full screen transition (removes borders/background during loader) */
.modal-card.loading-fullscreen {
    background: transparent !important;
    border-color: transparent !important;
    box-shadow: none !important;
    backdrop-filter: none !important;
    max-width: 100% !important;
    width: auto !important;
    overflow: visible !important; /* Allow massive logo to scale outside card boundaries! */
    transition: none !important; /* Disable transition entirely when full-screen loader starts to avoid a mini-panel flash! */
}

/* Glassmorphic Header Dropdown */
.header-dropdown {
    display: none;
    position: absolute;
    top: 50px;
    right: 0px;
    background: #121214;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 12px;
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.8);
    padding: 6px;
    z-index: 95;
    min-width: 180px;
    transform: translateY(-8px);
    opacity: 0;
    transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.2s ease;
}

.header-dropdown.active {
    display: block;
    transform: translateY(0);
    opacity: 1;
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    background: transparent;
    border: none;
    border-radius: 8px;
    padding: 10px 14px;
    color: var(--text-main);
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    text-align: left;
    transition: all 0.2s ease;
    font-family: inherit;
}

.dropdown-item:hover {
    background: rgba(255, 255, 255, 0.06);
}

.dropdown-item.leave-btn {
    color: #ff5252;
}

.dropdown-item.leave-btn:hover {
    background: rgba(255, 82, 82, 0.12);
}

/* Tiny, modern community logo in chat header */
.header-logo-avatar {
    width: 35px;
    height: 35px;
    border-radius: 9px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    font-weight: 700;
    color: #fff;
    letter-spacing: -0.02em;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.35);
    flex-shrink: 0;
    border: 1px solid rgba(255, 255, 255, 0.12);
    text-shadow: 0 1px 2px rgba(0,0,0,0.5);
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

/* Premium Drag and Drop Upload Zones */
.media-upload-row {
    display: flex;
    gap: 16px;
    margin-top: 8px;
}

.upload-zone {
    background: rgba(255, 255, 255, 0.02);
    border: 1.5px dashed rgba(255, 255, 255, 0.12);
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    transition: all 0.25s ease;
    color: var(--text-muted);
}

.upload-zone:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.3);
    color: var(--text-main);
}

.upload-zone.avatar-zone {
    width: 80px;
    height: 80px;
    border-radius: 50%; /* circular zone for server icon! */
}

.upload-zone.banner-zone {
    height: 80px;
}

.upload-preview {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    text-align: center;
    pointer-events: none;
}

.upload-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Premium Pinned Highlight Scroll Target */
.message.pinned-highlight {
    position: relative;
}

/* Subtle green indicator line for pinned messages */
.message.pinned-highlight::before {
    content: '';
    position: absolute;
    left: -20px;
    top: 0;
    bottom: 0;
    width: 3px;
    border-radius: 4px;
    background: linear-gradient(180deg, #22c55e, #10b981);
    box-shadow: 0 0 8px rgba(34, 197, 94, 0.4);
}

@keyframes pinnedFlashAnim {
    0% { opacity: 0; }
    10% { opacity: 1; }
    60% { opacity: 1; }
    100% { opacity: 0; }
}

.message.pinned-flash {
    position: relative;
    z-index: 1;
}

.message.pinned-flash::after {
    content: '';
    position: absolute;
    inset: -6px -20px -6px -20px;
    background: linear-gradient(90deg, rgba(34, 197, 94, 0.15) 0%, rgba(34, 197, 94, 0) 100%);
    pointer-events: none;
    animation: pinnedFlashAnim 1.6s ease-out forwards;
    border-radius: 8px;
    z-index: -1;
}

/* Voice Message Custom Styles & Microphone Pulsation */
@keyframes pulse-recording {
    0%, 100% { filter: drop-shadow(0 0 2px rgba(16, 185, 129, 0.4)); color: #10b981; }
    50% { filter: drop-shadow(0 0 8px rgba(16, 185, 129, 0.85)); color: #34d399; }
}
.chat-input-wrapper .mic-recording, .mic-recording {
    animation: pulse-recording 1.2s infinite ease-in-out !important;
    color: #10b981 !important;
    opacity: 1 !important;
}

.voice-message-bubble {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    padding: 8px;
    max-width: 300px;
    margin-top: 6px;
}
.voice-message-bubble audio {
    height: 32px;
    outline: none;
    max-width: 250px;
    filter: invert(1) hue-rotate(180deg);
}

/* Custom Premium Wave Voice Player styling */
.custom-voice-player {
    display: flex;
    align-items: center;
    gap: 12px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 16px;
    padding: 10px 16px;
    min-width: 280px;
    max-width: 340px;
    backdrop-filter: blur(12px);
    transition: all 0.2s ease;
    user-select: none;
    margin-top: 6px;
}
.custom-voice-player:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.12);
}

.voice-play-btn {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #ffffff;
    color: #121212;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 12px rgba(255, 255, 255, 0.15);
}
.voice-play-btn:hover {
    transform: scale(1.08);
    box-shadow: 0 4px 16px rgba(255, 255, 255, 0.3);
}

#voice-preview-submit {
    transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1), filter 0.2s ease;
}
#voice-preview-submit:hover {
    transform: scale(1.08);
    filter: drop-shadow(0 2px 8px rgba(255, 255, 255, 0.3));
}
#voice-preview-submit:active {
    transform: scale(0.95);
}

.voice-wave-container {
    display: flex;
    align-items: center;
    gap: 3px;
    flex-grow: 1;
    height: 32px;
    cursor: pointer;
}

.voice-wave-bar {
    width: 3px;
    border-radius: 2px;
    background: rgba(255, 255, 255, 0.2);
    transition: background 0.15s ease, transform 0.1s ease;
}
.voice-wave-container:hover .voice-wave-bar {
    transform: scaleY(1.1);
}
.voice-wave-bar.active {
    background: linear-gradient(to top, #ffffff, #e0e0e0);
}

/* If parent message is pinned (gold gradient), make wave bars match gold aesthetic! */
.message.pinned-highlight .voice-wave-bar.active {
    background: linear-gradient(to top, #ffb400, #ff8000);
}

.voice-duration {
    font-size: 11px;
    font-family: 'Outfit', 'Inter', sans-serif;
    font-weight: 500;
    color: var(--text-muted);
    min-width: 65px;
    text-align: right;
}

/* ================= DEDICATED AUTH STYLING & ANIMATIONS ================= */
#login-view input {
    transition: border-color 0.25s ease, box-shadow 0.25s ease, background-color 0.25s ease;
}
#login-view input:focus {
    border-color: rgba(34, 197, 94, 0.6) !important;
    box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.2), 0 0 12px rgba(34, 197, 94, 0.15) !important;
    background-color: rgba(0, 0, 0, 0.35) !important;
}
.login-card {
    animation: authCardEntrance 0.5s cubic-bezier(0.16, 1, 0.3, 1) both;
}
@keyframes authCardEntrance {
    from {
        opacity: 0;
        transform: translateY(20px) scale(0.98);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}
#me-profile-dropdown {
    display: none;
    position: absolute;
    top: 40px;
    right: 0px;
    background: #121214;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 12px;
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.8);
    padding: 6px;
    z-index: 100;
    min-width: 150px;
    flex-direction: column;
    gap: 4px;
    transform-origin: top right;
    transition: transform 0.15s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.15s ease;
}
#me-profile-dropdown.active {
    display: flex;
    animation: dropdownEntrance 0.2s cubic-bezier(0.16, 1, 0.3, 1) both;
}
@keyframes dropdownEntrance {
    from {
        opacity: 0;
        transform: scale(0.95) translateY(-4px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.card-meta-icon {
    display: inline-block;
    height: 13px;
    width: auto;
    object-fit: contain;
    vertical-align: -2.5px;
    margin-right: 5px;
    opacity: 0.65;
    transition: opacity 0.2s;
}
.community-card:hover .card-meta-icon {
    opacity: 0.9;
}

/* Typewriter Cursor Blinking Keyframes */
@keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0; }
}

/* Premium Splash Screen Overlay */
.splash-screen-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: #09090b; /* dark matching background */
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 999999; /* ensure it's on top of everything! */
    opacity: 0; /* start transparent for a gentle unified fade-in! */
    visibility: visible;
    transition: opacity 1.2s cubic-bezier(0.16, 1, 0.3, 1), visibility 1.2s;
}

.splash-logo-img {
    height: 120px; /* clean and prominent */
    width: auto;
    object-fit: contain;
    opacity: 0;
    transform: scale(0.75);
    filter: drop-shadow(0 0 30px rgba(34, 197, 94, 0.25)); /* soft emerald bloom shadow! */
    transition: opacity 1.2s cubic-bezier(0.16, 1, 0.3, 1), transform 1.2s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* Breathing animation for active loading screen */
.splash-breathing {
    animation: splashGlowPulse 1.8s ease-in-out infinite alternate;
}

@keyframes splashGlowPulse {
    0% {
        transform: scale(1);
        filter: drop-shadow(0 0 25px rgba(34, 197, 94, 0.22));
    }
    100% {
        transform: scale(1.04);
        filter: drop-shadow(0 0 50px rgba(34, 197, 94, 0.5));
    }
}

/* Live Call Banner Strip */
.live-call-strip {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 24px;
    background: linear-gradient(to top, rgba(16, 185, 129, 0.15) 0%, rgba(16, 185, 129, 0.05) 100%);
    border-bottom: 1px solid rgba(16, 185, 129, 0.3);
    box-shadow: inset 0 -12px 20px -10px rgba(16, 185, 129, 0.4);
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    position: relative;
    overflow: hidden;
    opacity: 0;
    transform: translateY(-20px);
    pointer-events: none;
}

.live-call-strip.visible {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

.live-call-strip.hiding {
    opacity: 0;
    transform: translateY(-20px);
    pointer-events: none;
}



.live-call-strip::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 3px;
    height: 100%;
    background: #10b981; /* neon green bar */
    box-shadow: 0 0 10px #10b981;
}

.live-call-strip:hover {
    background: linear-gradient(to top, rgba(16, 185, 129, 0.2) 0%, rgba(16, 185, 129, 0.08) 100%);
    box-shadow: inset 0 -15px 25px -10px rgba(16, 185, 129, 0.6);
}

.live-call-strip-content {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
    min-width: 0;
}

.live-call-indicator {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #10b981;
    box-shadow: 0 0 8px #10b981, 0 0 12px #10b981;
    animation: pulseCallIndicator 1.5s infinite alternate;
}

@keyframes pulseCallIndicator {
    0% { transform: scale(1); opacity: 0.8; }
    100% { transform: scale(1.3); opacity: 1; box-shadow: 0 0 12px #10b981, 0 0 20px #10b981; }
}

.live-call-text {
    font-size: 0.85rem;
    color: #10b981;
    font-weight: 500;
    letter-spacing: 0.02em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.live-call-timer {
    font-size: 0.8rem;
    color: rgba(16, 185, 129, 0.8);
    font-variant-numeric: tabular-nums; /* prevents jitter */
    font-weight: 600;
    margin-left: 12px;
    flex-shrink: 0;
}

/* Telegram-Style Thin Pinned Announcement Strip */
.tg-pinned-strip {
    height: 44px;
    min-height: 44px;
    border-bottom: 1px solid var(--border-light);
    background: rgba(15, 15, 18, 0.6);
    backdrop-filter: blur(12px);
    display: flex;
    align-items: center;
    padding: 0 32px;
    gap: 14px;
    z-index: 9;
    cursor: pointer;
    transition: background 0.2s ease, opacity 0.3s ease, transform 0.3s ease;
    user-select: none;
    position: relative;
    overflow: hidden;
}

.tg-pinned-strip:hover {
    background: rgba(25, 25, 30, 0.8);
}

.tg-pinned-bar {
    width: 3px;
    height: 24px;
    border-radius: 2px;
    background: linear-gradient(180deg, #22c55e, #10b981);
    flex-shrink: 0;
}

.tg-pinned-content {
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-width: 0;
    flex-grow: 1;
}

.tg-pinned-title {
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #22c55e;
    line-height: 1.2;
}

.tg-pinned-text {
    font-size: 0.8rem;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.3;
}

.tg-pinned-close {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.tg-pinned-close:hover {
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-main);
}

/* --- PREMIUM TV SCREEN WIDGET --- */
.tv-screen-widget {
    margin: 16px 24px 8px 24px;
    background: linear-gradient(180deg, #09090c 0%, #000000 100%);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    padding: 16px;
    position: relative;
    overflow: hidden;
    cursor: pointer;
    box-shadow: inset 0 0 20px rgba(0, 0, 0, 0.9), 0 8px 24px rgba(0, 0, 0, 0.4);
    transition: border-color 0.3s ease, transform 0.2s ease, box-shadow 0.3s ease, margin-top 0.4s cubic-bezier(0.25, 1, 0.5, 1), aspect-ratio 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    user-select: none;
    aspect-ratio: 16 / 9;
}

.tv-screen-widget:hover {
    border-color: rgba(255, 255, 255, 0.2);
    transform: scale(1.01);
    box-shadow: inset 0 0 20px rgba(0, 0, 0, 0.9), 0 12px 32px rgba(0, 0, 0, 0.6), 0 0 15px rgba(34, 197, 94, 0.03);
}

.tv-screen-widget.not-live:hover {
    box-shadow: inset 0 0 20px rgba(0, 0, 0, 0.9), 0 12px 32px rgba(0, 0, 0, 0.6);
}

/* CRT Glare & Scanlines Overlay */
.tv-glare {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.07) 0%, rgba(255, 255, 255, 0) 50%, rgba(255, 255, 255, 0) 100%);
    pointer-events: none;
    z-index: 2;
}

.tv-scanlines {
    display: none;
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: linear-gradient(rgba(18, 16, 16, 0) 50%, rgba(0, 0, 0, 0.25) 50%), linear-gradient(90deg, rgba(255, 0, 0, 0.06), rgba(0, 255, 0, 0.02), rgba(0, 0, 255, 0.06));
    background-size: 100% 3px, 6px 100%;
    pointer-events: none;
    opacity: 0.85;
    z-index: 2;
}

.tv-screen-body {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    height: 100%;
    position: relative;
    z-index: 1;
}

.tv-status-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.tv-live-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(34, 197, 94, 0.1);
    border: 1px solid rgba(34, 197, 94, 0.3);
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 0.68rem;
    font-weight: 700;
    color: #22c55e;
    letter-spacing: 0.05em;
    box-shadow: 0 0 10px rgba(34, 197, 94, 0.15);
    transition: all 0.3s ease;
}

.tv-screen-widget.not-live .tv-live-badge {
    background: rgba(255, 255, 255, 0.03);
    border-color: rgba(255, 255, 255, 0.1);
    color: var(--text-muted);
    box-shadow: none;
}

.tv-indicator-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #22c55e;
    box-shadow: 0 0 8px #22c55e;
    animation: tvDotPulse 1.5s infinite ease-in-out;
}

.tv-screen-widget.not-live .tv-indicator-dot {
    background: rgba(255, 255, 255, 0.2);
    box-shadow: none;
    animation: none;
}

@keyframes tvDotPulse {
    0% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.2); opacity: 0.4; }
    100% { transform: scale(1); opacity: 1; }
}

.tv-channel {
    font-size: 0.68rem;
    font-weight: 600;
    color: var(--text-muted);
    font-family: monospace;
    letter-spacing: 0.05em;
    background: rgba(255, 255, 255, 0.03);
    padding: 2px 6px;
    border-radius: 3px;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.tv-program-title {
    font-size: 0.92rem;
    font-weight: 600;
    color: #ffffff;
    letter-spacing: -0.01em;
    margin: 2px 0;
    text-shadow: 0 2px 4px rgba(0,0,0,0.5);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.tv-screen-widget.not-live .tv-program-title {
    color: var(--text-muted);
    text-shadow: none;
}

.tv-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 4px;
}

.tv-audience-count {
    font-size: 0.72rem;
    color: var(--text-muted);
    font-weight: 500;
}

.tv-stream-visualizer {
    display: flex;
    align-items: flex-end;
    gap: 3px;
    height: 14px;
}

.tv-stream-visualizer span {
    width: 2px;
    height: 4px;
    background: #22c55e;
    border-radius: 1px;
    transition: all 0.3s ease;
}

.tv-screen-widget:not(.not-live) .tv-stream-visualizer span {
    animation: tvVisualizer 0.8s infinite ease-in-out;
}

.tv-screen-widget.not-live .tv-stream-visualizer span {
    background: rgba(255, 255, 255, 0.15) !important;
    animation: none !important;
    height: 2px !important;
}

.tv-stream-visualizer span:nth-child(2) { animation-delay: 0.15s; }
.tv-stream-visualizer span:nth-child(3) { animation-delay: 0.3s; }
.tv-stream-visualizer span:nth-child(4) { animation-delay: 0.45s; }

@keyframes tvVisualizer {
    0% { height: 3px; }
    50% { height: 14px; }
    100% { height: 3px; }
}

/* --- PREMIUM GLASSMORPHIC CONTEXT MENU --- */
.custom-context-menu {
    position: fixed;
    z-index: 100000;
    display: none;
    background: rgba(18, 18, 22, 0.85);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    padding: 6px;
    width: 170px;
    box-shadow: 0 16px 32px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(255, 255, 255, 0.05);
    opacity: 0;
    transform: scale(0.95);
    transition: opacity 0.15s cubic-bezier(0.4, 0, 0.2, 1), transform 0.15s cubic-bezier(0.4, 0, 0.2, 1);
}

.context-menu-item {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    background: none;
    border: none;
    padding: 8px 12px;
    font-size: 0.82rem;
    color: var(--text-muted);
    font-family: inherit;
    border-radius: 8px;
    cursor: pointer;
    text-align: left;
    transition: all 0.15s ease;
}

.context-menu-item:hover {
    background: rgba(255, 255, 255, 0.06);
    color: var(--text-main);
}

.context-menu-item svg {
    color: var(--text-muted);
    transition: color 0.15s ease;
}

.context-menu-item:hover svg {
    color: var(--text-main);
}

/* --- TV EXPANDED/STAGE MODE LAYOUT TRANSITIONS --- */
#chat-view.tv-expanded-mode .chat-main {
    display: none !important;
}

#chat-view.tv-expanded-mode .chat-right-panel {
    width: 100% !important;
    min-width: 100% !important;
    flex-grow: 1 !important;
    border-left: none !important;
    padding: 0 !important;
}

#chat-view.tv-expanded-mode .panel-header,
#chat-view.tv-expanded-mode .panel-content {
    display: none !important;
}

#chat-view.tv-expanded-mode .resize-handle {
    display: none !important;
}

#chat-view.tv-expanded-mode .tv-screen-widget {
    margin: 0 !important;
    border-radius: 0 !important;
    width: 100% !important;
    height: 100% !important;
    max-width: 100% !important;
    max-height: 100% !important;
    aspect-ratio: auto !important;
    border: none !important;
}

/* Exit Stage Mode Button (only visible in stage mode) */
.tv-exit-stage-btn {
    position: absolute;
    top: 24px;
    left: 24px;
    z-index: 10;
    display: none;
    align-items: center;
    gap: 8px;
    background: rgba(18, 18, 22, 0.7);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-main);
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease, transform 0.2s ease, background 0.2s ease;
}

#chat-view.tv-expanded-mode .tv-exit-stage-btn {
    display: flex;
}

.tv-exit-stage-btn:hover {
    background: rgba(30, 30, 35, 0.9);
    border-color: rgba(255, 255, 255, 0.2);
    transform: translateY(-1px);
}

/* Fullscreen Button */
.tv-fullscreen-btn {
    position: absolute;
    bottom: 24px;
    right: 24px;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(18, 18, 22, 0.7);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-main);
    width: 36px;
    height: 36px;
    border-radius: 8px;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease, transform 0.2s ease, background 0.2s ease;
}

.tv-fullscreen-btn:hover {
    background: rgba(30, 30, 35, 0.9);
    border-color: rgba(255, 255, 255, 0.2);
    transform: scale(1.05);
}

/* Minimized normal view styles override for the expansion button */
#chat-view:not(.tv-expanded-mode) .tv-fullscreen-btn {
    bottom: 12px;
    right: 12px;
    width: 28px;
    height: 28px;
    border-radius: 6px;
}
#chat-view:not(.tv-expanded-mode) .tv-fullscreen-btn svg {
    width: 14px;
    height: 14px;
    stroke-width: 2.2;
}

/* Hover over black screen in normal mode or expanded mode makes controls visible */
.tv-screen-widget:hover .tv-exit-stage-btn,
.tv-screen-widget:hover .tv-fullscreen-btn {
    opacity: 1;
    pointer-events: auto;
}

/* Custom overlay class when mouse moves inside expanded/fullscreen mode */
.tv-screen-widget.controls-visible .tv-exit-stage-btn,
.tv-screen-widget.controls-visible .tv-fullscreen-btn {
    opacity: 1 !important;
    pointer-events: auto !important;
}

/* Hides cursor and controls when not active in expanded/fullscreen modes */
#chat-view.tv-expanded-mode .tv-screen-widget:not(.controls-visible) {
    cursor: none !important;
}
#chat-view.tv-expanded-mode .tv-screen-widget:not(.controls-visible) .tv-exit-stage-btn,
#chat-view.tv-expanded-mode .tv-screen-widget:not(.controls-visible) .tv-fullscreen-btn {
    opacity: 0 !important;
    pointer-events: none !important;
}

/* Expanded TV typography & layouts */
#chat-view.tv-expanded-mode .tv-program-title {
    font-size: 2.2rem;
    margin: 20px 0;
    text-align: center;
}
#chat-view.tv-expanded-mode .tv-screen-body {
    padding: 80px 40px 40px 40px;
    justify-content: space-between;
}
#chat-view.tv-expanded-mode .tv-status-header {
    justify-content: center;
    gap: 16px;
}
#chat-view.tv-expanded-mode .tv-live-badge {
    padding: 6px 14px;
    font-size: 0.85rem;
}
#chat-view.tv-expanded-mode .tv-channel {
    padding: 4px 12px;
    font-size: 0.85rem;
}
#chat-view.tv-expanded-mode .tv-footer {
    flex-direction: column;
    gap: 16px;
    align-items: center;
}
#chat-view.tv-expanded-mode .tv-audience-count {
    font-size: 1.1rem;
}
#chat-view.tv-expanded-mode .tv-stream-visualizer {
    height: 40px;
    gap: 6px;
}
#chat-view.tv-expanded-mode .tv-stream-visualizer span {
    width: 6px;
    border-radius: 3px;
}

/* --- PREMIUM PROMPT BOX ICONS INTERACTIVE STYLING --- */
@keyframes soundwave-bounce {
    0%, 100% { transform: scaleY(1); }
    50% { transform: scaleY(1.4); }
}

.soundwave-icon rect {
    transform-origin: center;
    transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1), fill 0.2s ease;
}

/* Hover and Active Recording Equalizer Animation */
#input-action-trigger:hover .soundwave-icon rect:nth-child(1), .soundwave-icon.mic-recording rect:nth-child(1) { animation: soundwave-bounce 0.8s ease-in-out infinite 0.1s; }
#input-action-trigger:hover .soundwave-icon rect:nth-child(2), .soundwave-icon.mic-recording rect:nth-child(2) { animation: soundwave-bounce 0.8s ease-in-out infinite 0.3s; }
#input-action-trigger:hover .soundwave-icon rect:nth-child(3), .soundwave-icon.mic-recording rect:nth-child(3) { animation: soundwave-bounce 0.8s ease-in-out infinite 0.0s; }
#input-action-trigger:hover .soundwave-icon rect:nth-child(4), .soundwave-icon.mic-recording rect:nth-child(4) { animation: soundwave-bounce 0.8s ease-in-out infinite 0.2s; }
#input-action-trigger:hover .soundwave-icon rect:nth-child(5), .soundwave-icon.mic-recording rect:nth-child(5) { animation: soundwave-bounce 0.8s ease-in-out infinite 0.4s; }


#input-action-trigger:hover {
    color: var(--text-main) !important;
}

/* Sticker Hover Curl Transform */
.sticker-btn-icon {
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275), color 0.2s ease;
}
.sticker-btn-icon:hover {
    transform: rotate(-10deg) scale(1.1);
    color: var(--text-main);
}

/* --- TV POWER BUTTON & WII CHANNELS --- */
.tv-power-btn {
    position: absolute;
    top: 24px;
    right: 24px;
    z-index: 20;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(220, 38, 38, 0.2); /* standby red glow */
    border: 1px solid rgba(220, 38, 38, 0.4);
    color: #ef4444;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 0 10px rgba(220, 38, 38, 0.3);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease, transform 0.2s ease, background 0.2s ease, box-shadow 0.2s ease, color 0.2s ease;
}

.tv-screen-widget:hover .tv-power-btn {
    opacity: 1;
    pointer-events: auto;
}

.tv-power-btn.active {
    background: rgba(34, 197, 94, 0.25); /* active green glow */
    border-color: rgba(34, 197, 94, 0.5);
    color: #22c55e;
    box-shadow: 0 0 15px rgba(34, 197, 94, 0.5);
}

.tv-power-btn:hover {
    transform: scale(1.1);
}

/* Normal mode sizing override */
#chat-view:not(.tv-expanded-mode) .tv-power-btn {
    top: 12px;
    right: 12px;
    width: 28px;
    height: 28px;
}
#chat-view:not(.tv-expanded-mode) .tv-power-btn svg {
    width: 13px;
    height: 13px;
}

/* Fading behaviors linked to mouse activity in expanded mode */
.tv-screen-widget.controls-visible .tv-power-btn {
    opacity: 1 !important;
    pointer-events: auto !important;
}
#chat-view.tv-expanded-mode .tv-screen-widget:not(.controls-visible) .tv-power-btn {
    opacity: 0 !important;
    pointer-events: none !important;
}

/* Wii Menu Bubble Buttons Styling */
.wii-channel-bubble {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    padding: 14px 10px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    cursor: pointer;
    box-sizing: border-box;
    transition: all 0.25s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    box-shadow: inset 0 1px 1px rgba(255,255,255,0.05), 0 4px 10px rgba(0,0,0,0.25);
}

.wii-channel-bubble:hover {
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(255, 255, 255, 0.18);
    transform: scale(1.05);
    box-shadow: 0 6px 18px rgba(255,255,255,0.06), inset 0 1px 1px rgba(255,255,255,0.1);
}

.wii-channel-bubble:active {
    transform: scale(0.97);
}

.wii-channel-bubble.locked {
    opacity: 0.45;
    cursor: not-allowed;
    filter: grayscale(80%);
}
.wii-channel-bubble.locked:hover {
    transform: none;
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.08);
    box-shadow: inset 0 1px 1px rgba(255,255,255,0.05), 0 4px 10px rgba(0,0,0,0.25);
}

.wii-icon-glow {
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.35);
    margin-bottom: 2px;
}

.wii-channel-bubble span {
    font-size: 0.78rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.85);
    font-family: 'Outfit', 'Inter', sans-serif;
    letter-spacing: 0.3px;
}

.tv-browser-bar button:hover {
    background: rgba(255,255,255,0.2) !important;
}

/* Auto-hiding Browser Navigation Bar */
#tv-browser-content {
    position: relative;
    overflow: hidden;
}

.tv-browser-bar {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    z-index: 25;
    transform: translateY(-100%);
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    background: rgba(10, 10, 12, 0.95) !important;
    backdrop-filter: blur(8px);
}

/* Hover sensor zone at the top of the screen */
#tv-browser-content::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 25px;
    z-index: 20;
    pointer-events: auto;
}

#tv-browser-content:hover .tv-browser-bar,
.tv-browser-bar:hover {
    transform: translateY(0);
}

/* Let the iframe occupy full height underneath */
#tv-iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
    z-index: 10;
}

/* Virtual TV Apps Styles (Native DOM elements) */
.tv-virtual-app {
    width: 100%;
    height: 100%;
    overflow-y: auto;
    box-sizing: border-box;
    position: relative;
    user-select: none;
    scrollbar-width: none; /* Hide default scrollbars */
    background: #0f0f0f;
    border-radius: 8px;
}
.tv-virtual-app::-webkit-scrollbar {
    display: none; /* Hide scrollbars Chrome/Safari */
}
#tv-wii-content::-webkit-scrollbar {
    display: none;
}

/* YouTube TV Layout */
#tv-youtube-app {
    background: #0f0f0f;
    color: #fff;
    font-family: 'Outfit', -apple-system, sans-serif;
    padding: 12px;
}
.yt-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}
.yt-logo-container {
    display: flex;
    align-items: center;
    gap: 6px;
}
.yt-logo-text {
    font-weight: 700;
    font-size: 1rem;
    letter-spacing: -0.5px;
    color: #fff;
}
.yt-search-bar {
    background: rgba(255,255,255,0.08);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 20px;
    padding: 4px 10px;
    width: 40%;
    color: #fff;
    outline: none;
    font-size: 0.75rem;
}
.yt-exit-btn {
    background: rgba(255,255,255,0.1);
    border: 1px solid rgba(255,255,255,0.15);
    color: #fff;
    padding: 4px 8px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.7rem;
    font-weight: 600;
    transition: background 0.2s;
}
.yt-exit-btn:hover {
    background: rgba(255,255,255,0.2);
}
.yt-video-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
}
.yt-video-card {
    cursor: pointer;
    transition: transform 0.2s;
}
.yt-video-card:hover {
    transform: scale(1.02);
}
.yt-thumbnail {
    width: 100%;
    aspect-ratio: 16/9;
    border-radius: 6px;
    background-size: cover;
    background-position: center;
    margin-bottom: 4px;
    border: 1px solid rgba(255,255,255,0.05);
    display: flex;
    align-items: flex-end;
    justify-content: flex-end;
    padding: 2px 4px;
    box-sizing: border-box;
}
.yt-duration {
    background: rgba(0,0,0,0.85);
    padding: 1px 3px;
    border-radius: 2px;
    font-size: 9px;
    font-family: monospace;
    color: #fff;
}
.yt-details {
    display: flex;
    flex-direction: column;
}
.yt-title {
    font-size: 0.75rem;
    font-weight: 600;
    line-height: 1.2;
    margin-bottom: 1px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    color: #fff;
}
.yt-author {
    font-size: 0.65rem;
    color: #aaa;
}
.yt-player-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    background: #000;
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 30;
    overflow: hidden;
    border-radius: 8px;
}
.yt-player-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 12px;
    background: rgba(0,0,0,0.85);
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    z-index: 35;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}
.yt-back-btn {
    background: rgba(255,255,255,0.15);
    border: 1px solid rgba(255,255,255,0.1);
    color: #fff;
    padding: 4px 10px;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.75rem;
    white-space: nowrap;
}
.yt-back-btn:hover {
    background: rgba(255,255,255,0.25);
}
.yt-action-btn {
    background: #ff0000;
    color: #fff;
    border: none;
    border-radius: 4px;
    padding: 4px 10px;
    font-weight: 700;
    font-size: 0.75rem;
    cursor: pointer;
    text-decoration: none;
    white-space: nowrap;
}
.yt-action-btn:hover {
    background: #cc0000;
}
#yt-video-player {
    width: 100%;
    height: 100%;
    background: #000;
    outline: none;
    box-sizing: border-box;
    padding-top: 36px;
}

/* Netflix TV Layout */
#tv-netflix-app {
    background: #141414;
    color: #fff;
    font-family: 'Outfit', -apple-system, sans-serif;
    padding: 12px;
}
.net-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
}
.net-logo {
    font-weight: 900;
    font-size: 1.2rem;
    color: #e50914;
    letter-spacing: 0.5px;
}
.net-exit-btn {
    background: rgba(255,255,255,0.1);
    border: 1px solid rgba(255,255,255,0.15);
    color: #fff;
    padding: 4px 8px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.7rem;
    font-weight: 600;
    transition: background 0.2s;
}
.net-exit-btn:hover {
    background: rgba(255,255,255,0.2);
}
.net-hero {
    position: relative;
    width: 100%;
    height: 95px;
    border-radius: 6px;
    overflow: hidden;
    background: linear-gradient(to right, rgba(0,0,0,0.85), rgba(0,0,0,0.1)), url('https://img.youtube.com/vi/b9EkMc79ZSU/hqdefault.jpg') center/cover;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 12px;
    box-sizing: border-box;
    border: 1px solid rgba(255,255,255,0.05);
    margin-bottom: 12px;
}
.net-hero-info {
    display: flex;
    flex-direction: column;
}
.net-hero-title {
    font-size: 0.95rem;
    font-weight: 800;
    margin-bottom: 2px;
    color: #fff;
}
.net-hero-desc {
    font-size: 0.65rem;
    opacity: 0.8;
    max-width: 65%;
    line-height: 1.2;
    margin-bottom: 6px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    color: #eee;
}
.net-play-btn {
    background: #fff;
    color: #000;
    border: none;
    border-radius: 4px;
    padding: 3px 8px;
    font-weight: 700;
    font-size: 0.65rem;
    cursor: pointer;
    width: fit-content;
}
.net-play-btn:hover {
    background: #e6e6e6;
}
.net-row-title {
    font-size: 0.75rem;
    font-weight: 700;
    margin-bottom: 6px;
    color: #e5e5e5;
}
.net-movie-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
}
.net-movie-card {
    aspect-ratio: 2/3;
    border-radius: 4px;
    overflow: hidden;
    cursor: pointer;
    background-size: cover;
    background-position: center;
    border: 1px solid rgba(255,255,255,0.05);
    transition: transform 0.2s;
    position: relative;
}
.net-movie-card:hover {
    transform: scale(1.03);
    border-color: rgba(255,255,255,0.2);
}
.net-movie-title-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(to top, rgba(0,0,0,0.9), transparent);
    padding: 4px;
    font-size: 8px;
    font-weight: 600;
    text-align: center;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: #fff;
}
.net-player-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    background: #000;
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 30;
    overflow: hidden;
    border-radius: 8px;
}
.net-player-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 12px;
    background: rgba(0,0,0,0.85);
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    z-index: 35;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

/* Auto-hide/reveal logic for YouTube & Netflix Player headers */
#chat-view:not(.tv-expanded-mode) .tv-screen-widget:hover .yt-player-header,
#chat-view:not(.tv-expanded-mode) .tv-screen-widget:hover .net-player-header {
    opacity: 1;
    pointer-events: auto;
}

#chat-view.tv-expanded-mode .tv-screen-widget.controls-visible .yt-player-header,
#chat-view.tv-expanded-mode .tv-screen-widget.controls-visible .net-player-header {
    opacity: 1;
    pointer-events: auto;
}
.net-back-btn {
    background: rgba(255,255,255,0.15);
    border: 1px solid rgba(255,255,255,0.1);
    color: #fff;
    padding: 4px 10px;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.75rem;
    white-space: nowrap;
}
.net-back-btn:hover {
    background: rgba(255,255,255,0.25);
}
.net-action-btn {
    background: #e50914;
    color: #fff;
    border: none;
    border-radius: 4px;
    padding: 4px 10px;
    font-weight: 700;
    font-size: 0.75rem;
    cursor: pointer;
    text-decoration: none;
    white-space: nowrap;
}
.net-action-btn:hover {
    background: #b80710;
}
#yt-video-player,
#net-video-player {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -53.5%);
    aspect-ratio: 16 / 9;
    min-width: 100%;
    min-height: 100%;
    width: auto;
    height: auto;
    background: #000;
    outline: none;
    border: none;
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1),
                width 0.4s cubic-bezier(0.4, 0, 0.2, 1), 
                height 0.4s cubic-bezier(0.4, 0, 0.2, 1), 
                min-width 0.4s cubic-bezier(0.4, 0, 0.2, 1), 
                min-height 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* When mouse is hovering (normal mode) or active (expanded mode), scale to fit showing the buttons */
#chat-view:not(.tv-expanded-mode) .tv-screen-widget:hover #yt-video-player,
#chat-view:not(.tv-expanded-mode) .tv-screen-widget:hover #net-video-player,
#chat-view.tv-expanded-mode .tv-screen-widget.controls-visible #yt-video-player,
#chat-view.tv-expanded-mode .tv-screen-widget.controls-visible #net-video-player {
    width: 100%;
    height: auto;
    max-height: 100%;
    min-width: 0%;
    min-height: 0%;
    transform: translate(-50%, -50%);
}

.yt-loading, .yt-no-results, .yt-error {
    grid-column: 1 / -1;
    text-align: center;
    color: rgba(255, 255, 255, 0.5);
    padding: 60px 20px;
    font-size: 14px;
    font-family: inherit;
    font-weight: 500;
    text-shadow: 0 1px 2px rgba(0,0,0,0.5);
}
/* --- SCREENSHARE APP --- */
.share-player-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 12px;
    background: rgba(0,0,0,0.85);
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    z-index: 35;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
    border-top-left-radius: 8px;
    border-top-right-radius: 8px;
}

#chat-view:not(.tv-expanded-mode) .tv-screen-widget:hover .share-player-header,
#chat-view.tv-expanded-mode .tv-screen-widget.controls-visible .share-player-header {
    opacity: 1;
    pointer-events: auto;
}

.share-back-btn {
    background: rgba(255,255,255,0.15);
    border: 1px solid rgba(255,255,255,0.1);
    color: #fff;
    padding: 4px 10px;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.75rem;
    white-space: nowrap;
}
.share-back-btn:hover {
    background: rgba(255,255,255,0.25);
}

.share-action-btn {
    background: #3b82f6;
    color: #fff;
    border: none;
    border-radius: 4px;
    padding: 4px 10px;
    font-weight: 700;
    font-size: 0.75rem;
    cursor: pointer;
    text-decoration: none;
    white-space: nowrap;
}
.share-action-btn:hover {
    background: #2563eb;
}

#tv-screenshare-video {
    width: 100%;
    height: 100%;
    object-fit: contain;
    background: #000;
    outline: none;
    border: none;
    border-radius: 8px;
}

/* ================= PREMIUM GROUP PROFILE & SETTINGS MODALS ================= */
.profile-modal-card,
.settings-modal-card {
    background: rgba(18, 18, 22, 0.75) !important;
    backdrop-filter: blur(30px) saturate(180%) !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    box-shadow: 0 24px 64px rgba(0, 0, 0, 0.7), inset 0 0 20px rgba(255, 255, 255, 0.02) !important;
    animation: modalEntrance 0.35s cubic-bezier(0.16, 1, 0.3, 1) both;
}

@keyframes modalEntrance {
    from {
        opacity: 0;
        transform: translateY(15px) scale(0.97);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.profile-banner-header {
    border-top-left-radius: 24px;
    border-top-right-radius: 24px;
    background-size: cover !important;
    background-position: center !important;
    background-repeat: no-repeat !important;
    box-shadow: inset 0 -40px 40px rgba(0, 0, 0, 0.4);
}

.profile-close-btn {
    transition: all 0.2s ease;
}

.profile-close-btn:hover {
    background: rgba(255, 255, 255, 0.15) !important;
    transform: scale(1.08);
}

.profile-avatar-overlapping {
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.profile-avatar-overlapping:hover {
    transform: scale(1.04);
}

.settings-avatar-zone,
.settings-banner-zone {
    transition: all 0.2s ease;
}

.settings-avatar-zone:hover,
.settings-banner-zone:hover {
    border-color: rgba(255, 255, 255, 0.3) !important;
    background: rgba(255, 255, 255, 0.02) !important;
}


/* Slick copy button animation states */
#profile-invite-copy-text {
    transition: all 0.2s ease;
}

/* Telegram-style profile action buttons with rounded cubes */
.profile-telegram-btn {
    background: none;
    border: none;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    cursor: pointer;
    width: 64px;
    padding: 4px 0;
    transition: all 0.2s ease;
}

.profile-telegram-btn .icon-cube {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.04);
    color: rgba(255, 255, 255, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.profile-telegram-btn span {
    font-size: 0.65rem;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.6);
    transition: color 0.2s ease;
    white-space: nowrap;
}

/* Hover effects for action cubes */
.profile-telegram-btn.btn-add-friend:hover .icon-cube {
    background: rgba(34, 197, 94, 0.12) !important;
    color: #4ade80 !important;
}
.profile-telegram-btn.btn-add-friend:hover span {
    color: #4ade80 !important;
}

.profile-telegram-btn.btn-settings:hover .icon-cube {
    background: rgba(59, 130, 246, 0.12) !important;
    color: #60a5fa !important;
}
.profile-telegram-btn.btn-settings:hover span {
    color: #60a5fa !important;
}

.profile-telegram-btn.btn-leave:hover .icon-cube {
    background: rgba(239, 68, 68, 0.12) !important;
    color: #f87171 !important;
}
.profile-telegram-btn.btn-leave:hover span {
    color: #f87171 !important;
}

/* inline positioned role pill next to group name */
#profile-role-pill {
    font-size: 0.6rem;
    font-weight: 850;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 3px 8px;
    border-radius: 4px;
    user-select: none;
    line-height: 1;
    white-space: nowrap;
    border: 1px solid transparent;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: max-content;
    transition: all 0.2s ease;
    vertical-align: middle;
}

#profile-role-pill.role-owner {
    background: linear-gradient(135deg, #22222a 0%, #0d0d10 100%) !important;
    color: #a1a1aa !important; /* Muted titanium silver text */
    border-color: rgba(255, 255, 255, 0.1) !important; /* Soft silver border glow */
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.5), inset 0 1px 1px rgba(255, 255, 255, 0.05);
}

#profile-role-pill.role-member {
    background: linear-gradient(135deg, #22222a 0%, #0d0d10 100%) !important;
    color: #a1a1aa !important; /* Muted titanium silver text */
    border-color: rgba(255, 255, 255, 0.1) !important; /* Soft silver border glow */
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.5), inset 0 1px 1px rgba(255, 255, 255, 0.05);
}



/* Input Fields inside settings modal */
.settings-modal-card input[type="text"],
.settings-modal-card textarea {
    background: rgba(0, 0, 0, 0.25) !important;
    border: 1px solid rgba(255, 255, 255, 0.08) !important;
    color: #fff !important;
    transition: border-color 0.25s ease, box-shadow 0.25s ease;
}

.settings-modal-card input[type="text"]:focus,
.settings-modal-card textarea:focus {
    border-color: rgba(59, 130, 246, 0.5) !important;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15) !important;
}

/* Dynamic Links List Row styling */
.settings-resource-row {
    display: flex;
    gap: 8px;
    align-items: center;
    width: 100%;
}

.settings-resource-row input {
    flex: 1;
    min-width: 0;
    padding: 8px 12px !important;
    background: rgba(0, 0, 0, 0.2) !important;
    border: 1px solid rgba(255, 255, 255, 0.08) !important;
    border-radius: 8px !important;
    color: #fff !important;
    font-size: 0.82rem !important;
    outline: none;
}

.settings-resource-row button {
    cursor: pointer;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    flex-shrink: 0;
}

/* ========================================================= */
/* PROMPT BOX CALL AVATAR STACK */
/* ========================================================= */
#call-avatar-stack {
    display: flex;
    align-items: center;
    gap: -12px; /* Super tight overlapping */
}

.voice-widget-avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background-size: cover;
    background-position: center;
    border: 2px solid var(--bg-card);
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    margin-left: -12px; /* Overlap logic */
    box-shadow: 0 2px 6px rgba(0,0,0,0.4);
    position: relative;
    z-index: 1;
}

.voice-widget-avatar:first-child {
    margin-left: 0;
}

/* Speaking State for Stack Avatars */
.voice-widget-avatar.speaking {
    transform: scale(1.05) translateY(-1px);
    border-color: #10b981;
    box-shadow: 0 0 15px 4px rgba(16, 185, 129, 0.6);
    z-index: 10 !important; /* Pull to front visually */
}


/* EXPANDED CALL VIEW */
.expanded-call-view {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: #020203;
    position: relative;
    border-radius: 16px;
    overflow: hidden;
    padding: 28px;
    gap: 24px;
    border: 1px solid rgba(255, 255, 255, 0.03);
    box-shadow: inset 0 0 60px rgba(0, 0, 0, 0.9);
}

.expanded-call-view::before {
    display: none !important;
}

/* Liquid Mercury Background */
.liquid-bg-container {
    position: absolute;
    top: -50px;
    left: -50px;
    right: -50px;
    bottom: -50px;
    z-index: 0;
    pointer-events: none;
    overflow: hidden;
    background: #020203;
}

.space-bg-layer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: #010103; /* Deep space black */
    display: block;
}

/* We still want a sleek dark fade at the bottom for the UI controls */
.space-bg-overlay {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(to top, rgba(1, 1, 3, 0.95) 0%, rgba(1, 1, 3, 0) 35%);
    pointer-events: none;
    z-index: 1;
}

.expanded-call-header {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    z-index: 2;
    position: relative;
}

.minimize-call-btn {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: rgba(255, 255, 255, 0.6);
    border-radius: 12px;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    backdrop-filter: blur(8px);
}

.minimize-call-btn:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.18);
    color: #fff;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.minimize-call-btn:active {
    transform: translateY(0);
    background: rgba(255, 255, 255, 0.04);
}

.expanded-call-grid {
    flex: 1;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 28px;
    align-items: center;
    justify-content: center;
    overflow-y: auto;
    overflow-x: hidden;
    z-index: 1;
    padding: 10px 0;
}

.call-card {
    background: none !important;
    border: none !important;
    border-radius: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 18px;
    position: relative;
    overflow: visible;
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: none !important;
    backdrop-filter: none !important;
}

.call-card::before {
    display: none !important;
}

.call-card:hover {
    transform: translateY(-6px) scale(1.03);
    background: none !important;
    border: none !important;
    box-shadow: none !important;
}

.call-card.speaking {
    background: none !important;
    border: none !important;
    box-shadow: none !important;
}

.call-card-avatar {
    width: 112px;
    height: 112px;
    border-radius: 50%;
    background-size: cover;
    background-position: center;
    border: 3px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.6);
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    position: relative;
}

.call-card-avatar::after {
    content: '';
    position: absolute;
    top: -6px;
    left: -6px;
    right: -6px;
    bottom: -6px;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.03);
    pointer-events: none;
    transition: all 0.4s;
}

.call-card:hover .call-card-avatar {
    transform: scale(1.05);
    border-color: rgba(16, 185, 129, 0.5);
    box-shadow: 0 16px 40px rgba(16, 185, 129, 0.2), 0 16px 40px rgba(0, 0, 0, 0.7);
}

.call-card.speaking .call-card-avatar {
    border-color: #10b981;
    animation: avatarRipple 1.8s infinite cubic-bezier(0.25, 0, 0, 1);
}

@keyframes avatarRipple {
    0% {
        box-shadow: 0 0 10px 0 rgba(16, 185, 129, 0.4), 0 12px 32px rgba(0, 0, 0, 0.6);
    }
    50% {
        box-shadow: 0 0 25px 8px rgba(16, 185, 129, 0.6), 0 12px 32px rgba(0, 0, 0, 0.6);
    }
    100% {
        box-shadow: 0 0 10px 0 rgba(16, 185, 129, 0.4), 0 12px 32px rgba(0, 0, 0, 0.6);
    }
}

.call-card-name {
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.85);
    font-weight: 500;
    font-family: 'Outfit', 'Inter', sans-serif;
    letter-spacing: 0.2px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.05);
    padding: 6px 16px;
    border-radius: 99px;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    z-index: 2;
}

.call-card:hover .call-card-name {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(16, 185, 129, 0.3);
    color: #fff;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.1);
}

.call-card.speaking .call-card-name {
    background: rgba(16, 185, 129, 0.08);
    border-color: rgba(16, 185, 129, 0.3);
    color: #10b981;
    box-shadow: 0 0 15px rgba(16, 185, 129, 0.1);
}

.expanded-call-controls {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    margin: 0 auto;
    z-index: 2;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 99px;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4), inset 0 1px 1px rgba(255, 255, 255, 0.05);
    max-width: fit-content;
}

.call-control-btn {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    border: 1px solid rgba(255, 255, 255, 0.05);
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    color: rgba(255, 255, 255, 0.85);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    position: relative;
    overflow: hidden;
}

.call-control-btn svg {
    width: 18px;
    height: 18px;
}

.call-control-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.05) 0%, transparent 100%);
    pointer-events: none;
}

.call-control-btn:hover {
    transform: scale(1.08) translateY(-2px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.4);
    color: #fff;
}

.call-control-btn:active {
    transform: scale(0.95) translateY(0);
    transition-duration: 0.1s;
}

.call-control-btn.mute-btn {
    background: rgba(255, 255, 255, 0.04);
}

.call-control-btn.mute-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.15);
}

.call-control-btn.mute-btn.muted {
    background: rgba(239, 68, 68, 0.15);
    border-color: rgba(239, 68, 68, 0.4);
    color: #ef4444;
    box-shadow: 0 8px 20px rgba(239, 68, 68, 0.2);
}

.call-control-btn.mute-btn.muted:hover {
    background: rgba(239, 68, 68, 0.22);
    border-color: rgba(239, 68, 68, 0.5);
    box-shadow: 0 10px 24px rgba(239, 68, 68, 0.3);
}

.call-control-btn.disconnect-btn {
    background: linear-gradient(135deg, #ef4444 0%, #b91c1c 100%);
    border-color: rgba(239, 68, 68, 0.2);
    box-shadow: 0 8px 20px rgba(239, 68, 68, 0.3);
}

.call-control-btn.disconnect-btn:hover {
    background: linear-gradient(135deg, #f87171 0%, #dc2626 100%);
    box-shadow: 0 10px 24px rgba(239, 68, 68, 0.5);
    border-color: rgba(255, 255, 255, 0.1);
}

