:root {
    --bg-base: #030508;
    --bg-surface: #0a0e17;
    --bg-glass: rgba(12, 16, 28, 0.65);
    --primary: #00f0ff;
    --primary-dim: rgba(0, 240, 255, 0.12);
    --primary-glow: rgba(0, 240, 255, 0.4);
    --secondary: #7000ff;
    --accent: #a855f7;
    --text-main: #edf2f7;
    --text-dim: #64748b;
    --glass-border: rgba(255, 255, 255, 0.06);
    --danger: #ff3366;
    --gold: #fbbf24;
    --sidebar-w: 280px;
    --radius: 16px;
}

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

body.immersive-mode {
    font-family: 'Inter', -apple-system, sans-serif;
    background: var(--bg-base);
    color: var(--text-main);
    height: 100dvh; width: 100vw;
    overflow: hidden;
    display: flex; flex-direction: column;
}

/* ── Canvas ──────────────────────────────────── */
/* ── Canvas Mascot Widget ───────────────────── */
#canvas-container {
    position: fixed;
    top: 90px;
    bottom: auto;
    right: 24px;
    width: 200px;
    height: 200px;
    z-index: 1000;
    background: transparent;
    border: none;
    box-shadow: none;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    overflow: visible;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    cursor: pointer;
}
#canvas-container:hover {
    transform: translateY(5px);
}
#canvas-container:not(.minimized):not(:hover) {
    animation: mascotFloat 5s ease-in-out infinite;
}
#canvas-container.minimized {
    width: 68px;
    height: 68px;
    border-radius: 50%;
    top: 90px;
    bottom: auto;
    right: 24px;
    background: rgba(8, 12, 24, 0.8);
    border: 1px solid rgba(0, 240, 255, 0.35);
    box-shadow: 0 8px 32px rgba(0, 240, 255, 0.25);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}
#canvas-container.minimized:hover {
    transform: scale(1.1) rotate(5deg);
    border-color: rgba(0, 240, 255, 0.6);
    box-shadow: 0 8px 32px rgba(0, 240, 255, 0.45);
}

.mascot-toggle-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-dim);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 1010;
    transition: all 0.2s ease;
    opacity: 0;
}
#canvas-container:hover .mascot-toggle-btn {
    opacity: 1;
}
.mascot-toggle-btn:hover {
    background: rgba(255, 255, 255, 0.15);
    color: #fff;
}
#canvas-container.minimized .mascot-toggle-btn {
    display: none;
}

@keyframes mascotFloat {
    0% { transform: translateY(0px); }
    50% { transform: translateY(-8px); }
    100% { transform: translateY(0px); }
}
.nebula-overlay {
    position: absolute; inset: 0; pointer-events: none; z-index: 1;
    background:
        radial-gradient(ellipse 60% 50% at 30% 60%, rgba(112,0,255,0.06) 0%, transparent 70%),
        radial-gradient(ellipse 60% 50% at 75% 30%, rgba(0,240,255,0.05) 0%, transparent 70%),
        radial-gradient(circle at center, transparent 30%, var(--bg-base) 100%);
}

/* ── Top Nav ─────────────────────────────────── */
.top-nav {
    position: relative; z-index: 20; width: 100%;
    padding: 0.7rem 1.5rem;
    display: flex; justify-content: space-between; align-items: center;
    border-bottom: 1px solid rgba(255,255,255,0.04);
    background: rgba(3,5,8,0.85);
    backdrop-filter: blur(24px);
    flex-shrink: 0;
}
.logo {
    font-family: 'Outfit', sans-serif;
    font-size: 1.3rem; font-weight: 800; letter-spacing: 4px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
    -webkit-background-clip: text; -webkit-text-fill-color: transparent;
    filter: drop-shadow(0 0 18px rgba(0,240,255,0.3));
}
.nav-right { display: flex; align-items: center; gap: 0.75rem; }
.online-stats {
    display: flex; align-items: center; gap: 6px;
    background: rgba(0,240,255,0.06);
    padding: 6px 14px; border-radius: 100px;
    border: 1px solid rgba(0,240,255,0.1);
    font-size: 0.8rem; font-weight: 500; color: var(--primary);
}
.pulsing {
    width: 7px; height: 7px; background: var(--primary);
    border-radius: 50%; box-shadow: 0 0 6px var(--primary);
    animation: pulse 2s infinite;
}
@keyframes pulse {
    0% { box-shadow: 0 0 0 0 var(--primary-glow); }
    70% { box-shadow: 0 0 0 7px transparent; }
    100% { box-shadow: 0 0 0 0 transparent; }
}
.user-profile {
    display: flex; align-items: center; gap: 8px;
    background: rgba(255,255,255,0.04); padding: 5px 12px 5px 5px;
    border-radius: 100px; border: 1px solid var(--glass-border);
    backdrop-filter: blur(12px);
}
.avatar {
    width: 30px; height: 30px; border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    display: flex; align-items: center; justify-content: center;
    font-weight: 700; font-size: 0.85rem; flex-shrink: 0;
}
.user-info { display: flex; flex-direction: column; line-height: 1.15; }
.username { font-size: 0.8rem; font-weight: 600; }
.user-level { font-size: 0.65rem; color: var(--text-dim); cursor: pointer; transition: color .2s; }
.user-level:hover { color: var(--primary); }
.btn-auth {
    background: rgba(0,240,255,0.08); border: 1px solid rgba(0,240,255,0.2);
    color: var(--primary); padding: 6px 16px; border-radius: 100px;
    font-size: 0.8rem; font-weight: 600; cursor: pointer; transition: all .2s;
}
.btn-auth:hover { background: rgba(0,240,255,0.15); box-shadow: 0 0 20px rgba(0,240,255,0.15); }
.sidebar-toggle {
    display: none; background: rgba(255,255,255,0.05);
    border: 1px solid var(--glass-border); color: var(--text-main);
    width: 34px; height: 34px; border-radius: 10px;
    align-items: center; justify-content: center; cursor: pointer;
}

