/* Dorehami - Modern Cinema & Glassmorphism Styling */

*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Vazirmatn', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

:root {
    --bg-dark: #08090d;
    --surface-dark: #0f1118;
    --surface-elevated: #161922;
    --accent-primary: #6366f1;
    --accent-rose: #f43f5e;
    --accent-emerald: #10b981;
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --border-subtle: rgba(255, 255, 255, 0.08);
}

body {
    background-color: var(--bg-dark);
    color: var(--text-main);
    overflow: hidden;
    height: 100vh;
    width: 100vw;
    -webkit-font-smoothing: antialiased;
}

/* Custom Scrollbars */
::-webkit-scrollbar {
    width: 5px;
    height: 5px;
}
::-webkit-scrollbar-track {
    background: transparent;
}
::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.15);
    border-radius: 9999px;
}
::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* Utility Classes */
.flex { display: flex; }
.flex-col { flex-direction: column; }
.flex-1 { flex: 1 1 0%; }
.flex-wrap { flex-wrap: wrap; }
.items-center { align-items: center; }
.items-start { align-items: flex-start; }
.justify-between { justify-content: space-between; }
.justify-center { justify-content: center; }
.justify-around { justify-content: space-around; }
.justify-end { justify-content: flex-end; }
.gap-1 { gap: 0.25rem; }
.gap-1\.5 { gap: 0.375rem; }
.gap-2 { gap: 0.5rem; }
.gap-3 { gap: 0.75rem; }
.gap-4 { gap: 1rem; }
.relative { position: relative; }
.absolute { position: absolute; }
.fixed { position: fixed; }
.inset-0 { inset: 0; }
.inset-x-0 { left: 0; right: 0; }
.top-0 { top: 0; }
.bottom-0 { bottom: 0; }
.left-0 { left: 0; }
.right-0 { right: 0; }
.top-1 { top: 0.25rem; }
.right-1 { right: 0.25rem; }
.top-4 { top: 1rem; }
.left-4 { left: 1rem; }
.top-16 { top: 4rem; }
.bottom-8 { bottom: 2rem; }
.bottom-20 { bottom: 5rem; }
.right-6 { right: 1.5rem; }
.z-10 { z-index: 10; }
.z-20 { z-index: 20; }
.z-25 { z-index: 25; }
.z-30 { z-index: 30; }
.z-50 { z-index: 50; }
/* SVG Global Defaults & Sizing */
svg {
    display: inline-block;
    vertical-align: middle;
    flex-shrink: 0;
}
.w-2 { width: 0.5rem; }
.h-2 { height: 0.5rem; }
.w-2\.5 { width: 0.625rem; }
.h-2\.5 { height: 0.625rem; }
.w-3 { width: 0.75rem; }
.h-3 { height: 0.75rem; }
.w-3\.5 { width: 0.875rem; }
.h-3\.5 { height: 0.875rem; }
.w-4 { width: 1rem; }
.h-4 { height: 1rem; }
.w-5 { width: 1.25rem; }
.h-5 { height: 1.25rem; }
.w-6 { width: 1.5rem; }
.h-6 { height: 1.5rem; }
.w-7 { width: 1.75rem; }
.h-7 { height: 1.75rem; }
.w-8 { width: 2rem; }
.h-8 { height: 2rem; }
.w-9 { width: 2.25rem; }
.h-9 { height: 2.25rem; }
.w-10 { width: 2.5rem; }
.h-10 { height: 2.5rem; }
.w-12 { width: 3rem; }
.h-12 { height: 3rem; }
.w-14 { width: 3.5rem; }
.h-14 { height: 3.5rem; }
.w-16 { width: 4rem; }
.h-16 { height: 4rem; }
.w-20 { width: 5rem; }
.h-20 { height: 5rem; }
.w-24 { width: 6rem; }
.h-24 { height: 6rem; }
.w-32 { width: 8rem; }
.w-80 { width: 20rem; }
.w-full { width: 100%; }
.h-full { height: 100%; }
.w-screen { width: 100vw; }
.h-screen { height: 100vh; }
.max-w-md { max-width: 28rem; }
.max-w-lg { max-width: 32rem; }
.max-w-xs { max-width: 20rem; }
.overflow-hidden { overflow: hidden; }
.overflow-y-auto { overflow-y: auto; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Colors & Backgrounds */
.bg-dark { background-color: var(--bg-dark); }
.bg-black { background-color: #000000; }
.bg-slate-950 { background-color: #020617; }
.bg-slate-900 { background-color: #0f172a; }
.bg-slate-800 { background-color: #1e293b; }
.bg-slate-700 { background-color: #334155; }
.bg-indigo-600 { background-color: #4f46e5; }
.bg-indigo-500 { background-color: #6366f1; }
.bg-rose-600 { background-color: #e11d48; }
.bg-rose-500 { background-color: #f43f5e; }
.bg-emerald-500 { background-color: #10b981; }
.bg-white\/10 { background-color: rgba(255, 255, 255, 0.1); }
.bg-white\/20 { background-color: rgba(255, 255, 255, 0.2); }
.bg-white\/30 { background-color: rgba(255, 255, 255, 0.3); }

/* Borders & Rounded */
.border { border-width: 1px; }
.border-b { border-bottom-width: 1px; }
.border-t { border-top-width: 1px; }
.border-r { border-right-width: 1px; }
.border-l { border-left-width: 1px; }
.border-white\/5 { border-color: rgba(255, 255, 255, 0.05); }
.border-white\/10 { border-color: rgba(255, 255, 255, 0.1); }
.border-white\/15 { border-color: rgba(255, 255, 255, 0.15); }
.border-white\/20 { border-color: rgba(255, 255, 255, 0.2); }
.border-indigo-500\/20 { border-color: rgba(99, 102, 241, 0.2); }
.rounded-md { border-radius: 0.375rem; }
.rounded-lg { border-radius: 0.5rem; }
.rounded-xl { border-radius: 0.75rem; }
.rounded-2xl { border-radius: 1rem; }
.rounded-3xl { border-radius: 1.5rem; }
.rounded-full { border-radius: 9999px; }

/* Text */
.text-white { color: #ffffff; }
.text-slate-100 { color: #f1f5f9; }
.text-slate-200 { color: #e2e8f0; }
.text-slate-300 { color: #cbd5e1; }
.text-slate-400 { color: #94a3b8; }
.text-slate-500 { color: #64748b; }
.text-slate-600 { color: #475569; }
.text-indigo-300 { color: #a5b4fc; }
.text-indigo-400 { color: #818cf8; }
.text-amber-300 { color: #fcd34d; }
.text-xs { font-size: 0.75rem; line-height: 1rem; }
.text-sm { font-size: 0.875rem; line-height: 1.25rem; }
.text-lg { font-size: 1.125rem; line-height: 1.75rem; }
.text-xl { font-size: 1.25rem; line-height: 1.75rem; }
.text-3xl { font-size: 1.875rem; line-height: 2.25rem; }
.text-4xl { font-size: 2.25rem; line-height: 2.5rem; }
.font-bold { font-weight: 700; }
.font-semibold { font-weight: 600; }
.font-medium { font-weight: 500; }
.font-extrabold { font-weight: 800; }
.font-mono { font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace; }

/* Effects & Blurs */
.backdrop-blur-md { backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); }
.backdrop-blur-xl { backdrop-filter: blur(24px); -webkit-backdrop-filter: blur(24px); }
.backdrop-blur-2xl { backdrop-filter: blur(40px); -webkit-backdrop-filter: blur(40px); }
.shadow-md { box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1); }
.shadow-lg { box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1); }
.shadow-xl { box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.2); }
.shadow-2xl { box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.4); }
.shadow-rose-500\/20 { box-shadow: 0 10px 15px -3px rgba(244, 63, 94, 0.2); }
.shadow-indigo-600\/30 { box-shadow: 0 10px 20px -3px rgba(79, 70, 229, 0.3); }

/* Padding & Margin */
.p-1 { padding: 0.25rem; }
.p-1\.5 { padding: 0.375rem; }
.p-2 { padding: 0.5rem; }
.p-2\.5 { padding: 0.625rem; }
.p-3 { padding: 0.75rem; }
.p-4 { padding: 1rem; }
.p-5 { padding: 1.25rem; }
.p-6 { padding: 1.5rem; }
.px-2 { padding-left: 0.5rem; padding-right: 0.5rem; }
.px-2\.5 { padding-left: 0.625rem; padding-right: 0.625rem; }
.px-3 { padding-left: 0.75rem; padding-right: 0.75rem; }
.px-3\.5 { padding-left: 0.875rem; padding-right: 0.875rem; }
.px-4 { padding-left: 1rem; padding-right: 1rem; }
.px-5 { padding-left: 1.25rem; padding-right: 1.25rem; }
.px-6 { padding-left: 1.5rem; padding-right: 1.5rem; }
.py-0\.5 { padding-top: 0.125rem; padding-bottom: 0.125rem; }
.py-1 { padding-top: 0.25rem; padding-bottom: 0.25rem; }
.py-1\.5 { padding-top: 0.375rem; padding-bottom: 0.375rem; }
.py-2 { padding-top: 0.5rem; padding-bottom: 0.5rem; }
.py-2\.5 { padding-top: 0.625rem; padding-bottom: 0.625rem; }
.py-3 { padding-top: 0.75rem; padding-bottom: 0.75rem; }
.pt-2 { padding-top: 0.5rem; }
.pt-3 { padding-top: 0.75rem; }
.pt-12 { padding-top: 3rem; }
.pb-3 { padding-bottom: 0.75rem; }
.mx-1 { margin-left: 0.25rem; margin-right: 0.25rem; }
.mx-auto { margin-left: auto; margin-right: auto; }
.mb-1 { margin-bottom: 0.25rem; }
.mb-1\.5 { margin-bottom: 0.375rem; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-3 { margin-bottom: 0.75rem; }
.mb-4 { margin-bottom: 1rem; }
.mb-6 { margin-bottom: 1.5rem; }
.mt-auto { margin-top: auto; }
.space-y-2 > :not([hidden]) ~ :not([hidden]) { margin-top: 0.5rem; }
.space-y-3 > :not([hidden]) ~ :not([hidden]) { margin-top: 0.75rem; }
.space-y-4 > :not([hidden]) ~ :not([hidden]) { margin-top: 1rem; }

/* Transitions */
.transition-all { transition-property: all; transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1); transition-duration: 200ms; }
.transition-opacity { transition-property: opacity; transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1); transition-duration: 200ms; }
.transition-transform { transition-property: transform; transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1); transition-duration: 200ms; }
.duration-300 { transition-duration: 300ms; }
.cursor-pointer { cursor: pointer; }
.pointer-events-none { pointer-events: none; }
.hidden { display: none !important; }

/* Button Styles */
button {
    border: none;
    background: none;
    cursor: pointer;
    font-family: inherit;
}
button:active {
    transform: scale(0.97);
}

/* Header & Action Buttons (Devigner Liquid Glass & VisionOS Style) */
.btn-invite {
    background: rgba(16, 185, 129, 0.12) !important;
    border: 1px solid rgba(16, 185, 129, 0.35) !important;
    color: #6ee7b7 !important;
    font-size: 0.75rem !important;
    font-weight: 600 !important;
    cursor: pointer;
    backdrop-filter: blur(16px) saturate(180%);
    -webkit-backdrop-filter: blur(16px) saturate(180%);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.15), 0 2px 8px rgba(0, 0, 0, 0.25);
    transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
    border-radius: 9999px !important;
}
.btn-invite:hover {
    background: rgba(16, 185, 129, 0.24) !important;
    border-color: rgba(16, 185, 129, 0.6) !important;
    color: #ffffff !important;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.3), 0 0 16px rgba(16, 185, 129, 0.45);
    transform: translateY(-1px) scale(1.02);
}
.btn-invite:active {
    transform: scale(0.96);
}

.btn-video {
    background: rgba(225, 29, 72, 0.88) !important;
    border: 1px solid rgba(255, 255, 255, 0.22) !important;
    color: #ffffff !important;
    font-size: 0.75rem !important;
    font-weight: 700 !important;
    cursor: pointer;
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.35), 0 4px 16px rgba(225, 29, 72, 0.35);
    transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
    border-radius: 9999px !important;
}
.btn-video:hover {
    background: rgba(244, 63, 94, 0.95) !important;
    box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.5), 0 6px 22px rgba(225, 29, 72, 0.55);
    transform: translateY(-1px) scale(1.02);
}
.btn-video:active {
    transform: scale(0.96);
}

.btn-header-icon, #btn-toggle-sidebar {
    width: 2.35rem !important;
    height: 2.35rem !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    background: rgba(255, 255, 255, 0.08) !important;
    border: 1px solid rgba(255, 255, 255, 0.16) !important;
    color: #cbd5e1 !important;
    cursor: pointer;
    backdrop-filter: blur(16px) saturate(180%);
    -webkit-backdrop-filter: blur(16px) saturate(180%);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.15), 0 2px 6px rgba(0, 0, 0, 0.25);
    transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
    border-radius: 0.75rem !important;
    flex-shrink: 0 !important;
    padding: 0 !important;
    position: relative !important;
}
.btn-header-icon:hover, #btn-toggle-sidebar:hover {
    background: rgba(255, 255, 255, 0.16) !important;
    border-color: rgba(255, 255, 255, 0.3) !important;
    color: #ffffff !important;
    transform: translateY(-1px);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.25), 0 4px 12px rgba(0, 0, 0, 0.35);
}
.btn-header-icon:active, #btn-toggle-sidebar:active {
    transform: scale(0.93);
}
.btn-header-icon svg, #btn-toggle-sidebar svg {
    width: 1.25rem !important;
    height: 1.25rem !important;
    display: block !important;
    flex-shrink: 0 !important;
}

#host-badge {
    background: rgba(245, 158, 11, 0.12) !important;
    border: 1px solid rgba(245, 158, 11, 0.35) !important;
    color: #fcd34d !important;
    font-size: 0.72rem !important;
    font-weight: 700 !important;
    padding: 0.22rem 0.65rem !important;
    border-radius: 9999px;
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.15);
}

#guest-badge {
    background: rgba(255, 255, 255, 0.05) !important;
    border: 1px solid rgba(255, 255, 255, 0.12) !important;
    color: #cbd5e1 !important;
    font-size: 0.72rem !important;
    font-weight: 600 !important;
    padding: 0.22rem 0.65rem !important;
    border-radius: 9999px;
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

/* Floating Exit Fullscreen Button (Apple Minimal Circular Glass) */
.floating-exit-fs {
    position: absolute;
    top: 0.85rem;
    right: 0.85rem;
    z-index: 50;
    width: 2.25rem;
    height: 2.25rem;
    border-radius: 9999px;
    background: rgba(12, 15, 24, 0.75);
    border: 1px solid rgba(255, 255, 255, 0.18);
    color: #f1f5f9;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    backdrop-filter: blur(16px) saturate(180%);
    -webkit-backdrop-filter: blur(16px) saturate(180%);
    box-shadow: inset 0 1px 0.5px rgba(255, 255, 255, 0.25), 0 4px 16px rgba(0, 0, 0, 0.5);
    transition: opacity 0.3s cubic-bezier(0.16, 1, 0.3, 1), transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), background-color 0.2s ease;
}
.floating-exit-fs:hover {
    background: rgba(225, 29, 72, 0.85);
    border-color: rgba(255, 255, 255, 0.4);
    transform: scale(1.08);
}
.floating-exit-fs:active {
    transform: scale(0.94);
}
#cinema-stage.hud-hidden #btn-exit-fs,
#player-hud.autohide ~ #btn-exit-fs {
    opacity: 0;
    pointer-events: none;
    transform: translateY(-6px);
}

/* Quick Reactions Bar - Anchored inside Player HUD (Bottom Right) */
#quick-reactions {
    position: absolute !important;
    bottom: 4.25rem !important;
    right: 1.25rem !important;
    left: auto !important;
    top: auto !important;
    z-index: 35 !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    gap: 0.35rem !important;
    pointer-events: auto !important;
    user-select: none;
    -webkit-user-select: none;
    transition: opacity 0.25s ease, transform 0.25s ease;
}

.reactions-tray {
    background: rgba(23, 33, 43, 0.94) !important;
    backdrop-filter: blur(20px) !important;
    -webkit-backdrop-filter: blur(20px) !important;
    border: 1px solid rgba(255, 255, 255, 0.12) !important;
    padding: 0.4rem 0.3rem !important;
    border-radius: 1.5rem !important;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6) !important;
    display: flex !important;
    flex-direction: column !important;
    gap: 0.35rem !important;
    transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1) !important;
}

.reaction-btn {
    font-size: 1.35rem;
    width: 2.35rem;
    height: 2.35rem;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    border-radius: 9999px;
    cursor: pointer;
    line-height: 1;
    transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1), background-color 0.15s ease !important;
    user-select: none;
    -webkit-user-select: none;
}

.reaction-btn:hover {
    transform: scale(1.35) translateY(-2px) !important;
    background: rgba(255, 255, 255, 0.15) !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.35);
}

.reaction-btn:active {
    transform: scale(0.9) !important;
}

.btn-toggle-reactions {
    width: 1.75rem !important;
    height: 1.75rem !important;
    border-radius: 9999px !important;
    background: rgba(23, 33, 43, 0.94) !important;
    border: 1px solid rgba(255, 255, 255, 0.15) !important;
    color: #cbd5e1 !important;
    cursor: pointer;
    backdrop-filter: blur(16px) !important;
    -webkit-backdrop-filter: blur(16px) !important;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1) !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4) !important;
}