/* ── Layout ──────────────────────────────────── */
.app-layout {
    display: flex; flex: 1; position: relative; z-index: 10;
    overflow: hidden; height: calc(100dvh - 50px);
}

/* ── Sidebar ─────────────────────────────────── */
.control-panel {
    width: var(--sidebar-w); display: flex; flex-direction: column;
    padding: 1rem 0.85rem; gap: 0.65rem;
    overflow-y: auto; flex-shrink: 0;
    background: linear-gradient(180deg, rgba(8,12,22,0.8) 0%, rgba(5,8,16,0.9) 100%);
    backdrop-filter: blur(30px) saturate(1.4);
    border-right: 1px solid rgba(255,255,255,0.04);
    transition: opacity .3s, transform .35s cubic-bezier(.4,0,.2,1);
    scrollbar-width: thin; scrollbar-color: rgba(255,255,255,0.08) transparent;
    z-index: 1100;
}
.control-panel::-webkit-scrollbar { width: 3px; }
.control-panel::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.08); border-radius: 3px; }

.panel-section {
    display: flex; flex-direction: column; gap: 0.55rem;
    padding: 0.85rem; border-radius: 14px;
    background: rgba(255,255,255,0.025);
    border: 1px solid rgba(255,255,255,0.05);
    position: relative; overflow: hidden;
}
.panel-section::before {
    content: ''; position: absolute; top: 0; left: 0; right: 0; height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.08), transparent);
}
.panel-section h3 {
    font-family: 'Outfit', sans-serif;
    font-size: 0.65rem; color: var(--text-dim);
    text-transform: uppercase; letter-spacing: 1.8px; font-weight: 600;
}
.filter-group { display: flex; flex-direction: column; gap: 3px; }
.filter-group label { font-size: 0.72rem; color: var(--text-dim); font-weight: 500; }
.glass-input {
    width: 100%; background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.06); color: var(--text-main);
    padding: 8px 10px; border-radius: 10px; font-size: 0.82rem;
    outline: none; appearance: none; cursor: pointer; transition: all .2s;
}
.glass-input:focus { border-color: rgba(0,240,255,0.3); box-shadow: 0 0 0 3px rgba(0,240,255,0.08); }

.tags-container { display: flex; flex-wrap: wrap; gap: 5px; }
.tag {
    background: rgba(255,255,255,0.03); border: 1px solid rgba(255,255,255,0.06);
    color: var(--text-dim); padding: 4px 10px; border-radius: 100px;
    font-size: 0.72rem; cursor: pointer; transition: all .2s; font-weight: 500;
}
.tag:hover { background: rgba(255,255,255,0.07); color: var(--text-main); transform: translateY(-1px); }
.tag.active {
    background: rgba(0,240,255,0.1); border-color: rgba(0,240,255,0.25);
    color: var(--primary); box-shadow: 0 0 12px rgba(0,240,255,0.1);
}

.premium-module {
    background: linear-gradient(135deg, rgba(251,191,36,0.06), rgba(245,158,11,0.03)) !important;
    border-color: rgba(251,191,36,0.15) !important;
}
.premium-module::before { background: linear-gradient(90deg, transparent, rgba(251,191,36,0.12), transparent) !important; }
.premium-module h3 { color: var(--gold) !important; display: flex; align-items: center; gap: 4px; }
.premium-module p { font-size: 0.7rem; color: var(--text-dim); line-height: 1.4; }