.btn-toggle-reactions:hover {
    background: rgba(42, 171, 238, 0.25) !important;
    color: #ffffff !important;
    border-color: rgba(42, 171, 238, 0.5) !important;
    transform: scale(1.1) !important;
}

#quick-reactions.collapsed .reactions-tray {
    max-height: 0;
    opacity: 0;
    pointer-events: none;
    padding: 0;
    margin: 0;
    border: none;
    transform: scale(0.8) translateY(12px);
    overflow: hidden;
}

#quick-reactions.collapsed #icon-reactions-chevron {
    transform: rotate(180deg);
}

/* Bottom HUD Fullscreen Button */
.hud-fs-btn {
    color: #ffffff !important;
    background: rgba(255, 255, 255, 0.12) !important;
    border: 1px solid rgba(255, 255, 255, 0.2) !important;
    padding: 0.45rem 0.6rem !important;
    border-radius: 0.5rem !important;
    cursor: pointer;
    transition: all 0.2s ease !important;
}
.hud-fs-btn:hover {
    background: rgba(99, 102, 241, 0.35) !important;
    border-color: rgba(99, 102, 241, 0.6) !important;
    box-shadow: 0 0 12px rgba(99, 102, 241, 0.5) !important;
    transform: scale(1.08);
}


/* Speaking ring animation */
.speaking-ring {
    box-shadow: 0 0 0 2px #10b981, 0 0 12px #10b981;
    animation: pulse-ring 1.2s infinite;
}

@keyframes pulse-ring {
    0% {
        box-shadow: 0 0 0 2px #10b981, 0 0 8px rgba(16, 185, 129, 0.6);
    }
    50% {
        box-shadow: 0 0 0 4px #10b981, 0 0 16px rgba(16, 185, 129, 0.9);
    }
    100% {
        box-shadow: 0 0 0 2px #10b981, 0 0 8px rgba(16, 185, 129, 0.6);
    }
}

/* Floating Emoji Reactions */
.floating-reaction {
    position: absolute;
    bottom: 5rem;
    right: 2rem;
    font-size: 2.2rem;
    pointer-events: none;
    user-select: none;
    animation: floatUp 3.2s cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
    filter: drop-shadow(0 4px 8px rgba(0,0,0,0.5));
}

@keyframes floatUp {
    0% {
        opacity: 0;
        transform: translateY(0) scale(0.5) rotate(0deg);
    }
    15% {
        opacity: 1;
        transform: translateY(-40px) scale(1.2) rotate(8deg);
    }
    70% {
        opacity: 0.9;
        transform: translateY(-240px) scale(1) rotate(-8deg);
    }
    100% {
        opacity: 0;
        transform: translateY(-380px) scale(0.7) rotate(12deg);
    }
}

/* Cinema Mode (Collapses Top Bar & Sidebar) */
body.cinema-mode #top-bar {
    transform: translateY(-100%);
    opacity: 0;
    pointer-events: none;
}

body.cinema-mode #room-sidebar {
    width: 0 !important;
    opacity: 0;
    pointer-events: none;
}

/* Player HUD & Cinema Scrubber Bar (Crystal Clear Video, Zero Blur Box, Clean Vignette) */
#player-hud {
    direction: ltr !important;
    opacity: 1;
    transition: opacity 0.35s cubic-bezier(0.16, 1, 0.3, 1);
    user-select: none;
    -webkit-user-select: none;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.88) 0%, rgba(0, 0, 0, 0.5) 45%, rgba(0, 0, 0, 0.15) 75%, transparent 100%) !important;
    border: none !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    padding: 2.5rem 1.25rem 0.85rem 1.25rem !important;
}

#player-hud.autohide {
    opacity: 0;
    pointer-events: none;
}

#player-hud .flex-shrink-0 {
    flex-shrink: 0 !important;
}

#hud-video-title {
    max-width: 32vw;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Play/Pause Button - Tactile Apple Circular Glass */
#btn-play-pause {
    width: 2.35rem !important;
    height: 2.35rem !important;
    border-radius: 9999px !important;
    background: rgba(255, 255, 255, 0.14) !important;
    border: 1px solid rgba(255, 255, 255, 0.25) !important;
    color: #ffffff !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.3), 0 4px 14px rgba(0, 0, 0, 0.45) !important;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1) !important;
    cursor: pointer !important;
    padding: 0 !important;
    flex-shrink: 0 !important;
}
#btn-play-pause:hover {
    background: rgba(255, 255, 255, 0.24) !important;
    border-color: rgba(255, 255, 255, 0.4) !important;
    box-shadow: inset 0 1px 1.5px rgba(255, 255, 255, 0.45), 0 6px 18px rgba(0, 0, 0, 0.55) !important;
    transform: scale(1.08) !important;
}
#btn-play-pause:active {
    transform: scale(0.93) !important;
}
#btn-play-pause svg {
    width: 1.25rem !important;
    height: 1.25rem !important;
    display: block !important;
    flex-shrink: 0 !important;
}

/* 10s Rewind / Forward Tactile Glass Icons */
#btn-rewind-10, #btn-forward-10 {
    width: 2.25rem !important;
    height: 2.25rem !important;
    border-radius: 0.65rem !important;
    background: rgba(255, 255, 255, 0.08) !important;
    border: 1px solid rgba(255, 255, 255, 0.14) !important;
    color: #cbd5e1 !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12) !important;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1) !important;
    cursor: pointer !important;
    padding: 0 !important;
    flex-shrink: 0 !important;
}
#btn-rewind-10:hover, #btn-forward-10:hover {
    background: rgba(255, 255, 255, 0.16) !important;
    border-color: rgba(255, 255, 255, 0.25) !important;
    color: #ffffff !important;
    transform: translateY(-1px) scale(1.05) !important;
}
#btn-rewind-10:active, #btn-forward-10:active {
    transform: scale(0.92) !important;
}
#btn-rewind-10 svg, #btn-forward-10 svg {
    width: 1.15rem !important;
    height: 1.15rem !important;
    display: block !important;
    flex-shrink: 0 !important;
}

#btn-mute {
    width: 2rem !important;
    height: 2rem !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    color: #cbd5e1 !important;
    transition: all 0.2s ease;
    cursor: pointer;
    flex-shrink: 0 !important;
    padding: 0 !important;
}
#btn-mute:hover {
    color: #ffffff !important;
    transform: scale(1.08) !important;
}
#btn-mute svg {
    width: 1.25rem !important;
    height: 1.25rem !important;
    display: block !important;
    flex-shrink: 0 !important;
}

/* Quality Button */
#btn-quality-toggle {
    height: 2.25rem !important;
    padding: 0 0.75rem !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    background: rgba(255, 255, 255, 0.08) !important;
    border: 1px solid rgba(255, 255, 255, 0.14) !important;
    color: #e2e8f0 !important;
    cursor: pointer;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12) !important;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1) !important;
    border-radius: 0.65rem !important;
    font-size: 0.75rem !important;
    font-weight: 600 !important;
    flex-shrink: 0 !important;
}
#btn-quality-toggle:hover {
    background: rgba(255, 255, 255, 0.16) !important;
    border-color: rgba(255, 255, 255, 0.25) !important;
    color: #ffffff !important;
    transform: translateY(-1px) !important;
}

#quality-dropdown {
    background: rgba(13, 16, 26, 0.94) !important;
    border: 1px solid rgba(255, 255, 255, 0.16) !important;
    backdrop-filter: blur(28px) saturate(190%) !important;
    -webkit-backdrop-filter: blur(28px) saturate(190%) !important;
    box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.2), 0 20px 45px rgba(0, 0, 0, 0.75) !important;
    border-radius: 1rem !important;
    padding: 0.35rem !important;
}