.tabs { display: flex; gap: 2px; background: rgba(255,255,255,0.03); border-radius: 8px; padding: 2px; }
.tab {
    background: transparent; border: none; color: var(--text-dim);
    padding: 5px 12px; font-size: 0.75rem; cursor: pointer;
    border-radius: 6px; transition: all .2s; font-weight: 500;
}
.tab.active { color: var(--primary); background: rgba(0,240,255,0.08); }
.recent-list { overflow-y: auto; max-height: 120px; }
.empty-state { font-size: 0.75rem; color: var(--text-dim); font-style: italic; opacity: 0.7; }

/* ── Main Stage ──────────────────────────────── */
.main-stage {
    flex: 1; display: flex; align-items: center; justify-content: center;
    position: relative; overflow: hidden;
}
.state-container {
    display: flex; flex-direction: column; align-items: center;
    gap: 1rem; text-align: center; width: 100%; max-width: 600px;
    padding: 2rem; transition: opacity .5s;
    z-index: 10;
}
#lobby-state, #invite-landing-state {
    transform: translateY(-12vh);
}
.glitch-text {
    font-family: 'Outfit', sans-serif;
    font-size: clamp(2.2rem, 5vw, 4rem); font-weight: 800; line-height: 1.05;
    color: white;
    text-shadow: 0 0 60px rgba(0,240,255,0.2), 0 0 120px rgba(112,0,255,0.1);
}
.main-stage p { font-size: 1.05rem; color: var(--text-dim); font-weight: 400; }
.status-text {
    display: flex; align-items: center; gap: 8px;
    font-size: 0.95rem; color: var(--primary); font-weight: 500;
    animation: fadeIn .4s ease;
}
.status-text::before {
    content: ''; width: 6px; height: 6px; border-radius: 50%;
    background: var(--primary); animation: pulse 1.5s infinite;
}
@keyframes fadeIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* ── Buttons ─────────────────────────────────── */
.btn {
    padding: 10px 20px; border: none; border-radius: 10px;
    font-weight: 600; cursor: pointer; transition: all .25s;
    font-size: 0.9rem; font-family: 'Inter', sans-serif;
}
.btn-primary { background: linear-gradient(135deg, var(--primary), var(--secondary)); color: #000; }
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 8px 30px rgba(112,0,255,0.4); }
.btn-secondary {
    background: rgba(255,255,255,0.04); border: 1px solid var(--glass-border);
    color: var(--text-main); backdrop-filter: blur(8px);
}
.btn-secondary:hover { background: rgba(255,255,255,0.08); }

.massive-btn {
    padding: 16px 48px; font-size: 1.25rem; border-radius: 100px;
    margin-top: 1rem; position: relative; overflow: hidden;
    box-shadow: 0 0 40px rgba(0,240,255,0.25), 0 0 80px rgba(112,0,255,0.15);
    animation: breathe 4s ease-in-out infinite;
    letter-spacing: 0.5px;
}
.massive-btn::before {
    content: ''; position: absolute; inset: 0;
    background: linear-gradient(90deg, transparent 0%, rgba(255,255,255,0.12) 50%, transparent 100%);
    transform: translateX(-100%); animation: shimmer 3s infinite 1s;
}
@keyframes shimmer { 0% { transform: translateX(-100%); } 100% { transform: translateX(100%); } }
@keyframes breathe {
    0%,100% { box-shadow: 0 0 40px rgba(0,240,255,0.25), 0 0 80px rgba(112,0,255,0.15); }
    50% { box-shadow: 0 0 50px rgba(0,240,255,0.35), 0 0 100px rgba(112,0,255,0.25); }
}
.massive-btn:hover { transform: translateY(-3px) scale(1.03); }

.danger { color: var(--danger) !important; border-color: rgba(255,51,102,0.2) !important; }
.danger:hover { background: rgba(255,51,102,0.08) !important; }

/* ── Call Card ────────────────────────────────── */
.call-card {
    background: rgba(10,14,26,0.75);
    backdrop-filter: blur(40px) saturate(1.6);
    border: 1px solid rgba(255,255,255,0.06);
    border-radius: 24px; padding: 1.8rem;
    width: 100%; max-width: 480px;
    display: flex; flex-direction: column; align-items: center; gap: 1.2rem;
    box-shadow:
        0 0 0 1px rgba(255,255,255,0.03),
        0 20px 60px rgba(0,0,0,0.5),
        0 0 80px rgba(0,240,255,0.04),
        0 0 120px rgba(112,0,255,0.03);
    animation: cardIn .5s cubic-bezier(.4,0,.2,1);
    position: relative; overflow: hidden;
}
.call-card::before {
    content: ''; position: absolute; top: 0; left: 0; right: 0; height: 1px;
    background: linear-gradient(90deg, transparent 10%, rgba(0,240,255,0.15) 50%, transparent 90%);
}
@keyframes cardIn { from { opacity: 0; transform: scale(.96) translateY(16px); } to { opacity: 1; transform: none; } }