/* Cinema Mode Button */
#btn-cinema-mode {
    width: 2.25rem !important;
    height: 2.25rem !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    color: #cbd5e1 !important;
    background: rgba(255, 255, 255, 0.08) !important;
    border: 1px solid rgba(255, 255, 255, 0.14) !important;
    cursor: pointer;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12) !important;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1) !important;
    border-radius: 0.65rem !important;
    padding: 0 !important;
    flex-shrink: 0 !important;
}
#btn-cinema-mode:hover {
    color: #ffffff !important;
    background: rgba(255, 255, 255, 0.16) !important;
    border-color: rgba(255, 255, 255, 0.25) !important;
    transform: translateY(-1px) !important;
}
#btn-cinema-mode svg {
    width: 1.25rem !important;
    height: 1.25rem !important;
    display: block !important;
    flex-shrink: 0 !important;
}

/* Fullscreen Button */
.hud-fs-btn, #btn-fullscreen {
    width: 2.25rem !important;
    height: 2.25rem !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    color: #ffffff !important;
    background: rgba(255, 255, 255, 0.1) !important;
    border: 1px solid rgba(255, 255, 255, 0.18) !important;
    padding: 0 !important;
    border-radius: 0.65rem !important;
    cursor: pointer;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2) !important;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1) !important;
    flex-shrink: 0 !important;
}
.hud-fs-btn:hover, #btn-fullscreen:hover {
    background: rgba(99, 102, 241, 0.35) !important;
    border-color: rgba(99, 102, 241, 0.6) !important;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.3), 0 0 14px rgba(99, 102, 241, 0.5) !important;
    transform: translateY(-1px) scale(1.05) !important;
}
.hud-fs-btn svg, #btn-fullscreen svg {
    width: 1.25rem !important;
    height: 1.25rem !important;
    display: block !important;
    flex-shrink: 0 !important;
}

/* Timeline Container & Stardust Scrubber */
.timeline-container {
    position: relative;
    width: 100%;
    padding: 8px 0;
    cursor: pointer;
    display: flex;
    align-items: center;
    touch-action: none;
}

.timeline-track {
    position: relative;
    width: 100%;
    height: 5px;
    background: rgba(255, 255, 255, 0.18);
    border-radius: 9999px;
    overflow: hidden;
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.6);
    transition: height 0.18s cubic-bezier(0.16, 1, 0.3, 1);
}

.timeline-container:hover .timeline-track,
.timeline-container.dragging .timeline-track {
    height: 9px;
}

.buffer-bar {
    position: absolute;
    top: 0;
    bottom: 0;
    left: 0;
    width: 0%;
    background: rgba(255, 255, 255, 0.32);
    border-radius: 9999px;
    transition: width 0.25s linear;
}

.progress-bar {
    position: absolute;
    top: 0;
    bottom: 0;
    left: 0;
    width: 0%;
    background: #ff0000;
    border-radius: 9999px;
    box-shadow: 0 0 8px rgba(255, 0, 0, 0.6);
}

.scrubber-thumb {
    position: absolute;
    top: 50%;
    left: 0%;
    width: 13px;
    height: 13px;
    background: #ff0000;
    border: 2px solid #ffffff;
    border-radius: 9999px;
    transform: translate(-50%, -50%);
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.8), 0 0 8px rgba(255, 0, 0, 0.7);
    pointer-events: none;
    transition: transform 0.15s cubic-bezier(0.16, 1, 0.3, 1), width 0.15s ease, height 0.15s ease;
    z-index: 15;
}

.timeline-container:hover .scrubber-thumb,
.timeline-container.dragging .scrubber-thumb {
    width: 16px;
    height: 16px;
    transform: translate(-50%, -50%) scale(1.15);
    box-shadow: 0 0 12px rgba(255, 0, 0, 0.9), 0 0 4px #ffffff, 0 3px 8px rgba(0, 0, 0, 0.7);
}

/* Tooltip - VisionOS Floating Frosted Glass Capsule */
.timeline-tooltip {
    position: absolute;
    bottom: 28px;
    left: 0%;
    transform: translateX(-50%);
    background: rgba(13, 16, 26, 0.88);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #f8fafc;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    font-size: 0.72rem;
    font-weight: 700;
    padding: 0.25rem 0.65rem;
    border-radius: 9999px;
    pointer-events: none;
    white-space: nowrap;
    opacity: 0;
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.25), 0 8px 24px rgba(0, 0, 0, 0.6);
    transition: opacity 0.15s ease, transform 0.15s ease;
    z-index: 30;
}

.timeline-container:hover .timeline-tooltip,
.timeline-container.dragging .timeline-tooltip {
    opacity: 1;
}

/* Top Bar & Sidebar Devigner Glassmorphism */
#top-bar {
    background: rgba(10, 12, 19, 0.82) !important;
    backdrop-filter: blur(24px) saturate(190%) !important;
    -webkit-backdrop-filter: blur(24px) saturate(190%) !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08) !important;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4) !important;
}

#room-sidebar {
    background: rgba(10, 12, 19, 0.92) !important;
    backdrop-filter: blur(28px) saturate(190%) !important;
    -webkit-backdrop-filter: blur(28px) saturate(190%) !important;
    border-right: 1px solid rgba(255, 255, 255, 0.08) !important;
}

.sidebar-tab.active {
    background: rgba(99, 102, 241, 0.15) !important;
    border: 1px solid rgba(99, 102, 241, 0.3) !important;
    color: #a5b4fc !important;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.15) !important;
}

/* Dynamic Voice Bar in Chat Tab (Telegram Desktop Voice Bar) */
.voice-active-bar {
    max-height: 0;
    opacity: 0;
    overflow: hidden;
    padding: 0 0.75rem;
    background: #17212b;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    transition: max-height 0.35s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.25s ease, padding 0.3s ease;
    pointer-events: none;
}

.voice-active-bar.visible {
    max-height: 90px;
    opacity: 1;
    padding: 0.65rem 0.75rem;
    pointer-events: auto;
}

.voice-speaker-chip {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.2rem;
    flex-shrink: 0;
}

.voice-speaker-avatar {
    width: 2.25rem;
    height: 2.25rem;
    border-radius: 9999px;
    background: #2b5278;
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 600;
    position: relative;
    border: 2px solid transparent;
    transition: all 0.2s ease;
}

.voice-speaker-avatar.speaking-ring {
    border-color: #26bf72 !important;
    box-shadow: 0 0 0 2px #26bf72, 0 0 10px rgba(38, 191, 114, 0.5) !important;
    animation: pulse-speaker 1.5s infinite;
}

@keyframes pulse-speaker {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.06);
    }
}

.voice-speaker-name {
    font-size: 0.625rem;
    color: #8293a4;
    max-width: 3.5rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    text-align: center;
}

/* Chat Bubbles (Authentic Telegram Desktop Dark Mode) */
.chat-bubble-wrap {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
    margin-bottom: 0.35rem !important;
}
.chat-bubble-wrap.items-end {
    align-items: flex-end !important;
}
.chat-bubble-wrap.items-start {
    align-items: flex-start !important;
}

.chat-bubble-container {
    position: relative !important;
    max-width: 85% !important;
    display: inline-flex !important;
    flex-direction: column !important;
}

.chat-bubble {
    display: inline-block !important;
    width: fit-content !important;
    max-width: 100% !important;
    min-width: 2.8rem !important;
    padding: 0.45rem 0.75rem !important;
    border-radius: 12px !important;
    font-size: 0.8125rem !important;
    line-height: 1.5 !important;
    white-space: pre-wrap !important;
    word-break: normal !important;
    overflow-wrap: anywhere !important;
    word-wrap: break-word !important;
    box-sizing: border-box !important;
    user-select: text;
    -webkit-user-select: text;
}
.chat-bubble.mine {
    background: #2b5278 !important;
    color: #ffffff !important;
    border-bottom-left-radius: 3px !important;
    border-top-left-radius: 12px !important;
    border: none !important;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.25) !important;
}
.chat-bubble.other {
    background: #182533 !important;
    color: #f5f5f5 !important;
    border-bottom-right-radius: 3px !important;
    border-top-right-radius: 12px !important;
    border: none !important;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.25) !important;
}
.chat-bubble.host {
    border-right: 3px solid #f59e0b !important;
    border-left: none !important;
}

.chat-bubble .msg-time {
    color: #708499;
    font-size: 0.65rem;
    margin-right: 0.4rem;
}
.chat-bubble.mine .msg-time {
    color: #8da4be;
}
.chat-bubble.mine .read-status {
    color: #4fa3df !important;
}

#chat-form button[type="submit"] {
    width: 2.25rem !important;
    height: 2.25rem !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    flex-shrink: 0 !important;
    background: #2aabee !important;
    border: none !important;
    box-shadow: 0 2px 8px rgba(42, 171, 238, 0.35) !important;
    border-radius: 9999px !important;
    cursor: pointer;
    padding: 0 !important;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1) !important;
}
#chat-form button[type="submit"] svg {
    width: 1.1rem !important;
    height: 1.1rem !important;
    display: block !important;
    flex-shrink: 0 !important;
}
#chat-form button[type="submit"]:hover {
    background: #239cdb !important;
    transform: scale(1.05) !important;
    box-shadow: 0 4px 12px rgba(42, 171, 238, 0.5) !important;
}
#chat-form button[type="submit"]:active {
    transform: scale(0.95) !important;
}

/* Devigner Glassmorphic Modals & Dialogue Boxes */
#modal-video-picker > div,
#modal-welcome > div {
    background: rgba(13, 16, 26, 0.88) !important;
    border: 1px solid rgba(255, 255, 255, 0.14) !important;
    backdrop-filter: blur(32px) saturate(200%) !important;
    -webkit-backdrop-filter: blur(32px) saturate(200%) !important;
    box-shadow: inset 0 1px 1.5px 0 rgba(255, 255, 255, 0.25), 0 28px 65px -12px rgba(0, 0, 0, 0.85) !important;
    border-radius: 1.5rem !important;
}

/* Frosted Recessed Inputs */
#input-video-url,
#input-username,
#input-room-name,
#chat-input {
    background: rgba(8, 10, 18, 0.72) !important;
    border: 1px solid rgba(255, 255, 255, 0.12) !important;
    color: #ffffff !important;
    box-shadow: inset 0 1.5px 3px rgba(0, 0, 0, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.06) !important;
    border-radius: 0.85rem !important;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1) !important;
}
#input-video-url:focus,
#input-username:focus,
#input-room-name:focus,
#chat-input:focus {
    outline: none !important;
    border-color: rgba(99, 102, 241, 0.6) !important;
    box-shadow: inset 0 1.5px 3px rgba(0, 0, 0, 0.3), 0 0 0 3px rgba(99, 102, 241, 0.25), 0 0 16px rgba(99, 102, 241, 0.2) !important;
}

/* Sample Chips & Subtle Pills */
.sample-chip {
    background: rgba(255, 255, 255, 0.05) !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    color: #cbd5e1 !important;
    border-radius: 0.65rem !important;
    backdrop-filter: blur(12px) !important;
    -webkit-backdrop-filter: blur(12px) !important;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08) !important;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1) !important;
}
.sample-chip:hover {
    background: rgba(255, 255, 255, 0.12) !important;
    border-color: rgba(255, 255, 255, 0.25) !important;
    color: #ffffff !important;
    transform: translateY(-1px) !important;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.15), 0 4px 12px rgba(0, 0, 0, 0.3) !important;
}
.sample-chip:active {
    transform: scale(0.96) !important;
}

/* Video Preview Card */
#video-preview-card {
    background: rgba(8, 10, 18, 0.75) !important;
    border: 1px solid rgba(255, 255, 255, 0.12) !important;
    backdrop-filter: blur(16px) !important;
    -webkit-backdrop-filter: blur(16px) !important;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08), 0 10px 25px rgba(0, 0, 0, 0.4) !important;
    border-radius: 1rem !important;
}

/* Primary Glass Buttons */
#btn-confirm-video,
#btn-submit-welcome,
#btn-empty-load {
    background: linear-gradient(135deg, #e11d48, #be123c) !important;
    border: 1px solid rgba(255, 255, 255, 0.25) !important;
    color: #ffffff !important;
    font-weight: 700 !important;
    border-radius: 0.85rem !important;
    box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.35), 0 8px 24px -4px rgba(225, 29, 72, 0.45) !important;
    transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1) !important;
    cursor: pointer;
}
#btn-confirm-video:hover,
#btn-submit-welcome:hover,
#btn-empty-load:hover {
    background: linear-gradient(135deg, #f43f5e, #e11d48) !important;
    box-shadow: inset 0 1px 1.5px rgba(255, 255, 255, 0.5), 0 12px 28px -4px rgba(225, 29, 72, 0.6) !important;
    transform: translateY(-1px) scale(1.02) !important;
}
#btn-confirm-video:active,
#btn-submit-welcome:active,
#btn-empty-load:active {
    transform: scale(0.96) !important;
}