/* Timer */
.session-timer-wrap {
    position: relative; width: 96px; height: 96px;
    display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.timer-svg { position: absolute; inset: 0; transform: rotate(-90deg); }
.timer-track { fill: none; stroke: rgba(255,255,255,0.04); stroke-width: 3.5; }
.timer-progress {
    fill: none; stroke: url(#timerGrad); stroke-width: 3.5;
    stroke-linecap: round; stroke-dasharray: 283; stroke-dashoffset: 0;
    transition: stroke-dashoffset 1s linear;
    filter: drop-shadow(0 0 4px rgba(0,240,255,0.4));
}
.timer-display { display: flex; flex-direction: column; align-items: center; position: relative; z-index: 1; }
.timer-value {
    font-family: 'Outfit', sans-serif; font-size: 1.5rem; font-weight: 700;
    color: var(--primary); text-shadow: 0 0 16px rgba(0,240,255,0.3); line-height: 1;
    font-variant-numeric: tabular-nums;
}
.timer-label { font-size: 0.55rem; color: var(--text-dim); text-transform: uppercase; letter-spacing: 1.5px; margin-top: 2px; }
.timer-value.warning { color: #f59e0b; text-shadow: 0 0 16px rgba(245,158,11,0.4); }
.timer-value.critical { color: var(--danger); text-shadow: 0 0 16px rgba(255,51,102,0.4); animation: blink .6s infinite; }
@keyframes blink { 0%,100% { opacity: 1; } 50% { opacity: .3; } }

.partner-info { display: flex; flex-direction: column; gap: 3px; }
.partner-name { font-family: 'Outfit', sans-serif; font-size: 1.15rem; font-weight: 700; }
.partner-status { display: flex; align-items: center; gap: 5px; font-size: 0.7rem; color: var(--primary); font-weight: 500; }
.live-dot { width: 5px; height: 5px; border-radius: 50%; background: var(--primary); animation: pulse 1.5s infinite; }

.icebreaker-card {
    background: rgba(0,240,255,0.04); border: 1px solid rgba(0,240,255,0.1);
    padding: 10px 14px; border-radius: 12px; font-size: 0.8rem;
    color: rgba(0,240,255,0.85); font-weight: 500; text-align: left; width: 100%;
    line-height: 1.4; animation: slideDown .4s ease;
}
@keyframes slideDown { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: none; } }

.captions-container {
    background: rgba(0,0,0,0.35); border: 1px solid rgba(255,255,255,0.04);
    border-left: 2px solid var(--accent); padding: 10px 14px;
    border-radius: 12px; width: 100%; min-height: 44px;
    display: flex; align-items: center; justify-content: center;
}
#transcript-preview { font-size: 0.88rem; color: rgba(255,255,255,0.6); font-style: italic; margin: 0; text-align: center; }

.voice-actions { display: flex; align-items: center; justify-content: center; gap: 10px; flex-wrap: wrap; }
.btn-circle {
    width: 48px; height: 48px; border-radius: 50%;
    border: 1px solid rgba(255,255,255,0.06); background: rgba(255,255,255,0.04);
    color: var(--text-dim); display: flex; align-items: center; justify-content: center;
    cursor: pointer; transition: all .2s; backdrop-filter: blur(8px);
}
.btn-circle:hover { background: rgba(255,255,255,0.1); color: var(--text-main); transform: scale(1.08); }
.btn-circle.mic-active {
    background: rgba(0,240,255,0.1); border-color: rgba(0,240,255,0.25);
    color: var(--primary); box-shadow: 0 0 14px rgba(0,240,255,0.2);
}
.btn-circle.danger-circle {
    background: rgba(255,51,102,0.1); border-color: rgba(255,51,102,0.25);
    color: var(--danger); width: 56px; height: 56px;
    box-shadow: 0 0 16px rgba(255,51,102,0.12);
}
.btn-circle.danger-circle:hover { background: rgba(255,51,102,0.2); transform: scale(1.1); }

/* ── Chat ────────────────────────────────────── */
.chat-panel {
    position: absolute; bottom: 80px; right: 1.5rem;
    width: 300px; height: 360px; border-radius: 18px;
    display: flex; flex-direction: column; padding: 0.85rem; z-index: 100;
    background: rgba(8,12,22,0.88); backdrop-filter: blur(30px);
    border: 1px solid rgba(255,255,255,0.06);
    box-shadow: 0 20px 50px rgba(0,0,0,0.5); animation: slideUp .3s ease;
}
@keyframes slideUp { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }
.chat-messages { flex: 1; overflow-y: auto; margin-bottom: 8px; display: flex; flex-direction: column; gap: 5px; }
.message { padding: 6px 10px; border-radius: 10px; font-size: 0.82rem; max-width: 85%; word-break: break-word; }
.message.sent { background: var(--primary); color: #000; align-self: flex-end; border-bottom-right-radius: 2px; font-weight: 500; }
.message.received { background: rgba(255,255,255,0.07); color: #fff; align-self: flex-start; border-bottom-left-radius: 2px; }
.message.system { background: transparent; color: var(--text-dim); font-size: 0.7rem; align-self: center; font-style: italic; }
.chat-input-container { display: flex; gap: 6px; }

/* ── Modal ────────────────────────────────────── */
.modal {
    position: fixed; inset: 0; background: rgba(0,0,0,0.7);
    backdrop-filter: blur(10px); display: flex; align-items: center;
    justify-content: center; z-index: 1000; opacity: 0;
    pointer-events: none; transition: all .3s;
}
.modal.active { opacity: 1; pointer-events: auto; }
.modal-content {
    background: rgba(12,16,28,0.95); padding: 2.2rem;
    border-radius: 24px; width: 100%; max-width: 380px;
    position: relative; border: 1px solid rgba(255,255,255,0.06);
    box-shadow: 0 0 80px rgba(0,240,255,0.06), 0 40px 80px rgba(0,0,0,0.5);
}
.close-modal {
    position: absolute; top: 0.8rem; right: 1.1rem;
    background: none; border: none; color: var(--text-dim);
    font-size: 1.3rem; cursor: pointer;
}
.auth-forms { display: flex; flex-direction: column; gap: 8px; }

/* ── Utility ──────────────────────────────────── */
.hidden { display: none !important; }
.sidebar-backdrop {
    position: fixed; inset: 0; background: rgba(0,0,0,0.6);
    backdrop-filter: blur(4px); z-index: 1050;
}

/* ── Mobile ───────────────────────────────────── */
@media (max-width: 768px) {
    .top-nav { padding: 0.6rem 0.8rem; }
    .logo { font-size: 1.1rem; }
    .username { display: none; }
    .sidebar-toggle { display: flex; }
    .control-panel {
        position: fixed; top: 0; left: 0;
        width: 85vw; max-width: 320px; height: 100dvh;
        transform: translateX(-100%); z-index: 1100;
        padding: 1rem 0.75rem; border-right: 1px solid rgba(0,240,255,0.06);
    }
    .control-panel.open { transform: translateX(0); }
    .main-stage { padding: 1rem; }
    .state-container { padding: 1rem; gap: 0.8rem; }
    .glitch-text { font-size: clamp(1.8rem, 8vw, 2.8rem); }
    .massive-btn { padding: 14px 36px; font-size: 1.1rem; }
    .call-card { padding: 1.3rem; gap: 1rem; border-radius: 20px; }
    .session-timer-wrap { width: 80px; height: 80px; }
    .timer-value { font-size: 1.3rem; }
    .voice-actions { gap: 8px; }
    .chat-panel { position: fixed; bottom: 12px; left: 10px; right: 10px; width: auto; height: 280px; }
    .modal-content { margin: 1rem; padding: 1.8rem; }
}

@media (max-width: 380px) {
    .btn-circle { width: 42px; height: 42px; }
    .btn-circle.danger-circle { width: 50px; height: 50px; }
}

/* ── DM Chat Drawer ─────────────────────────── */
.dm-drawer {
    position: fixed; top: 0; right: 0; bottom: 0;
    width: 360px; max-width: 100vw;
    background: rgba(10, 14, 23, 0.95);
    backdrop-filter: blur(24px);
    border-left: 1px solid var(--glass-border);
    z-index: 1100;
    display: flex; flex-direction: column;
    transform: translateX(100%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
.dm-drawer:not(.hidden) {
    transform: translateX(0);
}
.dm-header {
    display: flex; align-items: center; gap: 10px;
    padding: 12px 16px;
    border-bottom: 1px solid var(--glass-border);
    background: rgba(3, 5, 8, 0.6);
}
.dm-partner-name {
    font-family: 'Outfit', sans-serif;
    font-weight: 700; font-size: 0.95rem;
}
.dm-status {
    font-size: 0.7rem; color: var(--text-dim);
}
.dm-messages {
    flex: 1; overflow-y: auto; padding: 16px;
    display: flex; flex-direction: column; gap: 6px;
}
.dm-messages .dm-msg {
    max-width: 80%; padding: 8px 14px;
    border-radius: 16px; font-size: 0.85rem;
    line-height: 1.5; word-wrap: break-word;
}
.dm-messages .dm-msg.sent {
    align-self: flex-end;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: #000; border-bottom-right-radius: 4px;
}
.dm-messages .dm-msg.received {
    align-self: flex-start;
    background: rgba(255,255,255,0.06);
    color: var(--text-main); border-bottom-left-radius: 4px;
}
.dm-messages .dm-msg .dm-time {
    font-size: 0.6rem; opacity: 0.6; margin-top: 2px;
    display: block;
}
.dm-input-bar {
    display: flex; gap: 8px; padding: 10px 16px;
    border-top: 1px solid var(--glass-border);
    background: rgba(3, 5, 8, 0.6);
}
.dm-msg-friend {
    display: flex; align-items: center; gap: 10px;
    padding: 10px 12px; border-radius: 12px;
    cursor: pointer; transition: background 0.2s;
}
.dm-msg-friend:hover { background: rgba(255,255,255,0.04); }
.dm-msg-friend .dm-f-avatar {
    width: 36px; height: 36px; border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    display: flex; align-items: center; justify-content: center;
    font-weight: 700; font-size: 0.85rem; color: #000;
    flex-shrink: 0;
}
.dm-msg-friend .dm-f-info { flex: 1; min-width: 0; }
.dm-msg-friend .dm-f-name { font-weight: 600; font-size: 0.85rem; }
.dm-msg-friend .dm-f-preview {
    font-size: 0.75rem; color: var(--text-dim);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.dm-msg-friend .dm-f-dot {
    width: 8px; height: 8px; border-radius: 50%;
    background: #34d399; flex-shrink: 0;
}
@media (max-width: 640px) {
    .dm-drawer { width: 100vw; }
}

/* ── Text Chat (Stranger) ───────────────────── */
.text-chat-container {
    width: 100%; max-width: 640px; margin: 0 auto;
    height: 70vh; max-height: 600px;
    display: flex; flex-direction: column;
    background: var(--bg-glass);
    border: 1px solid var(--glass-border);
    border-radius: 20px; overflow: hidden;
    backdrop-filter: blur(20px);
}
.text-chat-header {
    display: flex; justify-content: space-between; align-items: center;
    padding: 12px 16px;
    border-bottom: 1px solid var(--glass-border);
    background: rgba(3,5,8,0.5);
}
.text-chat-messages {
    flex: 1; overflow-y: auto; padding: 16px;
    display: flex; flex-direction: column; gap: 6px;
}
.text-chat-messages .tc-msg {
    max-width: 75%; padding: 10px 16px;
    border-radius: 18px; font-size: 0.9rem;
    line-height: 1.5; word-wrap: break-word;
    animation: tcFadeIn 0.2s ease-out;
}
@keyframes tcFadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}
.text-chat-messages .tc-msg.sent {
    align-self: flex-end;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: #000; border-bottom-right-radius: 4px;
}
.text-chat-messages .tc-msg.received {
    align-self: flex-start;
    background: rgba(255,255,255,0.07);
    color: var(--text-main); border-bottom-left-radius: 4px;
}
.tc-system-msg {
    text-align: center; color: var(--text-dim);
    font-size: 0.75rem; padding: 8px;
    font-style: italic;
}
.tc-typing {
    align-self: flex-start; color: var(--text-dim);
    font-size: 0.8rem; font-style: italic; padding: 4px 16px;
}
.text-chat-input {
    display: flex; gap: 8px; padding: 12px 16px;
    border-top: 1px solid var(--glass-border);
    background: rgba(3,5,8,0.5);
}
@media (max-width: 640px) {
    .text-chat-container { height: 80vh; max-height: none; border-radius: 0; }
.searching-text {
  animation: cosmicPulse 3s ease-in-out infinite;
}

@keyframes cosmicPulse {
  0%, 100% { opacity: 0.8; text-shadow: 0 0 10px rgba(0, 240, 255, 0.2); }
  50% { opacity: 1; text-shadow: 0 0 25px rgba(0, 240, 255, 0.6); }
}

/* Chibi Mascot Speech Bubble */
.mascot-bubble {
    position: absolute;
    right: calc(100% + 15px);
    bottom: auto;
    left: auto;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(8, 12, 24, 0.95);
    border: 1px solid rgba(0, 240, 255, 0.35);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    padding: 11px 18px;
    border-radius: 16px;
    color: #ffffff;
    font-family: 'Outfit', sans-serif;
    font-size: 0.9rem;
    font-weight: 600;
    max-width: 200px;
    width: max-content;
    text-align: center;
    box-shadow: 0 10px 36px 0 rgba(0, 240, 255, 0.25), inset 0 1px 0 rgba(255, 255, 255, 0.15);
    pointer-events: none;
    z-index: 1000;
    opacity: 0;
    transform-origin: right center;
    animation: bubblePopLeft 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.6);
}

.mascot-bubble::after {
    content: '';
    position: absolute;
    right: -6px;
    bottom: auto;
    left: auto;
    top: 50%;
    transform: translateY(-50%) rotate(45deg);
    width: 12px;
    height: 12px;
    background: rgba(8, 12, 24, 0.95);
    border-top: 1px solid rgba(0, 240, 255, 0.35);
    border-right: 1px solid rgba(0, 240, 255, 0.35);
    border-bottom: none;
    border-left: none;
}

@keyframes bubblePopLeft {
    0% { opacity: 0; transform: translate(15px, -50%) scale(0.8); }
    100% { opacity: 1; transform: translate(0, -50%) scale(1); }
}

@media (max-width: 768px) {
    #canvas-container {
        width: 130px;
        height: 130px;
        top: 80px;
        bottom: auto;
        right: 16px;
        border-radius: 20px;
    }
    #canvas-container.minimized {
        width: 56px;
        height: 56px;
        top: 80px;
        bottom: auto;
        right: 16px;
    }
    .mascot-bubble {
        max-width: 150px;
        font-size: 0.75rem;
        padding: 8px 12px;
    }
}

/* Real-time Friend Online Pulse */
.online-pulse {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: #34d399;
    box-shadow: 0 0 8px #34d399;
    animation: statusPulse 1.8s infinite;
}

@keyframes statusPulse {
    0% { box-shadow: 0 0 0 0 rgba(52, 211, 153, 0.7); }
    70% { box-shadow: 0 0 0 6px rgba(52, 211, 153, 0); }
    100% { box-shadow: 0 0 0 0 rgba(52, 211, 153, 0); }
}

/* Streak Badge Style */
.streak-badge {
    display: flex;
    align-items: center;
    gap: 4px;
    background: rgba(255, 102, 0, 0.12);
    border: 1px solid rgba(255, 102, 0, 0.35);
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 700;
    color: #ff6600;
    box-shadow: 0 0 12px rgba(255, 102, 0, 0.15);
    transition: all 0.3s ease;
    animation: fireGlow 2.5s ease-in-out infinite alternate;
}

@keyframes fireGlow {
    0% { box-shadow: 0 0 5px rgba(255, 102, 0, 0.1), inset 0 0 2px rgba(255, 102, 0, 0.05); }
    100% { box-shadow: 0 0 15px rgba(255, 102, 0, 0.3), inset 0 0 5px rgba(255, 102, 0, 0.15); }
}

/* Feedback Tag Selectors */
.feedback-tag {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--glass-border);
    color: var(--text-dim);
    padding: 6px 12px;
    border-radius: 100px;
    font-size: 0.75rem;
    cursor: pointer;
    transition: all 0.2s ease;
    user-select: none;
}

.feedback-tag:hover {
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-main);
}

.feedback-tag.selected-good {
    background: rgba(52, 211, 153, 0.15);
    border-color: rgba(52, 211, 153, 0.5);
    color: #34d399;
    box-shadow: 0 0 10px rgba(52, 211, 153, 0.15);
}

.feedback-tag.selected-bad {
    background: rgba(239, 68, 68, 0.15);
    border-color: rgba(239, 68, 68, 0.5);
    color: #f87171;
    box-shadow: 0 0 10px rgba(239, 68, 68, 0.15);
}

/* AI Typing Indicator */
.ai-typing-indicator {
    display: inline-block;
    color: var(--text-dim);
    font-style: italic;
    animation: typingPulse 1.5s infinite;
}

@keyframes typingPulse {
    0%, 100% { opacity: 0.5; }
    50% { opacity: 1; }
}

/* Hide mascot widget on mobile when any chat panel, drawer, text chat state, or active modal is visible */
@media (max-width: 768px) {
    body:has(#text-chat-state:not(.hidden)) #canvas-container,
    body:has(#chat-panel:not(.hidden)) #canvas-container,
    body:has(#dm-drawer:not(.hidden)) #canvas-container,
    body:has(.modal.active) #canvas-container {
        display: none !important;
    }
}




/* AdSense Containers */
.adsense-container {
    display: none; /* Hidden until we turn ads on */
    background: rgba(255, 255, 255, 0.02);
    border: 1px dashed rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 1rem;
    text-align: center;
    position: relative;
    overflow: hidden;
    margin-top: 1rem;
}

.ad-label {
    position: absolute;
    top: 4px;
    right: 8px;
    font-size: 0.6rem;
    color: var(--text-dim);
    text-transform: uppercase;
    letter-spacing: 1px;
    opacity: 0.6;
}

.ad-placeholder {
    color: var(--text-dim);
    font-size: 0.85rem;
    font-family: "Inter", sans-serif;
    opacity: 0.5;
    padding: 2rem 1rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 4px;
}

/* Connection Status Badges */
.status-badge {
    font-size: 0.62rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    padding: 2px 8px;
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-dim);
    display: inline-flex;
    align-items: center;
    gap: 4px;
    line-height: 1.2;
}
.status-badge.connected {
    background: rgba(52, 211, 153, 0.12);
    border-color: rgba(52, 211, 153, 0.35);
    color: #34d399;
    box-shadow: 0 0 10px rgba(52, 211, 153, 0.1);
}
.status-badge.reconnecting {
    background: rgba(245, 158, 11, 0.12);
    border-color: rgba(245, 158, 11, 0.35);
    color: #fbbf24;
    animation: statusPulse 1.8s infinite;
}
.status-badge.muted-badge {
    background: rgba(239, 68, 68, 0.12);
    border-color: rgba(239, 68, 68, 0.35);
    color: #f87171;
    box-shadow: 0 0 10px rgba(239, 68, 68, 0.1);
}

/* Cyber-Radar Sonar Animation Styles */
.radar-container {
    position: relative;
    width: 220px;
    height: 220px;
    margin: 0 auto 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
}
.radar-svg {
    width: 100%;
    height: 100%;
    filter: drop-shadow(0 0 20px rgba(0, 240, 255, 0.15));
}
.radar-circle {
    fill: none;
    stroke: rgba(0, 240, 255, 0.08);
    stroke-width: 1;
}
.radar-grid {
    stroke: rgba(0, 240, 255, 0.08);
    stroke-width: 0.5;
    stroke-dasharray: 2 4;
}
.radar-center {
    fill: var(--primary);
    filter: drop-shadow(0 0 6px var(--primary));
}
.radar-sweep {
    stroke: var(--primary);
    stroke-width: 1.5;
    transform-origin: 100px 100px;
    animation: radarScan 4s linear infinite;
    opacity: 0.8;
}
.radar-blip {
    fill: #34d399;
    opacity: 0;
    filter: drop-shadow(0 0 4px #34d399);
}
.blip-1 {
    animation: blipFade 4s ease-in-out infinite;
    animation-delay: 1s;
}
.blip-2 {
    animation: blipFade 4s ease-in-out infinite;
    animation-delay: 2.8s;
}

@keyframes radarScan {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

@keyframes blipFade {
    0%, 100% { opacity: 0; }
    5% { opacity: 1; }
    40% { opacity: 0.1; }
}

/* Radar Stopwatch Overlay */
.radar-stopwatch {
    position: absolute;
    font-family: 'Outfit', sans-serif;
    font-size: 1.8rem;
    font-weight: 800;
    color: #fff;
    text-shadow: 0 0 15px rgba(255,255,255,0.4), 0 0 30px var(--primary-glow);
    letter-spacing: 1px;
    font-variant-numeric: tabular-nums;
    z-index: 10;
}

/* Matchmaking Dashboard & Stats */
.matchmaking-dashboard {
    width: 100%;
    max-width: 460px;
    margin: 0 auto;
}
.matchmaking-title {
    font-family: 'Outfit', sans-serif;
    font-size: 1.6rem;
    font-weight: 800;
    color: #fff;
    margin-bottom: 0.4rem;
    text-shadow: 0 0 20px rgba(255, 255, 255, 0.1);
}
.matchmaking-subtitle {
    font-size: 0.9rem;
    color: var(--text-dim);
    margin-bottom: 1.8rem;
}
.matchmaking-stats {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}
.stat-pill {
    background: rgba(255, 255, 255, 0.025);
    border: 1px solid rgba(255, 255, 255, 0.05);
    padding: 6px 14px;
    border-radius: 100px;
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.72rem;
    font-weight: 600;
    backdrop-filter: blur(8px);
}
.pill-label {
    color: var(--text-dim);
}
.pill-val {
    color: var(--primary);
    text-shadow: 0 0 8px rgba(0, 240, 255, 0.2);
}