#btn-extract-video {
    background: rgba(99, 102, 241, 0.88) !important;
    border: 1px solid rgba(255, 255, 255, 0.25) !important;
    color: #ffffff !important;
    border-radius: 0.85rem !important;
    box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.35), 0 4px 14px rgba(99, 102, 241, 0.35) !important;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1) !important;
    cursor: pointer;
}
#btn-extract-video:hover {
    background: rgba(99, 102, 241, 0.98) !important;
    box-shadow: inset 0 1px 1.5px rgba(255, 255, 255, 0.45), 0 6px 18px rgba(99, 102, 241, 0.5) !important;
    transform: translateY(-1px) !important;
}
#btn-extract-video:active {
    transform: scale(0.96) !important;
}

/* Modals Animation */
@keyframes scaleUp {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}
.animate-scale-up {
    animation: scaleUp 0.2s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

/* Center Play/Pause Ripple Feedback */
#center-ripple {
    position: absolute;
    width: 5.5rem;
    height: 5.5rem;
    border-radius: 9999px;
    background: rgba(255, 255, 255, 0.18);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    color: #ffffff;
    pointer-events: none;
    z-index: 25;
    opacity: 0 !important;
    transform: scale(0.65);
    transition: opacity 0.3s cubic-bezier(0.16, 1, 0.3, 1), transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

#center-ripple.active {
    opacity: 1 !important;
    transform: scale(1.05);
}

/* Native HTML5 Video Overlays Suppression */
video::-webkit-media-controls,
video::-webkit-media-controls-enclosure,
video::-webkit-media-controls-overlay-play-button,
video::-webkit-media-controls-start-playback-button {
    display: none !important;
    -webkit-appearance: none !important;
    opacity: 0 !important;
    pointer-events: none !important;
}

/* Opacity & Scale Helpers */
.opacity-0 { opacity: 0 !important; }
.opacity-100 { opacity: 1 !important; }
.scale-75 { transform: scale(0.75); }
.scale-100 { transform: scale(1); }

/* Quality Item Selected */
.quality-item.active {
    background-color: rgba(99, 102, 241, 0.3);
    color: #a5b4fc;
    font-weight: 700;
}

/* Fullscreen Handling - Standard :fullscreen */
#cinema-stage:fullscreen {
    position: fixed !important;
    inset: 0 !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    height: 100dvh !important;
    min-height: 100vh !important;
    min-height: 100dvh !important;
    max-height: none !important;
    max-width: none !important;
    z-index: 999999 !important;
    background: #000000 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    margin: 0 !important;
    padding: 0 !important;
}

#cinema-stage:fullscreen #main-player {
    width: 100% !important;
    height: 100% !important;
    max-width: 100vw !important;
    max-height: 100vh !important;
    max-height: 100dvh !important;
    object-fit: contain !important;
}

#cinema-stage:fullscreen #player-hud {
    position: absolute !important;
    bottom: 0 !important;
    left: 0 !important;
    right: 0 !important;
    z-index: 100 !important;
}

/* Fullscreen Handling - Webkit Prefix */
#cinema-stage:-webkit-full-screen {
    position: fixed !important;
    inset: 0 !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    height: 100dvh !important;
    min-height: 100vh !important;
    min-height: 100dvh !important;
    max-height: none !important;
    max-width: none !important;
    z-index: 999999 !important;
    background: #000000 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    margin: 0 !important;
    padding: 0 !important;
}

#cinema-stage:-webkit-full-screen #main-player {
    width: 100% !important;
    height: 100% !important;
    max-width: 100vw !important;
    max-height: 100vh !important;
    max-height: 100dvh !important;
    object-fit: contain !important;
}

#cinema-stage:-webkit-full-screen #player-hud {
    position: absolute !important;
    bottom: 0 !important;
    left: 0 !important;
    right: 0 !important;
    z-index: 100 !important;
}

/* Pseudo-Fullscreen (Mobile fallback, iOS Safari, etc.) */
#cinema-stage.mobile-fullscreen,
body.is-fullscreen #cinema-stage {
    position: fixed !important;
    inset: 0 !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    width: 100vw !important;
    width: 100% !important;
    height: 100vh !important;
    height: 100dvh !important;
    min-height: 100vh !important;
    min-height: 100dvh !important;
    max-height: none !important;
    max-width: none !important;
    min-width: 100vw !important;
    z-index: 999999 !important;
    background: #000000 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    margin: 0 !important;
    padding: 0 !important;
}

#cinema-stage.mobile-fullscreen #main-player,
body.is-fullscreen #cinema-stage #main-player {
    width: 100% !important;
    height: 100% !important;
    max-width: 100vw !important;
    max-height: 100vh !important;
    max-height: 100dvh !important;
    object-fit: contain !important;
}

#cinema-stage.mobile-fullscreen #player-hud,
body.is-fullscreen #cinema-stage #player-hud {
    position: absolute !important;
    bottom: 0 !important;
    left: 0 !important;
    right: 0 !important;
    z-index: 100 !important;
}

body.is-fullscreen {
    overflow: hidden !important;
}
body.is-fullscreen #top-bar,
body.is-fullscreen #room-sidebar {
    display: none !important;
}

#cinema-stage {
    touch-action: manipulation;
}

/* Unmute Banner Floating Top Pill */
#unmute-banner,
.floating-unmute-banner {
    position: absolute !important;
    top: 1.25rem !important;
    left: 50% !important;
    transform: translateX(-50%) !important;
    z-index: 45 !important;
    background: linear-gradient(135deg, #e11d48, #6366f1) !important;
    color: #ffffff !important;
    font-size: 0.8125rem !important;
    font-weight: 700 !important;
    padding: 0.6rem 1.35rem !important;
    border-radius: 9999px !important;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5), 0 0 20px rgba(99, 102, 241, 0.5) !important;
    border: 1px solid rgba(255, 255, 255, 0.3) !important;
    cursor: pointer !important;
    display: flex !important;
    align-items: center !important;
    gap: 0.6rem !important;
    user-select: none;
    -webkit-user-select: none;
    animation: gentle-bounce 2s infinite ease-in-out;
    transition: all 0.2s ease;
}

#unmute-banner:hover,
.floating-unmute-banner:hover {
    transform: translateX(-50%) scale(1.05) !important;
    box-shadow: 0 12px 35px rgba(0, 0, 0, 0.6), 0 0 25px rgba(99, 102, 241, 0.7) !important;
}

#unmute-banner.hidden,
.floating-unmute-banner.hidden {
    display: none !important;
}

@keyframes gentle-bounce {
    0%, 100% {
        transform: translateX(-50%) translateY(0);
    }
    50% {
        transform: translateX(-50%) translateY(-6px);
    }
}

/* Double-Tap Skip Feedback Overlays (YouTube / Aparat Style) */
.skip-feedback-overlay {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 35%;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 28;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
}
.skip-feedback-overlay.skip-left {
    left: 0;
    border-top-left-radius: 1rem;
    border-bottom-left-radius: 1rem;
    background: radial-gradient(circle at left center, rgba(255, 255, 255, 0.15) 0%, transparent 70%);
}
.skip-feedback-overlay.skip-right {
    right: 0;
    border-top-right-radius: 1rem;
    border-bottom-right-radius: 1rem;
    background: radial-gradient(circle at right center, rgba(255, 255, 255, 0.15) 0%, transparent 70%);
}
.skip-feedback-overlay.active {
    opacity: 1;
    animation: skip-pop 0.5s ease forwards;
}
.skip-pill {
    background: rgba(15, 23, 42, 0.88);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #ffffff;
    font-size: 0.875rem;
    font-weight: 700;
    padding: 0.55rem 0.95rem;
    border-radius: 9999px;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    display: flex;
    align-items: center;
    gap: 0.4rem;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.6);
}
@keyframes skip-pop {
    0% { transform: scale(0.85); opacity: 0; }
    30% { transform: scale(1.08); opacity: 1; }
    80% { transform: scale(1); opacity: 1; }
    100% { transform: scale(0.95); opacity: 0; }
}

/* Left-Side Interactive Notification Toast Card (Compact & Non-Intrusive) */
.left-msg-toast {
    pointer-events: auto;
    width: 14.5rem;
    max-width: 78vw;
    background: rgba(11, 14, 22, 0.88);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 0.85rem;
    padding: 0.5rem 0.75rem;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.6);
    user-select: none;
    touch-action: pan-y;
    transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.25s ease;
    cursor: grab;
}

.left-msg-toast.dragging {
    transition: none !important;
    cursor: grabbing;
}

.left-msg-toast.swiped-away {
    opacity: 0 !important;
    transform: translateX(-120%) !important;
    transition: transform 0.3s ease-out, opacity 0.3s ease-out !important;
}

.left-msg-toast.celebrate {
    border-color: rgba(245, 158, 11, 0.4);
    background: rgba(20, 24, 38, 0.95);
}

/* In-Chat Message Reaction Pills */
.msg-reactions-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem;
    margin-top: 0.25rem;
}

.msg-reaction-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 9999px;
    padding: 0.125rem 0.45rem;
    font-size: 0.6875rem;
    color: #cbd5e1;
    cursor: pointer;
    transition: all 0.15s ease;
}

.msg-reaction-pill:hover {
    background: rgba(255, 255, 255, 0.12);
    transform: scale(1.05);
}

.msg-reaction-pill.mine {
    background: rgba(99, 102, 241, 0.25);
    border-color: rgba(99, 102, 241, 0.5);
    color: #c7d2fe;
    font-weight: 700;
}

.msg-inline-picker {
    display: none;
    position: absolute;
    top: -0.9rem;
    align-items: center;
    gap: 0.2rem;
    background: rgba(13, 16, 26, 0.96);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 9999px;
    padding: 0.15rem 0.45rem;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.6);
    z-index: 20;
    white-space: nowrap;
}

.chat-bubble-wrap:hover .msg-inline-picker,
.chat-bubble-wrap:focus-within .msg-inline-picker {
    display: flex;
}

/* Responsive Layout for Mobile Devices (< 768px) */
@media (max-width: 768px) {
    #app-container {
        height: 100vh;
        height: 100dvh;
    }

    #top-bar {
        height: auto;
        min-height: 3rem;
        padding: 0.4rem 0.6rem;
    }

    #room-name-display {
        max-width: 85px;
        font-size: 0.75rem;
    }

    main {
        flex-direction: column !important;
        overflow: hidden;
    }

    #cinema-stage:not(.mobile-fullscreen) {
        flex: none !important;
        width: 100% !important;
        height: 35vh !important;
        min-height: 190px !important;
        max-height: 42vh !important;
        background: #000;
    }

    #cinema-stage.mobile-fullscreen,
    body.is-fullscreen #cinema-stage,
    #cinema-stage:fullscreen {
        position: fixed !important;
        inset: 0 !important;
        top: 0 !important;
        left: 0 !important;
        right: 0 !important;
        bottom: 0 !important;
        width: 100vw !important;
        height: 100vh !important;
        height: 100dvh !important;
        min-height: 100vh !important;
        min-height: 100dvh !important;
        max-height: none !important;
        max-width: none !important;
        z-index: 999999 !important;
    }

    #cinema-stage:-webkit-full-screen {
        position: fixed !important;
        inset: 0 !important;
        top: 0 !important;
        left: 0 !important;
        right: 0 !important;
        bottom: 0 !important;
        width: 100vw !important;
        height: 100vh !important;
        height: 100dvh !important;
        min-height: 100vh !important;
        min-height: 100dvh !important;
        max-height: none !important;
        max-width: none !important;
        z-index: 999999 !important;
    }

    #room-sidebar {
        flex: 1 1 0% !important;
        width: 100% !important;
        max-width: 100% !important;
        height: auto !important;
        border-right: none !important;
        border-top: 1px solid rgba(255, 255, 255, 0.1) !important;
        display: flex !important;
    }

    #room-sidebar.hidden {
        display: none !important;
    }

    #quick-reactions {
        bottom: 4.5rem;
        right: 0.5rem;
    }

    #left-notifications-container {
        bottom: 4.5rem;
        left: 0.5rem;
        max-width: calc(100vw - 4.5rem);
    }

    .player-hud {
        padding: 0.35rem 0.5rem;
    }

    .timeline-wrap {
        margin-bottom: 0.25rem !important;
    }

    #video-empty-state {
        padding: 1rem !important;
    }

    #video-empty-state h2 {
        font-size: 1rem !important;
    }
}

